@sentio/sdk 1.13.0 → 1.13.2
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/cli/commands/run-create.js +2 -0
- package/lib/cli/commands/run-create.js.map +1 -1
- package/lib/test/index.d.ts +1 -0
- package/lib/test/index.js +5 -1
- package/lib/test/index.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/commands/run-create.ts +3 -0
- package/src/test/index.ts +1 -0
- package/template/package.json +2 -3
- package/template/src/processor.test.ts +1 -1
- package/template/src/processor.ts +20 -16
- package/template/node_modules/@sentio/sdk/lib/base-processor-template.d.ts +0 -27
- package/template/node_modules/@sentio/sdk/lib/base-processor-template.js +0 -80
- package/template/node_modules/@sentio/sdk/lib/base-processor-template.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/base-processor.d.ts +0 -30
- package/template/node_modules/@sentio/sdk/lib/base-processor.js +0 -148
- package/template/node_modules/@sentio/sdk/lib/base-processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/bind-options.d.ts +0 -21
- package/template/node_modules/@sentio/sdk/lib/bind-options.js +0 -42
- package/template/node_modules/@sentio/sdk/lib/bind-options.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/binds.d.ts +0 -10
- package/template/node_modules/@sentio/sdk/lib/binds.js +0 -59
- package/template/node_modules/@sentio/sdk/lib/binds.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20/index.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20/index.js +0 -22
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20/test-utils.d.ts +0 -5
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20/test-utils.js +0 -46
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20/test-utils.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20bytes/index.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20bytes/index.js +0 -22
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20bytes/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20bytes/test-utils.d.ts +0 -4
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20bytes/test-utils.js +0 -35
- package/template/node_modules/@sentio/sdk/lib/builtin/erc20bytes/test-utils.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/ERC20.d.ts +0 -307
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/ERC20.js +0 -3
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/ERC20.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/ERC20Bytes.d.ts +0 -166
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/ERC20Bytes.js +0 -3
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/ERC20Bytes.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/WETH9.d.ts +0 -221
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/WETH9.js +0 -3
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/WETH9.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/common.d.ts +0 -22
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/common.js +0 -3
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/common.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/erc20_processor.d.ts +0 -184
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/erc20_processor.js +0 -453
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/erc20_processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/erc20bytes_processor.d.ts +0 -110
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/erc20bytes_processor.js +0 -325
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/erc20bytes_processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/ERC20Bytes__factory.d.ts +0 -48
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/ERC20Bytes__factory.js +0 -254
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/ERC20__factory.d.ts +0 -42
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/ERC20__factory.js +0 -404
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/ERC20__factory.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/WETH9__factory.d.ts +0 -45
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/WETH9__factory.js +0 -297
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/WETH9__factory.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/index.d.ts +0 -3
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/index.js +0 -13
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/factories/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/index.d.ts +0 -7
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/index.js +0 -34
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/weth9_processor.d.ts +0 -126
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/weth9_processor.js +0 -361
- package/template/node_modules/@sentio/sdk/lib/builtin/internal/weth9_processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/weth9/index.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/builtin/weth9/index.js +0 -22
- package/template/node_modules/@sentio/sdk/lib/builtin/weth9/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/builtin/weth9/test-utils.d.ts +0 -6
- package/template/node_modules/@sentio/sdk/lib/builtin/weth9/test-utils.js +0 -57
- package/template/node_modules/@sentio/sdk/lib/builtin/weth9/test-utils.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/chain-config.d.ts +0 -6
- package/template/node_modules/@sentio/sdk/lib/chain-config.js +0 -3
- package/template/node_modules/@sentio/sdk/lib/chain-config.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/build.d.ts +0 -4
- package/template/node_modules/@sentio/sdk/lib/cli/build.js +0 -178
- package/template/node_modules/@sentio/sdk/lib/cli/build.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/cli.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/cli/cli.js +0 -163
- package/template/node_modules/@sentio/sdk/lib/cli/cli.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/commands/run-create.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/commands/run-create.js +0 -43
- package/template/node_modules/@sentio/sdk/lib/cli/commands/run-create.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/commands/run-login.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/commands/run-login.js +0 -77
- package/template/node_modules/@sentio/sdk/lib/cli/commands/run-login.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/config.d.ts +0 -16
- package/template/node_modules/@sentio/sdk/lib/cli/config.js +0 -36
- package/template/node_modules/@sentio/sdk/lib/cli/config.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/key.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/cli/key.js +0 -44
- package/template/node_modules/@sentio/sdk/lib/cli/key.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/solana-code-gen.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/cli/solana-code-gen.js +0 -19
- package/template/node_modules/@sentio/sdk/lib/cli/solana-code-gen.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/upload.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/cli/upload.js +0 -85
- package/template/node_modules/@sentio/sdk/lib/cli/upload.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/cli/webpack.config.js +0 -42
- package/template/node_modules/@sentio/sdk/lib/context.d.ts +0 -49
- package/template/node_modules/@sentio/sdk/lib/context.js +0 -93
- package/template/node_modules/@sentio/sdk/lib/context.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/contract-namer.d.ts +0 -6
- package/template/node_modules/@sentio/sdk/lib/contract-namer.js +0 -20
- package/template/node_modules/@sentio/sdk/lib/contract-namer.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/error.d.ts +0 -7
- package/template/node_modules/@sentio/sdk/lib/error.js +0 -43
- package/template/node_modules/@sentio/sdk/lib/error.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/gen/builtin.d.ts +0 -6
- package/template/node_modules/@sentio/sdk/lib/gen/builtin.js +0 -3
- package/template/node_modules/@sentio/sdk/lib/gen/builtin.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/gen/google/protobuf/empty.d.ts +0 -16
- package/template/node_modules/@sentio/sdk/lib/gen/google/protobuf/empty.js +0 -47
- package/template/node_modules/@sentio/sdk/lib/gen/google/protobuf/empty.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/gen/processor/protos/processor.d.ts +0 -666
- package/template/node_modules/@sentio/sdk/lib/gen/processor/protos/processor.js +0 -2837
- package/template/node_modules/@sentio/sdk/lib/gen/processor/protos/processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/generic-processor.d.ts +0 -10
- package/template/node_modules/@sentio/sdk/lib/generic-processor.js +0 -32
- package/template/node_modules/@sentio/sdk/lib/generic-processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/index.d.ts +0 -18
- package/template/node_modules/@sentio/sdk/lib/index.js +0 -63
- package/template/node_modules/@sentio/sdk/lib/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/loader.d.ts +0 -5
- package/template/node_modules/@sentio/sdk/lib/loader.js +0 -30
- package/template/node_modules/@sentio/sdk/lib/loader.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/meter.d.ts +0 -26
- package/template/node_modules/@sentio/sdk/lib/meter.js +0 -131
- package/template/node_modules/@sentio/sdk/lib/meter.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/meter.test.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/meter.test.js +0 -16
- package/template/node_modules/@sentio/sdk/lib/meter.test.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/numberish.d.ts +0 -6
- package/template/node_modules/@sentio/sdk/lib/numberish.js +0 -96
- package/template/node_modules/@sentio/sdk/lib/numberish.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/numberish.test.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/numberish.test.js +0 -70
- package/template/node_modules/@sentio/sdk/lib/numberish.test.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/processor-runner.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/processor-runner.js +0 -40
- package/template/node_modules/@sentio/sdk/lib/processor-runner.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/processor-state.d.ts +0 -16
- package/template/node_modules/@sentio/sdk/lib/processor-state.js +0 -20
- package/template/node_modules/@sentio/sdk/lib/processor-state.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/promise-or-void.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/promise-or-void.js +0 -3
- package/template/node_modules/@sentio/sdk/lib/promise-or-void.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/provider.d.ts +0 -6
- package/template/node_modules/@sentio/sdk/lib/provider.js +0 -66
- package/template/node_modules/@sentio/sdk/lib/provider.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/release.config.js +0 -31
- package/template/node_modules/@sentio/sdk/lib/service.d.ts +0 -25
- package/template/node_modules/@sentio/sdk/lib/service.js +0 -406
- package/template/node_modules/@sentio/sdk/lib/service.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/index.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/index.js +0 -19
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/spl-token-processor.d.ts +0 -26
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/spl-token-processor.js +0 -138
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/spl-token-processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/types.d.ts +0 -330
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/types.js +0 -203
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/types.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/wormhole-processor.d.ts +0 -18
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/wormhole-processor.js +0 -192
- package/template/node_modules/@sentio/sdk/lib/solana/builtin/wormhole-processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/solana-processor.d.ts +0 -34
- package/template/node_modules/@sentio/sdk/lib/solana-processor.js +0 -95
- package/template/node_modules/@sentio/sdk/lib/solana-processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/target-ethers-sentio/codegen.d.ts +0 -4
- package/template/node_modules/@sentio/sdk/lib/target-ethers-sentio/codegen.js +0 -292
- package/template/node_modules/@sentio/sdk/lib/target-ethers-sentio/codegen.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/target-ethers-sentio/functions.d.ts +0 -3
- package/template/node_modules/@sentio/sdk/lib/target-ethers-sentio/functions.js +0 -61
- package/template/node_modules/@sentio/sdk/lib/target-ethers-sentio/functions.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/target-ethers-sentio/index.d.ts +0 -6
- package/template/node_modules/@sentio/sdk/lib/target-ethers-sentio/index.js +0 -51
- package/template/node_modules/@sentio/sdk/lib/target-ethers-sentio/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/codegen.test.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/codegen.test.js +0 -49
- package/template/node_modules/@sentio/sdk/lib/test/codegen.test.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/erc20-template.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/erc20-template.js +0 -23
- package/template/node_modules/@sentio/sdk/lib/test/erc20-template.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/erc20-template.test.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/erc20-template.test.js +0 -37
- package/template/node_modules/@sentio/sdk/lib/test/erc20-template.test.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/erc20.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/erc20.js +0 -44
- package/template/node_modules/@sentio/sdk/lib/test/erc20.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/erc20.test.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/erc20.test.js +0 -96
- package/template/node_modules/@sentio/sdk/lib/test/erc20.test.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/generic-processor.test.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/generic-processor.test.js +0 -59
- package/template/node_modules/@sentio/sdk/lib/test/generic-processor.test.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/index.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/test/index.js +0 -8
- package/template/node_modules/@sentio/sdk/lib/test/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/metric-utils.d.ts +0 -6
- package/template/node_modules/@sentio/sdk/lib/test/metric-utils.js +0 -50
- package/template/node_modules/@sentio/sdk/lib/test/metric-utils.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/mirrorworld.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/mirrorworld.js +0 -42
- package/template/node_modules/@sentio/sdk/lib/test/mirrorworld.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/solana.test.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/solana.test.js +0 -90
- package/template/node_modules/@sentio/sdk/lib/test/solana.test.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/test-processor-server.d.ts +0 -34
- package/template/node_modules/@sentio/sdk/lib/test/test-processor-server.js +0 -205
- package/template/node_modules/@sentio/sdk/lib/test/test-processor-server.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/test-provider.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/test-provider.js +0 -25
- package/template/node_modules/@sentio/sdk/lib/test/test-provider.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/types/game_wallet.d.ts +0 -45
- package/template/node_modules/@sentio/sdk/lib/test/types/game_wallet.js +0 -1396
- package/template/node_modules/@sentio/sdk/lib/test/types/game_wallet.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/types/game_wallet_processor.d.ts +0 -107
- package/template/node_modules/@sentio/sdk/lib/test/types/game_wallet_processor.js +0 -105
- package/template/node_modules/@sentio/sdk/lib/test/types/game_wallet_processor.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/wormhole-token-bridge.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/test/wormhole-token-bridge.js +0 -22
- package/template/node_modules/@sentio/sdk/lib/test/wormhole-token-bridge.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/trace.d.ts +0 -35
- package/template/node_modules/@sentio/sdk/lib/trace.js +0 -43
- package/template/node_modules/@sentio/sdk/lib/trace.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/utils/chainmap.d.ts +0 -2
- package/template/node_modules/@sentio/sdk/lib/utils/chainmap.js +0 -98
- package/template/node_modules/@sentio/sdk/lib/utils/chainmap.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/utils/convert.d.ts +0 -5
- package/template/node_modules/@sentio/sdk/lib/utils/convert.js +0 -27
- package/template/node_modules/@sentio/sdk/lib/utils/convert.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/utils/erc20.d.ts +0 -14
- package/template/node_modules/@sentio/sdk/lib/utils/erc20.js +0 -62
- package/template/node_modules/@sentio/sdk/lib/utils/erc20.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/utils/erc20.test.d.ts +0 -1
- package/template/node_modules/@sentio/sdk/lib/utils/erc20.test.js +0 -23
- package/template/node_modules/@sentio/sdk/lib/utils/erc20.test.js.map +0 -1
- package/template/node_modules/@sentio/sdk/lib/utils/index.d.ts +0 -3
- package/template/node_modules/@sentio/sdk/lib/utils/index.js +0 -14
- package/template/node_modules/@sentio/sdk/lib/utils/index.js.map +0 -1
- package/template/node_modules/@sentio/sdk/package.json +0 -78
- package/template/node_modules/@sentio/sdk/src/abis/ERC20.json +0 -174
- package/template/node_modules/@sentio/sdk/src/abis/ERC20Bytes.json +0 -236
- package/template/node_modules/@sentio/sdk/src/abis/WETH9.json +0 -153
- package/template/node_modules/@sentio/sdk/src/base-processor-template.ts +0 -105
- package/template/node_modules/@sentio/sdk/src/base-processor.ts +0 -172
- package/template/node_modules/@sentio/sdk/src/bind-options.ts +0 -41
- package/template/node_modules/@sentio/sdk/src/binds.ts +0 -73
- package/template/node_modules/@sentio/sdk/src/builtin/erc20/index.ts +0 -6
- package/template/node_modules/@sentio/sdk/src/builtin/erc20/test-utils.ts +0 -71
- package/template/node_modules/@sentio/sdk/src/builtin/erc20bytes/index.ts +0 -6
- package/template/node_modules/@sentio/sdk/src/builtin/erc20bytes/test-utils.ts +0 -53
- package/template/node_modules/@sentio/sdk/src/builtin/internal/ERC20.ts +0 -679
- package/template/node_modules/@sentio/sdk/src/builtin/internal/ERC20Bytes.ts +0 -384
- package/template/node_modules/@sentio/sdk/src/builtin/internal/WETH9.ts +0 -480
- package/template/node_modules/@sentio/sdk/src/builtin/internal/common.ts +0 -46
- package/template/node_modules/@sentio/sdk/src/builtin/internal/erc20_processor.ts +0 -762
- package/template/node_modules/@sentio/sdk/src/builtin/internal/erc20bytes_processor.ts +0 -531
- package/template/node_modules/@sentio/sdk/src/builtin/internal/factories/ERC20Bytes__factory.ts +0 -257
- package/template/node_modules/@sentio/sdk/src/builtin/internal/factories/ERC20__factory.ts +0 -404
- package/template/node_modules/@sentio/sdk/src/builtin/internal/factories/WETH9__factory.ts +0 -297
- package/template/node_modules/@sentio/sdk/src/builtin/internal/factories/index.ts +0 -6
- package/template/node_modules/@sentio/sdk/src/builtin/internal/index.ts +0 -10
- package/template/node_modules/@sentio/sdk/src/builtin/internal/weth9_processor.ts +0 -589
- package/template/node_modules/@sentio/sdk/src/builtin/weth9/index.ts +0 -6
- package/template/node_modules/@sentio/sdk/src/builtin/weth9/test-utils.ts +0 -89
- package/template/node_modules/@sentio/sdk/src/chain-config.ts +0 -6
- package/template/node_modules/@sentio/sdk/src/cli/build.ts +0 -196
- package/template/node_modules/@sentio/sdk/src/cli/cli.ts +0 -160
- package/template/node_modules/@sentio/sdk/src/cli/commands/run-create.ts +0 -36
- package/template/node_modules/@sentio/sdk/src/cli/commands/run-login.ts +0 -70
- package/template/node_modules/@sentio/sdk/src/cli/config.ts +0 -45
- package/template/node_modules/@sentio/sdk/src/cli/key.ts +0 -43
- package/template/node_modules/@sentio/sdk/src/cli/solana-code-gen.ts +0 -16
- package/template/node_modules/@sentio/sdk/src/cli/upload.ts +0 -88
- package/template/node_modules/@sentio/sdk/src/cli/webpack.config.js +0 -42
- package/template/node_modules/@sentio/sdk/src/context.ts +0 -103
- package/template/node_modules/@sentio/sdk/src/contract-namer.ts +0 -17
- package/template/node_modules/@sentio/sdk/src/error.ts +0 -45
- package/template/node_modules/@sentio/sdk/src/gen/builtin.ts +0 -22
- package/template/node_modules/@sentio/sdk/src/gen/google/protobuf/empty.ts +0 -70
- package/template/node_modules/@sentio/sdk/src/gen/processor/protos/processor.ts +0 -3626
- package/template/node_modules/@sentio/sdk/src/generic-processor.ts +0 -35
- package/template/node_modules/@sentio/sdk/src/index.ts +0 -21
- package/template/node_modules/@sentio/sdk/src/loader.ts +0 -24
- package/template/node_modules/@sentio/sdk/src/meter.test.ts +0 -16
- package/template/node_modules/@sentio/sdk/src/meter.ts +0 -140
- package/template/node_modules/@sentio/sdk/src/numberish.test.ts +0 -82
- package/template/node_modules/@sentio/sdk/src/numberish.ts +0 -100
- package/template/node_modules/@sentio/sdk/src/processor-runner.ts +0 -46
- package/template/node_modules/@sentio/sdk/src/processor-state.ts +0 -24
- package/template/node_modules/@sentio/sdk/src/promise-or-void.ts +0 -1
- package/template/node_modules/@sentio/sdk/src/provider.ts +0 -74
- package/template/node_modules/@sentio/sdk/src/service.ts +0 -491
- package/template/node_modules/@sentio/sdk/src/solana/builtin/index.ts +0 -2
- package/template/node_modules/@sentio/sdk/src/solana/builtin/spl-token-processor.ts +0 -164
- package/template/node_modules/@sentio/sdk/src/solana/builtin/types.ts +0 -268
- package/template/node_modules/@sentio/sdk/src/solana/builtin/wormhole-processor.ts +0 -178
- package/template/node_modules/@sentio/sdk/src/solana-processor.ts +0 -106
- package/template/node_modules/@sentio/sdk/src/target-ethers-sentio/codegen.ts +0 -315
- package/template/node_modules/@sentio/sdk/src/target-ethers-sentio/functions.ts +0 -68
- package/template/node_modules/@sentio/sdk/src/target-ethers-sentio/index.ts +0 -50
- package/template/node_modules/@sentio/sdk/src/target-ethers-sentio/tsconfig.json +0 -9
- package/template/node_modules/@sentio/sdk/src/test/abis/evm/CommitmentPool.json +0 -1034
- package/template/node_modules/@sentio/sdk/src/test/abis/evm/anyswapRouter.json +0 -490
- package/template/node_modules/@sentio/sdk/src/test/abis/solana/mirrorworld.json +0 -1392
- package/template/node_modules/@sentio/sdk/src/test/codegen.test.ts +0 -29
- package/template/node_modules/@sentio/sdk/src/test/erc20-template.test.ts +0 -37
- package/template/node_modules/@sentio/sdk/src/test/erc20-template.ts +0 -25
- package/template/node_modules/@sentio/sdk/src/test/erc20.test.ts +0 -117
- package/template/node_modules/@sentio/sdk/src/test/erc20.ts +0 -50
- package/template/node_modules/@sentio/sdk/src/test/generic-processor.test.ts +0 -70
- package/template/node_modules/@sentio/sdk/src/test/index.ts +0 -2
- package/template/node_modules/@sentio/sdk/src/test/metric-utils.ts +0 -49
- package/template/node_modules/@sentio/sdk/src/test/mirrorworld.ts +0 -40
- package/template/node_modules/@sentio/sdk/src/test/sentio.yaml +0 -4
- package/template/node_modules/@sentio/sdk/src/test/solana.test.ts +0 -93
- package/template/node_modules/@sentio/sdk/src/test/test-processor-server.ts +0 -258
- package/template/node_modules/@sentio/sdk/src/test/test-provider.ts +0 -25
- package/template/node_modules/@sentio/sdk/src/test/types/game_wallet.ts +0 -1392
- package/template/node_modules/@sentio/sdk/src/test/types/game_wallet_processor.ts +0 -113
- package/template/node_modules/@sentio/sdk/src/test/wormhole-token-bridge.ts +0 -21
- package/template/node_modules/@sentio/sdk/src/trace.ts +0 -86
- package/template/node_modules/@sentio/sdk/src/types/global.d.ts +0 -17
- package/template/node_modules/@sentio/sdk/src/utils/chainmap.ts +0 -95
- package/template/node_modules/@sentio/sdk/src/utils/convert.ts +0 -26
- package/template/node_modules/@sentio/sdk/src/utils/erc20.test.ts +0 -26
- package/template/node_modules/@sentio/sdk/src/utils/erc20.ts +0 -66
- package/template/node_modules/@sentio/sdk/src/utils/index.ts +0 -3
- package/template/node_modules/base-x/LICENSE.md +0 -22
- package/template/node_modules/base-x/README.md +0 -73
- package/template/node_modules/base-x/package.json +0 -46
- package/template/node_modules/base-x/src/index.d.ts +0 -9
- package/template/node_modules/base-x/src/index.js +0 -121
- package/template/node_modules/bs58/CHANGELOG.md +0 -65
- package/template/node_modules/bs58/LICENSE +0 -21
- package/template/node_modules/bs58/README.md +0 -91
- package/template/node_modules/bs58/index.d.ts +0 -5
- package/template/node_modules/bs58/index.js +0 -4
- package/template/node_modules/bs58/package.json +0 -39
- package/template/src/types/internal/X2y2.ts +0 -684
- package/template/src/types/internal/common.ts +0 -46
- package/template/src/types/internal/factories/X2y2__factory.ts +0 -436
- package/template/src/types/internal/factories/index.ts +0 -4
- package/template/src/types/internal/index.ts +0 -6
- package/template/src/types/internal/x2y2_processor.ts +0 -1004
- package/template/src/types/x2y2/index.ts +0 -6
- package/template/src/types/x2y2/test-utils.ts +0 -89
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { codeGenEthersProcessor } from '../cli/build'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
import * as fs from 'fs'
|
|
4
|
-
import os from 'os'
|
|
5
|
-
|
|
6
|
-
describe('Test EVM codegen', () => {
|
|
7
|
-
const codeGenFolder = fs.mkdtempSync(path.join(os.tmpdir(), 'codegen_test'))
|
|
8
|
-
|
|
9
|
-
jest.setTimeout(20000)
|
|
10
|
-
|
|
11
|
-
// TODO make sure code could be compile
|
|
12
|
-
test('code gen for evm', async () => {
|
|
13
|
-
console.log('source code generated to ' + codeGenFolder)
|
|
14
|
-
|
|
15
|
-
await codeGenEthersProcessor(
|
|
16
|
-
path.join(__dirname, 'abis/evm'),
|
|
17
|
-
'lib/target-ethers-sentio',
|
|
18
|
-
`${codeGenFolder}/internal`
|
|
19
|
-
)
|
|
20
|
-
expect(fs.existsSync(codeGenFolder)).toEqual(true)
|
|
21
|
-
expect(fs.readdirSync(codeGenFolder).length).toEqual(3)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
// afterAll(() => {
|
|
25
|
-
// if (fs.existsSync(codeGenFolder)) {
|
|
26
|
-
// fs.rmSync(codeGenFolder, { recursive: true, force: true })
|
|
27
|
-
// }
|
|
28
|
-
// })
|
|
29
|
-
})
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// TODO move out of this package
|
|
2
|
-
|
|
3
|
-
import { expect } from 'chai'
|
|
4
|
-
|
|
5
|
-
import { StartRequest } from '..'
|
|
6
|
-
import Long from 'long'
|
|
7
|
-
import { TestProcessorServer } from './test-processor-server'
|
|
8
|
-
|
|
9
|
-
describe('Test Template', () => {
|
|
10
|
-
const service = new TestProcessorServer(() => require('./erc20-template'))
|
|
11
|
-
|
|
12
|
-
beforeAll(async () => {
|
|
13
|
-
const request: StartRequest = {
|
|
14
|
-
templateInstances: [
|
|
15
|
-
{
|
|
16
|
-
contract: {
|
|
17
|
-
address: 'dynamic2',
|
|
18
|
-
name: 'dynamic2',
|
|
19
|
-
chainId: '1',
|
|
20
|
-
abi: '',
|
|
21
|
-
},
|
|
22
|
-
startBlock: Long.ZERO,
|
|
23
|
-
endBlock: Long.ZERO,
|
|
24
|
-
templateId: 0,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
}
|
|
28
|
-
await service.start(request)
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
test('Check template instantiate', async () => {
|
|
32
|
-
const config = await service.getConfig({})
|
|
33
|
-
expect(config.contractConfigs).length(2)
|
|
34
|
-
expect(config.contractConfigs?.[1].contract?.name).equals('dynamic2')
|
|
35
|
-
expect(config.templateInstances).length(1)
|
|
36
|
-
})
|
|
37
|
-
})
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ERC20Processor, ERC20ProcessorTemplate } from '../builtin/erc20'
|
|
2
|
-
|
|
3
|
-
export const filter = ERC20Processor.filters.Transfer(
|
|
4
|
-
'0x0000000000000000000000000000000000000000',
|
|
5
|
-
'0xb329e39ebefd16f40d38f07643652ce17ca5bac1'
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
const processorTemplate = new ERC20ProcessorTemplate().onEventTransfer(async function (event, ctx) {
|
|
9
|
-
console.log('')
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
ERC20Processor.bind({
|
|
13
|
-
address: '0x1e4ede388cbc9f4b5c79681b7f94d36a11abebc9',
|
|
14
|
-
network: 1,
|
|
15
|
-
name: 'x2y2',
|
|
16
|
-
startBlock: 14201940,
|
|
17
|
-
}).onEventTransfer(async function (event, ctx) {
|
|
18
|
-
processorTemplate.bind({
|
|
19
|
-
address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
|
|
20
|
-
network: 3,
|
|
21
|
-
name: 'dynamic',
|
|
22
|
-
})
|
|
23
|
-
// template.bind('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 3, 'dynamic')
|
|
24
|
-
ctx.meter.Counter('c1').add(1)
|
|
25
|
-
}, filter)
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
// TODO move out of this package
|
|
2
|
-
|
|
3
|
-
import { expect } from 'chai'
|
|
4
|
-
|
|
5
|
-
import { HandlerType } from '..'
|
|
6
|
-
|
|
7
|
-
import { TestProcessorServer } from './test-processor-server'
|
|
8
|
-
import { firstCounterValue, firstGaugeValue } from './metric-utils'
|
|
9
|
-
import { BigNumber } from 'ethers'
|
|
10
|
-
import { mockTransferLog } from '../builtin/erc20/test-utils'
|
|
11
|
-
import { Trace } from '../trace'
|
|
12
|
-
|
|
13
|
-
describe('Test Basic Examples', () => {
|
|
14
|
-
const service = new TestProcessorServer(() => require('./erc20'))
|
|
15
|
-
|
|
16
|
-
beforeAll(async () => {
|
|
17
|
-
await service.start()
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
test('check configuration', async () => {
|
|
21
|
-
const config = await service.getConfig({})
|
|
22
|
-
expect(config.contractConfigs).length(5)
|
|
23
|
-
|
|
24
|
-
// check auto rename
|
|
25
|
-
expect(config.contractConfigs?.[2].contract?.name).equals('ERC20')
|
|
26
|
-
expect(config.contractConfigs?.[3].contract?.name).equals('ERC20_1')
|
|
27
|
-
// same as above because only differ in parameters
|
|
28
|
-
expect(config.contractConfigs?.[4].contract?.name).equals('ERC20_1')
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
test('Check block dispatch', async () => {
|
|
32
|
-
const res = (await service.testBlock(blockData)).result
|
|
33
|
-
expect(res?.counters).length(0)
|
|
34
|
-
expect(res?.gauges).length(1)
|
|
35
|
-
expect(firstGaugeValue(res, 'g1')).equals(10n)
|
|
36
|
-
|
|
37
|
-
const gauge = res?.gauges?.[0]
|
|
38
|
-
expect(gauge?.metadata?.blockNumber?.toString()).equals('14373295')
|
|
39
|
-
expect(gauge?.runtimeInfo?.from).equals(HandlerType.BLOCK)
|
|
40
|
-
|
|
41
|
-
const res2 = (await service.testBlock(blockData, 56)).result
|
|
42
|
-
expect(res2?.counters).length(0)
|
|
43
|
-
expect(res2?.gauges).length(1)
|
|
44
|
-
expect(firstGaugeValue(res2, 'g2')).equals(20n)
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
test('Check log dispatch', async () => {
|
|
48
|
-
const logData = mockTransferLog('0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9', {
|
|
49
|
-
from: '0x0000000000000000000000000000000000000000',
|
|
50
|
-
to: '0xB329e39Ebefd16f40d38f07643652cE17Ca5Bac1',
|
|
51
|
-
value: BigNumber.from('0x9a71db64810aaa0000'),
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
let res = await service.testLog(logData)
|
|
55
|
-
|
|
56
|
-
const counters = res.result?.counters
|
|
57
|
-
expect(counters).length(1)
|
|
58
|
-
expect(firstCounterValue(res.result, 'c1')).equals(1n)
|
|
59
|
-
|
|
60
|
-
expect(counters?.[0].metadata?.chainId).equals('1')
|
|
61
|
-
expect(counters?.[0].runtimeInfo?.from).equals(HandlerType.LOG)
|
|
62
|
-
expect(res.configUpdated).equals(true)
|
|
63
|
-
|
|
64
|
-
const logData2 = Object.assign({}, logData)
|
|
65
|
-
logData2.address = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
|
|
66
|
-
res = await service.testLog(logData2, 56)
|
|
67
|
-
|
|
68
|
-
expect(firstCounterValue(res.result, 'c2')).equals(2n)
|
|
69
|
-
expect(res.result?.counters[0].metadata?.chainId).equals('56')
|
|
70
|
-
|
|
71
|
-
expect(res.result?.gauges).length(0)
|
|
72
|
-
|
|
73
|
-
const config = await service.getConfig({})
|
|
74
|
-
expect(config.contractConfigs).length(6) //config increased
|
|
75
|
-
expect(config.contractConfigs?.[5].contract?.name).equals('dynamic')
|
|
76
|
-
|
|
77
|
-
// repeat trigger won't bind again
|
|
78
|
-
await service.testLogs([logData])
|
|
79
|
-
const config2 = await service.getConfig({})
|
|
80
|
-
expect(config).deep.equals(config2)
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
const blockData = {
|
|
84
|
-
hash: '0x2b9b7cce1f17f3b7e1f3c2472cc806a07bee3f0baca07d021350950d81d73a42',
|
|
85
|
-
number: 14373295,
|
|
86
|
-
timestamp: 1647106437,
|
|
87
|
-
extraData: '0xe4b883e5bda9e7a59ee4bb99e9b1bc493421',
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
test('Check trace dispatch', async () => {
|
|
91
|
-
const res = (await service.testTrace(traceData)).result
|
|
92
|
-
expect(res?.counters).length(1)
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
const traceData: Trace = {
|
|
96
|
-
action: {
|
|
97
|
-
from: '0x80009ff8154bd5653c6dda2fa5f5053e5a5c1a91',
|
|
98
|
-
callType: 'call',
|
|
99
|
-
gas: 0xbb0a,
|
|
100
|
-
input:
|
|
101
|
-
'0x095ea7b30000000000000000000000003eabf546fff0a41edaaf5b667333a846285713180000000000000000000000000000000000000000000000000000002a03956d85',
|
|
102
|
-
to: '0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9',
|
|
103
|
-
value: 0x0,
|
|
104
|
-
},
|
|
105
|
-
blockHash: '0xb1fe1fefca4063ab9cc06a10356a6dd397b8c3dd38e21470e107a711ad559c13',
|
|
106
|
-
blockNumber: 15548801,
|
|
107
|
-
result: {
|
|
108
|
-
gasUsed: 0x95df,
|
|
109
|
-
output: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
110
|
-
},
|
|
111
|
-
subtraces: 1,
|
|
112
|
-
traceAddress: [],
|
|
113
|
-
transactionHash: '0xc05c37b34e13380d0b7e0475b27a0c77fda826f82c603f9c45922e952d63b7a5',
|
|
114
|
-
transactionPosition: 69,
|
|
115
|
-
type: 'call',
|
|
116
|
-
}
|
|
117
|
-
})
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ERC20Processor, ERC20ProcessorTemplate } from '../builtin/erc20'
|
|
2
|
-
|
|
3
|
-
export const filter = ERC20Processor.filters.Transfer(
|
|
4
|
-
'0x0000000000000000000000000000000000000000',
|
|
5
|
-
'0xb329e39ebefd16f40d38f07643652ce17ca5bac1'
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
const processorTemplate = new ERC20ProcessorTemplate().onEventTransfer(async function (event, ctx) {
|
|
9
|
-
console.log('')
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
ERC20Processor.bind({
|
|
13
|
-
address: '0x1e4ede388cbc9f4b5c79681b7f94d36a11abebc9',
|
|
14
|
-
// network: 1,
|
|
15
|
-
name: 'x2y2',
|
|
16
|
-
startBlock: 14201940,
|
|
17
|
-
})
|
|
18
|
-
.onEventTransfer(async function (event, ctx) {
|
|
19
|
-
processorTemplate.bind({ address: '0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9', network: 3, name: 'dynamic' })
|
|
20
|
-
// template.bind('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 3, 'dynamic')
|
|
21
|
-
ctx.meter.Counter('c1').add(1)
|
|
22
|
-
}, filter)
|
|
23
|
-
.onBlock(async function (block, ctx) {
|
|
24
|
-
ctx.meter.Gauge('g1').record(10, { k: 'v' })
|
|
25
|
-
})
|
|
26
|
-
.onCallApprove(function (call, ctx) {
|
|
27
|
-
ctx.meter.Counter('added').add(call.args.amount, { spender: call.args.spender })
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
ERC20Processor.bind({ address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', network: 56, name: 'usdc' })
|
|
31
|
-
.onEventTransfer(async function (event, ctx) {
|
|
32
|
-
ctx.meter.Counter('c2').add(2)
|
|
33
|
-
}, filter)
|
|
34
|
-
.onBlock(async function (block, ctx) {
|
|
35
|
-
ctx.meter.Gauge('g2').record(20, { k: 'v' })
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
ERC20Processor.bind({ address: 'xxxx', network: 56 })
|
|
39
|
-
|
|
40
|
-
ERC20Processor.bind({ address: 'yyyy', network: 1 })
|
|
41
|
-
ERC20Processor.bind({ address: 'yyyy', network: 1 })
|
|
42
|
-
ERC20Processor.bind({ address: 'yyyy', network: 1, startBlock: 21 })
|
|
43
|
-
|
|
44
|
-
// const template = Erc20Processor.template
|
|
45
|
-
// .onTransfer(async function (event, ctx) {
|
|
46
|
-
// ctx.meter.Counter('c2').add(2)
|
|
47
|
-
// }, filter)
|
|
48
|
-
// .onBlock(async function (block, ctx) {
|
|
49
|
-
// ctx.meter.Gauge('h1').record(20, { k: 'v' })
|
|
50
|
-
// })
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// TODO move out of this package
|
|
2
|
-
|
|
3
|
-
import { expect } from 'chai'
|
|
4
|
-
|
|
5
|
-
import { HandlerType } from '..'
|
|
6
|
-
|
|
7
|
-
import { GenericProcessor } from '../generic-processor'
|
|
8
|
-
import { TestProcessorServer } from './test-processor-server'
|
|
9
|
-
import { firstCounterValue } from './metric-utils'
|
|
10
|
-
|
|
11
|
-
describe('Test Generic Processor', () => {
|
|
12
|
-
const service = new TestProcessorServer(() => {
|
|
13
|
-
GenericProcessor.bind(
|
|
14
|
-
[
|
|
15
|
-
'event Transfer(address indexed from, address indexed to, uint256 value)',
|
|
16
|
-
'event Approval(address indexed from, address indexed to, uint256 value)',
|
|
17
|
-
],
|
|
18
|
-
{ address: '0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9' }
|
|
19
|
-
).onAllEvents(function (log, ctx) {
|
|
20
|
-
ctx.meter.Counter('event_num').add(1)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
GenericProcessor.bind('event WalletCreated(address wallet, address owner)', {
|
|
24
|
-
address: '0x57E037F4d2c8BEa011Ad8a9A5AF4AaEEd508650f',
|
|
25
|
-
}).onAllEvents(function (log, ctx) {
|
|
26
|
-
ctx.meter.Counter('wallet').add(1)
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
beforeAll(async () => {
|
|
31
|
-
await service.start()
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
test('check configuration', async () => {
|
|
35
|
-
const config = await service.getConfig({})
|
|
36
|
-
expect(config.contractConfigs).length(2)
|
|
37
|
-
expect(config.contractConfigs?.[0].contract?.name).equals('Generic')
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
test('Check log dispatch', async () => {
|
|
41
|
-
const res = await service.testLogs([logData, logData])
|
|
42
|
-
const counters = res.result?.counters
|
|
43
|
-
expect(counters).length(2)
|
|
44
|
-
expect(firstCounterValue(res.result, 'event_num')).equals(1n)
|
|
45
|
-
expect(counters?.[0].runtimeInfo?.from).equals(HandlerType.LOG)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
test('Check log dispatch no buffer over rune', async () => {
|
|
49
|
-
const logStr =
|
|
50
|
-
'{"address":"0x57e037f4d2c8bea011ad8a9a5af4aaeed508650f","topics":["0x5b03bfed1c14a02bdeceb5fa582eb1a5765fc0bc64ca0e6af4c20afc9487f081"],"data":"0x00000000000000000000000093269483a70c68d5c5bb63aac1e8f4ac59f498800000000000000000000000000c520e51c055cf63bab075715c1b860b2e9b8e24","blockNumber":"0xc9d6d7","transactionHash":"0x208af3250499672c2f07138b9aa236153c65c78ae4341b23c2763017afdd61a2","transactionIndex":"0xf3","blockHash":"0x6e3b100c34b510049e922fbe1c1dab1b0793be3d1229b632688e6a518cdd11b6","logIndex":"0x14b","removed":false}'
|
|
51
|
-
const res = await service.testLog(JSON.parse(logStr))
|
|
52
|
-
console.log(JSON.stringify(res))
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
const logData = {
|
|
56
|
-
blockNumber: 14213252,
|
|
57
|
-
blockHash: '0x83d646fac9350b281def8c4c37626f9d8efc95df801287b848c719edf35cdbaf',
|
|
58
|
-
transactionIndex: 347,
|
|
59
|
-
removed: false,
|
|
60
|
-
address: '0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9',
|
|
61
|
-
data: '0x00000000000000000000000000000000000000000000009a71db64810aaa0000',
|
|
62
|
-
topics: [
|
|
63
|
-
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
|
|
64
|
-
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
65
|
-
'0x000000000000000000000000b329e39ebefd16f40d38f07643652ce17ca5bac1',
|
|
66
|
-
],
|
|
67
|
-
transactionHash: '0x93355e0cb2c3490cb8a747029ff2dc8cdbde2407025b8391398436955afae303',
|
|
68
|
-
logIndex: 428,
|
|
69
|
-
}
|
|
70
|
-
})
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { DeepPartial } from '../gen/builtin'
|
|
2
|
-
import { BigDecimal, MetricValue, ProcessResult } from '@sentio/sdk'
|
|
3
|
-
import { Numberish } from '../numberish'
|
|
4
|
-
import { BigNumber } from 'ethers'
|
|
5
|
-
|
|
6
|
-
export function MetricValueToNumber(v: DeepPartial<MetricValue> | undefined): Numberish | undefined {
|
|
7
|
-
if (v === undefined) {
|
|
8
|
-
return undefined
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (v.doubleValue !== undefined) {
|
|
12
|
-
return v.doubleValue
|
|
13
|
-
}
|
|
14
|
-
if (v.bigInteger !== undefined) {
|
|
15
|
-
let intValue = BigNumber.from(v.bigInteger.data).toBigInt()
|
|
16
|
-
if (v.bigInteger.negative) {
|
|
17
|
-
intValue = -intValue
|
|
18
|
-
}
|
|
19
|
-
return intValue
|
|
20
|
-
}
|
|
21
|
-
if (v.bigDecimal !== undefined) {
|
|
22
|
-
return new BigDecimal(v.bigDecimal)
|
|
23
|
-
}
|
|
24
|
-
return undefined
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function firstCounterValue(result: ProcessResult | undefined, name: string): Numberish | undefined {
|
|
28
|
-
if (!result) {
|
|
29
|
-
return undefined
|
|
30
|
-
}
|
|
31
|
-
for (const counter of result.counters) {
|
|
32
|
-
if (counter.metadata?.name === name) {
|
|
33
|
-
return MetricValueToNumber(counter.metricValue)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return undefined
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function firstGaugeValue(result: ProcessResult | undefined, name: string): Numberish | undefined {
|
|
40
|
-
if (!result) {
|
|
41
|
-
return undefined
|
|
42
|
-
}
|
|
43
|
-
for (const gauge of result.gauges) {
|
|
44
|
-
if (gauge.metadata?.name === name) {
|
|
45
|
-
return MetricValueToNumber(gauge.metricValue)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return undefined
|
|
49
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { GameWalletProcessor } from './types/game_wallet_processor'
|
|
2
|
-
|
|
3
|
-
GameWalletProcessor.bind({ address: 'F78NhTC9XmP1DKsCBRz5LGdQc4n4yFbj2dURiv7T9gGZ' })
|
|
4
|
-
.onDistributeWithoutUser((payload, ctx) => {
|
|
5
|
-
const amount = payload.amount.toNumber()
|
|
6
|
-
ctx.meter.Counter('deposit_pool_total_value').add(amount)
|
|
7
|
-
ctx.meter.Counter('deposit_pool_current_value').add(amount)
|
|
8
|
-
ctx.meter.Counter('distribution_pool_total_value').sub(amount)
|
|
9
|
-
})
|
|
10
|
-
.onDeposit((payload, ctx) => {
|
|
11
|
-
const amount = payload.amount.toNumber()
|
|
12
|
-
ctx.meter.Counter('deposit_pool_total_value').add(amount)
|
|
13
|
-
ctx.meter.Counter('deposit_pool_current_value').add(amount)
|
|
14
|
-
})
|
|
15
|
-
.onWithdraw((payload, ctx) => {
|
|
16
|
-
const amount = payload.amount.toNumber()
|
|
17
|
-
ctx.meter.Counter('deposit_pool_total_value').add(amount)
|
|
18
|
-
ctx.meter.Counter('distribution_pool_total_value').sub(amount)
|
|
19
|
-
})
|
|
20
|
-
.onSpend((payload, ctx) => {
|
|
21
|
-
const amount = payload.amount.toNumber()
|
|
22
|
-
ctx.meter.Counter('deposit_pool_total_value').add(amount)
|
|
23
|
-
ctx.meter.Counter('distribution_pool_total_value').sub(amount)
|
|
24
|
-
})
|
|
25
|
-
.onDistribute((payload, ctx) => {
|
|
26
|
-
const amount = payload.amount.toNumber()
|
|
27
|
-
ctx.meter.Counter('deposit_pool_total_value').add(amount)
|
|
28
|
-
ctx.meter.Counter('deposit_pool_current_value').add(amount)
|
|
29
|
-
ctx.meter.Counter('distribution_pool_total_value').sub(amount)
|
|
30
|
-
})
|
|
31
|
-
.onSpendWithoutUser((payload, ctx) => {
|
|
32
|
-
const amount = payload.amount.toNumber()
|
|
33
|
-
ctx.meter.Counter('deposit_pool_total_value').add(amount)
|
|
34
|
-
ctx.meter.Counter('deposit_pool_current_value').sub(amount)
|
|
35
|
-
})
|
|
36
|
-
.onAddDistributeSupply((payload, ctx) => {
|
|
37
|
-
const amount = payload.amount.toNumber()
|
|
38
|
-
ctx.meter.Counter('distribution_pool_total_value').add(amount)
|
|
39
|
-
})
|
|
40
|
-
.startSlot(142700000)
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// TODO move out of this package
|
|
2
|
-
|
|
3
|
-
import { expect } from 'chai'
|
|
4
|
-
|
|
5
|
-
import { HandlerType, ProcessInstructionsRequest } from '..'
|
|
6
|
-
|
|
7
|
-
import Long from 'long'
|
|
8
|
-
import { TextEncoder } from 'util'
|
|
9
|
-
import { TestProcessorServer } from './test-processor-server'
|
|
10
|
-
import { firstCounterValue } from './metric-utils'
|
|
11
|
-
|
|
12
|
-
describe('Test Solana Example', () => {
|
|
13
|
-
const service = new TestProcessorServer(() => {
|
|
14
|
-
require('./mirrorworld')
|
|
15
|
-
require('./wormhole-token-bridge')
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
beforeAll(async () => {
|
|
19
|
-
await service.start({ templateInstances: [] })
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
test('check configuration ', async () => {
|
|
23
|
-
const config = await service.getConfig({})
|
|
24
|
-
expect(config.contractConfigs).length(3)
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
test('Check mirrorworld instruction dispatch', async () => {
|
|
28
|
-
const request: ProcessInstructionsRequest = {
|
|
29
|
-
instructions: [
|
|
30
|
-
{
|
|
31
|
-
instructionData: 'CACadoFwjNvan4GP8gh3Jtm1qdeoKX5j2SbSNEiB',
|
|
32
|
-
slot: Long.fromNumber(0),
|
|
33
|
-
programAccountId: 'F78NhTC9XmP1DKsCBRz5LGdQc4n4yFbj2dURiv7T9gGZ',
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
}
|
|
37
|
-
const res = await service.processInstructions(request)
|
|
38
|
-
expect(res.result?.counters).length(3)
|
|
39
|
-
expect(res.result?.gauges).length(0)
|
|
40
|
-
expect(firstCounterValue(res.result, 'deposit_pool_total_value')).equal(5000000000n)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
test('Check wormhole token bridge instruction dispatch', async () => {
|
|
44
|
-
const request: ProcessInstructionsRequest = {
|
|
45
|
-
instructions: [
|
|
46
|
-
{
|
|
47
|
-
instructionData: '33G5T8yXAQWdH8FX7fTy1mBJ6e4dUKfQWbViSrT7qJjpS8UAA3ftEQx9sNzrkaJm56xtENhDsWf',
|
|
48
|
-
slot: Long.fromNumber(0),
|
|
49
|
-
programAccountId: 'wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
instructionData: '33G5T8yXAQWdH8FX7fTy1mBJ6e4dUKfQWbViSrT7qJjpS8UAA3ftEQx9sNzrkaJm56xtENhDsWf',
|
|
53
|
-
slot: Long.fromNumber(1),
|
|
54
|
-
programAccountId: 'wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb',
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
}
|
|
58
|
-
const res = await service.processInstructions(request)
|
|
59
|
-
expect(res.result?.counters).length(2)
|
|
60
|
-
expect(res.result?.gauges).length(0)
|
|
61
|
-
expect(res.result?.counters[0].metadata?.blockNumber.toInt()).equal(0)
|
|
62
|
-
expect(firstCounterValue(res.result, 'total_transfer_amount')).equal(1000000n)
|
|
63
|
-
expect(res.result?.counters[0].runtimeInfo?.from).equals(HandlerType.INSTRUCTION)
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
test('Check SPLToken parsed instruction dispatch', async () => {
|
|
67
|
-
const parsedIns = {
|
|
68
|
-
info: {
|
|
69
|
-
account: '2SDN4vEJdCdW3pGyhx2km9gB3LeHzMGLrG2j4uVNZfrx',
|
|
70
|
-
amount: '12000000000000',
|
|
71
|
-
mint: '7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs',
|
|
72
|
-
mintAuthority: 'BCD75RNBHrJJpW4dXVagL5mPjzRLnVZq4YirJdjEYMV7',
|
|
73
|
-
},
|
|
74
|
-
type: 'mintTo',
|
|
75
|
-
}
|
|
76
|
-
const request: ProcessInstructionsRequest = {
|
|
77
|
-
instructions: [
|
|
78
|
-
{
|
|
79
|
-
instructionData: '',
|
|
80
|
-
slot: Long.fromNumber(0),
|
|
81
|
-
programAccountId: 'wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb',
|
|
82
|
-
parsed: new TextEncoder().encode(JSON.stringify(parsedIns)),
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
}
|
|
86
|
-
const res = await service.processInstructions(request)
|
|
87
|
-
expect(res.result?.counters).length(1)
|
|
88
|
-
expect(res.result?.gauges).length(0)
|
|
89
|
-
expect(res.result?.counters[0].metadata?.blockNumber.toInt()).equal(0)
|
|
90
|
-
expect(firstCounterValue(res.result, 'totalWeth_supply')).equal(12000000000000)
|
|
91
|
-
expect(res.result?.counters[0].runtimeInfo?.from).equals(HandlerType.INSTRUCTION)
|
|
92
|
-
})
|
|
93
|
-
})
|