{"id":14968447,"url":"https://github.com/iamnotstatic/multichain-crypto-wallet","last_synced_at":"2025-04-12T08:13:20.665Z","repository":{"id":38240931,"uuid":"480514215","full_name":"iamnotstatic/multichain-crypto-wallet","owner":"iamnotstatic","description":"A Multichain crypto wallet library that supports Ethereum, Bitcoin, Solana, Tron, Waves and other EVM compatible blockchains E.g. Binance Smart Chain, Polygon, Avalanche etc.","archived":false,"fork":false,"pushed_at":"2025-04-05T16:39:42.000Z","size":615,"stargazers_count":327,"open_issues_count":11,"forks_count":100,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-12T08:13:15.913Z","etag":null,"topics":["avalanche","binance-smart-chain","bitcoin","blockchain","cryptocurrency","cryptography","erc20","erc20-tokens","eth","ethereum","evm","multichain","polygon","solana","trc20","tron","wallet"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/multichain-crypto-wallet","language":"TypeScript","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/iamnotstatic.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-11T19:01:42.000Z","updated_at":"2025-04-12T03:18:23.000Z","dependencies_parsed_at":"2024-06-19T00:23:53.766Z","dependency_job_id":"b28bdde3-d6c6-46b3-9f86-19c2b4c555f1","html_url":"https://github.com/iamnotstatic/multichain-crypto-wallet","commit_stats":{"total_commits":155,"total_committers":7,"mean_commits":"22.142857142857142","dds":"0.19354838709677424","last_synced_commit":"bb71290ca53ebeb6a094b6542a2d6435256a3372"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnotstatic%2Fmultichain-crypto-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnotstatic%2Fmultichain-crypto-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnotstatic%2Fmultichain-crypto-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnotstatic%2Fmultichain-crypto-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamnotstatic","download_url":"https://codeload.github.com/iamnotstatic/multichain-crypto-wallet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537144,"owners_count":21120711,"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":["avalanche","binance-smart-chain","bitcoin","blockchain","cryptocurrency","cryptography","erc20","erc20-tokens","eth","ethereum","evm","multichain","polygon","solana","trc20","tron","wallet"],"created_at":"2024-09-24T13:39:56.193Z","updated_at":"2025-04-12T08:13:20.621Z","avatar_url":"https://github.com/iamnotstatic.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multichain Crypto Wallet\n\nA Multichain crypto wallet library that supports Ethereum, Bitcoin, Solana, Waves and other EVM compatible blockchains E.g. Binance Smart Chain, Polygon, Avalanche etc.\n\n[![Build](https://img.shields.io/github/actions/workflow/status/iamnotstatic/multichain-crypto-wallet/main.yml)](https://github.com/iamnotstatic/multichain-crypto-wallet)\n[![Version](https://img.shields.io/npm/v/multichain-crypto-wallet)](https://github.com/iamnotstatic/multichain-crypto-wallet)\n[![GitHub issues](https://img.shields.io/github/issues/iamnotstatic/multichain-crypto-wallet)](https://github.com/iamnotstatic/multichain-crypto-wallet/issues)\n[![GitHub stars](https://img.shields.io/github/stars/iamnotstatic/multichain-crypto-wallet)](https://github.com/iamnotstatic/multichain-crypto-wallet/stargazers)\n[![GitHub license](https://img.shields.io/github/license/iamnotstatic/multichain-crypto-wallet)](https://github.com/iamnotstatic/multichain-crypto-wallet)\n[![Total Downloads](https://img.shields.io/npm/dm/multichain-crypto-wallet)](https://github.com/iamnotstatic/multichain-crypto-wallet)\n\n## Installation\n\n```bash\nnpm install multichain-crypto-wallet\n```\n\nUsing yarn,\n\n```bash\nyarn add multichain-crypto-wallet\n```\n\n## Usage\n\n### Javascript\n\n```javascript\nconst multichainWallet = require('multichain-crypto-wallet');\n```\n\n### TypeScript\n\n```typescript\nimport * as multichainWallet from 'multichain-crypto-wallet';\n```\n\n## Methods\n\nThe following methods are available with this SDK:\n\n- [Multichain Crypto Wallet](#multichain-crypto-wallet)\n  - [Installation](#installation)\n  - [Usage](#usage)\n    - [Javascript](#javascript)\n    - [TypeScript](#typescript)\n  - [Methods](#methods)\n    - [Generate mnemonic](#generate-mnemonic)\n      - [Response](#response)\n    - [Create Wallet](#create-wallet)\n      - [Response](#response)\n    - [Get Balance](#get-balance)\n      - [Native coins](#native-coins)\n      - [Tokens](#tokens)\n      - [Response](#response-1)\n    - [Generate Wallet from Mnemonic](#generate-wallet-from-mnemonic)\n      - [Response](#response-2)\n    - [Get Address from Private Key](#get-address-from-private-key)\n      - [Response](#response-3)\n    - [Get Transaction](#get-transaction)\n      - [Response](#response-4)\n    - [Transfer](#transfer)\n      - [Ethereum Network](#ethereum-network)\n      - [Response](#response-5)\n      - [Bitcoin Network](#bitcoin-network)\n      - [Response](#response-6)\n      - [Solana Network](#solana-network)\n      - [Response](#response-7)\n      - [Waves Network](#waves-network)\n      - [Response](#response-8)\n      - [Tron Network](#tron-network)\n      - [Response](#response-9)\n    - [Encryptions](#encryptions)\n      - [Encrypt Private Key](#encrypt-private-key)\n      - [Response](#response-10)\n      - [Decrypt Encrypted JSON](#decrypt-encrypted-json)\n      - [Response](#response-11)\n    - [Token Info](#token-info)\n      - [Get ERC20 Token Info](#get-erc20-token-info)\n      - [Response](#response-12)\n      - [Get SPL Token Info](#get-spl-token-info)\n      - [Response](#response-13)\n      - [Get Waves Token Info](#get-waves-token-info)\n      - [Response](#response-14)\n      - [Get TRC20 Token Info](#get-tron-token-info)\n      - [Response](#response-15)\n    - [Smart Contract Call](#smart-contract-call)\n      - [Ethereum network](#ethereum-network-1)\n      - [Waves network](#waves-network-1)\n      - [Tron network](#tron-network-1)\n      - [Response](#response-17)\n    - [Want to contribute?](#want-to-contribute)\n\n### Generate mnemonic\n\nThis method is used to generate mnemonic. Default number of words is `12` but you can pass a number param if you want to generate more or less.\n\n```javascript\nconst mnemonic = multichainWallet.generateMnemonic();\n\n// Note: Mnemonics with less than 12 words have low entropy and may be guessed by an attacker.\n```\n\n#### Response\n\n```javascript\nnet idle lava mango another capable inhale portion blossom fluid discover cruise\n```\n\n### Create Wallet\n\nThis method creates a new wallet. The method accepts a payload object as the parameter. The parameter of this payload is:\n\n```javascript\n// Creating an Ethereum wallet.\nconst wallet = multichainWallet.createWallet({\n  derivationPath: \"m/44'/60'/0'/0/0\", // Leave empty to use default derivation path\n  network: 'ethereum',\n}); // NOTE - Address generated will work for EVM compatible blockchains E.g. Binance smart chain, Polygon etc\n\n\n// Creating a Bitcoin wallet.\nconst wallet = multichainWallet.createWallet({\n  derivationPath: \"m/44'/0'/0'/0/0\", // Leave empty to use default derivation path\n  network: 'bitcoin', // 'bitcoin' or 'bitcoin-testnet'\n});\n\n// Creating a Solana wallet.\nconst wallet = multichainWallet.createWallet({\n  derivationPath: \"m/44'/501'/0'/0'\", // Leave empty to use default derivation path\n  network: 'solana',\n});\n\n// Creating a Waves wallet.\nconst wallet = await multichainWallet.createWallet({\n  cluster: 'testnet' // Can also be mainnet,\n  network: 'waves',\n});\n\n// Creating a Tron wallet\nconst wallet = await multichainWallet.createWallet({\n  network: 'tron',\n});\n\n```\n\n#### Response\n\n```javascript\n{\n  address: '0xfBE11AC0258cc8288cA24E818691Eb062f7042E9',\n  privateKey: '0xfdf745f45d1942feea79b4c0a3fc1ca67da366899f7e6cebaa06496806ca8127',\n  mnemonic: 'net idle lava mango another capable inhale portion blossom fluid discover cruise'\n}\n```\n\n### Get Balance\n\nThis gets the balance of the address passed in. The method accepts an object as the parameter.\nThe parameters for this object depending on the kind of balance to be gotten is in the form:\n\n#### Native coins\n\n```javascript\n// Get the ETH balance of an address.\nconst data = await multichainWallet.getBalance({\n  address: '0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22',\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n}); // NOTE - For otherEVM compatible blockchains all you have to do is change the rpcUrl.\n\n// Binance Smart chain\nconst data = await multichainWallet.getBalance({\n  address: '0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22',\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n});\n\n// Get the BTC balance of an address.\nconst data = await multichainWallet.getBalance({\n  address: '2NAhbS79dEUeqcnbC27UppwnjoVSwET5bat',\n  network: 'bitcoin-testnet', // 'bitcoin' or 'bitcoin-testnet'\n});\n\n// Get the SOL balance of an address.\nconst data = await multichainWallet.getBalance({\n  address: 'DYgLjazTY6kMqagbDMsNttRHKQj9o6pNS8D6jMjWbmP7',\n  network: 'solana',\n  rpcUrl: 'https://api.devnet.solana.com',\n});\n\n// Get the WAVES balance of an address.\nconst data = await multichainWallet.getBalance({\n  network: 'waves',\n  address: '3NBE5tjbQn9BHczjD6NSSuFDKVHKsBRzTv9',\n  rpcUrl: 'https://nodes-testnet.wavesnodes.com',\n});\n\n// Get the Tron balance of an address.\nconst data = await multichainWallet.getBalance({\n  network: 'tron',\n  address: 'TDdHvW9nU1JaX1P7roYtDvjErTTR17GPJJ',\n  rpcUrl: 'https://nile.trongrid.io',\n});\n```\n\n#### Tokens\n\n```javascript\n// Get the balance of an ERC20 token.\nconst data = await multichainWallet.getBalance({\n  address: '0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22',\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n  tokenAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7',\n}); // NOTE - For other EVM compatible blockchains all you have to do is change the rpcUrl.\n\n// Get the balance of a token on Solana.\nconst data = await multichainWallet.getBalance({\n  address: '5PwN5k7hin2XxUUaXveur7jSe5qt2mkWinp1JEiv8xYu',\n  tokenAddress: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',\n  network: 'solana',\n  rpcUrl: 'https://rpc.ankr.com/solana',\n});\n\n// Get the balance of a token on Waves.\nconst data = await multichainWallet.getBalance({\n  network: 'waves',\n  address: '3NBE5tjbQn9BHczjD6NSSuFDKVHKsBRzTv9',\n  rpcUrl: 'https://nodes-testnet.wavesnodes.com',\n  tokenAddress: '39pnv8FVf3BX3xwtC6uhFxffy2sE3seXCPsf25eNn6qG',\n});\n\n// Get the balance of a token on tron.\nconst data = await multichainWallet.getBalance({\n  network: 'tron',\n  address: 'TDdHvW9nU1JaX1P7roYtDvjErTTR17GPJJ',\n  rpcUrl: 'https://nile.trongrid.io',\n  tokenAddress: 'TXLAQ63Xg1NAzckPwKHvzw7CSEmLMEqcdj',\n});\n```\n\n#### Response\n\n```javascript\n{\n  balance: '2';\n}\n```\n\n### Generate Wallet from Mnemonic\n\nThis generates a wallet from Mnemonic phrase. The method accepts an object as the parameter. The parameters that this object takes are:\n\n```javascript\n// Generate an Ethereum wallet from mnemonic.\nconst wallet = multichainWallet.generateWalletFromMnemonic({\n  mnemonic:\n    'candy maple cake sugar pudding cream honey rich smooth crumble sweet treat',\n  derivationPath: \"m/44'/60'/0'/0/0\", // Leave empty to use default derivation path\n  network: 'ethereum',\n}); // NOTE - Address generated will work for EVM compatible blockchains E.g. Binance smart chain, Polygon etc\n\n// Generate a Bitcoin wallet from mnemonic.\nconst wallet = multichainWallet.generateWalletFromMnemonic({\n  mnemonic:\n    'excess quit spot inspire stereo scrap cave wife narrow era pizza typical',\n  derivationPath: \"m/44'/0'/0'/0/0\", // Leave empty to use default derivation path\n  network: 'bitcoin', // 'bitcoin' or 'bitcoin-testnet'\n});\n\n// Generate a Solana wallet from mnemonic.\nconst wallet = multichainWallet.generateWalletFromMnemonic({\n  mnemonic:\n    'base dry mango subject neither labor portion weekend range couple right document',\n  derivationPath: \"m/44'/501'/0'/0'\", // Leave empty to use default derivation path\n  network: 'solana',\n});\n\n// Generate a Waves wallet from mnemonic.\nconst wallet = multichainWallet.generateWalletFromMnemonic({\n  mnemonic:\n    'mushroom deliver work spray hire nuclear wrong deputy march six midnight outside motor differ adult',\n  cluster: 'testnet',\n  network: 'waves',\n});\n\n// Generate a Waves wallet from mnemonic.\nconst wallet = multichainWallet.generateWalletFromMnemonic({\n  mnemonic:\n    'mushroom deliver work spray hire nuclear wrong deputy march six midnight outside motor differ adult',\n  cluster: 'testnet',\n  network: 'waves',\n});\n\n// Generate a Tron wallet from mnemonic.\nconst wallet = multichainWallet.generateWalletFromMnemonic({\n  mnemonic:\n    'mushroom deliver work spray hire nuclear wrong deputy march six midnight outside motor differ adult',\n  network: 'tron',\n});\n```\n\n#### Response\n\n```javascript\n{\n  address: '0x627306090abaB3A6e1400e9345bC60c78a8BEf57',\n  privateKey: '0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3',\n  mnemonic: 'candy maple cake sugar pudding cream honey rich smooth crumble sweet treat'\n}\n```\n\n### Get Address from Private Key\n\nThis gets the address from the private key passed in. The method accepts an object as the parameter. The parameters that this object takes are:\n\n```javascript\n// Get the address from the private key on the Ethereum network.\nconst address = multichainWallet.getAddressFromPrivateKey({\n  privateKey:\n    '0f9e5c0bee6c7d06b95204ca22dea8d7f89bb04e8527a2c59e134d185d9af8ad',\n  network: 'ethereum',\n});\n\n// Get the address from the private key on the Bitcoin network.\nconst data = multichainWallet.getAddressFromPrivateKey({\n  privateKey: 'KxqTGtCMnX6oL9rxynDKCRJXt64Gm5ame4AEQcYncFhSSUxFBkeJ',\n  network: 'bitcoin', // 'bitcoin' or 'bitcoin-testnet'\n});\n\n// Get the address from the private key on the Solana network.\nconst address = multichainWallet.getAddressFromPrivateKey({\n  privateKey:\n    'bXXgTj2cgXMFAGpLHkF5GhnoNeUpmcJDsxXDhXQhQhL2BDpJumdwMGeC5Cs66stsN3GfkMH8oyHu24dnojKbtfp',\n  network: 'solana',\n});\n\n// Get the address from the private key on the Tron network.\nconst address = multichainWallet.getAddressFromPrivateKey({\n  privateKey:\n    'fa01dc6efd5fd64e4897aadf255ae715cf34138c7ada5f6a7efb0bdd0bd9c8c4',\n  network: 'tron',\n});\n```\n\n#### Response\n\n```javascript\n{\n  address: '0x1C082D1052fb44134a408651c01148aDBFcCe7Fe';\n}\n```\n\n### Get Transaction\n\nThis gets the transaction receipt of a transaction from the transaction hash. The method accepts an object as the parameter. The parameters that this object takes are:\n\n```javascript\n// Get the transaction receipt on Ethereum network.\nconst receipt = await multichainWallet.getTransaction({\n  hash: '0x5a90cea37e3a5dbee6e10190ff5a3769ad27a0c6f625458682104e26e0491055',\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n}); // NOTE - For other EVM compatible blockchains all you have to do is change the rpcUrl.\n\n// Get the transaction receipt on Bitcoin network.\nconst receipt = await getTransaction({\n  network: 'bitcoin-testnet', // 'bitcoin' or 'bitcoin-testnet'\n  hash: '4f6c3661e0e6d190dbdfb6c0791396fccee653c5bf4a5249b049341c2b539ee1',\n});\n\n// Get the transaction receipt on Solana network.\nconst receipt = await multichainWallet.getTransaction({\n  rpcUrl: 'https://api.devnet.solana.com',\n  hash:\n    'CkG1ynQ2vN8bmNsBUKG8ix3moUUfELWwd8K2f7mmqDd7LifFFfgyFhBux6t22AncbY4NR3PsEU3DbH7mDBMXWk7',\n  network: 'solana',\n});\n\n// Get the transaction receipt on Waves network.\nconst receipt = await multichainWallet.getTransaction({\n  rpcUrl: 'https://nodes-testnet.wavesnodes.com',\n  hash: 'Barwuj1gCiQ9wCfLQ1nbdz2CSyQXLnRxnDEubtdTwJpd',\n  network: 'waves',\n});\n\n// Get the transaction receipt on Tron network.\nconst receipt = await multichainWallet.getTransaction({\n  hash: '34f27486cbe693d5182c4b5e18c1779d918668f86f396ed62a279d8b519b81cc',\n  network: 'tron',\n  rpcUrl: 'https://nile.trongrid.io',\n});\n```\n\n#### Response\n\n```javascript\n{\n  object;\n}\n```\n\n### Transfer\n\nThis transfers the amount of tokens from the source address to the destination address It takes in an object as the parameter. It allows for the transfer of the following:\n\n#### Ethereum Network\n\nAllows for the transfer of ETH, and overriding of transactions.\n\n```javascript\n// Transferring ETH from one address to another.\nconst transfer = await multichainWallet.transfer({\n  recipientAddress: '0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22',\n  amount: 1,\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n  privateKey:\n    '0f9e5c0bee6c7d06b95204ca22dea8d7f89bb04e8527a2c59e134d185d9af8ad',\n  gasPrice: '10', // Gas price is in Gwei. Leave empty to use default gas price\n  data: 'Money for transportation', // Send a message\n}); // NOTE - For other EVM compatible blockchains all you have to do is change the rpcUrl.\n\n// Transferring ERC20 tokens from one address to another.\nconst transfer = await multichainWallet.transfer({\n  recipientAddress: '0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22',\n  amount: 10,\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n  privateKey:\n    '0f9e5c0bee6c7d06b95204ca22dea8d7f89bb04e8527a2c59e134d185d9af8ad',\n  gasPrice: '10', // Gas price is in Gwei. leave empty to use default gas price\n  tokenAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7',\n}); // NOTE - For other EVM compatible blockchains all you have to do is change the rpcUrl.\n```\n\nThe optional parameters that the object takes in are: gas price, nonce, and data.\n\n- The gas price is the price of gas in Gwei. The higher the gas price, the faster the transaction will be. It's best to use a higher gas price than the default.\n- The nonce is the number of transactions that have been sent from the source address and is used to ensure that the transaction is unique. The transaction is unique because the nonce is incremented each time a transaction is sent.\n- The data is a string parameter used to pass across a message through the transaction. Can only be used on transfer of ETH.\n\n```javascript\n// Overriding pending ETH transaction.\nconst transfer = await multichainWallet.transfer({\n  recipientAddress: '0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22',\n  amount: 0,\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n  privateKey:\n    '0f9e5c0bee6c7d06b95204ca22dea8d7f89bb04e8527a2c59e134d185d9af8ad',\n  gasPrice: '10',\n  nonce: 1, // The pending transaction nonce\n  data: 'Money for feeding', // Send a message\n});\n\n// Overriding ERC20 token pending transaction.\nconst transfer = await multichainWallet.transfer({\n  recipientAddress: '0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22',\n  amount: 0,\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n  privateKey:\n    '0f9e5c0bee6c7d06b95204ca22dea8d7f89bb04e8527a2c59e134d185d9af8ad',\n  gasPrice: '10',\n  tokenAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7',\n  nonce: 1, // The pending transaction nonce\n});\n```\n\n#### Response\n\n```javascript\n{\n  object;\n}\n```\n\n#### Bitcoin Network\n\nAllows for the transfer of BTC from one address to another.\n\n```javascript\n// Transferring BTC from one address to another.\nconst response = await multichainWallet.transfer({\n  privateKey: 'L3tSvMViDit1GSp7mbV2xFCGv6M45kDNuSyNY9xyUxmUPBFrBkc4',\n  recipientAddress: '2NAhbS79dEUeqcnbC27UppwnjoVSwET5bat',\n  amount: 0.001,\n  network: 'bitcoin-testnet', // 'bitcoin' or 'bitcoin-testnet'\n  fee: 10000, // Optional param default value is 10000\n  subtractFee: false, // Optional param default value is false\n});\n```\n\n#### Response\n\n```javascript\n{\n  object;\n}\n```\n\n#### Solana Network\n\nAllows for the transfer of SOL and tokens.\n\n```javascript\n// Transferring SOL from one address to another.\nconst transfer = await multichainWallet.transfer({\n  recipientAddress: '9DSRMyr3EfxPzxZo9wMBPku7mvcazHTHfyjhcfw5yucA',\n  amount: 1,\n  network: 'solana',\n  rpcUrl: 'https://api.devnet.solana.com',\n  privateKey:\n    'bXXgTj2cgXMFAGpLHkF5GhnoNeUpmcJDsxXDhXQhQhL2BDpJumdwMGeC5Cs66stsN3GfkMH8oyHu24dnojKbtfp',\n});\n\n// Transferring a token from one address to another.\nconst transfer = await multichainWallet.transfer({\n  recipientAddress: '9DSRMyr3EfxPzxZo9wMBPku7mvcazHTHfyjhcfw5yucA',\n  tokenAddress: 'DV2exYApRFWEVb9oQkedLRYeSm8ccxNReLfEksEE5FZm',\n  amount: 1,\n  network: 'solana',\n  rpcUrl: 'https://api.devnet.solana.com',\n  privateKey:\n    'h5KUPKU4z8c9nhMCQsvCLq4q6Xn9XK1B1cKjC9bJVLQLgJDvknKCBtZdHKDoKBHuATnSYaHRvjJSDdBWN8P67hh',\n});\n```\n\n#### Response\n\n```javascript\n{\n  hash: '3nGq2yczqCpm8bF2dyvdPtXpnFLJ1oGWkDfD6neLbRay8SjNqYNhWQBKE1ZFunxvFhJ47FyT6igNpYPP293jXCZk';\n}\n```\n\n#### Waves Network\n\nAllows for the transfer of WAVES and tokens.\n\n```javascript\n// Transferring WAVES from one address to another.\n\nconst response = await multichainWallet.transfer({\n  recipientAddress: '3N4x4ML4D6fiU18Tpw86puRoN78FCTs9VQu',\n  amount: 0.0001,\n  network: 'waves',\n  rpcUrl: 'https://nodes-testnet.wavesnodes.com',\n  privateKey:\n    'mushroom deliver work spray hire nuclear wrong deputy march six midnight outside motor differ adult',\n});\n\n// Transferring a token from one address to another.\nconst transfer = await multichainWallet.transfer({\n  recipientAddress: '3N4x4ML4D6fiU18Tpw86puRoN78FCTs9VQu',\n  tokenAddress: '39pnv8FVf3BX3xwtC6uhFxffy2sE3seXCPsf25eNn6qG',\n  amount: 1,\n  network: 'waves',\n  rpcUrl: 'https://nodes-testnet.wavesnodes.com',\n  privateKey:\n    'mushroom deliver work spray hire nuclear wrong deputy march six midnight outside motor differ adult',\n});\n```\n\n#### Response\n\n```javascript\n{\n  type: 4,\n  id: '9CbA3dsyEvbdf52gqeBvVkjEP5zBmCQPANjguNznHryf',\n  fee: 100000,\n  feeAssetId: null,\n  timestamp: 1661781621495,\n  version: 3,\n  chainId: 84,\n  sender: '3NBE5tjbQn9BHczjD6NSSuFDKVHKsBRzTv9',\n  senderPublicKey: '8JEFTsZfqp2Y7HpmaxqgGtiMLfsNAAq3bMkwZwGpUWPV',\n  proofs: [\n    '5m4DpkkYkVY4xkiMNyrNpiVUHNNAtyJrSH5UCkjWSnLTAabkCefLx6wWTFT1Xcb7K8C31H7ndZAX8mWrJLMrsqxr'\n  ],\n  recipient: '3N4x4ML4D6fiU18Tpw86puRoN78FCTs9VQu',\n  assetId: '39pnv8FVf3BX3xwtC6uhFxffy2sE3seXCPsf25eNn6qG',\n  feeAsset: null,\n  amount: 100000000,\n  attachment: ''\n}\n```\n\n#### Tron Network\n\nAllows for the transfer of TRX and TRC20 tokens.\n\n```javascript\n// Transferring TRX from one address to another.\nconst transfer = await multichainWallet.transfer({\n  rpcUrl: 'https://nile.trongrid.io',\n  recipientAddress: 'TEVuGfgLkQCVXs7EtjMiQp3ZSSUkEbNnVS',\n  amount: 0.0001,\n  network: 'tron',\n  privateKey:\n    'fa01dc6efd5fd64e4897aadf255ae715cf34138c7ada5f6a7efb0bdd0bd9c8c4',\n});\n\n// Transferring TRC20 tokens from one address to another.\nconst transfer = await multichainWallet.transfer({\n  rpcUrl: 'https://nile.trongrid.io',\n  recipientAddress: 'TEVuGfgLkQCVXs7EtjMiQp3ZSSUkEbNnVS',\n  privateKey:\n    'fa01dc6efd5fd64e4897aadf255ae715cf34138c7ada5f6a7efb0bdd0bd9c8c4',\n  amount: 0.1,\n  network: 'tron',\n  tokenAddress: 'TXLAQ63Xg1NAzckPwKHvzw7CSEmLMEqcdj',\n});\n```\n\n#### Response\n\n```javascript\n{\n  txid\n  ..object;\n}\n```\n\n### Encryptions\n\n#### Encrypt Private Key\n\nIt supports encryption of ethereum and other EVM compatible chains private keys.\n\n```javascript\n// encrypt private key.\n\nconst encrypted = await multichainWallet.getEncryptedJsonFromPrivateKey({\n  network: 'ethereum',\n  privateKey:\n    '0f9e5c0bee6c7d06b95204ca22dea8d7f89bb04e8527a2c59e134d185d9af8ad',\n  password: 'walletpassword',\n});\n```\n\n#### Response\n\n```javascript\n{\n  json: '{\"address\":\"1c082d1052fb44134a408651c01148adbfcce7fe\",\"id\":\"abfb9f10-165a-4b7a-935d-51729f10c310\",\"version\":3,\"Crypto\":{\"cipher\":\"aes-128-ctr\",\"cipherparams\":{\"iv\":\"f3fac53ee2d76c293977d1af3a7d73bb\"},\"ciphertext\":\"c5034579cdf32d7a612c9a83801aad899abfebb7436712f363ecf89546bbcbce\",\"kdf\":\"scrypt\",\"kdfparams\":{\"salt\":\"78ff80ece5d681b1aecd829526388472d1889da233229fa5c1416e8f2035b7a8\",\"n\":131072,\"dklen\":32,\"p\":1,\"r\":8},\"mac\":\"0f70eca6138ffe60b174308b6ab7a8a81a0d2b662e2cf5d8727443cf12af766c\"}}';\n}\n```\n\n#### Decrypt Encrypted JSON\n\nIt supports decryption of encrypted JSONs (A.K.A keystore).\n\n```javascript\n// decrypting encrypted JSON.\n\nconst decrypted = await multichainWallet.getWalletFromEncryptedJson({\n  network: 'ethereum',\n  json:\n    '{\"address\":\"1c082d1052fb44134a408651c01148adbfcce7fe\",\"id\":\"abfb9f10-165a-4b7a-935d-51729f10c310\",\"version\":3,\"Crypto\":{\"cipher\":\"aes-128-ctr\",\"cipherparams\":{\"iv\":\"f3fac53ee2d76c293977d1af3a7d73bb\"},\"ciphertext\":\"c5034579cdf32d7a612c9a83801aad899abfebb7436712f363ecf89546bbcbce\",\"kdf\":\"scrypt\",\"kdfparams\":{\"salt\":\"78ff80ece5d681b1aecd829526388472d1889da233229fa5c1416e8f2035b7a8\",\"n\":131072,\"dklen\":32,\"p\":1,\"r\":8},\"mac\":\"0f70eca6138ffe60b174308b6ab7a8a81a0d2b662e2cf5d8727443cf12af766c\"}}',\n  password: 'walletpassword',\n});\n```\n\n#### Response\n\n```javascript\n{\n  privateKey: '0x0f9e5c0bee6c7d06b95204ca22dea8d7f89bb04e8527a2c59e134d185d9af8ad',\n  address: '0x1C082D1052fb44134a408651c01148aDBFcCe7Fe'\n}\n\n```\n\n### Token Info\n\n#### Get ERC20 Token Info\n\nAllows for fetching ERC20 tokens info from compatible blockchains by the token address\n\n```javascript\n// getting token info.\n\nconst info = await multichainWallet.getTokenInfo({\n  address: '0x7fe03a082fd18a80a7dbd55e9b216bcf540557e4',\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n}); // NOTE - For other EVM compatible blockchains all you have to do is change the rpcUrl.\n```\n\n#### Response\n\n```javascript\n{\n  name: 'Mocked USDT',\n  symbol: 'USDT',\n  decimals: 6,\n  address: '0x7fe03a082fd18a80a7dbd55e9b216bcf540557e4',\n  totalSupply: '1000000000000'\n}\n```\n\n#### Get SPL Token Info\n\nAllows for fetching SPL tokens info on the solana by the token address.\nNote: Token has to be available on the solana token list registry\n\n```javascript\n// getting token info.\n\nconst info = await multichainWallet.getTokenInfo({\n  address: '7Xn4mM868daxsGVJmaGrYxg8CZiuqBnDwUse66s5ALmr',\n  network: 'solana',\n  rpcUrl: 'https://api.devnet.solana.com',\n  cluster: 'devnet',\n});\n```\n\n#### Response\n\n```javascript\n{\n  object;\n}\n```\n\n#### Get ERC20 Token Info\n\nAllows for fetching ERC20 tokens info from compatible blockchains by the token address\n\n```javascript\n// getting token info.\n\nconst info = await multichainWallet.getTokenInfo({\n  address: '0x7fe03a082fd18a80a7dbd55e9b216bcf540557e4',\n  network: 'ethereum',\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n}); // NOTE - For other EVM compatible blockchains all you have to do is change the rpcUrl.\n```\n\n#### Response\n\n```javascript\n{\n  name: 'Mocked USDT',\n  symbol: 'USDT',\n  decimals: 6,\n  address: '0x7fe03a082fd18a80a7dbd55e9b216bcf540557e4',\n  totalSupply: '1000000000000'\n}\n```\n\n\n#### Get Tron Token Info\n\nAllows for fetching Tron token info\n\n```javascript\nconst info = await multichainWallet.getTokenInfo({\n  address: 'TXLAQ63Xg1NAzckPwKHvzw7CSEmLMEqcdj',\n  network: 'tron',\n  rpcUrl: 'https://nile.trongrid.io',\n});\n```\n\n#### Response\n\n```javascript\n{\n  name: 'Tether USD',\n  symbol: 'USDT',\n  address: 'TXLAQ63Xg1NAzckPwKHvzw7CSEmLMEqcdj',\n  decimals: 6,\n  totalSupply: '2100000000000000'\n}\n```\n\n### Smart Contract Call\n\nThis can be used to make custom smart contract interaction by specifying the contract ABI and function types.\n\n#### Ethereum network\n\n```javascript\n// Calling a write smart contract function.\nconst data = await multichainWallet.smartContractCall({\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n  network: 'ethereum',\n  contractAddress: '0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa',\n  method: 'transfer',\n  methodType: 'write',\n  params: ['0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22', '1000000000000000000'],\n  contractAbi: [\n    {\n      constant: false,\n      inputs: [\n        { name: '_to', type: 'address' },\n        { name: '_value', type: 'uint256' },\n      ],\n      name: 'transfer',\n      outputs: [{ name: '', type: 'bool' }],\n      payable: false,\n      stateMutability: 'nonpayable',\n      type: 'function',\n    },\n  ],\n  privateKey:\n    '0f9e5c0bee6c7d06b95204ca22dea8d7f89bb04e8527a2c59e134d185d9af8ad',\n}); // NOTE - For other EVM compatible blockchains all you have to do is change the rpcUrl.\n\n// calling a read smart contract function.\nconst data = await multichainWallet.smartContractCall({\n  rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',\n  network: 'ethereum',\n  contractAddress: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D',\n  method: 'factory',\n  methodType: 'read',\n  params: [],\n  contractAbi: [\n    {\n      inputs: [],\n      name: 'factory',\n      outputs: [{ internalType: 'address', name: '', type: 'address' }],\n      stateMutability: 'view',\n      type: 'function',\n    },\n  ],\n}); // NOTE - For other EVM compatible blockchains all you have to do is change the rpcUrl.\n```\n\n#### Waves network\n\n```javascript\n// calling a read smart contract function.\nconst data = await multichainWallet.smartContractCall({\n  network: 'waves',\n  methodType: 'read',\n  rpcUrl: 'https://nodes-testnet.wavesnodes.com',\n  contractAddress: '3N9uzrTiArce1h9VCqK3QUUZmFqBgg5rZSW',\n  method: '3N1gVpA5MVY4WsMpzQ6RfcscpDDdqBbLx6n_balance',\n  params: [],\n});\n\n// calling a write smart contract function.\nconst data = await multichainWallet.smartContractCall({\n  network: 'waves',\n  methodType: 'write',\n  rpcUrl: 'https://nodes-testnet.wavesnodes.com',\n  contractAddress: '3N9uzrTiArce1h9VCqK3QUUZmFqBgg5rZSW',\n  privateKey:\n    'mushroom deliver work spray hire nuclear wrong deputy march six midnight outside motor differ adult',\n  method: 'deposit',\n  payment: [{ assetId: null, amount: 1000 }],\n  params: [],\n});\n```\n\n#### Tron network\n\n```javascript\n// Calling a write smart contract function.\nconst data = await multichainWallet.smartContractCall({\n  network: 'tron',\n  rpcUrl: 'https://nile.trongrid.io',\n  contractAddress: 'TXLAQ63Xg1NAzckPwKHvzw7CSEmLMEqcdj',\n  method: 'transfer(address,uint256)',\n  methodType: 'write',\n  contractAbi: [\n    {\n      constant: false,\n      inputs: [\n        { name: '_to', type: 'address' },\n        { name: '_value', type: 'uint256' },\n      ],\n      name: 'transfer',\n      outputs: [{ name: '', type: 'bool' }],\n      payable: false,\n      stateMutability: 'nonpayable',\n      type: 'function',\n    },\n  ],\n  params: [\n    { type: 'address', value: 'TEVuGfgLkQCVXs7EtjMiQp3ZSSUkEbNnVS' },\n    { type: 'uint256', value: 1000000 },\n  ],\n  privateKey:\n    'fa01dc6efd5fd64e4897aadf255ae715cf34138c7ada5f6a7efb0bdd0bd9c8c4',\n});\n\n// calling a read smart contract function.\nconst data = await multichainWallet.smartContractCall({\n  network: 'tron',\n  rpcUrl: 'https://nile.trongrid.io',\n  contractAddress: 'TXLAQ63Xg1NAzckPwKHvzw7CSEmLMEqcdj',\n  method: 'balanceOf',\n  methodType: 'read',\n  contractAbi: [\n    {\n      constant: true,\n      inputs: [{ name: '_owner', type: 'address' }],\n      name: 'balanceOf',\n      outputs: [{ name: 'balance', type: 'uint256' }],\n      payable: false,\n      stateMutability: 'view',\n      type: 'function',\n    },\n  ],\n  params: [{ type: 'address', value: 'TEVuGfgLkQCVXs7EtjMiQp3ZSSUkEbNnVS' }],\n});\n```\n\nSome of the parameters available in this function are:\n\n- The **method** parameter is the name of the smart contract function to be interacted with.\n- The **method type** is the type of action the method is meant to perform.\n- The **params** parameter is the parameter of the smart contract function if it requires any. It must be in the same order as the smart contract function. If the smart contract function does not require any parameters, leave it as an empty array.\n\nThe optional parameters that the object takes in are: value, contractAbi, gas price, gas limit, nonce, and private key.\n\n- The **value** is the amount of ETH you want to send while interacting with the function.\n- The **contractAbi** is the ABI of the smart contract. Every smart contract has an ABI that can be used to interact with the smart contract functions. If this is not specified. You can interact with all the [ERC20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md) token standard functions by default.\n- The **gas price** is the price of gas in Gwei. The higher the gas price, the faster the transaction gets mined. It's best to use a higher gas price than the default.\n- The **gas limit** is the maximum amount of gas you are willing to pay for the transaction.\n- The **nonce** is the number of transactions that have been sent from the source address and is used to ensure that the transaction is unique. The transaction is unique because the nonce is incremented each time a transaction is sent.\n- The **private key** is a string parameter that can be passed to use as the signer. It is used to sign the transaction. This parameter is not needed when calling a smart contract read function.\n- The **payment** (only on Waves) payment is the payment (WAVES or Waves Asset) sent to the smart contract while interacting with it. If the smart contract function does not require any payment.\n- The **feeLimt** (only on Tron) is the max amount of fee you're willing to pay for the transaction\n\n#### Response\n\n```javascript\n{\n  data: object;\n}\n```\n\n### Want to contribute?\n\nContributions are welcome! Kindly refer to the [contribution guidelines](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnotstatic%2Fmultichain-crypto-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamnotstatic%2Fmultichain-crypto-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnotstatic%2Fmultichain-crypto-wallet/lists"}