@metamask/assets-controllers 38.0.0 → 38.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -1
- package/dist/AccountTrackerController.cjs +245 -0
- package/dist/AccountTrackerController.cjs.map +1 -0
- package/dist/{types/AccountTrackerController.d.ts → AccountTrackerController.d.cts} +6 -6
- package/dist/AccountTrackerController.d.cts.map +1 -0
- package/dist/AccountTrackerController.d.mts +112 -0
- package/dist/AccountTrackerController.d.mts.map +1 -0
- package/dist/AccountTrackerController.mjs +244 -8
- package/dist/AccountTrackerController.mjs.map +1 -1
- package/dist/AssetsContractController.cjs +389 -0
- package/dist/AssetsContractController.cjs.map +1 -0
- package/dist/{types/AssetsContractController.d.ts → AssetsContractController.d.cts} +9 -9
- package/dist/AssetsContractController.d.cts.map +1 -0
- package/dist/AssetsContractController.d.mts +277 -0
- package/dist/AssetsContractController.d.mts.map +1 -0
- package/dist/AssetsContractController.mjs +387 -16
- package/dist/AssetsContractController.mjs.map +1 -1
- package/dist/CurrencyRateController.cjs +156 -0
- package/dist/CurrencyRateController.cjs.map +1 -0
- package/dist/{types/CurrencyRateController.d.ts → CurrencyRateController.d.cts} +5 -5
- package/dist/CurrencyRateController.d.cts.map +1 -0
- package/dist/CurrencyRateController.d.mts +80 -0
- package/dist/CurrencyRateController.d.mts.map +1 -0
- package/dist/CurrencyRateController.mjs +150 -10
- package/dist/CurrencyRateController.mjs.map +1 -1
- package/dist/NftController.cjs +1159 -0
- package/dist/NftController.cjs.map +1 -0
- package/dist/{types/NftController.d.ts → NftController.d.cts} +11 -11
- package/dist/NftController.d.cts.map +1 -0
- package/dist/NftController.d.mts +424 -0
- package/dist/NftController.d.mts.map +1 -0
- package/dist/NftController.mjs +1156 -12
- package/dist/NftController.mjs.map +1 -1
- package/dist/NftDetectionController.cjs +237 -0
- package/dist/NftDetectionController.cjs.map +1 -0
- package/dist/{types/NftDetectionController.d.ts → NftDetectionController.d.cts} +9 -9
- package/dist/NftDetectionController.d.cts.map +1 -0
- package/dist/NftDetectionController.d.mts +368 -0
- package/dist/NftDetectionController.d.mts.map +1 -0
- package/dist/NftDetectionController.mjs +231 -14
- package/dist/NftDetectionController.mjs.map +1 -1
- package/dist/RatesController/RatesController.cjs +189 -0
- package/dist/RatesController/RatesController.cjs.map +1 -0
- package/dist/{types/RatesController/RatesController.d.ts → RatesController/RatesController.d.cts} +3 -3
- package/dist/RatesController/RatesController.d.cts.map +1 -0
- package/dist/RatesController/RatesController.d.mts +44 -0
- package/dist/RatesController/RatesController.d.mts.map +1 -0
- package/dist/RatesController/RatesController.mjs +183 -12
- package/dist/RatesController/RatesController.mjs.map +1 -1
- package/dist/RatesController/index.cjs +7 -0
- package/dist/RatesController/index.cjs.map +1 -0
- package/dist/{types/RatesController/index.d.ts → RatesController/index.d.cts} +3 -3
- package/dist/RatesController/index.d.cts.map +1 -0
- package/dist/RatesController/index.d.mts +3 -0
- package/dist/RatesController/index.d.mts.map +1 -0
- package/dist/RatesController/index.mjs +1 -12
- package/dist/RatesController/index.mjs.map +1 -1
- package/dist/RatesController/types.cjs +3 -0
- package/dist/RatesController/types.cjs.map +1 -0
- package/dist/{types/RatesController/types.d.ts → RatesController/types.d.cts} +4 -4
- package/dist/RatesController/types.d.cts.map +1 -0
- package/dist/RatesController/types.d.mts +100 -0
- package/dist/RatesController/types.d.mts.map +1 -0
- package/dist/RatesController/types.mjs +1 -0
- package/dist/RatesController/types.mjs.map +1 -1
- package/dist/Standards/ERC20Standard.cjs +124 -0
- package/dist/Standards/ERC20Standard.cjs.map +1 -0
- package/dist/{types/Standards/ERC20Standard.d.ts → Standards/ERC20Standard.d.cts} +3 -3
- package/dist/Standards/ERC20Standard.d.cts.map +1 -0
- package/dist/Standards/ERC20Standard.d.mts +49 -0
- package/dist/Standards/ERC20Standard.d.mts.map +1 -0
- package/dist/Standards/ERC20Standard.mjs +121 -8
- package/dist/Standards/ERC20Standard.mjs.map +1 -1
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.cjs +189 -0
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.cjs.map +1 -0
- package/dist/{types/Standards/NftStandards/ERC1155/ERC1155Standard.d.ts → Standards/NftStandards/ERC1155/ERC1155Standard.d.cts} +3 -3
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.d.cts.map +1 -0
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.d.mts +95 -0
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.d.mts.map +1 -0
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.mjs +184 -8
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.mjs.map +1 -1
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.cjs +167 -0
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.cjs.map +1 -0
- package/dist/{types/Standards/NftStandards/ERC721/ERC721Standard.d.ts → Standards/NftStandards/ERC721/ERC721Standard.d.cts} +2 -2
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.d.cts.map +1 -0
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.d.mts +89 -0
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.d.mts.map +1 -0
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.mjs +162 -8
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.mjs.map +1 -1
- package/dist/TokenBalancesController.cjs +136 -0
- package/dist/TokenBalancesController.cjs.map +1 -0
- package/dist/{types/TokenBalancesController.d.ts → TokenBalancesController.d.cts} +7 -7
- package/dist/TokenBalancesController.d.cts.map +1 -0
- package/dist/TokenBalancesController.d.mts +82 -0
- package/dist/TokenBalancesController.d.mts.map +1 -0
- package/dist/TokenBalancesController.mjs +129 -10
- package/dist/TokenBalancesController.mjs.map +1 -1
- package/dist/TokenDetectionController.cjs +368 -0
- package/dist/TokenDetectionController.cjs.map +1 -0
- package/dist/{types/TokenDetectionController.d.ts → TokenDetectionController.d.cts} +10 -10
- package/dist/TokenDetectionController.d.cts.map +1 -0
- package/dist/TokenDetectionController.d.mts +109 -0
- package/dist/TokenDetectionController.d.mts.map +1 -0
- package/dist/TokenDetectionController.mjs +365 -15
- package/dist/TokenDetectionController.mjs.map +1 -1
- package/dist/TokenListController.cjs +274 -0
- package/dist/TokenListController.cjs.map +1 -0
- package/dist/{types/TokenListController.d.ts → TokenListController.d.cts} +5 -5
- package/dist/TokenListController.d.cts.map +1 -0
- package/dist/TokenListController.d.mts +117 -0
- package/dist/TokenListController.d.mts.map +1 -0
- package/dist/TokenListController.mjs +267 -12
- package/dist/TokenListController.mjs.map +1 -1
- package/dist/TokenRatesController.cjs +452 -0
- package/dist/TokenRatesController.cjs.map +1 -0
- package/dist/{types/TokenRatesController.d.ts → TokenRatesController.d.cts} +8 -8
- package/dist/TokenRatesController.d.cts.map +1 -0
- package/dist/TokenRatesController.d.mts +170 -0
- package/dist/TokenRatesController.d.mts.map +1 -0
- package/dist/TokenRatesController.mjs +446 -16
- package/dist/TokenRatesController.mjs.map +1 -1
- package/dist/TokensController.cjs +678 -0
- package/dist/TokensController.cjs.map +1 -0
- package/dist/{types/TokensController.d.ts → TokensController.d.cts} +9 -9
- package/dist/TokensController.d.cts.map +1 -0
- package/dist/TokensController.d.mts +165 -0
- package/dist/TokensController.d.mts.map +1 -0
- package/dist/TokensController.mjs +675 -14
- package/dist/TokensController.mjs.map +1 -1
- package/dist/assetsUtil.cjs +358 -0
- package/dist/assetsUtil.cjs.map +1 -0
- package/dist/{types/assetsUtil.d.ts → assetsUtil.d.cts} +7 -7
- package/dist/assetsUtil.d.cts.map +1 -0
- package/dist/assetsUtil.d.mts +177 -0
- package/dist/assetsUtil.d.mts.map +1 -0
- package/dist/assetsUtil.mjs +343 -36
- package/dist/assetsUtil.mjs.map +1 -1
- package/dist/constants.cjs +10 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/{types/constants.d.ts → constants.d.cts} +1 -1
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +6 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +6 -7
- package/dist/constants.mjs.map +1 -1
- package/dist/crypto-compare-service/crypto-compare.cjs +119 -0
- package/dist/crypto-compare-service/crypto-compare.cjs.map +1 -0
- package/dist/{types/crypto-compare-service/crypto-compare.d.ts → crypto-compare-service/crypto-compare.d.cts} +1 -1
- package/dist/crypto-compare-service/crypto-compare.d.cts.map +1 -0
- package/dist/crypto-compare-service/crypto-compare.d.mts +22 -0
- package/dist/crypto-compare-service/crypto-compare.d.mts.map +1 -0
- package/dist/crypto-compare-service/crypto-compare.mjs +113 -9
- package/dist/crypto-compare-service/crypto-compare.mjs.map +1 -1
- package/dist/crypto-compare-service/index.cjs +7 -0
- package/dist/crypto-compare-service/index.cjs.map +1 -0
- package/dist/crypto-compare-service/index.d.cts +2 -0
- package/dist/crypto-compare-service/index.d.cts.map +1 -0
- package/dist/crypto-compare-service/index.d.mts +2 -0
- package/dist/crypto-compare-service/index.d.mts.map +1 -0
- package/dist/crypto-compare-service/index.mjs +1 -10
- package/dist/crypto-compare-service/index.mjs.map +1 -1
- package/dist/index.cjs +51 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{types/index.d.ts → index.d.cts} +24 -24
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +24 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +13 -80
- package/dist/index.mjs.map +1 -1
- package/dist/token-prices-service/abstract-token-prices-service.cjs +3 -0
- package/dist/token-prices-service/abstract-token-prices-service.cjs.map +1 -0
- package/dist/{types/token-prices-service/abstract-token-prices-service.d.ts → token-prices-service/abstract-token-prices-service.d.cts} +2 -2
- package/dist/token-prices-service/abstract-token-prices-service.d.cts.map +1 -0
- package/dist/token-prices-service/abstract-token-prices-service.d.mts +79 -0
- package/dist/token-prices-service/abstract-token-prices-service.d.mts.map +1 -0
- package/dist/token-prices-service/abstract-token-prices-service.mjs +1 -0
- package/dist/token-prices-service/abstract-token-prices-service.mjs.map +1 -1
- package/dist/token-prices-service/codefi-v2.cjs +352 -0
- package/dist/token-prices-service/codefi-v2.cjs.map +1 -0
- package/dist/{types/token-prices-service/codefi-v2.d.ts → token-prices-service/codefi-v2.d.cts} +3 -3
- package/dist/token-prices-service/codefi-v2.d.cts.map +1 -0
- package/dist/token-prices-service/codefi-v2.d.mts +97 -0
- package/dist/token-prices-service/codefi-v2.d.mts.map +1 -0
- package/dist/token-prices-service/codefi-v2.mjs +347 -12
- package/dist/token-prices-service/codefi-v2.mjs.map +1 -1
- package/dist/token-prices-service/index.cjs +7 -0
- package/dist/token-prices-service/index.cjs.map +1 -0
- package/dist/token-prices-service/index.d.cts +3 -0
- package/dist/token-prices-service/index.d.cts.map +1 -0
- package/dist/token-prices-service/index.d.mts +3 -0
- package/dist/token-prices-service/index.d.mts.map +1 -0
- package/dist/token-prices-service/index.mjs +1 -10
- package/dist/token-prices-service/index.mjs.map +1 -1
- package/dist/token-service.cjs +130 -0
- package/dist/token-service.cjs.map +1 -0
- package/dist/{types/token-service.d.ts → token-service.d.cts} +2 -2
- package/dist/token-service.d.cts.map +1 -0
- package/dist/token-service.d.mts +31 -0
- package/dist/token-service.d.mts.map +1 -0
- package/dist/token-service.mjs +124 -14
- package/dist/token-service.mjs.map +1 -1
- package/package.json +21 -16
- package/dist/AccountTrackerController.js +0 -10
- package/dist/AccountTrackerController.js.map +0 -1
- package/dist/AssetsContractController.js +0 -18
- package/dist/AssetsContractController.js.map +0 -1
- package/dist/CurrencyRateController.js +0 -12
- package/dist/CurrencyRateController.js.map +0 -1
- package/dist/NftController.js +0 -14
- package/dist/NftController.js.map +0 -1
- package/dist/NftDetectionController.js +0 -16
- package/dist/NftDetectionController.js.map +0 -1
- package/dist/RatesController/RatesController.js +0 -14
- package/dist/RatesController/RatesController.js.map +0 -1
- package/dist/RatesController/index.js +0 -13
- package/dist/RatesController/index.js.map +0 -1
- package/dist/RatesController/types.js +0 -1
- package/dist/RatesController/types.js.map +0 -1
- package/dist/Standards/ERC20Standard.js +0 -9
- package/dist/Standards/ERC20Standard.js.map +0 -1
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.js +0 -9
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.js.map +0 -1
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.js +0 -9
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.js.map +0 -1
- package/dist/TokenBalancesController.js +0 -12
- package/dist/TokenBalancesController.js.map +0 -1
- package/dist/TokenDetectionController.js +0 -17
- package/dist/TokenDetectionController.js.map +0 -1
- package/dist/TokenListController.js +0 -14
- package/dist/TokenListController.js.map +0 -1
- package/dist/TokenRatesController.js +0 -18
- package/dist/TokenRatesController.js.map +0 -1
- package/dist/TokensController.js +0 -16
- package/dist/TokensController.js.map +0 -1
- package/dist/assetsUtil.js +0 -38
- package/dist/assetsUtil.js.map +0 -1
- package/dist/chunk-27KOXCQK.mjs +0 -1
- package/dist/chunk-27KOXCQK.mjs.map +0 -1
- package/dist/chunk-2TZK6YZA.js +0 -1405
- package/dist/chunk-2TZK6YZA.js.map +0 -1
- package/dist/chunk-3LPQTUGG.js +0 -434
- package/dist/chunk-3LPQTUGG.js.map +0 -1
- package/dist/chunk-3QDXAE2D.mjs +0 -178
- package/dist/chunk-3QDXAE2D.mjs.map +0 -1
- package/dist/chunk-46KUC5FH.mjs +0 -434
- package/dist/chunk-46KUC5FH.mjs.map +0 -1
- package/dist/chunk-4QZESU46.mjs +0 -530
- package/dist/chunk-4QZESU46.mjs.map +0 -1
- package/dist/chunk-5QLC2MHV.js +0 -215
- package/dist/chunk-5QLC2MHV.js.map +0 -1
- package/dist/chunk-7K6PSEAA.js +0 -1
- package/dist/chunk-7K6PSEAA.js.map +0 -1
- package/dist/chunk-AX522TDL.mjs +0 -85
- package/dist/chunk-AX522TDL.mjs.map +0 -1
- package/dist/chunk-AZSIKIMK.mjs +0 -429
- package/dist/chunk-AZSIKIMK.mjs.map +0 -1
- package/dist/chunk-BBCZM5P4.js +0 -300
- package/dist/chunk-BBCZM5P4.js.map +0 -1
- package/dist/chunk-BZEAPSD5.mjs +0 -215
- package/dist/chunk-BZEAPSD5.mjs.map +0 -1
- package/dist/chunk-C7LNCQXM.mjs +0 -300
- package/dist/chunk-C7LNCQXM.mjs.map +0 -1
- package/dist/chunk-CP3HC7AQ.mjs +0 -12
- package/dist/chunk-CP3HC7AQ.mjs.map +0 -1
- package/dist/chunk-FWKV5FGP.mjs +0 -71
- package/dist/chunk-FWKV5FGP.mjs.map +0 -1
- package/dist/chunk-GDFLKKDY.js +0 -71
- package/dist/chunk-GDFLKKDY.js.map +0 -1
- package/dist/chunk-GW6RE66P.mjs +0 -210
- package/dist/chunk-GW6RE66P.mjs.map +0 -1
- package/dist/chunk-HVOIBGYN.js +0 -282
- package/dist/chunk-HVOIBGYN.js.map +0 -1
- package/dist/chunk-ISK2VSBB.js +0 -178
- package/dist/chunk-ISK2VSBB.js.map +0 -1
- package/dist/chunk-JCR4H6YL.js +0 -115
- package/dist/chunk-JCR4H6YL.js.map +0 -1
- package/dist/chunk-JJX7TMH5.mjs +0 -135
- package/dist/chunk-JJX7TMH5.mjs.map +0 -1
- package/dist/chunk-JMZ7KWJS.js +0 -157
- package/dist/chunk-JMZ7KWJS.js.map +0 -1
- package/dist/chunk-JYHAAA6W.mjs +0 -1
- package/dist/chunk-JYHAAA6W.mjs.map +0 -1
- package/dist/chunk-K7A3EOIM.js +0 -85
- package/dist/chunk-K7A3EOIM.js.map +0 -1
- package/dist/chunk-KPBNX6GP.mjs +0 -215
- package/dist/chunk-KPBNX6GP.mjs.map +0 -1
- package/dist/chunk-LKVWPNXY.js +0 -429
- package/dist/chunk-LKVWPNXY.js.map +0 -1
- package/dist/chunk-MZI3SDQN.js +0 -215
- package/dist/chunk-MZI3SDQN.js.map +0 -1
- package/dist/chunk-NDUMUEE6.js +0 -812
- package/dist/chunk-NDUMUEE6.js.map +0 -1
- package/dist/chunk-OBUR4TXH.js +0 -1
- package/dist/chunk-OBUR4TXH.js.map +0 -1
- package/dist/chunk-RGHTNZQ6.js +0 -12
- package/dist/chunk-RGHTNZQ6.js.map +0 -1
- package/dist/chunk-S5CFNNOM.mjs +0 -115
- package/dist/chunk-S5CFNNOM.mjs.map +0 -1
- package/dist/chunk-SK2B36Q4.mjs +0 -1405
- package/dist/chunk-SK2B36Q4.mjs.map +0 -1
- package/dist/chunk-TFLYM4PY.mjs +0 -291
- package/dist/chunk-TFLYM4PY.mjs.map +0 -1
- package/dist/chunk-TIFLP53R.js +0 -210
- package/dist/chunk-TIFLP53R.js.map +0 -1
- package/dist/chunk-TTH3ES66.mjs +0 -1
- package/dist/chunk-TTH3ES66.mjs.map +0 -1
- package/dist/chunk-UKXD6WUT.mjs +0 -157
- package/dist/chunk-UKXD6WUT.mjs.map +0 -1
- package/dist/chunk-UUF4E7OG.js +0 -530
- package/dist/chunk-UUF4E7OG.js.map +0 -1
- package/dist/chunk-V6DNVROD.js +0 -348
- package/dist/chunk-V6DNVROD.js.map +0 -1
- package/dist/chunk-XC3SOOGC.js +0 -1
- package/dist/chunk-XC3SOOGC.js.map +0 -1
- package/dist/chunk-XMQA5NLX.mjs +0 -812
- package/dist/chunk-XMQA5NLX.mjs.map +0 -1
- package/dist/chunk-XQO3EG4J.mjs +0 -348
- package/dist/chunk-XQO3EG4J.mjs.map +0 -1
- package/dist/chunk-XUI43LEZ.mjs +0 -30
- package/dist/chunk-XUI43LEZ.mjs.map +0 -1
- package/dist/chunk-YGGUAMHV.js +0 -135
- package/dist/chunk-YGGUAMHV.js.map +0 -1
- package/dist/chunk-Z4BLTVTB.js +0 -30
- package/dist/chunk-Z4BLTVTB.js.map +0 -1
- package/dist/chunk-Z7RMCHD4.mjs +0 -282
- package/dist/chunk-Z7RMCHD4.mjs.map +0 -1
- package/dist/chunk-ZAR4BIOC.js +0 -291
- package/dist/chunk-ZAR4BIOC.js.map +0 -1
- package/dist/constants.js +0 -8
- package/dist/constants.js.map +0 -1
- package/dist/crypto-compare-service/crypto-compare.js +0 -10
- package/dist/crypto-compare-service/crypto-compare.js.map +0 -1
- package/dist/crypto-compare-service/index.js +0 -11
- package/dist/crypto-compare-service/index.js.map +0 -1
- package/dist/index.js +0 -81
- package/dist/index.js.map +0 -1
- package/dist/token-prices-service/abstract-token-prices-service.js +0 -1
- package/dist/token-prices-service/abstract-token-prices-service.js.map +0 -1
- package/dist/token-prices-service/codefi-v2.js +0 -14
- package/dist/token-prices-service/codefi-v2.js.map +0 -1
- package/dist/token-prices-service/index.js +0 -11
- package/dist/token-prices-service/index.js.map +0 -1
- package/dist/token-service.js +0 -15
- package/dist/token-service.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/AccountTrackerController.d.ts.map +0 -1
- package/dist/types/AssetsContractController.d.ts.map +0 -1
- package/dist/types/CurrencyRateController.d.ts.map +0 -1
- package/dist/types/NftController.d.ts.map +0 -1
- package/dist/types/NftDetectionController.d.ts.map +0 -1
- package/dist/types/RatesController/RatesController.d.ts.map +0 -1
- package/dist/types/RatesController/index.d.ts.map +0 -1
- package/dist/types/RatesController/types.d.ts.map +0 -1
- package/dist/types/Standards/ERC20Standard.d.ts.map +0 -1
- package/dist/types/Standards/NftStandards/ERC1155/ERC1155Standard.d.ts.map +0 -1
- package/dist/types/Standards/NftStandards/ERC721/ERC721Standard.d.ts.map +0 -1
- package/dist/types/TokenBalancesController.d.ts.map +0 -1
- package/dist/types/TokenDetectionController.d.ts.map +0 -1
- package/dist/types/TokenListController.d.ts.map +0 -1
- package/dist/types/TokenRatesController.d.ts.map +0 -1
- package/dist/types/TokensController.d.ts.map +0 -1
- package/dist/types/assetsUtil.d.ts.map +0 -1
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/crypto-compare-service/crypto-compare.d.ts.map +0 -1
- package/dist/types/crypto-compare-service/index.d.ts +0 -2
- package/dist/types/crypto-compare-service/index.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/token-prices-service/abstract-token-prices-service.d.ts.map +0 -1
- package/dist/types/token-prices-service/codefi-v2.d.ts.map +0 -1
- package/dist/types/token-prices-service/index.d.ts +0 -3
- package/dist/types/token-prices-service/index.d.ts.map +0 -1
- package/dist/types/token-service.d.ts.map +0 -1
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import type { AccountsControllerSelectedEvmAccountChangeEvent, AccountsControllerGetAccountAction, AccountsControllerGetSelectedAccountAction } from "@metamask/accounts-controller";
|
|
2
|
+
import type { AddApprovalRequest } from "@metamask/approval-controller";
|
|
3
|
+
import type { RestrictedControllerMessenger, ControllerStateChangeEvent } from "@metamask/base-controller";
|
|
4
|
+
import { BaseController, type ControllerGetStateAction } from "@metamask/base-controller";
|
|
5
|
+
import type { NetworkClientId, NetworkControllerGetNetworkClientByIdAction, NetworkControllerNetworkDidChangeEvent } from "@metamask/network-controller";
|
|
6
|
+
import type { PreferencesControllerStateChangeEvent } from "@metamask/preferences-controller";
|
|
7
|
+
import type { Hex } from "@metamask/utils";
|
|
8
|
+
import type { AssetsContractControllerGetERC1155BalanceOfAction, AssetsContractControllerGetERC1155TokenURIAction, AssetsContractControllerGetERC721AssetNameAction, AssetsContractControllerGetERC721AssetSymbolAction, AssetsContractControllerGetERC721OwnerOfAction, AssetsContractControllerGetERC721TokenURIAction } from "./AssetsContractController.mjs";
|
|
9
|
+
import { Source } from "./constants.mjs";
|
|
10
|
+
import type { Collection, Attributes, LastSale, TopBid } from "./NftDetectionController.mjs";
|
|
11
|
+
type NFTStandardType = 'ERC721' | 'ERC1155';
|
|
12
|
+
type SuggestedNftMeta = {
|
|
13
|
+
asset: {
|
|
14
|
+
address: string;
|
|
15
|
+
tokenId: string;
|
|
16
|
+
} & NftMetadata;
|
|
17
|
+
id: string;
|
|
18
|
+
time: number;
|
|
19
|
+
type: NFTStandardType;
|
|
20
|
+
interactingAddress: string;
|
|
21
|
+
origin: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @type Nft
|
|
25
|
+
*
|
|
26
|
+
* NFT representation
|
|
27
|
+
* @property address - Hex address of a ERC721 contract
|
|
28
|
+
* @property description - The NFT description
|
|
29
|
+
* @property image - URI of custom NFT image associated with this tokenId
|
|
30
|
+
* @property name - Name associated with this tokenId and contract address
|
|
31
|
+
* @property tokenId - The NFT identifier
|
|
32
|
+
* @property numberOfSales - Number of sales
|
|
33
|
+
* @property backgroundColor - The background color to be displayed with the item
|
|
34
|
+
* @property imagePreview - URI of a smaller image associated with this NFT
|
|
35
|
+
* @property imageThumbnail - URI of a thumbnail image associated with this NFT
|
|
36
|
+
* @property imageOriginal - URI of the original image associated with this NFT
|
|
37
|
+
* @property animation - URI of a animation associated with this NFT
|
|
38
|
+
* @property animationOriginal - URI of the original animation associated with this NFT
|
|
39
|
+
* @property externalLink - External link containing additional information
|
|
40
|
+
* @property creator - The NFT owner information object
|
|
41
|
+
* @property isCurrentlyOwned - Boolean indicating whether the address/chainId combination where it's currently stored currently owns this NFT
|
|
42
|
+
* @property transactionId - Transaction Id associated with the NFT
|
|
43
|
+
*/
|
|
44
|
+
export type Nft = {
|
|
45
|
+
tokenId: string;
|
|
46
|
+
address: string;
|
|
47
|
+
isCurrentlyOwned?: boolean;
|
|
48
|
+
} & NftMetadata;
|
|
49
|
+
/**
|
|
50
|
+
* @type NftContract
|
|
51
|
+
*
|
|
52
|
+
* NFT contract information representation
|
|
53
|
+
* @property name - Contract name
|
|
54
|
+
* @property logo - Contract logo
|
|
55
|
+
* @property address - Contract address
|
|
56
|
+
* @property symbol - Contract symbol
|
|
57
|
+
* @property description - Contract description
|
|
58
|
+
* @property totalSupply - Total supply of NFTs
|
|
59
|
+
* @property assetContractType - The NFT type, it could be `semi-fungible` or `non-fungible`
|
|
60
|
+
* @property createdDate - Creation date
|
|
61
|
+
* @property schemaName - The schema followed by the contract, it could be `ERC721` or `ERC1155`
|
|
62
|
+
* @property externalLink - External link containing additional information
|
|
63
|
+
*/
|
|
64
|
+
export type NftContract = {
|
|
65
|
+
name?: string;
|
|
66
|
+
logo?: string;
|
|
67
|
+
address: string;
|
|
68
|
+
symbol?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
totalSupply?: string;
|
|
71
|
+
assetContractType?: string;
|
|
72
|
+
createdDate?: string;
|
|
73
|
+
schemaName?: string;
|
|
74
|
+
externalLink?: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* @type NftMetadata
|
|
78
|
+
*
|
|
79
|
+
* NFT custom information
|
|
80
|
+
* @property name - NFT custom name
|
|
81
|
+
* @property description - The NFT description
|
|
82
|
+
* @property numberOfSales - Number of sales
|
|
83
|
+
* @property backgroundColor - The background color to be displayed with the item
|
|
84
|
+
* @property image - Image custom image URI
|
|
85
|
+
* @property imagePreview - URI of a smaller image associated with this NFT
|
|
86
|
+
* @property imageThumbnail - URI of a thumbnail image associated with this NFT
|
|
87
|
+
* @property imageOriginal - URI of the original image associated with this NFT
|
|
88
|
+
* @property animation - URI of a animation associated with this NFT
|
|
89
|
+
* @property animationOriginal - URI of the original animation associated with this NFT
|
|
90
|
+
* @property externalLink - External link containing additional information
|
|
91
|
+
* @property creator - The NFT owner information object
|
|
92
|
+
* @property standard - NFT standard name for the NFT, e.g., ERC-721 or ERC-1155
|
|
93
|
+
*/
|
|
94
|
+
export type NftMetadata = {
|
|
95
|
+
name: string | null;
|
|
96
|
+
description: string | null;
|
|
97
|
+
image: string | null;
|
|
98
|
+
standard: string | null;
|
|
99
|
+
favorite?: boolean;
|
|
100
|
+
numberOfSales?: number;
|
|
101
|
+
backgroundColor?: string;
|
|
102
|
+
imagePreview?: string;
|
|
103
|
+
imageThumbnail?: string;
|
|
104
|
+
imageOriginal?: string;
|
|
105
|
+
animation?: string;
|
|
106
|
+
animationOriginal?: string;
|
|
107
|
+
externalLink?: string;
|
|
108
|
+
creator?: string;
|
|
109
|
+
transactionId?: string;
|
|
110
|
+
tokenURI?: string | null;
|
|
111
|
+
collection?: Collection;
|
|
112
|
+
address?: string;
|
|
113
|
+
attributes?: Attributes[];
|
|
114
|
+
lastSale?: LastSale;
|
|
115
|
+
rarityRank?: string;
|
|
116
|
+
topBid?: TopBid;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* @type NftControllerState
|
|
120
|
+
*
|
|
121
|
+
* NFT controller state
|
|
122
|
+
* @property allNftContracts - Object containing NFT contract information
|
|
123
|
+
* @property allNfts - Object containing NFTs per account and network
|
|
124
|
+
* @property ignoredNfts - List of NFTs that should be ignored
|
|
125
|
+
*/
|
|
126
|
+
export type NftControllerState = {
|
|
127
|
+
allNftContracts: {
|
|
128
|
+
[key: string]: {
|
|
129
|
+
[chainId: Hex]: NftContract[];
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
allNfts: {
|
|
133
|
+
[key: string]: {
|
|
134
|
+
[chainId: Hex]: Nft[];
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
ignoredNfts: Nft[];
|
|
138
|
+
};
|
|
139
|
+
type NftAsset = {
|
|
140
|
+
address: string;
|
|
141
|
+
tokenId: string;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* The name of the {@link NftController}.
|
|
145
|
+
*/
|
|
146
|
+
declare const controllerName = "NftController";
|
|
147
|
+
export type NftControllerGetStateAction = ControllerGetStateAction<typeof controllerName, NftControllerState>;
|
|
148
|
+
export type NftControllerActions = NftControllerGetStateAction;
|
|
149
|
+
/**
|
|
150
|
+
* The external actions available to the {@link NftController}.
|
|
151
|
+
*/
|
|
152
|
+
export type AllowedActions = AddApprovalRequest | AccountsControllerGetAccountAction | AccountsControllerGetSelectedAccountAction | NetworkControllerGetNetworkClientByIdAction | AssetsContractControllerGetERC721AssetNameAction | AssetsContractControllerGetERC721AssetSymbolAction | AssetsContractControllerGetERC721TokenURIAction | AssetsContractControllerGetERC721OwnerOfAction | AssetsContractControllerGetERC1155BalanceOfAction | AssetsContractControllerGetERC1155TokenURIAction;
|
|
153
|
+
export type AllowedEvents = PreferencesControllerStateChangeEvent | NetworkControllerNetworkDidChangeEvent | AccountsControllerSelectedEvmAccountChangeEvent;
|
|
154
|
+
export type NftControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, NftControllerState>;
|
|
155
|
+
export type NftControllerEvents = NftControllerStateChangeEvent;
|
|
156
|
+
/**
|
|
157
|
+
* The messenger of the {@link NftController}.
|
|
158
|
+
*/
|
|
159
|
+
export type NftControllerMessenger = RestrictedControllerMessenger<typeof controllerName, NftControllerActions | AllowedActions, NftControllerEvents | AllowedEvents, AllowedActions['type'], AllowedEvents['type']>;
|
|
160
|
+
export declare const getDefaultNftControllerState: () => NftControllerState;
|
|
161
|
+
/**
|
|
162
|
+
* Controller that stores assets and exposes convenience methods
|
|
163
|
+
*/
|
|
164
|
+
export declare class NftController extends BaseController<typeof controllerName, NftControllerState, NftControllerMessenger> {
|
|
165
|
+
#private;
|
|
166
|
+
/**
|
|
167
|
+
* Optional API key to use with opensea
|
|
168
|
+
*/
|
|
169
|
+
openSeaApiKey?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Creates an NftController instance.
|
|
172
|
+
*
|
|
173
|
+
* @param options - The controller options.
|
|
174
|
+
* @param options.chainId - The chain ID of the current network.
|
|
175
|
+
* @param options.ipfsGateway - The configured IPFS gateway.
|
|
176
|
+
* @param options.openSeaEnabled - Controls whether the OpenSea API is used.
|
|
177
|
+
* @param options.useIpfsSubdomains - Controls whether IPFS subdomains are used.
|
|
178
|
+
* @param options.isIpfsGatewayEnabled - Controls whether IPFS is enabled or not.
|
|
179
|
+
* @param options.onNftAdded - Callback that is called when an NFT is added. Currently used pass data
|
|
180
|
+
* for tracking the NFT added event.
|
|
181
|
+
* @param options.messenger - The controller messenger.
|
|
182
|
+
* @param options.state - Initial state to set on this controller.
|
|
183
|
+
*/
|
|
184
|
+
constructor({ chainId: initialChainId, ipfsGateway, openSeaEnabled, useIpfsSubdomains, isIpfsGatewayEnabled, onNftAdded, messenger, state, }: {
|
|
185
|
+
chainId: Hex;
|
|
186
|
+
ipfsGateway?: string;
|
|
187
|
+
openSeaEnabled?: boolean;
|
|
188
|
+
useIpfsSubdomains?: boolean;
|
|
189
|
+
isIpfsGatewayEnabled?: boolean;
|
|
190
|
+
onNftAdded?: (data: {
|
|
191
|
+
address: string;
|
|
192
|
+
symbol: string | undefined;
|
|
193
|
+
tokenId: string;
|
|
194
|
+
standard: string | null;
|
|
195
|
+
source: string;
|
|
196
|
+
}) => void;
|
|
197
|
+
messenger: NftControllerMessenger;
|
|
198
|
+
state?: Partial<NftControllerState>;
|
|
199
|
+
});
|
|
200
|
+
getNftApi(): string;
|
|
201
|
+
/**
|
|
202
|
+
* Adds a new suggestedAsset to state. Parameters will be validated according to
|
|
203
|
+
* asset type being watched. A `<suggestedNftMeta.id>:pending` hub event will be emitted once added.
|
|
204
|
+
*
|
|
205
|
+
* @param asset - The asset to be watched. For now ERC721 and ERC1155 tokens are accepted.
|
|
206
|
+
* @param asset.address - The address of the asset contract.
|
|
207
|
+
* @param asset.tokenId - The ID of the asset.
|
|
208
|
+
* @param type - The asset type.
|
|
209
|
+
* @param origin - Domain origin to register the asset from.
|
|
210
|
+
* @param options - Options bag.
|
|
211
|
+
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
212
|
+
* @param options.userAddress - The address of the account where the NFT is being added.
|
|
213
|
+
* @returns Object containing a Promise resolving to the suggestedAsset address if accepted.
|
|
214
|
+
*/
|
|
215
|
+
watchNft(asset: NftAsset, type: NFTStandardType, origin: string, { networkClientId, userAddress, }?: {
|
|
216
|
+
networkClientId?: NetworkClientId;
|
|
217
|
+
userAddress?: string;
|
|
218
|
+
}): Promise<void>;
|
|
219
|
+
/**
|
|
220
|
+
* Sets an OpenSea API key to retrieve NFT information.
|
|
221
|
+
*
|
|
222
|
+
* @param openSeaApiKey - OpenSea API key.
|
|
223
|
+
*/
|
|
224
|
+
setApiKey(openSeaApiKey: string): void;
|
|
225
|
+
/**
|
|
226
|
+
* Checks the ownership of a ERC-721 or ERC-1155 NFT for a given address.
|
|
227
|
+
*
|
|
228
|
+
* @param ownerAddress - User public address.
|
|
229
|
+
* @param nftAddress - NFT contract address.
|
|
230
|
+
* @param tokenId - NFT token ID.
|
|
231
|
+
* @param options - Options bag.
|
|
232
|
+
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
233
|
+
* @returns Promise resolving the NFT ownership.
|
|
234
|
+
*/
|
|
235
|
+
isNftOwner(ownerAddress: string, nftAddress: string, tokenId: string, { networkClientId, }?: {
|
|
236
|
+
networkClientId?: NetworkClientId;
|
|
237
|
+
}): Promise<boolean>;
|
|
238
|
+
/**
|
|
239
|
+
* Verifies currently selected address owns entered NFT address/tokenId combo and
|
|
240
|
+
* adds the NFT and respective NFT contract to the stored NFT and NFT contracts lists.
|
|
241
|
+
*
|
|
242
|
+
* @param address - Hex address of the NFT contract.
|
|
243
|
+
* @param tokenId - The NFT identifier.
|
|
244
|
+
* @param options - an object of arguments
|
|
245
|
+
* @param options.userAddress - The address of the current user.
|
|
246
|
+
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
247
|
+
* @param options.source - Whether the NFT was detected, added manually or suggested by a dapp.
|
|
248
|
+
*/
|
|
249
|
+
addNftVerifyOwnership(address: string, tokenId: string, { userAddress, networkClientId, source, }?: {
|
|
250
|
+
userAddress?: string;
|
|
251
|
+
networkClientId?: NetworkClientId;
|
|
252
|
+
source?: Source;
|
|
253
|
+
}): Promise<void>;
|
|
254
|
+
/**
|
|
255
|
+
* Adds an NFT and respective NFT contract to the stored NFT and NFT contracts lists.
|
|
256
|
+
*
|
|
257
|
+
* @param tokenAddress - Hex address of the NFT contract.
|
|
258
|
+
* @param tokenId - The NFT identifier.
|
|
259
|
+
* @param options - an object of arguments
|
|
260
|
+
* @param options.nftMetadata - NFT optional metadata.
|
|
261
|
+
* @param options.userAddress - The address of the current user.
|
|
262
|
+
* @param options.source - Whether the NFT was detected, added manually or suggested by a dapp.
|
|
263
|
+
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
264
|
+
* @returns Promise resolving to the current NFT list.
|
|
265
|
+
*/
|
|
266
|
+
addNft(tokenAddress: string, tokenId: string, { nftMetadata, userAddress, source, networkClientId, }?: {
|
|
267
|
+
nftMetadata?: NftMetadata;
|
|
268
|
+
userAddress?: string;
|
|
269
|
+
source?: Source;
|
|
270
|
+
networkClientId?: NetworkClientId;
|
|
271
|
+
}): Promise<void>;
|
|
272
|
+
/**
|
|
273
|
+
* Refetches NFT metadata and updates the state
|
|
274
|
+
*
|
|
275
|
+
* @param options - Options for refetching NFT metadata
|
|
276
|
+
* @param options.nfts - nfts to update metadata for.
|
|
277
|
+
* @param options.userAddress - The current user address
|
|
278
|
+
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
279
|
+
*/
|
|
280
|
+
updateNftMetadata({ nfts, userAddress, networkClientId, }: {
|
|
281
|
+
nfts: Nft[];
|
|
282
|
+
userAddress?: string;
|
|
283
|
+
networkClientId?: NetworkClientId;
|
|
284
|
+
}): Promise<void>;
|
|
285
|
+
/**
|
|
286
|
+
* Removes an NFT from the stored token list.
|
|
287
|
+
*
|
|
288
|
+
* @param address - Hex address of the NFT contract.
|
|
289
|
+
* @param tokenId - Token identifier of the NFT.
|
|
290
|
+
* @param options - an object of arguments
|
|
291
|
+
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
292
|
+
* @param options.userAddress - The address of the account where the NFT is being removed.
|
|
293
|
+
*/
|
|
294
|
+
removeNft(address: string, tokenId: string, { networkClientId, userAddress, }?: {
|
|
295
|
+
networkClientId?: NetworkClientId;
|
|
296
|
+
userAddress?: string;
|
|
297
|
+
}): void;
|
|
298
|
+
/**
|
|
299
|
+
* Removes an NFT from the stored token list and saves it in ignored NFTs list.
|
|
300
|
+
*
|
|
301
|
+
* @param address - Hex address of the NFT contract.
|
|
302
|
+
* @param tokenId - Token identifier of the NFT.
|
|
303
|
+
* @param options - an object of arguments
|
|
304
|
+
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
305
|
+
* @param options.userAddress - The address of the account where the NFT is being removed.
|
|
306
|
+
*/
|
|
307
|
+
removeAndIgnoreNft(address: string, tokenId: string, { networkClientId, userAddress, }?: {
|
|
308
|
+
networkClientId?: NetworkClientId;
|
|
309
|
+
userAddress?: string;
|
|
310
|
+
}): void;
|
|
311
|
+
/**
|
|
312
|
+
* Removes all NFTs from the ignored list.
|
|
313
|
+
*/
|
|
314
|
+
clearIgnoredNfts(): void;
|
|
315
|
+
/**
|
|
316
|
+
* Checks whether input NFT is still owned by the user
|
|
317
|
+
* And updates the isCurrentlyOwned value on the NFT object accordingly.
|
|
318
|
+
*
|
|
319
|
+
* @param nft - The NFT object to check and update.
|
|
320
|
+
* @param batch - A boolean indicating whether this method is being called as part of a batch or single update.
|
|
321
|
+
* @param accountParams - The userAddress and chainId to check ownership against
|
|
322
|
+
* @param accountParams.userAddress - the address passed through the confirmed transaction flow to ensure assets are stored to the correct account
|
|
323
|
+
* @param accountParams.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
324
|
+
* @returns the NFT with the updated isCurrentlyOwned value
|
|
325
|
+
*/
|
|
326
|
+
checkAndUpdateSingleNftOwnershipStatus(nft: Nft, batch: boolean, { userAddress, networkClientId, }?: {
|
|
327
|
+
networkClientId?: NetworkClientId;
|
|
328
|
+
userAddress?: string;
|
|
329
|
+
}): Promise<{
|
|
330
|
+
isCurrentlyOwned: boolean | undefined;
|
|
331
|
+
tokenId: string;
|
|
332
|
+
address: string;
|
|
333
|
+
name: string | null;
|
|
334
|
+
description: string | null;
|
|
335
|
+
image: string | null;
|
|
336
|
+
standard: string | null;
|
|
337
|
+
favorite?: boolean | undefined;
|
|
338
|
+
numberOfSales?: number | undefined;
|
|
339
|
+
backgroundColor?: string | undefined;
|
|
340
|
+
imagePreview?: string | undefined;
|
|
341
|
+
imageThumbnail?: string | undefined;
|
|
342
|
+
imageOriginal?: string | undefined;
|
|
343
|
+
animation?: string | undefined;
|
|
344
|
+
animationOriginal?: string | undefined;
|
|
345
|
+
externalLink?: string | undefined;
|
|
346
|
+
creator?: string | undefined;
|
|
347
|
+
transactionId?: string | undefined;
|
|
348
|
+
tokenURI?: string | null | undefined;
|
|
349
|
+
collection?: Collection | undefined;
|
|
350
|
+
attributes?: Attributes[] | undefined;
|
|
351
|
+
lastSale?: LastSale | undefined;
|
|
352
|
+
rarityRank?: string | undefined;
|
|
353
|
+
topBid?: TopBid | undefined;
|
|
354
|
+
}>;
|
|
355
|
+
/**
|
|
356
|
+
* Checks whether NFTs associated with current selectedAddress/chainId combination are still owned by the user
|
|
357
|
+
* And updates the isCurrentlyOwned value on each accordingly.
|
|
358
|
+
* @param options - an object of arguments
|
|
359
|
+
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
360
|
+
* @param options.userAddress - The address of the account where the NFT ownership status is checked/updated.
|
|
361
|
+
*/
|
|
362
|
+
checkAndUpdateAllNftsOwnershipStatus({ networkClientId, userAddress, }?: {
|
|
363
|
+
networkClientId?: NetworkClientId;
|
|
364
|
+
userAddress?: string;
|
|
365
|
+
}): Promise<void>;
|
|
366
|
+
/**
|
|
367
|
+
* Update NFT favorite status.
|
|
368
|
+
*
|
|
369
|
+
* @param address - Hex address of the NFT contract.
|
|
370
|
+
* @param tokenId - Hex address of the NFT contract.
|
|
371
|
+
* @param favorite - NFT new favorite status.
|
|
372
|
+
* @param options - an object of arguments
|
|
373
|
+
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
|
374
|
+
* @param options.userAddress - The address of the account where the NFT is being removed.
|
|
375
|
+
*/
|
|
376
|
+
updateNftFavoriteStatus(address: string, tokenId: string, favorite: boolean, { networkClientId, userAddress, }?: {
|
|
377
|
+
networkClientId?: NetworkClientId;
|
|
378
|
+
userAddress?: string;
|
|
379
|
+
}): void;
|
|
380
|
+
/**
|
|
381
|
+
* Returns an NFT by the address and token id.
|
|
382
|
+
*
|
|
383
|
+
* @param address - Hex address of the NFT contract.
|
|
384
|
+
* @param tokenId - Number that represents the id of the token.
|
|
385
|
+
* @param selectedAddress - Hex address of the user account.
|
|
386
|
+
* @param chainId - Id of the current network.
|
|
387
|
+
* @returns Object containing the NFT and its position in the array
|
|
388
|
+
*/
|
|
389
|
+
findNftByAddressAndTokenId(address: string, tokenId: string, selectedAddress: string, chainId: Hex): {
|
|
390
|
+
nft: Nft;
|
|
391
|
+
index: number;
|
|
392
|
+
} | null;
|
|
393
|
+
/**
|
|
394
|
+
* Update NFT data.
|
|
395
|
+
*
|
|
396
|
+
* @param nft - NFT object to find the right NFT to updates.
|
|
397
|
+
* @param updates - NFT partial object to update properties of the NFT.
|
|
398
|
+
* @param selectedAddress - Hex address of the user account.
|
|
399
|
+
* @param chainId - Id of the current network.
|
|
400
|
+
*/
|
|
401
|
+
updateNft(nft: Nft, updates: Partial<Nft>, selectedAddress: string, chainId: Hex): void;
|
|
402
|
+
/**
|
|
403
|
+
* Resets the transaction status of an NFT.
|
|
404
|
+
*
|
|
405
|
+
* @param transactionId - NFT transaction id.
|
|
406
|
+
* @param selectedAddress - Hex address of the user account.
|
|
407
|
+
* @param chainId - Id of the current network.
|
|
408
|
+
* @returns a boolean indicating if the reset was well succeeded or not
|
|
409
|
+
*/
|
|
410
|
+
resetNftTransactionStatusByTransactionId(transactionId: string, selectedAddress: string, chainId: Hex): boolean;
|
|
411
|
+
/**
|
|
412
|
+
* Fetches NFT Collection Metadata from the NFT API.
|
|
413
|
+
*
|
|
414
|
+
* @param contractAddresses - The contract addresses of the NFTs.
|
|
415
|
+
* @param chainId - The chain ID of the network where the NFT is located.
|
|
416
|
+
* @returns NFT collections metadata.
|
|
417
|
+
*/
|
|
418
|
+
getNFTContractInfo(contractAddresses: string[], chainId: Hex): Promise<{
|
|
419
|
+
collections: Collection[];
|
|
420
|
+
}>;
|
|
421
|
+
_requestApproval(suggestedNftMeta: SuggestedNftMeta): Promise<unknown>;
|
|
422
|
+
}
|
|
423
|
+
export default NftController;
|
|
424
|
+
//# sourceMappingURL=NftController.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NftController.d.mts","sourceRoot":"","sources":["../src/NftController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,+CAA+C,EAC/C,kCAAkC,EAClC,0CAA0C,EAC3C,sCAAsC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,sCAAsC;AACxE,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,EACL,cAAc,EACd,KAAK,wBAAwB,EAC9B,kCAAkC;AAenC,OAAO,KAAK,EACV,eAAe,EACf,2CAA2C,EAC3C,sCAAsC,EAEvC,qCAAqC;AACtC,OAAO,KAAK,EACV,qCAAqC,EAEtC,yCAAyC;AAE1C,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAM3C,OAAO,KAAK,EACV,iDAAiD,EACjD,gDAAgD,EAChD,gDAAgD,EAChD,kDAAkD,EAClD,8CAA8C,EAC9C,+CAA+C,EAChD,uCAAmC;AAMpC,OAAO,EAAE,MAAM,EAAE,wBAAoB;AACrC,OAAO,KAAK,EAGV,UAAU,EACV,UAAU,EACV,QAAQ,EAER,MAAM,EACP,qCAAiC;AAElC,KAAK,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5C,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,WAAW,CAAC;IAC1D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,GAAG,GACX;IACE,OAA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