@sentio/sdk 2.0.0-rc.2 → 2.0.0-rc.21
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/lib/aptos/api.d.ts +5 -0
- package/lib/aptos/api.js +21 -0
- package/lib/aptos/api.js.map +1 -0
- package/lib/aptos/aptos-plugin.d.ts +14 -0
- package/lib/aptos/aptos-plugin.js +146 -0
- package/lib/aptos/aptos-plugin.js.map +1 -0
- package/lib/aptos/aptos-processor.d.ts +72 -0
- package/lib/aptos/aptos-processor.js +201 -0
- package/lib/aptos/aptos-processor.js.map +1 -0
- package/lib/aptos/builtin/0x1.d.ts +1914 -0
- package/lib/aptos/builtin/0x1.js +2727 -0
- package/lib/aptos/builtin/0x1.js.map +1 -0
- package/lib/aptos/builtin/0x3.d.ts +491 -0
- package/lib/aptos/builtin/0x3.js +496 -0
- package/lib/aptos/builtin/0x3.js.map +1 -0
- package/lib/aptos/builtin/index.d.ts +2 -0
- package/lib/aptos/builtin/index.js +6 -0
- package/lib/aptos/builtin/index.js.map +1 -0
- package/lib/aptos/codegen/codegen.d.ts +21 -0
- package/lib/aptos/codegen/codegen.js +380 -0
- package/lib/aptos/codegen/codegen.js.map +1 -0
- package/lib/aptos/codegen/index.d.ts +1 -0
- package/lib/aptos/codegen/index.js +2 -0
- package/lib/aptos/codegen/index.js.map +1 -0
- package/lib/aptos/codegen/typegen.d.ts +18 -0
- package/lib/aptos/codegen/typegen.js +145 -0
- package/lib/aptos/codegen/typegen.js.map +1 -0
- package/lib/{core/generic-processor.test.d.ts → aptos/codegen/typegen.test.d.ts} +0 -0
- package/lib/aptos/codegen/typegen.test.js.map +1 -0
- package/lib/aptos/context.d.ts +21 -0
- package/lib/aptos/context.js +59 -0
- package/lib/aptos/context.js.map +1 -0
- package/lib/aptos/index.d.ts +9 -0
- package/lib/aptos/index.js +8 -0
- package/lib/aptos/index.js.map +1 -0
- package/lib/aptos/models.d.ts +27 -0
- package/lib/aptos/models.js +2 -0
- package/lib/aptos/models.js.map +1 -0
- package/lib/aptos/move-coder.d.ts +22 -0
- package/lib/aptos/move-coder.js +162 -0
- package/lib/aptos/move-coder.js.map +1 -0
- package/lib/aptos/move-types.d.ts +10 -0
- package/lib/aptos/move-types.js +2 -0
- package/lib/aptos/move-types.js.map +1 -0
- package/lib/aptos/network.d.ts +11 -0
- package/lib/aptos/network.js +27 -0
- package/lib/aptos/network.js.map +1 -0
- package/lib/aptos/run-codegen.d.ts +1 -0
- package/lib/aptos/run-codegen.js +12 -0
- package/lib/aptos/run-codegen.js.map +1 -0
- package/lib/aptos/tests/aptos.test.d.ts +1 -0
- package/lib/aptos/tests/aptos.test.js.map +1 -0
- package/lib/aptos/tests/souffl3.d.ts +1 -0
- package/lib/aptos/tests/souffl3.js +44 -0
- package/lib/aptos/tests/souffl3.js.map +1 -0
- package/lib/aptos/tests/types/index.d.ts +3 -0
- package/lib/aptos/tests/types/index.js +7 -0
- package/lib/aptos/tests/types/index.js.map +1 -0
- package/lib/aptos/tests/types/reserved.d.ts +345 -0
- package/lib/aptos/tests/types/reserved.js +301 -0
- package/lib/aptos/tests/types/reserved.js.map +1 -0
- package/lib/aptos/tests/types/soffl3.d.ts +812 -0
- package/lib/aptos/tests/types/soffl3.js +548 -0
- package/lib/aptos/tests/types/soffl3.js.map +1 -0
- package/lib/aptos/tests/types/souffle.d.ts +340 -0
- package/lib/aptos/tests/types/souffle.js +295 -0
- package/lib/aptos/tests/types/souffle.js.map +1 -0
- package/lib/aptos/types.d.ts +9 -0
- package/lib/aptos/types.js +130 -0
- package/lib/aptos/types.js.map +1 -0
- package/lib/aptos/types.test.d.ts +1 -0
- package/lib/aptos/types.test.js.map +1 -0
- package/lib/aptos/utils.d.ts +7 -0
- package/lib/aptos/utils.js +20 -0
- package/lib/aptos/utils.js.map +1 -0
- package/lib/core/base-context.d.ts +4 -4
- package/lib/core/base-context.js +7 -11
- package/lib/core/base-context.js.map +1 -1
- package/lib/core/big-decimal.d.ts +2 -0
- package/lib/core/big-decimal.js +11 -7
- package/lib/core/big-decimal.js.map +1 -1
- package/lib/{utils → core}/chain.d.ts +0 -0
- package/lib/{utils → core}/chain.js +7 -12
- package/lib/core/chain.js.map +1 -0
- package/lib/core/core-plugin.js +9 -13
- package/lib/core/core-plugin.js.map +1 -1
- package/lib/core/event-tracker.d.ts +2 -2
- package/lib/core/event-tracker.js +6 -13
- package/lib/core/event-tracker.js.map +1 -1
- package/lib/core/exporter.d.ts +2 -2
- package/lib/core/exporter.js +4 -9
- package/lib/core/exporter.js.map +1 -1
- package/lib/core/index.d.ts +10 -9
- package/lib/core/index.js +10 -32
- package/lib/core/index.js.map +1 -1
- package/lib/core/logger.d.ts +2 -2
- package/lib/core/logger.js +7 -11
- package/lib/core/logger.js.map +1 -1
- package/lib/core/metadata.d.ts +4 -0
- package/lib/core/metadata.js +21 -7
- package/lib/core/metadata.js.map +1 -1
- package/lib/core/meter.d.ts +3 -7
- package/lib/core/meter.js +22 -57
- package/lib/core/meter.js.map +1 -1
- package/lib/core/meter.test.js.map +1 -1
- package/lib/core/numberish.d.ts +1 -3
- package/lib/core/numberish.js +11 -26
- package/lib/core/numberish.js.map +1 -1
- package/lib/core/numberish.test.js.map +1 -1
- package/lib/core/sui-plugin.js +12 -16
- package/lib/core/sui-plugin.js.map +1 -1
- package/lib/core/sui-processor.d.ts +1 -1
- package/lib/core/sui-processor.js +6 -12
- package/lib/core/sui-processor.js.map +1 -1
- package/lib/eth/account-processor-state.d.ts +1 -1
- package/lib/eth/account-processor-state.js +2 -6
- package/lib/eth/account-processor-state.js.map +1 -1
- package/lib/eth/account-processor.d.ts +7 -7
- package/lib/eth/account-processor.js +23 -27
- package/lib/eth/account-processor.js.map +1 -1
- package/lib/eth/base-processor-template.d.ts +9 -8
- package/lib/eth/base-processor-template.js +8 -14
- package/lib/eth/base-processor-template.js.map +1 -1
- package/lib/eth/base-processor.d.ts +8 -7
- package/lib/eth/base-processor.js +21 -27
- package/lib/eth/base-processor.js.map +1 -1
- package/lib/{core → eth}/bind-options.d.ts +0 -0
- package/lib/eth/bind-options.js +40 -0
- package/lib/eth/bind-options.js.map +1 -0
- package/lib/eth/binds.d.ts +3 -3
- package/lib/eth/binds.js +11 -19
- package/lib/eth/binds.js.map +1 -1
- package/lib/eth/builtin/eacaggregatorproxy/index.d.ts +3 -0
- package/lib/eth/builtin/eacaggregatorproxy/index.js +7 -0
- package/lib/eth/builtin/eacaggregatorproxy/index.js.map +1 -0
- package/lib/{builtin → eth/builtin}/eacaggregatorproxy/test-utils.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/eacaggregatorproxy/test-utils.js +9 -16
- package/lib/eth/builtin/eacaggregatorproxy/test-utils.js.map +1 -0
- package/lib/eth/builtin/erc1155/index.d.ts +3 -0
- package/lib/eth/builtin/erc1155/index.js +7 -0
- package/lib/eth/builtin/erc1155/index.js.map +1 -0
- package/lib/{builtin → eth/builtin}/erc1155/test-utils.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/erc1155/test-utils.js +9 -16
- package/lib/eth/builtin/erc1155/test-utils.js.map +1 -0
- package/lib/eth/builtin/erc20/index.d.ts +3 -0
- package/lib/eth/builtin/erc20/index.js +7 -0
- package/lib/eth/builtin/erc20/index.js.map +1 -0
- package/lib/{builtin → eth/builtin}/erc20/test-utils.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/erc20/test-utils.js +7 -13
- package/lib/eth/builtin/erc20/test-utils.js.map +1 -0
- package/lib/eth/builtin/erc20bytes/index.d.ts +3 -0
- package/lib/eth/builtin/erc20bytes/index.js +7 -0
- package/lib/eth/builtin/erc20bytes/index.js.map +1 -0
- package/lib/{builtin → eth/builtin}/erc20bytes/test-utils.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/erc20bytes/test-utils.js +5 -10
- package/lib/eth/builtin/erc20bytes/test-utils.js.map +1 -0
- package/lib/eth/builtin/erc721/index.d.ts +3 -0
- package/lib/eth/builtin/erc721/index.js +7 -0
- package/lib/eth/builtin/erc721/index.js.map +1 -0
- package/lib/{builtin → eth/builtin}/erc721/test-utils.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/erc721/test-utils.js +7 -13
- package/lib/eth/builtin/erc721/test-utils.js.map +1 -0
- package/lib/eth/builtin/index.d.ts +8 -0
- package/lib/eth/builtin/index.js +9 -0
- package/lib/eth/builtin/index.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/EACAggregatorProxy.d.ts +6 -6
- package/lib/eth/builtin/internal/EACAggregatorProxy.js +2 -0
- package/lib/eth/builtin/internal/EACAggregatorProxy.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/ERC1155.d.ts +6 -6
- package/lib/eth/builtin/internal/ERC1155.js +2 -0
- package/lib/eth/builtin/internal/ERC1155.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/ERC20.d.ts +5 -5
- package/lib/eth/builtin/internal/ERC20.js +2 -0
- package/lib/eth/builtin/internal/ERC20.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/ERC20Bytes.d.ts +4 -4
- package/lib/eth/builtin/internal/ERC20Bytes.js +2 -0
- package/lib/eth/builtin/internal/ERC20Bytes.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/ERC721.d.ts +5 -5
- package/lib/eth/builtin/internal/ERC721.js +2 -0
- package/lib/eth/builtin/internal/ERC721.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/WETH9.d.ts +6 -6
- package/lib/eth/builtin/internal/WETH9.js +2 -0
- package/lib/eth/builtin/internal/WETH9.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/common.d.ts +4 -2
- package/lib/{builtin → eth/builtin}/internal/common.js +1 -2
- package/lib/eth/builtin/internal/common.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/eacaggregatorproxy_processor.d.ts +3 -3
- package/lib/{builtin → eth/builtin}/internal/eacaggregatorproxy_processor.js +123 -221
- package/lib/eth/builtin/internal/eacaggregatorproxy_processor.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/erc1155_processor.d.ts +3 -3
- package/lib/{builtin → eth/builtin}/internal/erc1155_processor.js +45 -78
- package/lib/eth/builtin/internal/erc1155_processor.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/erc20_processor.d.ts +3 -3
- package/lib/{builtin → eth/builtin}/internal/erc20_processor.js +63 -111
- package/lib/eth/builtin/internal/erc20_processor.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/erc20bytes_processor.d.ts +3 -3
- package/lib/{builtin → eth/builtin}/internal/erc20bytes_processor.js +51 -89
- package/lib/eth/builtin/internal/erc20bytes_processor.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/erc721_processor.d.ts +3 -3
- package/lib/{builtin → eth/builtin}/internal/erc721_processor.js +69 -122
- package/lib/eth/builtin/internal/erc721_processor.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/factories/EACAggregatorProxy__factory.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/internal/factories/EACAggregatorProxy__factory.js +4 -8
- package/lib/eth/builtin/internal/factories/EACAggregatorProxy__factory.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/factories/ERC1155__factory.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/internal/factories/ERC1155__factory.js +4 -8
- package/lib/eth/builtin/internal/factories/ERC1155__factory.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/factories/ERC20Bytes__factory.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/internal/factories/ERC20Bytes__factory.js +4 -8
- package/lib/eth/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/factories/ERC20__factory.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/internal/factories/ERC20__factory.js +4 -8
- package/lib/eth/builtin/internal/factories/ERC20__factory.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/factories/ERC721__factory.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/internal/factories/ERC721__factory.js +4 -8
- package/lib/eth/builtin/internal/factories/ERC721__factory.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/factories/WETH9__factory.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/internal/factories/WETH9__factory.js +4 -8
- package/lib/eth/builtin/internal/factories/WETH9__factory.js.map +1 -0
- package/lib/eth/builtin/internal/factories/index.d.ts +6 -0
- package/lib/eth/builtin/internal/factories/index.js +10 -0
- package/lib/eth/builtin/internal/factories/index.js.map +1 -0
- package/lib/eth/builtin/internal/index.d.ts +13 -0
- package/lib/eth/builtin/internal/index.js +8 -0
- package/lib/eth/builtin/internal/index.js.map +1 -0
- package/lib/{builtin → eth/builtin}/internal/weth9_processor.d.ts +3 -3
- package/lib/{builtin → eth/builtin}/internal/weth9_processor.js +51 -89
- package/lib/eth/builtin/internal/weth9_processor.js.map +1 -0
- package/lib/eth/builtin/weth9/index.d.ts +3 -0
- package/lib/eth/builtin/weth9/index.js +7 -0
- package/lib/eth/builtin/weth9/index.js.map +1 -0
- package/lib/{builtin → eth/builtin}/weth9/test-utils.d.ts +1 -1
- package/lib/{builtin → eth/builtin}/weth9/test-utils.js +9 -16
- package/lib/eth/builtin/weth9/test-utils.js.map +1 -0
- package/lib/eth/codegen/codegen.d.ts +1 -0
- package/lib/eth/codegen/codegen.js +53 -0
- package/lib/eth/codegen/codegen.js.map +1 -0
- package/lib/{target-ethers-sentio/index.d.ts → eth/codegen/ethers-sentio.d.ts} +1 -1
- package/lib/eth/codegen/ethers-sentio.js +57 -0
- package/lib/eth/codegen/ethers-sentio.js.map +1 -0
- package/lib/{target-ethers-sentio → eth/codegen}/event-handler.d.ts +0 -0
- package/lib/eth/codegen/event-handler.js +46 -0
- package/lib/eth/codegen/event-handler.js.map +1 -0
- package/lib/{target-ethers-sentio → eth/codegen}/file.d.ts +0 -0
- package/lib/{target-ethers-sentio → eth/codegen}/file.js +33 -39
- package/lib/eth/codegen/file.js.map +1 -0
- package/lib/{target-ethers-sentio → eth/codegen}/functions-handler.d.ts +0 -0
- package/lib/{target-ethers-sentio → eth/codegen}/functions-handler.js +12 -18
- package/lib/eth/codegen/functions-handler.js.map +1 -0
- package/lib/eth/codegen/index.d.ts +1 -0
- package/lib/eth/codegen/index.js +2 -0
- package/lib/eth/codegen/index.js.map +1 -0
- package/lib/{target-ethers-sentio → eth/codegen}/types.d.ts +0 -0
- package/lib/{target-ethers-sentio → eth/codegen}/types.js +3 -9
- package/lib/eth/codegen/types.js.map +1 -0
- package/lib/{target-ethers-sentio → eth/codegen}/view-function.d.ts +0 -0
- package/lib/eth/codegen/view-function.js +62 -0
- package/lib/eth/codegen/view-function.js.map +1 -0
- package/lib/{core → eth}/context.d.ts +5 -5
- package/lib/{core → eth}/context.js +14 -23
- package/lib/eth/context.js.map +1 -0
- package/lib/eth/error.d.ts +1 -0
- package/lib/eth/error.js +3 -0
- package/lib/eth/error.js.map +1 -0
- package/lib/eth/eth-plugin.js +30 -34
- package/lib/eth/eth-plugin.js.map +1 -1
- package/lib/eth/eth.d.ts +13 -0
- package/lib/eth/eth.js +44 -0
- package/lib/eth/eth.js.map +1 -0
- package/lib/eth/generic-processor.d.ts +3 -3
- package/lib/eth/generic-processor.js +9 -13
- package/lib/eth/generic-processor.js.map +1 -1
- package/lib/eth/generic-processor.test.d.ts +1 -0
- package/lib/eth/generic-processor.test.js.map +1 -0
- package/lib/eth/index.d.ts +11 -6
- package/lib/eth/index.js +10 -14
- package/lib/eth/index.js.map +1 -1
- package/lib/eth/provider.js +13 -17
- package/lib/eth/provider.js.map +1 -1
- package/lib/eth/run-codegen.d.ts +2 -0
- package/lib/eth/run-codegen.js +12 -0
- package/lib/eth/run-codegen.js.map +1 -0
- package/lib/eth/trace.js +1 -2
- package/lib/eth/trace.js.map +1 -1
- package/lib/index.d.ts +2 -5
- package/lib/index.js +3 -18
- package/lib/index.js.map +1 -1
- package/lib/jest.config.d.ts +9 -0
- package/lib/jest.config.js +9 -0
- package/lib/jest.config.js.map +1 -0
- package/lib/promise-or-void.js +1 -2
- package/lib/solana/builtin/index.d.ts +1 -0
- package/lib/solana/builtin/index.js +2 -0
- package/lib/solana/builtin/index.js.map +1 -0
- package/lib/solana/builtin/spl-token-processor.d.ts +39 -0
- package/lib/solana/builtin/spl-token-processor.js +254 -0
- package/lib/solana/builtin/spl-token-processor.js.map +1 -0
- package/lib/solana/builtin/types.d.ts +427 -0
- package/lib/solana/builtin/types.js +200 -0
- package/lib/solana/builtin/types.js.map +1 -0
- package/lib/solana/codegen/codegen.d.ts +1 -0
- package/lib/solana/codegen/codegen.js +122 -0
- package/lib/solana/codegen/codegen.js.map +1 -0
- package/lib/solana/codegen/index.d.ts +1 -0
- package/lib/solana/codegen/index.js +2 -0
- package/lib/solana/codegen/index.js.map +1 -0
- package/lib/solana/index.d.ts +4 -0
- package/lib/solana/index.js +5 -0
- package/lib/solana/index.js.map +1 -0
- package/lib/solana/run-codegen.d.ts +2 -0
- package/lib/solana/run-codegen.js +12 -0
- package/lib/solana/run-codegen.js.map +1 -0
- package/lib/solana/solana-context.d.ts +9 -0
- package/lib/solana/solana-context.js +28 -0
- package/lib/solana/solana-context.js.map +1 -0
- package/lib/solana/solana-options.d.ts +10 -0
- package/lib/solana/solana-options.js +10 -0
- package/lib/solana/solana-options.js.map +1 -0
- package/lib/solana/solana-plugin.d.ts +9 -0
- package/lib/solana/solana-plugin.js +87 -0
- package/lib/solana/solana-plugin.js.map +1 -0
- package/lib/solana/solana-processor.d.ts +43 -0
- package/lib/solana/solana-processor.js +72 -0
- package/lib/solana/solana-processor.js.map +1 -0
- package/lib/solana/tests/solana.test.d.ts +1 -0
- package/lib/solana/tests/solana.test.js.map +1 -0
- package/lib/solana/tests/types/basic_1.d.ts +26 -0
- package/lib/solana/tests/types/basic_1.js +63 -0
- package/lib/solana/tests/types/basic_1.js.map +1 -0
- package/lib/solana/tests/types/basic_1_processor.d.ts +21 -0
- package/lib/solana/tests/types/basic_1_processor.js +35 -0
- package/lib/solana/tests/types/basic_1_processor.js.map +1 -0
- package/lib/solana/tests/types/token_bridge.d.ts +29 -0
- package/lib/solana/tests/types/token_bridge.js +938 -0
- package/lib/solana/tests/types/token_bridge.js.map +1 -0
- package/lib/solana/tests/types/token_bridge_processor.d.ts +212 -0
- package/lib/solana/tests/types/token_bridge_processor.js +134 -0
- package/lib/solana/tests/types/token_bridge_processor.js.map +1 -0
- package/lib/solana/tests/wormhole-token-bridge.d.ts +15 -0
- package/lib/solana/tests/wormhole-token-bridge.js +79 -0
- package/lib/solana/tests/wormhole-token-bridge.js.map +1 -0
- package/lib/testing/index.d.ts +3 -2
- package/lib/testing/index.js +3 -10
- package/lib/testing/index.js.map +1 -1
- package/lib/testing/metric-utils.d.ts +1 -1
- package/lib/testing/metric-utils.js +7 -13
- package/lib/testing/metric-utils.js.map +1 -1
- package/lib/testing/test-processor-server.d.ts +3 -4
- package/lib/testing/test-processor-server.js +24 -29
- package/lib/testing/test-processor-server.js.map +1 -1
- package/lib/testing/test-provider.js +5 -9
- package/lib/testing/test-provider.js.map +1 -1
- package/lib/tsup.config.ts +31 -0
- package/lib/utils/conversion.d.ts +0 -5
- package/lib/utils/conversion.js +22 -27
- package/lib/utils/conversion.js.map +1 -1
- package/lib/utils/dex-price.js +14 -19
- package/lib/utils/dex-price.js.map +1 -1
- package/lib/utils/dex-price.test.js.map +1 -1
- package/lib/utils/erc20.test.js.map +1 -1
- package/lib/utils/index.d.ts +3 -4
- package/lib/utils/index.js +3 -8
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/price.d.ts +11 -11
- package/lib/utils/price.js +10 -16
- package/lib/utils/price.js.map +1 -1
- package/lib/utils/token.d.ts +1 -2
- package/lib/utils/token.js +23 -40
- package/lib/utils/token.js.map +1 -1
- package/package.json +51 -25
- package/src/aptos/abis/0x1.json +9205 -0
- package/src/aptos/abis/0x3.json +1515 -0
- package/src/aptos/api.ts +23 -0
- package/src/aptos/aptos-plugin.ts +183 -0
- package/src/aptos/aptos-processor.ts +331 -0
- package/src/aptos/builtin/0x1.ts +4685 -0
- package/src/aptos/builtin/0x3.ts +1010 -0
- package/src/{builtin/weth9 → aptos/builtin}/index.ts +2 -3
- package/src/aptos/codegen/codegen.ts +457 -0
- package/src/aptos/codegen/index.ts +1 -0
- package/src/aptos/codegen/tsconfig.json +8 -0
- package/src/aptos/codegen/typegen.ts +165 -0
- package/src/aptos/context.ts +72 -0
- package/src/aptos/index.ts +10 -0
- package/src/aptos/models.ts +35 -0
- package/src/aptos/move-coder.ts +199 -0
- package/src/aptos/move-types.ts +11 -0
- package/src/aptos/network.ts +29 -0
- package/src/aptos/run-codegen.ts +13 -0
- package/src/aptos/tests/abis/reserved.json +402 -0
- package/src/aptos/tests/abis/soffl3.json +1411 -0
- package/src/aptos/tests/abis/souffle.json +389 -0
- package/src/aptos/tests/souffl3.ts +57 -0
- package/src/aptos/tests/types/index.ts +6 -0
- package/src/aptos/tests/types/reserved.ts +781 -0
- package/src/aptos/tests/types/soffl3.ts +1567 -0
- package/src/aptos/tests/types/souffle.ts +780 -0
- package/src/aptos/types.ts +149 -0
- package/src/aptos/utils.ts +26 -0
- package/src/core/base-context.ts +4 -4
- package/src/core/big-decimal.ts +11 -0
- package/src/{utils → core}/chain.ts +0 -0
- package/src/core/core-plugin.ts +3 -3
- package/src/core/event-tracker.ts +2 -2
- package/src/core/exporter.ts +3 -3
- package/src/core/index.ts +10 -10
- package/src/core/logger.ts +2 -2
- package/src/core/metadata.ts +23 -2
- package/src/core/meter.ts +3 -26
- package/src/core/numberish.ts +1 -12
- package/src/core/sui-plugin.ts +2 -2
- package/src/core/sui-processor.ts +1 -1
- package/src/{abis → eth/abis}/EACAggregatorProxy.json +0 -0
- package/src/{abis → eth/abis}/ERC1155.json +0 -0
- package/src/{abis → eth/abis}/ERC20.json +0 -0
- package/src/{abis → eth/abis}/ERC20Bytes.json +0 -0
- package/src/{abis → eth/abis}/ERC721.json +0 -0
- package/src/{abis → eth/abis}/WETH9.json +0 -0
- package/src/eth/account-processor-state.ts +1 -1
- package/src/eth/account-processor.ts +11 -11
- package/src/eth/base-processor-template.ts +8 -7
- package/src/eth/base-processor.ts +12 -22
- package/src/{core → eth}/bind-options.ts +0 -0
- package/src/eth/binds.ts +3 -3
- package/src/eth/builtin/eacaggregatorproxy/index.ts +7 -0
- package/src/{builtin → eth/builtin}/eacaggregatorproxy/test-utils.ts +1 -1
- package/src/eth/builtin/erc1155/index.ts +7 -0
- package/src/{builtin → eth/builtin}/erc1155/test-utils.ts +1 -1
- package/src/eth/builtin/erc20/index.ts +7 -0
- package/src/{builtin → eth/builtin}/erc20/test-utils.ts +1 -1
- package/src/eth/builtin/erc20bytes/index.ts +7 -0
- package/src/{builtin → eth/builtin}/erc20bytes/test-utils.ts +1 -1
- package/src/eth/builtin/erc721/index.ts +7 -0
- package/src/{builtin → eth/builtin}/erc721/test-utils.ts +1 -1
- package/src/eth/builtin/index.ts +8 -0
- package/src/{builtin → eth/builtin}/internal/EACAggregatorProxy.ts +6 -10
- package/src/{builtin → eth/builtin}/internal/ERC1155.ts +6 -10
- package/src/{builtin → eth/builtin}/internal/ERC20.ts +5 -8
- package/src/{builtin → eth/builtin}/internal/ERC20Bytes.ts +4 -6
- package/src/{builtin → eth/builtin}/internal/ERC721.ts +5 -8
- package/src/{builtin → eth/builtin}/internal/WETH9.ts +6 -10
- package/src/eth/builtin/internal/common.ts +22 -0
- package/src/{builtin → eth/builtin}/internal/eacaggregatorproxy_processor.ts +93 -165
- package/src/{builtin → eth/builtin}/internal/erc1155_processor.ts +28 -52
- package/src/{builtin → eth/builtin}/internal/erc20_processor.ts +43 -75
- package/src/{builtin → eth/builtin}/internal/erc20bytes_processor.ts +33 -57
- package/src/{builtin → eth/builtin}/internal/erc721_processor.ts +48 -84
- package/src/{builtin → eth/builtin}/internal/factories/EACAggregatorProxy__factory.ts +1 -1
- package/src/{builtin → eth/builtin}/internal/factories/ERC1155__factory.ts +1 -1
- package/src/{builtin → eth/builtin}/internal/factories/ERC20Bytes__factory.ts +1 -1
- package/src/{builtin → eth/builtin}/internal/factories/ERC20__factory.ts +1 -1
- package/src/{builtin → eth/builtin}/internal/factories/ERC721__factory.ts +1 -1
- package/src/{builtin → eth/builtin}/internal/factories/WETH9__factory.ts +1 -1
- package/src/eth/builtin/internal/factories/index.ts +9 -0
- package/src/eth/builtin/internal/index.ts +16 -0
- package/src/{builtin → eth/builtin}/internal/weth9_processor.ts +33 -57
- package/src/eth/builtin/weth9/index.ts +7 -0
- package/src/{builtin → eth/builtin}/weth9/test-utils.ts +1 -1
- package/src/eth/codegen/codegen.ts +62 -0
- package/src/{target-ethers-sentio/index.ts → eth/codegen/ethers-sentio.ts} +5 -2
- package/src/{target-ethers-sentio → eth/codegen}/event-handler.ts +2 -2
- package/src/{target-ethers-sentio → eth/codegen}/file.ts +13 -12
- package/src/{target-ethers-sentio → eth/codegen}/functions-handler.ts +4 -5
- package/src/eth/codegen/index.ts +1 -0
- package/src/eth/codegen/tsconfig.json +8 -0
- package/src/{target-ethers-sentio → eth/codegen}/types.ts +1 -1
- package/src/{target-ethers-sentio → eth/codegen}/view-function.ts +7 -12
- package/src/{core → eth}/context.ts +5 -6
- package/src/eth/error.ts +4 -0
- package/src/eth/eth-plugin.ts +3 -3
- package/src/eth/eth.ts +56 -0
- package/src/eth/generic-processor.ts +5 -5
- package/src/eth/index.ts +12 -6
- package/src/eth/provider.ts +4 -3
- package/src/eth/run-codegen.ts +12 -0
- package/src/index.ts +2 -9
- package/src/jest.config.ts +8 -0
- package/src/solana/builtin/index.ts +1 -0
- package/src/solana/builtin/spl-token-processor.ts +298 -0
- package/src/solana/builtin/types.ts +279 -0
- package/src/solana/codegen/codegen.ts +140 -0
- package/src/solana/codegen/index.ts +1 -0
- package/src/solana/codegen/tsconfig.json +8 -0
- package/src/solana/index.ts +4 -0
- package/src/solana/run-codegen.ts +13 -0
- package/src/solana/solana-context.ts +30 -0
- package/src/solana/solana-options.ts +11 -0
- package/src/solana/solana-plugin.ts +103 -0
- package/src/solana/solana-processor.ts +102 -0
- package/src/solana/tests/abis/basic_1.json +62 -0
- package/src/solana/tests/abis/token_bridge.json +937 -0
- package/src/solana/tests/types/basic_1.ts +62 -0
- package/src/solana/tests/types/basic_1_processor.ts +42 -0
- package/src/solana/tests/types/token_bridge.ts +937 -0
- package/src/solana/tests/types/token_bridge_processor.ts +150 -0
- package/src/solana/tests/wormhole-token-bridge.ts +96 -0
- package/src/testing/index.ts +3 -3
- package/src/testing/metric-utils.ts +2 -2
- package/src/testing/test-processor-server.ts +5 -5
- package/src/testing/test-provider.ts +1 -1
- package/src/tsup.config.ts +31 -0
- package/src/utils/conversion.ts +21 -25
- package/src/utils/dex-price.ts +4 -5
- package/src/utils/index.ts +3 -4
- package/src/utils/price.ts +1 -1
- package/src/utils/token.ts +20 -31
- package/lib/builtin/eacaggregatorproxy/index.d.ts +0 -2
- package/lib/builtin/eacaggregatorproxy/index.js +0 -9
- package/lib/builtin/eacaggregatorproxy/index.js.map +0 -1
- package/lib/builtin/eacaggregatorproxy/test-utils.js.map +0 -1
- package/lib/builtin/erc1155/index.d.ts +0 -2
- package/lib/builtin/erc1155/index.js +0 -9
- package/lib/builtin/erc1155/index.js.map +0 -1
- package/lib/builtin/erc1155/test-utils.js.map +0 -1
- package/lib/builtin/erc20/index.d.ts +0 -2
- package/lib/builtin/erc20/index.js +0 -9
- package/lib/builtin/erc20/index.js.map +0 -1
- package/lib/builtin/erc20/test-utils.js.map +0 -1
- package/lib/builtin/erc20bytes/index.d.ts +0 -2
- package/lib/builtin/erc20bytes/index.js +0 -9
- package/lib/builtin/erc20bytes/index.js.map +0 -1
- package/lib/builtin/erc20bytes/test-utils.js.map +0 -1
- package/lib/builtin/erc721/index.d.ts +0 -2
- package/lib/builtin/erc721/index.js +0 -9
- package/lib/builtin/erc721/index.js.map +0 -1
- package/lib/builtin/erc721/test-utils.js.map +0 -1
- package/lib/builtin/index.d.ts +0 -4
- package/lib/builtin/index.js +0 -9
- package/lib/builtin/index.js.map +0 -1
- package/lib/builtin/internal/EACAggregatorProxy.js +0 -3
- package/lib/builtin/internal/EACAggregatorProxy.js.map +0 -1
- package/lib/builtin/internal/ERC1155.js +0 -3
- package/lib/builtin/internal/ERC1155.js.map +0 -1
- package/lib/builtin/internal/ERC20.js +0 -3
- package/lib/builtin/internal/ERC20.js.map +0 -1
- package/lib/builtin/internal/ERC20Bytes.js +0 -3
- package/lib/builtin/internal/ERC20Bytes.js.map +0 -1
- package/lib/builtin/internal/ERC721.js +0 -3
- package/lib/builtin/internal/ERC721.js.map +0 -1
- package/lib/builtin/internal/WETH9.js +0 -3
- package/lib/builtin/internal/WETH9.js.map +0 -1
- package/lib/builtin/internal/common.js.map +0 -1
- package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +0 -1
- package/lib/builtin/internal/erc1155_processor.js.map +0 -1
- package/lib/builtin/internal/erc20_processor.js.map +0 -1
- package/lib/builtin/internal/erc20bytes_processor.js.map +0 -1
- package/lib/builtin/internal/erc721_processor.js.map +0 -1
- package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js.map +0 -1
- package/lib/builtin/internal/factories/ERC1155__factory.js.map +0 -1
- package/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +0 -1
- package/lib/builtin/internal/factories/ERC20__factory.js.map +0 -1
- package/lib/builtin/internal/factories/ERC721__factory.js.map +0 -1
- package/lib/builtin/internal/factories/WETH9__factory.js.map +0 -1
- package/lib/builtin/internal/factories/index.d.ts +0 -6
- package/lib/builtin/internal/factories/index.js +0 -19
- package/lib/builtin/internal/factories/index.js.map +0 -1
- package/lib/builtin/internal/index.d.ts +0 -13
- package/lib/builtin/internal/index.js +0 -18
- package/lib/builtin/internal/index.js.map +0 -1
- package/lib/builtin/internal/weth9_processor.js.map +0 -1
- package/lib/builtin/weth9/index.d.ts +0 -2
- package/lib/builtin/weth9/index.js +0 -9
- package/lib/builtin/weth9/index.js.map +0 -1
- package/lib/builtin/weth9/test-utils.js.map +0 -1
- package/lib/core/bind-options.js +0 -47
- package/lib/core/bind-options.js.map +0 -1
- package/lib/core/context.js.map +0 -1
- package/lib/core/generic-processor.test.js.map +0 -1
- package/lib/error.d.ts +0 -7
- package/lib/error.js +0 -43
- package/lib/error.js.map +0 -1
- package/lib/target-ethers-sentio/event-handler.js +0 -52
- package/lib/target-ethers-sentio/event-handler.js.map +0 -1
- package/lib/target-ethers-sentio/file.js.map +0 -1
- package/lib/target-ethers-sentio/functions-handler.js.map +0 -1
- package/lib/target-ethers-sentio/index.js +0 -58
- package/lib/target-ethers-sentio/index.js.map +0 -1
- package/lib/target-ethers-sentio/types.js.map +0 -1
- package/lib/target-ethers-sentio/view-function.js +0 -74
- package/lib/target-ethers-sentio/view-function.js.map +0 -1
- package/lib/utils/chain.js.map +0 -1
- package/lib/webpack.config.js +0 -50
- package/src/builtin/eacaggregatorproxy/index.ts +0 -6
- package/src/builtin/erc1155/index.ts +0 -6
- package/src/builtin/erc20/index.ts +0 -6
- package/src/builtin/erc20bytes/index.ts +0 -6
- package/src/builtin/erc721/index.ts +0 -6
- package/src/builtin/index.ts +0 -4
- package/src/builtin/internal/common.ts +0 -46
- package/src/builtin/internal/factories/index.ts +0 -9
- package/src/builtin/internal/index.ts +0 -16
- package/src/error.ts +0 -45
- package/src/target-ethers-sentio/.eslintrc.json +0 -14
- package/src/target-ethers-sentio/tsconfig.json +0 -9
- package/src/webpack.config.js +0 -50
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { BorshInstructionCoder, Instruction, Idl } from '@project-serum/anchor'
|
|
2
|
+
import { SolanaBaseProcessor, SolanaContext, SolanaBindOptions } from "@sentio/sdk/solana"
|
|
3
|
+
import { token_bridge_idl } from "./token_bridge.js"
|
|
4
|
+
import { PublicKey } from '@solana/web3.js'
|
|
5
|
+
|
|
6
|
+
export class TokenBridgeProcessor extends SolanaBaseProcessor {
|
|
7
|
+
static DEFAULT_OPTIONS = {
|
|
8
|
+
name: 'TokenBridge',
|
|
9
|
+
instructionCoder: new BorshInstructionCoder(token_bridge_idl as Idl)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static bind(options: SolanaBindOptions): TokenBridgeProcessor {
|
|
13
|
+
return new TokenBridgeProcessor( { ...TokenBridgeProcessor.DEFAULT_OPTIONS, ...options })
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
onInitialize(handler: (args: { wormhole: PublicKey }, accounts: { payer: string, config: string, rent: string, systemProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
18
|
+
this.onInstruction('initialize', (ins: Instruction, ctx, accounts: string[]) => {
|
|
19
|
+
const origin = ins.data as any
|
|
20
|
+
if (origin) {
|
|
21
|
+
const data = { wormhole: origin.wormhole as PublicKey }
|
|
22
|
+
const accountData = { payer: accounts[0], config: accounts[1], rent: accounts[2], systemProgram: accounts[3] }
|
|
23
|
+
handler(data, accountData, ctx)
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
return this
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
onAttestToken(handler: (args: { nonce: number }, accounts: { payer: string, config: string, mint: string, wrappedMeta: string, splMetadata: string, wormholeBridge: string, wormholeMessage: string, wormholeEmitter: string, wormholeSequence: string, wormholeFeeCollector: string, clock: string, rent: string, systemProgram: string, wormholeProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
30
|
+
this.onInstruction('attestToken', (ins: Instruction, ctx, accounts: string[]) => {
|
|
31
|
+
const origin = ins.data as any
|
|
32
|
+
if (origin) {
|
|
33
|
+
const data = { nonce: origin.nonce as number }
|
|
34
|
+
const accountData = { payer: accounts[0], config: accounts[1], mint: accounts[2], wrappedMeta: accounts[3], splMetadata: accounts[4], wormholeBridge: accounts[5], wormholeMessage: accounts[6], wormholeEmitter: accounts[7], wormholeSequence: accounts[8], wormholeFeeCollector: accounts[9], clock: accounts[10], rent: accounts[11], systemProgram: accounts[12], wormholeProgram: accounts[13] }
|
|
35
|
+
handler(data, accountData, ctx)
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
return this
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
onCompleteNative(handler: (args: { }, accounts: { payer: string, config: string, vaa: string, claim: string, endpoint: string, to: string, toFees: string, custody: string, mint: string, custodySigner: string, rent: string, systemProgram: string, tokenProgram: string, wormholeProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
42
|
+
this.onInstruction('completeNative', (ins: Instruction, ctx, accounts: string[]) => {
|
|
43
|
+
const origin = ins.data as any
|
|
44
|
+
if (origin) {
|
|
45
|
+
const data = { }
|
|
46
|
+
const accountData = { payer: accounts[0], config: accounts[1], vaa: accounts[2], claim: accounts[3], endpoint: accounts[4], to: accounts[5], toFees: accounts[6], custody: accounts[7], mint: accounts[8], custodySigner: accounts[9], rent: accounts[10], systemProgram: accounts[11], tokenProgram: accounts[12], wormholeProgram: accounts[13] }
|
|
47
|
+
handler(data, accountData, ctx)
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
return this
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
onCompleteWrapped(handler: (args: { }, accounts: { payer: string, config: string, vaa: string, claim: string, endpoint: string, to: string, toFees: string, mint: string, wrappedMeta: string, mintAuthority: string, rent: string, systemProgram: string, tokenProgram: string, wormholeProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
54
|
+
this.onInstruction('completeWrapped', (ins: Instruction, ctx, accounts: string[]) => {
|
|
55
|
+
const origin = ins.data as any
|
|
56
|
+
if (origin) {
|
|
57
|
+
const data = { }
|
|
58
|
+
const accountData = { payer: accounts[0], config: accounts[1], vaa: accounts[2], claim: accounts[3], endpoint: accounts[4], to: accounts[5], toFees: accounts[6], mint: accounts[7], wrappedMeta: accounts[8], mintAuthority: accounts[9], rent: accounts[10], systemProgram: accounts[11], tokenProgram: accounts[12], wormholeProgram: accounts[13] }
|
|
59
|
+
handler(data, accountData, ctx)
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
return this
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
onTransferWrapped(handler: (args: { nonce: number, amount: bigint, fee: bigint, targetAddress: any, targetChain: number }, accounts: { payer: string, config: string, from: string, fromOwner: string, mint: string, wrappedMeta: string, authoritySigner: string, wormholeBridge: string, wormholeMessage: string, wormholeEmitter: string, wormholeSequence: string, wormholeFeeCollector: string, clock: string, rent: string, systemProgram: string, tokenProgram: string, wormholeProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
66
|
+
this.onInstruction('transferWrapped', (ins: Instruction, ctx, accounts: string[]) => {
|
|
67
|
+
const origin = ins.data as any
|
|
68
|
+
if (origin) {
|
|
69
|
+
const data = { nonce: origin.nonce as number, amount: BigInt(origin.amount.toString()), fee: BigInt(origin.fee.toString()), targetAddress: origin.targetAddress as any, targetChain: origin.targetChain as number }
|
|
70
|
+
const accountData = { payer: accounts[0], config: accounts[1], from: accounts[2], fromOwner: accounts[3], mint: accounts[4], wrappedMeta: accounts[5], authoritySigner: accounts[6], wormholeBridge: accounts[7], wormholeMessage: accounts[8], wormholeEmitter: accounts[9], wormholeSequence: accounts[10], wormholeFeeCollector: accounts[11], clock: accounts[12], rent: accounts[13], systemProgram: accounts[14], tokenProgram: accounts[15], wormholeProgram: accounts[16] }
|
|
71
|
+
handler(data, accountData, ctx)
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
return this
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
onTransferNative(handler: (args: { nonce: number, amount: bigint, fee: bigint, targetAddress: any, targetChain: number }, accounts: { payer: string, config: string, from: string, mint: string, custody: string, authoritySigner: string, custodySigner: string, wormholeBridge: string, wormholeMessage: string, wormholeEmitter: string, wormholeSequence: string, wormholeFeeCollector: string, clock: string, rent: string, systemProgram: string, tokenProgram: string, wormholeProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
78
|
+
this.onInstruction('transferNative', (ins: Instruction, ctx, accounts: string[]) => {
|
|
79
|
+
const origin = ins.data as any
|
|
80
|
+
if (origin) {
|
|
81
|
+
const data = { nonce: origin.nonce as number, amount: BigInt(origin.amount.toString()), fee: BigInt(origin.fee.toString()), targetAddress: origin.targetAddress as any, targetChain: origin.targetChain as number }
|
|
82
|
+
const accountData = { payer: accounts[0], config: accounts[1], from: accounts[2], mint: accounts[3], custody: accounts[4], authoritySigner: accounts[5], custodySigner: accounts[6], wormholeBridge: accounts[7], wormholeMessage: accounts[8], wormholeEmitter: accounts[9], wormholeSequence: accounts[10], wormholeFeeCollector: accounts[11], clock: accounts[12], rent: accounts[13], systemProgram: accounts[14], tokenProgram: accounts[15], wormholeProgram: accounts[16] }
|
|
83
|
+
handler(data, accountData, ctx)
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
return this
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
onRegisterChain(handler: (args: { }, accounts: { payer: string, config: string, endpoint: string, vaa: string, claim: string, rent: string, systemProgram: string, wormholeProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
90
|
+
this.onInstruction('registerChain', (ins: Instruction, ctx, accounts: string[]) => {
|
|
91
|
+
const origin = ins.data as any
|
|
92
|
+
if (origin) {
|
|
93
|
+
const data = { }
|
|
94
|
+
const accountData = { payer: accounts[0], config: accounts[1], endpoint: accounts[2], vaa: accounts[3], claim: accounts[4], rent: accounts[5], systemProgram: accounts[6], wormholeProgram: accounts[7] }
|
|
95
|
+
handler(data, accountData, ctx)
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
return this
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
onCreateWrapped(handler: (args: { }, accounts: { payer: string, config: string, endpoint: string, vaa: string, claim: string, mint: string, wrappedMeta: string, splMetadata: string, mintAuthority: string, rent: string, systemProgram: string, tokenProgram: string, splMetadataProgram: string, wormholeProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
102
|
+
this.onInstruction('createWrapped', (ins: Instruction, ctx, accounts: string[]) => {
|
|
103
|
+
const origin = ins.data as any
|
|
104
|
+
if (origin) {
|
|
105
|
+
const data = { }
|
|
106
|
+
const accountData = { payer: accounts[0], config: accounts[1], endpoint: accounts[2], vaa: accounts[3], claim: accounts[4], mint: accounts[5], wrappedMeta: accounts[6], splMetadata: accounts[7], mintAuthority: accounts[8], rent: accounts[9], systemProgram: accounts[10], tokenProgram: accounts[11], splMetadataProgram: accounts[12], wormholeProgram: accounts[13] }
|
|
107
|
+
handler(data, accountData, ctx)
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
return this
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
onUpgradeContract(handler: (args: { }, accounts: { payer: string, vaa: string, claim: string, upgradeAuthority: string, spill: string, implementation: string, programData: string, tokenBridgeProgram: string, rent: string, clock: string, bpfLoaderUpgradeable: string, systemProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
114
|
+
this.onInstruction('upgradeContract', (ins: Instruction, ctx, accounts: string[]) => {
|
|
115
|
+
const origin = ins.data as any
|
|
116
|
+
if (origin) {
|
|
117
|
+
const data = { }
|
|
118
|
+
const accountData = { payer: accounts[0], vaa: accounts[1], claim: accounts[2], upgradeAuthority: accounts[3], spill: accounts[4], implementation: accounts[5], programData: accounts[6], tokenBridgeProgram: accounts[7], rent: accounts[8], clock: accounts[9], bpfLoaderUpgradeable: accounts[10], systemProgram: accounts[11] }
|
|
119
|
+
handler(data, accountData, ctx)
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
return this
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
onTransferWrappedWithPayload(handler: (args: { nonce: number, amount: bigint, targetAddress: any, targetChain: number, payload: any, cpiProgramId: any }, accounts: { payer: string, config: string, from: string, fromOwner: string, mint: string, wrappedMeta: string, authoritySigner: string, wormholeBridge: string, wormholeMessage: string, wormholeEmitter: string, wormholeSequence: string, wormholeFeeCollector: string, clock: string, sender: string, rent: string, systemProgram: string, tokenProgram: string, wormholeProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
126
|
+
this.onInstruction('transferWrappedWithPayload', (ins: Instruction, ctx, accounts: string[]) => {
|
|
127
|
+
const origin = ins.data as any
|
|
128
|
+
if (origin) {
|
|
129
|
+
const data = { nonce: origin.nonce as number, amount: BigInt(origin.amount.toString()), targetAddress: origin.targetAddress as any, targetChain: origin.targetChain as number, payload: origin.payload as any, cpiProgramId: origin.cpiProgramId as any }
|
|
130
|
+
const accountData = { payer: accounts[0], config: accounts[1], from: accounts[2], fromOwner: accounts[3], mint: accounts[4], wrappedMeta: accounts[5], authoritySigner: accounts[6], wormholeBridge: accounts[7], wormholeMessage: accounts[8], wormholeEmitter: accounts[9], wormholeSequence: accounts[10], wormholeFeeCollector: accounts[11], clock: accounts[12], sender: accounts[13], rent: accounts[14], systemProgram: accounts[15], tokenProgram: accounts[16], wormholeProgram: accounts[17] }
|
|
131
|
+
handler(data, accountData, ctx)
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
return this
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
onTransferNativeWithPayload(handler: (args: { nonce: number, amount: bigint, targetAddress: any, targetChain: number, payload: any, cpiProgramId: any }, accounts: { payer: string, config: string, from: string, mint: string, custody: string, authoritySigner: string, custodySigner: string, wormholeBridge: string, wormholeMessage: string, wormholeEmitter: string, wormholeSequence: string, wormholeFeeCollector: string, clock: string, sender: string, rent: string, systemProgram: string, tokenProgram: string, wormholeProgram: string }, ctx: SolanaContext) => void): TokenBridgeProcessor {
|
|
138
|
+
this.onInstruction('transferNativeWithPayload', (ins: Instruction, ctx, accounts: string[]) => {
|
|
139
|
+
const origin = ins.data as any
|
|
140
|
+
if (origin) {
|
|
141
|
+
const data = { nonce: origin.nonce as number, amount: BigInt(origin.amount.toString()), targetAddress: origin.targetAddress as any, targetChain: origin.targetChain as number, payload: origin.payload as any, cpiProgramId: origin.cpiProgramId as any }
|
|
142
|
+
const accountData = { payer: accounts[0], config: accounts[1], from: accounts[2], mint: accounts[3], custody: accounts[4], authoritySigner: accounts[5], custodySigner: accounts[6], wormholeBridge: accounts[7], wormholeMessage: accounts[8], wormholeEmitter: accounts[9], wormholeSequence: accounts[10], wormholeFeeCollector: accounts[11], clock: accounts[12], sender: accounts[13], rent: accounts[14], systemProgram: accounts[15], tokenProgram: accounts[16], wormholeProgram: accounts[17] }
|
|
143
|
+
handler(data, accountData, ctx)
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
return this
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
}
|
|
150
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { SPLTokenProcessor } from '@sentio/sdk/solana/builtin'
|
|
2
|
+
import { TokenBridgeProcessor } from './types/token_bridge_processor.js'
|
|
3
|
+
|
|
4
|
+
import { token_bridge_idl } from './types/token_bridge.js'
|
|
5
|
+
import { Idl, Instruction } from '@project-serum/anchor'
|
|
6
|
+
import bs58 from 'bs58'
|
|
7
|
+
import { camelCase, upperFirst } from 'lodash-es'
|
|
8
|
+
// @ts-ignore no type definition
|
|
9
|
+
import { Layout } from 'buffer-layout'
|
|
10
|
+
import { IdlField, IdlStateMethod } from '@project-serum/anchor/dist/cjs/idl.js'
|
|
11
|
+
import * as borsh from '@coral-xyz/borsh'
|
|
12
|
+
import { IdlCoder } from '@project-serum/anchor/dist/cjs/coder/borsh/idl.js'
|
|
13
|
+
|
|
14
|
+
// TODO this could be more general
|
|
15
|
+
class TokenBridgeDecoder {
|
|
16
|
+
private ixLayout: Map<string, Layout>
|
|
17
|
+
|
|
18
|
+
constructor(idl: Idl) {
|
|
19
|
+
this.ixLayout = TokenBridgeDecoder.parseIxLayout(idl)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private static parseIxLayout(idl: Idl): Map<string, Layout> {
|
|
23
|
+
const stateMethods = idl.state ? idl.state.methods : []
|
|
24
|
+
|
|
25
|
+
const ixLayouts = stateMethods
|
|
26
|
+
.map((m: IdlStateMethod): [string, Layout<unknown>] => {
|
|
27
|
+
const fieldLayouts = m.args.map((arg: IdlField) => {
|
|
28
|
+
return IdlCoder.fieldLayout(arg, Array.from([...(idl.accounts ?? []), ...(idl.types ?? [])]))
|
|
29
|
+
})
|
|
30
|
+
const name = camelCase(m.name)
|
|
31
|
+
return [name, borsh.struct(fieldLayouts, name)]
|
|
32
|
+
})
|
|
33
|
+
.concat(
|
|
34
|
+
idl.instructions.map((ix) => {
|
|
35
|
+
const fieldLayouts = ix.args.map((arg: IdlField) =>
|
|
36
|
+
IdlCoder.fieldLayout(arg, Array.from([...(idl.accounts ?? []), ...(idl.types ?? [])]))
|
|
37
|
+
)
|
|
38
|
+
const name = camelCase(ix.name)
|
|
39
|
+
return [name, borsh.struct(fieldLayouts, name)]
|
|
40
|
+
})
|
|
41
|
+
)
|
|
42
|
+
return new Map(ixLayouts)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public decode(ix: Buffer | string, encoding: 'hex' | 'base58' = 'hex'): Instruction | null {
|
|
46
|
+
if (typeof ix === 'string') {
|
|
47
|
+
ix = encoding === 'hex' ? Buffer.from(ix, 'hex') : Buffer.from(bs58.decode(ix))
|
|
48
|
+
}
|
|
49
|
+
const discriminator = ix.subarray(0, 1).readInt8()
|
|
50
|
+
const data = ix.subarray(1)
|
|
51
|
+
|
|
52
|
+
const name = camelCase(TokenBridgeInstruction[discriminator])
|
|
53
|
+
const layout = this.ixLayout.get(name)
|
|
54
|
+
|
|
55
|
+
if (!layout) {
|
|
56
|
+
return null
|
|
57
|
+
}
|
|
58
|
+
return { data: this.ixLayout.get(name)?.decode(data), name }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export enum TokenBridgeInstruction {
|
|
63
|
+
Initialize,
|
|
64
|
+
AttestToken,
|
|
65
|
+
CompleteNative,
|
|
66
|
+
CompleteWrapped,
|
|
67
|
+
TransferWrapped,
|
|
68
|
+
TransferNative,
|
|
69
|
+
RegisterChain,
|
|
70
|
+
CreateWrapped,
|
|
71
|
+
UpgradeContract,
|
|
72
|
+
CompleteNativeWithPayload,
|
|
73
|
+
CompleteWrappedWithPayload,
|
|
74
|
+
TransferWrappedWithPayload,
|
|
75
|
+
TransferNativeWithPayload,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
TokenBridgeProcessor.bind({
|
|
79
|
+
address: 'wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb',
|
|
80
|
+
instructionCoder: new TokenBridgeDecoder(token_bridge_idl as Idl),
|
|
81
|
+
}).onTransferNative((args, accounts, ctx) => {
|
|
82
|
+
ctx.meter.Counter('total_transfer_amount').add(args.amount)
|
|
83
|
+
ctx.meter.Counter(accounts.payer).add(args.amount)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
SPLTokenProcessor.bind({ address: 'wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb', processInnerInstruction: true })
|
|
87
|
+
.onMintTo((data, ctx) => {
|
|
88
|
+
if (data.mint === '7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs') {
|
|
89
|
+
ctx.meter.Counter('totalWeth_supply').add(BigInt(data.amount))
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
.onBurn((data, ctx) => {
|
|
93
|
+
if (data.mint === '7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs') {
|
|
94
|
+
ctx.meter.Counter('totalWeth_supply').sub(BigInt(data.amount))
|
|
95
|
+
}
|
|
96
|
+
})
|
package/src/testing/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TestProcessorServer } from './test-processor-server'
|
|
2
|
-
export { MetricValueToNumber, firstCounterValue, firstGaugeValue } from './metric-utils'
|
|
1
|
+
export { TestProcessorServer } from './test-processor-server.js'
|
|
2
|
+
export { MetricValueToNumber, firstCounterValue, firstGaugeValue } from './metric-utils.js'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export { loadTestProvidersFromEnv } from './test-provider.js' // TODO make the interface more standard and then export
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MetricValue, ProcessResult } from '@sentio/protos'
|
|
2
|
-
import { Numberish, BigDecimal } from '../core'
|
|
3
|
-
import { bytesToBigInt } from '../utils/conversion'
|
|
2
|
+
import { Numberish, BigDecimal } from '../core/index.js'
|
|
3
|
+
import { bytesToBigInt } from '../utils/conversion.js'
|
|
4
4
|
|
|
5
5
|
export function MetricValueToNumber(v: Partial<MetricValue> | undefined): Numberish | undefined {
|
|
6
6
|
if (v === undefined) {
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
ProcessConfigResponse,
|
|
11
11
|
ProcessorServiceImplementation,
|
|
12
12
|
StartRequest,
|
|
13
|
+
Empty,
|
|
13
14
|
} from '@sentio/protos'
|
|
14
15
|
import { CallContext } from 'nice-grpc-common'
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { CHAIN_MAP } from '../utils/chain'
|
|
16
|
+
import { ProcessorServiceImpl, Endpoints, State } from '@sentio/runtime'
|
|
17
|
+
import { CHAIN_MAP } from '../core/chain.js'
|
|
18
18
|
|
|
19
|
-
import { Trace } from '../eth/trace'
|
|
19
|
+
import { Trace } from '../eth/trace.js'
|
|
20
20
|
import { LogParams, Networkish, BlockParams, Network } from 'ethers/providers'
|
|
21
21
|
|
|
22
22
|
import { Block, Log } from 'ethers'
|
|
@@ -33,7 +33,7 @@ export class TestProcessorServer implements ProcessorServiceImplementation {
|
|
|
33
33
|
contractConfigs: ContractConfig[]
|
|
34
34
|
accountConfigs: AccountConfig[]
|
|
35
35
|
|
|
36
|
-
constructor(loader: () =>
|
|
36
|
+
constructor(loader: () => Promise<any>, httpEndpoints: Record<string, string> = {}) {
|
|
37
37
|
cleanTest()
|
|
38
38
|
|
|
39
39
|
this.service = new ProcessorServiceImpl(loader)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
esbuildOptions: (options) => {
|
|
5
|
+
options.banner = {
|
|
6
|
+
js: `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`,
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
entry: {
|
|
10
|
+
lib: 'src/processor.ts',
|
|
11
|
+
},
|
|
12
|
+
minify: true,
|
|
13
|
+
sourcemap: 'inline',
|
|
14
|
+
clean: true,
|
|
15
|
+
format: 'esm',
|
|
16
|
+
dts: {
|
|
17
|
+
resolve: true,
|
|
18
|
+
},
|
|
19
|
+
external: [
|
|
20
|
+
'protobufjs',
|
|
21
|
+
'aptos',
|
|
22
|
+
'aptos-sdk',
|
|
23
|
+
'ethers',
|
|
24
|
+
'bs58',
|
|
25
|
+
'bn.js',
|
|
26
|
+
'csv-parse',
|
|
27
|
+
/^nice-grpc.*$/,
|
|
28
|
+
/^@(ethersproject|solana|project-serum).*$/,
|
|
29
|
+
/^@sentio\/(sdk|runtime|protos|bigdecimal|ethers).*$/,
|
|
30
|
+
],
|
|
31
|
+
})
|
package/src/utils/conversion.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { BigDecimal } from '../core/big-decimal'
|
|
2
|
-
import { Numberish } from '../core'
|
|
3
|
-
import { MetricValue } from '@sentio/protos'
|
|
4
|
-
|
|
5
|
-
export function toBigDecimal(n: bigint) {
|
|
6
|
-
return new BigDecimal(n.toString())
|
|
7
|
-
}
|
|
1
|
+
// import { BigDecimal } from '../core/big-decimal.js'
|
|
2
|
+
// import { Numberish } from '../core/index.js'
|
|
3
|
+
// import { MetricValue } from '@sentio/protos'
|
|
8
4
|
|
|
9
5
|
export function bytesToBigInt(bytes: Uint8Array) {
|
|
10
6
|
let intValue = BigInt(0)
|
|
@@ -14,21 +10,21 @@ export function bytesToBigInt(bytes: Uint8Array) {
|
|
|
14
10
|
return intValue
|
|
15
11
|
}
|
|
16
12
|
|
|
17
|
-
export function metricValueToNumberish(v: MetricValue): Numberish {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
13
|
+
// export function metricValueToNumberish(v: MetricValue): Numberish {
|
|
14
|
+
// if (v.doubleValue) {
|
|
15
|
+
// return v.doubleValue
|
|
16
|
+
// }
|
|
17
|
+
// if (v.bigInteger) {
|
|
18
|
+
// let intValue = bytesToBigInt(v.bigInteger.data)
|
|
19
|
+
// if (v.bigInteger.negative) {
|
|
20
|
+
// intValue = -intValue
|
|
21
|
+
// }
|
|
22
|
+
// return intValue
|
|
23
|
+
// }
|
|
24
|
+
//
|
|
25
|
+
// if (v.bigDecimal) {
|
|
26
|
+
// return new BigDecimal(v.bigDecimal)
|
|
27
|
+
// }
|
|
28
|
+
//
|
|
29
|
+
// throw Error("MetricValue doesn't contain any of possible value")
|
|
30
|
+
// }
|
package/src/utils/dex-price.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { getEACAggregatorProxyContract } from '../builtin/internal/eacaggregatorproxy_processor'
|
|
2
|
-
import path from 'path'
|
|
1
|
+
import { getEACAggregatorProxyContract } from '../eth/builtin/internal/eacaggregatorproxy_processor.js'
|
|
3
2
|
import fs from 'fs'
|
|
4
|
-
// @ts-ignore type def not provided
|
|
5
3
|
import { parse } from 'csv-parse/sync'
|
|
6
4
|
import { BlockTag } from 'ethers/providers'
|
|
7
|
-
import
|
|
5
|
+
import url from 'url'
|
|
6
|
+
import { scaleDown } from '../core/big-decimal.js'
|
|
8
7
|
|
|
9
8
|
type OralceRecord = {
|
|
10
9
|
Pair: string
|
|
@@ -36,7 +35,7 @@ class DexPrice {
|
|
|
36
35
|
|
|
37
36
|
constructor(csvFileName: string, chainId: number) {
|
|
38
37
|
this.chainId = chainId
|
|
39
|
-
const csvFilePath =
|
|
38
|
+
const csvFilePath = url.fileURLToPath(new URL('./' + csvFileName, import.meta.url))
|
|
40
39
|
const fileContent = fs.readFileSync(csvFilePath, { encoding: 'utf-8' })
|
|
41
40
|
const headers = ['Pair', 'Asset', 'Type', 'Address']
|
|
42
41
|
|
package/src/utils/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export *
|
|
2
|
-
export *
|
|
3
|
-
export *
|
|
4
|
-
export * as dexPrice from './dex-price'
|
|
1
|
+
export * from './conversion.js'
|
|
2
|
+
export * from './token.js'
|
|
3
|
+
export * from './dex-price.js'
|
package/src/utils/price.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoinID, PriceServiceClient, PriceServiceDefinition } from '@sentio/protos/
|
|
1
|
+
import { CoinID, PriceServiceClient, PriceServiceDefinition } from '@sentio/protos/price'
|
|
2
2
|
import { createChannel, createClientFactory } from 'nice-grpc'
|
|
3
3
|
import { retryMiddleware, RetryOptions } from 'nice-grpc-client-middleware-retry'
|
|
4
4
|
import { Endpoints } from '@sentio/runtime'
|
package/src/utils/token.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { toBigDecimal } from './conversion'
|
|
1
|
+
import { getERC20Contract } from '../eth/builtin/erc20/index.js'
|
|
2
|
+
import { getERC20BytesContract } from '../eth/builtin/internal/erc20bytes_processor.js'
|
|
3
|
+
import { BigDecimal, scaleDown } from '../core/big-decimal.js'
|
|
4
|
+
// import { toBigDecimal } from './conversion'
|
|
6
5
|
// import { utils } from 'ethers'
|
|
7
|
-
import { PromiseOrValue } from '../builtin/internal/common'
|
|
6
|
+
import { PromiseOrValue } from '../eth/builtin/internal/common.js'
|
|
8
7
|
import { decodeBytes32String } from 'ethers'
|
|
9
8
|
|
|
10
9
|
export interface TokenInfo {
|
|
@@ -42,30 +41,25 @@ export async function getERC20TokenInfo(tokenAddress: string, chainId = 1): Prom
|
|
|
42
41
|
const contract = getERC20Contract(tokenAddress, chainId)
|
|
43
42
|
const bytesContract = getERC20BytesContract(tokenAddress, chainId)
|
|
44
43
|
|
|
44
|
+
let name = ''
|
|
45
45
|
try {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} catch (e) {
|
|
51
|
-
name = decodeBytes32String(await bytesContract.name())
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let symbol = ''
|
|
55
|
-
try {
|
|
56
|
-
symbol = await contract.symbol()
|
|
57
|
-
} catch (e) {
|
|
58
|
-
symbol = decodeBytes32String(await bytesContract.symbol())
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const decimal = await contract.decimals()
|
|
62
|
-
const info = getTokenInfoPromise(symbol, name, decimal)
|
|
46
|
+
name = await contract.name()
|
|
47
|
+
} catch (e) {
|
|
48
|
+
name = decodeBytes32String(await bytesContract.name())
|
|
49
|
+
}
|
|
63
50
|
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
let symbol = ''
|
|
52
|
+
try {
|
|
53
|
+
symbol = await contract.symbol()
|
|
66
54
|
} catch (e) {
|
|
67
|
-
|
|
55
|
+
symbol = decodeBytes32String(await bytesContract.symbol())
|
|
68
56
|
}
|
|
57
|
+
|
|
58
|
+
const decimal = await contract.decimals()
|
|
59
|
+
const info = getTokenInfoPromise(symbol, name, decimal)
|
|
60
|
+
|
|
61
|
+
TOKEN_INFOS.set(key, info)
|
|
62
|
+
return info
|
|
69
63
|
}
|
|
70
64
|
|
|
71
65
|
export async function getER20NormalizedAmount(
|
|
@@ -76,8 +70,3 @@ export async function getER20NormalizedAmount(
|
|
|
76
70
|
const tokenInfo = await getERC20TokenInfo(tokenAddress, chainId)
|
|
77
71
|
return scaleDown(amount, tokenInfo.decimal)
|
|
78
72
|
}
|
|
79
|
-
|
|
80
|
-
export function scaleDown(amount: bigint, decimal: number | bigint) {
|
|
81
|
-
const divider = new BigDecimal(10).pow(Number(decimal))
|
|
82
|
-
return amount.asBigDecimal().dividedBy(divider)
|
|
83
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* Autogenerated file. Do not edit manually. */
|
|
3
|
-
/* tslint:disable */
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
tslib_1.__exportStar(require("../internal/eacaggregatorproxy_processor"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("../internal/EACAggregatorProxy"), exports);
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builtin/eacaggregatorproxy/index.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;;;AAEpB,mFAAyD;AACzD,yEAA+C","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nexport * from \"../internal/eacaggregatorproxy_processor\";\nexport * from \"../internal/EACAggregatorProxy\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../../src/builtin/eacaggregatorproxy/test-utils.ts"],"names":[],"mappings":";;;AAIA,wBAMW;AACX,MAAM,SAAS,GAAG;IAChB,SAAS,EACP,oEAAoE;IACtE,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,KAAK;IACd,eAAe,EACb,oEAAoE;IACtE,gBAAgB,EAAE,CAAC;CACpB,CAAC;AAEF,SAAgB,oBAAoB,CAClC,eAAuB,EACvB,KAA+B;IAE/B,MAAM,QAAQ,GAAG,IAAA,gCAA6B,EAAC,eAAe,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,uCAAuC,EACvC,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAChD,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,oDAgBC;AAED,SAAgB,eAAe,CAC7B,eAAuB,EACvB,KAA0B;IAE1B,MAAM,QAAQ,GAAG,IAAA,gCAA6B,EAAC,eAAe,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,mCAAmC,EACnC,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAClD,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,0CAgBC;AAED,SAAgB,iCAAiC,CAC/C,eAAuB,EACvB,KAA4C;IAE5C,MAAM,QAAQ,GAAG,IAAA,gCAA6B,EAAC,eAAe,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,6CAA6C,EAC7C,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CACvB,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,8EAgBC;AAED,SAAgB,2BAA2B,CACzC,eAAuB,EACvB,KAAsC;IAEtC,MAAM,QAAQ,GAAG,IAAA,gCAA6B,EAAC,eAAe,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,uCAAuC,EACvC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CACvB,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,kEAgBC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { LogParams } from \"ethers/providers\";\nimport {\n getEACAggregatorProxyContract,\n AnswerUpdatedEventObject,\n NewRoundEventObject,\n OwnershipTransferRequestedEventObject,\n OwnershipTransferredEventObject,\n} from \".\";\nconst mockField = {\n blockHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n blockNumber: 0,\n logIndex: 0,\n removed: false,\n transactionHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n transactionIndex: 0,\n};\n\nexport function mockAnswerUpdatedLog(\n contractAddress: string,\n event: AnswerUpdatedEventObject\n): LogParams {\n const contract = getEACAggregatorProxyContract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"AnswerUpdated(int256,uint256,uint256)\",\n [event.current, event.roundId, event.updatedAt]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockNewRoundLog(\n contractAddress: string,\n event: NewRoundEventObject\n): LogParams {\n const contract = getEACAggregatorProxyContract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"NewRound(uint256,address,uint256)\",\n [event.roundId, event.startedBy, event.startedAt]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockOwnershipTransferRequestedLog(\n contractAddress: string,\n event: OwnershipTransferRequestedEventObject\n): LogParams {\n const contract = getEACAggregatorProxyContract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"OwnershipTransferRequested(address,address)\",\n [event.from, event.to]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockOwnershipTransferredLog(\n contractAddress: string,\n event: OwnershipTransferredEventObject\n): LogParams {\n const contract = getEACAggregatorProxyContract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"OwnershipTransferred(address,address)\",\n [event.from, event.to]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* Autogenerated file. Do not edit manually. */
|
|
3
|
-
/* tslint:disable */
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
tslib_1.__exportStar(require("../internal/erc1155_processor"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("../internal/ERC1155"), exports);
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builtin/erc1155/index.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;;;AAEpB,wEAA8C;AAC9C,8DAAoC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nexport * from \"../internal/erc1155_processor\";\nexport * from \"../internal/ERC1155\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../../src/builtin/erc1155/test-utils.ts"],"names":[],"mappings":";;;AAIA,wBAMW;AACX,MAAM,SAAS,GAAG;IAChB,SAAS,EACP,oEAAoE;IACtE,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,KAAK;IACd,eAAe,EACb,oEAAoE;IACtE,gBAAgB,EAAE,CAAC;CACpB,CAAC;AAEF,SAAgB,qBAAqB,CACnC,eAAuB,EACvB,KAAgC;IAEhC,MAAM,QAAQ,GAAG,IAAA,qBAAkB,EAAC,eAAe,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,sCAAsC,EACtC,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAChD,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,sDAgBC;AAED,SAAgB,oBAAoB,CAClC,eAAuB,EACvB,KAA+B;IAE/B,MAAM,QAAQ,GAAG,IAAA,qBAAkB,EAAC,eAAe,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,4DAA4D,EAC5D,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAChE,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,oDAgBC;AAED,SAAgB,qBAAqB,CACnC,eAAuB,EACvB,KAAgC;IAEhC,MAAM,QAAQ,GAAG,IAAA,qBAAkB,EAAC,eAAe,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,yDAAyD,EACzD,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAC9D,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,sDAgBC;AAED,SAAgB,UAAU,CACxB,eAAuB,EACvB,KAAqB;IAErB,MAAM,QAAQ,GAAG,IAAA,qBAAkB,EAAC,eAAe,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,qBAAqB,EACrB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CACxB,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,gCAgBC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { LogParams } from \"ethers/providers\";\nimport {\n getERC1155Contract,\n ApprovalForAllEventObject,\n TransferBatchEventObject,\n TransferSingleEventObject,\n URIEventObject,\n} from \".\";\nconst mockField = {\n blockHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n blockNumber: 0,\n logIndex: 0,\n removed: false,\n transactionHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n transactionIndex: 0,\n};\n\nexport function mockApprovalForAllLog(\n contractAddress: string,\n event: ApprovalForAllEventObject\n): LogParams {\n const contract = getERC1155Contract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"ApprovalForAll(address,address,bool)\",\n [event.account, event.operator, event.approved]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockTransferBatchLog(\n contractAddress: string,\n event: TransferBatchEventObject\n): LogParams {\n const contract = getERC1155Contract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"TransferBatch(address,address,address,uint256[],uint256[])\",\n [event.operator, event.from, event.to, event.ids, event.values]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockTransferSingleLog(\n contractAddress: string,\n event: TransferSingleEventObject\n): LogParams {\n const contract = getERC1155Contract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"TransferSingle(address,address,address,uint256,uint256)\",\n [event.operator, event.from, event.to, event.id, event.value]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockURILog(\n contractAddress: string,\n event: URIEventObject\n): LogParams {\n const contract = getERC1155Contract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"URI(string,uint256)\",\n [event.value, event.id]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* Autogenerated file. Do not edit manually. */
|
|
3
|
-
/* tslint:disable */
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
tslib_1.__exportStar(require("../internal/erc20_processor"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("../internal/ERC20"), exports);
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builtin/erc20/index.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;;;AAEpB,sEAA4C;AAC5C,4DAAkC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nexport * from \"../internal/erc20_processor\";\nexport * from \"../internal/ERC20\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../../src/builtin/erc20/test-utils.ts"],"names":[],"mappings":";;;AAIA,wBAKW;AACX,MAAM,SAAS,GAAG;IAChB,SAAS,EACP,oEAAoE;IACtE,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,KAAK;IACd,eAAe,EACb,oEAAoE;IACtE,gBAAgB,EAAE,CAAC;CACpB,CAAC;AAEF,SAAgB,eAAe,CAC7B,eAAuB,EACvB,KAA0B;IAE1B,MAAM,QAAQ,GAAG,IAAA,mBAAgB,EAAC,eAAe,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,mCAAmC,EACnC,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAC1C,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,0CAgBC;AAED,SAAgB,2BAA2B,CACzC,eAAuB,EACvB,KAAsC;IAEtC,MAAM,QAAQ,GAAG,IAAA,mBAAgB,EAAC,eAAe,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,uCAAuC,EACvC,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,CACtC,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,kEAgBC;AAED,SAAgB,eAAe,CAC7B,eAAuB,EACvB,KAA0B;IAE1B,MAAM,QAAQ,GAAG,IAAA,mBAAgB,EAAC,eAAe,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,mCAAmC,EACnC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CACpC,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,0CAgBC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { LogParams } from \"ethers/providers\";\nimport {\n getERC20Contract,\n ApprovalEventObject,\n OwnershipTransferredEventObject,\n TransferEventObject,\n} from \".\";\nconst mockField = {\n blockHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n blockNumber: 0,\n logIndex: 0,\n removed: false,\n transactionHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n transactionIndex: 0,\n};\n\nexport function mockApprovalLog(\n contractAddress: string,\n event: ApprovalEventObject\n): LogParams {\n const contract = getERC20Contract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Approval(address,address,uint256)\",\n [event.owner, event.spender, event.value]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockOwnershipTransferredLog(\n contractAddress: string,\n event: OwnershipTransferredEventObject\n): LogParams {\n const contract = getERC20Contract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"OwnershipTransferred(address,address)\",\n [event.previousOwner, event.newOwner]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockTransferLog(\n contractAddress: string,\n event: TransferEventObject\n): LogParams {\n const contract = getERC20Contract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Transfer(address,address,uint256)\",\n [event.from, event.to, event.value]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* Autogenerated file. Do not edit manually. */
|
|
3
|
-
/* tslint:disable */
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
tslib_1.__exportStar(require("../internal/erc20bytes_processor"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("../internal/ERC20Bytes"), exports);
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builtin/erc20bytes/index.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;;;AAEpB,2EAAiD;AACjD,iEAAuC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nexport * from \"../internal/erc20bytes_processor\";\nexport * from \"../internal/ERC20Bytes\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../../src/builtin/erc20bytes/test-utils.ts"],"names":[],"mappings":";;;AAIA,wBAIW;AACX,MAAM,SAAS,GAAG;IAChB,SAAS,EACP,oEAAoE;IACtE,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,KAAK;IACd,eAAe,EACb,oEAAoE;IACtE,gBAAgB,EAAE,CAAC;CACpB,CAAC;AAEF,SAAgB,eAAe,CAC7B,eAAuB,EACvB,KAA0B;IAE1B,MAAM,QAAQ,GAAG,IAAA,wBAAqB,EAAC,eAAe,CAAC,CAAC;IACxD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,mCAAmC,EACnC,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAC1C,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,0CAgBC;AAED,SAAgB,eAAe,CAC7B,eAAuB,EACvB,KAA0B;IAE1B,MAAM,QAAQ,GAAG,IAAA,wBAAqB,EAAC,eAAe,CAAC,CAAC;IACxD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAC9D,mCAAmC,EACnC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CACpC,CAAC;IACF,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAhBD,0CAgBC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { LogParams } from \"ethers/providers\";\nimport {\n getERC20BytesContract,\n ApprovalEventObject,\n TransferEventObject,\n} from \".\";\nconst mockField = {\n blockHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n blockNumber: 0,\n logIndex: 0,\n removed: false,\n transactionHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n transactionIndex: 0,\n};\n\nexport function mockApprovalLog(\n contractAddress: string,\n event: ApprovalEventObject\n): LogParams {\n const contract = getERC20BytesContract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Approval(address,address,uint256)\",\n [event.owner, event.spender, event.value]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockTransferLog(\n contractAddress: string,\n event: TransferEventObject\n): LogParams {\n const contract = getERC20BytesContract(contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Transfer(address,address,uint256)\",\n [event.from, event.to, event.value]\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n"]}
|