@tonappchain/sdk 0.7.0-rc9 → 0.7.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/LICENSE +20 -20
- package/README.md +198 -191
- package/dist/artifacts/dev/index.d.ts +9 -0
- package/dist/artifacts/dev/index.js +52 -0
- package/dist/artifacts/dev/tac/addresses.d.ts +4 -0
- package/dist/artifacts/dev/tac/addresses.js +8 -0
- package/dist/artifacts/dev/tac/artifacts.d.ts +330 -0
- package/dist/artifacts/dev/tac/artifacts.js +26 -0
- package/dist/artifacts/dev/tac/endpoints.d.ts +2 -0
- package/dist/artifacts/dev/tac/endpoints.js +5 -0
- package/dist/artifacts/dev/tac/index.d.ts +6 -0
- package/dist/artifacts/dev/tac/index.js +43 -0
- package/dist/artifacts/dev/tac/internal/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +296 -0
- package/dist/artifacts/dev/tac/internal/artifacts/contracts/core/Structs.sol/IStructsInterface.json +1087 -0
- package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/ICrossChainLayer.sol/ICrossChainLayer.json +114 -0
- package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/ISettings.sol/ISettings.json +194 -0
- package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/ITokenUtils.sol/ITokenUtils.json +164 -0
- package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC20.sol/ICrossChainLayerERC20.json +278 -0
- package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC721.sol/ICrossChainLayerERC721.json +380 -0
- package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/tokens/IERC20WithDecimals.sol/IERC20WithDecimals.json +207 -0
- package/dist/artifacts/dev/tac/internal/artifacts/contracts/smart-account/interfaces/ISAFactory.sol/ISAFactory.json +103 -0
- package/dist/artifacts/dev/tac/internal/artifacts/contracts/smart-account/interfaces/ITacSmartAccount.sol/ITacSmartAccount.json +181 -0
- package/dist/artifacts/dev/tac/internal/scripts/utils/encoding.d.ts +4 -0
- package/dist/artifacts/dev/tac/internal/scripts/utils/encoding.js +18 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.d.ts +199 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/common.d.ts +50 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/common.js +2 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.d.ts +356 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.js +2 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.d.ts +75 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.js +2 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ISettings.d.ts +123 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ISettings.js +2 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.d.ts +99 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.js +2 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.d.ts +182 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.js +2 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.d.ts +244 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.js +2 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.d.ts +133 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.js +2 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.d.ts +77 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.js +2 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.d.ts +127 -0
- package/dist/artifacts/dev/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.js +2 -0
- package/dist/artifacts/dev/tac/multicall.d.ts +1 -0
- package/dist/artifacts/dev/tac/multicall.js +22 -0
- package/dist/artifacts/dev/tac/structs.d.ts +1 -0
- package/dist/artifacts/dev/tac/structs.js +2 -0
- package/dist/artifacts/dev/tac/utils.d.ts +1 -0
- package/dist/artifacts/dev/tac/utils.js +5 -0
- package/dist/artifacts/dev/tac/wrappers.d.ts +9 -0
- package/dist/artifacts/dev/tac/wrappers.js +2 -0
- package/dist/artifacts/dev/ton/addresses.d.ts +1 -0
- package/dist/artifacts/dev/ton/addresses.js +5 -0
- package/dist/artifacts/dev/ton/artifacts.d.ts +47 -0
- package/dist/artifacts/dev/ton/artifacts.js +26 -0
- package/dist/artifacts/dev/ton/endpoints.d.ts +3 -0
- package/dist/artifacts/dev/ton/endpoints.js +6 -0
- package/dist/artifacts/dev/ton/index.d.ts +3 -0
- package/dist/artifacts/dev/ton/index.js +40 -0
- package/dist/artifacts/dev/ton/internal/build/CrossChainLayer.compiled.json +1 -0
- package/dist/artifacts/dev/ton/internal/build/Executor.compiled.json +1 -0
- package/dist/artifacts/dev/ton/internal/build/JettonMinter.compiled.json +1 -0
- package/dist/artifacts/dev/ton/internal/build/JettonProxy.compiled.json +1 -0
- package/dist/artifacts/dev/ton/internal/build/JettonWallet.compiled.json +1 -0
- package/dist/artifacts/dev/ton/internal/build/NFTCollection.compiled.json +1 -0
- package/dist/artifacts/dev/ton/internal/build/NFTItem.compiled.json +1 -0
- package/dist/artifacts/dev/ton/internal/build/NFTProxy.compiled.json +1 -0
- package/dist/artifacts/dev/ton/internal/build/Settings.compiled.json +1 -0
- package/dist/artifacts/dev/ton/internal/wrappers/Constants.d.ts +56 -0
- package/dist/artifacts/dev/ton/internal/wrappers/Constants.js +62 -0
- package/dist/artifacts/dev/ton/internal/wrappers/CrossChainLayer.d.ts +164 -0
- package/dist/artifacts/dev/ton/internal/wrappers/CrossChainLayer.js +336 -0
- package/dist/artifacts/dev/ton/internal/wrappers/JettonMinter.d.ts +94 -0
- package/dist/artifacts/dev/ton/internal/wrappers/JettonMinter.js +202 -0
- package/dist/artifacts/dev/ton/internal/wrappers/JettonProxy.d.ts +80 -0
- package/dist/artifacts/dev/ton/internal/wrappers/JettonProxy.js +158 -0
- package/dist/{wrappers → artifacts/dev/ton/internal/wrappers}/JettonWallet.d.ts +52 -13
- package/dist/artifacts/dev/ton/internal/wrappers/JettonWallet.js +193 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTCollection.d.ts +75 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTCollection.js +151 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTItem.d.ts +82 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTItem.js +148 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTProxy.d.ts +84 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTProxy.js +157 -0
- package/dist/artifacts/dev/ton/internal/wrappers/Settings.d.ts +80 -0
- package/dist/artifacts/dev/ton/internal/wrappers/Settings.js +152 -0
- package/dist/artifacts/dev/ton/internal/wrappers/utils/GasUtils.d.ts +79 -0
- package/dist/artifacts/dev/ton/internal/wrappers/utils/GasUtils.js +291 -0
- package/dist/artifacts/dev/ton/internal/wrappers/utils/MerkleRoots.d.ts +7 -0
- package/dist/artifacts/dev/ton/internal/wrappers/utils/MerkleRoots.js +27 -0
- package/dist/artifacts/dev/ton/wrappers.d.ts +8 -0
- package/dist/artifacts/dev/ton/wrappers.js +27 -0
- package/dist/artifacts/index.d.ts +3 -0
- package/dist/artifacts/index.js +39 -0
- package/dist/artifacts/mainnet/index.d.ts +9 -0
- package/dist/artifacts/mainnet/index.js +52 -0
- package/dist/artifacts/mainnet/tac/addresses.d.ts +4 -0
- package/dist/artifacts/mainnet/tac/addresses.js +7 -0
- package/dist/artifacts/mainnet/tac/artifacts.d.ts +330 -0
- package/dist/artifacts/mainnet/tac/artifacts.js +26 -0
- package/dist/artifacts/mainnet/tac/endpoints.d.ts +2 -0
- package/dist/artifacts/mainnet/tac/endpoints.js +5 -0
- package/dist/artifacts/mainnet/tac/index.d.ts +6 -0
- package/dist/artifacts/mainnet/tac/index.js +43 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +296 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/core/Structs.sol/IStructsInterface.json +1087 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/ICrossChainLayer.sol/ICrossChainLayer.json +114 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/ISettings.sol/ISettings.json +194 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/ITokenUtils.sol/ITokenUtils.json +164 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC20.sol/ICrossChainLayerERC20.json +278 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC721.sol/ICrossChainLayerERC721.json +380 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/tokens/IERC20WithDecimals.sol/IERC20WithDecimals.json +207 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/smart-account/interfaces/ISAFactory.sol/ISAFactory.json +103 -0
- package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/smart-account/interfaces/ITacSmartAccount.sol/ITacSmartAccount.json +181 -0
- package/dist/artifacts/mainnet/tac/internal/scripts/utils/encoding.d.ts +4 -0
- package/dist/artifacts/mainnet/tac/internal/scripts/utils/encoding.js +18 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.d.ts +199 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/common.d.ts +50 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/common.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.d.ts +356 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.d.ts +75 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ISettings.d.ts +123 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ISettings.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.d.ts +99 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.d.ts +182 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.d.ts +244 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.d.ts +133 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.d.ts +77 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.js +2 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.d.ts +127 -0
- package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.js +2 -0
- package/dist/artifacts/mainnet/tac/multicall.d.ts +1 -0
- package/dist/artifacts/mainnet/tac/multicall.js +22 -0
- package/dist/artifacts/mainnet/tac/structs.d.ts +1 -0
- package/dist/artifacts/mainnet/tac/structs.js +2 -0
- package/dist/artifacts/mainnet/tac/utils.d.ts +1 -0
- package/dist/artifacts/mainnet/tac/utils.js +5 -0
- package/dist/artifacts/mainnet/tac/wrappers.d.ts +9 -0
- package/dist/artifacts/mainnet/tac/wrappers.js +2 -0
- package/dist/artifacts/mainnet/ton/addresses.d.ts +1 -0
- package/dist/artifacts/mainnet/ton/addresses.js +4 -0
- package/dist/artifacts/mainnet/ton/artifacts.d.ts +47 -0
- package/dist/artifacts/mainnet/ton/artifacts.js +26 -0
- package/dist/artifacts/mainnet/ton/endpoints.d.ts +3 -0
- package/dist/artifacts/mainnet/ton/endpoints.js +6 -0
- package/dist/artifacts/mainnet/ton/index.d.ts +3 -0
- package/dist/artifacts/mainnet/ton/index.js +40 -0
- package/dist/artifacts/mainnet/ton/internal/build/CrossChainLayer.compiled.json +1 -0
- package/dist/artifacts/mainnet/ton/internal/build/Executor.compiled.json +1 -0
- package/dist/artifacts/mainnet/ton/internal/build/JettonMinter.compiled.json +1 -0
- package/dist/artifacts/mainnet/ton/internal/build/JettonProxy.compiled.json +1 -0
- package/dist/artifacts/mainnet/ton/internal/build/JettonWallet.compiled.json +1 -0
- package/dist/artifacts/mainnet/ton/internal/build/NFTCollection.compiled.json +1 -0
- package/dist/artifacts/mainnet/ton/internal/build/NFTItem.compiled.json +1 -0
- package/dist/artifacts/mainnet/ton/internal/build/NFTProxy.compiled.json +1 -0
- package/dist/artifacts/mainnet/ton/internal/build/Settings.compiled.json +1 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/Constants.d.ts +56 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/Constants.js +62 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/CrossChainLayer.d.ts +164 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/CrossChainLayer.js +336 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonMinter.d.ts +94 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonMinter.js +202 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonProxy.d.ts +80 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonProxy.js +158 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonWallet.d.ts +95 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonWallet.js +193 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/NFTCollection.d.ts +75 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/NFTCollection.js +151 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/NFTItem.d.ts +82 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/NFTItem.js +148 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/NFTProxy.d.ts +84 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/NFTProxy.js +157 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/Settings.d.ts +80 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/Settings.js +152 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/utils/GasUtils.d.ts +79 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/utils/GasUtils.js +291 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/utils/MerkleRoots.d.ts +7 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/utils/MerkleRoots.js +27 -0
- package/dist/artifacts/mainnet/ton/wrappers.d.ts +8 -0
- package/dist/artifacts/mainnet/ton/wrappers.js +27 -0
- package/dist/artifacts/tacTypes.d.ts +13 -0
- package/dist/artifacts/tacTypes.js +2 -0
- package/dist/artifacts/testnet/index.d.ts +9 -0
- package/dist/artifacts/testnet/index.js +52 -0
- package/dist/artifacts/testnet/tac/addresses.d.ts +4 -0
- package/dist/artifacts/testnet/tac/addresses.js +7 -0
- package/dist/artifacts/testnet/tac/artifacts.d.ts +330 -0
- package/dist/artifacts/testnet/tac/artifacts.js +26 -0
- package/dist/artifacts/testnet/tac/endpoints.d.ts +2 -0
- package/dist/artifacts/testnet/tac/endpoints.js +5 -0
- package/dist/artifacts/testnet/tac/index.d.ts +6 -0
- package/dist/artifacts/testnet/tac/index.js +43 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +296 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/contracts/core/Structs.sol/IStructsInterface.json +1087 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/ICrossChainLayer.sol/ICrossChainLayer.json +114 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/ISettings.sol/ISettings.json +194 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/ITokenUtils.sol/ITokenUtils.json +164 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC20.sol/ICrossChainLayerERC20.json +278 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC721.sol/ICrossChainLayerERC721.json +380 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/tokens/IERC20WithDecimals.sol/IERC20WithDecimals.json +207 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/contracts/smart-account/interfaces/ISAFactory.sol/ISAFactory.json +103 -0
- package/dist/artifacts/testnet/tac/internal/artifacts/contracts/smart-account/interfaces/ITacSmartAccount.sol/ITacSmartAccount.json +181 -0
- package/dist/artifacts/testnet/tac/internal/scripts/utils/encoding.d.ts +4 -0
- package/dist/artifacts/testnet/tac/internal/scripts/utils/encoding.js +18 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.d.ts +199 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/common.d.ts +50 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/common.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.d.ts +356 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.d.ts +75 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ISettings.d.ts +123 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ISettings.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.d.ts +99 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.d.ts +182 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.d.ts +244 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.d.ts +133 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.d.ts +77 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.js +2 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.d.ts +127 -0
- package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.js +2 -0
- package/dist/artifacts/testnet/tac/multicall.d.ts +1 -0
- package/dist/artifacts/testnet/tac/multicall.js +22 -0
- package/dist/artifacts/testnet/tac/structs.d.ts +1 -0
- package/dist/artifacts/testnet/tac/structs.js +2 -0
- package/dist/artifacts/testnet/tac/utils.d.ts +1 -0
- package/dist/artifacts/testnet/tac/utils.js +5 -0
- package/dist/artifacts/testnet/tac/wrappers.d.ts +9 -0
- package/dist/artifacts/testnet/tac/wrappers.js +2 -0
- package/dist/artifacts/testnet/ton/addresses.d.ts +1 -0
- package/dist/artifacts/testnet/ton/addresses.js +4 -0
- package/dist/artifacts/testnet/ton/artifacts.d.ts +47 -0
- package/dist/artifacts/testnet/ton/artifacts.js +26 -0
- package/dist/artifacts/testnet/ton/endpoints.d.ts +3 -0
- package/dist/artifacts/testnet/ton/endpoints.js +6 -0
- package/dist/artifacts/testnet/ton/index.d.ts +3 -0
- package/dist/artifacts/testnet/ton/index.js +40 -0
- package/dist/artifacts/testnet/ton/internal/build/CrossChainLayer.compiled.json +1 -0
- package/dist/artifacts/testnet/ton/internal/build/Executor.compiled.json +1 -0
- package/dist/artifacts/testnet/ton/internal/build/JettonMinter.compiled.json +1 -0
- package/dist/artifacts/testnet/ton/internal/build/JettonProxy.compiled.json +1 -0
- package/dist/artifacts/testnet/ton/internal/build/JettonWallet.compiled.json +1 -0
- package/dist/artifacts/testnet/ton/internal/build/NFTCollection.compiled.json +1 -0
- package/dist/artifacts/testnet/ton/internal/build/NFTItem.compiled.json +1 -0
- package/dist/artifacts/testnet/ton/internal/build/NFTProxy.compiled.json +1 -0
- package/dist/artifacts/testnet/ton/internal/build/Settings.compiled.json +1 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/Constants.d.ts +56 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/Constants.js +62 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/CrossChainLayer.d.ts +164 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/CrossChainLayer.js +336 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonMinter.d.ts +94 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonMinter.js +202 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonProxy.d.ts +80 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonProxy.js +158 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonWallet.d.ts +95 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonWallet.js +193 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTCollection.d.ts +75 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTCollection.js +151 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTItem.d.ts +82 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTItem.js +148 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTProxy.d.ts +84 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTProxy.js +157 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/Settings.d.ts +80 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/Settings.js +152 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/utils/GasUtils.d.ts +79 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/utils/GasUtils.js +291 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/utils/MerkleRoots.d.ts +7 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/utils/MerkleRoots.js +27 -0
- package/dist/artifacts/testnet/ton/wrappers.d.ts +8 -0
- package/dist/artifacts/testnet/ton/wrappers.js +27 -0
- package/dist/artifacts/tonTypes.d.ts +20 -0
- package/dist/artifacts/tonTypes.js +2 -0
- package/dist/{adapters → src/adapters}/contractOpener.d.ts +2 -1
- package/dist/{adapters → src/adapters}/contractOpener.js +39 -6
- package/dist/src/adapters/index.d.ts +2 -0
- package/dist/src/adapters/index.js +18 -0
- package/dist/{adapters → src/adapters}/retryableContractOpener.d.ts +6 -3
- package/dist/{adapters → src/adapters}/retryableContractOpener.js +10 -11
- package/dist/src/agnosticSdk/AbiHandler.d.ts +27 -0
- package/dist/src/agnosticSdk/AbiHandler.js +137 -0
- package/dist/src/agnosticSdk/AgnosticSdk.d.ts +201 -0
- package/dist/src/agnosticSdk/AgnosticSdk.js +201 -0
- package/dist/src/agnosticSdk/AgnosticStructs.d.ts +108 -0
- package/dist/src/agnosticSdk/AgnosticStructs.js +23 -0
- package/dist/src/agnosticSdk/DebugHelpers.d.ts +88 -0
- package/dist/src/agnosticSdk/DebugHelpers.js +274 -0
- package/dist/src/agnosticSdk/HooksHandler.d.ts +43 -0
- package/dist/src/agnosticSdk/HooksHandler.js +102 -0
- package/dist/src/agnosticSdk/ReplacementHelper.d.ts +95 -0
- package/dist/src/agnosticSdk/ReplacementHelper.js +235 -0
- package/dist/{assets → src/assets}/AssetCache.d.ts +1 -1
- package/dist/{assets → src/assets}/AssetFactory.d.ts +2 -2
- package/dist/{assets → src/assets}/AssetFactory.js +1 -1
- package/dist/{assets → src/assets}/FT.d.ts +14 -17
- package/dist/{assets → src/assets}/FT.js +94 -58
- package/dist/{assets → src/assets}/NFT.d.ts +15 -16
- package/dist/{assets → src/assets}/NFT.js +58 -32
- package/dist/{assets → src/assets}/TON.d.ts +7 -13
- package/dist/{assets → src/assets}/TON.js +22 -20
- package/dist/src/errors/index.d.ts +2 -0
- package/dist/{errors → src/errors}/index.js +8 -2
- package/dist/{errors → src/errors}/instances.d.ts +11 -1
- package/dist/src/errors/instances.js +58 -0
- package/dist/src/index.d.ts +21 -0
- package/dist/{index.js → src/index.js} +38 -18
- package/dist/src/interfaces/Asset.d.ts +78 -0
- package/dist/src/interfaces/Asset.js +2 -0
- package/dist/src/interfaces/ContractOpener.d.ts +21 -0
- package/dist/src/interfaces/ContractOpener.js +2 -0
- package/dist/src/interfaces/IConfiguration.d.ts +35 -0
- package/dist/src/interfaces/IConfiguration.js +2 -0
- package/dist/src/interfaces/IHttpClient.d.ts +16 -0
- package/dist/src/interfaces/IHttpClient.js +2 -0
- package/dist/src/interfaces/ILiteSequencerClient.d.ts +43 -0
- package/dist/src/interfaces/ILiteSequencerClient.js +2 -0
- package/dist/src/interfaces/ILiteSequencerClientFactory.d.ts +9 -0
- package/dist/src/interfaces/ILiteSequencerClientFactory.js +2 -0
- package/dist/src/interfaces/ILogger.d.ts +10 -0
- package/dist/src/interfaces/ILogger.js +2 -0
- package/dist/src/interfaces/IOperationTracker.d.ts +81 -0
- package/dist/src/interfaces/IOperationTracker.js +2 -0
- package/dist/src/interfaces/ISimulator.d.ts +18 -0
- package/dist/src/interfaces/ISimulator.js +2 -0
- package/dist/src/interfaces/ITACTransactionManager.d.ts +15 -0
- package/dist/src/interfaces/ITACTransactionManager.js +2 -0
- package/dist/src/interfaces/ITONTransactionManager.d.ts +20 -0
- package/dist/src/interfaces/ITONTransactionManager.js +2 -0
- package/dist/src/interfaces/ITacSDK.d.ts +185 -0
- package/dist/src/interfaces/ITacSDK.js +2 -0
- package/dist/src/interfaces/SenderAbstraction.d.ts +35 -0
- package/dist/src/interfaces/SenderAbstraction.js +2 -0
- package/dist/src/interfaces/WalletInstanse.d.ts +20 -0
- package/dist/src/interfaces/WalletInstanse.js +2 -0
- package/dist/src/interfaces/index.d.ts +14 -0
- package/dist/src/interfaces/index.js +30 -0
- package/dist/src/sdk/AxiosHttpClient.d.ts +12 -0
- package/dist/src/sdk/AxiosHttpClient.js +23 -0
- package/dist/{sdk → src/sdk}/Configuration.d.ts +6 -5
- package/dist/src/sdk/Configuration.js +195 -0
- package/dist/{sdk → src/sdk}/Consts.d.ts +3 -0
- package/dist/{sdk → src/sdk}/Consts.js +4 -1
- package/dist/src/sdk/LiteSequencerClient.d.ts +18 -0
- package/dist/{sdk → src/sdk}/LiteSequencerClient.js +81 -25
- package/dist/{sdk → src/sdk}/Logger.d.ts +5 -5
- package/dist/{sdk → src/sdk}/Logger.js +12 -4
- package/dist/{sdk → src/sdk}/OperationTracker.d.ts +5 -13
- package/dist/{sdk → src/sdk}/OperationTracker.js +112 -16
- package/dist/src/sdk/Simulator.d.ts +11 -0
- package/dist/src/sdk/Simulator.js +70 -0
- package/dist/{sdk → src/sdk}/StartTracking.d.ts +1 -1
- package/dist/src/sdk/TACTransactionManager.d.ts +10 -0
- package/dist/src/sdk/TACTransactionManager.js +101 -0
- package/dist/src/sdk/TONTransactionManager.d.ts +17 -0
- package/dist/src/sdk/TONTransactionManager.js +220 -0
- package/dist/src/sdk/TacSdk.d.ts +44 -0
- package/dist/src/sdk/TacSdk.js +181 -0
- package/dist/{sdk → src/sdk}/TxFinalizer.d.ts +3 -2
- package/dist/{sdk → src/sdk}/TxFinalizer.js +13 -8
- package/dist/{sdk → src/sdk}/Utils.d.ts +14 -7
- package/dist/{sdk → src/sdk}/Utils.js +127 -34
- package/dist/{sdk → src/sdk}/Validator.d.ts +2 -2
- package/dist/{sdk → src/sdk}/Validator.js +6 -6
- package/dist/{sender → src/sender}/BatchSender.d.ts +1 -2
- package/dist/{sender → src/sender}/RawSender.d.ts +3 -3
- package/dist/{sender → src/sender}/SenderFactory.d.ts +1 -1
- package/dist/{sender → src/sender}/SenderFactory.js +1 -1
- package/dist/{sender → src/sender}/TonConnectSender.d.ts +2 -2
- package/dist/{sender → src/sender}/TonConnectSender.js +3 -3
- package/dist/{sender → src/sender}/index.d.ts +1 -1
- package/dist/{sender → src/sender}/index.js +1 -1
- package/dist/{structs → src/structs}/InternalStruct.d.ts +30 -6
- package/dist/{structs → src/structs}/Struct.d.ts +109 -62
- package/dist/{structs → src/structs}/Struct.js +7 -1
- package/dist/{wrappers → src/wrappers}/ContentUtils.js +0 -1
- package/dist/{wrappers → src/wrappers}/HighloadWalletV3.d.ts +2 -2
- package/package.json +57 -6
- package/dist/errors/index.d.ts +0 -2
- package/dist/errors/instances.js +0 -47
- package/dist/index.d.ts +0 -19
- package/dist/sdk/Configuration.js +0 -90
- package/dist/sdk/LiteSequencerClient.d.ts +0 -13
- package/dist/sdk/Simulator.d.ts +0 -23
- package/dist/sdk/Simulator.js +0 -169
- package/dist/sdk/TacSdk.d.ts +0 -32
- package/dist/sdk/TacSdk.js +0 -154
- package/dist/sdk/TransactionManager.d.ts +0 -22
- package/dist/sdk/TransactionManager.js +0 -269
- package/dist/sender/SenderAbstraction.d.ts +0 -22
- package/dist/sender/SenderAbstraction.js +0 -5
- package/dist/structs/Services.d.ts +0 -66
- package/dist/wrappers/JettonMaster.d.ts +0 -24
- package/dist/wrappers/JettonMaster.js +0 -53
- package/dist/wrappers/JettonWallet.js +0 -124
- package/dist/wrappers/Settings.d.ts +0 -10
- package/dist/wrappers/Settings.js +0 -38
- /package/dist/{structs/Services.js → artifacts/dev/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.js} +0 -0
- /package/dist/{assets → src/assets}/AssetCache.js +0 -0
- /package/dist/{assets → src/assets}/index.d.ts +0 -0
- /package/dist/{assets → src/assets}/index.js +0 -0
- /package/dist/{errors → src/errors}/errors.d.ts +0 -0
- /package/dist/{errors → src/errors}/errors.js +0 -0
- /package/dist/{sdk → src/sdk}/StartTracking.js +0 -0
- /package/dist/{sender → src/sender}/BatchSender.js +0 -0
- /package/dist/{sender → src/sender}/RawSender.js +0 -0
- /package/dist/{structs → src/structs}/InternalStruct.js +0 -0
- /package/dist/{wrappers → src/wrappers}/ContentUtils.d.ts +0 -0
- /package/dist/{wrappers → src/wrappers}/HighloadQueryId.d.ts +0 -0
- /package/dist/{wrappers → src/wrappers}/HighloadQueryId.js +0 -0
- /package/dist/{wrappers → src/wrappers}/HighloadWalletV3.js +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgnosticProxySDK = void 0;
|
|
4
|
+
const mainnet_1 = require("../../artifacts/mainnet");
|
|
5
|
+
const testnet_1 = require("../../artifacts/testnet");
|
|
6
|
+
const Struct_1 = require("../structs/Struct");
|
|
7
|
+
const AbiHandler_1 = require("./AbiHandler");
|
|
8
|
+
const DebugHelpers_1 = require("./DebugHelpers");
|
|
9
|
+
const HooksHandler_1 = require("./HooksHandler");
|
|
10
|
+
const ReplacementHelper_1 = require("./ReplacementHelper");
|
|
11
|
+
/**
|
|
12
|
+
* SDK for building AgnosticProxy Zap calls with efficient hook encoding
|
|
13
|
+
* @param network - The network to use (MAINNET || TESTNET || DEV)
|
|
14
|
+
* @param agnosticProxyAddress - The address of the agnostic proxy(optional)
|
|
15
|
+
*/
|
|
16
|
+
class AgnosticProxySDK {
|
|
17
|
+
constructor(network, agnosticProxyAddress) {
|
|
18
|
+
switch (network) {
|
|
19
|
+
case Struct_1.Network.MAINNET:
|
|
20
|
+
this.agnosticProxyAddress = agnosticProxyAddress ?? mainnet_1.AGNOSTIC_PROXY_ADDRESS;
|
|
21
|
+
break;
|
|
22
|
+
case Struct_1.Network.TESTNET:
|
|
23
|
+
this.agnosticProxyAddress = agnosticProxyAddress ?? testnet_1.AGNOSTIC_PROXY_ADDRESS;
|
|
24
|
+
break;
|
|
25
|
+
case Struct_1.Network.DEV:
|
|
26
|
+
if (!agnosticProxyAddress) {
|
|
27
|
+
throw new Error('Agnostic proxy address is required for dev network');
|
|
28
|
+
}
|
|
29
|
+
this.agnosticProxyAddress = agnosticProxyAddress;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
this.abiHandler = new AbiHandler_1.AbiHandler();
|
|
33
|
+
this.replacementHelper = new ReplacementHelper_1.ReplacementHelper();
|
|
34
|
+
this.hooksHandler = new HooksHandler_1.HooksHandler();
|
|
35
|
+
this.debugHelpers = new DebugHelpers_1.DebugHelpers();
|
|
36
|
+
}
|
|
37
|
+
addContractInterface(address, abi) {
|
|
38
|
+
this.abiHandler.addContractInterface(address, abi);
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create a custom hook with optional dynamic value replacement
|
|
43
|
+
* @param contractAddress - The address of the contract to call
|
|
44
|
+
* @param functionName - The name of the function to call
|
|
45
|
+
* @param params - The parameters of the function to call
|
|
46
|
+
* @param options - The options of the custom hook
|
|
47
|
+
* @returns The custom hook
|
|
48
|
+
*/
|
|
49
|
+
createCustomHook(contractAddress, functionName, params, options = {}) {
|
|
50
|
+
return this.hooksHandler.createCustomHook(contractAddress, functionName, params, this.abiHandler.contractInterfaces, options);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a full balance approve hook
|
|
54
|
+
* @param token - The token to approve
|
|
55
|
+
* @param to - The address to approve to
|
|
56
|
+
* @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
|
|
57
|
+
* @returns The full balance approve hook
|
|
58
|
+
*/
|
|
59
|
+
createFullBalanceApproveHook(token, to, isFromSAPerspective = true) {
|
|
60
|
+
return this.hooksHandler.createFullBalanceApproveHook(token, to, isFromSAPerspective);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Create a full balance transfer hook
|
|
64
|
+
* @param token - The token to transfer
|
|
65
|
+
* @param to - The address to transfer to
|
|
66
|
+
* @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
|
|
67
|
+
* @returns The full balance transfer hook
|
|
68
|
+
*/
|
|
69
|
+
createFullBalanceTransferHook(token, to, isFromSAPerspective = true) {
|
|
70
|
+
return this.hooksHandler.createFullBalanceTransferHook(token, to, isFromSAPerspective);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Utility: Create multiple approve hooks at once
|
|
74
|
+
* @param approvals - The approvals to create
|
|
75
|
+
* @returns The multiple approve hooks
|
|
76
|
+
*/
|
|
77
|
+
createMultipleApproves(approvals) {
|
|
78
|
+
return this.hooksHandler.createMultipleApproves(approvals);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Utility: Create a sequence of custom hooks
|
|
82
|
+
* @param calls - The calls to create
|
|
83
|
+
* @returns The hook sequence
|
|
84
|
+
*/
|
|
85
|
+
createHookSequence(calls) {
|
|
86
|
+
return calls.map((call) => this.createCustomHook(call.contract, call.functionName, call.params, call.options));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Helper to create dynamic amount replacement for a specific parameter
|
|
90
|
+
* @param paramIndex - The index of the parameter to replace
|
|
91
|
+
* @param token - The token to replace
|
|
92
|
+
* @param balanceAddress - The address to replace the parameter with
|
|
93
|
+
* @returns The amount replacement
|
|
94
|
+
*/
|
|
95
|
+
createAmountReplacement(paramIndex, token, balanceAddress) {
|
|
96
|
+
return this.replacementHelper.createAmountReplacement(paramIndex, token, balanceAddress);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Advanced replacement calculator - calculates position and length for any parameter type
|
|
100
|
+
* Required that you have added the contract interface first using addContractInterface().
|
|
101
|
+
* If human readable abi is used, need to provide function and params names also
|
|
102
|
+
* @param contractAddress - The address of the contract to call
|
|
103
|
+
* @param functionName - The name of the function to call
|
|
104
|
+
* @param parameterName - The name of the parameter to replace
|
|
105
|
+
* @param token - The token to replace
|
|
106
|
+
* @param balanceAddress - The address to replace the parameter with
|
|
107
|
+
* @returns The replacement data
|
|
108
|
+
*/
|
|
109
|
+
calculateReplacementData(contractAddress, functionName, parameterName, token, balanceAddress) {
|
|
110
|
+
return this.replacementHelper.calculateReplacementData(contractAddress, functionName, parameterName, token, balanceAddress, this.abiHandler.contractInterfaces);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get replacement helper - shows available functions and parameters for a contract
|
|
114
|
+
* Required that you have added the contract interface first using addContractInterface().
|
|
115
|
+
* If human readable abi is used, need to provide function and params names also
|
|
116
|
+
* @param contractAddress - The address of the contract to call
|
|
117
|
+
* @returns The replacement helper
|
|
118
|
+
*/
|
|
119
|
+
getReplacementHelper(contractAddress) {
|
|
120
|
+
return this.replacementHelper.getReplacementHelper(contractAddress, this.abiHandler.contractInterfaces);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Interactive replacement builder - helps build replacement step by step
|
|
124
|
+
* @param contractAddress - The address of the contract to call
|
|
125
|
+
* @param functionName - The name of the function to call
|
|
126
|
+
* @param parameterName - The name of the parameter to replace
|
|
127
|
+
* @param token - The token to replace
|
|
128
|
+
* @param balanceAddress - The address to replace the parameter with
|
|
129
|
+
* @param options - The options of the interactive replacement builder
|
|
130
|
+
* @returns The interactive replacement builder
|
|
131
|
+
*/
|
|
132
|
+
buildReplacementInteractive(contractAddress, functionName, parameterName, token, balanceAddress, options = {}) {
|
|
133
|
+
return this.replacementHelper.buildReplacementInteractive(contractAddress, functionName, parameterName, token, balanceAddress, this.abiHandler.contractInterfaces, options);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Debug helper: Decode hook data back to readable format
|
|
137
|
+
* @param hook - The hook to decode
|
|
138
|
+
* @returns The decoded hook
|
|
139
|
+
*/
|
|
140
|
+
decodeHookData(hook) {
|
|
141
|
+
return this.debugHelpers.decodeHookData(hook);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Debug helper: Get estimated gas for a ZapCall
|
|
145
|
+
* @param zapCall - The zap call to estimate the gas usage for
|
|
146
|
+
* @returns The estimated gas usage
|
|
147
|
+
*/
|
|
148
|
+
estimateGasUsage(zapCall) {
|
|
149
|
+
return this.debugHelpers.estimateGasUsage(zapCall);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Visualize ZapCall chain - Human readable description of all operations
|
|
153
|
+
* @param zapCall - The zap call to visualize
|
|
154
|
+
*/
|
|
155
|
+
visualizeZapCall(zapCall) {
|
|
156
|
+
return this.debugHelpers.visualizeZapCall(zapCall, this.abiHandler.contractInterfaces);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Get a detailed breakdown of a ZapCall for logging
|
|
160
|
+
* @param zapCall - The zap call to get the breakdown for
|
|
161
|
+
* @returns The breakdown of the zap call
|
|
162
|
+
*/
|
|
163
|
+
getZapCallBreakdown(zapCall) {
|
|
164
|
+
return this.debugHelpers.getZapCallBreakdown(zapCall, this.abiHandler.contractInterfaces);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Compare two ZapCalls and show differences
|
|
168
|
+
* @param zapCall1 - The first zap call to compare
|
|
169
|
+
* @param zapCall2 - The second zap call to compare
|
|
170
|
+
* @param label1 - The label of the first zap call
|
|
171
|
+
* @param label2 - The label of the second zap call
|
|
172
|
+
*/
|
|
173
|
+
compareZapCalls(zapCall1, zapCall2, label1 = 'ZapCall 1', label2 = 'ZapCall 2') {
|
|
174
|
+
return this.debugHelpers.compareZapCalls(zapCall1, zapCall2, label1, label2, this.abiHandler.contractInterfaces);
|
|
175
|
+
}
|
|
176
|
+
getAgnosticCallParams() {
|
|
177
|
+
return {
|
|
178
|
+
evmTargetAddress: this.agnosticProxyAddress,
|
|
179
|
+
methodName: 'Zap(bytes,bytes)',
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Build a complete ZapCall
|
|
184
|
+
* @param hooks - The hooks of the zap call
|
|
185
|
+
* @param bridgeTokens - The tokens to bridge
|
|
186
|
+
* @param bridgeNFTs - The nfts to bridge
|
|
187
|
+
* @returns The zap call
|
|
188
|
+
*/
|
|
189
|
+
buildZapCall(hooks, bridgeTokens = [], bridgeNFTs = []) {
|
|
190
|
+
return this.debugHelpers.buildZapCall(hooks, bridgeTokens, bridgeNFTs);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Encode ZapCall for transaction
|
|
194
|
+
* @param zapCall - The zap call to encode
|
|
195
|
+
* @returns The encoded zap call that can be used as calldata in tac sdk
|
|
196
|
+
*/
|
|
197
|
+
encodeZapCall(zapCall) {
|
|
198
|
+
return this.debugHelpers.encodeZapCall(zapCall);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
exports.AgnosticProxySDK = AgnosticProxySDK;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NFTData is a struct that contains the nft, id, and amount of the nft
|
|
3
|
+
* @param nft - The address of the nft
|
|
4
|
+
* @param id - The id of the nft
|
|
5
|
+
* @param amount - The amount of the nft to transfer(for ERC1155, but currently supported only ERC721)
|
|
6
|
+
*/
|
|
7
|
+
export interface NFTData {
|
|
8
|
+
nft: string;
|
|
9
|
+
id: bigint;
|
|
10
|
+
amount: bigint;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* BridgeData is a struct that contains the tokens, nfts, and isRequired of the bridge data
|
|
14
|
+
* @param tokens - The addresses of the tokens to bridge
|
|
15
|
+
* @param nfts - The nfts to bridge
|
|
16
|
+
* @param isRequired - Whether the bridge is required
|
|
17
|
+
*/
|
|
18
|
+
export interface BridgeData {
|
|
19
|
+
tokens: string[];
|
|
20
|
+
nfts: NFTData[];
|
|
21
|
+
isRequired: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* HookType is an enum that contains the type of the hook
|
|
25
|
+
* @param Custom - The custom hook
|
|
26
|
+
* @param FullBalanceApprove - The full balance approve hook
|
|
27
|
+
* @param FullBalanceTransfer - The full balance transfer hook
|
|
28
|
+
*/
|
|
29
|
+
export declare enum HookType {
|
|
30
|
+
Custom = 0,
|
|
31
|
+
FullBalanceApprove = 1,
|
|
32
|
+
FullBalanceTransfer = 2
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* ReplacementType is an enum that contains the type of the replacement
|
|
36
|
+
* @param Amount - The amount replacement
|
|
37
|
+
*/
|
|
38
|
+
export declare enum ReplacementType {
|
|
39
|
+
Amount = 0
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* AmountChange is a struct that contains the position, length, token, and balance address of the amount change
|
|
43
|
+
* @param position - The position of the amount change(position of the parameter in the function call)
|
|
44
|
+
* @param len - The length of the amount change(length of the parameter in the function call)
|
|
45
|
+
* @param token - The token of the amount change
|
|
46
|
+
* @param balanceAddress - The balance address of the amount change(address to check balance for)
|
|
47
|
+
*/
|
|
48
|
+
export interface AmountChange {
|
|
49
|
+
position: number;
|
|
50
|
+
len: number;
|
|
51
|
+
token: string;
|
|
52
|
+
balanceAddress: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* CustomHookData is a struct that contains the isFromSAPerspective, contractAddress, value, data, and improvedMissionInfo of the custom hook
|
|
56
|
+
* @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
|
|
57
|
+
* @param contractAddress - The address of the contract to call
|
|
58
|
+
* @param value - The value of the hook
|
|
59
|
+
* @param data - The data of the hook
|
|
60
|
+
* @param improvedMissionInfo - The improved mission info of the hook
|
|
61
|
+
*/
|
|
62
|
+
export interface CustomHookData {
|
|
63
|
+
isFromSAPerspective: boolean;
|
|
64
|
+
contractAddress: string;
|
|
65
|
+
value: bigint;
|
|
66
|
+
data: string;
|
|
67
|
+
improvedMissionInfo: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* ApproveHookData is a struct that contains the token, to, and isFromSAPerspective of the approve hook
|
|
71
|
+
* @param token - The token to approve
|
|
72
|
+
* @param to - The address to approve to
|
|
73
|
+
* @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
|
|
74
|
+
*/
|
|
75
|
+
export interface ApproveHookData {
|
|
76
|
+
token: string;
|
|
77
|
+
to: string;
|
|
78
|
+
isFromSAPerspective: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* TransferHookData is a struct that contains the token, to, and isFromSAPerspective of the transfer hook
|
|
82
|
+
* @param token - The token to transfer
|
|
83
|
+
* @param to - The address to transfer to
|
|
84
|
+
* @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
|
|
85
|
+
*/
|
|
86
|
+
export interface TransferHookData {
|
|
87
|
+
token: string;
|
|
88
|
+
to: string;
|
|
89
|
+
isFromSAPerspective: boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Hook is a struct that contains the hookType and hookData of the hook
|
|
93
|
+
* @param hookType - The type of the hook
|
|
94
|
+
* @param hookData - The data of the hook
|
|
95
|
+
*/
|
|
96
|
+
export interface Hook {
|
|
97
|
+
hookType: HookType;
|
|
98
|
+
hookData: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* ZapCall is a struct that contains the hooks and bridgeData of the zap call
|
|
102
|
+
* @param hooks - The hooks of the zap call
|
|
103
|
+
* @param bridgeData - The bridge data of the zap call
|
|
104
|
+
*/
|
|
105
|
+
export interface ZapCall {
|
|
106
|
+
hooks: Hook[];
|
|
107
|
+
bridgeData: BridgeData;
|
|
108
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplacementType = exports.HookType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* HookType is an enum that contains the type of the hook
|
|
6
|
+
* @param Custom - The custom hook
|
|
7
|
+
* @param FullBalanceApprove - The full balance approve hook
|
|
8
|
+
* @param FullBalanceTransfer - The full balance transfer hook
|
|
9
|
+
*/
|
|
10
|
+
var HookType;
|
|
11
|
+
(function (HookType) {
|
|
12
|
+
HookType[HookType["Custom"] = 0] = "Custom";
|
|
13
|
+
HookType[HookType["FullBalanceApprove"] = 1] = "FullBalanceApprove";
|
|
14
|
+
HookType[HookType["FullBalanceTransfer"] = 2] = "FullBalanceTransfer";
|
|
15
|
+
})(HookType || (exports.HookType = HookType = {}));
|
|
16
|
+
/**
|
|
17
|
+
* ReplacementType is an enum that contains the type of the replacement
|
|
18
|
+
* @param Amount - The amount replacement
|
|
19
|
+
*/
|
|
20
|
+
var ReplacementType;
|
|
21
|
+
(function (ReplacementType) {
|
|
22
|
+
ReplacementType[ReplacementType["Amount"] = 0] = "Amount";
|
|
23
|
+
})(ReplacementType || (exports.ReplacementType = ReplacementType = {}));
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Interface } from 'ethers';
|
|
2
|
+
import { Hook, NFTData, ZapCall } from './AgnosticStructs';
|
|
3
|
+
export declare class DebugHelpers {
|
|
4
|
+
/**
|
|
5
|
+
* Build a complete ZapCall
|
|
6
|
+
* @param hooks - The hooks of the zap call
|
|
7
|
+
* @param bridgeTokens - The tokens to bridge
|
|
8
|
+
* @param bridgeNFTs - The nfts to bridge
|
|
9
|
+
* @returns The zap call
|
|
10
|
+
*/
|
|
11
|
+
buildZapCall(hooks: Hook[], bridgeTokens?: string[], bridgeNFTs?: NFTData[]): ZapCall;
|
|
12
|
+
/**
|
|
13
|
+
* Debug helper: Decode hook data back to readable format
|
|
14
|
+
* @param hook - The hook to decode
|
|
15
|
+
* @returns The decoded hook
|
|
16
|
+
*/
|
|
17
|
+
decodeHookData(hook: Hook): any;
|
|
18
|
+
/**
|
|
19
|
+
* Debug helper: Get estimated gas for a ZapCall
|
|
20
|
+
* @param zapCall - The zap call to estimate the gas usage for
|
|
21
|
+
* @returns The estimated gas usage
|
|
22
|
+
*/
|
|
23
|
+
estimateGasUsage(zapCall: ZapCall): number;
|
|
24
|
+
/**
|
|
25
|
+
* Visualize ZapCall chain - Human readable description of all operations
|
|
26
|
+
* @param zapCall - The zap call to visualize
|
|
27
|
+
*/
|
|
28
|
+
visualizeZapCall(zapCall: ZapCall, contractInterfaces: Map<string, Interface>): void;
|
|
29
|
+
/**
|
|
30
|
+
* Private helper to describe individual hooks
|
|
31
|
+
* @param hook - The hook to describe
|
|
32
|
+
* @returns The description of the hook
|
|
33
|
+
*/
|
|
34
|
+
private _describeHook;
|
|
35
|
+
/**
|
|
36
|
+
* Describe custom hook with function details
|
|
37
|
+
* @param hook - The hook to describe
|
|
38
|
+
* @returns The description of the hook
|
|
39
|
+
*/
|
|
40
|
+
private _describeCustomHook;
|
|
41
|
+
/**
|
|
42
|
+
* Describe approve hook
|
|
43
|
+
* @param hook - The hook to describe
|
|
44
|
+
* @returns The description of the hook
|
|
45
|
+
*/
|
|
46
|
+
private _describeApproveHook;
|
|
47
|
+
/**
|
|
48
|
+
* Describe transfer hook
|
|
49
|
+
* @param hook - The hook to describe
|
|
50
|
+
* @returns The description of the hook
|
|
51
|
+
*/
|
|
52
|
+
private _describeTransferHook;
|
|
53
|
+
/**
|
|
54
|
+
* Format address for display (show first 6 and last 4 characters)
|
|
55
|
+
* @param address - The address to format
|
|
56
|
+
* @returns The formatted address
|
|
57
|
+
*/
|
|
58
|
+
private _formatAddress;
|
|
59
|
+
/**
|
|
60
|
+
* Get a detailed breakdown of a ZapCall for logging
|
|
61
|
+
* @param zapCall - The zap call to get the breakdown for
|
|
62
|
+
* @returns The breakdown of the zap call
|
|
63
|
+
*/
|
|
64
|
+
getZapCallBreakdown(zapCall: ZapCall, contractInterfaces: Map<string, Interface>): {
|
|
65
|
+
totalHooks: number;
|
|
66
|
+
hookTypes: {
|
|
67
|
+
[key: string]: number;
|
|
68
|
+
};
|
|
69
|
+
gasEstimate: number;
|
|
70
|
+
encodedSize: number;
|
|
71
|
+
bridgeRequired: boolean;
|
|
72
|
+
hookDescriptions: string[];
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Compare two ZapCalls and show differences
|
|
76
|
+
* @param zapCall1 - The first zap call to compare
|
|
77
|
+
* @param zapCall2 - The second zap call to compare
|
|
78
|
+
* @param label1 - The label of the first zap call
|
|
79
|
+
* @param label2 - The label of the second zap call
|
|
80
|
+
*/
|
|
81
|
+
compareZapCalls(zapCall1: ZapCall, zapCall2: ZapCall, label1: string | undefined, label2: string | undefined, contractInterfaces: Map<string, Interface>): void;
|
|
82
|
+
/**
|
|
83
|
+
* Encode ZapCall for transaction
|
|
84
|
+
* @param zapCall - The zap call to encode
|
|
85
|
+
* @returns The encoded zap call that can be used as calldata in tac sdk
|
|
86
|
+
*/
|
|
87
|
+
encodeZapCall(zapCall: ZapCall): string;
|
|
88
|
+
}
|