cosmology-tech / cosmos-kit

Universal wallet connector for the Cosmos ⚛️
https://cosmology.zone/products/cosmos-kit
BSD 3-Clause Clear License
182 stars 132 forks source link

Feature Add leap social login #374

Closed leapsamvel closed 9 months ago

liujun93 commented 10 months ago

@leapsamvel Can you add doc for this new wallet? https://docs.cosmoskit.com/integrating-wallets/adding-new-wallets#6%EF%B8%8F%E2%83%A3-dont-forget-to-update-docs

liujun93 commented 10 months ago

@leapsamvel I also met this error trying to test leap social login.

import Capsule, { CapsuleAminoSigner, Environment } from '@leapwallet/capsule-web-sdk-lite';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1153:20)
    at Module._compile (node:internal/modules/cjs/loader:1205:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at mod.require (/Users/june/code/cosmos-kit/node_modules/next/dist/server/require-hook.js:64:28)
    at require (node:internal/modules/helpers:130:18)
    at @leapwallet/cosmos-social-login-capsule-provider (/Users/june/code/cosmos-kit/packages/example/.next/server/pages/_app.js:1275:18)
    at __webpack_require__ (/Users/june/code/cosmos-kit/packages/example/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///../../wallets/leap-social-login/cjs/main-wallet.js:9:48)
    at ../../wallets/leap-social-login/cjs/main-wallet.js (/Users/june/code/cosmos-kit/packages/example/.next/server/pages/_app.js:1177:1)
    at __webpack_require__ (/Users/june/code/cosmos-kit/packages/example/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///../../wallets/leap-social-login/cjs/index.js:26:14)
 ⨯ /Users/june/code/cosmos-kit/node_modules/@leapwallet/cosmos-social-login-capsule-provider/dist/index.js:10

I cannot add "type": "module" in my package because it'll cause other errors. So it seems the only solution is publishing @leapwallet/cosmos-social-login-capsule-provider with additional commonjs type. Or is there any other solutions you suggest?

leapsamvel commented 9 months ago

Are you using next.js app for testing @liujun93 ?

liujun93 commented 9 months ago

Are you using next.js app for testing @liujun93 ?

yes. we're using the example for testing https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/example

leapsamvel commented 9 months ago

Let me add and test it @liujun93 👍