{"id":45591501,"url":"https://github.com/meet-one/meet-js-sdk","last_synced_at":"2026-02-23T12:38:22.031Z","repository":{"id":55346729,"uuid":"197536601","full_name":"meet-one/meet-js-sdk","owner":"meet-one","description":"Library for MEET.ONE wallet client, better Typescript support, better friendly APIs","archived":false,"fork":false,"pushed_at":"2021-01-05T12:07:11.000Z","size":949,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-30T07:41:41.199Z","etag":null,"topics":["cosmos-sdk","eos","eosjs","meet","scatter","wallet"],"latest_commit_sha":null,"homepage":"https://meet-common.gitlab.io/fe/meet-js-sdk/index.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meet-one.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-18T07:36:06.000Z","updated_at":"2021-11-14T17:44:17.000Z","dependencies_parsed_at":"2022-08-14T21:51:04.482Z","dependency_job_id":null,"html_url":"https://github.com/meet-one/meet-js-sdk","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/meet-one/meet-js-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meet-one%2Fmeet-js-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meet-one%2Fmeet-js-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meet-one%2Fmeet-js-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meet-one%2Fmeet-js-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meet-one","download_url":"https://codeload.github.com/meet-one/meet-js-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meet-one%2Fmeet-js-sdk/sbom","scorecard":{"id":634776,"data":{"date":"2025-08-11","repo":{"name":"github.com/meet-one/meet-js-sdk","commit":"96cb27eabd9fce6ff7b22df2d23575b8f02b2229"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"126 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-2mj8-pj3j-h362","Warn: Project is vulnerable to: GHSA-gqf6-75v8-vr26","Warn: Project is vulnerable to: GHSA-v45m-2wcp-gg98","Warn: Project is vulnerable to: GHSA-wrw9-m778-g6mc","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-vfrc-7r7c-w9mx","Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-pc5p-h8pf-mvwp","Warn: Project is vulnerable to: GHSA-x55w-vjjp-222r","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-ch52-vgq2-943f","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-m6cx-g6qm-p2cx","Warn: Project is vulnerable to: GHSA-x8qc-rrcw-4r46","Warn: Project is vulnerable to: GHSA-4328-8hgf-7wjr","Warn: Project is vulnerable to: GHSA-93f3-23rq-pjfp","Warn: Project is vulnerable to: GHSA-jmqm-f2gx-4fjv","Warn: Project is vulnerable to: GHSA-pw54-mh39-w3hc","Warn: Project is vulnerable to: GHSA-xgh6-85xh-479p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-r2j6-p67h-q639","Warn: Project is vulnerable to: GHSA-x6fg-f45m-jf5q","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T08:49:42.480Z","repository_id":55346729,"created_at":"2025-08-21T08:49:42.481Z","updated_at":"2025-08-21T08:49:42.481Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29742922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cosmos-sdk","eos","eosjs","meet","scatter","wallet"],"created_at":"2026-02-23T12:38:21.142Z","updated_at":"2026-02-23T12:38:22.019Z","avatar_url":"https://github.com/meet-one.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# meet-js-sdk\n\n[![npm version](https://badge.fury.io/js/meet-js-sdk.svg)](https://badge.fury.io/js/meet-js-sdk)\n[![js deliver](https://data.jsdelivr.com/v1/package/npm/meet-js-sdk/badge)](https://data.jsdelivr.com/v1/package/npm/meet-js-sdk/badge)\n\n更好的 Typescript 支持, 更好的类型提示, 更友好的 API 接口\n\nBetter Typescript support, Better Intelligent code completion, Better friendly APIs\n\n- [Detail APIs](https://meet-common.gitlab.io/fe/meet-js-sdk/index.html)\n\n\u003c!-- TOC --\u003e\n\n- [meet-js-sdk](#meet-js-sdk)\n  - [Quick Start](#quick-start)\n    - [Browser](#browser)\n  - [Common](#common)\n    - [wallet.isInApp](#walletisinapp)\n    - [wallet.load](#walletload)\n    - [wallet.getAppInfo](#walletgetappinfo)\n    - [wallet.getChainInfo](#walletgetchaininfo)\n    - [wallet.navigate](#walletnavigate)\n    - [wallet.shareText](#walletsharetext)\n    - [wallet.shareImage](#walletshareimage)\n    - [wallet.shareLink](#walletsharelink)\n    - [wallet.webview](#walletwebview)\n    - [wallet.webviewMenu](#walletwebviewmenu)\n    - [wallet.back](#walletback)\n    - [wallet.close](#walletclose)\n    - [wallet.fullScreen](#walletfullscreen)\n    - [wallet.horizontal](#wallethorizontal)\n    - [wallet.gestures](#walletgestures)\n    - [wallet.switchWallet](#walletswitchwallet)\n  - [Plugin](#plugin)\n    - [Eos](#eos)\n      - [plugin.getEos [recommend]](#plugingeteos-recommend)\n      - [plugin.getEos2](#plugingeteos2)\n      - [plugin.sign](#pluginsign)\n      - [plugin.getIdentity](#plugingetidentity)\n      - [plugin.transaction](#plugintransaction)\n      - [plugin.transfer](#plugintransfer)\n    - [Cosmos](#cosmos)\n      - [Identity](#identity)\n        - [plugin.getIdentity](#plugingetidentity-1)\n        - [plugin.account](#pluginaccount)\n      - [Transactions](#transactions)\n        - [plugin.transfer](#plugintransfer-1)\n        - [plugin.delegate / plugin.undelegate](#plugindelegate--pluginundelegate)\n        - [plugin.redelegate](#pluginredelegate)\n        - [plugin.submitProposal](#pluginsubmitproposal)\n        - [plugin.deposit](#plugindeposit)\n        - [plugin.vote](#pluginvote)\n      - [plugin.requestArbitrarySignature](#pluginrequestarbitrarysignature)\n        - [How to sign](#how-to-sign)\n        - [How to verify signature](#how-to-verify-signature)\n      - [Generate Custom Msgs](#generate-custom-msgs)\n  - [Contribute Guide](#contribute-guide)\n    - [Run Unit Test](#run-unit-test)\n    - [Run E2E Test](#run-e2e-test)\n  - [Change Log](#change-log)\n\n\u003c!-- /TOC --\u003e\n\n## Quick Start\n\n### Browser\n\n```js\n// 钱包通用SDK, 可以调用 `Common Module` 内的方法\n// The wallet client common sdk, can invoking `Common Module` functions\nlet wallet = new MeetJS.MeetWallet({ isDebug: true })\n\n// 下面代码展示加载 `Eos` 插件\n// Following the code is showing how to load `Eos` Plugin\nwallet.load(new MeetJS.Eos(wallet, {})).then(({ wallet, plugin }) =\u003e {\n  // callback after plugin loaded success\n  let eos = plugin.getEos() // 此对象的所有签名操作将由钱包来代理 (This object's all about signature operations will be proxied by wallet client)\n  let account = plugin.account // current wallet identity\n\n  eos\n    .transaction({\n      actions: [\n        {\n          account: 'eosio.token',\n          name: 'transfer',\n          authorization: [\n            {\n              actor: account.name, // creator\n              permission: account.authority\n            }\n          ],\n          data: {\n            from: account.name, // creator\n            to: 'g.f.w',\n            quantity: '0.0001 EOS',\n            memo: 'meet-js-sdk signProvider'\n          }\n        }\n      ],\n      options: {\n        broadcast: true\n      }\n    })\n    .then(res =\u003e {\n      // if success, you will get `res.transaction_id`\n    })\n})\n```\n\n## Common\n\n### wallet.isInApp\n\n判断当前浏览器环境是否在 MEET.ONE 客户端内\n\ndetect current enviroment is in MEET.ONE client or not\n\n```js\nwallet = new MeetJS.MeetWallet({ isDebug: true }).isInApp(result =\u003e {\n  alert(result) // true - in MEET.ONE Dapps Browsers; false - not in MEET.ONE Dapps Browsers\n})\n```\n\n### wallet.load\n\n```\nwallet.load(Plugin)\n```\n\n**Parameters**\n\nPlugin:Object - [EOS](#eosplugin), [Cosmos](#cosmosplugin):\n\n加载对应的插件[Plugin](#Plugin), 例如:\n\nShow how to load specific plugin, for example:\n\n1. [EOS](#eosplugin)\n\n   `new MeetJS.Eos(wallet: MeetWallet, options?: { protocol: string, host: string, port: number, chainId: string })`\n\n2. [Cosmos](#cosmosplugin)\n\n   `new MeetJS.Cosmos(wallet: MeetWallet, options?: { protocol: string; host: string; port: number; address: string; SYSToken?: string })`\n\n### wallet.getAppInfo\n\n```\nwallet.getAppInfo(forceUpdate)\n```\n\n获取当前 APP 客户端信息\n\nGet informations about client\n\n\u003e 初始化 SDK 会自动调用\n\n**Parameters**\n\nforceUpdate - boolean\n\n- true - 每次都调用协议获取 attemp to update everytimes\n- false - 优先从缓存中获取 get it first from cache\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nawait wallet.getAppInfo(true)\n\nPromise \u003e\u003e\u003e\n  {\n    code: 0,\n    type: 0,\n    data: {\n      appVersion: '2.6.0',\n      isMeetOne: true,\n      language: 'zh-Hans',\n      platform: 'iOS'\n    }\n  }\n\n// 也可以直接从wallet属性上获取\n// You can get `appInfo` from `wallet` property direct\nconsole.log(wallet.appInfo)\n```\n\n### wallet.getChainInfo\n\n```\nwallet.getChainInfo(forceUpdate?: boolean)\n```\n\n查询客户端当前所选中的网络, 节点信息\n\nGet the current network information(about the user choosed blockchain network)\n\n\u003e 初始化 SDK 会自动调用, 根据协议返回的内容做了一层兼容性封装, 如果想要获取最原始的客户端返回数据, 请调用 `wallet.getNodeInfo()`\n\n**Parameters**\n\nforceUpdate - boolean\n\n- true - 每次都调用协议获取 attemp to update everytimes\n- false - 优先从缓存中获取 get it first from cache\n\n**Returns**\n\n```js\nthis.nodeInfo = {\n  blockchain: string // blockchain type\n  chainId: string // blockchain chainId\n  host: string // hostname\n  port: number // port, 默认为80\n  protocol: string // protocol, default is http\n}\n```\n\n**Example**\n\n```js\nawait this.getChainInfo(true)\nPromise \u003e\u003e\u003e\n  {\n    blockchain: 'eos',\n    chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906',\n    host: 'mainnet.shareeos.com',\n    port: 443,\n    protocol: 'https'\n  }\n// 也可以直接从wallet属性上获取\n// You can also get `nodeInfo` from `wallet` property direct\nconsole.log(wallet.nodeInfo)\n```\n\n### wallet.navigate\n\n```\nwallet.navigate(target, external?: boolean, options?)\n```\n\n跳转到指定页面中 Jump to the specified page\n\n**Parameters**\n\n- target: string 指定的页面名称 (The specified page name)\n- external? boolean - 是否从外部唤起客户端(is call MEET.ONE client from external browser)\n- options?: Object 传递给页面的参数 (The parameters will pass to specified page)\n\n**Returns**\n\n``ClientResponse\n\n**Example**\n\n```js\n// 成功跳转\n// successful\nawait wallet.navigated('EOSNodeVoteProxyPage', wallet.isExternal)\n// Success[in MEET.ONE dapps browser]\nPromise \u003e\u003e\u003e\n{\n  code: 0,\n  type: 0,\n  data: {}\n}\n\n// Success[in External browser, will attemp to call MEET.ONE client]\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{\n  code: 0,\n  data: {\n    message: 'Call the App from external'\n  }\n}\n\n// 找不到页面\n// not found\nawait wallet.navigate('undefinedView', undefined)\nPromise \u003e\u003e\u003e\n{\n  code: 404,\n  type: 404,\n  data: {\n    message: '协议或目标找不到' // protocol or target undefined\n  }\n}\n```\n\n### wallet.shareText\n\n```\nwallet.shareText(content: string)\n```\n\n分享文本 Share Text Content\n\n**Parameters**\n\ncontent: string - 分享的文本内容 The share content\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nawait wallet.shareText('I am the description')\n\n// 分享成功[弹窗出来后点击对应的图标]的回调\n// Share success\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{\n  code: 0,\n  type: 0,\n  data: {\n    channel: 1 // 1 - 微信(wechat); 2 - 朋友圈(wechat moment); 3 - QQ; 4 - 微博(weibo); 5 - Facebook; 6 - Telegram\n  }\n}\n\n// 分享取消的回调\n// Share canceled\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{\n  code: 999,\n  type: 999,\n  data: {message: '操作取消'}\n}\n\n```\n\n### wallet.shareImage\n\n```\nwallet.shareImage(url: string)\n```\n\n分享图片 Share Picture\n\n**Parameters**\n\nurl - string 图片 URL 地址 (The Picture URL)\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nawait wallet.shareImage(\n  'https://static.ethte.com/meet/static/images/logo-landscape-8c94de9326b1e256dd02213449180174.png'\n)\n\n// 分享成功[弹窗出来后点击对应的图标]的回调\n// Share success\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{\n  code: 0,\n  type: 0,\n  data: {\n    channel: 1 // 1 - 微信; 2 - 朋友圈; 3 - QQ; 4 - 微博; 5 - Facebook; 6 - Telegram\n  }\n}\n\n// 分享取消的回调\n// Share canceled\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{\n  code: 999,\n  type: 999,\n  data: {message: '操作取消'}\n}\n```\n\n### wallet.shareLink\n\n```\nwallet.shareLink(url: string, title: string, description: string)\n```\n\n分享链接 Share Link\n\n**Parameters**\n\nurl: string - 分享的链接地址 (The link about share)\ntitle: string - 分享的标题 (The title about share)\ndescription: string - 分享的描述 (The description about share)\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nawait wallet.shareLink('https://meet.one', '我是标题', '我是描述')\n\n// 分享成功[弹窗出来后点击对应的图标]的回调\n// Share success\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{\n  code: 0,\n  type: 0,\n  data: {\n    channel: 1 // 1 - 微信; 2 - 朋友圈; 3 - QQ; 4 - 微博; 5 - Facebook; 6 - Telegram\n  }\n}\n\n// 分享取消的回调\n// Share canceled\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{\n  code: 999,\n  type: 999,\n  data: {message: '操作取消'}\n}\n```\n\n### wallet.webview\n\n```\nwallet.webview(url: string, external?: boolean)\n```\n\n在应用内打开网页 Open a webpage in client\n\n**Parameters**\n\n- url: string - 要跳转的目标地址 (The webpage url)\n- external? boolean - 是否从外部唤起客户端(is call MEET.ONE client from external browser)\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nawait wallet.webview('https://meet.one', wallet.isExternal)\n// Success[in MEET.ONE dapps browser]\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{\n  code: 0,\n  type: 7,\n  data: {}\n}\n// Success[in External browser, will attemp to call MEET.ONE client]\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{\n  code: 0,\n  data: {\n    message: 'Call the App from external'\n  }\n}\n```\n\n### wallet.webviewMenu\n\n```\nwallet.webviewMenu(rightTitle: string, callback: Function)\n```\n\n自定义当前 webview 右上角菜单名称, 及点击事件\n\nCustom webview's menu button in the upper right corner\n\n**Parameters**\n\nrightTitle: string - 右上角自定义菜单名称 (Custom title)\ncallback: Function - 当点击右上角菜单时执行的回调 (after click will called)\n\n**Returns**\n\nNone\n\n**Example**\n\n```js\nwallet.webviewMenu('custom menu', () =\u003e {\n  alert('you click the menu')\n})\n```\n\n### wallet.back\n\n```\nwallet.back()\n```\n\n后退操作\n\nBack operation\n\n**Parameters**\n\nNone\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nlet response = await wallet.back()\nif (response.code === 0) {\n  success(e)\n} else {\n  failed(e)\n}\n```\n\n### wallet.close\n\n```\nwallet.close()\n```\n\n关闭当前页面\n\nClose current webview\n\n**Parameters**\n\nNone\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nlet response = await wallet.close()\nif (response.code === 0) {\n  success(e)\n} else {\n  failed(e)\n}\n```\n\n### wallet.fullScreen\n\n```\nwallet.fullScreen(isFullScreen: boolean = false)\n```\n\n进入全屏模式\n\nControl fullscreen whether or not\n\n**Parameters**\n\n- isFullScreen\n  - true - fullscreen\n  - false - not fullscreen\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nisFullScreen = !isFullScreen\nlet response = await wallet.fullScreen(isFullScreen)\nif (response.code === 0) {\n  success(e)\n} else {\n  failed(e)\n}\n```\n\n### wallet.horizontal\n\n```\nwallet.horizontal(isHorizontal: boolean = false)\n```\n\n控制 Dapps 浏览器是否水平显示\n\nControl Dapps browser horizontal or vertical\n\n**Parameters**\n\n- isHorizontal\n  - true - 水平显示 Horizontal\n  - false - 正常显示 Vertical(default)\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nlet response = await wallet.horizontal()\nif (response.code === 0) {\n  success(e)\n} else {\n  failed(e)\n}\n```\n\n### wallet.gestures\n\n```\nwallet.gestures(isDisableGestures: boolean = false)\n```\n\n禁止当前页面手势判断操作(当前 webview 中有效)，客户端默认的手势的判断包括: 左滑前进, 右滑后退操作\n\nDisable the left-sliding gesture to forward, right-sliding gesture to back\n\n**Parameters**\n\n- isDisableGestures\n  - true - disable default gestures\n  - false - enable gestures\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nlet response = await wallet.gestures(false)\nif (response.code === 0) {\n  success(e)\n} else {\n  failed(e)\n}\n```\n\n### wallet.switchWallet\n\n```\nwallet.switchWallet(type: string = '')\n```\n\n显示切换钱包的弹窗, 切换后刷新所有 webview\n\nDisplay the popups about wallet switcher, after then reload all webview\n\n**Parameters**\n\ntype: enum['meetone', 'eos', 'bos', 'eth', 'cosmos']\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```\nlet response = await wallet.switchWallet('meetone')\n```\n\n## Plugin\n\n### Eos\n\n客户端已经支持并兼容 Scatter 协议(eosjs@16.0.9, eosjs@20+)\n\nMEET.ONE Wallet have already supported _Scatter Protocols[recommend]_.(eosjs@16.0.9, eosjs@20+)\n\n#### plugin.getEos [recommend]\n\nRequired Version: EosJS \u003e= 16\n\n```\nplugin.getEos(eosOptions?: EosConfig, Eos?: Object\u003cEos\u003e)\n```\n\n使用此方法获取 `Eosjs` 实例, 签名部分由客户端代理(`signProvider`), 客户端只负责对数据做签名\n\n`plugin.getEos()` will return `Eosjs` instance object. All operations which need signature will be proxied by `plugin.signProvider()` and invoke client protocol to sign\n\n返回的 `Eosjs` 实例 API 请参考 [EOSIO/eosjs@16.0.9](https://github.com/EOSIO/eosjs/tree/v16.0.9)\n\n`Eosjs` instance object APIs please refer to [EOSIO/eosjs@16.0.9](https://github.com/EOSIO/eosjs/tree/v16.0.9)\n\n**Parameters**\n\n- eosOptions?: EosConfig - [eosjs - configuration](https://github.com/EOSIO/eosjs/tree/v16.0.9#configuration)\n- Eos?: Object\u003cEos\u003e - 尝试从 `window.Eos`上读取, 如果读取不到或者需要自定义 Eos, 从这里传入(options, default `window.Eos`)\n\n**Example**\n\n```js\nlet eos = plugin.getEos();\neos.transaction({...})\n```\n\n#### plugin.getEos2\n\nRequired Version: EosJS \u003e= 20\n\n```\nplugin.getEos(Api?: object, JsonRpc?: object)\n```\n\n使用此方法获取 `Eosjs` 实例, 签名部分由客户端代理(`signProvider`), 客户端只负责对数据做签名\n\n`plugin.getEos()` will return `Eosjs` instance object. All operations which need signature will be proxied by `plugin.signProvider()` and invoke client protocol to sign\n\n返回的 `Eosjs` 实例 API 请参考 [EOSIO/eosjs@20+](https://eosio.github.io/eosjs/)\n\n`Eosjs` instance object APIs please refer to [EOSIO/eosjs@20+](https://eosio.github.io/eosjs/)\n\n**Example**\n\n```js\n// Browser Distribution\nlet eos = plugin.getEos2(eosjs_api.Api, eosjs_jsonrpc.JsonRpc)\nlet res = await eos.transact({...})\nconst { Api, JsonRpc } = require('eosjs'); // CommonJS\n// import { Api, JsonRpc } from 'eosjs'; // ES Modules\nlet eos = plugin.getEos2(Api, JsonRpc)\nlet res = await eos.transact({...})\n```\n\n#### plugin.sign\n\n```\nplugin.sign(signData: Object)\n```\n\n**Parameters**\n\nsignData: Object | String - 要签名的数据, 如果是 Object 类型的数据, 会自动进行`JSON`序列化 (The object which want to sign, if the data is `Object` will JSON serialization)\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nawait plugin.sign({message: '芝士就是力量'})\n// success\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n{data: {isOwner: true, account: \"johntrump123\", signature: \"SIG_K1_KXbiT3zRZJYjB3FV8xv3qPYjDaBPQbfGiw8ZWwgmEpM…fg4yMazqc2iJycUa4ETtqzbza3HvqVmVBtvuacjcW77G8zgm6\"}, code: 0, type: 6}\n```\n\n#### plugin.getIdentity\n\n获取当前账号信息\n\nGet current account informations\n\n\u003e 初始化 EOS 模块时会默认调用\n\n```\nplugin.getIdentity(foreceUpdate?: boolean)\n```\n\n**Parameters**\n\nforceUpdate - boolean\n\n- true - 每次都调用协议获取 attemp to update everytimes\n- false - 优先从缓存中获取 get it first from cache\n\n**Returns**\n\n```ts\ninterface Account {\n  authority: string, // 权限\n  chainType: string, // EOS链类型, 支持 MEETONE\\EOS\\BOS..\n  name: string, // EOS账号名\n  publicKey: string, // 公钥地址\n  isHardware: boolean, // static\n  kyc: boolean // static\n}\n\nPromise\u003cAccount\u003e\n```\n\n**Example**\n\n```js\nawait plugin.getIdentity()\n\nPromise\u003cAccount\u003e\n\n\u003e\u003e\u003e\n\n{\n  \"authority\": \"active\",\n  \"chainType\": \"eos\",\n  \"name\": \"johntrump123\",\n  \"publicKey\": \"EOS7ukaArHrh4uLVXuauRC1Mjr2zbu1QTv7WQrFEV8rzbaMvv5aPd\",\n  \"isHardware\": false,\n  \"kyc\": false\n}\n\n// 同时更新 `wallet.plugin.account`\nconsole.log(wallet.plugin.account)\n```\n\n#### plugin.transaction\n\n```\nplugin.transaction(\n  actions = [],\n  description = '',\n  options = { broadcast: true }\n)\n```\n\n发送协议给客户端, 将组装的事务交由客户端去签名,推送到链上\n\nPass the transactions and invoke client `sign` protocol, after then push the signature to blockchain\n\n**Parameters**\n\n- actions: Action[] - 要提交的事务操作\n- description?: string 对事务的描述\n- options?: {broadcast: true} - 配置\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n`ClientResponse.data`部分由链上返回, [格式参考](https://gist.github.com/wujunchuan/ee6c5bdcda61e3903c709a2198dcb90e)\n\n**Example**\n\n```js\nlet account = plugin.account\nlet res = await plugin.transaction(\n  [\n    {\n      account: 'eosio.token',\n      name: 'transfer',\n      authorization: [\n        {\n          actor: account.name, // creator\n          permission: account.authority\n        }\n      ],\n      data: {\n        from: account.name, // creator\n        to: 'g.f.w',\n        quantity: '0.0001 EOS',\n        memo: 'js-sdk transaction'\n      }\n    }\n  ],\n  'js-sdk transaction test Description'\n)\n```\n\n#### plugin.transfer\n\n```ts\ninterface TransferOptions {\n  /** 代币名称, 默认为`EOS` */\n  tokenName: string\n  /** 合约账号, 默认为 `eosio.token` */\n  contract: string\n  /** 精度设置, 默认为 4 */\n  precision: number\n}\n\nplugin.transfer(\n  to: string,\n  amount: number,\n  memo = '',\n  orderInfo = '',\n  options?: TransferOptions\n)\n```\n\n发起转账协议, 由客户端签名并发送到链上\n\nInvoke transfer protocol\n\n**Parameters**\n\n- to:string - 转账给`to`目标账号 (transfer target)\n- amount: number - 转账数量 (transfer amount)\n- memo?: string - 转账 Memo, 默认为空 (memo, default is '')\n- orderInfo?: string - 订单信息, 默认为空 (the order description)\n- options?: TransferOptions 转账的配置项 (transfer config options)\n\n**Returns**\n`Promise\u003cClientResponse\u003e`\n\n`ClientResponse.data`部分由链上返回, [格式参考](https://gist.github.com/wujunchuan/ee6c5bdcda61e3903c709a2198dcb90e)\n\n**Example**\n\n```js\nlet res = await plugin.transfer('g.f.w', 0.0001, 'Transfer Memo', 'Order Info')\n```\n\n### Cosmos\n\n#### Identity\n\n获取当前账号的信息\n\n##### plugin.getIdentity\n\n获取账户信息, 初始化时就会自动调用, 如果传入参数为 true, 则每次都去链上更新, 如果为 false 则优先取缓存中的数据\n\nGet current account information.\n\nIf `forceUpdate` is true, will be updated everytime;\n\nIf `forceUpdate` is false, will get in cache first\n\n```ts\ninterface Account {\n  address: string\n  coins: Coin[]\n  public_key: {\n    type: string\n    value: string\n  }\n  account_number: string\n  sequence: string\n}\n\nplugin.getIdentity(forceUpdate?: boolean): Promise\u003cAccount\u003e\n\n```\n\n**Returns**\n\n`Promise\u003cAccount\u003e`\n\n**Example**\n\n```js\nlet res = await plugin.getIdentity(true)\nconsole.log(JSON.stringify(res)) // {address: \"cosmos1jwgdw55ssd3zdwfgm20sh6pc5kmwzfqdg84m4g\", coins: [{denom: \"uatom\", amount: \"402575\"}], public_key: {type: \"tendermint/PubKeySecp256k1\", value: \"AyjefySdsjZ4WzXpTr12x+S2wpy2N+Lk94wdCRsHPw87\"}, account_number: \"12519\", sequence: \"382\"}\n```\n\n##### plugin.account\n\n在 plugin 初始化的时候会自动调用`plugin.getIdentity()`这个方法，并将返回结果附加在属性`account`上\n\n因此可以直接使用`plugin.account`获取, 需要更新再调用 [plugin.getIdentity()](#plugingetidentity-1)\n\nIn this plugin initialization lifecycle will invoke `plugin.getIdentity()`.\n\nSo you can get the account information by `plugin.account`(If need update account information, need invoke [plugin.getIdentity()](#plugingetidentity-1))\n\n#### Transactions\n\n封装好的事务相关操作, 只需要传入对应参数, 即可发送事务到链上\n\n```ts\ninterface CommonTransactionArgs {\n  /** 手续费 */\n  fee: number\n  /** 手续费代币符号, default `this.SYSToken` */\n  feeDenom?: string\n  /** Gas */\n  gas: number\n  /** Memo */\n  memo?: string\n}\n\ninterface BroadcastTxCommitResult {\n  check_tx?: Object\n  deliver_tx?: Object\n  hash: string\n  height: integer\n}\n```\n\n##### plugin.transfer\n\ntype: `cosmos-sdk/MsgSend`\n\n```\nplugin.transfer(input: TransferArgs)\n```\n\n**Parameters**\n\n```ts\ninterface TransferArgs extends CommonTransactionArgs {\n  /** 转账的金额 */\n  amount: number\n  /** 转账代币符号, default `this.SYSToken` */\n  amountDenom?: string\n  /** transfer to */\n  to: string\n  /** transfer from[option] */\n  from?: string\n}\n```\n\n**Returns**\n\n`BroadcastTxCommitResult`\n\nRaw Data\n\nhttps://stargate.cosmos.network/txs/A9FA53852753EC40207858F74CF08B5D91773851A22E86EAFD36F94EECE91BBF\n\n**Example**\n\n```js\nlet ratio = 1000000\nlet res = await plugin.transfer({\n  amount: 1,\n  fee: 0.0015 * ratio,\n  gas: 0.04 * ratio,\n  memo: 'js-sdk test',\n  to: 'cosmos1yqg3xm8ftxm96trp2j3jyknfm4t7tlgwxpgtth'\n})\nif (res.txhash \u0026\u0026 typeof res.code === 'undefined') {\n  // success(e)\n}\n```\n\n##### plugin.delegate / plugin.undelegate\n\n抵押与赎回\n\ntype: `cosmos-sdk/MsgDelegate`\n\ntype: `cosmos-sdk/MsgUndelegate`\n\n```\nplugin.delegate(input: DelegateMsgs)\nplugin.undelegate(input: DelegateMsgs)\n```\n\n**Parameters**\n\n```ts\ninterface DelegateMsgs extends CommonTransactionArgs {\n  /** (取消)抵押的数量 */\n  amount: number | string\n  /** (取消)抵押的代币符号, default `this.SYSToken` */\n  amountDenom?: string\n  delegator_address: string\n  validator_address: string\n}\n```\n\n**Returns**\n\n`BroadcastTxCommitResult`\n\nRaw Data - delegate\n\nhttps://stargate.cosmos.network/txs/0AA58ED1E47915703E06DF46291D664031F889AEBC7A1AA747339A015901B62C\n\nRaw Data - undelegate\n\nhttps://stargate.cosmos.network/txs/040099262917BBAA9A9AFDD54D448D51A085C4D86DDEB7CA70754E9BA9507AE4\n\n**Example**\n\n```js\nlet ratio = 1000000\n\n/** delegate */\nlet res = await plugin.delegate({\n  amount: 1,\n  fee: 0.0015 * ratio,\n  gas: 0.15 * ratio, // 150000\n  memo: 'js-sdk test',\n  delegator_address: meetwallet.plugin.address,\n  validator_address: 'cosmosvaloper1u724thtn8z47nw9nvel367m3qh0gqnxe4g555a'\n})\n\nif (res.txhash \u0026\u0026 typeof res.code === 'undefined') {\n  // success\n}\n\n/** undelegate */\nlet res = await plugin.undelegate({\n  amount: 1,\n  fee: 0.0015 * ratio,\n  gas: 0.15 * ratio, // 150000\n  memo: 'js-sdk test',\n  delegator_address: meetwallet.plugin.address,\n  validator_address: 'cosmosvaloper1u724thtn8z47nw9nvel367m3qh0gqnxe4g555a'\n})\n\nif (res.txhash \u0026\u0026 typeof res.code === 'undefined') {\n  // successs\n}\n```\n\n##### plugin.redelegate\n\ntype: `cosmos-sdk/MsgBeginRedelegate`,\n\n**Parameters**\n\n```ts\ninterface RedelegateArgs extends CommonTransactionArgs {\n  /** (重新)抵押的数量 */\n  amount: number | string\n  /** (重新)抵押的代币符号, default `this.SYSToken` */\n  amountDenom?: string\n  /** 抵押者 */\n  delegator: string\n  /** 打算抵押的 validator cosmos address */\n  to_validator: string\n  /** 原先抵押的 validator cosmos address */\n  from_validator: string\n}\n```\n\n**Returns**\n\n`BroadcastTxCommitResult`\n\nRaw Data\n\nhttps://www.mintscan.io/txs/C7BC679E8F19500D8A47E4FE33B065CD3C73D7D9F730A288B505D21D43308A4F\n\n**Example**\n\n```js\nlet ratio = 1000000\nlet res = await plugin.redelegate({\n  amount: 1,\n  fee: 0.0015 * ratio,\n  gas: 0.22 * ratio, // 150000\n  memo: 'js-sdk test',\n  delegator: meetwallet.plugin.address,\n  to_validator: 'cosmosvaloper1u724thtn8z47nw9nvel367m3qh0gqnxe4g555a',\n  from_validator: 'cosmosvaloper102ruvpv2srmunfffxavttxnhezln6fnc54at8c'\n})\n\nif (res.txhash \u0026\u0026 typeof res.code === 'undefined') {\n  // success(e)\n}\n```\n\n##### plugin.submitProposal\n\n发起提案\n\nCosmos governance explain: https://blog.chorus.one/an-overview-of-cosmos-hub-governance/\n\ntype: `cosmos-sdk/MsgSubmitProposal`\n\n**Parameters**\n\n```ts\ninterface SubmitProposalArgs extends CommonTransactionArgs {\n  /** 标题 */\n  title: string\n  /** 描述 */\n  description: string\n  /** 初始抵押的代币数量 */\n  initialDepositAmount: number | string\n  /** 初始抵押的代币符号, default `this.SYSToken` */\n  initialDepositDenom?: string\n  /** 提案类型, 默认为 `Text` */\n  proposal_type?: string\n  /** 提案人的公钥地址 */\n  proposer: string\n}\n```\n\n**Returns**\n\n`BroadcastTxCommitResult`\n\nRaw Data\n\nhttps://www.mintscan.io/txs/6ce2f9f3457e30641fef714c2b6855d5a095522a9bf46f2aac94fc1e796797b4\n\n**Example**\n\n```js\nlet ratio = 1000000\nlet res = await plugin.submitProposal({\n  fee: 0.0015 * ratio,\n  gas: 0.06 * ratio, // 60000\n  memo: 'js-sdk test',\n  title: 'proposal_title',\n  description: 'proposal_description',\n  initialDepositAmount: 1,\n  proposer: meetwallet.plugin.address\n})\n\nif (res.txhash \u0026\u0026 typeof res.code === 'undefined') {\n  // success(e)\n}\n```\n\n##### plugin.deposit\n\n为提案[DepositPeriod]增加保证金\n\ndeposit for deposit period proposal\n\nCosmos governance explain: https://blog.chorus.one/an-overview-of-cosmos-hub-governance/\n\ntype: `cosmos-sdk/MsgDeposit`\n\n**Parameters**\n\n```ts\ninterface DepositArgs extends CommonTransactionArgs {\n  /** deposit amount */\n  amount: string | number\n  /** Token symbol, default `this.SYSToken` */\n  amountDenom?: string\n  depositor: string\n  proposal_id: string\n}\n```\n\n**Returns**\n\n`BroadcastTxCommitResult`\n\nRaw Data\n\nhttps://www.mintscan.io/txs/1A98D18BF5C0AB6CA09C4222EC0765DB2BB7DF1FC0FBB41F6FBC61B88AC49BDF\n\n**Example**\n\n```js\nlet ratio = 1000000\nlet res = await plugin.deposit({\n  amount: 1,\n  fee: 0.0015 * ratio,\n  gas: 0.22 * ratio, // 22000\n  memo: 'js-sdk test',\n  depositor: meetwallet.plugin.address,\n  proposal_id: 9\n})\n\nif (res.txhash \u0026\u0026 typeof res.code === 'undefined') {\n  // success(e)\n}\n```\n\n##### plugin.vote\n\ntype: `cosmos-sdk/MsgVote`\n\n```\nplugin.transfer(input)\n```\n\n**Parameters**\n\n```ts\ninput:{\n  fee: number | string\n  feeDenom: string\n  gas: number | string\n  memo?: string\n  /** options: [\"Yes\", \"No\", \"No with Veto\", \"Abstain\"] */\n  option: string\n  proposal_id: string | number\n  voter: string\n}\n```\n\n**Returns**\n\n`BroadcastTxCommitResult`\n\nRaw Data\n\nhttps://hubble.figment.network/cosmos/chains/cosmoshub-2/transactions/5DD24DC54660D224F590D089FCEFCFDCC37FC96A9EB009F63F7A87E5D841ED6F\n\n**Example**\n\n```js\nlet ratio = 1000000\nlet res = await plugin.vote({\n  amount: 1,\n  fee: 0.0015 * ratio,\n  gas: 0.025 * ratio, // 25000\n  memo: 'js-sdk test',\n  option: 'Yes', // must be [\"Yes\", \"No\", \"No with Veto\", \"Abstain\"]\n  proposal_id: '10',\n  voter: meetwallet.plugin.address\n})\n\nif (res.txhash \u0026\u0026 typeof res.code === 'undefined') {\n  // success(e)\n}\n```\n\n#### plugin.requestArbitrarySignature\n\n```\nplugin.requestArbitrarySignature(signObject: any)\n```\n\n**Parameters**\n\n**Returns**\n\n`Promise\u003cClientResponse\u003e`\n\n**Example**\n\n```js\nlet signData = 'hello world'\nlet res = await plugin.requestArbitrarySignature(signData)\nPromise\u003cClientResponse\u003e \u003e\u003e\u003e\n\n{\n  code: 0,\n  type: 0,\n  data: {\n    publicKey: 'cosmos1jwgdw55ssd3zdwfgm20sh6pc5kmwzfqdg84m4g',\n    signature: 'a69d3ed83aca5af910de2b05115657bff3ed384750c1aeb7d9bfce4b5bf83f3010714584e1d5a7007db9ede5db4087724fe7c01ac273781f565bfa44d8590448'\n  }\n}\n\n```\n\n##### How to sign\n\n```js\nconst secp256k1 = require('secp256k1') // https://github.com/cryptocoinjs/secp256k1-node\n\nconst hash = crypto\n  .createHash('sha256')\n  .update(signData)\n  .digest('hex')\nconst buf = Buffer.from(hash, 'hex')\n// `ecpairPriv` 为私钥\nlet signObj = secp256k1.sign(buf, ecpairPriv)\n\n// 签名结果\nlet signatureBase64 = Buffer.from(signObj.signature, 'binary').toString('hex')\n```\n\n##### How to verify signature\n\n下面以 `secp256k1-node`库为例\n\n```js\nconst secp256k1 = require('secp256k1') // https://github.com/cryptocoinjs/secp256k1-node\n\n// Public Key Byte\nconst pubKeyByte = secp256k1.publicKeyCreate(ecpairPriv)\n\n// secp256k1.verify(Buffer message, Buffer signature, Buffer publicKey)\nvar isVerify = secp256k1.verify(\n  buf,\n  // signObj.signature,\n  Buffer.from(\n    'a69d3ed83aca5af910de2b05115657bff3ed384750c1aeb7d9bfce4b5bf83f3010714584e1d5a7007db9ede5db4087724fe7c01ac273781f565bfa44d8590448',\n    'hex'\n  ),\n  Buffer.from(pubKeyByte, 'binary')\n)\n\nconsole.log(isVerify) // true\n```\n\n#### Generate Custom Msgs\n\n尽管我们封装了大多数的[COSMOS Transactions](#transactions)便于调用, 但是可能会有一些冷门的 **Transaction**需要开发者自行组装, SDK 暴露了一些基础方法, 方便进行扩展\n\nEven though we have provided mostly [COSMOS Transactions](#transactions) for developers to use.But some special **Transaction** generated by developers, so we export some basic functions for easy to generate custom Msgs.\n\n下面以转账为例\n\nLet's take the transfer as an example.\n\n```ts\nasync customTransfer(input: TransferArgs) {\n  let signObject = await plugin.generateMsg(\n    // Set Fee \u0026 Gas config\n    // fee: { amount: number | string; denom?: string; gas: number | string },\n    { amount: input.fee, denom: input.feeDenom, gas: input.gas },\n    // 最重要的Msgs内容组装 (The Msgs[] here)\n    // msgs: Array\u003c{ type: string; value: object }\u003e,\n    [\n      {\n        type: 'cosmos-sdk/MsgSend', // 类型请参考 `cosmos/go-sdk`\n        value: {\n          amount: [\n            {\n              amount: String(input.amount),\n              denom: input.amountDenom || this.SYSToken\n            }\n          ],\n          from_address: input.from || this.account.address,\n          to_address: input.to\n        }\n      }\n    ],\n    // 每个事务都可以带上memo, 默认为`''`(Every transaction can bring memo, default is `''`)\n    // memo?: string\n    input.memo\n  )\n  // `plugin.signProvider` 会调用客户端协议进行签名, 并且将签名推送到链上(get signature and broadcast)\n  return plugin.signProvider(signObject)\n}\n```\n\n## Contribute Guide\n\n### Run Unit Test\n\n```\ncd meet-js-sdk/\nnpm run test:watch\n```\n\n### Run E2E Test\n\n```\ncd meet-js-sdk/\nnpm run start\nnpx http-server -o -c-1 -p 8081 // http://127.0.0.1:8081/test/e2e/\n```\n\n## Change Log\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeet-one%2Fmeet-js-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeet-one%2Fmeet-js-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeet-one%2Fmeet-js-sdk/lists"}