@sentio/sdk 1.13.1 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli/commands/run-create.js +2 -0
- package/lib/cli/commands/run-create.js.map +1 -1
- package/lib/gen/processor/protos/processor.d.ts +0 -1
- package/lib/gen/processor/protos/processor.js +0 -10
- package/lib/gen/processor/protos/processor.js.map +1 -1
- package/lib/meter.js +0 -5
- package/lib/meter.js.map +1 -1
- package/lib/test/metric-utils.js +2 -2
- package/lib/test/metric-utils.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/commands/run-create.ts +3 -0
- package/src/gen/processor/protos/processor.ts +0 -11
- package/src/meter.ts +0 -5
- package/src/test/metric-utils.ts +2 -2
- 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,6 +0,0 @@
|
|
|
1
|
-
import { Provider, StaticJsonRpcProvider } from '@ethersproject/providers';
|
|
2
|
-
import { Networkish } from '@ethersproject/networks';
|
|
3
|
-
import { ChainConfig } from './chain-config';
|
|
4
|
-
export declare const DummyProvider: StaticJsonRpcProvider;
|
|
5
|
-
export declare function getProvider(networkish?: Networkish): Provider;
|
|
6
|
-
export declare function setProvider(config: Record<string, ChainConfig>, concurrency?: number, useChainServer?: boolean): void;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.setProvider = exports.getProvider = exports.DummyProvider = void 0;
|
|
7
|
-
const providers_1 = require("@ethersproject/providers");
|
|
8
|
-
const p_queue_1 = __importDefault(require("p-queue"));
|
|
9
|
-
exports.DummyProvider = new providers_1.StaticJsonRpcProvider(undefined, 1);
|
|
10
|
-
function getProvider(networkish) {
|
|
11
|
-
if (!networkish) {
|
|
12
|
-
networkish = 1;
|
|
13
|
-
}
|
|
14
|
-
const network = (0, providers_1.getNetwork)(networkish);
|
|
15
|
-
if (!global.PROCESSOR_STATE.providers) {
|
|
16
|
-
throw Error('Provider not set');
|
|
17
|
-
}
|
|
18
|
-
const value = global.PROCESSOR_STATE.providers.get(network.chainId);
|
|
19
|
-
if (value === undefined) {
|
|
20
|
-
throw Error('Provider not found for chain ' +
|
|
21
|
-
network.chainId +
|
|
22
|
-
', configured chains: ' +
|
|
23
|
-
[...global.PROCESSOR_STATE.providers.keys()].join(' '));
|
|
24
|
-
}
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
exports.getProvider = getProvider;
|
|
28
|
-
function setProvider(config, concurrency = 4, useChainServer = false) {
|
|
29
|
-
global.PROCESSOR_STATE.providers = new Map();
|
|
30
|
-
for (const chainIdStr in config) {
|
|
31
|
-
if (isNaN(Number.parseInt(chainIdStr))) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
const chainConfig = config[chainIdStr];
|
|
35
|
-
const chainId = Number(chainIdStr);
|
|
36
|
-
// let providers: StaticJsonRpcProvider[] = []
|
|
37
|
-
// for (const http of chainConfig.Https) {
|
|
38
|
-
// providers.push(new StaticJsonRpcProvider(http, chainId))
|
|
39
|
-
// }
|
|
40
|
-
// random shuffle
|
|
41
|
-
// providers = providers.sort(() => Math.random() - 0.5)
|
|
42
|
-
// const provider = new FallbackProvider(providers)
|
|
43
|
-
let rpcAddress = '';
|
|
44
|
-
if (useChainServer && chainConfig.ChainServer) {
|
|
45
|
-
rpcAddress = chainConfig.ChainServer;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
const idx = Math.floor(Math.random() * chainConfig.Https.length);
|
|
49
|
-
rpcAddress = chainConfig.Https[idx];
|
|
50
|
-
}
|
|
51
|
-
const provider = new QueuedStaticJsonRpcProvider(rpcAddress, chainId, concurrency);
|
|
52
|
-
global.PROCESSOR_STATE.providers.set(chainId, provider);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.setProvider = setProvider;
|
|
56
|
-
class QueuedStaticJsonRpcProvider extends providers_1.StaticJsonRpcProvider {
|
|
57
|
-
executor;
|
|
58
|
-
constructor(url, network, concurrency) {
|
|
59
|
-
super(url, network);
|
|
60
|
-
this.executor = new p_queue_1.default({ concurrency: concurrency });
|
|
61
|
-
}
|
|
62
|
-
send(method, params) {
|
|
63
|
-
return this.executor.add(() => super.send(method, params));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAsF;AAEtF,sDAA4B;AAIf,QAAA,aAAa,GAAG,IAAI,iCAAqB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AAEpE,SAAgB,WAAW,CAAC,UAAuB;IACjD,IAAI,CAAC,UAAU,EAAE;QACf,UAAU,GAAG,CAAC,CAAA;KACf;IACD,MAAM,OAAO,GAAG,IAAA,sBAAU,EAAC,UAAU,CAAC,CAAA;IAEtC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE;QACrC,MAAM,KAAK,CAAC,kBAAkB,CAAC,CAAA;KAChC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACnE,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,MAAM,KAAK,CACT,+BAA+B;YAC7B,OAAO,CAAC,OAAO;YACf,uBAAuB;YACvB,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACzD,CAAA;KACF;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAnBD,kCAmBC;AAED,SAAgB,WAAW,CAAC,MAAmC,EAAE,WAAW,GAAG,CAAC,EAAE,cAAc,GAAG,KAAK;IACtG,MAAM,CAAC,eAAe,CAAC,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAA;IAE9D,KAAK,MAAM,UAAU,IAAI,MAAM,EAAE;Q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M,CAAC,CAAC,CAAA;IAC5D,CAAC;CACF","sourcesContent":["import { getNetwork, Provider, StaticJsonRpcProvider } from '@ethersproject/providers'\nimport { Networkish } from '@ethersproject/networks'\nimport PQueue from 'p-queue'\nimport { ConnectionInfo } from '@ethersproject/web'\nimport { ChainConfig } from './chain-config'\n\nexport const DummyProvider = new StaticJsonRpcProvider(undefined, 1)\n\nexport function getProvider(networkish?: Networkish): Provider {\n if (!networkish) {\n networkish = 1\n }\n const network = getNetwork(networkish)\n\n if (!global.PROCESSOR_STATE.providers) {\n throw Error('Provider not set')\n }\n const value = global.PROCESSOR_STATE.providers.get(network.chainId)\n if (value === undefined) {\n throw Error(\n 'Provider not found for chain ' +\n network.chainId +\n ', configured chains: ' +\n [...global.PROCESSOR_STATE.providers.keys()].join(' ')\n )\n }\n return value\n}\n\nexport function setProvider(config: Record<string, ChainConfig>, concurrency = 4, useChainServer = false) {\n global.PROCESSOR_STATE.providers = new Map<number, Provider>()\n\n for (const chainIdStr in config) {\n if (isNaN(Number.parseInt(chainIdStr))) {\n continue\n }\n\n const chainConfig = config[chainIdStr]\n const chainId = Number(chainIdStr)\n\n // let providers: StaticJsonRpcProvider[] = []\n // for (const http of chainConfig.Https) {\n // providers.push(new StaticJsonRpcProvider(http, chainId))\n // }\n // random shuffle\n // providers = providers.sort(() => Math.random() - 0.5)\n\n // const provider = new FallbackProvider(providers)\n\n let rpcAddress = ''\n if (useChainServer && chainConfig.ChainServer) {\n rpcAddress = chainConfig.ChainServer\n } else {\n const idx = Math.floor(Math.random() * chainConfig.Https.length)\n rpcAddress = chainConfig.Https[idx]\n }\n\n const provider = new QueuedStaticJsonRpcProvider(rpcAddress, chainId, concurrency)\n global.PROCESSOR_STATE.providers.set(chainId, provider)\n }\n}\n\nclass QueuedStaticJsonRpcProvider extends StaticJsonRpcProvider {\n executor: PQueue\n\n constructor(url: ConnectionInfo | string, network: Networkish, concurrency: number) {\n super(url, network)\n this.executor = new PQueue({ concurrency: concurrency })\n }\n\n send(method: string, params: Array<any>): Promise<any> {\n return this.executor.add(() => super.send(method, params))\n }\n}\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
// branches: ['release', { name: 'main', prerelease: 'rc' }],
|
|
3
|
-
branches: ['main'],
|
|
4
|
-
plugins: [
|
|
5
|
-
[
|
|
6
|
-
'@semantic-release/commit-analyzer',
|
|
7
|
-
{
|
|
8
|
-
preset: 'angular',
|
|
9
|
-
releaseRules: [
|
|
10
|
-
{ type: 'release', "scope": 'major', release: 'major' },
|
|
11
|
-
{ type: 'release', "scope": 'minor', release: 'minor' },
|
|
12
|
-
{ type: 'release', "scope": 'patch', release: 'patch' },
|
|
13
|
-
{ type: 'chore', release: 'patch' },
|
|
14
|
-
{ type: 'refactor', release: 'patch' },
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
["@semantic-release/npm", {
|
|
19
|
-
// "pkgRoot": "dist"
|
|
20
|
-
}],
|
|
21
|
-
'@semantic-release/release-notes-generator',
|
|
22
|
-
[
|
|
23
|
-
'@semantic-release/github',
|
|
24
|
-
{
|
|
25
|
-
successComment: false,
|
|
26
|
-
labels: false,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
// ['@semantic-release/exec', { publishCmd: 'echo "::set-output name=release_version::${nextRelease.version}"' }],
|
|
30
|
-
],
|
|
31
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CallContext } from 'nice-grpc';
|
|
2
|
-
import { BlockBinding, ProcessResult, ProcessBlocksRequest, ProcessBlocksResponse, ProcessConfigRequest, ProcessConfigResponse, ProcessInstructionsRequest, ProcessInstructionsResponse, ProcessLogsRequest, ProcessLogsResponse, ProcessorServiceImplementation, ProcessTracesRequest, ProcessTracesResponse, ProcessTransactionsRequest, ProcessTransactionsResponse, StartRequest, TraceBinding } from './gen/processor/protos/processor';
|
|
3
|
-
import { Empty } from './gen/google/protobuf/empty';
|
|
4
|
-
export declare class ProcessorServiceImpl implements ProcessorServiceImplementation {
|
|
5
|
-
private eventHandlers;
|
|
6
|
-
private traceHandlers;
|
|
7
|
-
private blockHandlers;
|
|
8
|
-
private started;
|
|
9
|
-
private contractConfigs;
|
|
10
|
-
private templateInstances;
|
|
11
|
-
private readonly loader;
|
|
12
|
-
private readonly shutdownHandler?;
|
|
13
|
-
constructor(loader: () => void, shutdownHandler?: () => void);
|
|
14
|
-
getConfig(request: ProcessConfigRequest, context: CallContext): Promise<ProcessConfigResponse>;
|
|
15
|
-
configure(): Promise<void>;
|
|
16
|
-
start(request: StartRequest, context: CallContext): Promise<Empty>;
|
|
17
|
-
stop(request: Empty, context: CallContext): Promise<Empty>;
|
|
18
|
-
processLogs(request: ProcessLogsRequest, context: CallContext): Promise<ProcessLogsResponse>;
|
|
19
|
-
processTransactions(request: ProcessTransactionsRequest, context: CallContext): Promise<ProcessTransactionsResponse>;
|
|
20
|
-
processInstructions(request: ProcessInstructionsRequest, context: CallContext): Promise<ProcessInstructionsResponse>;
|
|
21
|
-
processBlocks(request: ProcessBlocksRequest, context: CallContext): Promise<ProcessBlocksResponse>;
|
|
22
|
-
processBlock(binding: BlockBinding): Promise<ProcessResult>;
|
|
23
|
-
processTraces(request: ProcessTracesRequest, context: CallContext): Promise<ProcessTracesResponse>;
|
|
24
|
-
processTrace(binding: TraceBinding): Promise<ProcessResult>;
|
|
25
|
-
}
|
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ProcessorServiceImpl = void 0;
|
|
7
|
-
const nice_grpc_1 = require("nice-grpc");
|
|
8
|
-
const processor_1 = require("./gen/processor/protos/processor");
|
|
9
|
-
const long_1 = __importDefault(require("long"));
|
|
10
|
-
const util_1 = require("util");
|
|
11
|
-
const DEFAULT_MAX_BLOCK = long_1.default.ZERO;
|
|
12
|
-
class ProcessorServiceImpl {
|
|
13
|
-
eventHandlers = [];
|
|
14
|
-
traceHandlers = [];
|
|
15
|
-
blockHandlers = [];
|
|
16
|
-
// map from chain id to list of processors
|
|
17
|
-
// private blockHandlers = new Map<string, ((block: Block) => Promise<ProcessResult>)[]>()
|
|
18
|
-
// private processorsByChainId = new Map<string, BaseProcessor<BaseContract, BoundContractView<BaseContract, any>>>()
|
|
19
|
-
started = false;
|
|
20
|
-
contractConfigs;
|
|
21
|
-
templateInstances;
|
|
22
|
-
loader;
|
|
23
|
-
shutdownHandler;
|
|
24
|
-
constructor(loader, shutdownHandler) {
|
|
25
|
-
this.loader = loader;
|
|
26
|
-
this.shutdownHandler = shutdownHandler;
|
|
27
|
-
}
|
|
28
|
-
async getConfig(request, context) {
|
|
29
|
-
if (!this.started) {
|
|
30
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.UNAVAILABLE, 'Service Not started.');
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
// TODO project setting
|
|
34
|
-
config: undefined,
|
|
35
|
-
contractConfigs: this.contractConfigs,
|
|
36
|
-
templateInstances: this.templateInstances,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
async configure() {
|
|
40
|
-
this.eventHandlers = [];
|
|
41
|
-
this.templateInstances = [];
|
|
42
|
-
// this.processorsByChainId.clear()
|
|
43
|
-
this.contractConfigs = [];
|
|
44
|
-
this.templateInstances = [...global.PROCESSOR_STATE.templatesInstances];
|
|
45
|
-
// Part 1, prepare EVM processors
|
|
46
|
-
for (const processor of global.PROCESSOR_STATE.processors) {
|
|
47
|
-
// If server favor incremental update this need to change
|
|
48
|
-
// Start basic config for contract
|
|
49
|
-
const chainId = processor.getChainId();
|
|
50
|
-
// this.processorsByChainId.set(chainId, processor)
|
|
51
|
-
const contractConfig = {
|
|
52
|
-
processorType: 'user_processor',
|
|
53
|
-
contract: {
|
|
54
|
-
name: processor.config.name,
|
|
55
|
-
chainId: chainId.toString(),
|
|
56
|
-
address: processor.config.address,
|
|
57
|
-
abi: '',
|
|
58
|
-
},
|
|
59
|
-
blockConfigs: [],
|
|
60
|
-
logConfigs: [],
|
|
61
|
-
traceConfigs: [],
|
|
62
|
-
startBlock: processor.config.startBlock,
|
|
63
|
-
endBlock: DEFAULT_MAX_BLOCK,
|
|
64
|
-
instructionConfig: undefined,
|
|
65
|
-
};
|
|
66
|
-
if (processor.config.endBlock) {
|
|
67
|
-
contractConfig.endBlock = processor.config.endBlock;
|
|
68
|
-
}
|
|
69
|
-
// Step 1. Prepare all the block handlers
|
|
70
|
-
for (const blockHandler of processor.blockHandlers) {
|
|
71
|
-
const handlerId = this.blockHandlers.push(blockHandler) - 1;
|
|
72
|
-
contractConfig.blockConfigs.push({
|
|
73
|
-
handlerId: handlerId,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
// Step 2. Prepare all trace handlers
|
|
77
|
-
for (const traceHandler of processor.traceHandlers) {
|
|
78
|
-
const handlerId = this.traceHandlers.push(traceHandler.handler) - 1;
|
|
79
|
-
contractConfig.traceConfigs.push({
|
|
80
|
-
signature: traceHandler.signature,
|
|
81
|
-
handlerId: handlerId,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
// Step 3. Prepare all the event handlers
|
|
85
|
-
for (const eventsHandler of processor.eventHandlers) {
|
|
86
|
-
// associate id with filter
|
|
87
|
-
const handlerId = this.eventHandlers.push(eventsHandler.handler) - 1;
|
|
88
|
-
const logConfig = {
|
|
89
|
-
handlerId: handlerId,
|
|
90
|
-
filters: [],
|
|
91
|
-
};
|
|
92
|
-
for (const filter of eventsHandler.filters) {
|
|
93
|
-
if (!filter.topics) {
|
|
94
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INVALID_ARGUMENT, 'Topic should not be null');
|
|
95
|
-
}
|
|
96
|
-
const logFilter = {
|
|
97
|
-
topics: [],
|
|
98
|
-
};
|
|
99
|
-
for (const ts of filter.topics) {
|
|
100
|
-
let hashes = [];
|
|
101
|
-
if (Array.isArray(ts)) {
|
|
102
|
-
hashes = hashes.concat(ts);
|
|
103
|
-
}
|
|
104
|
-
else if (ts) {
|
|
105
|
-
hashes.push(ts);
|
|
106
|
-
}
|
|
107
|
-
logFilter.topics.push({ hashes: hashes });
|
|
108
|
-
}
|
|
109
|
-
logConfig.filters.push(logFilter);
|
|
110
|
-
}
|
|
111
|
-
contractConfig.logConfigs.push(logConfig);
|
|
112
|
-
}
|
|
113
|
-
// Finish up a contract
|
|
114
|
-
this.contractConfigs.push(contractConfig);
|
|
115
|
-
}
|
|
116
|
-
// Part 2, prepare solana constractors
|
|
117
|
-
for (const solanaProcessor of global.PROCESSOR_STATE.solanaProcessors) {
|
|
118
|
-
const contractConfig = {
|
|
119
|
-
processorType: 'user_processor',
|
|
120
|
-
contract: {
|
|
121
|
-
name: solanaProcessor.contractName,
|
|
122
|
-
chainId: 'SOL_mainnet',
|
|
123
|
-
address: solanaProcessor.address,
|
|
124
|
-
abi: '',
|
|
125
|
-
},
|
|
126
|
-
blockConfigs: [],
|
|
127
|
-
logConfigs: [],
|
|
128
|
-
traceConfigs: [],
|
|
129
|
-
startBlock: solanaProcessor.config.startSlot,
|
|
130
|
-
endBlock: DEFAULT_MAX_BLOCK,
|
|
131
|
-
instructionConfig: {
|
|
132
|
-
innerInstruction: solanaProcessor.processInnerInstruction,
|
|
133
|
-
parsedInstruction: solanaProcessor.fromParsedInstruction !== null,
|
|
134
|
-
rawDataInstruction: solanaProcessor.decodeInstruction !== null,
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
this.contractConfigs.push(contractConfig);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
async start(request, context) {
|
|
141
|
-
if (this.started) {
|
|
142
|
-
return {};
|
|
143
|
-
}
|
|
144
|
-
this.loader();
|
|
145
|
-
for (const instance of request.templateInstances) {
|
|
146
|
-
const template = global.PROCESSOR_STATE.templates[instance.templateId];
|
|
147
|
-
if (!template) {
|
|
148
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INVALID_ARGUMENT, 'Invalid template contract:' + instance);
|
|
149
|
-
}
|
|
150
|
-
if (!instance.contract) {
|
|
151
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INVALID_ARGUMENT, 'Contract Empty from:' + instance);
|
|
152
|
-
}
|
|
153
|
-
template.bind({
|
|
154
|
-
name: instance.contract.name,
|
|
155
|
-
address: instance.contract.address,
|
|
156
|
-
network: Number(instance.contract.chainId),
|
|
157
|
-
startBlock: instance.startBlock,
|
|
158
|
-
endBlock: instance.endBlock,
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
await this.configure();
|
|
162
|
-
this.started = true;
|
|
163
|
-
return {};
|
|
164
|
-
}
|
|
165
|
-
async stop(request, context) {
|
|
166
|
-
console.log('Server Shutting down in 5 seconds');
|
|
167
|
-
if (this.shutdownHandler) {
|
|
168
|
-
setTimeout(this.shutdownHandler, 5000);
|
|
169
|
-
}
|
|
170
|
-
return {};
|
|
171
|
-
}
|
|
172
|
-
async processLogs(request, context) {
|
|
173
|
-
if (!this.started) {
|
|
174
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.UNAVAILABLE, 'Service Not started.');
|
|
175
|
-
}
|
|
176
|
-
const resp = {
|
|
177
|
-
gauges: [],
|
|
178
|
-
counters: [],
|
|
179
|
-
logs: [],
|
|
180
|
-
};
|
|
181
|
-
const promises = [];
|
|
182
|
-
for (const l of request.logBindings) {
|
|
183
|
-
if (!l.log) {
|
|
184
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INVALID_ARGUMENT, "Log can't be null");
|
|
185
|
-
}
|
|
186
|
-
// const jsonString = Buffer.from(l.log.raw.buffer).toString("utf-8")
|
|
187
|
-
// const jsonString = String.fromCharCode.apply(null, l.log.raw)
|
|
188
|
-
try {
|
|
189
|
-
const jsonString = Utf8ArrayToStr(l.log.raw);
|
|
190
|
-
const log = JSON.parse(jsonString);
|
|
191
|
-
const handler = this.eventHandlers[l.handlerId];
|
|
192
|
-
const promise = handler(log).catch((e) => {
|
|
193
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INTERNAL, 'error processing log: ' + jsonString + '\n' + e.toString());
|
|
194
|
-
});
|
|
195
|
-
promises.push(promise);
|
|
196
|
-
}
|
|
197
|
-
catch (e) {
|
|
198
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INTERNAL, 'error parse log: ' + l);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
const results = await Promise.all(promises);
|
|
202
|
-
for (const res of results) {
|
|
203
|
-
resp.counters = resp.counters.concat(res.counters);
|
|
204
|
-
resp.gauges = resp.gauges.concat(res.gauges);
|
|
205
|
-
}
|
|
206
|
-
let updated = false;
|
|
207
|
-
if (global.PROCESSOR_STATE.templatesInstances &&
|
|
208
|
-
this.templateInstances.length != global.PROCESSOR_STATE.templatesInstances.length) {
|
|
209
|
-
await this.configure();
|
|
210
|
-
updated = true;
|
|
211
|
-
}
|
|
212
|
-
recordRuntimeInfo(resp, processor_1.HandlerType.LOG);
|
|
213
|
-
return {
|
|
214
|
-
result: resp,
|
|
215
|
-
configUpdated: updated,
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
async processTransactions(request, context) {
|
|
219
|
-
if (!this.started) {
|
|
220
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.UNAVAILABLE, 'Service not started.');
|
|
221
|
-
}
|
|
222
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.UNIMPLEMENTED, 'Processing transaction is not suppored.');
|
|
223
|
-
}
|
|
224
|
-
async processInstructions(request, context) {
|
|
225
|
-
if (!this.started) {
|
|
226
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.UNAVAILABLE, 'Service not started.');
|
|
227
|
-
}
|
|
228
|
-
const result = {
|
|
229
|
-
gauges: [],
|
|
230
|
-
counters: [],
|
|
231
|
-
logs: [],
|
|
232
|
-
};
|
|
233
|
-
// Only have instruction handlers for solana processors
|
|
234
|
-
if (global.PROCESSOR_STATE.solanaProcessors) {
|
|
235
|
-
const processorPromises = [];
|
|
236
|
-
for (const instruction of request.instructions) {
|
|
237
|
-
if (!instruction) {
|
|
238
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INVALID_ARGUMENT, 'instruction cannot be null');
|
|
239
|
-
}
|
|
240
|
-
processorPromises.push(new Promise((resolve, _) => {
|
|
241
|
-
for (const processor of global.PROCESSOR_STATE.solanaProcessors) {
|
|
242
|
-
if (processor.address === instruction.programAccountId) {
|
|
243
|
-
let res;
|
|
244
|
-
if (instruction.parsed) {
|
|
245
|
-
res = processor.handleInstruction(JSON.parse(new util_1.TextDecoder().decode(instruction.parsed)));
|
|
246
|
-
}
|
|
247
|
-
else if (instruction.instructionData) {
|
|
248
|
-
res = processor.handleInstruction(instruction.instructionData);
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
if (res) {
|
|
254
|
-
try {
|
|
255
|
-
res.gauges.forEach((g) => {
|
|
256
|
-
if (g.metadata) {
|
|
257
|
-
g.metadata.blockNumber = instruction.slot;
|
|
258
|
-
}
|
|
259
|
-
result.gauges.push(g);
|
|
260
|
-
});
|
|
261
|
-
res.counters.forEach((c) => {
|
|
262
|
-
if (c.metadata) {
|
|
263
|
-
c.metadata.blockNumber = instruction.slot;
|
|
264
|
-
}
|
|
265
|
-
result.counters.push(c);
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
catch (e) {
|
|
269
|
-
console.error('error processing instruction ' + e.toString());
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
console.warn(`Failed to decode the instruction: ${instruction.instructionData} with slot: ${instruction.slot}`);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
resolve();
|
|
278
|
-
}));
|
|
279
|
-
}
|
|
280
|
-
await Promise.all(processorPromises);
|
|
281
|
-
}
|
|
282
|
-
recordRuntimeInfo(result, processor_1.HandlerType.INSTRUCTION);
|
|
283
|
-
return {
|
|
284
|
-
result,
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
async processBlocks(request, context) {
|
|
288
|
-
if (!this.started) {
|
|
289
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.UNAVAILABLE, 'Service Not started.');
|
|
290
|
-
}
|
|
291
|
-
const promises = request.blockBindings.map((binding) => this.processBlock(binding));
|
|
292
|
-
const results = await Promise.all(promises);
|
|
293
|
-
const res = processor_1.ProcessResult.fromPartial({});
|
|
294
|
-
for (const r of results) {
|
|
295
|
-
res.counters = res.counters.concat(r.counters);
|
|
296
|
-
res.gauges = res.gauges.concat(r.gauges);
|
|
297
|
-
}
|
|
298
|
-
recordRuntimeInfo(res, processor_1.HandlerType.BLOCK);
|
|
299
|
-
return {
|
|
300
|
-
result: res,
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
async processBlock(binding) {
|
|
304
|
-
if (!binding.block) {
|
|
305
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INVALID_ARGUMENT, "Block can't be empty");
|
|
306
|
-
}
|
|
307
|
-
const jsonString = Utf8ArrayToStr(binding.block.raw);
|
|
308
|
-
const block = JSON.parse(jsonString);
|
|
309
|
-
const resp = {
|
|
310
|
-
gauges: [],
|
|
311
|
-
counters: [],
|
|
312
|
-
logs: [],
|
|
313
|
-
};
|
|
314
|
-
const promises = [];
|
|
315
|
-
for (const handlerId of binding.handlerIds) {
|
|
316
|
-
const promise = this.blockHandlers[handlerId](block).catch((e) => {
|
|
317
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INTERNAL, 'error processing block: ' + block.number + '\n' + e.toString());
|
|
318
|
-
});
|
|
319
|
-
promises.push(promise);
|
|
320
|
-
}
|
|
321
|
-
const allRes = await Promise.all(promises);
|
|
322
|
-
for (const res of allRes) {
|
|
323
|
-
resp.counters = resp.counters.concat(res.counters);
|
|
324
|
-
resp.gauges = resp.gauges.concat(res.gauges);
|
|
325
|
-
}
|
|
326
|
-
return resp;
|
|
327
|
-
}
|
|
328
|
-
async processTraces(request, context) {
|
|
329
|
-
if (!this.started) {
|
|
330
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.UNAVAILABLE, 'Service Not started.');
|
|
331
|
-
}
|
|
332
|
-
const promises = request.traceBindings.map((binding) => this.processTrace(binding));
|
|
333
|
-
const results = await Promise.all(promises);
|
|
334
|
-
const res = processor_1.ProcessResult.fromPartial({});
|
|
335
|
-
for (const r of results) {
|
|
336
|
-
res.counters = res.counters.concat(r.counters);
|
|
337
|
-
res.gauges = res.gauges.concat(r.gauges);
|
|
338
|
-
}
|
|
339
|
-
recordRuntimeInfo(res, processor_1.HandlerType.TRACE);
|
|
340
|
-
return {
|
|
341
|
-
result: res,
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
async processTrace(binding) {
|
|
345
|
-
if (!binding.trace) {
|
|
346
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INVALID_ARGUMENT, "Trace can't be empty");
|
|
347
|
-
}
|
|
348
|
-
const jsonString = Utf8ArrayToStr(binding.trace.raw);
|
|
349
|
-
const trace = JSON.parse(jsonString);
|
|
350
|
-
return this.traceHandlers[binding.handlerId](trace).catch((e) => {
|
|
351
|
-
throw new nice_grpc_1.ServerError(nice_grpc_1.Status.INTERNAL, 'error processing trace: ' + jsonString + '\n' + e.toString());
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
exports.ProcessorServiceImpl = ProcessorServiceImpl;
|
|
356
|
-
// https://ourcodeworld.com/articles/read/164/how-to-convert-an-uint8array-to-string-in-javascript
|
|
357
|
-
/* eslint-disable */
|
|
358
|
-
function Utf8ArrayToStr(array) {
|
|
359
|
-
let out, i, len, c;
|
|
360
|
-
let char2, char3;
|
|
361
|
-
out = '';
|
|
362
|
-
len = array.length;
|
|
363
|
-
i = 0;
|
|
364
|
-
while (i < len) {
|
|
365
|
-
c = array[i++];
|
|
366
|
-
switch (c >> 4) {
|
|
367
|
-
case 0:
|
|
368
|
-
case 1:
|
|
369
|
-
case 2:
|
|
370
|
-
case 3:
|
|
371
|
-
case 4:
|
|
372
|
-
case 5:
|
|
373
|
-
case 6:
|
|
374
|
-
case 7:
|
|
375
|
-
// 0xxxxxxx
|
|
376
|
-
out += String.fromCharCode(c);
|
|
377
|
-
break;
|
|
378
|
-
case 12:
|
|
379
|
-
case 13:
|
|
380
|
-
// 110x xxxx 10xx xxxx
|
|
381
|
-
char2 = array[i++];
|
|
382
|
-
out += String.fromCharCode(((c & 0x1f) << 6) | (char2 & 0x3f));
|
|
383
|
-
break;
|
|
384
|
-
case 14:
|
|
385
|
-
// 1110 xxxx 10xx xxxx 10xx xxxx
|
|
386
|
-
char2 = array[i++];
|
|
387
|
-
char3 = array[i++];
|
|
388
|
-
out += String.fromCharCode(((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0));
|
|
389
|
-
break;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
return out;
|
|
393
|
-
}
|
|
394
|
-
function recordRuntimeInfo(results, handlerType) {
|
|
395
|
-
results.gauges.forEach((e) => {
|
|
396
|
-
e.runtimeInfo = {
|
|
397
|
-
from: handlerType,
|
|
398
|
-
};
|
|
399
|
-
});
|
|
400
|
-
results.counters.forEach((e) => {
|
|
401
|
-
e.runtimeInfo = {
|
|
402
|
-
from: handlerType,
|
|
403
|
-
};
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
//# sourceMappingURL=service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";;;;;;AACA,yCAA4D;AAE5D,gEAuByC;AAGzC,gDAAuB;AACvB,+BAAkC;AAGlC,MAAM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SAClB,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QAC7B,CAAC,CAAC,WAAW,GAAG;YACd,IAAI,EAAE,WAAW;SAClB,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { Block, Log } from '@ethersproject/abstract-provider'\nimport { CallContext, ServerError, Status } from 'nice-grpc'\n\nimport {\n BlockBinding,\n ContractConfig,\n HandlerType,\n LogFilter,\n LogHandlerConfig,\n ProcessResult,\n ProcessBlocksRequest,\n ProcessBlocksResponse,\n ProcessConfigRequest,\n ProcessConfigResponse,\n ProcessInstructionsRequest,\n ProcessInstructionsResponse,\n ProcessLogsRequest,\n ProcessLogsResponse,\n ProcessorServiceImplementation,\n ProcessTracesRequest,\n ProcessTracesResponse,\n ProcessTransactionsRequest,\n ProcessTransactionsResponse,\n StartRequest,\n TemplateInstance,\n TraceBinding,\n} from './gen/processor/protos/processor'\n\nimport { Empty } from './gen/google/protobuf/empty'\nimport Long from 'long'\nimport { TextDecoder } from 'util'\nimport { Trace } from './trace'\n\nconst DEFAULT_MAX_BLOCK = Long.ZERO\n\nexport class ProcessorServiceImpl implements ProcessorServiceImplementation {\n private eventHandlers: ((event: Log) => Promise<ProcessResult>)[] = []\n private traceHandlers: ((trace: Trace) => Promise<ProcessResult>)[] = []\n private blockHandlers: ((block: Block) => Promise<ProcessResult>)[] = []\n\n // map from chain id to list of processors\n // private blockHandlers = new Map<string, ((block: Block) => Promise<ProcessResult>)[]>()\n // private processorsByChainId = new Map<string, BaseProcessor<BaseContract, BoundContractView<BaseContract, any>>>()\n\n private started = false\n private contractConfigs: ContractConfig[]\n private templateInstances: TemplateInstance[]\n private readonly loader: () => void\n\n private readonly shutdownHandler?: () => void\n\n constructor(loader: () => void, shutdownHandler?: () => void) {\n this.loader = loader\n this.shutdownHandler = shutdownHandler\n }\n\n async getConfig(request: ProcessConfigRequest, context: CallContext): Promise<ProcessConfigResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n return {\n // TODO project setting\n config: undefined,\n contractConfigs: this.contractConfigs,\n templateInstances: this.templateInstances,\n }\n }\n\n async configure() {\n this.eventHandlers = []\n this.templateInstances = []\n // this.processorsByChainId.clear()\n this.contractConfigs = []\n\n this.templateInstances = [...global.PROCESSOR_STATE.templatesInstances]\n\n // Part 1, prepare EVM processors\n for (const processor of global.PROCESSOR_STATE.processors) {\n // If server favor incremental update this need to change\n // Start basic config for contract\n const chainId = processor.getChainId()\n // this.processorsByChainId.set(chainId, processor)\n\n const contractConfig: ContractConfig = {\n processorType: 'user_processor',\n contract: {\n name: processor.config.name,\n chainId: chainId.toString(),\n address: processor.config.address,\n abi: '',\n },\n blockConfigs: [],\n logConfigs: [],\n traceConfigs: [],\n startBlock: processor.config.startBlock,\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: undefined,\n }\n if (processor.config.endBlock) {\n contractConfig.endBlock = processor.config.endBlock\n }\n\n // Step 1. Prepare all the block handlers\n for (const blockHandler of processor.blockHandlers) {\n const handlerId = this.blockHandlers.push(blockHandler) - 1\n contractConfig.blockConfigs.push({\n handlerId: handlerId,\n })\n }\n\n // Step 2. Prepare all trace handlers\n for (const traceHandler of processor.traceHandlers) {\n const handlerId = this.traceHandlers.push(traceHandler.handler) - 1\n contractConfig.traceConfigs.push({\n signature: traceHandler.signature,\n handlerId: handlerId,\n })\n }\n\n // Step 3. Prepare all the event handlers\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = this.eventHandlers.push(eventsHandler.handler) - 1\n const logConfig: LogHandlerConfig = {\n handlerId: handlerId,\n filters: [],\n }\n\n for (const filter of eventsHandler.filters) {\n if (!filter.topics) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Topic should not be null')\n }\n const logFilter: LogFilter = {\n topics: [],\n }\n\n for (const ts of filter.topics) {\n let hashes: string[] = []\n if (Array.isArray(ts)) {\n hashes = hashes.concat(ts)\n } else if (ts) {\n hashes.push(ts)\n }\n logFilter.topics.push({ hashes: hashes })\n }\n logConfig.filters.push(logFilter)\n }\n contractConfig.logConfigs.push(logConfig)\n }\n\n // Finish up a contract\n this.contractConfigs.push(contractConfig)\n }\n\n // Part 2, prepare solana constractors\n for (const solanaProcessor of global.PROCESSOR_STATE.solanaProcessors) {\n const contractConfig: ContractConfig = {\n processorType: 'user_processor',\n contract: {\n name: solanaProcessor.contractName,\n chainId: 'SOL_mainnet', // TODO set in processor\n address: solanaProcessor.address,\n abi: '',\n },\n blockConfigs: [],\n logConfigs: [],\n traceConfigs: [],\n startBlock: solanaProcessor.config.startSlot,\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: {\n innerInstruction: solanaProcessor.processInnerInstruction,\n parsedInstruction: solanaProcessor.fromParsedInstruction !== null,\n rawDataInstruction: solanaProcessor.decodeInstruction !== null,\n },\n }\n this.contractConfigs.push(contractConfig)\n }\n }\n\n async start(request: StartRequest, context: CallContext): Promise<Empty> {\n if (this.started) {\n return {}\n }\n\n this.loader()\n\n for (const instance of request.templateInstances) {\n const template = global.PROCESSOR_STATE.templates[instance.templateId]\n if (!template) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Invalid template contract:' + instance)\n }\n if (!instance.contract) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Contract Empty from:' + instance)\n }\n template.bind({\n name: instance.contract.name,\n address: instance.contract.address,\n network: Number(instance.contract.chainId),\n startBlock: instance.startBlock,\n endBlock: instance.endBlock,\n })\n }\n await this.configure()\n this.started = true\n return {}\n }\n\n async stop(request: Empty, context: CallContext): Promise<Empty> {\n console.log('Server Shutting down in 5 seconds')\n if (this.shutdownHandler) {\n setTimeout(this.shutdownHandler, 5000)\n }\n return {}\n }\n\n async processLogs(request: ProcessLogsRequest, context: CallContext): Promise<ProcessLogsResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const resp: ProcessResult = {\n gauges: [],\n counters: [],\n logs: [],\n }\n\n const promises: Promise<ProcessResult>[] = []\n for (const l of request.logBindings) {\n if (!l.log) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Log can't be null\")\n }\n // const jsonString = Buffer.from(l.log.raw.buffer).toString(\"utf-8\")\n // const jsonString = String.fromCharCode.apply(null, l.log.raw)\n\n try {\n const jsonString = Utf8ArrayToStr(l.log.raw)\n const log: Log = JSON.parse(jsonString)\n const handler = this.eventHandlers[l.handlerId]\n const promise = handler(log).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing log: ' + jsonString + '\\n' + e.toString())\n })\n\n promises.push(promise)\n } catch (e) {\n throw new ServerError(Status.INTERNAL, 'error parse log: ' + l)\n }\n }\n\n const results = await Promise.all(promises)\n for (const res of results) {\n resp.counters = resp.counters.concat(res.counters)\n resp.gauges = resp.gauges.concat(res.gauges)\n }\n\n let updated = false\n if (\n global.PROCESSOR_STATE.templatesInstances &&\n this.templateInstances.length != global.PROCESSOR_STATE.templatesInstances.length\n ) {\n await this.configure()\n updated = true\n }\n\n recordRuntimeInfo(resp, HandlerType.LOG)\n return {\n result: resp,\n configUpdated: updated,\n }\n }\n\n async processTransactions(\n request: ProcessTransactionsRequest,\n context: CallContext\n ): Promise<ProcessTransactionsResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service not started.')\n }\n\n throw new ServerError(Status.UNIMPLEMENTED, 'Processing transaction is not suppored.')\n }\n\n async processInstructions(\n request: ProcessInstructionsRequest,\n context: CallContext\n ): Promise<ProcessInstructionsResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service not started.')\n }\n\n const result: ProcessResult = {\n gauges: [],\n counters: [],\n logs: [],\n }\n\n // Only have instruction handlers for solana processors\n if (global.PROCESSOR_STATE.solanaProcessors) {\n const processorPromises: Promise<void>[] = []\n for (const instruction of request.instructions) {\n if (!instruction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'instruction cannot be null')\n }\n\n processorPromises.push(\n new Promise((resolve, _) => {\n for (const processor of global.PROCESSOR_STATE.solanaProcessors) {\n if (processor.address === instruction.programAccountId) {\n let res: ProcessResult | null\n if (instruction.parsed) {\n res = processor.handleInstruction(JSON.parse(new TextDecoder().decode(instruction.parsed)))\n } else if (instruction.instructionData) {\n res = processor.handleInstruction(instruction.instructionData)\n } else {\n continue\n }\n if (res) {\n try {\n res.gauges.forEach((g) => {\n if (g.metadata) {\n g.metadata.blockNumber = instruction.slot\n }\n result.gauges.push(g)\n })\n res.counters.forEach((c) => {\n if (c.metadata) {\n c.metadata.blockNumber = instruction.slot\n }\n result.counters.push(c)\n })\n } catch (e) {\n console.error('error processing instruction ' + e.toString())\n }\n } else {\n console.warn(\n `Failed to decode the instruction: ${instruction.instructionData} with slot: ${instruction.slot}`\n )\n }\n }\n }\n resolve()\n })\n )\n }\n\n await Promise.all(processorPromises)\n }\n\n recordRuntimeInfo(result, HandlerType.INSTRUCTION)\n return {\n result,\n }\n }\n\n async processBlocks(request: ProcessBlocksRequest, context: CallContext): Promise<ProcessBlocksResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises = request.blockBindings.map((binding) => this.processBlock(binding))\n const results = await Promise.all(promises)\n\n const res = ProcessResult.fromPartial({})\n\n for (const r of results) {\n res.counters = res.counters.concat(r.counters)\n res.gauges = res.gauges.concat(r.gauges)\n }\n\n recordRuntimeInfo(res, HandlerType.BLOCK)\n return {\n result: res,\n }\n }\n\n async processBlock(binding: BlockBinding): Promise<ProcessResult> {\n if (!binding.block) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Block can't be empty\")\n }\n const jsonString = Utf8ArrayToStr(binding.block.raw)\n\n const block: Block = JSON.parse(jsonString)\n\n const resp: ProcessResult = {\n gauges: [],\n counters: [],\n logs: [],\n }\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n const promise = this.blockHandlers[handlerId](block).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing block: ' + block.number + '\\n' + e.toString())\n })\n promises.push(promise)\n }\n const allRes = await Promise.all(promises)\n for (const res of allRes) {\n resp.counters = resp.counters.concat(res.counters)\n resp.gauges = resp.gauges.concat(res.gauges)\n }\n return resp\n }\n\n async processTraces(request: ProcessTracesRequest, context: CallContext): Promise<ProcessTracesResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises = request.traceBindings.map((binding) => this.processTrace(binding))\n const results = await Promise.all(promises)\n\n const res = ProcessResult.fromPartial({})\n\n for (const r of results) {\n res.counters = res.counters.concat(r.counters)\n res.gauges = res.gauges.concat(r.gauges)\n }\n\n recordRuntimeInfo(res, HandlerType.TRACE)\n return {\n result: res,\n }\n }\n\n async processTrace(binding: TraceBinding): Promise<ProcessResult> {\n if (!binding.trace) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Trace can't be empty\")\n }\n const jsonString = Utf8ArrayToStr(binding.trace.raw)\n const trace: Trace = JSON.parse(jsonString)\n\n return this.traceHandlers[binding.handlerId](trace).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing trace: ' + jsonString + '\\n' + e.toString())\n })\n }\n}\n\n// https://ourcodeworld.com/articles/read/164/how-to-convert-an-uint8array-to-string-in-javascript\n/* eslint-disable */\nfunction Utf8ArrayToStr(array: Uint8Array) {\n let out, i, len, c\n let char2, char3\n\n out = ''\n len = array.length\n i = 0\n while (i < len) {\n c = array[i++]\n switch (c >> 4) {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c)\n break\n case 12:\n case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++]\n out += String.fromCharCode(((c & 0x1f) << 6) | (char2 & 0x3f))\n break\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++]\n char3 = array[i++]\n out += String.fromCharCode(((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0))\n break\n }\n }\n\n return out\n}\n\nfunction recordRuntimeInfo(results: ProcessResult, handlerType: HandlerType) {\n results.gauges.forEach((e) => {\n e.runtimeInfo = {\n from: handlerType,\n }\n })\n\n results.counters.forEach((e) => {\n e.runtimeInfo = {\n from: handlerType,\n }\n })\n}\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./spl-token-processor"), exports);
|
|
18
|
-
__exportStar(require("./wormhole-processor"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/solana/builtin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC;AACrC,uDAAoC","sourcesContent":["export * from './spl-token-processor'\nexport * from './wormhole-processor'"]}
|