@ercworldio/blockchain-shared 1.0.0-dev.4
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/README.md +1 -0
- package/build/chains/ChainDefinition.d.ts +2 -0
- package/build/chains/ChainDefinition.d.ts.map +1 -0
- package/build/chains/ChainDefinition.js +84 -0
- package/build/chains/Provider.d.ts +20 -0
- package/build/chains/Provider.d.ts.map +1 -0
- package/build/chains/Provider.js +85 -0
- package/build/chains/RPC.d.ts +34 -0
- package/build/chains/RPC.d.ts.map +1 -0
- package/build/chains/RPC.js +147 -0
- package/build/chains/chain_to_ticker.json +28 -0
- package/build/chains/chains.json +513 -0
- package/build/chains/chains_stg-bu.json +513 -0
- package/build/chains/chains_v2.json +494 -0
- package/build/chains/escrow-contracts/10143.json +8 -0
- package/build/chains/escrow-contracts/97.json +8 -0
- package/build/chains/event_listener_config_escrows.json +699 -0
- package/build/chains/networks_dev.json +715 -0
- package/build/chains/networks_prod-bu.json +542 -0
- package/build/chains/networks_prod.json +541 -0
- package/build/chains/networks_stg-bu.json +568 -0
- package/build/chains/networks_stg-dz.json +451 -0
- package/build/chains/networks_stg.json +541 -0
- package/build/chains/networks_stg_drizzle.json +130 -0
- package/build/chains/rpcs.d.ts +30 -0
- package/build/chains/rpcs.d.ts.map +1 -0
- package/build/chains/rpcs.js +138 -0
- package/build/constants.d.ts +34 -0
- package/build/constants.d.ts.map +1 -0
- package/build/constants.js +40 -0
- package/build/contracts/Escrow.d.ts +162 -0
- package/build/contracts/Escrow.d.ts.map +1 -0
- package/build/contracts/Escrow.js +359 -0
- package/build/contracts/EscrowErrors.d.ts +75 -0
- package/build/contracts/EscrowErrors.d.ts.map +1 -0
- package/build/contracts/EscrowErrors.js +47 -0
- package/build/contracts/artifacts/ERC20Mock.json +344 -0
- package/build/contracts/artifacts/Erc20.json +344 -0
- package/build/contracts/artifacts/ErrorAbi.json +1847 -0
- package/build/contracts/artifacts/Escrow.json +1545 -0
- package/build/contracts/contract-events/AccessControlEvents.d.ts +51 -0
- package/build/contracts/contract-events/AccessControlEvents.d.ts.map +1 -0
- package/build/contracts/contract-events/AccessControlEvents.js +83 -0
- package/build/contracts/contract-events/CoverageInfo.d.ts +16 -0
- package/build/contracts/contract-events/CoverageInfo.d.ts.map +1 -0
- package/build/contracts/contract-events/CoverageInfo.js +135 -0
- package/build/contracts/contract-events/Erc20Events.d.ts +23 -0
- package/build/contracts/contract-events/Erc20Events.d.ts.map +1 -0
- package/build/contracts/contract-events/Erc20Events.js +52 -0
- package/build/contracts/contract-events/EscrowEvents.d.ts +64 -0
- package/build/contracts/contract-events/EscrowEvents.d.ts.map +1 -0
- package/build/contracts/contract-events/EscrowEvents.js +142 -0
- package/build/contracts/contract-events/types/AccessControlEvents.d.ts +9 -0
- package/build/contracts/contract-events/types/AccessControlEvents.d.ts.map +1 -0
- package/build/contracts/contract-events/types/AccessControlEvents.js +2 -0
- package/build/contracts/contract-events/types/events.d.ts +24 -0
- package/build/contracts/contract-events/types/events.d.ts.map +1 -0
- package/build/contracts/contract-events/types/events.js +2 -0
- package/build/contracts/deployment/avalanche/contracts.json +37 -0
- package/build/contracts/deployment/bitlayer/contracts.json +50 -0
- package/build/contracts/deployment/bsc/contracts.json +62 -0
- package/build/contracts/deployment/config.d.ts +4 -0
- package/build/contracts/deployment/config.d.ts.map +1 -0
- package/build/contracts/deployment/config.js +19 -0
- package/build/contracts/deployment/fantom/contracts.json +61 -0
- package/build/contracts/deployment/mumbai/contracts.json +43 -0
- package/build/contracts/deployment/polygon/contracts.json +43 -0
- package/build/contracts/deployment/sepolia/contracts.json +62 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/AccessControl.d.ts +160 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/AccessControl.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/AccessControl.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/IAccessControl.d.ts +148 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/IAccessControl.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/IAccessControl.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/Ownable.d.ts +55 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/Ownable.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/Ownable.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/index.d.ts +4 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/access/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/index.d.ts +9 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/IERC5267.d.ts +79 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/IERC5267.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/IERC5267.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.d.ts +21 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.d.ts +21 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.d.ts +21 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.d.ts +4 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/index.d.ts +4 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/interfaces/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/ERC20.d.ts +142 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/ERC20.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/ERC20.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/IERC20.d.ts +130 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/IERC20.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/IERC20.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.d.ts +142 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/index.d.ts +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/index.d.ts +5 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/ERC20/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/index.d.ts +3 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/token/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/ShortStrings.d.ts +21 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/ShortStrings.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/ShortStrings.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/Strings.d.ts +21 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/Strings.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/Strings.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/cryptography/EIP712.d.ts +79 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/cryptography/EIP712.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/cryptography/EIP712.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/cryptography/index.d.ts +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/cryptography/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/cryptography/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/index.d.ts +9 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/introspection/ERC165.d.ts +30 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/introspection/ERC165.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/introspection/ERC165.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/introspection/IERC165.d.ts +30 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/introspection/IERC165.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/introspection/IERC165.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/introspection/index.d.ts +3 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/introspection/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/introspection/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/math/SafeCast.d.ts +21 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/math/SafeCast.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/math/SafeCast.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/math/index.d.ts +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/math/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts/utils/math/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/index.d.ts +3 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/proxy/index.d.ts +3 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/proxy/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/proxy/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.d.ts +37 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/proxy/utils/index.d.ts +2 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/proxy/utils/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/contracts-upgradeable/proxy/utils/index.js +2 -0
- package/build/contracts/typechain-types/@openzeppelin/index.d.ts +5 -0
- package/build/contracts/typechain-types/@openzeppelin/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/@openzeppelin/index.js +2 -0
- package/build/contracts/typechain-types/common.d.ts +51 -0
- package/build/contracts/typechain-types/common.d.ts.map +1 -0
- package/build/contracts/typechain-types/common.js +2 -0
- package/build/contracts/typechain-types/contracts/escrow/Escrow.d.ts +856 -0
- package/build/contracts/typechain-types/contracts/escrow/Escrow.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/escrow/Escrow.js +2 -0
- package/build/contracts/typechain-types/contracts/escrow/EscrowAccessControl.d.ts +218 -0
- package/build/contracts/typechain-types/contracts/escrow/EscrowAccessControl.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/escrow/EscrowAccessControl.js +2 -0
- package/build/contracts/typechain-types/contracts/escrow/EscrowErrors.d.ts +21 -0
- package/build/contracts/typechain-types/contracts/escrow/EscrowErrors.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/escrow/EscrowErrors.js +2 -0
- package/build/contracts/typechain-types/contracts/escrow/EscrowSignature.d.ts +120 -0
- package/build/contracts/typechain-types/contracts/escrow/EscrowSignature.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/escrow/EscrowSignature.js +2 -0
- package/build/contracts/typechain-types/contracts/escrow/TokensWhitelist.d.ts +82 -0
- package/build/contracts/typechain-types/contracts/escrow/TokensWhitelist.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/escrow/TokensWhitelist.js +2 -0
- package/build/contracts/typechain-types/contracts/escrow/index.d.ts +6 -0
- package/build/contracts/typechain-types/contracts/escrow/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/escrow/index.js +2 -0
- package/build/contracts/typechain-types/contracts/index.d.ts +5 -0
- package/build/contracts/typechain-types/contracts/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/index.js +2 -0
- package/build/contracts/typechain-types/contracts/mock/erc20/ERC20Mock.d.ts +146 -0
- package/build/contracts/typechain-types/contracts/mock/erc20/ERC20Mock.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/mock/erc20/ERC20Mock.js +2 -0
- package/build/contracts/typechain-types/contracts/mock/erc20/index.d.ts +2 -0
- package/build/contracts/typechain-types/contracts/mock/erc20/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/mock/erc20/index.js +2 -0
- package/build/contracts/typechain-types/contracts/mock/index.d.ts +3 -0
- package/build/contracts/typechain-types/contracts/mock/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/contracts/mock/index.js +2 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/AccessControl__factory.d.ts +182 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/AccessControl__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/AccessControl__factory.js +244 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/IAccessControl__factory.d.ts +158 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/IAccessControl__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/IAccessControl__factory.js +212 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/Ownable__factory.d.ts +65 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/Ownable__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/Ownable__factory.js +93 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/index.d.ts +4 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/access/index.js +12 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/index.d.ts +5 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/index.js +43 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/IERC5267__factory.d.ts +47 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/IERC5267__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/IERC5267__factory.js +68 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors__factory.d.ts +84 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors__factory.js +121 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors__factory.d.ts +72 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors__factory.js +105 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors__factory.d.ts +84 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors__factory.js +122 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.d.ts +4 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.js +12 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/index.d.ts +3 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/interfaces/index.js +42 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory.d.ts +242 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory.js +327 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.d.ts +148 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.js +202 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.d.ts +178 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.js +241 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/index.d.ts +2 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/index.js +8 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/index.d.ts +4 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/ERC20/index.js +44 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/index.d.ts +2 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/token/index.js +40 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/ShortStrings__factory.d.ts +35 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/ShortStrings__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/ShortStrings__factory.js +55 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/Strings__factory.d.ts +43 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/Strings__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/Strings__factory.js +65 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/cryptography/EIP712__factory.d.ts +59 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/cryptography/EIP712__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/cryptography/EIP712__factory.js +84 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/cryptography/index.d.ts +2 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/cryptography/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/cryptography/index.js +8 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/index.d.ts +6 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/index.js +46 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/introspection/ERC165__factory.d.ts +22 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/introspection/ERC165__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/introspection/ERC165__factory.js +38 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.d.ts +22 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.js +38 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/introspection/index.d.ts +3 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/introspection/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/introspection/index.js +10 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/math/SafeCast__factory.d.ts +63 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/math/SafeCast__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/math/SafeCast__factory.js +93 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/math/index.d.ts +2 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/math/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts/utils/math/index.js +8 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/index.d.ts +2 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/index.js +40 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/proxy/index.d.ts +2 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/proxy/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/proxy/index.js +40 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable__factory.d.ts +26 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable__factory.js +42 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/proxy/utils/index.d.ts +2 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/proxy/utils/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/contracts-upgradeable/proxy/utils/index.js +8 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/index.d.ts +3 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/@openzeppelin/index.js +41 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowAccessControl__factory.d.ts +415 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowAccessControl__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowAccessControl__factory.js +547 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowErrors__factory.d.ts +151 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowErrors__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowErrors__factory.js +205 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowSignature__factory.d.ts +151 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowSignature__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowSignature__factory.js +205 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.d.ts +1217 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.js +1582 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/TokensWhitelist__factory.d.ts +99 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/TokensWhitelist__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/TokensWhitelist__factory.js +139 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/index.d.ts +6 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/escrow/index.js +16 -0
- package/build/contracts/typechain-types/factories/contracts/index.d.ts +3 -0
- package/build/contracts/typechain-types/factories/contracts/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/index.js +41 -0
- package/build/contracts/typechain-types/factories/contracts/mock/erc20/ERC20Mock__factory.d.ts +283 -0
- package/build/contracts/typechain-types/factories/contracts/mock/erc20/ERC20Mock__factory.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/mock/erc20/ERC20Mock__factory.js +381 -0
- package/build/contracts/typechain-types/factories/contracts/mock/erc20/index.d.ts +2 -0
- package/build/contracts/typechain-types/factories/contracts/mock/erc20/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/mock/erc20/index.js +8 -0
- package/build/contracts/typechain-types/factories/contracts/mock/index.d.ts +2 -0
- package/build/contracts/typechain-types/factories/contracts/mock/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/contracts/mock/index.js +40 -0
- package/build/contracts/typechain-types/factories/index.d.ts +3 -0
- package/build/contracts/typechain-types/factories/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/factories/index.js +41 -0
- package/build/contracts/typechain-types/index.d.ts +52 -0
- package/build/contracts/typechain-types/index.d.ts.map +1 -0
- package/build/contracts/typechain-types/index.js +83 -0
- package/build/contracts/types/escrow.d.ts +42 -0
- package/build/contracts/types/escrow.d.ts.map +1 -0
- package/build/contracts/types/escrow.js +20 -0
- package/build/entities/Checkpoint.d.ts +11 -0
- package/build/entities/Checkpoint.d.ts.map +1 -0
- package/build/entities/Checkpoint.js +52 -0
- package/build/entities/ClaimHistory.d.ts +17 -0
- package/build/entities/ClaimHistory.d.ts.map +1 -0
- package/build/entities/ClaimHistory.js +73 -0
- package/build/entities/ClaimJob.d.ts +27 -0
- package/build/entities/ClaimJob.d.ts.map +1 -0
- package/build/entities/ClaimJob.js +113 -0
- package/build/entities/CryptoConfirmationLocks.d.ts +14 -0
- package/build/entities/CryptoConfirmationLocks.d.ts.map +1 -0
- package/build/entities/CryptoConfirmationLocks.js +65 -0
- package/build/entities/DepositAddress.d.ts +12 -0
- package/build/entities/DepositAddress.d.ts.map +1 -0
- package/build/entities/DepositAddress.js +56 -0
- package/build/entities/DepositWalletBalance.d.ts +16 -0
- package/build/entities/DepositWalletBalance.d.ts.map +1 -0
- package/build/entities/DepositWalletBalance.js +72 -0
- package/build/entities/SweepHistory.d.ts +16 -0
- package/build/entities/SweepHistory.d.ts.map +1 -0
- package/build/entities/SweepHistory.js +72 -0
- package/build/entities/SweepJob.d.ts +26 -0
- package/build/entities/SweepJob.d.ts.map +1 -0
- package/build/entities/SweepJob.js +116 -0
- package/build/entities/WalletIndex.d.ts +8 -0
- package/build/entities/WalletIndex.d.ts.map +1 -0
- package/build/entities/WalletIndex.js +40 -0
- package/build/errors/AdminErrors.d.ts +25 -0
- package/build/errors/AdminErrors.d.ts.map +1 -0
- package/build/errors/AdminErrors.js +45 -0
- package/build/errors/AlchemyErrors.d.ts +34 -0
- package/build/errors/AlchemyErrors.d.ts.map +1 -0
- package/build/errors/AlchemyErrors.js +79 -0
- package/build/errors/BalanceErrors.d.ts +23 -0
- package/build/errors/BalanceErrors.d.ts.map +1 -0
- package/build/errors/BalanceErrors.js +45 -0
- package/build/errors/DatabaseErrors.d.ts +25 -0
- package/build/errors/DatabaseErrors.d.ts.map +1 -0
- package/build/errors/DatabaseErrors.js +49 -0
- package/build/errors/TransactionsErrors.d.ts +37 -0
- package/build/errors/TransactionsErrors.d.ts.map +1 -0
- package/build/errors/TransactionsErrors.js +95 -0
- package/build/errors/VoltageErrors.d.ts +29 -0
- package/build/errors/VoltageErrors.d.ts.map +1 -0
- package/build/errors/VoltageErrors.js +69 -0
- package/build/errors/WalletErrors.d.ts +26 -0
- package/build/errors/WalletErrors.d.ts.map +1 -0
- package/build/errors/WalletErrors.js +55 -0
- package/build/errors/errors.d.ts +74 -0
- package/build/errors/errors.d.ts.map +1 -0
- package/build/errors/errors.js +117 -0
- package/build/errors/index.d.ts +81 -0
- package/build/errors/index.d.ts.map +1 -0
- package/build/errors/index.js +78 -0
- package/build/index.d.ts +95 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +208 -0
- package/build/interfaces/config.d.ts +75 -0
- package/build/interfaces/config.d.ts.map +1 -0
- package/build/interfaces/config.js +2 -0
- package/build/interfaces/database.d.ts +29 -0
- package/build/interfaces/database.d.ts.map +1 -0
- package/build/interfaces/database.js +2 -0
- package/build/interfaces.d.ts +311 -0
- package/build/interfaces.d.ts.map +1 -0
- package/build/interfaces.js +12 -0
- package/build/services/AccountingService.d.ts +34 -0
- package/build/services/AccountingService.d.ts.map +1 -0
- package/build/services/AccountingService.js +239 -0
- package/build/services/AlchemyService.d.ts +47 -0
- package/build/services/AlchemyService.d.ts.map +1 -0
- package/build/services/AlchemyService.js +239 -0
- package/build/services/AlchemyWebhookSignature.d.ts +16 -0
- package/build/services/AlchemyWebhookSignature.d.ts.map +1 -0
- package/build/services/AlchemyWebhookSignature.js +119 -0
- package/build/services/AlchemyWebhooks.d.ts +87 -0
- package/build/services/AlchemyWebhooks.d.ts.map +1 -0
- package/build/services/AlchemyWebhooks.js +406 -0
- package/build/services/AsyncTTLCache.d.ts +12 -0
- package/build/services/AsyncTTLCache.d.ts.map +1 -0
- package/build/services/AsyncTTLCache.js +67 -0
- package/build/services/AzureEventHubHandler.d.ts +32 -0
- package/build/services/AzureEventHubHandler.d.ts.map +1 -0
- package/build/services/AzureEventHubHandler.js +139 -0
- package/build/services/BalanceService.d.ts +39 -0
- package/build/services/BalanceService.d.ts.map +1 -0
- package/build/services/BalanceService.js +482 -0
- package/build/services/ChainManager.d.ts +86 -0
- package/build/services/ChainManager.d.ts.map +1 -0
- package/build/services/ChainManager.js +440 -0
- package/build/services/ClaimHistoryService.d.ts +40 -0
- package/build/services/ClaimHistoryService.d.ts.map +1 -0
- package/build/services/ClaimHistoryService.js +121 -0
- package/build/services/ClaimJobService.d.ts +45 -0
- package/build/services/ClaimJobService.d.ts.map +1 -0
- package/build/services/ClaimJobService.js +398 -0
- package/build/services/CryptoConfirmationLocksService.d.ts +13 -0
- package/build/services/CryptoConfirmationLocksService.d.ts.map +1 -0
- package/build/services/CryptoConfirmationLocksService.js +46 -0
- package/build/services/CryptoKeysManager.d.ts +16 -0
- package/build/services/CryptoKeysManager.d.ts.map +1 -0
- package/build/services/CryptoKeysManager.js +136 -0
- package/build/services/DepositAddressService.d.ts +41 -0
- package/build/services/DepositAddressService.d.ts.map +1 -0
- package/build/services/DepositAddressService.js +264 -0
- package/build/services/ElasticSearch.d.ts +19 -0
- package/build/services/ElasticSearch.d.ts.map +1 -0
- package/build/services/ElasticSearch.js +104 -0
- package/build/services/EventsHandler.d.ts +11 -0
- package/build/services/EventsHandler.d.ts.map +1 -0
- package/build/services/EventsHandler.js +39 -0
- package/build/services/EventsService.d.ts +44 -0
- package/build/services/EventsService.d.ts.map +1 -0
- package/build/services/EventsService.js +234 -0
- package/build/services/InvoiceQueue.d.ts +56 -0
- package/build/services/InvoiceQueue.d.ts.map +1 -0
- package/build/services/InvoiceQueue.js +297 -0
- package/build/services/KeyVaultService.d.ts +14 -0
- package/build/services/KeyVaultService.d.ts.map +1 -0
- package/build/services/KeyVaultService.js +92 -0
- package/build/services/PriceCache.d.ts +19 -0
- package/build/services/PriceCache.d.ts.map +1 -0
- package/build/services/PriceCache.js +125 -0
- package/build/services/ProviderManager.d.ts +41 -0
- package/build/services/ProviderManager.d.ts.map +1 -0
- package/build/services/ProviderManager.js +106 -0
- package/build/services/QuicknodeWebhookSignature.d.ts +14 -0
- package/build/services/QuicknodeWebhookSignature.d.ts.map +1 -0
- package/build/services/QuicknodeWebhookSignature.js +119 -0
- package/build/services/Redis.d.ts +41 -0
- package/build/services/Redis.d.ts.map +1 -0
- package/build/services/Redis.js +317 -0
- package/build/services/RedisListQueue.d.ts +15 -0
- package/build/services/RedisListQueue.d.ts.map +1 -0
- package/build/services/RedisListQueue.js +81 -0
- package/build/services/RedisPubSub.d.ts +41 -0
- package/build/services/RedisPubSub.d.ts.map +1 -0
- package/build/services/RedisPubSub.js +254 -0
- package/build/services/RedisQueue.d.ts +18 -0
- package/build/services/RedisQueue.d.ts.map +1 -0
- package/build/services/RedisQueue.js +82 -0
- package/build/services/StorageService.d.ts +12 -0
- package/build/services/StorageService.d.ts.map +1 -0
- package/build/services/StorageService.js +92 -0
- package/build/services/SweepHistoryService.d.ts +15 -0
- package/build/services/SweepHistoryService.d.ts.map +1 -0
- package/build/services/SweepHistoryService.js +52 -0
- package/build/services/SweepJobService.d.ts +52 -0
- package/build/services/SweepJobService.d.ts.map +1 -0
- package/build/services/SweepJobService.js +716 -0
- package/build/services/TimerManager.d.ts +44 -0
- package/build/services/TimerManager.d.ts.map +1 -0
- package/build/services/TimerManager.js +231 -0
- package/build/services/WalletIndexService.d.ts +11 -0
- package/build/services/WalletIndexService.d.ts.map +1 -0
- package/build/services/WalletIndexService.js +73 -0
- package/build/services/WalletManager.d.ts +42 -0
- package/build/services/WalletManager.d.ts.map +1 -0
- package/build/services/WalletManager.js +359 -0
- package/build/services/WithdrawalManager.d.ts +51 -0
- package/build/services/WithdrawalManager.d.ts.map +1 -0
- package/build/services/WithdrawalManager.js +368 -0
- package/build/services/Worker.d.ts +25 -0
- package/build/services/Worker.d.ts.map +1 -0
- package/build/services/Worker.js +115 -0
- package/build/services/solana/escrow/SolanaEscrowAdmin.d.ts +102 -0
- package/build/services/solana/escrow/SolanaEscrowAdmin.d.ts.map +1 -0
- package/build/services/solana/escrow/SolanaEscrowAdmin.js +209 -0
- package/build/services/solana/escrow/SolanaEscrowInteraction.d.ts +50 -0
- package/build/services/solana/escrow/SolanaEscrowInteraction.d.ts.map +1 -0
- package/build/services/solana/escrow/SolanaEscrowInteraction.js +235 -0
- package/build/services/solana/escrow/idl/escrow.json +2941 -0
- package/build/services/solana/escrow/index.d.ts +5 -0
- package/build/services/solana/escrow/index.d.ts.map +1 -0
- package/build/services/solana/escrow/index.js +20 -0
- package/build/services/solana/escrow/services/Errors.d.ts +19 -0
- package/build/services/solana/escrow/services/Errors.d.ts.map +1 -0
- package/build/services/solana/escrow/services/Errors.js +29 -0
- package/build/services/solana/escrow/services/EscrowAdminUtility.d.ts +121 -0
- package/build/services/solana/escrow/services/EscrowAdminUtility.d.ts.map +1 -0
- package/build/services/solana/escrow/services/EscrowAdminUtility.js +663 -0
- package/build/services/solana/escrow/services/EscrowService.d.ts +15 -0
- package/build/services/solana/escrow/services/EscrowService.d.ts.map +1 -0
- package/build/services/solana/escrow/services/EscrowService.js +155 -0
- package/build/services/solana/escrow/services/EscrowUtility.d.ts +58 -0
- package/build/services/solana/escrow/services/EscrowUtility.d.ts.map +1 -0
- package/build/services/solana/escrow/services/EscrowUtility.js +318 -0
- package/build/services/solana/escrow/services/TokenAccountService.d.ts +10 -0
- package/build/services/solana/escrow/services/TokenAccountService.d.ts.map +1 -0
- package/build/services/solana/escrow/services/TokenAccountService.js +145 -0
- package/build/services/solana/escrow/services/TransactionsService.d.ts +12 -0
- package/build/services/solana/escrow/services/TransactionsService.d.ts.map +1 -0
- package/build/services/solana/escrow/services/TransactionsService.js +44 -0
- package/build/services/solana/escrow/services/index.d.ts +7 -0
- package/build/services/solana/escrow/services/index.d.ts.map +1 -0
- package/build/services/solana/escrow/services/index.js +22 -0
- package/build/services/solana/escrow/types/custom.d.ts +14 -0
- package/build/services/solana/escrow/types/custom.d.ts.map +1 -0
- package/build/services/solana/escrow/types/custom.js +2 -0
- package/build/services/solana/escrow/types/escrow.d.ts +2948 -0
- package/build/services/solana/escrow/types/escrow.d.ts.map +1 -0
- package/build/services/solana/escrow/types/escrow.js +2 -0
- package/build/services/solana/escrow/types/index.d.ts +3 -0
- package/build/services/solana/escrow/types/index.d.ts.map +1 -0
- package/build/services/solana/escrow/types/index.js +18 -0
- package/build/services/solana/escrow/types/types.d.ts +19 -0
- package/build/services/solana/escrow/types/types.d.ts.map +1 -0
- package/build/services/solana/escrow/types/types.js +2 -0
- package/build/services/solana/index.d.ts +2 -0
- package/build/services/solana/index.d.ts.map +1 -0
- package/build/services/solana/index.js +17 -0
- package/build/services/tron/index.d.ts +5 -0
- package/build/services/tron/index.d.ts.map +1 -0
- package/build/services/tron/index.js +21 -0
- package/build/services/tron/services/BitQueryQueue.d.ts +13 -0
- package/build/services/tron/services/BitQueryQueue.d.ts.map +1 -0
- package/build/services/tron/services/BitQueryQueue.js +22 -0
- package/build/services/tron/services/BitQuerySubscription.d.ts +5 -0
- package/build/services/tron/services/BitQuerySubscription.d.ts.map +1 -0
- package/build/services/tron/services/BitQuerySubscription.js +7 -0
- package/build/services/tron/services/Escrow.d.ts +1 -0
- package/build/services/tron/services/Escrow.d.ts.map +1 -0
- package/build/services/tron/services/Escrow.js +1 -0
- package/build/services/tron/services/Transactions.d.ts +33 -0
- package/build/services/tron/services/Transactions.d.ts.map +1 -0
- package/build/services/tron/services/Transactions.js +164 -0
- package/build/services/tron/services/TronCustodialWallet.d.ts +17 -0
- package/build/services/tron/services/TronCustodialWallet.d.ts.map +1 -0
- package/build/services/tron/services/TronCustodialWallet.js +46 -0
- package/build/services/tron/services/TronFundingWallet.d.ts +30 -0
- package/build/services/tron/services/TronFundingWallet.d.ts.map +1 -0
- package/build/services/tron/services/TronFundingWallet.js +57 -0
- package/build/services/tron/services/TronHelper.d.ts +11 -0
- package/build/services/tron/services/TronHelper.d.ts.map +1 -0
- package/build/services/tron/services/TronHelper.js +29 -0
- package/build/services/tron/services/TronHotWallet.d.ts +29 -0
- package/build/services/tron/services/TronHotWallet.d.ts.map +1 -0
- package/build/services/tron/services/TronHotWallet.js +168 -0
- package/build/services/tron/services/TronSigner.d.ts +12 -0
- package/build/services/tron/services/TronSigner.d.ts.map +1 -0
- package/build/services/tron/services/TronSigner.js +51 -0
- package/build/services/tron/services/TronWallet.d.ts +32 -0
- package/build/services/tron/services/TronWallet.d.ts.map +1 -0
- package/build/services/tron/services/TronWallet.js +110 -0
- package/build/services/tron/types/bitquery.d.ts +26 -0
- package/build/services/tron/types/bitquery.d.ts.map +1 -0
- package/build/services/tron/types/bitquery.js +3 -0
- package/build/services/tron/types/index.d.ts +3 -0
- package/build/services/tron/types/index.d.ts.map +1 -0
- package/build/services/tron/types/index.js +18 -0
- package/build/services/tron/types/transactions.d.ts +36 -0
- package/build/services/tron/types/transactions.d.ts.map +1 -0
- package/build/services/tron/types/transactions.js +3 -0
- package/build/services/tron/types/tron_helper.d.ts +25 -0
- package/build/services/tron/types/tron_helper.d.ts.map +1 -0
- package/build/services/tron/types/tron_helper.js +3 -0
- package/build/services/types/RedisPubSub.d.ts +11 -0
- package/build/services/types/RedisPubSub.d.ts.map +1 -0
- package/build/services/types/RedisPubSub.js +15 -0
- package/build/services/types/accounting_service.d.ts +7 -0
- package/build/services/types/accounting_service.d.ts.map +1 -0
- package/build/services/types/accounting_service.js +2 -0
- package/build/services/types/alchemy.d.ts +243 -0
- package/build/services/types/alchemy.d.ts.map +1 -0
- package/build/services/types/alchemy.js +3 -0
- package/build/services/types/azure_event_hub_handler.d.ts +18 -0
- package/build/services/types/azure_event_hub_handler.d.ts.map +1 -0
- package/build/services/types/azure_event_hub_handler.js +20 -0
- package/build/services/types/balance_service.d.ts +10 -0
- package/build/services/types/balance_service.d.ts.map +1 -0
- package/build/services/types/balance_service.js +2 -0
- package/build/services/types/chain_manager.d.ts +49 -0
- package/build/services/types/chain_manager.d.ts.map +1 -0
- package/build/services/types/chain_manager.js +2 -0
- package/build/services/types/claim.d.ts +42 -0
- package/build/services/types/claim.d.ts.map +1 -0
- package/build/services/types/claim.js +2 -0
- package/build/services/types/claim_job_service.d.ts +54 -0
- package/build/services/types/claim_job_service.d.ts.map +1 -0
- package/build/services/types/claim_job_service.js +2 -0
- package/build/services/types/crypto_confirmation_locks_service.d.ts +6 -0
- package/build/services/types/crypto_confirmation_locks_service.d.ts.map +1 -0
- package/build/services/types/crypto_confirmation_locks_service.js +2 -0
- package/build/services/types/events_service.d.ts +57 -0
- package/build/services/types/events_service.d.ts.map +1 -0
- package/build/services/types/events_service.js +2 -0
- package/build/services/types/index.d.ts +16 -0
- package/build/services/types/index.d.ts.map +1 -0
- package/build/services/types/index.js +31 -0
- package/build/services/types/lightning.d.ts +129 -0
- package/build/services/types/lightning.d.ts.map +1 -0
- package/build/services/types/lightning.js +2 -0
- package/build/services/types/quicknode.d.ts +7 -0
- package/build/services/types/quicknode.d.ts.map +1 -0
- package/build/services/types/quicknode.js +2 -0
- package/build/services/types/sweep_job_service.d.ts +9 -0
- package/build/services/types/sweep_job_service.d.ts.map +1 -0
- package/build/services/types/sweep_job_service.js +3 -0
- package/build/services/types/timer_manager.d.ts +6 -0
- package/build/services/types/timer_manager.d.ts.map +1 -0
- package/build/services/types/timer_manager.js +2 -0
- package/build/services/types/wallet_manager.d.ts +36 -0
- package/build/services/types/wallet_manager.d.ts.map +1 -0
- package/build/services/types/wallet_manager.js +2 -0
- package/build/services/types/withdrawal.d.ts +48 -0
- package/build/services/types/withdrawal.d.ts.map +1 -0
- package/build/services/types/withdrawal.js +50 -0
- package/build/services/types/withdrawal_manager.d.ts +14 -0
- package/build/services/types/withdrawal_manager.d.ts.map +1 -0
- package/build/services/types/withdrawal_manager.js +2 -0
- package/build/services/utils/alchemy.d.ts +6 -0
- package/build/services/utils/alchemy.d.ts.map +1 -0
- package/build/services/utils/alchemy.js +155 -0
- package/build/services/utils/graphql.d.ts +2 -0
- package/build/services/utils/graphql.d.ts.map +1 -0
- package/build/services/utils/graphql.js +46 -0
- package/build/utils/AsyncRateLimiter.d.ts +23 -0
- package/build/utils/AsyncRateLimiter.d.ts.map +1 -0
- package/build/utils/AsyncRateLimiter.js +84 -0
- package/build/utils/AsyncTTLCache.d.ts +12 -0
- package/build/utils/AsyncTTLCache.d.ts.map +1 -0
- package/build/utils/AsyncTTLCache.js +69 -0
- package/build/utils/Logger.d.ts +67 -0
- package/build/utils/Logger.d.ts.map +1 -0
- package/build/utils/Logger.js +171 -0
- package/build/utils/MemoryMonitor.d.ts +12 -0
- package/build/utils/MemoryMonitor.d.ts.map +1 -0
- package/build/utils/MemoryMonitor.js +59 -0
- package/build/utils/Parsing.d.ts +13 -0
- package/build/utils/Parsing.d.ts.map +1 -0
- package/build/utils/Parsing.js +84 -0
- package/build/utils/RpcLimiter.d.ts +10 -0
- package/build/utils/RpcLimiter.d.ts.map +1 -0
- package/build/utils/RpcLimiter.js +28 -0
- package/build/utils/Utility.d.ts +23 -0
- package/build/utils/Utility.d.ts.map +1 -0
- package/build/utils/Utility.js +211 -0
- package/build/utils/Wallets.d.ts +4 -0
- package/build/utils/Wallets.d.ts.map +1 -0
- package/build/utils/Wallets.js +68 -0
- package/build/utils/custodial.d.ts +32 -0
- package/build/utils/custodial.d.ts.map +1 -0
- package/build/utils/custodial.js +291 -0
- package/build/utils/solana.d.ts +150 -0
- package/build/utils/solana.d.ts.map +1 -0
- package/build/utils/solana.js +658 -0
- package/package.json +107 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.check_approve_delegate = exports.handle_create_versioned_transaction_spl = exports.estimate_withdraw_gas_cost = exports.create_versioned_transaction_solana = exports.get_token_account_info = exports.getSolanaConnectionPublic = exports.getSolanaConnection = exports.find_transfer_instruction = exports.handle_transfer_batch = exports.handle_sweep = exports.SplTransferCheckedLayout = exports.SolTransferInstructionLayout = exports.usdc_program_address = exports.solana_program_address = exports.min_solana_funding_lamports = void 0;
|
|
49
|
+
const buffer_layout_utils_1 = require("@solana/buffer-layout-utils");
|
|
50
|
+
const buffer_layout_1 = require("@solana/buffer-layout");
|
|
51
|
+
const web3_js_1 = __importStar(require("@solana/web3.js"));
|
|
52
|
+
const Utility_1 = require("./Utility");
|
|
53
|
+
const spl_token_1 = require("@solana/spl-token");
|
|
54
|
+
const ChainManager_1 = __importDefault(require("../services/ChainManager"));
|
|
55
|
+
const WalletManager_1 = __importDefault(require("../services/WalletManager"));
|
|
56
|
+
const Wallets_1 = require("./Wallets");
|
|
57
|
+
const WithdrawalManager_1 = __importDefault(require("../services/WithdrawalManager"));
|
|
58
|
+
const constants_1 = require("../constants");
|
|
59
|
+
exports.min_solana_funding_lamports = 0.001 * web3_js_1.LAMPORTS_PER_SOL;
|
|
60
|
+
exports.solana_program_address = "11111111111111111111111111111111";
|
|
61
|
+
exports.usdc_program_address = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
62
|
+
const token_program_addresses = [exports.solana_program_address, exports.usdc_program_address];
|
|
63
|
+
exports.SolTransferInstructionLayout = (0, buffer_layout_1.struct)([(0, buffer_layout_utils_1.u64)('lamports'), (0, buffer_layout_1.u32)("instruction_type")]);
|
|
64
|
+
exports.SplTransferCheckedLayout = (0, buffer_layout_1.struct)([
|
|
65
|
+
(0, buffer_layout_1.u8)('disc'),
|
|
66
|
+
(0, buffer_layout_utils_1.u64)('amount'),
|
|
67
|
+
(0, buffer_layout_1.u8)('decimals')
|
|
68
|
+
]);
|
|
69
|
+
const handle_sweep = (payloads_1, chain_id_1, token_type_1, connection_1, payer_1, ...args_1) => __awaiter(void 0, [payloads_1, chain_id_1, token_type_1, connection_1, payer_1, ...args_1], void 0, function* (payloads, chain_id, token_type, connection, payer, is_funding = false, dbPool, config) {
|
|
70
|
+
if (payloads.length === 0)
|
|
71
|
+
return { status: true, signatures: [], success: [], failed: [] };
|
|
72
|
+
// Get approved token transfers based on payment token
|
|
73
|
+
let batches = [];
|
|
74
|
+
const max_tx_per_batch = config.serverConfig.maxInstructionsPerTxSolana;
|
|
75
|
+
// Create batches without mutating original array
|
|
76
|
+
for (let i = 0; i < payloads.length; i += max_tx_per_batch) {
|
|
77
|
+
const batch = payloads.slice(i, i + max_tx_per_batch);
|
|
78
|
+
batches.push(batch);
|
|
79
|
+
}
|
|
80
|
+
if (batches.length === 0)
|
|
81
|
+
return { status: true, signatures: [], success: [], failed: [] };
|
|
82
|
+
let success = [];
|
|
83
|
+
let failed = [];
|
|
84
|
+
let signatures = [];
|
|
85
|
+
for (let batch of batches) {
|
|
86
|
+
if (token_type === "spl") {
|
|
87
|
+
let { transfer_sig, blocknumber, fee, success: success_requests, failed: failed_requests } = yield (0, exports.handle_create_versioned_transaction_spl)(batch, connection, payer, is_funding, dbPool, config);
|
|
88
|
+
console.log(`Transferred spl tokens for ${batch.length} candidates. Signature: `, transfer_sig);
|
|
89
|
+
signatures.push(transfer_sig);
|
|
90
|
+
if (success_requests.length) {
|
|
91
|
+
let success_candidates = batch.map(r => { return Object.assign(Object.assign({}, r.candidate), { hash: transfer_sig }); });
|
|
92
|
+
success.push(...success_candidates);
|
|
93
|
+
}
|
|
94
|
+
if (failed_requests.length) {
|
|
95
|
+
let failed_candidates = batch.map(r => { return Object.assign(Object.assign({}, r.candidate), { hash: "" }); });
|
|
96
|
+
failed.push(...failed_candidates);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
let tx_result = yield (0, exports.create_versioned_transaction_solana)(batch, connection, is_funding, true, dbPool, config);
|
|
101
|
+
console.log(`Transferred SOL tokens for ${batch.length} candidates. Signature: `, tx_result);
|
|
102
|
+
if (tx_result.success) {
|
|
103
|
+
const sigs = tx_result.success.map(r => r.signature).filter(r => r !== null);
|
|
104
|
+
signatures.push(...sigs);
|
|
105
|
+
let success_candidates = tx_result.success.map(r => {
|
|
106
|
+
const target_candidate = batch.find(b => b.id === r.id);
|
|
107
|
+
if (!target_candidate)
|
|
108
|
+
return undefined;
|
|
109
|
+
return Object.assign(Object.assign({}, target_candidate.candidate), { hash: r.signature }); // todo: Add block number
|
|
110
|
+
})
|
|
111
|
+
.filter(r => r !== undefined);
|
|
112
|
+
success.push(...success_candidates);
|
|
113
|
+
}
|
|
114
|
+
if (tx_result.failed) {
|
|
115
|
+
const failed_candidates = tx_result.failed.map(r => {
|
|
116
|
+
const target_candidate = batch.find(b => b.id === r.id);
|
|
117
|
+
if (!target_candidate)
|
|
118
|
+
return undefined;
|
|
119
|
+
return Object.assign(Object.assign({}, target_candidate.candidate), { hash: "" });
|
|
120
|
+
})
|
|
121
|
+
.filter(r => r !== undefined);
|
|
122
|
+
failed.push(...failed_candidates);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return { status: true, signatures, success, failed };
|
|
127
|
+
});
|
|
128
|
+
exports.handle_sweep = handle_sweep;
|
|
129
|
+
// Combines transfer requests into 1 list given a pre-sorted payloads array by chain id and blockchain
|
|
130
|
+
// export const handle_transfer_batch = async (payloads: SolanaTransactionPayload[]) => {
|
|
131
|
+
const handle_transfer_batch = (payloads_1, chain_id_1, token_type_1, connection_1, payer_1, ...args_1) => __awaiter(void 0, [payloads_1, chain_id_1, token_type_1, connection_1, payer_1, ...args_1], void 0, function* (payloads, chain_id, token_type, connection, payer, is_funding = false, dbPool, config) {
|
|
132
|
+
if (payloads.length === 0)
|
|
133
|
+
return { status: true, signatures: [], success: [], failed: [] };
|
|
134
|
+
// Get approved token transfers based on payment token
|
|
135
|
+
// const sanitized_requests = payloads.map(p => { return get_approved_requests(p.blockchain, p.chain_id, p.request) })
|
|
136
|
+
// const transfer_requests: SolanaTransactionRequest[] = sanitized_requests.flatMap(p => p);
|
|
137
|
+
let batches = [];
|
|
138
|
+
const max_tx_per_batch = config.serverConfig.maxInstructionsPerTxSolana;
|
|
139
|
+
// Create batches without mutating original array
|
|
140
|
+
for (let i = 0; i < payloads.length; i += max_tx_per_batch) {
|
|
141
|
+
const batch = payloads.slice(i, i + max_tx_per_batch);
|
|
142
|
+
console.log(`Adding ${batch.length} items to batch transaction...`);
|
|
143
|
+
batches.push(batch);
|
|
144
|
+
}
|
|
145
|
+
if (batches.length === 0)
|
|
146
|
+
return { status: true, signatures: [], success: [], failed: [] };
|
|
147
|
+
const withdraw_manager = new WithdrawalManager_1.default(dbPool, config);
|
|
148
|
+
let success = [];
|
|
149
|
+
let failed = [];
|
|
150
|
+
let signatures = [];
|
|
151
|
+
for (let batch of batches) {
|
|
152
|
+
if (token_type === "spl") {
|
|
153
|
+
try {
|
|
154
|
+
const executed_at = new Date();
|
|
155
|
+
let { transfer_sig, blocknumber, fee } = yield (0, exports.handle_create_versioned_transaction_spl)(batch, connection, payer, is_funding, dbPool, config);
|
|
156
|
+
console.log(`Transferred spl tokens for ${batch.length} candidates. Signature: `, transfer_sig);
|
|
157
|
+
signatures.push(transfer_sig);
|
|
158
|
+
let success_requests = batch.map(b => {
|
|
159
|
+
return Object.assign(Object.assign({}, b), { signature: transfer_sig, blocknumber, gas_used: fee, fee: fee, executed_at });
|
|
160
|
+
});
|
|
161
|
+
success.push(...success_requests);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
failed.push(...batch);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
let tx_result = yield (0, exports.create_versioned_transaction_solana)(batch, connection, is_funding, true, dbPool, config);
|
|
169
|
+
console.log(`Transferred SOL tokens for ${batch.length} candidates. Signature: `, tx_result);
|
|
170
|
+
if (tx_result.success) {
|
|
171
|
+
const sigs = tx_result.success.map(r => r.signature).filter(r => r !== null);
|
|
172
|
+
signatures.push(...sigs);
|
|
173
|
+
success.push(...tx_result.success);
|
|
174
|
+
}
|
|
175
|
+
if (tx_result.failed) {
|
|
176
|
+
// const failed_requests = tx_result.failed.flatMap(r => r.requests);
|
|
177
|
+
failed.push(...tx_result.failed);
|
|
178
|
+
success.push();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return { status: true, signatures, success, failed };
|
|
183
|
+
});
|
|
184
|
+
exports.handle_transfer_batch = handle_transfer_batch;
|
|
185
|
+
const find_transfer_instruction = (tx) => {
|
|
186
|
+
const message = tx.transaction[0].message[0];
|
|
187
|
+
const target_instruction = message.instructions.find(i => token_program_addresses.some(a => a === message.account_keys[parseInt(i.program_id_index)]));
|
|
188
|
+
if (!target_instruction)
|
|
189
|
+
throw new Error(`Cannot find program index for accepted payment tokens: ${token_program_addresses}`);
|
|
190
|
+
const program_index = target_instruction === null || target_instruction === void 0 ? void 0 : target_instruction.program_id_index;
|
|
191
|
+
return { instruction: target_instruction, is_native: tx.transaction[0].message[0].account_keys[parseInt(program_index)] === exports.solana_program_address };
|
|
192
|
+
};
|
|
193
|
+
exports.find_transfer_instruction = find_transfer_instruction;
|
|
194
|
+
const getSolanaConnection = (chainId, config) => {
|
|
195
|
+
const network = ChainManager_1.default.getInstance(config).getChainConfigForChainIdSync(parseInt(chainId));
|
|
196
|
+
if (!network)
|
|
197
|
+
throw new Error(`Network config not set for ${chainId}`);
|
|
198
|
+
const url = `${network.rpcBaseUrl}/${config.config.ankrApiKey}`;
|
|
199
|
+
return new web3_js_1.Connection(url, 'confirmed');
|
|
200
|
+
};
|
|
201
|
+
exports.getSolanaConnection = getSolanaConnection;
|
|
202
|
+
const getSolanaConnectionPublic = (chainId) => {
|
|
203
|
+
const url = chainId === '101'
|
|
204
|
+
? (0, web3_js_1.clusterApiUrl)('mainnet-beta')
|
|
205
|
+
: chainId === '102'
|
|
206
|
+
? (0, web3_js_1.clusterApiUrl)('testnet')
|
|
207
|
+
: (0, web3_js_1.clusterApiUrl)('devnet');
|
|
208
|
+
return new web3_js_1.Connection(url, 'confirmed');
|
|
209
|
+
};
|
|
210
|
+
exports.getSolanaConnectionPublic = getSolanaConnectionPublic;
|
|
211
|
+
const get_token_account_info = (chainId, mint_address, owner_address, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
212
|
+
const connection = (0, exports.getSolanaConnection)(chainId, config);
|
|
213
|
+
const mintPk = new web3_js_1.PublicKey(mint_address);
|
|
214
|
+
const ownerPk = new web3_js_1.PublicKey(owner_address);
|
|
215
|
+
const parsedTokenAccounts = yield (0, Utility_1.retryWithExponentialBackoff)(() => connection.getParsedTokenAccountsByOwner(ownerPk, { programId: spl_token_1.TOKEN_PROGRAM_ID }));
|
|
216
|
+
const targetAccount = parsedTokenAccounts.value.find(a => a.account.data.parsed.info.mint.toString() === mintPk.toString());
|
|
217
|
+
if (!targetAccount)
|
|
218
|
+
throw new Error("Token account not found");
|
|
219
|
+
const tokenInfo = yield connection.getAccountInfo(targetAccount.pubkey);
|
|
220
|
+
const sol_balance = tokenInfo === null || tokenInfo === void 0 ? void 0 : tokenInfo.lamports;
|
|
221
|
+
const balance = targetAccount.account.data.parsed.info.tokenAmount.amount;
|
|
222
|
+
const balance_decimals = targetAccount.account.data.parsed.info.tokenAmount.uiAmount;
|
|
223
|
+
const decimals = targetAccount.account.data.parsed.info.tokenAmount.decimals;
|
|
224
|
+
return {
|
|
225
|
+
sol_balance_lamports: sol_balance,
|
|
226
|
+
spl_balance_lamports: balance,
|
|
227
|
+
spl_balance_decimals: balance_decimals,
|
|
228
|
+
decimals
|
|
229
|
+
};
|
|
230
|
+
});
|
|
231
|
+
exports.get_token_account_info = get_token_account_info;
|
|
232
|
+
const is_payment_token = (blockchain, payment_tokens, target) => {
|
|
233
|
+
const entry = payment_tokens.find(p => (0, Wallets_1.normalizeAddress)(p, blockchain) === (0, Wallets_1.normalizeAddress)(target, blockchain));
|
|
234
|
+
return entry ? true : false;
|
|
235
|
+
};
|
|
236
|
+
const get_approved_requests = (blockchain, chain_id, requests, config) => {
|
|
237
|
+
// Ensure payment token is accepted
|
|
238
|
+
const chain_manager = ChainManager_1.default.getInstance(config);
|
|
239
|
+
const payment_tokens = chain_manager.getPaymentTokensForChain(parseInt(chain_id));
|
|
240
|
+
if (!payment_tokens)
|
|
241
|
+
throw new Error(`Payment tokens not found for chain ${chain_id}`);
|
|
242
|
+
const token_addresses = payment_tokens.map(t => t.address);
|
|
243
|
+
const accepted_requests = requests.filter(r => is_payment_token(blockchain, token_addresses, r.token));
|
|
244
|
+
return accepted_requests;
|
|
245
|
+
};
|
|
246
|
+
// const create_versioned_transaction_solana = async (chain_id: ChainId, from_address: string, to_address: string, amount_in_lamports: number) => {
|
|
247
|
+
const create_versioned_transaction_solana = (requests_1, connection_1, ...args_1) => __awaiter(void 0, [requests_1, connection_1, ...args_1], void 0, function* (requests, connection, is_funding = false, is_sweep = false, dbPool, config) {
|
|
248
|
+
let min_rent = yield (0, Utility_1.retryWithExponentialBackoff)(() => connection.getMinimumBalanceForRentExemption(0));
|
|
249
|
+
let { blockhash } = yield (0, Utility_1.retryWithExponentialBackoff)(() => connection.getLatestBlockhash());
|
|
250
|
+
const walletManager = WalletManager_1.default.getInstance(config, dbPool);
|
|
251
|
+
const funding_wallet = walletManager.getEscrowFundsManagerWallet("solana");
|
|
252
|
+
const funding_address = funding_wallet.publicKey.toString();
|
|
253
|
+
if (is_funding) {
|
|
254
|
+
try {
|
|
255
|
+
const instructions = requests.map(p => web3_js_1.default.SystemProgram.transfer({
|
|
256
|
+
fromPubkey: new web3_js_1.PublicKey(p.from_address),
|
|
257
|
+
toPubkey: new web3_js_1.PublicKey(p.to_address),
|
|
258
|
+
lamports: p.amount_in_lamports
|
|
259
|
+
}));
|
|
260
|
+
const message_v0 = new web3_js_1.default.TransactionMessage({
|
|
261
|
+
payerKey: funding_wallet.publicKey,
|
|
262
|
+
recentBlockhash: blockhash,
|
|
263
|
+
instructions: instructions
|
|
264
|
+
}).compileToV0Message();
|
|
265
|
+
const transaction = new web3_js_1.default.VersionedTransaction(message_v0);
|
|
266
|
+
transaction.sign([funding_wallet]);
|
|
267
|
+
const executed_at = new Date();
|
|
268
|
+
const tx_id = yield connection.sendTransaction(transaction);
|
|
269
|
+
let _reqs = requests.map(r => {
|
|
270
|
+
return Object.assign(Object.assign({}, r), { hash: tx_id });
|
|
271
|
+
});
|
|
272
|
+
yield (0, Utility_1.sleep)(200);
|
|
273
|
+
// Get the transaction details
|
|
274
|
+
const tx_data = yield (0, Utility_1.retryWithExponentialBackoff)(() => connection.getParsedTransaction(tx_id, { maxSupportedTransactionVersion: 0, commitment: 'confirmed' }));
|
|
275
|
+
const success = _reqs.map(r => {
|
|
276
|
+
var _a, _b;
|
|
277
|
+
return Object.assign(Object.assign({}, r), { signature: tx_id, blocknumber: (tx_data === null || tx_data === void 0 ? void 0 : tx_data.slot) ? tx_data.slot : 0, gas_used: ((_a = tx_data === null || tx_data === void 0 ? void 0 : tx_data.meta) === null || _a === void 0 ? void 0 : _a.computeUnitsConsumed) ? tx_data.meta.computeUnitsConsumed : 0, fee: ((_b = tx_data === null || tx_data === void 0 ? void 0 : tx_data.meta) === null || _b === void 0 ? void 0 : _b.fee) ? tx_data.meta.fee / requests.length : 0, // average fee per instruction
|
|
278
|
+
executed_at });
|
|
279
|
+
});
|
|
280
|
+
return { success: success, failed: [] };
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
const _reqs = requests.map(r => { return Object.assign(Object.assign({}, r), { hash: "" }); });
|
|
284
|
+
return { success: [], failed: _reqs };
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
const promises = yield Promise.allSettled(requests.map((r) => __awaiter(void 0, void 0, void 0, function* () {
|
|
289
|
+
var _a, _b;
|
|
290
|
+
try {
|
|
291
|
+
const payer = walletManager.deriveWallet(r.source_parent_index, r.source_child_index, "solana");
|
|
292
|
+
const onchainbalance = yield connection.getBalance(payer.wallet.publicKey);
|
|
293
|
+
// Transfer entire balance in case of sweeping
|
|
294
|
+
const amount_in_lamports = !is_sweep && onchainbalance >= BigInt(r.amount_in_lamports) ? BigInt(r.amount_in_lamports) : BigInt(onchainbalance);
|
|
295
|
+
let { amount_to_transfer, gas_cost } = yield estimate_gas_cost_transfer_sol(payer.wallet, r.from_address, funding_wallet.publicKey.toString(), amount_in_lamports, connection);
|
|
296
|
+
const instructions = [web3_js_1.default.SystemProgram.transfer({
|
|
297
|
+
fromPubkey: new web3_js_1.PublicKey(r.from_address),
|
|
298
|
+
toPubkey: funding_wallet.publicKey,
|
|
299
|
+
lamports: amount_to_transfer
|
|
300
|
+
})];
|
|
301
|
+
// Skip low balance
|
|
302
|
+
if (amount_to_transfer === BigInt(0)) {
|
|
303
|
+
return { status: true, signature: "", requests: [Object.assign(Object.assign({}, r), { signature: "", blocknumber: 0, gas_used: 0 })] };
|
|
304
|
+
}
|
|
305
|
+
const block = yield (0, Utility_1.retryWithExponentialBackoff)(() => connection.getLatestBlockhash());
|
|
306
|
+
const message_v0 = new web3_js_1.default.TransactionMessage({
|
|
307
|
+
payerKey: payer.wallet.publicKey,
|
|
308
|
+
recentBlockhash: blockhash,
|
|
309
|
+
instructions: instructions
|
|
310
|
+
}).compileToV0Message();
|
|
311
|
+
const transaction = new web3_js_1.default.VersionedTransaction(message_v0);
|
|
312
|
+
transaction.sign([payer.wallet]);
|
|
313
|
+
try {
|
|
314
|
+
const executed_at = new Date();
|
|
315
|
+
const tx_id = yield connection.sendTransaction(transaction);
|
|
316
|
+
yield (0, Utility_1.sleep)(100);
|
|
317
|
+
// Get the transaction details
|
|
318
|
+
const fee = yield (0, Utility_1.retryWithExponentialBackoff)(() => connection.getParsedTransaction(tx_id, "confirmed"));
|
|
319
|
+
const _reqs = [
|
|
320
|
+
Object.assign(Object.assign({}, r), { signature: tx_id, blocknumber: block.lastValidBlockHeight, gas_used: ((_a = fee === null || fee === void 0 ? void 0 : fee.meta) === null || _a === void 0 ? void 0 : _a.computeUnitsConsumed) ? fee.meta.computeUnitsConsumed : 0, fee: ((_b = fee === null || fee === void 0 ? void 0 : fee.meta) === null || _b === void 0 ? void 0 : _b.fee) ? fee.meta.fee : 0, executed_at })
|
|
321
|
+
];
|
|
322
|
+
return { status: true, signature: tx_id, requests: _reqs };
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
return { status: false, signature: null, requests: requests, error: error.message ? error.message : "Unexpected error occured while creating SOL transaction" };
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
const _reqs = [Object.assign({}, r)];
|
|
330
|
+
return { status: false, signature: null, requests: _reqs, error: error.message ? error.message : "Unexpected error occured while creating SOL transaction" };
|
|
331
|
+
}
|
|
332
|
+
})));
|
|
333
|
+
//29999700
|
|
334
|
+
//29995000
|
|
335
|
+
//'Transfer: insufficient lamports 9995000, need 9999700'
|
|
336
|
+
//.009995000
|
|
337
|
+
//.009999700
|
|
338
|
+
const success = promises
|
|
339
|
+
.filter(r => r.status === "fulfilled")
|
|
340
|
+
.map(r => {
|
|
341
|
+
if (r.value.status === true) {
|
|
342
|
+
return r.value.requests;
|
|
343
|
+
}
|
|
344
|
+
return undefined;
|
|
345
|
+
})
|
|
346
|
+
.filter(r => r !== undefined)
|
|
347
|
+
.flatMap(r => r);
|
|
348
|
+
const failed = promises
|
|
349
|
+
.filter(r => r.status === "fulfilled")
|
|
350
|
+
.map(r => {
|
|
351
|
+
if (r.value.status === false) {
|
|
352
|
+
return r.value.requests;
|
|
353
|
+
}
|
|
354
|
+
})
|
|
355
|
+
.filter(r => r !== undefined)
|
|
356
|
+
.flatMap(r => r);
|
|
357
|
+
return { success: success, failed: failed };
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
exports.create_versioned_transaction_solana = create_versioned_transaction_solana;
|
|
361
|
+
const estimate_gas_cost_transfer_sol = (signer, from_address, to_address, amount_in_lamports, connection) => __awaiter(void 0, void 0, void 0, function* () {
|
|
362
|
+
const fromPubkey = new web3_js_1.PublicKey(from_address);
|
|
363
|
+
const toPubkey = new web3_js_1.PublicKey(to_address);
|
|
364
|
+
// Build a message identical to the one you'll send (amount doesn't change fee)
|
|
365
|
+
const { blockhash } = yield connection.getLatestBlockhash();
|
|
366
|
+
const ix = web3_js_1.default.SystemProgram.transfer({
|
|
367
|
+
fromPubkey,
|
|
368
|
+
toPubkey,
|
|
369
|
+
lamports: amount_in_lamports
|
|
370
|
+
});
|
|
371
|
+
const msg = new web3_js_1.default.TransactionMessage({
|
|
372
|
+
payerKey: fromPubkey,
|
|
373
|
+
recentBlockhash: blockhash,
|
|
374
|
+
instructions: [ix],
|
|
375
|
+
}).compileToV0Message();
|
|
376
|
+
const feeResp = yield connection.getFeeForMessage(msg);
|
|
377
|
+
if (!feeResp || feeResp.value === null)
|
|
378
|
+
throw new Error("Failed to estimate transaction fee.");
|
|
379
|
+
const feeLamports = BigInt(feeResp.value);
|
|
380
|
+
const balanceLamports = BigInt(yield connection.getBalance(fromPubkey));
|
|
381
|
+
const spendable = balanceLamports > feeLamports ? (balanceLamports - feeLamports) : BigInt(0);
|
|
382
|
+
// Cap the amount to send by what's actually spendable after fees
|
|
383
|
+
const amount_to_transfer = amount_in_lamports > spendable ? spendable : amount_in_lamports;
|
|
384
|
+
return {
|
|
385
|
+
gas_cost: feeLamports,
|
|
386
|
+
balance: balanceLamports,
|
|
387
|
+
amount_to_transfer
|
|
388
|
+
};
|
|
389
|
+
});
|
|
390
|
+
const estimate_withdraw_gas_cost = (chain_id, transfer_requests, payer, dbPool, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
391
|
+
if (!transfer_requests.length)
|
|
392
|
+
return 0;
|
|
393
|
+
const connection = (0, exports.getSolanaConnection)(chain_id, config);
|
|
394
|
+
const sol_requests = transfer_requests.filter(r => r.token === exports.solana_program_address);
|
|
395
|
+
const spl_requests = transfer_requests.filter(r => r.token !== exports.solana_program_address);
|
|
396
|
+
const sol_payload = sol_requests.map(r => {
|
|
397
|
+
return {
|
|
398
|
+
fromPubkey: new web3_js_1.PublicKey(r.from_address),
|
|
399
|
+
toPubkey: new web3_js_1.PublicKey(r.to_address),
|
|
400
|
+
lamports: BigInt(r.amount_in_lamports)
|
|
401
|
+
};
|
|
402
|
+
});
|
|
403
|
+
let sol_estimation = 0;
|
|
404
|
+
if (sol_payload.length) {
|
|
405
|
+
sol_estimation = yield estimate_batch_transfer_sol(sol_payload, payer, connection);
|
|
406
|
+
}
|
|
407
|
+
let spl_estimation = 0;
|
|
408
|
+
if (spl_requests.length) {
|
|
409
|
+
spl_estimation = yield estimate_gas_cost_transfer_spl(spl_requests, connection, payer, dbPool, config);
|
|
410
|
+
}
|
|
411
|
+
return sol_estimation + spl_estimation;
|
|
412
|
+
});
|
|
413
|
+
exports.estimate_withdraw_gas_cost = estimate_withdraw_gas_cost;
|
|
414
|
+
const estimate_batch_transfer_sol = (transfer_requests, payer, connection) => __awaiter(void 0, void 0, void 0, function* () {
|
|
415
|
+
if (transfer_requests.length === 0)
|
|
416
|
+
return 0;
|
|
417
|
+
const block = yield connection.getLatestBlockhash();
|
|
418
|
+
const ixs = transfer_requests.map(p => {
|
|
419
|
+
return web3_js_1.default.SystemProgram.transfer(p);
|
|
420
|
+
});
|
|
421
|
+
const msg = new web3_js_1.default.TransactionMessage({
|
|
422
|
+
payerKey: payer.publicKey,
|
|
423
|
+
recentBlockhash: block.blockhash,
|
|
424
|
+
instructions: ixs
|
|
425
|
+
}).compileToV0Message();
|
|
426
|
+
const fee_res = yield connection.getFeeForMessage(msg);
|
|
427
|
+
if (!fee_res || fee_res.value === null)
|
|
428
|
+
throw new Error("Failed to estimate transaction fee.");
|
|
429
|
+
return fee_res.value;
|
|
430
|
+
});
|
|
431
|
+
const estimate_gas_cost_transfer_spl = (transfer_requests, connection, payer, dbPool, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
432
|
+
if (transfer_requests.length === 0)
|
|
433
|
+
return 0;
|
|
434
|
+
const blockhash = yield connection.getLatestBlockhash();
|
|
435
|
+
// TODO: CHeck is_funding
|
|
436
|
+
// Build the transaction instructions
|
|
437
|
+
const { transfer_transaction, signers } = yield build_transactions_spl(transfer_requests, connection, false, dbPool, config);
|
|
438
|
+
transfer_transaction.recentBlockhash = blockhash.blockhash;
|
|
439
|
+
transfer_transaction.feePayer = payer.publicKey;
|
|
440
|
+
// const estimated_fee = await retryWithExponentialBackoff(() => transfer_transaction.getEstimatedFee(connection));
|
|
441
|
+
const estimated_fee = yield (0, Utility_1.retryWithExponentialBackoff)(() => transfer_transaction.getEstimatedFee(connection));
|
|
442
|
+
// TODO: Return fallback value
|
|
443
|
+
if (estimated_fee === null)
|
|
444
|
+
throw new Error("Failed to estimated transaction cost");
|
|
445
|
+
return estimated_fee;
|
|
446
|
+
});
|
|
447
|
+
const handle_create_versioned_transaction_spl = (transfer_requests, connection, payer, is_funding, dbPool, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
448
|
+
var _a, _b, _c;
|
|
449
|
+
if (transfer_requests.length > config.serverConfig.maxInstructionsPerTxSolana)
|
|
450
|
+
throw new Error(`Cannot exceed maxium instructions per transaction of ${config.serverConfig.maxInstructionsPerTxSolana}`);
|
|
451
|
+
const block = yield (0, Utility_1.retryWithExponentialBackoff)(() => connection.getLatestBlockhash());
|
|
452
|
+
// Build the transaction instructions
|
|
453
|
+
const { transfer_transaction, signers } = yield build_transactions_spl(transfer_requests, connection, is_funding, dbPool, config);
|
|
454
|
+
let success_requests = [];
|
|
455
|
+
let failed_requests = [];
|
|
456
|
+
let signature = "";
|
|
457
|
+
let gas_used = 0;
|
|
458
|
+
let fee = 0;
|
|
459
|
+
try {
|
|
460
|
+
const executed_at = new Date();
|
|
461
|
+
// Sign and send the tx
|
|
462
|
+
signature = yield (0, Utility_1.retryWithExponentialBackoff)(() => (0, web3_js_1.sendAndConfirmTransaction)(connection, transfer_transaction, [payer, ...signers], { commitment: 'confirmed' }));
|
|
463
|
+
const tx = yield (0, Utility_1.retryWithExponentialBackoff)(() => connection.getParsedTransaction(signature, "confirmed"));
|
|
464
|
+
gas_used = ((_a = tx === null || tx === void 0 ? void 0 : tx.meta) === null || _a === void 0 ? void 0 : _a.computeUnitsConsumed) ? tx.meta.computeUnitsConsumed : 0;
|
|
465
|
+
fee = ((_b = tx === null || tx === void 0 ? void 0 : tx.meta) === null || _b === void 0 ? void 0 : _b.fee) ? (_c = tx.meta) === null || _c === void 0 ? void 0 : _c.fee : 0;
|
|
466
|
+
const fee_per_ix = fee / transfer_requests.length;
|
|
467
|
+
success_requests = transfer_requests.map(r => {
|
|
468
|
+
return Object.assign(Object.assign({}, r), { signature: signature, blocknumber: block.lastValidBlockHeight, gas_used: gas_used, fee: fee_per_ix, executed_at });
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
catch (error) {
|
|
472
|
+
failed_requests.push(...transfer_requests);
|
|
473
|
+
}
|
|
474
|
+
return {
|
|
475
|
+
success: success_requests,
|
|
476
|
+
failed: failed_requests,
|
|
477
|
+
transfer_sig: signature,
|
|
478
|
+
blocknumber: block.lastValidBlockHeight,
|
|
479
|
+
gas_cost: gas_used,
|
|
480
|
+
fee: fee
|
|
481
|
+
};
|
|
482
|
+
});
|
|
483
|
+
exports.handle_create_versioned_transaction_spl = handle_create_versioned_transaction_spl;
|
|
484
|
+
const setup_spl_token_transfer = (token, from, to, connection) => __awaiter(void 0, void 0, void 0, function* () {
|
|
485
|
+
var _a;
|
|
486
|
+
const fromTokenAccountAddress = yield (0, spl_token_1.getAssociatedTokenAddress)(token, from, false, spl_token_1.TOKEN_PROGRAM_ID);
|
|
487
|
+
const toTokenAccountAddress = yield (0, spl_token_1.getAssociatedTokenAddress)(token, to, false, spl_token_1.TOKEN_PROGRAM_ID);
|
|
488
|
+
const info = yield connection.getParsedAccountInfo(token);
|
|
489
|
+
if (!info)
|
|
490
|
+
throw new Error(`Failed to get spl token account decimals for: ${token.toString()}`);
|
|
491
|
+
return {
|
|
492
|
+
senderATA: fromTokenAccountAddress,
|
|
493
|
+
receiverATA: toTokenAccountAddress,
|
|
494
|
+
mint: token,
|
|
495
|
+
decimals: ((_a = info.value) === null || _a === void 0 ? void 0 : _a.data).parsed.decimals,
|
|
496
|
+
};
|
|
497
|
+
});
|
|
498
|
+
const build_solana_transactions = (transfer_requests, conection) => {
|
|
499
|
+
let instructions = [];
|
|
500
|
+
const transfer_transaction = new web3_js_1.Transaction();
|
|
501
|
+
};
|
|
502
|
+
const build_spl_instructions = (payloads, connection) => __awaiter(void 0, void 0, void 0, function* () {
|
|
503
|
+
let instructions = [];
|
|
504
|
+
const transfer_transaction = new web3_js_1.Transaction();
|
|
505
|
+
let signers = new Map();
|
|
506
|
+
for (let t of payloads) {
|
|
507
|
+
const { mint, senderATA, receiverATA } = yield setup_spl_token_transfer(new web3_js_1.PublicKey(t.token), new web3_js_1.PublicKey(t.from_address), new web3_js_1.PublicKey(t.to_address), connection);
|
|
508
|
+
const transfer_ix = (0, spl_token_1.createTransferCheckedInstruction)(senderATA, new web3_js_1.PublicKey(t.token), receiverATA, new web3_js_1.PublicKey(t.from_address), t.amount_in_lamports, t.decimals, [], spl_token_1.TOKEN_PROGRAM_ID);
|
|
509
|
+
instructions.push(transfer_ix);
|
|
510
|
+
// Add the instruction to the transaction
|
|
511
|
+
transfer_transaction.add(transfer_ix);
|
|
512
|
+
signers.set(t.from_address, t);
|
|
513
|
+
}
|
|
514
|
+
return { signers, instructions, transfer_transaction };
|
|
515
|
+
});
|
|
516
|
+
const build_transactions_spl = (transfer_requests_1, connection_1, ...args_1) => __awaiter(void 0, [transfer_requests_1, connection_1, ...args_1], void 0, function* (transfer_requests, connection, is_funding = false, dbPool, config) {
|
|
517
|
+
const wallet_manager = WalletManager_1.default.getInstance(config, dbPool);
|
|
518
|
+
const { signers, instructions, transfer_transaction } = yield build_spl_instructions(transfer_requests, connection);
|
|
519
|
+
let signer_keypairs = [];
|
|
520
|
+
for (let [address, request] of signers.entries()) {
|
|
521
|
+
let keypair = null;
|
|
522
|
+
if (is_funding) {
|
|
523
|
+
keypair = WalletManager_1.default.getInstance(config, dbPool).getEscrowFundsManagerWallet(constants_1.BLOCKCHAINS.SOLANA);
|
|
524
|
+
signer_keypairs.push(keypair);
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
const keys = wallet_manager.deriveWallet(request.source_parent_index, request.source_child_index, "solana");
|
|
528
|
+
signer_keypairs.push(keys.wallet);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
return { transfer_transaction, signers: signer_keypairs };
|
|
532
|
+
});
|
|
533
|
+
const check_approve_delegate = (chain_id, from_address, parent_index, child_index, token, dbPool, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
534
|
+
const wallet_manager = WalletManager_1.default.getInstance(config, dbPool);
|
|
535
|
+
const connection = (0, exports.getSolanaConnection)(chain_id, config);
|
|
536
|
+
// const token_address = "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU";
|
|
537
|
+
const from_wallet = wallet_manager.deriveWallet(parent_index, child_index, "solana");
|
|
538
|
+
const payer = wallet_manager.getEscrowFundsManagerWallet("solana");
|
|
539
|
+
const delegate = payer;
|
|
540
|
+
// Fetch token account
|
|
541
|
+
const { decimals, associated_token_account, balance } = yield get_or_create_token_account(connection, from_wallet.wallet, token);
|
|
542
|
+
// Only create new approval if current amount is 0
|
|
543
|
+
const current_spending = yield get_approved_spending(connection, associated_token_account.address.toString());
|
|
544
|
+
if (current_spending.amount > 0)
|
|
545
|
+
return true;
|
|
546
|
+
// Fund wallet with sol
|
|
547
|
+
const res = yield (0, exports.create_versioned_transaction_solana)([{
|
|
548
|
+
id: 0,
|
|
549
|
+
// source_parent_index: config.config.fundsManagerIndices[1],
|
|
550
|
+
source_parent_index: 2,
|
|
551
|
+
source_child_index: 0,
|
|
552
|
+
from_address: payer.publicKey.toString(),
|
|
553
|
+
to_address: from_address,
|
|
554
|
+
decimals: decimals,
|
|
555
|
+
token,
|
|
556
|
+
amount_in_lamports: BigInt(1000000)
|
|
557
|
+
}], connection, true, false, dbPool, config);
|
|
558
|
+
yield (0, Utility_1.sleep)(200);
|
|
559
|
+
// Approve
|
|
560
|
+
const is_approved = yield approve_delegate(connection, associated_token_account.address.toString(), token, from_wallet.wallet, delegate.publicKey.toString(), decimals);
|
|
561
|
+
if (!is_approved)
|
|
562
|
+
throw new Error("Failed to set spending allowance.");
|
|
563
|
+
// Get updated account details
|
|
564
|
+
let account_data = yield get_approved_spending(connection, associated_token_account.address.toString());
|
|
565
|
+
return true;
|
|
566
|
+
});
|
|
567
|
+
exports.check_approve_delegate = check_approve_delegate;
|
|
568
|
+
const approve_delegate = (connection, associated_token_account_address, token_address, owner, delegate_address, decimals) => __awaiter(void 0, void 0, void 0, function* () {
|
|
569
|
+
const latest_blockhash = yield connection.getLatestBlockhash();
|
|
570
|
+
const approve_amount = BigInt(1000000000000000000);
|
|
571
|
+
// Create instruction
|
|
572
|
+
const approve_ix = (0, spl_token_1.createApproveCheckedInstruction)(new web3_js_1.PublicKey(associated_token_account_address), new web3_js_1.PublicKey(token_address), new web3_js_1.PublicKey(delegate_address), owner.publicKey, approve_amount, decimals, [], spl_token_1.TOKEN_PROGRAM_ID);
|
|
573
|
+
// Create transaction
|
|
574
|
+
const approve_tx = new web3_js_1.Transaction({
|
|
575
|
+
feePayer: owner.publicKey,
|
|
576
|
+
blockhash: latest_blockhash.blockhash,
|
|
577
|
+
lastValidBlockHeight: latest_blockhash.lastValidBlockHeight
|
|
578
|
+
}).add(approve_ix);
|
|
579
|
+
try {
|
|
580
|
+
// Send transaction
|
|
581
|
+
const tx_signature = yield (0, web3_js_1.sendAndConfirmTransaction)(connection, approve_tx, [owner]);
|
|
582
|
+
// Get updated spending
|
|
583
|
+
// const { delegate, amount } = await get_approved_spending(connection, associated_token_account_address);
|
|
584
|
+
return true;
|
|
585
|
+
}
|
|
586
|
+
catch (error) {
|
|
587
|
+
const solana_error = error;
|
|
588
|
+
const details = yield solana_error.getLogs(connection);
|
|
589
|
+
console.log(`Full solana error log: `, details);
|
|
590
|
+
throw error;
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
const get_approved_spending = (connection, associated_token_account_address) => __awaiter(void 0, void 0, void 0, function* () {
|
|
594
|
+
let _account_data = yield (0, spl_token_1.getAccount)(connection, new web3_js_1.PublicKey(associated_token_account_address), "confirmed", spl_token_1.TOKEN_PROGRAM_ID);
|
|
595
|
+
const _delegate = _account_data.delegate;
|
|
596
|
+
const _delegate_amt = _account_data.delegatedAmount;
|
|
597
|
+
return {
|
|
598
|
+
delegate: _delegate === null || _delegate === void 0 ? void 0 : _delegate.toString(),
|
|
599
|
+
amount: _delegate_amt
|
|
600
|
+
};
|
|
601
|
+
});
|
|
602
|
+
const get_token_account = () => {
|
|
603
|
+
};
|
|
604
|
+
const get_or_create_token_account = (connection, owner, token_address) => __awaiter(void 0, void 0, void 0, function* () {
|
|
605
|
+
const associated_token_account = yield (0, spl_token_1.getOrCreateAssociatedTokenAccount)(connection, owner, new web3_js_1.PublicKey(token_address), new web3_js_1.PublicKey(owner.publicKey), false, "confirmed", undefined, spl_token_1.TOKEN_PROGRAM_ID, spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID);
|
|
606
|
+
const account_balance = (yield connection.getTokenAccountBalance(associated_token_account.address));
|
|
607
|
+
let _decimals = account_balance.value.decimals;
|
|
608
|
+
return { decimals: _decimals, associated_token_account, balance: account_balance.value.amount };
|
|
609
|
+
});
|
|
610
|
+
/**
|
|
611
|
+
*
|
|
612
|
+
* ed SOL tokens for 9 candidates. Signature: {
|
|
613
|
+
success: [
|
|
614
|
+
{
|
|
615
|
+
status: true,
|
|
616
|
+
signature: '5TqE4jg9uAUYjSD9qesaUTTetY2gyr3jTu2DVQmgLnV5S39v1NZtVqd6rkqBX2gCFWbA28oosJdTMw3s4zPW86c6',
|
|
617
|
+
requests: [Array]
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
status: true,
|
|
621
|
+
signature: '5SKz2R5tJ6s4SjCYpf6guEjup7AJsdXfmFrcDVj6g3E3bWChhaS2JbTek9iUmaogjRZgbriHtyEuhseHJMYfR9NZ',
|
|
622
|
+
requests: [Array]
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
status: true,
|
|
626
|
+
signature: 'Rv9fe8aALLg2JZRZPQnAChsVrYatP15Ujq4xDbyeqvcR5p8NMCwmLu6i3Sy5ZSQsL3ZbhSBTYAoTEkuw1RkHvQh',
|
|
627
|
+
requests: [Array]
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
status: true,
|
|
631
|
+
signature: '4US2GHvquPAYejYcqDkHEXqNZs2B3geYDs8sJL2NsDqyTAUboGyWTPo1Yt9547qBakpuuP2Zi4DRABbPEtoq3EDs',
|
|
632
|
+
requests: [Array]
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
status: true,
|
|
636
|
+
signature: '4b8o27d7jbqrTFzFjx9oq8RcrupnCZVsxwELHBLVN4kTW52Xp8ReShK8UbFpBtkc7PjQ1xVqWQLd6GxBxftcr2mz',
|
|
637
|
+
requests: [Array]
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
status: true,
|
|
641
|
+
signature: '4XMc7FyGHcW4ski7PNEtPGXh18GFGVC8syUi9zeXjtRMtu2MKbnyMUhgJBu7nNvo41MYXfenuYVmLftnndxBjzzE',
|
|
642
|
+
requests: [Array]
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
status: true,
|
|
646
|
+
signature: '47yUxggE2mCAJz2j4B36uU7yxQxn8ymwAotnybVAcx3uQ5m2QD2V9JhPwJXZ73yuP2bd6otFvPoTLqzho68nzGtB',
|
|
647
|
+
requests: [Array]
|
|
648
|
+
}
|
|
649
|
+
],
|
|
650
|
+
failed: [
|
|
651
|
+
{ status: false, signature: null, requests: [Array] },
|
|
652
|
+
{ status: false, signature: null, requests: [Array] }
|
|
653
|
+
]
|
|
654
|
+
}
|
|
655
|
+
Processing 1 ERC20 transfers for token 0xd36A20dB12953F0bf09C66B08c1771ae046D2152
|
|
656
|
+
Sleeping 200ms
|
|
657
|
+
====================================
|
|
658
|
+
*/
|