@sentio/sdk 1.13.1 → 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/package.json +1 -1
- package/src/cli/commands/run-create.ts +3 -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,196 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
import fs from 'fs'
|
|
4
|
-
import { exec } from 'child_process'
|
|
5
|
-
import { EVM, SOLANA, Target } from './config'
|
|
6
|
-
|
|
7
|
-
export async function buildProcessor(onlyGen: boolean, targets: Target[]) {
|
|
8
|
-
if (!onlyGen) {
|
|
9
|
-
await installDeps()
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// targets.forEach(async (target) => await buildProcessorForTarget(onlyGen, target))
|
|
13
|
-
for (const target of targets) {
|
|
14
|
-
await buildProcessorForTarget(onlyGen, target)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (!onlyGen) {
|
|
18
|
-
const WEBPACK_CONFIG = path.join(__dirname, 'webpack.config.js')
|
|
19
|
-
await execStep('yarn tsc -p .', 'Compile')
|
|
20
|
-
await execStep('yarn webpack --config=' + WEBPACK_CONFIG, 'Packaging')
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
async function buildProcessorForTarget(onlyGen: boolean, target: Target) {
|
|
25
|
-
if (target.chain === EVM) {
|
|
26
|
-
await codeGenEthersProcessor(target.abisDir ?? path.join('abis', 'evm'))
|
|
27
|
-
} else if (target.chain === SOLANA) {
|
|
28
|
-
codeGenSolanaProcessor(target.abisDir ?? path.join('abis', 'solana'))
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (onlyGen) {
|
|
32
|
-
return
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async function installDeps() {
|
|
37
|
-
await execStep('yarn install --ignore-scripts', 'Yarn Install')
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export async function codeGenEthersProcessor(
|
|
41
|
-
abisDir: string,
|
|
42
|
-
ETHERS_TARGET = path.join(__dirname, '../target-ethers-sentio'),
|
|
43
|
-
outDir = 'src/types/internal'
|
|
44
|
-
) {
|
|
45
|
-
if (!fs.existsSync(abisDir)) {
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
let haveJson = false
|
|
50
|
-
const files = fs.readdirSync(abisDir)
|
|
51
|
-
for (const file of files) {
|
|
52
|
-
if (file.toLowerCase().endsWith('.json')) {
|
|
53
|
-
haveJson = true
|
|
54
|
-
break
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (!haveJson) {
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// TODO this will fail during postinstall, need to locate real typechain path
|
|
62
|
-
await execStep(
|
|
63
|
-
'yarn typechain --target ' + ETHERS_TARGET + ` --out-dir ${outDir} ${path.join(abisDir, '*.json')}`,
|
|
64
|
-
'Type definitions gen'
|
|
65
|
-
)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function codeGenSolanaProcessor(abisDir: string, root = '', targetPath = path.join('src', 'types')) {
|
|
69
|
-
const abisFolder = path.join(root, abisDir)
|
|
70
|
-
const abisFiles = fs.readdirSync(abisFolder)
|
|
71
|
-
const typeFolder = path.join(root, targetPath)
|
|
72
|
-
for (const file of abisFiles) {
|
|
73
|
-
if (path.extname(file) === '.json') {
|
|
74
|
-
if (!fs.existsSync(typeFolder)) {
|
|
75
|
-
fs.mkdirSync(typeFolder)
|
|
76
|
-
}
|
|
77
|
-
const idlContent = fs.readFileSync(path.join(abisFolder, file), 'utf-8')
|
|
78
|
-
const idlObj = JSON.parse(idlContent)
|
|
79
|
-
const idlName = idlObj.name
|
|
80
|
-
const idlFile = path.join(typeFolder, idlName + '.ts')
|
|
81
|
-
fs.writeFileSync(idlFile, `export const ${idlName}_idl = ${idlContent}`)
|
|
82
|
-
fs.writeFileSync(path.join(typeFolder, `${idlName}_processor.ts`), codeGenSolanaIdlProcessor(idlObj))
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function codeGenSolanaIdlProcessor(idlObj: any): string {
|
|
88
|
-
const idlName = idlObj.name
|
|
89
|
-
const idlNamePascalCase = toPascalCase(idlName)
|
|
90
|
-
const instructions: any[] = idlObj.instructions
|
|
91
|
-
return `import { BorshInstructionCoder, Instruction, Idl, BN } from '@project-serum/anchor'
|
|
92
|
-
import { SolanaBaseProcessor, SolanaContext, SolanaBindOptions } from "@sentio/sdk"
|
|
93
|
-
import { ${idlName}_idl } from "./${idlName}"
|
|
94
|
-
import bs58 from 'bs58'
|
|
95
|
-
import { PublicKey } from '@solana/web3.js'
|
|
96
|
-
|
|
97
|
-
export class ${idlNamePascalCase}Processor extends SolanaBaseProcessor {
|
|
98
|
-
static bind(options: SolanaBindOptions): ${idlNamePascalCase}Processor {
|
|
99
|
-
if (options && !options.name) {
|
|
100
|
-
options.name = '${idlNamePascalCase}'
|
|
101
|
-
}
|
|
102
|
-
return new ${idlNamePascalCase}Processor(options)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
decodeInstruction: (rawInstruction: string) => Instruction | null = (rawInstruction) => {
|
|
106
|
-
const instructionCoder = new BorshInstructionCoder(${idlName}_idl as Idl)
|
|
107
|
-
const decodedIns = instructionCoder.decode(Buffer.from(bs58.decode(rawInstruction)))
|
|
108
|
-
return decodedIns
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
${instructions.map((ins) => codeGenSolanaInstruction(idlNamePascalCase, ins)).join('')}
|
|
112
|
-
}
|
|
113
|
-
`
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function codeGenSolanaInstruction(idlName: string, ins: any): string {
|
|
117
|
-
const instructionName = ins.name
|
|
118
|
-
const argsTypeString = codeGenInstructionArgs(ins.args)
|
|
119
|
-
return `
|
|
120
|
-
on${
|
|
121
|
-
instructionName.charAt(0).toUpperCase() + instructionName.slice(1)
|
|
122
|
-
}(handler: (args: ${argsTypeString}, ctx: SolanaContext) => void): ${idlName}Processor {
|
|
123
|
-
this.onInstruction('${instructionName}', (ins: Instruction, ctx) => {
|
|
124
|
-
if (ins) {
|
|
125
|
-
handler(ins.data as ${argsTypeString}, ctx)
|
|
126
|
-
}
|
|
127
|
-
})
|
|
128
|
-
return this
|
|
129
|
-
}
|
|
130
|
-
`
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function codeGenInstructionArgs(args: { name: string; type: string }[]): string {
|
|
134
|
-
return `{ ${args.map((arg) => arg.name + ': ' + mapType(arg.type)).join(', ')} }`
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Reference: https://github.com/coral-xyz/anchor/blob/93332766f13e86efbe77c9986722731742317ede/ts/src/program/namespace/types.ts#L104
|
|
138
|
-
function mapType(tpe: string): string {
|
|
139
|
-
switch (tpe) {
|
|
140
|
-
case 'publicKey':
|
|
141
|
-
return 'PublicKey'
|
|
142
|
-
case 'bool':
|
|
143
|
-
return 'boolean'
|
|
144
|
-
case 'string':
|
|
145
|
-
return 'string'
|
|
146
|
-
case 'u8':
|
|
147
|
-
case 'i8':
|
|
148
|
-
case 'u16':
|
|
149
|
-
case 'i16':
|
|
150
|
-
case 'u32':
|
|
151
|
-
case 'i32':
|
|
152
|
-
case 'f32':
|
|
153
|
-
case 'f64':
|
|
154
|
-
return 'number'
|
|
155
|
-
case 'u64':
|
|
156
|
-
case 'i64':
|
|
157
|
-
case 'u128':
|
|
158
|
-
case 'i128':
|
|
159
|
-
return 'BN'
|
|
160
|
-
default:
|
|
161
|
-
return 'any'
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function toPascalCase(str: string) {
|
|
166
|
-
return `${str}`
|
|
167
|
-
.toLowerCase()
|
|
168
|
-
.replace(new RegExp(/[-_]+/, 'g'), ' ')
|
|
169
|
-
.replace(new RegExp(/[^\w\s]/, 'g'), '')
|
|
170
|
-
.replace(new RegExp(/\s+(.)(\w*)/, 'g'), ($1, $2, $3) => `${$2.toUpperCase() + $3}`)
|
|
171
|
-
.replace(new RegExp(/\w/), (s) => s.toUpperCase())
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
async function execStep(cmd: string, stepName: string) {
|
|
175
|
-
const child = exec(cmd)
|
|
176
|
-
console.log(chalk.blue(stepName + ' begin'))
|
|
177
|
-
|
|
178
|
-
if (!child.stdout || !child.stderr) {
|
|
179
|
-
console.error(chalk.red(stepName + ' failed'))
|
|
180
|
-
process.exit(1)
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
child.stdout.pipe(process.stdout)
|
|
184
|
-
child.stderr.pipe(process.stderr)
|
|
185
|
-
|
|
186
|
-
await new Promise((resolve) => {
|
|
187
|
-
child.on('close', resolve)
|
|
188
|
-
})
|
|
189
|
-
|
|
190
|
-
if (child.exitCode) {
|
|
191
|
-
console.error(chalk.red(stepName + ' failed'))
|
|
192
|
-
process.exit(child.exitCode)
|
|
193
|
-
}
|
|
194
|
-
console.log(chalk.blue(stepName + ' success'))
|
|
195
|
-
console.log()
|
|
196
|
-
}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import commandLineArgs from 'command-line-args'
|
|
4
|
-
import commandLineUsage from 'command-line-usage'
|
|
5
|
-
import fs from 'fs'
|
|
6
|
-
import path from 'path'
|
|
7
|
-
|
|
8
|
-
import yaml from 'js-yaml'
|
|
9
|
-
import { EVM, finalizeHost, FinalizeProjectName, SentioProjectConfig } from './config'
|
|
10
|
-
import { uploadFile } from './upload'
|
|
11
|
-
import chalk from 'chalk'
|
|
12
|
-
import { buildProcessor } from './build'
|
|
13
|
-
import { runLogin } from './commands/run-login'
|
|
14
|
-
import { runCreate } from './commands/run-create'
|
|
15
|
-
|
|
16
|
-
const mainDefinitions = [{ name: 'command', defaultOption: true }]
|
|
17
|
-
const mainOptions = commandLineArgs(mainDefinitions, {
|
|
18
|
-
stopAtFirstUnknown: true,
|
|
19
|
-
})
|
|
20
|
-
const argv = mainOptions._unknown || []
|
|
21
|
-
|
|
22
|
-
if (mainOptions.command === 'login') {
|
|
23
|
-
runLogin(argv)
|
|
24
|
-
} else if (mainOptions.command === 'create') {
|
|
25
|
-
runCreate(argv)
|
|
26
|
-
} else {
|
|
27
|
-
// For all the commands that need read project configs
|
|
28
|
-
// TODO move them to their own modules
|
|
29
|
-
|
|
30
|
-
// Process configs
|
|
31
|
-
let processorConfig: SentioProjectConfig = { host: '', project: '', source: '', build: true, targets: [] }
|
|
32
|
-
// Fist step, read from project yaml file
|
|
33
|
-
try {
|
|
34
|
-
console.log(chalk.blue('Loading Process config'))
|
|
35
|
-
// TODO correctly located sentio.yaml
|
|
36
|
-
const pwd = process.cwd()
|
|
37
|
-
const packageJson = path.join(pwd, 'package.json')
|
|
38
|
-
if (!fs.existsSync(packageJson)) {
|
|
39
|
-
console.error('package.json not found, please run this command in the root of your project')
|
|
40
|
-
process.exit(1)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const yamlPath = path.join(pwd, 'sentio.yaml')
|
|
44
|
-
if (!fs.existsSync(yamlPath)) {
|
|
45
|
-
console.error('sentio.yaml not found, please create one according to: TODO docs')
|
|
46
|
-
process.exit(1)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
processorConfig = yaml.load(fs.readFileSync('sentio.yaml', 'utf8')) as SentioProjectConfig
|
|
50
|
-
if (!processorConfig.project === undefined) {
|
|
51
|
-
console.error('Config yaml must have contain a valid project identifier')
|
|
52
|
-
process.exit(1)
|
|
53
|
-
}
|
|
54
|
-
if (processorConfig.build === undefined) {
|
|
55
|
-
processorConfig.build = true
|
|
56
|
-
}
|
|
57
|
-
if (!processorConfig.host) {
|
|
58
|
-
processorConfig.host = 'prod'
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (!processorConfig.source) {
|
|
62
|
-
processorConfig.source = 'src/processor.ts'
|
|
63
|
-
}
|
|
64
|
-
if (!processorConfig.targets) {
|
|
65
|
-
console.warn('targets is not defined, use EVM as the default target')
|
|
66
|
-
processorConfig.targets = []
|
|
67
|
-
}
|
|
68
|
-
if (processorConfig.targets.length === 0) {
|
|
69
|
-
// By default evm
|
|
70
|
-
processorConfig.targets.push({ chain: EVM })
|
|
71
|
-
}
|
|
72
|
-
} catch (e) {
|
|
73
|
-
console.error(e)
|
|
74
|
-
process.exit(1)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (mainOptions.command === 'upload') {
|
|
78
|
-
const optionDefinitions = [
|
|
79
|
-
{
|
|
80
|
-
name: 'help',
|
|
81
|
-
alias: 'h',
|
|
82
|
-
type: Boolean,
|
|
83
|
-
description: 'Display this usage guide.',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'api-key',
|
|
87
|
-
type: String,
|
|
88
|
-
description: '(Optional) Manually provide API key rather than use saved credential',
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: 'host',
|
|
92
|
-
description: '(Optional) Override Sentio Host name',
|
|
93
|
-
type: String,
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: 'owner',
|
|
97
|
-
description: '(Optional) Override Project owner',
|
|
98
|
-
type: String,
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: 'nobuild',
|
|
102
|
-
description: '(Optional) Skip build & pack file before uploading, default false',
|
|
103
|
-
type: Boolean,
|
|
104
|
-
},
|
|
105
|
-
]
|
|
106
|
-
const options = commandLineArgs(optionDefinitions, { argv })
|
|
107
|
-
if (options.help) {
|
|
108
|
-
const usage = commandLineUsage([
|
|
109
|
-
{
|
|
110
|
-
header: 'Sentio upload',
|
|
111
|
-
content: 'Upload your project files to Sentio.',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
header: 'Options',
|
|
115
|
-
optionList: optionDefinitions,
|
|
116
|
-
},
|
|
117
|
-
])
|
|
118
|
-
console.log(usage)
|
|
119
|
-
} else {
|
|
120
|
-
if (options.host) {
|
|
121
|
-
processorConfig.host = options.host
|
|
122
|
-
}
|
|
123
|
-
if (options.nobuild) {
|
|
124
|
-
processorConfig.build = false
|
|
125
|
-
}
|
|
126
|
-
finalizeHost(processorConfig)
|
|
127
|
-
FinalizeProjectName(processorConfig, options.owner)
|
|
128
|
-
console.log(processorConfig)
|
|
129
|
-
|
|
130
|
-
let apiOverride = undefined
|
|
131
|
-
if (options['api-key']) {
|
|
132
|
-
apiOverride = options['api-key']
|
|
133
|
-
}
|
|
134
|
-
uploadFile(processorConfig, apiOverride)
|
|
135
|
-
}
|
|
136
|
-
} else if (mainOptions.command === 'build') {
|
|
137
|
-
buildProcessor(false, processorConfig.targets)
|
|
138
|
-
} else if (mainOptions.command === 'gen') {
|
|
139
|
-
buildProcessor(true, processorConfig.targets)
|
|
140
|
-
} else {
|
|
141
|
-
const usage = commandLineUsage([
|
|
142
|
-
{
|
|
143
|
-
header: 'Sentio',
|
|
144
|
-
content: 'Login & Manage your project files to Sentio.',
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
header: 'Usage',
|
|
148
|
-
content: [
|
|
149
|
-
'sentio $command --help\t\tshow detail usage of specific command',
|
|
150
|
-
'sentio login --api-key=xx\t\tsave credential to local',
|
|
151
|
-
'sentio create\t\t\t\tcreate a template project',
|
|
152
|
-
'sentio upload\t\t\t\tbuild and upload processor to sentio',
|
|
153
|
-
'sentio gen\t\t\t\tgenerate abi',
|
|
154
|
-
'sentio build\t\t\t\tgenerate abi and build',
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
])
|
|
158
|
-
console.log(usage)
|
|
159
|
-
}
|
|
160
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import commandLineArgs from 'command-line-args'
|
|
2
|
-
import commandLineUsage from 'command-line-usage'
|
|
3
|
-
|
|
4
|
-
export function runCreate(argv: string[]) {
|
|
5
|
-
const optionDefinitions = [
|
|
6
|
-
{
|
|
7
|
-
name: 'help',
|
|
8
|
-
alias: 'h',
|
|
9
|
-
type: Boolean,
|
|
10
|
-
description: 'Display this usage guide.',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'name',
|
|
14
|
-
alias: 'n',
|
|
15
|
-
type: String,
|
|
16
|
-
description: '(Required) Project name',
|
|
17
|
-
},
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
const options = commandLineArgs(optionDefinitions, { argv })
|
|
21
|
-
if (options.help || !options.name) {
|
|
22
|
-
const usage = commandLineUsage([
|
|
23
|
-
{
|
|
24
|
-
header: 'Sentio Create',
|
|
25
|
-
content: 'Create a template project',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
header: 'Options',
|
|
29
|
-
optionList: optionDefinitions,
|
|
30
|
-
},
|
|
31
|
-
])
|
|
32
|
-
console.log(usage)
|
|
33
|
-
} else {
|
|
34
|
-
//
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import commandLineArgs from 'command-line-args'
|
|
2
|
-
import commandLineUsage from 'command-line-usage'
|
|
3
|
-
import { getFinalizedHost } from '../config'
|
|
4
|
-
import chalk from 'chalk'
|
|
5
|
-
import https from 'https'
|
|
6
|
-
import http from 'http'
|
|
7
|
-
import { WriteKey } from '../key'
|
|
8
|
-
|
|
9
|
-
export function runLogin(argv: string[]) {
|
|
10
|
-
const optionDefinitions = [
|
|
11
|
-
{
|
|
12
|
-
name: 'help',
|
|
13
|
-
alias: 'h',
|
|
14
|
-
type: Boolean,
|
|
15
|
-
description: 'Display this usage guide.',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
name: 'api-key',
|
|
19
|
-
type: String,
|
|
20
|
-
description: '(Required) Your API key',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'host',
|
|
24
|
-
description: '(Optional) Override Sentio Host name',
|
|
25
|
-
type: String,
|
|
26
|
-
},
|
|
27
|
-
]
|
|
28
|
-
const options = commandLineArgs(optionDefinitions, { argv })
|
|
29
|
-
|
|
30
|
-
if (options.help || !options['api-key']) {
|
|
31
|
-
const usage = commandLineUsage([
|
|
32
|
-
{
|
|
33
|
-
header: 'Sentio Login',
|
|
34
|
-
content: 'Try login to Sentio with your apikey.',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
header: 'Options',
|
|
38
|
-
optionList: optionDefinitions,
|
|
39
|
-
},
|
|
40
|
-
])
|
|
41
|
-
console.log(usage)
|
|
42
|
-
} else {
|
|
43
|
-
const host = getFinalizedHost(options.host)
|
|
44
|
-
console.log(chalk.blue('login to ' + host))
|
|
45
|
-
const url = new URL(host)
|
|
46
|
-
const reqOptions = {
|
|
47
|
-
hostname: url.hostname,
|
|
48
|
-
port: url.port,
|
|
49
|
-
path: '/api/v1/processors/check_key',
|
|
50
|
-
method: 'HEAD',
|
|
51
|
-
headers: {
|
|
52
|
-
'api-key': options['api-key'],
|
|
53
|
-
},
|
|
54
|
-
}
|
|
55
|
-
const h = url.protocol == 'https:' ? https : http
|
|
56
|
-
const req = h.request(reqOptions, (res) => {
|
|
57
|
-
if (res.statusCode == 200) {
|
|
58
|
-
WriteKey(host, options['api-key'])
|
|
59
|
-
console.log(chalk.green('login success'))
|
|
60
|
-
} else {
|
|
61
|
-
console.error(chalk.red('login failed, code:', res.statusCode, res.statusMessage))
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
req.on('error', (error) => {
|
|
66
|
-
console.error(error)
|
|
67
|
-
})
|
|
68
|
-
req.end()
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export interface SentioProjectConfig {
|
|
2
|
-
project: string
|
|
3
|
-
host: string
|
|
4
|
-
source: string
|
|
5
|
-
build: boolean
|
|
6
|
-
targets: Target[]
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function getFinalizedHost(host: string): string {
|
|
10
|
-
switch (host) {
|
|
11
|
-
case '':
|
|
12
|
-
case 'prod':
|
|
13
|
-
return 'https://app.sentio.xyz'
|
|
14
|
-
case 'test':
|
|
15
|
-
return 'https://test.sentio.xyz'
|
|
16
|
-
case 'staging':
|
|
17
|
-
return 'https://staging.sentio.xyz'
|
|
18
|
-
case 'local':
|
|
19
|
-
return 'http://localhost:10000'
|
|
20
|
-
}
|
|
21
|
-
return host
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function finalizeHost(config: SentioProjectConfig) {
|
|
25
|
-
config.host = getFinalizedHost(config.host)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function FinalizeProjectName(config: SentioProjectConfig, owner: string | undefined) {
|
|
29
|
-
if (owner) {
|
|
30
|
-
let name = config.project
|
|
31
|
-
if (name.includes('/')) {
|
|
32
|
-
name = config.project.split('/')[1]
|
|
33
|
-
}
|
|
34
|
-
config.project = [owner, name].join('/')
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface Target {
|
|
39
|
-
chain: string
|
|
40
|
-
abisDir?: string
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Supported target chain, lower case
|
|
44
|
-
export const EVM = 'evm'
|
|
45
|
-
export const SOLANA = 'solana'
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
|
-
import fs from 'fs'
|
|
3
|
-
import os from 'os'
|
|
4
|
-
|
|
5
|
-
const homeDir = os.homedir()
|
|
6
|
-
const sentioDir = path.join(homeDir, '.sentio')
|
|
7
|
-
const configFile = path.join(sentioDir, 'config.json')
|
|
8
|
-
|
|
9
|
-
interface SentioKeyConfig {
|
|
10
|
-
[key: string]: {
|
|
11
|
-
api_keys: string
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function WriteKey(host: string, api_key: string) {
|
|
16
|
-
const sentioDir = path.join(homeDir, '.sentio')
|
|
17
|
-
if (!fs.existsSync(sentioDir)) {
|
|
18
|
-
fs.mkdirSync(sentioDir, { recursive: true })
|
|
19
|
-
}
|
|
20
|
-
let config: SentioKeyConfig = {}
|
|
21
|
-
if (fs.existsSync(configFile)) {
|
|
22
|
-
const content = fs.readFileSync(configFile, 'utf8')
|
|
23
|
-
config = JSON.parse(content)
|
|
24
|
-
}
|
|
25
|
-
const hostConfig = config[host] || { api_keys: {} }
|
|
26
|
-
hostConfig.api_keys = api_key
|
|
27
|
-
config[host] = hostConfig
|
|
28
|
-
fs.writeFileSync(configFile, JSON.stringify(config, null, 2))
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function ReadKey(host: string): string | undefined {
|
|
32
|
-
if (!fs.existsSync(sentioDir)) {
|
|
33
|
-
return undefined
|
|
34
|
-
}
|
|
35
|
-
const configFile = path.join(sentioDir, 'config.json')
|
|
36
|
-
if (fs.existsSync(configFile)) {
|
|
37
|
-
const content = fs.readFileSync(configFile, 'utf8')
|
|
38
|
-
const config = JSON.parse(content)
|
|
39
|
-
return config[host]?.api_keys
|
|
40
|
-
} else {
|
|
41
|
-
return undefined
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { codeGenSolanaProcessor } from './build'
|
|
4
|
-
|
|
5
|
-
const abisDir = 'abis/solana'
|
|
6
|
-
if (process.argv.length > 2) {
|
|
7
|
-
const rootPath = process.argv[2]
|
|
8
|
-
if (process.argv.length > 3) {
|
|
9
|
-
const targetPath = process.argv[3]
|
|
10
|
-
codeGenSolanaProcessor(abisDir, rootPath, targetPath)
|
|
11
|
-
} else {
|
|
12
|
-
codeGenSolanaProcessor(abisDir, rootPath)
|
|
13
|
-
}
|
|
14
|
-
} else {
|
|
15
|
-
codeGenSolanaProcessor(abisDir)
|
|
16
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process'
|
|
2
|
-
import { createHash } from 'crypto'
|
|
3
|
-
import FormData from 'form-data'
|
|
4
|
-
import fs from 'fs'
|
|
5
|
-
import { SentioProjectConfig } from './config'
|
|
6
|
-
import { ReadKey } from './key'
|
|
7
|
-
import path from 'path'
|
|
8
|
-
import chalk from 'chalk'
|
|
9
|
-
import { buildProcessor } from './build'
|
|
10
|
-
import fetch from 'node-fetch'
|
|
11
|
-
|
|
12
|
-
export async function uploadFile(options: SentioProjectConfig, apiKeyOverride: string) {
|
|
13
|
-
if (options.build) {
|
|
14
|
-
await buildProcessor(false, options.targets)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
console.log(chalk.blue('Uploading'))
|
|
18
|
-
|
|
19
|
-
const PROCESSOR_FILE = path.join(process.cwd(), 'dist/lib.js')
|
|
20
|
-
|
|
21
|
-
const url = new URL(options.host)
|
|
22
|
-
const apiKey = apiKeyOverride || ReadKey(options.host)
|
|
23
|
-
|
|
24
|
-
const isProd = options.host === 'https://app.sentio.xyz'
|
|
25
|
-
if (!apiKey) {
|
|
26
|
-
const cmd = isProd ? 'sentio login' : 'sentio login --host=' + options.host
|
|
27
|
-
console.error(chalk.red('No Credential found for', options.host, '. Please run `' + cmd + '`.'))
|
|
28
|
-
process.exit(1)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (!fs.existsSync(PROCESSOR_FILE)) {
|
|
32
|
-
console.error(chalk.red('File not existed ', PROCESSOR_FILE, "don't use --nobuild"))
|
|
33
|
-
process.exit(1)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const stat = fs.statSync(PROCESSOR_FILE)
|
|
37
|
-
console.log('Packed processor file size', Math.floor(stat.size / 1024) + 'K, last modified', stat.mtime)
|
|
38
|
-
const content = fs.readFileSync(PROCESSOR_FILE)
|
|
39
|
-
const hash = createHash('sha256')
|
|
40
|
-
hash.update(content)
|
|
41
|
-
const digest = hash.digest('hex')
|
|
42
|
-
|
|
43
|
-
const data = new FormData()
|
|
44
|
-
data.append('attachment', fs.createReadStream(PROCESSOR_FILE))
|
|
45
|
-
data.append('sha256', digest)
|
|
46
|
-
|
|
47
|
-
let commitSha
|
|
48
|
-
try {
|
|
49
|
-
commitSha = execSync('git rev-parse HEAD').toString().trim()
|
|
50
|
-
data.append('commitSha', commitSha)
|
|
51
|
-
} catch (e) {
|
|
52
|
-
chalk.yellow(e)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
url.pathname = '/api/v1/processors'
|
|
56
|
-
|
|
57
|
-
let packageJson: { version: string }
|
|
58
|
-
try {
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
60
|
-
packageJson = require('../package.json')
|
|
61
|
-
} catch (e) {
|
|
62
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
63
|
-
packageJson = require('../../package.json')
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const res = await fetch(url, {
|
|
67
|
-
method: 'POST',
|
|
68
|
-
headers: {
|
|
69
|
-
'api-key': apiKey,
|
|
70
|
-
project: options.project,
|
|
71
|
-
version: packageJson.version,
|
|
72
|
-
},
|
|
73
|
-
body: data,
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
if (res.ok) {
|
|
77
|
-
console.log(chalk.green('Upload success: '))
|
|
78
|
-
console.log('\t', chalk.blue('sha256:'), digest)
|
|
79
|
-
if (commitSha) {
|
|
80
|
-
console.log('\t', chalk.blue('Git commit SHA:'), commitSha)
|
|
81
|
-
}
|
|
82
|
-
const { ProjectSlug } = await res.json()
|
|
83
|
-
console.log('\t', chalk.blue('Check status:'), `${options.host}/${ProjectSlug}/datasource`)
|
|
84
|
-
} else {
|
|
85
|
-
console.error(chalk.red('Upload Failed'))
|
|
86
|
-
console.error(chalk.red(await res.text()))
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
const path = require('path')
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
entry: {
|
|
6
|
-
lib: './src/processor.ts',
|
|
7
|
-
},
|
|
8
|
-
devtool: 'inline-source-map',
|
|
9
|
-
module: {
|
|
10
|
-
rules: [
|
|
11
|
-
{
|
|
12
|
-
test: /\.tsx?$/,
|
|
13
|
-
use: 'ts-loader',
|
|
14
|
-
exclude: /node_modules/,
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
resolve: {
|
|
19
|
-
extensions: ['.ts', '.js'],
|
|
20
|
-
},
|
|
21
|
-
output: {
|
|
22
|
-
filename: '[name].js',
|
|
23
|
-
path: path.resolve(process.cwd(), 'dist'),
|
|
24
|
-
},
|
|
25
|
-
target: 'node',
|
|
26
|
-
mode: 'production',
|
|
27
|
-
externals: [
|
|
28
|
-
{
|
|
29
|
-
ethers: 'commonjs2 ethers',
|
|
30
|
-
'@sentio/sdk': 'root sentio_sdk',
|
|
31
|
-
bs58: 'commonjs2 bs58',
|
|
32
|
-
"bignumber.js": 'commonjs2 bignumber.js',
|
|
33
|
-
'bn.js': 'commonjs2 bn.js',
|
|
34
|
-
},
|
|
35
|
-
function ({ context, request }, callback) {
|
|
36
|
-
if (/^@(ethersproject|solana|project-serum).*$/.test(request)) {
|
|
37
|
-
return callback(null, 'commonjs ' + request)
|
|
38
|
-
}
|
|
39
|
-
callback()
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
}
|