{"_id":"@ckb-connect/walletconnect-wallet-sdk","_rev":"2-449f2187ff406ec691084dda9a147d90","name":"@ckb-connect/walletconnect-wallet-sdk","dist-tags":{"latest":"0.0.1-alpha.2"},"versions":{"0.0.1-alpha.0":{"name":"@ckb-connect/walletconnect-wallet-sdk","version":"0.0.1-alpha.0","homepage":"https://github.com/Magickbase/ckb-wallet-connect","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"repository":{"type":"git","url":"git+https://github.com/Magickbase/ckb-wallet-connect.git"},"bugs":{"url":"https://github.com/Magickbase/ckb-wallet-connect/issues"},"scripts":{"start":"tsdx watch --target node","build":"tsdx build --target node","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build --target node","size":"size-limit","analyze":"size-limit --why"},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"module":"dist/ckb-walletconnect-wallet-sdk.esm.js","devDependencies":{"husky":"8.0.3","tsdx":"0.14.1","tslib":"2.6.2","typescript":"5.0.4","vitest":"0.34.4"},"dependencies":{"@types/events":"^3.0.1","@walletconnect/jsonrpc-utils":"1.0.8","@walletconnect/types":"2.10.0","@walletconnect/utils":"2.10.0","@walletconnect/web3wallet":"1.9.0","events":"^3.3.0","lokijs":"^1.5.12"},"publishConfig":{"access":"public"},"gitHead":"2451e603c2a4497f87f0698a36af18ffb1e36edf","description":"## Description","_id":"@ckb-connect/walletconnect-wallet-sdk@0.0.1-alpha.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-RGpDGkaOuNXO4DBB0ieHUym4Dh9WIldPE93MD8KtDanlAEoB3ut/lvESWm7KZUhbvGT12xhkuqnp3nz9FlYhdA==","shasum":"44a770540aca7fc0c915fba00a64684383ba582d","tarball":"https://registry.npmjs.org/@ckb-connect/walletconnect-wallet-sdk/-/walletconnect-wallet-sdk-0.0.1-alpha.0.tgz","fileCount":20,"unpackedSize":94767,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNNU/VJGq+k1mOIV7kFPyEV2478vjGoyghBY3furF4mgIhAK3DtzSBvKTLf7o9doiHgcGiaUO6vTZ6YOI8hw14DJrs"}]},"_npmUser":{"name":"echo_fefe","email":"547618466@qq.com"},"directories":{},"maintainers":[{"name":"echo_fefe","email":"547618466@qq.com"},{"name":"keith_chen","email":"keithwhisper@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/walletconnect-wallet-sdk_0.0.1-alpha.0_1699407828037_0.915303036568557"},"_hasShrinkwrap":false},"0.0.1-alpha.1":{"name":"@ckb-connect/walletconnect-wallet-sdk","version":"0.0.1-alpha.1","homepage":"https://github.com/Magickbase/ckb-wallet-connect","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"repository":{"type":"git","url":"git+https://github.com/Magickbase/ckb-wallet-connect.git"},"bugs":{"url":"https://github.com/Magickbase/ckb-wallet-connect/issues"},"scripts":{"start":"tsdx watch --target node","build":"tsdx build --target node","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build --target node","size":"size-limit","analyze":"size-limit --why"},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"module":"dist/walletconnect-wallet-sdk.esm.js","devDependencies":{"husky":"8.0.3","tsdx":"0.14.1","tslib":"2.6.2","typescript":"5.0.4","vitest":"0.34.4"},"dependencies":{"@types/events":"^3.0.1","@walletconnect/jsonrpc-utils":"1.0.8","@walletconnect/types":"2.10.0","@walletconnect/utils":"2.10.0","@walletconnect/web3wallet":"1.9.0","events":"^3.3.0","lokijs":"^1.5.12"},"publishConfig":{"access":"public"},"gitHead":"58aaec9119b2cb65b0e174743d30eb20a4f14b27","description":"## Description","_id":"@ckb-connect/walletconnect-wallet-sdk@0.0.1-alpha.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-OehGBaEmtRbCOdVvRXxFjc29lPqPf6qZinyzHetcSC8Oz+YqFFHIJiuCmtH23M98aZFDDxMc95al2iiaCswu4w==","shasum":"b45875cd48b2404da3575a45c701787efe462e87","tarball":"https://registry.npmjs.org/@ckb-connect/walletconnect-wallet-sdk/-/walletconnect-wallet-sdk-0.0.1-alpha.1.tgz","fileCount":20,"unpackedSize":94790,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDWBzt0f7kbtqID8vRsa/ifsMYJ0O8/E2YKYC8fyrqzEAiB/mHoCkkXqWJl9OJH0Qtkpafxf6TZJz7NgVaHnk4sHBw=="}]},"_npmUser":{"name":"echo_fefe","email":"547618466@qq.com"},"directories":{},"maintainers":[{"name":"echo_fefe","email":"547618466@qq.com"},{"name":"keith_chen","email":"keithwhisper@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/walletconnect-wallet-sdk_0.0.1-alpha.1_1699409345883_0.2070919611302009"},"_hasShrinkwrap":false},"0.0.1-alpha.2":{"name":"@ckb-connect/walletconnect-wallet-sdk","version":"0.0.1-alpha.2","homepage":"https://github.com/Magickbase/ckb-wallet-connect","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"repository":{"type":"git","url":"git+https://github.com/Magickbase/ckb-wallet-connect.git"},"bugs":{"url":"https://github.com/Magickbase/ckb-wallet-connect/issues"},"scripts":{"start":"tsdx watch --target node","build":"tsdx build --target node","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build --target node","size":"size-limit","analyze":"size-limit --why"},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"module":"dist/walletconnect-wallet-sdk.esm.js","devDependencies":{"husky":"8.0.3","tsdx":"0.14.1","tslib":"2.6.2","typescript":"5.0.4","vitest":"0.34.4"},"dependencies":{"@types/events":"^3.0.1","@walletconnect/jsonrpc-utils":"1.0.8","@walletconnect/types":"2.10.0","@walletconnect/utils":"2.10.0","@walletconnect/web3wallet":"1.9.0","events":"^3.3.0","lokijs":"^1.5.12"},"publishConfig":{"access":"public"},"_id":"@ckb-connect/walletconnect-wallet-sdk@0.0.1-alpha.2","gitHead":"5e053771eff15277bf5480b505856bcb4e8a558b","description":"## Description","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-eWV+yNhlCDFRTi9sFUwjwW4KeXNgr4RWb4eWOaZZhXYzt/wPKlpMRGcGyCkh4IiMGZ8mt1GLPQltDcyyMg7W4w==","shasum":"70bc9e8355be973f2701c2f11fa8e12245d4b866","tarball":"https://registry.npmjs.org/@ckb-connect/walletconnect-wallet-sdk/-/walletconnect-wallet-sdk-0.0.1-alpha.2.tgz","fileCount":20,"unpackedSize":94685,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICNFRc7Kh5MeDhmefl8JdIc1XdmdC0ybSlsMawReoqeOAiA9Z7QtTqsCK1JGc2O1L8XI7enKi4empOVWA001YivOzQ=="}]},"_npmUser":{"name":"echo_fefe","email":"547618466@qq.com"},"directories":{},"maintainers":[{"name":"echo_fefe","email":"547618466@qq.com"},{"name":"keith_chen","email":"keithwhisper@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/walletconnect-wallet-sdk_0.0.1-alpha.2_1701416506517_0.7163488620234619"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-08T01:43:47.885Z","0.0.1-alpha.0":"2023-11-08T01:43:48.221Z","modified":"2023-12-01T07:41:46.976Z","0.0.1-alpha.1":"2023-11-08T02:09:06.077Z","0.0.1-alpha.2":"2023-12-01T07:41:46.748Z"},"maintainers":[{"name":"echo_fefe","email":"547618466@qq.com"},{"name":"keith_chen","email":"keithwhisper@gmail.com"}],"description":"## Description","homepage":"https://github.com/Magickbase/ckb-wallet-connect","repository":{"type":"git","url":"git+https://github.com/Magickbase/ckb-wallet-connect.git"},"bugs":{"url":"https://github.com/Magickbase/ckb-wallet-connect/issues"},"license":"MIT","readme":"# @ckb-connect/walletconnect-wallet-sdk\n\n## Description\n\nAn auxiliary library built on top of WalletConnect which wraps the protocol for integration within the CKB ecosystem.\n\n## Getting Started\n\n### Install\n\n```\nnpm install @ckb-connect/walletconnect-wallet-sdk\n```\n\n### Usage\n\n- Initialization\n\n```javascript\nimport { Core } from \"@walletconnect/core\";\nimport { CkbWallet, getSdkError, CKBWalletAdapter, GetAddressesParams, SignTransactionParams, SignMessageParams } from \"@ckb-connect/walletconnect-wallet-sdk\";\n\nclass Adapter implements CKBWalletAdapter {\n  async ckb_getAddresses(params: GetAddressesParams) {\n    // ...\n  }\n\n  async ckb_signTransaction(params: SignTransactionParams) {\n    // ...\n  }\n\n  async ckb_signMessage(params: SignMessageParams) {\n    // ...\n  }\n}\n\nconst core = new Core({\n  projectId: process.env.PROJECT_ID,\n});\n\nconst walletSDK = await CkbWallet.init({\n  core, \n  metadata: {\n    name: \"MyWalletnName\",\n    description: \"My Wallet description\",\n    url: \"https://mywalletdescription.com\",\n    icons: [\"https://mywalletdescription.com/mywalleticon.png\"],\n  },\n  adapter: new Adapter()\n});\n```\n\n- Connect\n\n```javascript\nawait walletSDK.connect(uri);\n```\n- Proposals\n\n```javascript\nconst proposals = walletSDK.proposals\n```\n\n- Sessions\n\n```javascript\nconst sessions = walletSDK.sessions\n```\n\n- Session Requests\n\n```javascript\nconst requests = walletSDK.requests()\n```\n\n- Session Approval\n\n```javascript\nconst session = await walletSDK.approve({\n  id: proposal.id,\n  chain: 'testnet',\n  identity: 'xxxxxxxxxx',\n  scriptBases:  ['0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8']\n});\n```\n\n- Session Rejection\n\n```javascript\nconst session = await walletSDK.reject(proposal.id);\n```\n\n- Session Disconnect\n\n```javascript\nawait walletSDK.disconnect(session.topic);\n```\n\n- Responding to Session Requests\n\n```javascript\n// Approve\nawait walletSDK.approveRequest(request);\n\n// or Reject\nawait walletSDK.rejectRequest(request);\n\n```\n\n- Change Account\n\n```javascript\nwalletSDK.changeAccount('xxxxxxxxxx');\n```\n\n- Handle Events\n\n```javascript\nwalletSDK.emitter.on(\"proposals\", handler);\nwalletSDK.emitter.on(\"sessions\", handler);\nwalletSDK.emitter.on(\"requests\", handler);\n```\n","readmeFilename":"README.md"}