@sentio/sdk 1.0.0-development → 1.0.0-rc.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/LICENSE +55 -0
- package/lib/aptos/api.d.ts +2 -0
- package/lib/aptos/api.js +14 -0
- package/lib/aptos/api.js.map +1 -0
- package/lib/aptos/aptos-plugin.d.ts +14 -0
- package/lib/aptos/aptos-plugin.js +190 -0
- package/lib/aptos/aptos-plugin.js.map +1 -0
- package/lib/aptos/aptos-processor.d.ts +75 -0
- package/lib/aptos/aptos-processor.js +193 -0
- package/lib/aptos/aptos-processor.js.map +1 -0
- package/lib/aptos/context.d.ts +22 -0
- package/lib/aptos/context.js +69 -0
- package/lib/aptos/context.js.map +1 -0
- package/lib/aptos/index.d.ts +9 -0
- package/lib/aptos/index.js +34 -0
- package/lib/aptos/index.js.map +1 -0
- package/lib/aptos/models.d.ts +23 -0
- package/lib/aptos/models.js +3 -0
- package/lib/aptos/models.js.map +1 -0
- package/lib/aptos/network.d.ts +14 -0
- package/lib/aptos/network.js +46 -0
- package/lib/aptos/network.js.map +1 -0
- package/lib/aptos/runtime.d.ts +2 -0
- package/lib/aptos/runtime.js +16 -0
- package/lib/aptos/runtime.js.map +1 -0
- package/lib/aptos/type-registry.d.ts +21 -0
- package/lib/aptos/type-registry.js +156 -0
- package/lib/aptos/type-registry.js.map +1 -0
- package/lib/aptos/types.d.ts +9 -0
- package/lib/aptos/types.js +135 -0
- package/lib/aptos/types.js.map +1 -0
- package/{dist/numberish.test.d.ts → lib/aptos/types.test.d.ts} +0 -0
- package/lib/aptos/types.test.js.map +1 -0
- package/lib/aptos/utils.d.ts +7 -0
- package/lib/aptos/utils.js +27 -0
- package/lib/aptos/utils.js.map +1 -0
- package/lib/aptos-codegen/codegen.d.ts +23 -0
- package/lib/aptos-codegen/codegen.js +364 -0
- package/lib/aptos-codegen/codegen.js.map +1 -0
- package/lib/aptos-codegen/typegen.d.ts +17 -0
- package/lib/aptos-codegen/typegen.js +142 -0
- package/lib/aptos-codegen/typegen.js.map +1 -0
- package/lib/binds.d.ts +12 -0
- package/lib/binds.js +38 -0
- package/lib/binds.js.map +1 -0
- package/lib/builtin/aptos/0x1.d.ts +1913 -0
- package/lib/builtin/aptos/0x1.js +2748 -0
- package/lib/builtin/aptos/0x1.js.map +1 -0
- package/lib/builtin/aptos/0x3.d.ts +482 -0
- package/lib/builtin/aptos/0x3.js +526 -0
- package/lib/builtin/aptos/0x3.js.map +1 -0
- package/lib/builtin/aptos/index.d.ts +2 -0
- package/{dist/builtin/internal → lib/builtin/aptos}/index.js +3 -4
- package/lib/builtin/aptos/index.js.map +1 -0
- package/lib/builtin/eacaggregatorproxy/index.d.ts +2 -0
- package/lib/builtin/eacaggregatorproxy/index.js +22 -0
- package/lib/builtin/eacaggregatorproxy/index.js.map +1 -0
- package/lib/builtin/eacaggregatorproxy/test-utils.d.ts +6 -0
- package/lib/builtin/eacaggregatorproxy/test-utils.js +57 -0
- package/lib/builtin/eacaggregatorproxy/test-utils.js.map +1 -0
- package/lib/builtin/erc1155/index.d.ts +2 -0
- package/lib/builtin/erc1155/index.js +22 -0
- package/lib/builtin/erc1155/index.js.map +1 -0
- package/lib/builtin/erc1155/test-utils.d.ts +6 -0
- package/lib/builtin/erc1155/test-utils.js +57 -0
- package/lib/builtin/erc1155/test-utils.js.map +1 -0
- package/{dist → lib}/builtin/erc20/index.d.ts +1 -1
- package/{dist → lib}/builtin/erc20/index.js +1 -1
- package/lib/builtin/erc20/index.js.map +1 -0
- package/lib/builtin/erc20/test-utils.d.ts +5 -0
- package/lib/builtin/erc20/test-utils.js +46 -0
- package/lib/builtin/erc20/test-utils.js.map +1 -0
- package/lib/builtin/erc20bytes/index.d.ts +2 -0
- package/lib/builtin/erc20bytes/index.js +22 -0
- package/lib/builtin/erc20bytes/index.js.map +1 -0
- package/lib/builtin/erc20bytes/test-utils.d.ts +4 -0
- package/lib/builtin/erc20bytes/test-utils.js +35 -0
- package/lib/builtin/erc20bytes/test-utils.js.map +1 -0
- package/lib/builtin/erc721/index.d.ts +2 -0
- package/lib/builtin/erc721/index.js +22 -0
- package/lib/builtin/erc721/index.js.map +1 -0
- package/lib/builtin/erc721/test-utils.d.ts +5 -0
- package/lib/builtin/erc721/test-utils.js +46 -0
- package/lib/builtin/erc721/test-utils.js.map +1 -0
- package/lib/builtin/index.d.ts +6 -0
- package/lib/builtin/index.js +33 -0
- package/lib/builtin/index.js.map +1 -0
- package/lib/builtin/internal/EACAggregatorProxy.d.ts +460 -0
- package/lib/builtin/internal/EACAggregatorProxy.js +3 -0
- package/lib/builtin/internal/EACAggregatorProxy.js.map +1 -0
- package/lib/builtin/internal/ERC1155.d.ts +199 -0
- package/lib/builtin/internal/ERC1155.js +3 -0
- package/lib/builtin/internal/ERC1155.js.map +1 -0
- package/lib/builtin/internal/ERC20.d.ts +307 -0
- package/{dist/builtin/internal/Erc20.js → lib/builtin/internal/ERC20.js} +1 -1
- package/lib/builtin/internal/ERC20.js.map +1 -0
- package/{dist/builtin/internal/Erc20.d.ts → lib/builtin/internal/ERC20Bytes.d.ts} +62 -46
- package/lib/builtin/internal/ERC20Bytes.js +3 -0
- package/lib/builtin/internal/ERC20Bytes.js.map +1 -0
- package/lib/builtin/internal/ERC721.d.ts +252 -0
- package/lib/builtin/internal/ERC721.js +3 -0
- package/lib/builtin/internal/ERC721.js.map +1 -0
- package/lib/builtin/internal/WETH9.d.ts +221 -0
- package/lib/builtin/internal/WETH9.js +3 -0
- package/lib/builtin/internal/WETH9.js.map +1 -0
- package/{dist → lib}/builtin/internal/common.d.ts +0 -0
- package/{dist → lib}/builtin/internal/common.js +0 -0
- package/lib/builtin/internal/common.js.map +1 -0
- package/lib/builtin/internal/eacaggregatorproxy_processor.d.ts +294 -0
- package/lib/builtin/internal/eacaggregatorproxy_processor.js +761 -0
- package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +1 -0
- package/lib/builtin/internal/erc1155_processor.d.ts +126 -0
- package/lib/builtin/internal/erc1155_processor.js +313 -0
- package/lib/builtin/internal/erc1155_processor.js.map +1 -0
- package/lib/builtin/internal/erc20_processor.d.ts +166 -0
- package/lib/builtin/internal/erc20_processor.js +418 -0
- package/lib/builtin/internal/erc20_processor.js.map +1 -0
- package/lib/builtin/internal/erc20bytes_processor.d.ts +101 -0
- package/lib/builtin/internal/erc20bytes_processor.js +311 -0
- package/lib/builtin/internal/erc20bytes_processor.js.map +1 -0
- package/lib/builtin/internal/erc721_processor.d.ts +155 -0
- package/lib/builtin/internal/erc721_processor.js +437 -0
- package/lib/builtin/internal/erc721_processor.js.map +1 -0
- package/lib/builtin/internal/factories/EACAggregatorProxy__factory.d.ts +46 -0
- package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js +528 -0
- package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js.map +1 -0
- package/{dist/builtin/internal/factories/Erc20__factory.d.ts → lib/builtin/internal/factories/ERC1155__factory.d.ts} +4 -4
- package/lib/builtin/internal/factories/ERC1155__factory.js +333 -0
- package/lib/builtin/internal/factories/ERC1155__factory.js.map +1 -0
- package/lib/builtin/internal/factories/ERC20Bytes__factory.d.ts +48 -0
- package/{dist/builtin/internal/factories/Erc20__factory.js → lib/builtin/internal/factories/ERC20Bytes__factory.js} +128 -89
- package/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -0
- package/lib/builtin/internal/factories/ERC20__factory.d.ts +42 -0
- package/lib/builtin/internal/factories/ERC20__factory.js +405 -0
- package/lib/builtin/internal/factories/ERC20__factory.js.map +1 -0
- package/lib/builtin/internal/factories/ERC721__factory.d.ts +51 -0
- package/lib/builtin/internal/factories/ERC721__factory.js +365 -0
- package/lib/builtin/internal/factories/ERC721__factory.js.map +1 -0
- package/lib/builtin/internal/factories/WETH9__factory.d.ts +45 -0
- package/lib/builtin/internal/factories/WETH9__factory.js +298 -0
- package/lib/builtin/internal/factories/WETH9__factory.js.map +1 -0
- package/lib/builtin/internal/factories/index.d.ts +6 -0
- package/lib/builtin/internal/factories/index.js +19 -0
- package/lib/builtin/internal/factories/index.js.map +1 -0
- package/lib/builtin/internal/index.d.ts +13 -0
- package/lib/builtin/internal/index.js +40 -0
- package/lib/builtin/internal/index.js.map +1 -0
- package/lib/builtin/internal/weth9_processor.d.ts +115 -0
- package/lib/builtin/internal/weth9_processor.js +353 -0
- package/lib/builtin/internal/weth9_processor.js.map +1 -0
- package/lib/builtin/solana/index.d.ts +2 -0
- package/lib/builtin/solana/index.js +19 -0
- package/lib/builtin/solana/index.js.map +1 -0
- package/lib/builtin/solana/spl-token-processor.d.ts +39 -0
- package/lib/builtin/solana/spl-token-processor.js +258 -0
- package/lib/builtin/solana/spl-token-processor.js.map +1 -0
- package/lib/builtin/solana/types.d.ts +427 -0
- package/lib/builtin/solana/types.js +203 -0
- package/lib/builtin/solana/types.js.map +1 -0
- package/lib/builtin/solana/wormhole-processor.d.ts +16 -0
- package/{dist/test-case/types/wormhole_processor.js → lib/builtin/solana/wormhole-processor.js} +57 -54
- package/lib/builtin/solana/wormhole-processor.js.map +1 -0
- package/lib/builtin/weth9/index.d.ts +2 -0
- package/lib/builtin/weth9/index.js +22 -0
- package/lib/builtin/weth9/index.js.map +1 -0
- package/lib/builtin/weth9/test-utils.d.ts +6 -0
- package/lib/builtin/weth9/test-utils.js +57 -0
- package/lib/builtin/weth9/test-utils.js.map +1 -0
- package/lib/chain-config.d.ts +6 -0
- package/lib/chain-config.js +3 -0
- package/lib/chain-config.js.map +1 -0
- package/lib/core/account-processor.d.ts +58 -0
- package/lib/core/account-processor.js +147 -0
- package/lib/core/account-processor.js.map +1 -0
- package/lib/core/base-context.d.ts +12 -0
- package/lib/core/base-context.js +25 -0
- package/lib/core/base-context.js.map +1 -0
- package/lib/core/base-processor-template.d.ts +42 -0
- package/{dist → lib/core}/base-processor-template.js +32 -6
- package/lib/core/base-processor-template.js.map +1 -0
- package/lib/core/base-processor.d.ts +39 -0
- package/lib/core/base-processor.js +153 -0
- package/lib/core/base-processor.js.map +1 -0
- package/lib/core/big-decimal.d.ts +1 -0
- package/lib/core/big-decimal.js +6 -0
- package/lib/core/big-decimal.js.map +1 -0
- package/{dist → lib/core}/bind-options.d.ts +5 -0
- package/{dist → lib/core}/bind-options.js +10 -1
- package/lib/core/bind-options.js.map +1 -0
- package/lib/core/context.d.ts +55 -0
- package/lib/core/context.js +162 -0
- package/lib/core/context.js.map +1 -0
- package/lib/core/eth-plugin.d.ts +14 -0
- package/lib/core/eth-plugin.js +221 -0
- package/lib/core/eth-plugin.js.map +1 -0
- package/lib/core/event-tracker.d.ts +26 -0
- package/lib/core/event-tracker.js +54 -0
- package/lib/core/event-tracker.js.map +1 -0
- package/lib/core/exporter.d.ts +13 -0
- package/lib/core/exporter.js +30 -0
- package/lib/core/exporter.js.map +1 -0
- package/lib/core/generic-processor.d.ts +10 -0
- package/lib/core/generic-processor.js +32 -0
- package/lib/core/generic-processor.js.map +1 -0
- package/{dist/test-case/erc20-template.test.d.ts → lib/core/generic-processor.test.d.ts} +0 -0
- package/lib/core/generic-processor.test.js.map +1 -0
- package/lib/core/index.d.ts +17 -0
- package/lib/core/index.js +46 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/logger.d.ts +14 -0
- package/lib/core/logger.js +42 -0
- package/lib/core/logger.js.map +1 -0
- package/lib/core/metadata.d.ts +7 -0
- package/lib/core/metadata.js +12 -0
- package/lib/core/metadata.js.map +1 -0
- package/lib/core/meter.d.ts +59 -0
- package/lib/core/meter.js +166 -0
- package/lib/core/meter.js.map +1 -0
- package/{dist/test-case/erc20.test.d.ts → lib/core/meter.test.d.ts} +0 -0
- package/lib/core/meter.test.js.map +1 -0
- package/lib/core/numberish.d.ts +8 -0
- package/lib/core/numberish.js +115 -0
- package/lib/core/numberish.js.map +1 -0
- package/{dist/test-case/mirrorworld.d.ts → lib/core/numberish.test.d.ts} +0 -0
- package/lib/core/numberish.test.js.map +1 -0
- package/lib/core/solana-context.d.ts +12 -0
- package/lib/core/solana-context.js +34 -0
- package/lib/core/solana-context.js.map +1 -0
- package/lib/core/solana-options.d.ts +9 -0
- package/lib/core/solana-options.js +13 -0
- package/lib/core/solana-options.js.map +1 -0
- package/lib/core/solana-plugin.d.ts +9 -0
- package/lib/core/solana-plugin.js +79 -0
- package/lib/core/solana-plugin.js.map +1 -0
- package/lib/core/solana-processor.d.ts +41 -0
- package/lib/core/solana-processor.js +90 -0
- package/lib/core/solana-processor.js.map +1 -0
- package/lib/core/sui-plugin.d.ts +8 -0
- package/lib/core/sui-plugin.js +46 -0
- package/lib/core/sui-plugin.js.map +1 -0
- package/lib/core/sui-processor.d.ts +26 -0
- package/lib/core/sui-processor.js +59 -0
- package/lib/core/sui-processor.js.map +1 -0
- package/lib/core/trace.d.ts +35 -0
- package/lib/core/trace.js +43 -0
- package/lib/core/trace.js.map +1 -0
- package/lib/endpoints.d.ts +6 -0
- package/lib/endpoints.js +11 -0
- package/lib/endpoints.js.map +1 -0
- package/lib/error.d.ts +7 -0
- package/lib/error.js +43 -0
- package/lib/error.js.map +1 -0
- package/{dist → lib}/gen/builtin.d.ts +0 -0
- package/{dist → lib}/gen/builtin.js +0 -0
- package/lib/gen/builtin.js.map +1 -0
- package/lib/gen/chainquery/protos/chainquery.d.ts +400 -0
- package/lib/gen/chainquery/protos/chainquery.js +972 -0
- package/lib/gen/chainquery/protos/chainquery.js.map +1 -0
- package/{dist → lib}/gen/google/protobuf/empty.d.ts +0 -0
- package/{dist → lib}/gen/google/protobuf/empty.js +0 -0
- package/lib/gen/google/protobuf/empty.js.map +1 -0
- package/lib/gen/google/protobuf/struct.d.ts +73 -0
- package/lib/gen/google/protobuf/struct.js +371 -0
- package/lib/gen/google/protobuf/struct.js.map +1 -0
- package/lib/gen/google/protobuf/timestamp.d.ts +18 -0
- package/lib/gen/google/protobuf/timestamp.js +71 -0
- package/lib/gen/google/protobuf/timestamp.js.map +1 -0
- package/lib/gen/index.d.ts +2 -0
- package/lib/gen/index.js +19 -0
- package/lib/gen/index.js.map +1 -0
- package/lib/gen/processor/protos/processor.d.ts +826 -0
- package/lib/gen/processor/protos/processor.js +3988 -0
- package/lib/gen/processor/protos/processor.js.map +1 -0
- package/lib/gen/service/price/protos/price.d.ts +85 -0
- package/lib/gen/service/price/protos/price.js +269 -0
- package/lib/gen/service/price/protos/price.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +48 -0
- package/lib/index.js.map +1 -0
- package/lib/loader.d.ts +5 -0
- package/lib/loader.js +30 -0
- package/lib/loader.js.map +1 -0
- package/lib/plugin.d.ts +15 -0
- package/lib/plugin.js +32 -0
- package/lib/plugin.js.map +1 -0
- package/{dist → lib}/processor-runner.d.ts +0 -0
- package/lib/processor-runner.js +102 -0
- package/lib/processor-runner.js.map +1 -0
- package/lib/promise-or-void.d.ts +1 -0
- package/lib/promise-or-void.js +3 -0
- package/lib/promise-or-void.js.map +1 -0
- package/{dist → lib}/provider.d.ts +2 -1
- package/{dist → lib}/provider.js +19 -9
- package/lib/provider.js.map +1 -0
- package/lib/service.d.ts +26 -0
- package/lib/service.js +225 -0
- package/lib/service.js.map +1 -0
- package/lib/solana-codegen/codegen.d.ts +1 -0
- package/lib/solana-codegen/codegen.js +113 -0
- package/lib/solana-codegen/codegen.js.map +1 -0
- package/lib/state/processor-state.d.ts +3 -0
- package/lib/state/processor-state.js +8 -0
- package/lib/state/processor-state.js.map +1 -0
- package/lib/state/state-storage.d.ts +17 -0
- package/lib/state/state-storage.js +60 -0
- package/lib/state/state-storage.js.map +1 -0
- package/{dist/test-case/solana.test.d.ts → lib/state/state-storage.test.d.ts} +0 -0
- package/lib/state/state-storage.test.js.map +1 -0
- package/lib/target-ethers-sentio/event-handler.d.ts +3 -0
- package/lib/target-ethers-sentio/event-handler.js +35 -0
- package/lib/target-ethers-sentio/event-handler.js.map +1 -0
- package/{dist/target-ethers-sentio/codegen.d.ts → lib/target-ethers-sentio/file.d.ts} +1 -0
- package/lib/target-ethers-sentio/file.js +226 -0
- package/lib/target-ethers-sentio/file.js.map +1 -0
- package/lib/target-ethers-sentio/functions-handler.d.ts +3 -0
- package/lib/target-ethers-sentio/functions-handler.js +50 -0
- package/lib/target-ethers-sentio/functions-handler.js.map +1 -0
- package/{dist → lib}/target-ethers-sentio/index.d.ts +1 -0
- package/{dist → lib}/target-ethers-sentio/index.js +16 -3
- package/{dist → lib}/target-ethers-sentio/index.js.map +1 -1
- package/lib/target-ethers-sentio/types.d.ts +4 -0
- package/lib/target-ethers-sentio/types.js +46 -0
- package/lib/target-ethers-sentio/types.js.map +1 -0
- package/lib/target-ethers-sentio/view-function.d.ts +5 -0
- package/lib/target-ethers-sentio/view-function.js +74 -0
- package/lib/target-ethers-sentio/view-function.js.map +1 -0
- package/{dist/cli/cli.d.ts → lib/test-abi-code-gen.d.ts} +0 -0
- package/lib/test-abi-code-gen.js +20 -0
- package/lib/test-abi-code-gen.js.map +1 -0
- package/lib/testing/index.d.ts +2 -0
- package/lib/testing/index.js +11 -0
- package/lib/testing/index.js.map +1 -0
- package/lib/testing/metric-utils.d.ts +5 -0
- package/lib/testing/metric-utils.js +50 -0
- package/lib/testing/metric-utils.js.map +1 -0
- package/lib/testing/test-processor-server.d.ts +42 -0
- package/lib/testing/test-processor-server.js +293 -0
- package/lib/testing/test-processor-server.js.map +1 -0
- package/lib/testing/test-provider.d.ts +1 -0
- package/lib/testing/test-provider.js +33 -0
- package/lib/testing/test-provider.js.map +1 -0
- package/lib/utils/chain.d.ts +89 -0
- package/lib/utils/chain.js +128 -0
- package/lib/utils/chain.js.map +1 -0
- package/lib/utils/chainlink-oracles-goerli.csv +8 -0
- package/lib/utils/chainlink-oracles.csv +217 -0
- package/lib/utils/conversion.d.ts +6 -0
- package/lib/utils/conversion.js +27 -0
- package/lib/utils/conversion.js.map +1 -0
- package/lib/utils/dex-price.d.ts +22 -0
- package/lib/utils/dex-price.js +114 -0
- package/lib/utils/dex-price.js.map +1 -0
- package/{dist/test-case/wormhole-token-bridge.d.ts → lib/utils/dex-price.test.d.ts} +0 -0
- package/lib/utils/dex-price.test.js.map +1 -0
- package/lib/utils/erc20.test.d.ts +1 -0
- package/lib/utils/erc20.test.js.map +1 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.js +31 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/price.d.ts +52 -0
- package/lib/utils/price.js +86 -0
- package/lib/utils/price.js.map +1 -0
- package/lib/utils/token.d.ts +15 -0
- package/lib/utils/token.js +60 -0
- package/lib/utils/token.js.map +1 -0
- package/package.json +43 -42
- package/src/abis/EACAggregatorProxy.json +227 -0
- package/src/abis/ERC1155.json +314 -0
- package/src/abis/ERC20.json +174 -0
- package/src/abis/ERC20Bytes.json +236 -0
- package/src/abis/ERC721.json +346 -0
- package/src/abis/WETH9.json +153 -0
- package/src/abis/aptos/0x1.json +9205 -0
- package/src/abis/aptos/0x3.json +1515 -0
- package/src/aptos/api.ts +11 -0
- package/src/aptos/aptos-plugin.ts +217 -0
- package/src/aptos/aptos-processor.ts +305 -0
- package/src/aptos/context.ts +75 -0
- package/src/aptos/index.ts +10 -0
- package/src/aptos/models.ts +34 -0
- package/src/aptos/network.ts +42 -0
- package/src/aptos/runtime.ts +13 -0
- package/src/aptos/type-registry.ts +187 -0
- package/src/aptos/types.ts +149 -0
- package/src/aptos/utils.ts +26 -0
- package/src/aptos-codegen/codegen.ts +428 -0
- package/src/aptos-codegen/tsconfig.json +9 -0
- package/src/aptos-codegen/typegen.ts +153 -0
- package/src/binds.ts +45 -0
- package/src/builtin/aptos/0x1.ts +4210 -0
- package/src/builtin/aptos/0x3.ts +888 -0
- package/src/builtin/aptos/index.ts +2 -0
- package/src/builtin/eacaggregatorproxy/index.ts +6 -0
- package/src/builtin/eacaggregatorproxy/test-utils.ts +89 -0
- package/src/builtin/erc1155/index.ts +6 -0
- package/src/builtin/erc1155/test-utils.ts +89 -0
- package/src/builtin/erc20/index.ts +6 -0
- package/src/builtin/erc20/test-utils.ts +71 -0
- package/src/builtin/erc20bytes/index.ts +6 -0
- package/src/builtin/erc20bytes/test-utils.ts +53 -0
- package/src/builtin/erc721/index.ts +6 -0
- package/src/builtin/erc721/test-utils.ts +71 -0
- package/src/builtin/index.ts +7 -0
- package/src/builtin/internal/EACAggregatorProxy.ts +861 -0
- package/src/builtin/internal/ERC1155.ts +529 -0
- package/src/builtin/internal/ERC20.ts +679 -0
- package/src/builtin/internal/ERC20Bytes.ts +384 -0
- package/src/builtin/internal/ERC721.ts +639 -0
- package/src/builtin/internal/WETH9.ts +480 -0
- package/src/builtin/internal/common.ts +46 -0
- package/src/builtin/internal/eacaggregatorproxy_processor.ts +1219 -0
- package/src/builtin/internal/erc1155_processor.ts +534 -0
- package/src/builtin/internal/erc20_processor.ts +663 -0
- package/src/builtin/internal/erc20bytes_processor.ts +474 -0
- package/src/builtin/internal/erc721_processor.ts +686 -0
- package/src/builtin/internal/factories/EACAggregatorProxy__factory.ts +534 -0
- package/src/builtin/internal/factories/ERC1155__factory.ts +336 -0
- package/src/builtin/internal/factories/ERC20Bytes__factory.ts +258 -0
- package/src/builtin/internal/factories/ERC20__factory.ts +405 -0
- package/src/builtin/internal/factories/ERC721__factory.ts +365 -0
- package/src/builtin/internal/factories/WETH9__factory.ts +298 -0
- package/src/builtin/internal/factories/index.ts +9 -0
- package/src/builtin/internal/index.ts +16 -0
- package/src/builtin/internal/weth9_processor.ts +536 -0
- package/src/builtin/solana/index.ts +2 -0
- package/src/builtin/solana/spl-token-processor.ts +298 -0
- package/src/builtin/solana/types.ts +279 -0
- package/src/builtin/solana/wormhole-processor.ts +178 -0
- package/src/builtin/weth9/index.ts +6 -0
- package/src/builtin/weth9/test-utils.ts +89 -0
- package/src/chain-config.ts +6 -0
- package/src/core/account-processor.ts +217 -0
- package/src/core/base-context.ts +28 -0
- package/src/core/base-processor-template.ts +150 -0
- package/src/core/base-processor.ts +217 -0
- package/src/core/big-decimal.ts +1 -0
- package/src/core/bind-options.ts +45 -0
- package/src/core/context.ts +183 -0
- package/src/core/eth-plugin.ts +255 -0
- package/src/core/event-tracker.ts +69 -0
- package/src/core/exporter.ts +32 -0
- package/src/core/generic-processor.ts +34 -0
- package/src/core/index.ts +22 -0
- package/src/core/logger.ts +49 -0
- package/src/core/metadata.ts +11 -0
- package/src/core/meter.ts +179 -0
- package/src/core/numberish.ts +121 -0
- package/src/core/solana-context.ts +35 -0
- package/src/core/solana-options.ts +10 -0
- package/src/core/solana-plugin.ts +97 -0
- package/src/core/solana-processor.ts +109 -0
- package/src/core/sui-plugin.ts +54 -0
- package/src/core/sui-processor.ts +65 -0
- package/src/core/trace.ts +86 -0
- package/src/endpoints.ts +9 -0
- package/src/error.ts +45 -0
- package/src/gen/builtin.ts +22 -0
- package/src/gen/chainquery/protos/chainquery.ts +1212 -0
- package/src/gen/google/protobuf/empty.ts +58 -0
- package/src/gen/google/protobuf/struct.ts +422 -0
- package/src/gen/google/protobuf/timestamp.ts +85 -0
- package/src/gen/index.ts +3 -0
- package/src/gen/processor/protos/processor.ts +4619 -0
- package/src/gen/service/price/protos/price.ts +329 -0
- package/src/index.ts +13 -0
- package/src/loader.ts +24 -0
- package/src/plugin.ts +41 -0
- package/src/processor-runner.ts +93 -0
- package/src/promise-or-void.ts +1 -0
- package/src/provider.ts +74 -0
- package/src/service.ts +255 -0
- package/src/solana-codegen/codegen.ts +116 -0
- package/src/state/processor-state.ts +3 -0
- package/src/state/state-storage.ts +65 -0
- package/src/target-ethers-sentio/event-handler.ts +31 -0
- package/src/target-ethers-sentio/file.ts +242 -0
- package/src/target-ethers-sentio/functions-handler.ts +57 -0
- package/src/target-ethers-sentio/index.ts +60 -0
- package/src/target-ethers-sentio/tsconfig.json +9 -0
- package/src/target-ethers-sentio/types.ts +42 -0
- package/src/target-ethers-sentio/view-function.ts +79 -0
- package/src/test-abi-code-gen.ts +16 -0
- package/src/testing/index.ts +4 -0
- package/src/testing/metric-utils.ts +48 -0
- package/src/testing/test-processor-server.ts +334 -0
- package/src/testing/test-provider.ts +33 -0
- package/src/types/global.d.ts +15 -0
- package/src/utils/chain.ts +127 -0
- package/src/utils/chainlink-oracles-goerli.csv +8 -0
- package/src/utils/chainlink-oracles.csv +217 -0
- package/src/utils/conversion.ts +27 -0
- package/src/utils/dex-price.ts +136 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/price.ts +95 -0
- package/src/utils/token.ts +70 -0
- package/dist/base-processor-template.d.ts +0 -20
- package/dist/base-processor-template.js.map +0 -1
- package/dist/base-processor.d.ts +0 -22
- package/dist/base-processor.js +0 -103
- package/dist/base-processor.js.map +0 -1
- package/dist/bind-options.js.map +0 -1
- package/dist/binds.d.ts +0 -10
- package/dist/binds.js +0 -58
- package/dist/binds.js.map +0 -1
- package/dist/builtin/erc20/index.js.map +0 -1
- package/dist/builtin/internal/Erc20.js.map +0 -1
- package/dist/builtin/internal/common.js.map +0 -1
- package/dist/builtin/internal/erc20_processor.d.ts +0 -38
- package/dist/builtin/internal/erc20_processor.js +0 -209
- package/dist/builtin/internal/erc20_processor.js.map +0 -1
- package/dist/builtin/internal/factories/Erc20__factory.js.map +0 -1
- package/dist/builtin/internal/factories/index.d.ts +0 -1
- package/dist/builtin/internal/factories/index.js +0 -9
- package/dist/builtin/internal/factories/index.js.map +0 -1
- package/dist/builtin/internal/index.d.ts +0 -3
- package/dist/builtin/internal/index.js.map +0 -1
- package/dist/cli/build.d.ts +0 -3
- package/dist/cli/build.js +0 -161
- package/dist/cli/build.js.map +0 -1
- package/dist/cli/cli.js +0 -212
- package/dist/cli/cli.js.map +0 -1
- package/dist/cli/config.d.ts +0 -14
- package/dist/cli/config.js +0 -24
- package/dist/cli/config.js.map +0 -1
- package/dist/cli/key.d.ts +0 -2
- package/dist/cli/key.js +0 -44
- package/dist/cli/key.js.map +0 -1
- package/dist/cli/solana-code-gen.d.ts +0 -2
- package/dist/cli/solana-code-gen.js +0 -19
- package/dist/cli/solana-code-gen.js.map +0 -1
- package/dist/cli/upload.d.ts +0 -2
- package/dist/cli/upload.js +0 -76
- package/dist/cli/upload.js.map +0 -1
- package/dist/cli/webpack.config.js +0 -41
- package/dist/context.d.ts +0 -39
- package/dist/context.js +0 -75
- package/dist/context.js.map +0 -1
- package/dist/contract-namer.d.ts +0 -6
- package/dist/contract-namer.js +0 -20
- package/dist/contract-namer.js.map +0 -1
- package/dist/error.d.ts +0 -2
- package/dist/error.js +0 -39
- package/dist/error.js.map +0 -1
- package/dist/gen/builtin.js.map +0 -1
- package/dist/gen/google/protobuf/empty.js.map +0 -1
- package/dist/gen/processor/protos/processor.d.ts +0 -598
- package/dist/gen/processor/protos/processor.js +0 -2424
- package/dist/gen/processor/protos/processor.js.map +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -54
- package/dist/index.js.map +0 -1
- package/dist/meter.d.ts +0 -25
- package/dist/meter.js +0 -114
- package/dist/meter.js.map +0 -1
- package/dist/numberish.d.ts +0 -7
- package/dist/numberish.js +0 -74
- package/dist/numberish.js.map +0 -1
- package/dist/numberish.test.js +0 -54
- package/dist/numberish.test.js.map +0 -1
- package/dist/processor-runner.js +0 -66
- package/dist/processor-runner.js.map +0 -1
- package/dist/processor-state.d.ts +0 -16
- package/dist/processor-state.js +0 -20
- package/dist/processor-state.js.map +0 -1
- package/dist/provider.js.map +0 -1
- package/dist/service.d.ts +0 -22
- package/dist/service.js +0 -361
- package/dist/service.js.map +0 -1
- package/dist/solana/builtin/spl-token-processor.d.ts +0 -25
- package/dist/solana/builtin/spl-token-processor.js +0 -152
- package/dist/solana/builtin/spl-token-processor.js.map +0 -1
- package/dist/solana-processor.d.ts +0 -28
- package/dist/solana-processor.js +0 -79
- package/dist/solana-processor.js.map +0 -1
- package/dist/target-ethers-sentio/codegen.js +0 -201
- package/dist/target-ethers-sentio/codegen.js.map +0 -1
- package/dist/test-case/clean-test.d.ts +0 -1
- package/dist/test-case/clean-test.js +0 -9
- package/dist/test-case/clean-test.js.map +0 -1
- package/dist/test-case/erc20-template.d.ts +0 -1
- package/dist/test-case/erc20-template.js +0 -23
- package/dist/test-case/erc20-template.js.map +0 -1
- package/dist/test-case/erc20-template.test.js +0 -69
- package/dist/test-case/erc20-template.test.js.map +0 -1
- package/dist/test-case/erc20.d.ts +0 -1
- package/dist/test-case/erc20.js +0 -42
- package/dist/test-case/erc20.js.map +0 -1
- package/dist/test-case/erc20.test.js +0 -154
- package/dist/test-case/erc20.test.js.map +0 -1
- package/dist/test-case/mirrorworld.js +0 -42
- package/dist/test-case/mirrorworld.js.map +0 -1
- package/dist/test-case/solana.test.js +0 -58
- package/dist/test-case/solana.test.js.map +0 -1
- package/dist/test-case/types/game_wallet.d.ts +0 -45
- package/dist/test-case/types/game_wallet.js +0 -1396
- package/dist/test-case/types/game_wallet.js.map +0 -1
- package/dist/test-case/types/game_wallet_processor.d.ts +0 -107
- package/dist/test-case/types/game_wallet_processor.js +0 -102
- package/dist/test-case/types/game_wallet_processor.js.map +0 -1
- package/dist/test-case/types/wormhole_processor.d.ts +0 -16
- package/dist/test-case/types/wormhole_processor.js.map +0 -1
- package/dist/test-case/wormhole-token-bridge.js +0 -7
- package/dist/test-case/wormhole-token-bridge.js.map +0 -1
- package/dist/utils/chainmap.d.ts +0 -4
- package/dist/utils/chainmap.js +0 -95
- package/dist/utils/chainmap.js.map +0 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -6
- package/dist/utils/index.js.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { RetryOptions } from 'nice-grpc-client-middleware-retry';
|
|
2
|
+
export declare function getPriceClient(address?: string): import("nice-grpc").RawClient<import("nice-grpc/lib/service-definitions/ts-proto").FromTsProtoServiceDefinition<{
|
|
3
|
+
readonly name: "PriceService";
|
|
4
|
+
readonly fullName: "price_service.PriceService";
|
|
5
|
+
readonly methods: {
|
|
6
|
+
readonly getPrice: {
|
|
7
|
+
readonly name: "GetPrice";
|
|
8
|
+
readonly requestType: {
|
|
9
|
+
encode(message: import("../gen/service/price/protos/price").GetPriceRequest, writer?: import("protobufjs").Writer): import("protobufjs").Writer;
|
|
10
|
+
decode(input: Uint8Array | import("protobufjs").Reader, length?: number | undefined): import("../gen/service/price/protos/price").GetPriceRequest;
|
|
11
|
+
fromJSON(object: any): import("../gen/service/price/protos/price").GetPriceRequest;
|
|
12
|
+
toJSON(message: import("../gen/service/price/protos/price").GetPriceRequest): unknown;
|
|
13
|
+
fromPartial(object: {
|
|
14
|
+
timestamp?: Date | undefined;
|
|
15
|
+
coinId?: {
|
|
16
|
+
symbol?: string | undefined;
|
|
17
|
+
address?: {
|
|
18
|
+
address?: string | undefined;
|
|
19
|
+
chain?: string | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
} | undefined;
|
|
22
|
+
}): import("../gen/service/price/protos/price").GetPriceRequest;
|
|
23
|
+
};
|
|
24
|
+
readonly requestStream: false;
|
|
25
|
+
readonly responseType: {
|
|
26
|
+
encode(message: import("../gen/service/price/protos/price").GetPriceResponse, writer?: import("protobufjs").Writer): import("protobufjs").Writer;
|
|
27
|
+
decode(input: Uint8Array | import("protobufjs").Reader, length?: number | undefined): import("../gen/service/price/protos/price").GetPriceResponse;
|
|
28
|
+
fromJSON(object: any): import("../gen/service/price/protos/price").GetPriceResponse;
|
|
29
|
+
toJSON(message: import("../gen/service/price/protos/price").GetPriceResponse): unknown;
|
|
30
|
+
fromPartial(object: {
|
|
31
|
+
price?: number | undefined;
|
|
32
|
+
timestamp?: Date | undefined;
|
|
33
|
+
}): import("../gen/service/price/protos/price").GetPriceResponse;
|
|
34
|
+
};
|
|
35
|
+
readonly responseStream: false;
|
|
36
|
+
readonly options: {};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}>, RetryOptions>;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param chainId chain id refers to CHAIN_MAP
|
|
43
|
+
* @param coinType
|
|
44
|
+
* @param date
|
|
45
|
+
*/
|
|
46
|
+
export declare function getPriceByType(chainId: string, coinType: string, date: Date): Promise<number>;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param symbol token symbol like BTC, etc
|
|
50
|
+
* @param date
|
|
51
|
+
*/
|
|
52
|
+
export declare function getPriceBySymbol(symbol: string, date: Date): Promise<number>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPriceBySymbol = exports.getPriceByType = exports.getPriceClient = void 0;
|
|
4
|
+
const price_1 = require("../gen/service/price/protos/price");
|
|
5
|
+
const nice_grpc_1 = require("nice-grpc");
|
|
6
|
+
const nice_grpc_client_middleware_retry_1 = require("nice-grpc-client-middleware-retry");
|
|
7
|
+
function getPriceClient(address) {
|
|
8
|
+
if (!address) {
|
|
9
|
+
address = global.ENDPOINTS.priceFeedAPI;
|
|
10
|
+
}
|
|
11
|
+
const channel = (0, nice_grpc_1.createChannel)(address);
|
|
12
|
+
return (0, nice_grpc_1.createClientFactory)().use(nice_grpc_client_middleware_retry_1.retryMiddleware).create(price_1.PriceServiceDefinition, channel);
|
|
13
|
+
}
|
|
14
|
+
exports.getPriceClient = getPriceClient;
|
|
15
|
+
const priceMap = new Map();
|
|
16
|
+
let priceClient;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param chainId chain id refers to CHAIN_MAP
|
|
20
|
+
* @param coinType
|
|
21
|
+
* @param date
|
|
22
|
+
*/
|
|
23
|
+
async function getPriceByType(chainId, coinType, date) {
|
|
24
|
+
if (!priceClient) {
|
|
25
|
+
priceClient = getPriceClient();
|
|
26
|
+
}
|
|
27
|
+
const dateStr = dateString(date);
|
|
28
|
+
const key = `${coinType}-${dateStr}`;
|
|
29
|
+
let price = priceMap.get(key);
|
|
30
|
+
if (price) {
|
|
31
|
+
return price;
|
|
32
|
+
}
|
|
33
|
+
const response = await priceClient.getPrice({
|
|
34
|
+
timestamp: date,
|
|
35
|
+
coinId: {
|
|
36
|
+
address: {
|
|
37
|
+
chain: chainId,
|
|
38
|
+
address: coinType,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}, {
|
|
42
|
+
retry: true,
|
|
43
|
+
retryMaxAttempts: 8,
|
|
44
|
+
});
|
|
45
|
+
price = response.price;
|
|
46
|
+
if (response.timestamp && dateString(response.timestamp) === dateStr) {
|
|
47
|
+
priceMap.set(key, price);
|
|
48
|
+
}
|
|
49
|
+
return price;
|
|
50
|
+
}
|
|
51
|
+
exports.getPriceByType = getPriceByType;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @param symbol token symbol like BTC, etc
|
|
55
|
+
* @param date
|
|
56
|
+
*/
|
|
57
|
+
async function getPriceBySymbol(symbol, date) {
|
|
58
|
+
if (!priceClient) {
|
|
59
|
+
priceClient = getPriceClient();
|
|
60
|
+
}
|
|
61
|
+
const dateStr = dateString(date);
|
|
62
|
+
const key = `${symbol}-${dateStr}`;
|
|
63
|
+
let price = priceMap.get(key);
|
|
64
|
+
if (price) {
|
|
65
|
+
return price;
|
|
66
|
+
}
|
|
67
|
+
const response = await priceClient.getPrice({
|
|
68
|
+
timestamp: date,
|
|
69
|
+
coinId: {
|
|
70
|
+
symbol,
|
|
71
|
+
},
|
|
72
|
+
}, {
|
|
73
|
+
retry: true,
|
|
74
|
+
retryMaxAttempts: 8,
|
|
75
|
+
});
|
|
76
|
+
price = response.price;
|
|
77
|
+
if (response.timestamp && dateString(response.timestamp) === dateStr) {
|
|
78
|
+
priceMap.set(key, price);
|
|
79
|
+
}
|
|
80
|
+
return price;
|
|
81
|
+
}
|
|
82
|
+
exports.getPriceBySymbol = getPriceBySymbol;
|
|
83
|
+
function dateString(date) {
|
|
84
|
+
return [date.getUTCDate(), date.getUTCMonth() + 1, date.getUTCFullYear()].join('-');
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=price.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price.js","sourceRoot":"","sources":["../../src/utils/price.ts"],"names":[],"mappings":";;;AAAA,6DAA8F;AAC9F,yCAA8D;AAC9D,yFAAiF;AAEjF,SAAgB,cAAc,CAAC,OAAgB;IAC7C,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,YAAY,CAAA;KACxC;IACD,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,OAAO,CAAC,CAAA;IAEtC,OAAO,IAAA,+BAAmB,GAAE,CAAC,GAAG,CAAC,mDAAe,CAAC,CAAC,MAAM,CAAC,8BAAsB,EAAE,OAAO,CAAC,CAAA;AAC3F,CAAC;AAPD,wCAOC;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAA;AAC1C,IAAI,WAA6C,CAAA;AAEjD;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,QAAgB,EAAE,IAAU;IAChF,IAAI,CAAC,WAAW,EAAE;QAChB,WAAW,GAAG,cAAc,EAAE,CAAA;KAC/B;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;IAChC,MAAM,GAAG,GAAG,GAAG,QAAQ,IAAI,OAAO,EAAE,CAAA;IACpC,IAAI,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC7B,IAAI,KAAK,EAAE;QACT,OAAO,KAAK,CAAA;KACb;IAED,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,QAAQ,CACzC;QACE,SAAS,EAAE,IAAI;QACf,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,QAAQ;aAClB;SACF;KACF,EACD;QACE,KAAK,EAAE,IAAI;QACX,gBAAgB,EAAE,CAAC;KACpB,CACF,CAAA;IACD,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAA;IACtB,IAAI,QAAQ,CAAC,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,OAAO,EAAE;QACpE,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;KACzB;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAhCD,wCAgCC;AAED;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CAAC,MAAc,EAAE,IAAU;IAC/D,IAAI,CAAC,WAAW,EAAE;QAChB,WAAW,GAAG,cAAc,EAAE,CAAA;KAC/B;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;IAChC,MAAM,GAAG,GAAG,GAAG,MAAM,IAAI,OAAO,EAAE,CAAA;IAClC,IAAI,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC7B,IAAI,KAAK,EAAE;QACT,OAAO,KAAK,CAAA;KACb;IAED,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,QAAQ,CACzC;QACE,SAAS,EAAE,IAAI;QACf,MAAM,EAAE;YACN,MAAM;SACP;KACF,EACD;QACE,KAAK,EAAE,IAAI;QACX,gBAAgB,EAAE,CAAC;KACpB,CACF,CAAA;IACD,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAA;IACtB,IAAI,QAAQ,CAAC,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,OAAO,EAAE;QACpE,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;KACzB;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AA7BD,4CA6BC;AAED,SAAS,UAAU,CAAC,IAAU;IAC5B,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACrF,CAAC","sourcesContent":["import { PriceServiceClient, PriceServiceDefinition } from '../gen/service/price/protos/price'\nimport { createChannel, createClientFactory } from 'nice-grpc'\nimport { retryMiddleware, RetryOptions } from 'nice-grpc-client-middleware-retry'\n\nexport function getPriceClient(address?: string) {\n if (!address) {\n address = global.ENDPOINTS.priceFeedAPI\n }\n const channel = createChannel(address)\n\n return createClientFactory().use(retryMiddleware).create(PriceServiceDefinition, channel)\n}\n\nconst priceMap = new Map<string, number>()\nlet priceClient: PriceServiceClient<RetryOptions>\n\n/**\n *\n * @param chainId chain id refers to CHAIN_MAP\n * @param coinType\n * @param date\n */\nexport async function getPriceByType(chainId: string, coinType: string, date: Date): Promise<number> {\n if (!priceClient) {\n priceClient = getPriceClient()\n }\n\n const dateStr = dateString(date)\n const key = `${coinType}-${dateStr}`\n let price = priceMap.get(key)\n if (price) {\n return price\n }\n\n const response = await priceClient.getPrice(\n {\n timestamp: date,\n coinId: {\n address: {\n chain: chainId,\n address: coinType,\n },\n },\n },\n {\n retry: true,\n retryMaxAttempts: 8,\n }\n )\n price = response.price\n if (response.timestamp && dateString(response.timestamp) === dateStr) {\n priceMap.set(key, price)\n }\n return price\n}\n\n/**\n *\n * @param symbol token symbol like BTC, etc\n * @param date\n */\nexport async function getPriceBySymbol(symbol: string, date: Date): Promise<number> {\n if (!priceClient) {\n priceClient = getPriceClient()\n }\n\n const dateStr = dateString(date)\n const key = `${symbol}-${dateStr}`\n let price = priceMap.get(key)\n if (price) {\n return price\n }\n\n const response = await priceClient.getPrice(\n {\n timestamp: date,\n coinId: {\n symbol,\n },\n },\n {\n retry: true,\n retryMaxAttempts: 8,\n }\n )\n price = response.price\n if (response.timestamp && dateString(response.timestamp) === dateStr) {\n priceMap.set(key, price)\n }\n return price\n}\n\nfunction dateString(date: Date) {\n return [date.getUTCDate(), date.getUTCMonth() + 1, date.getUTCFullYear()].join('-')\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
|
+
import { BigDecimal } from '../core/big-decimal';
|
|
3
|
+
export interface TokenInfo {
|
|
4
|
+
symbol: string;
|
|
5
|
+
name: string;
|
|
6
|
+
decimal: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const NATIVE_ETH: {
|
|
9
|
+
symbol: string;
|
|
10
|
+
decimal: number;
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function getERC20TokenInfo(tokenAddress: string, chainId?: number): Promise<TokenInfo>;
|
|
14
|
+
export declare function getER20NormalizedAmount(tokenAddress: string, amount: BigNumber, chainId: number): Promise<BigDecimal>;
|
|
15
|
+
export declare function scaleDown(amount: BigNumber | bigint, decimal: number): BigDecimal;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scaleDown = exports.getER20NormalizedAmount = exports.getERC20TokenInfo = exports.NATIVE_ETH = void 0;
|
|
4
|
+
const error_1 = require("../error");
|
|
5
|
+
const erc20_1 = require("../builtin/erc20");
|
|
6
|
+
const erc20bytes_processor_1 = require("../builtin/internal/erc20bytes_processor");
|
|
7
|
+
const big_decimal_1 = require("../core/big-decimal");
|
|
8
|
+
const conversion_1 = require("./conversion");
|
|
9
|
+
const ethers_1 = require("ethers");
|
|
10
|
+
exports.NATIVE_ETH = {
|
|
11
|
+
symbol: 'ETH',
|
|
12
|
+
decimal: 18,
|
|
13
|
+
name: 'Native ETH',
|
|
14
|
+
};
|
|
15
|
+
const TOKEN_INFOS = new Map();
|
|
16
|
+
async function getERC20TokenInfo(tokenAddress, chainId = 1) {
|
|
17
|
+
const key = chainId + tokenAddress;
|
|
18
|
+
const res = TOKEN_INFOS.get(key);
|
|
19
|
+
if (res) {
|
|
20
|
+
return res;
|
|
21
|
+
}
|
|
22
|
+
const contract = (0, erc20_1.getERC20Contract)(tokenAddress, chainId);
|
|
23
|
+
const bytesContract = (0, erc20bytes_processor_1.getERC20BytesContract)(tokenAddress, chainId);
|
|
24
|
+
try {
|
|
25
|
+
// TODO maybe not do try catch, just do raw call the parse results
|
|
26
|
+
let name = '';
|
|
27
|
+
try {
|
|
28
|
+
name = await contract.name();
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
name = ethers_1.utils.parseBytes32String(await bytesContract.name());
|
|
32
|
+
}
|
|
33
|
+
let symbol = '';
|
|
34
|
+
try {
|
|
35
|
+
symbol = await contract.symbol();
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
symbol = ethers_1.utils.parseBytes32String(await bytesContract.symbol());
|
|
39
|
+
}
|
|
40
|
+
const decimal = await contract.decimals();
|
|
41
|
+
const info = { name, symbol, decimal };
|
|
42
|
+
TOKEN_INFOS.set(key, info);
|
|
43
|
+
return info;
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
throw (0, error_1.transformEtherError)(e, undefined);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.getERC20TokenInfo = getERC20TokenInfo;
|
|
50
|
+
async function getER20NormalizedAmount(tokenAddress, amount, chainId) {
|
|
51
|
+
const tokenInfo = await getERC20TokenInfo(tokenAddress, chainId);
|
|
52
|
+
return scaleDown(amount, tokenInfo.decimal);
|
|
53
|
+
}
|
|
54
|
+
exports.getER20NormalizedAmount = getER20NormalizedAmount;
|
|
55
|
+
function scaleDown(amount, decimal) {
|
|
56
|
+
const divider = new big_decimal_1.BigDecimal(10).pow(decimal);
|
|
57
|
+
return (0, conversion_1.toBigDecimal)(amount).dividedBy(divider);
|
|
58
|
+
}
|
|
59
|
+
exports.scaleDown = scaleDown;
|
|
60
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/utils/token.ts"],"names":[],"mappings":";;;AAEA,oCAA8C;AAC9C,4CAAmD;AACnD,mFAAgF;AAChF,qDAAgD;AAChD,6CAA2C;AAC3C,mCAA8B;AAQjB,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,YAAY;CACnB,CAAA;AAED,MAAM,WAAW,GAAG,IAAI,GAAG,EAAqB,CAAA;AAEzC,KAAK,UAAU,iBAAiB,CAAC,YAAoB,EAAE,OAAO,GAAG,CAAC;IACvE,MAAM,GAAG,GAAG,OAAO,GAAG,YAAY,CAAA;IAClC,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAChC,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAA;KACX;IACD,MAAM,QAAQ,GAAG,IAAA,wBAAgB,EAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACxD,MAAM,aAAa,GAAG,IAAA,4CAAqB,EAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IAElE,IAAI;QACF,kEAAkE;QAClE,IAAI,IAAI,GAAG,EAAE,CAAA;QACb,IAAI;YACF,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;SAC7B;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,GAAG,cAAK,CAAC,kBAAkB,CAAC,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC,CAAA;SAC5D;QAED,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,IAAI;YACF,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAA;SACjC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,cAAK,CAAC,kBAAkB,CAAC,MAAM,aAAa,CAAC,MAAM,EAAE,CAAC,CAAA;SAChE;QAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,CAAA;QACzC,MAAM,IAAI,GAAc,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA;QACjD,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QAC1B,OAAO,IAAI,CAAA;KACZ;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAA,2BAAmB,EAAC,CAAC,EAAE,SAAS,CAAC,CAAA;KACxC;AACH,CAAC;AAhCD,8CAgCC;AAEM,KAAK,UAAU,uBAAuB,CAC3C,YAAoB,EACpB,MAAiB,EACjB,OAAe;IAEf,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IAChE,OAAO,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;AAC7C,CAAC;AAPD,0DAOC;AAED,SAAgB,SAAS,CAAC,MAA0B,EAAE,OAAe;IACnE,MAAM,OAAO,GAAG,IAAI,wBAAU,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAC/C,OAAO,IAAA,yBAAY,EAAC,MAAM,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;AAChD,CAAC;AAHD,8BAGC","sourcesContent":["import { BigNumber } from '@ethersproject/bignumber'\n\nimport { transformEtherError } from '../error'\nimport { getERC20Contract } from '../builtin/erc20'\nimport { getERC20BytesContract } from '../builtin/internal/erc20bytes_processor'\nimport { BigDecimal } from '../core/big-decimal'\nimport { toBigDecimal } from './conversion'\nimport { utils } from 'ethers'\n\nexport interface TokenInfo {\n symbol: string\n name: string\n decimal: number\n}\n\nexport const NATIVE_ETH = {\n symbol: 'ETH',\n decimal: 18,\n name: 'Native ETH',\n}\n\nconst TOKEN_INFOS = new Map<string, TokenInfo>()\n\nexport async function getERC20TokenInfo(tokenAddress: string, chainId = 1): Promise<TokenInfo> {\n const key = chainId + tokenAddress\n const res = TOKEN_INFOS.get(key)\n if (res) {\n return res\n }\n const contract = getERC20Contract(tokenAddress, chainId)\n const bytesContract = getERC20BytesContract(tokenAddress, chainId)\n\n try {\n // TODO maybe not do try catch, just do raw call the parse results\n let name = ''\n try {\n name = await contract.name()\n } catch (e) {\n name = utils.parseBytes32String(await bytesContract.name())\n }\n\n let symbol = ''\n try {\n symbol = await contract.symbol()\n } catch (e) {\n symbol = utils.parseBytes32String(await bytesContract.symbol())\n }\n\n const decimal = await contract.decimals()\n const info: TokenInfo = { name, symbol, decimal }\n TOKEN_INFOS.set(key, info)\n return info\n } catch (e) {\n throw transformEtherError(e, undefined)\n }\n}\n\nexport async function getER20NormalizedAmount(\n tokenAddress: string,\n amount: BigNumber,\n chainId: number\n): Promise<BigDecimal> {\n const tokenInfo = await getERC20TokenInfo(tokenAddress, chainId)\n return scaleDown(amount, tokenInfo.decimal)\n}\n\nexport function scaleDown(amount: BigNumber | bigint, decimal: number) {\n const divider = new BigDecimal(10).pow(decimal)\n return toBigDecimal(amount).dividedBy(divider)\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentio/sdk",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
+
"version": "1.0.0-rc.2",
|
|
4
5
|
"scripts": {
|
|
5
6
|
"compile_target": "yarn tsc -b src/target-ethers-sentio/tsconfig.json",
|
|
6
|
-
"compile": "tsc -p . && cp src/
|
|
7
|
-
"build": "yarn
|
|
8
|
-
"
|
|
9
|
-
"start_ts": "ts-node --files src/processor-runner.ts ../examples/x2y2/src/processor.ts",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"gen_test_abi": "
|
|
17
|
-
"gen_bultin_evm": "typechain --target
|
|
18
|
-
"
|
|
7
|
+
"compile": "tsc -p . && cp src/utils/*.csv lib/utils",
|
|
8
|
+
"build": "yarn gen && yarn compile",
|
|
9
|
+
"build_all": "yarn lerna run --scope=@sentio/sdk build --include-dependencies",
|
|
10
|
+
"start_ts": "ts-node --files src/processor-runner.ts --log-format=json ../examples/x2y2/src/processor.ts",
|
|
11
|
+
"start": "ts-node --files src/processor-runner.ts ../examples/aptos/dist/lib.js",
|
|
12
|
+
"start_js": "node lib/processor-runner.js ../examples/aptos/dist/lib.js",
|
|
13
|
+
"ts-start": "ts-node --files src/processor-runner.ts ./src/anyswap/src/processor.ts",
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"test-nocache": "yarn jest --clearCache && yarn jest",
|
|
16
|
+
"gen": "yarn compile_target && yarn gen_bultin_evm && yarn gen_bultin_others && yarn gen_test_abi",
|
|
17
|
+
"gen_test_abi": "ts-node src/test-abi-code-gen.ts src/tests/abis src/tests/types",
|
|
18
|
+
"gen_bultin_evm": "typechain --target lib/target-ethers-sentio --out-dir src/builtin/internal 'src/abis/*.json'",
|
|
19
|
+
"gen_bultin_others": "ts-node src/test-abi-code-gen.ts src/abis src/builtin",
|
|
20
|
+
"docs": "typedoc --options typedoc.json"
|
|
19
21
|
},
|
|
20
|
-
"bin": {
|
|
21
|
-
"processor-runner": "./dist/processor-runner.js",
|
|
22
|
-
"sentio": "./dist/cli/cli.js"
|
|
23
|
-
},
|
|
24
|
-
"version": "1.0.0-development",
|
|
25
22
|
"dependencies": {
|
|
26
23
|
"@ethersproject/providers": "~5.7.0",
|
|
27
|
-
"@project-serum/anchor": "^0.
|
|
28
|
-
"@
|
|
24
|
+
"@project-serum/anchor": "^0.26.0",
|
|
25
|
+
"@sentio/cli": "^1.0.0",
|
|
29
26
|
"@solana/web3.js": "^1.47.3",
|
|
30
27
|
"@typechain/ethers-v5": "^10.0.0",
|
|
31
28
|
"@types/bn.js": "^5.1.0",
|
|
32
|
-
"@types/
|
|
33
|
-
"
|
|
29
|
+
"@types/bs58": "^4.0.1",
|
|
30
|
+
"aptos-sdk": "npm:aptos@^1.3.17",
|
|
31
|
+
"bignumber.js": "^9.1.0",
|
|
34
32
|
"bn.js": "^5.2.1",
|
|
35
33
|
"bs58": "^5.0.0",
|
|
36
34
|
"command-line-args": "^5.2.1",
|
|
37
35
|
"command-line-usage": "^6.1.3",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"fs-extra": "^
|
|
36
|
+
"csv-parse": "^5.3.0",
|
|
37
|
+
"ethers": "~5.7.1",
|
|
38
|
+
"fs-extra": "^11.0.0",
|
|
41
39
|
"google-protobuf": "^3.15.8",
|
|
42
40
|
"js-yaml": "^4.1.0",
|
|
43
41
|
"nice-grpc": "^2.0.0",
|
|
44
|
-
"
|
|
42
|
+
"nice-grpc-client-middleware-retry": "^2.0.1",
|
|
43
|
+
"nice-grpc-error-details": "^0.1.4",
|
|
45
44
|
"p-queue": "^6.6.2",
|
|
46
|
-
"ts-loader": "^9.3.0",
|
|
47
45
|
"typechain": "^8.0.0",
|
|
48
|
-
"
|
|
49
|
-
|
|
46
|
+
"winston": "^3.8.2"
|
|
47
|
+
},
|
|
48
|
+
"resolutions": {
|
|
49
|
+
"@grpc/grpc-js": "1.7.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/chai": "^4.3.1",
|
|
@@ -56,21 +56,22 @@
|
|
|
56
56
|
"@types/fs-extra": "^9.0.13",
|
|
57
57
|
"@types/google-protobuf": "^3.15.6",
|
|
58
58
|
"@types/js-yaml": "^4.0.5",
|
|
59
|
-
"@types/mkdirp": "^1.0.2",
|
|
60
|
-
"@types/mocha": "^9.1.1",
|
|
61
59
|
"@types/node": "^18.0.4",
|
|
62
|
-
"
|
|
63
|
-
"mocha": "^10.0.0",
|
|
64
|
-
"semantic-release": "^19.0.5",
|
|
65
|
-
"ts-mocha": "^10.0.0",
|
|
66
|
-
"ts-node": "^10.8.0",
|
|
67
|
-
"tsconfig-paths": "^4.0.0",
|
|
68
|
-
"typescript": "^4.8.0"
|
|
60
|
+
"typedoc": "^0.23.15"
|
|
69
61
|
},
|
|
62
|
+
"bin": {
|
|
63
|
+
"processor-runner": "./lib/processor-runner.js"
|
|
64
|
+
},
|
|
65
|
+
"main": "./lib/index.js",
|
|
66
|
+
"types": "./lib/index.d.ts",
|
|
67
|
+
"module": "./lib/index.js",
|
|
70
68
|
"files": [
|
|
71
|
-
"
|
|
69
|
+
"{lib,src,templates}",
|
|
70
|
+
"!{lib,src}/tests",
|
|
71
|
+
"!**/*.test.{js,ts}"
|
|
72
72
|
],
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=16"
|
|
75
|
+
},
|
|
76
|
+
"gitHead": "9e9713c08f812579f2662ab304caf56804a67efe"
|
|
76
77
|
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{ "internalType": "address", "name": "_aggregator", "type": "address" },
|
|
5
|
+
{ "internalType": "address", "name": "_accessController", "type": "address" }
|
|
6
|
+
],
|
|
7
|
+
"stateMutability": "nonpayable",
|
|
8
|
+
"type": "constructor"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"anonymous": false,
|
|
12
|
+
"inputs": [
|
|
13
|
+
{ "indexed": true, "internalType": "int256", "name": "current", "type": "int256" },
|
|
14
|
+
{ "indexed": true, "internalType": "uint256", "name": "roundId", "type": "uint256" },
|
|
15
|
+
{ "indexed": false, "internalType": "uint256", "name": "updatedAt", "type": "uint256" }
|
|
16
|
+
],
|
|
17
|
+
"name": "AnswerUpdated",
|
|
18
|
+
"type": "event"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"anonymous": false,
|
|
22
|
+
"inputs": [
|
|
23
|
+
{ "indexed": true, "internalType": "uint256", "name": "roundId", "type": "uint256" },
|
|
24
|
+
{ "indexed": true, "internalType": "address", "name": "startedBy", "type": "address" },
|
|
25
|
+
{ "indexed": false, "internalType": "uint256", "name": "startedAt", "type": "uint256" }
|
|
26
|
+
],
|
|
27
|
+
"name": "NewRound",
|
|
28
|
+
"type": "event"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"anonymous": false,
|
|
32
|
+
"inputs": [
|
|
33
|
+
{ "indexed": true, "internalType": "address", "name": "from", "type": "address" },
|
|
34
|
+
{ "indexed": true, "internalType": "address", "name": "to", "type": "address" }
|
|
35
|
+
],
|
|
36
|
+
"name": "OwnershipTransferRequested",
|
|
37
|
+
"type": "event"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"anonymous": false,
|
|
41
|
+
"inputs": [
|
|
42
|
+
{ "indexed": true, "internalType": "address", "name": "from", "type": "address" },
|
|
43
|
+
{ "indexed": true, "internalType": "address", "name": "to", "type": "address" }
|
|
44
|
+
],
|
|
45
|
+
"name": "OwnershipTransferred",
|
|
46
|
+
"type": "event"
|
|
47
|
+
},
|
|
48
|
+
{ "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
|
|
49
|
+
{
|
|
50
|
+
"inputs": [],
|
|
51
|
+
"name": "accessController",
|
|
52
|
+
"outputs": [{ "internalType": "contract AccessControllerInterface", "name": "", "type": "address" }],
|
|
53
|
+
"stateMutability": "view",
|
|
54
|
+
"type": "function"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"inputs": [],
|
|
58
|
+
"name": "aggregator",
|
|
59
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
60
|
+
"stateMutability": "view",
|
|
61
|
+
"type": "function"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"inputs": [{ "internalType": "address", "name": "_aggregator", "type": "address" }],
|
|
65
|
+
"name": "confirmAggregator",
|
|
66
|
+
"outputs": [],
|
|
67
|
+
"stateMutability": "nonpayable",
|
|
68
|
+
"type": "function"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"inputs": [],
|
|
72
|
+
"name": "decimals",
|
|
73
|
+
"outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
|
|
74
|
+
"stateMutability": "view",
|
|
75
|
+
"type": "function"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"inputs": [],
|
|
79
|
+
"name": "description",
|
|
80
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
81
|
+
"stateMutability": "view",
|
|
82
|
+
"type": "function"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"inputs": [{ "internalType": "uint256", "name": "_roundId", "type": "uint256" }],
|
|
86
|
+
"name": "getAnswer",
|
|
87
|
+
"outputs": [{ "internalType": "int256", "name": "", "type": "int256" }],
|
|
88
|
+
"stateMutability": "view",
|
|
89
|
+
"type": "function"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"inputs": [{ "internalType": "uint80", "name": "_roundId", "type": "uint80" }],
|
|
93
|
+
"name": "getRoundData",
|
|
94
|
+
"outputs": [
|
|
95
|
+
{ "internalType": "uint80", "name": "roundId", "type": "uint80" },
|
|
96
|
+
{ "internalType": "int256", "name": "answer", "type": "int256" },
|
|
97
|
+
{ "internalType": "uint256", "name": "startedAt", "type": "uint256" },
|
|
98
|
+
{ "internalType": "uint256", "name": "updatedAt", "type": "uint256" },
|
|
99
|
+
{ "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }
|
|
100
|
+
],
|
|
101
|
+
"stateMutability": "view",
|
|
102
|
+
"type": "function"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"inputs": [{ "internalType": "uint256", "name": "_roundId", "type": "uint256" }],
|
|
106
|
+
"name": "getTimestamp",
|
|
107
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
108
|
+
"stateMutability": "view",
|
|
109
|
+
"type": "function"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"inputs": [],
|
|
113
|
+
"name": "latestAnswer",
|
|
114
|
+
"outputs": [{ "internalType": "int256", "name": "", "type": "int256" }],
|
|
115
|
+
"stateMutability": "view",
|
|
116
|
+
"type": "function"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"inputs": [],
|
|
120
|
+
"name": "latestRound",
|
|
121
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
122
|
+
"stateMutability": "view",
|
|
123
|
+
"type": "function"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"inputs": [],
|
|
127
|
+
"name": "latestRoundData",
|
|
128
|
+
"outputs": [
|
|
129
|
+
{ "internalType": "uint80", "name": "roundId", "type": "uint80" },
|
|
130
|
+
{ "internalType": "int256", "name": "answer", "type": "int256" },
|
|
131
|
+
{ "internalType": "uint256", "name": "startedAt", "type": "uint256" },
|
|
132
|
+
{ "internalType": "uint256", "name": "updatedAt", "type": "uint256" },
|
|
133
|
+
{ "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }
|
|
134
|
+
],
|
|
135
|
+
"stateMutability": "view",
|
|
136
|
+
"type": "function"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"inputs": [],
|
|
140
|
+
"name": "latestTimestamp",
|
|
141
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
142
|
+
"stateMutability": "view",
|
|
143
|
+
"type": "function"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"inputs": [],
|
|
147
|
+
"name": "owner",
|
|
148
|
+
"outputs": [{ "internalType": "address payable", "name": "", "type": "address" }],
|
|
149
|
+
"stateMutability": "view",
|
|
150
|
+
"type": "function"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }],
|
|
154
|
+
"name": "phaseAggregators",
|
|
155
|
+
"outputs": [{ "internalType": "contract AggregatorV2V3Interface", "name": "", "type": "address" }],
|
|
156
|
+
"stateMutability": "view",
|
|
157
|
+
"type": "function"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"inputs": [],
|
|
161
|
+
"name": "phaseId",
|
|
162
|
+
"outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }],
|
|
163
|
+
"stateMutability": "view",
|
|
164
|
+
"type": "function"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"inputs": [{ "internalType": "address", "name": "_aggregator", "type": "address" }],
|
|
168
|
+
"name": "proposeAggregator",
|
|
169
|
+
"outputs": [],
|
|
170
|
+
"stateMutability": "nonpayable",
|
|
171
|
+
"type": "function"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"inputs": [],
|
|
175
|
+
"name": "proposedAggregator",
|
|
176
|
+
"outputs": [{ "internalType": "contract AggregatorV2V3Interface", "name": "", "type": "address" }],
|
|
177
|
+
"stateMutability": "view",
|
|
178
|
+
"type": "function"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"inputs": [{ "internalType": "uint80", "name": "_roundId", "type": "uint80" }],
|
|
182
|
+
"name": "proposedGetRoundData",
|
|
183
|
+
"outputs": [
|
|
184
|
+
{ "internalType": "uint80", "name": "roundId", "type": "uint80" },
|
|
185
|
+
{ "internalType": "int256", "name": "answer", "type": "int256" },
|
|
186
|
+
{ "internalType": "uint256", "name": "startedAt", "type": "uint256" },
|
|
187
|
+
{ "internalType": "uint256", "name": "updatedAt", "type": "uint256" },
|
|
188
|
+
{ "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }
|
|
189
|
+
],
|
|
190
|
+
"stateMutability": "view",
|
|
191
|
+
"type": "function"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"inputs": [],
|
|
195
|
+
"name": "proposedLatestRoundData",
|
|
196
|
+
"outputs": [
|
|
197
|
+
{ "internalType": "uint80", "name": "roundId", "type": "uint80" },
|
|
198
|
+
{ "internalType": "int256", "name": "answer", "type": "int256" },
|
|
199
|
+
{ "internalType": "uint256", "name": "startedAt", "type": "uint256" },
|
|
200
|
+
{ "internalType": "uint256", "name": "updatedAt", "type": "uint256" },
|
|
201
|
+
{ "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }
|
|
202
|
+
],
|
|
203
|
+
"stateMutability": "view",
|
|
204
|
+
"type": "function"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"inputs": [{ "internalType": "address", "name": "_accessController", "type": "address" }],
|
|
208
|
+
"name": "setController",
|
|
209
|
+
"outputs": [],
|
|
210
|
+
"stateMutability": "nonpayable",
|
|
211
|
+
"type": "function"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"inputs": [{ "internalType": "address", "name": "_to", "type": "address" }],
|
|
215
|
+
"name": "transferOwnership",
|
|
216
|
+
"outputs": [],
|
|
217
|
+
"stateMutability": "nonpayable",
|
|
218
|
+
"type": "function"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"inputs": [],
|
|
222
|
+
"name": "version",
|
|
223
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
224
|
+
"stateMutability": "view",
|
|
225
|
+
"type": "function"
|
|
226
|
+
}
|
|
227
|
+
]
|