{"id":23263170,"url":"https://github.com/wavesplatform/provider-metamask","last_synced_at":"2025-08-20T18:34:59.664Z","repository":{"id":38683301,"uuid":"402757401","full_name":"wavesplatform/provider-metamask","owner":"wavesplatform","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-01T15:06:55.000Z","size":197,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-29T20:18:43.931Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wavesplatform.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-03T12:08:36.000Z","updated_at":"2022-08-27T15:57:22.000Z","dependencies_parsed_at":"2023-01-21T05:03:58.177Z","dependency_job_id":null,"html_url":"https://github.com/wavesplatform/provider-metamask","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fprovider-metamask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fprovider-metamask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fprovider-metamask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fprovider-metamask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesplatform","download_url":"https://codeload.github.com/wavesplatform/provider-metamask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445917,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-19T14:15:04.025Z","updated_at":"2024-12-19T14:15:04.500Z","avatar_url":"https://github.com/wavesplatform.png","language":"TypeScript","readme":"# ProviderMetamask\n\n* [Overview](#overview)\n* [Getting Started](#getting-started)\n\n\u003ca id=\"overview\"\u003e\u003c/a\u003e\n## Overview\n\nProviderMetamask\n\n\u003ca id=\"getting-started\"\u003e\u003c/a\u003e\n## Getting Started\n\n### 1. Library installation\n\nTo install Signer and ProviderMetamask libraries use\n\n```bash\nnpm i @waves/signer @waves/provider-metamask\n```\n\n### 2. Library initialization\n\nAdd library initialization to your app.\n\n* For Stagenet:\n\n\t```js\n\timport { Signer } from '@waves/signer';\n\timport { ProviderMetamask } from '@waves/provider-metamask';\n\n\tconst signer = new Signer({\n\t\t// Specify URL of the node on Stagenet\n\t\tNODE_URL: 'https://nodes-stagenet.wavesnodes.com'\n\t});\n\tconst provider = new ProviderMetamask({\n\t\twavesConfig: {\n\t\t\tnodeUrl: 'https://nodes-stagenet.wavesnodes.com',\n\t\t\tchainId: 'S'.charCodeAt(0)\n\t\t}\n\t});\n\tsigner.setProvider(provider);\n\t```\n\n* For Mainnet:\n\n\t```js\n\timport { Signer } from '@waves/signer';\n\timport { ProviderMetamask } from '@waves/provider-metamask';\n\n\tconst signer = new Signer();\n\tconst provider = new ProviderMetamask();\n\tsigner.setProvider(provider);\n\t```\n\n### 3. Basic example\n\nNow your application is ready to work with Waves Platform. Let's test it by implementing basic functionality. For example, we could try to authenticate user and transfer funds.\n\n```js\nconst user = await signer.login();\nconst [transfer] = await signer\n  .transfer({\n\tamount: 1,\n\trecipient: 'alias:T:merry',\n  })\n  .broadcast();\n```\n\n```js\nconst user = await signer.login();\nconst [invoke] = await signer\n  .invoke({\n\tdApp: \"3F4bY4PsS8E1tShx9ruSYthie3uzYiSffSv\",\n\tcall:{\n\t\t function: \"deposit\",\n\t\t args:[{ type: \"string\", value: \"string\" }]\n\t},\n\tpayment:[]\n  })\n  .broadcast();\n```\n\nFor more information see [Signer documentation](https://github.com/wavesplatform/signer/blob/master/README.md).\n\n### 4. How to sign order\n\nSet the order parameters:\n- Omit senderPublicKey.\n- Specify asset IDs in Waves format: 32 bytes in base58. For WAVES use the string WAVES.\n\n```js\nconst orderData = {\n  orderType: 'sell',\n  version: 4,\n  assetPair: {\n\tamountAsset: '8KTfWNoWYf9bP3hg1QYBLpkk9tgRb5wiUZnT1HUiNa9r',\n\tpriceAsset: 'WAVES',\n  },\n  price: 100000,\n  amount: 100000,\n  timestamp: 1634563969123,\n  expiration: 1637069590926,\n  matcherFee: 300000,\n  matcherFeeAssetId: null,\n};\nconst provider = new ProviderMetamask();\nconst sign = await provider.signOrder(orderData);\n```\n\n### 5. How to get Ethereum address\n\n```js\nimport { ProviderMetamask } from '@waves/provider-metamask';\nimport { wavesAddress2eth } from '@waves/node-api-js';\n\nconst user = await signer.login();\nconst ethereumAddress = wavesAddress2eth(user.address);\n```\n\n### 6. How to sign message\n\n```js\nconst message = 'message text';\nconst provider = new ProviderMetamask();\nconst sign = await provider.signMessage(message);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fprovider-metamask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesplatform%2Fprovider-metamask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fprovider-metamask/lists"}