{"_id":"@depay/web3-assets-svm","name":"@depay/web3-assets-svm","dist-tags":{"latest":"8.0.0"},"versions":{"8.0.0":{"name":"@depay/web3-assets-svm","moduleName":"Web3Assets","version":"8.0.0","description":"JavaScript library to retrieve Web3 assets of a given or connected wallet/account.","main":"dist/umd/index.solana.js","module":"dist/esm/index.solana.js","repository":{"type":"git","url":"git+ssh://git@github.com/DePayFi/web3-assets.git"},"keywords":["web3","assets","tokens","crypto","blockchain"],"author":{"name":"depay.com"},"license":"MIT","bugs":{"url":"https://github.com/DePayFi/web3-assets/issues"},"homepage":"https://depay.com","private":false,"dependencies":{},"peerDependencies":{"@depay/solana-web3.js":"^1.98.0","@depay/web3-blockchains":"^9.7.9","@depay/web3-client-svm":"^11.0.1","@depay/web3-tokens-svm":"^11.0.0"},"engines":{"node":">=16"},"_id":"@depay/web3-assets-svm@8.0.0","gitHead":"a567492e1a627bd4d8fbab94fc0f81552d664296","_nodeVersion":"18.20.7","_npmVersion":"10.8.2","dist":{"integrity":"sha512-go8TZhAbnjol8fnUOJdm+yUQEZMZRTdGn7vwetffuNUGxa1/EKkqKL8lecJUWFKJ37xa26/KilKY575lb8QFlQ==","shasum":"29fb83eb9c8e1a3a357888dede5bd71e882bc094","tarball":"https://registry.npmjs.org/@depay/web3-assets-svm/-/web3-assets-svm-8.0.0.tgz","fileCount":9,"unpackedSize":78534,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGPMV5IIGo/qyPFYtIsP8AoX3hottJUa6kok+naC4Z5JAiAnq1j+2eE82xmerzRtMaiSNefcB9JcAZPye4pFP0JCdA=="}]},"_npmUser":{"name":"depay-sebastian","email":"s@depay.fi"},"directories":{},"maintainers":[{"name":"depay-sebastian","email":"s@depay.fi"},{"name":"0xneo11","email":"0xneo11@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/web3-assets-svm_8.0.0_1742119707236_0.043189464339911554"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-16T10:08:27.171Z","8.0.0":"2025-03-16T10:08:27.439Z","modified":"2025-03-16T10:08:27.680Z"},"maintainers":[{"name":"depay-sebastian","email":"s@depay.fi"},{"name":"0xneo11","email":"0xneo11@gmail.com"}],"description":"JavaScript library to retrieve Web3 assets of a given or connected wallet/account.","homepage":"https://depay.com","keywords":["web3","assets","tokens","crypto","blockchain"],"repository":{"type":"git","url":"git+ssh://git@github.com/DePayFi/web3-assets.git"},"author":{"name":"depay.com"},"bugs":{"url":"https://github.com/DePayFi/web3-assets/issues"},"license":"MIT","readme":"## Quickstart\n\n```\nyarn add @depay/web3-assets\n```\n\nor \n\n```\nnpm install --save @depay/web3-assets\n```\n\n```javascript\nimport { getAssets } from '@depay/web3-assets'\n\nlet assets = await getAssets({\n  accounts: {\n    ethereum: '0x08B277154218CCF3380CAE48d630DA13462E3950',\n    bsc: '0x08B277154218CCF3380CAE48d630DA13462E3950' \n  } \n})\n//[\n// {\n//   \"name\": \"Dai Stablecoin\",\n//   \"symbol\": \"DAI\",\n//   \"address\": \"0x6B175474E89094C44Da98b954EedeAC495271d0F\",\n//   \"blockchain\": \"ethereum\",\n//   \"type\": \"20\",\n//   \"balance\": \"8007804249707967889272\"\n// }, {\n//   \"name\": \"DePay\",\n//   \"symbol\": \"DEPAY\",\n//   \"address\": \"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb\",\n//   \"blockchain\": \"ethereum\",\n//   \"type\": \"20\",\n//   \"balance\": \"212816860003097638129\"\n// }, {\n//   \"name\": \"PancakeSwap Token\",\n//   \"symbol\": \"CAKE\",\n//   \"address\": \"0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82\",\n//   \"blockchain\": \"bsc\",\n//   \"type\": \"20\",\n//   \"balance\": \"2221112213212321\"\n// }\n//]\n```\n\n```javascript\nimport { dripAssets } from '@depay/web3-assets'\n\nlet allAssets = await dripAssets({\n  accounts: { ethereum: '0x08B277154218CCF3380CAE48d630DA13462E3950', bsc: '0x08B277154218CCF3380CAE48d630DA13462E3950' },\n  priority: [\n    { blockchain: 'ethereum', address: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' },\n    { blockchain: 'bsc', address: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' },\n    { blockchain: 'ethereum', address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' },\n    { blockchain: 'bsc', address: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c' }\n  ],\n  drip: (asset)=>{\n    // {\n    //   \"name\": \"DePay\",\n    //   \"symbol\": \"DEPAY\",\n    //   \"address\": \"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb\",\n    //   \"blockchain\": \"ethereum\",\n    //   \"type\": \"20\",\n    //   \"balance\": \"212816860003097638129\"\n    // }\n  }\n})\n```\n\n## Support\n\nThis library supports the following blockchains:\n\n- [Ethereum](https://ethereum.org)\n- [BNB Smart Chain](https://www.binance.org/smartChain)\n- [Polygon](https://polygon.technology)\n- [Solana](https://solana.com)\n- [Fantom](https://fantom.foundation)\n- [Arbitrum](https://arbitrum.io)\n- [Avalanche](https://www.avax.network)\n- [Gnosis](https://gnosis.io)\n- [Optimism](https://www.optimism.io)\n- [Base](https://base.org)\n- [Worldchain](https://worldcoin.org/world-chain)\n\n## Platform specific packaging\n\nIn case you want to use and package only specific platforms, use the platform-specific package:\n\n### EVM (Ethereum Virtual Machine) platform specific packaging\n\n```javascript\nimport { getAssets } from '@depay/web3-assets-evm'\n```\n\n### SVM (Solana Virtual Machine) platform specific packaging\n\n```javascript\nimport { getAssets } from '@depay/web3-assets-svm'\n```\n\n## Functionalities\n\n### getAssets\n\nRetrieves all assets of the given account on the given blockchains:\n\n```javascript\n\nimport { getAssets } from '@depay/web3-assets'\n\nlet assets = await getAssets({\n  accounts: {\n    ethereum: '0x08B277154218CCF3380CAE48d630DA13462E3950',\n    bsc: '0x08B277154218CCF3380CAE48d630DA13462E3950'\n  }\n})\n//[\n// {\n//   \"name\": \"Dai Stablecoin\",\n//   \"symbol\": \"DAI\",\n//   \"address\": \"0x6B175474E89094C44Da98b954EedeAC495271d0F\",\n//   \"blockchain\": \"ethereum\",\n//   \"type\": \"20\",\n//   \"balance\": \"8007804249707967889272\"\n// }, {\n//   \"name\": \"DePay\",\n//   \"symbol\": \"DEPAY\",\n//   \"address\": \"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb\",\n//   \"blockchain\": \"ethereum\",\n//   \"type\": \"20\",\n//   \"balance\": \"212816860003097638129\"\n// }, {\n//   \"name\": \"PancakeSwap Token\",\n//   \"symbol\": \"CAKE\",\n//   \"address\": \"0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82\",\n//   \"blockchain\": \"bsc\",\n//   \"type\": \"20\",\n//   \"balance\": \"2221112213212321\"\n// }\n//]\n```\n\nTimeout happens after 10s and `[]` will be returned in cases the assets for the given addresses can't be retrieved within 10s.\n\n#### only (getAssets)\n\nOnly gets assets and balances for given token addresses.\n\n```javascript\n\nimport { getAssets } from '@depay/web3-assets'\n\nlet assets = await getAssets({\n  accounts: {\n    ethereum: '0x08B277154218CCF3380CAE48d630DA13462E3950',\n    bsc: '0x08B277154218CCF3380CAE48d630DA13462E3950'\n  },\n  only: {\n    ethereum: ['0x6B175474E89094C44Da98b954EedeAC495271d0F'],\n    bsc: ['0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82']\n  }\n})\n//[\n// {\n//   \"name\": \"Dai Stablecoin\",\n//   \"symbol\": \"DAI\",\n//   \"address\": \"0x6B175474E89094C44Da98b954EedeAC495271d0F\",\n//   \"blockchain\": \"ethereum\",\n//   \"type\": \"20\",\n//   \"balance\": \"8007804249707967889272\"\n// }, {\n//   \"name\": \"PancakeSwap Token\",\n//   \"symbol\": \"CAKE\",\n//   \"address\": \"0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82\",\n//   \"blockchain\": \"bsc\",\n//   \"type\": \"20\",\n//   \"balance\": \"2221112213212321\"\n// }\n//]\n```\n\n#### exclude (getAssets)\n\nExcludes given assets\n\n```javascript\n\nimport { getAssets } from '@depay/web3-assets'\n\nlet assets = await getAssets({\n  accounts: {\n    ethereum: '0x08B277154218CCF3380CAE48d630DA13462E3950',\n    bsc: '0x08B277154218CCF3380CAE48d630DA13462E3950'\n  },\n  exclude: {\n    ethereum: ['0x6B175474E89094C44Da98b954EedeAC495271d0F'],\n    bsc: ['0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82']\n  }\n})\n//[\n// {\n//   \"name\": \"DePay\",\n//   \"symbol\": \"DEPAY\",\n//   \"address\": \"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb\",\n//   \"blockchain\": \"ethereum\",\n//   \"type\": \"20\",\n//   \"balance\": \"212816860003097638129\"\n// }\n//]\n```\n\n### dripAssets\n\nDrips every single asset immediately after resolved and all assets after all assets have been resolved (just as getAssets):\n\n```javascript\nimport { dripAssets } from '@depay/web3-assets'\n\nlet allAssets = await dripAssets({\n  accounts: { ethereum: '0x08B277154218CCF3380CAE48d630DA13462E3950', bsc: '0x08B277154218CCF3380CAE48d630DA13462E3950' },\n  priority: [\n    { blockchain: 'ethereum', address: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' },\n    { blockchain: 'bsc', address: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' },\n    { blockchain: 'ethereum', address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' },\n    { blockchain: 'bsc', address: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c' },\n  ],\n  drip: (asset)=>{\n    // {\n    //   \"name\": \"DePay\",\n    //   \"symbol\": \"DEPAY\",\n    //   \"address\": \"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb\",\n    //   \"blockchain\": \"ethereum\",\n    //   \"type\": \"20\",\n    //   \"balance\": \"212816860003097638129\"\n    // }\n  }\n})\n```\n\n#### only (dripAssets)\n\nOnly drips assets and balances for given token addresses.\n\n```javascript\n\nimport { dripAssets } from '@depay/web3-assets'\n\nlet assets = await dripAssets({\n  accounts: {\n    ethereum: '0x08B277154218CCF3380CAE48d630DA13462E3950',\n    bsc: '0x08B277154218CCF3380CAE48d630DA13462E3950'\n  },\n  only: {\n    ethereum: ['0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb'],\n    bsc: ['0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb']\n  },\n  drip: (asset)=>{\n    // {\n    //   \"name\": \"DePay\",\n    //   \"symbol\": \"DEPAY\",\n    //   \"address\": \"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb\",\n    //   \"blockchain\": \"ethereum\",\n    //   \"type\": \"20\",\n    //   \"balance\": \"212816860003097638129\"\n    // }\n  }\n})\n```\n\n#### exclude (dripAssets)\n\nDrips all assets except the ones you \"exclude\":\n\n```javascript\n\nimport { dripAssets } from '@depay/web3-assets'\n\nlet assets = await dripAssets({\n  accounts: {\n    ethereum: '0x08B277154218CCF3380CAE48d630DA13462E3950',\n    bsc: '0x08B277154218CCF3380CAE48d630DA13462E3950'\n  },\n  exclude: {\n    ethereum: ['0x6B175474E89094C44Da98b954EedeAC495271d0F'],\n    bsc: ['0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82']\n  },\n  drip: (asset)=>{\n    // {\n    //   \"name\": \"DePay\",\n    //   \"symbol\": \"DEPAY\",\n    //   \"address\": \"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb\",\n    //   \"blockchain\": \"ethereum\",\n    //   \"type\": \"20\",\n    //   \"balance\": \"212816860003097638129\"\n    // }\n  }\n})\n```\n\n## Development\n\n### Get started\n\n```\nyarn install\nyarn dev\n```\n\n### Release\n\n```\nnpm publish\n```\n","readmeFilename":"README.md","_rev":"1-81e328ba257e41d0a1a33273fdf74794"}