@sentio/sdk 3.9.0-rc.9 → 4.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/lib/aptos/aptos-plugin.d.ts +1 -1
- package/lib/aptos/aptos-plugin.d.ts.map +1 -1
- package/lib/aptos/aptos-plugin.js +43 -42
- package/lib/aptos/aptos-plugin.js.map +1 -1
- package/lib/aptos/aptos-processor.d.ts +4 -4
- package/lib/aptos/aptos-processor.d.ts.map +1 -1
- package/lib/aptos/aptos-processor.js +25 -25
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/aptos-resource-processor-template.d.ts +1 -1
- package/lib/aptos/aptos-resource-processor-template.d.ts.map +1 -1
- package/lib/aptos/aptos-resource-processor-template.js +10 -5
- package/lib/aptos/aptos-resource-processor-template.js.map +1 -1
- package/lib/aptos/context.d.ts +1 -1
- package/lib/aptos/context.d.ts.map +1 -1
- package/lib/aptos/context.js +8 -6
- package/lib/aptos/context.js.map +1 -1
- package/lib/aptos/data.d.ts +4 -4
- package/lib/aptos/data.d.ts.map +1 -1
- package/lib/core/base-context.d.ts +3 -2
- package/lib/core/base-context.d.ts.map +1 -1
- package/lib/core/base-context.js +12 -11
- package/lib/core/base-context.js.map +1 -1
- package/lib/core/core-plugin.d.ts.map +1 -1
- package/lib/core/core-plugin.js +6 -4
- package/lib/core/core-plugin.js.map +1 -1
- package/lib/core/event-logger.d.ts +10 -2
- package/lib/core/event-logger.d.ts.map +1 -1
- package/lib/core/event-logger.js +42 -26
- package/lib/core/event-logger.js.map +1 -1
- package/lib/core/exporter.d.ts.map +1 -1
- package/lib/core/exporter.js +5 -3
- package/lib/core/exporter.js.map +1 -1
- package/lib/core/handler-options.d.ts +1 -1
- package/lib/core/handler-options.d.ts.map +1 -1
- package/lib/core/handler-register.d.ts +1 -1
- package/lib/core/handler-register.d.ts.map +1 -1
- package/lib/core/handler-register.js +2 -2
- package/lib/core/handler-register.js.map +1 -1
- package/lib/core/meter.d.ts +4 -3
- package/lib/core/meter.d.ts.map +1 -1
- package/lib/core/meter.js +5 -4
- package/lib/core/meter.js.map +1 -1
- package/lib/core/normalization.d.ts +1 -1
- package/lib/core/normalization.d.ts.map +1 -1
- package/lib/core/normalization.js +41 -31
- package/lib/core/normalization.js.map +1 -1
- package/lib/core/numberish.d.ts +1 -1
- package/lib/core/numberish.d.ts.map +1 -1
- package/lib/core/numberish.js +35 -30
- package/lib/core/numberish.js.map +1 -1
- package/lib/core/partition-handler-manager.d.ts +1 -1
- package/lib/core/partition-handler-manager.d.ts.map +1 -1
- package/lib/core/partition-handler-manager.js +10 -9
- package/lib/core/partition-handler-manager.js.map +1 -1
- package/lib/cosmos/context.d.ts.map +1 -1
- package/lib/cosmos/context.js +4 -2
- package/lib/cosmos/context.js.map +1 -1
- package/lib/cosmos/cosmos-plugin.d.ts.map +1 -1
- package/lib/cosmos/cosmos-plugin.js +11 -10
- package/lib/cosmos/cosmos-plugin.js.map +1 -1
- package/lib/cosmos/cosmos-processor.js.map +1 -1
- package/lib/eth/abi-decoder/decode-worker.js +2 -2
- package/lib/eth/abi-decoder/decode-worker.js.map +1 -1
- package/lib/eth/account-processor.d.ts +2 -2
- package/lib/eth/account-processor.d.ts.map +1 -1
- package/lib/eth/account-processor.js +10 -9
- package/lib/eth/account-processor.js.map +1 -1
- package/lib/eth/base-processor-template.d.ts +3 -3
- package/lib/eth/base-processor-template.d.ts.map +1 -1
- package/lib/eth/base-processor-template.js +14 -8
- package/lib/eth/base-processor-template.js.map +1 -1
- package/lib/eth/base-processor.d.ts +3 -3
- package/lib/eth/base-processor.d.ts.map +1 -1
- package/lib/eth/base-processor.js +53 -46
- package/lib/eth/base-processor.js.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +48 -46
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +18 -16
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +38 -36
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +20 -18
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +30 -28
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +24 -22
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/file.d.ts.map +1 -1
- package/lib/eth/codegen/file.js +2 -1
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/function-calls.js +1 -1
- package/lib/eth/context.d.ts +1 -1
- package/lib/eth/context.d.ts.map +1 -1
- package/lib/eth/context.js +12 -10
- package/lib/eth/context.js.map +1 -1
- package/lib/eth/eth-plugin.d.ts.map +1 -1
- package/lib/eth/eth-plugin.js +83 -75
- package/lib/eth/eth-plugin.js.map +1 -1
- package/lib/eth/eth.d.ts +6 -6
- package/lib/eth/eth.d.ts.map +1 -1
- package/lib/eth/eth.js +22 -14
- package/lib/eth/eth.js.map +1 -1
- package/lib/eth/index.d.ts +1 -1
- package/lib/eth/index.d.ts.map +1 -1
- package/lib/eth/index.js +0 -1
- package/lib/eth/index.js.map +1 -1
- package/lib/fuel/asset-processor.d.ts +2 -2
- package/lib/fuel/asset-processor.d.ts.map +1 -1
- package/lib/fuel/asset-processor.js +5 -3
- package/lib/fuel/asset-processor.js.map +1 -1
- package/lib/fuel/context.d.ts.map +1 -1
- package/lib/fuel/context.js +4 -2
- package/lib/fuel/context.js.map +1 -1
- package/lib/fuel/fuel-plugin.d.ts.map +1 -1
- package/lib/fuel/fuel-plugin.js +41 -53
- package/lib/fuel/fuel-plugin.js.map +1 -1
- package/lib/fuel/fuel-processor-template.d.ts.map +1 -1
- package/lib/fuel/fuel-processor-template.js +9 -5
- package/lib/fuel/fuel-processor-template.js.map +1 -1
- package/lib/fuel/fuel-processor.d.ts.map +1 -1
- package/lib/fuel/fuel-processor.js +30 -20
- package/lib/fuel/fuel-processor.js.map +1 -1
- package/lib/fuel/global-processor.d.ts.map +1 -1
- package/lib/fuel/global-processor.js +2 -1
- package/lib/fuel/global-processor.js.map +1 -1
- package/lib/fuel/types.d.ts +10 -4
- package/lib/fuel/types.d.ts.map +1 -1
- package/lib/fuel/types.js.map +1 -1
- package/lib/iota/context.d.ts +1 -1
- package/lib/iota/context.d.ts.map +1 -1
- package/lib/iota/context.js +8 -6
- package/lib/iota/context.js.map +1 -1
- package/lib/iota/iota-object-processor-template.d.ts +1 -1
- package/lib/iota/iota-object-processor-template.d.ts.map +1 -1
- package/lib/iota/iota-object-processor-template.js +17 -12
- package/lib/iota/iota-object-processor-template.js.map +1 -1
- package/lib/iota/iota-object-processor.d.ts +1 -1
- package/lib/iota/iota-object-processor.d.ts.map +1 -1
- package/lib/iota/iota-object-processor.js +23 -16
- package/lib/iota/iota-object-processor.js.map +1 -1
- package/lib/iota/iota-plugin-part.d.ts +1 -1
- package/lib/iota/iota-plugin-part.d.ts.map +1 -1
- package/lib/iota/iota-plugin-part.js +16 -15
- package/lib/iota/iota-plugin-part.js.map +1 -1
- package/lib/iota/iota-processor.d.ts +3 -3
- package/lib/iota/iota-processor.d.ts.map +1 -1
- package/lib/iota/iota-processor.js +20 -19
- package/lib/iota/iota-processor.js.map +1 -1
- package/lib/iota/network.js +2 -2
- package/lib/iota/network.js.map +1 -1
- package/lib/move/filter.d.ts +1 -1
- package/lib/move/filter.d.ts.map +1 -1
- package/lib/move/index.d.ts +1 -1
- package/lib/move/index.d.ts.map +1 -1
- package/lib/move/index.js +0 -1
- package/lib/move/index.js.map +1 -1
- package/lib/solana/builtin/types.d.ts +4 -4
- package/lib/solana/codegen/codegen.d.ts +1 -1
- package/lib/solana/codegen/codegen.d.ts.map +1 -1
- package/lib/solana/codegen/codegen.js +2 -2
- package/lib/solana/codegen/codegen.js.map +1 -1
- package/lib/solana/solana-context.d.ts.map +1 -1
- package/lib/solana/solana-context.js +4 -3
- package/lib/solana/solana-context.js.map +1 -1
- package/lib/solana/solana-plugin.d.ts.map +1 -1
- package/lib/solana/solana-plugin.js +19 -18
- package/lib/solana/solana-plugin.js.map +1 -1
- package/lib/solana/solana-processor.d.ts +2 -2
- package/lib/solana/solana-processor.d.ts.map +1 -1
- package/lib/solana/solana-processor.js +8 -3
- package/lib/solana/solana-processor.js.map +1 -1
- package/lib/store/cache.d.ts.map +1 -1
- package/lib/store/cache.js +22 -17
- package/lib/store/cache.js.map +1 -1
- package/lib/store/codegen.js +2 -2
- package/lib/store/codegen.js.map +1 -1
- package/lib/store/convert.d.ts +1 -1
- package/lib/store/convert.d.ts.map +1 -1
- package/lib/store/convert.js +67 -104
- package/lib/store/convert.js.map +1 -1
- package/lib/store/decorators.d.ts +1 -1
- package/lib/store/decorators.d.ts.map +1 -1
- package/lib/store/decorators.js +3 -1
- package/lib/store/decorators.js.map +1 -1
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +24 -16
- package/lib/store/store.js.map +1 -1
- package/lib/store/types.js +24 -32
- package/lib/store/types.js.map +1 -1
- package/lib/store/util.d.ts +1 -1
- package/lib/store/util.d.ts.map +1 -1
- package/lib/store/util.js +13 -17
- package/lib/store/util.js.map +1 -1
- package/lib/sui/context.d.ts +1 -1
- package/lib/sui/context.d.ts.map +1 -1
- package/lib/sui/context.js +8 -6
- package/lib/sui/context.js.map +1 -1
- package/lib/sui/sui-object-processor-template.d.ts +1 -1
- package/lib/sui/sui-object-processor-template.d.ts.map +1 -1
- package/lib/sui/sui-object-processor-template.js +17 -12
- package/lib/sui/sui-object-processor-template.js.map +1 -1
- package/lib/sui/sui-object-processor.d.ts +1 -1
- package/lib/sui/sui-object-processor.d.ts.map +1 -1
- package/lib/sui/sui-object-processor.js +23 -16
- package/lib/sui/sui-object-processor.js.map +1 -1
- package/lib/sui/sui-plugin-part.d.ts +1 -1
- package/lib/sui/sui-plugin-part.d.ts.map +1 -1
- package/lib/sui/sui-plugin-part.js +16 -15
- package/lib/sui/sui-plugin-part.js.map +1 -1
- package/lib/sui/sui-plugin.d.ts +1 -1
- package/lib/sui/sui-plugin.d.ts.map +1 -1
- package/lib/sui/sui-plugin.js +35 -34
- package/lib/sui/sui-plugin.js.map +1 -1
- package/lib/sui/sui-processor.d.ts +3 -3
- package/lib/sui/sui-processor.d.ts.map +1 -1
- package/lib/sui/sui-processor.js +20 -19
- package/lib/sui/sui-processor.js.map +1 -1
- package/lib/testing/aptos-facet.d.ts.map +1 -1
- package/lib/testing/aptos-facet.js +18 -11
- package/lib/testing/aptos-facet.js.map +1 -1
- package/lib/testing/cosmos-facet.d.ts.map +1 -1
- package/lib/testing/cosmos-facet.js +10 -6
- package/lib/testing/cosmos-facet.js.map +1 -1
- package/lib/testing/eth-facet.d.ts +1 -1
- package/lib/testing/eth-facet.d.ts.map +1 -1
- package/lib/testing/eth-facet.js +34 -18
- package/lib/testing/eth-facet.js.map +1 -1
- package/lib/testing/fuel-facet.d.ts.map +1 -1
- package/lib/testing/fuel-facet.js +28 -18
- package/lib/testing/fuel-facet.js.map +1 -1
- package/lib/testing/iota-facet.d.ts.map +1 -1
- package/lib/testing/iota-facet.js +32 -20
- package/lib/testing/iota-facet.js.map +1 -1
- package/lib/testing/memory-database.d.ts +1 -1
- package/lib/testing/memory-database.d.ts.map +1 -1
- package/lib/testing/memory-database.js +82 -69
- package/lib/testing/memory-database.js.map +1 -1
- package/lib/testing/metric-utils.d.ts +2 -2
- package/lib/testing/metric-utils.d.ts.map +1 -1
- package/lib/testing/metric-utils.js +13 -12
- package/lib/testing/metric-utils.js.map +1 -1
- package/lib/testing/solana-facet.d.ts +3 -2
- package/lib/testing/solana-facet.d.ts.map +1 -1
- package/lib/testing/solana-facet.js +8 -5
- package/lib/testing/solana-facet.js.map +1 -1
- package/lib/testing/sui-facet.d.ts.map +1 -1
- package/lib/testing/sui-facet.js +30 -20
- package/lib/testing/sui-facet.js.map +1 -1
- package/lib/testing/test-processor-server.d.ts +19 -13
- package/lib/testing/test-processor-server.d.ts.map +1 -1
- package/lib/testing/test-processor-server.js +22 -20
- package/lib/testing/test-processor-server.js.map +1 -1
- package/lib/utils/price.d.ts +1 -1
- package/lib/utils/price.d.ts.map +1 -1
- package/lib/utils/price.js +19 -12
- package/lib/utils/price.js.map +1 -1
- package/package.json +10 -12
- package/src/aptos/aptos-plugin.ts +105 -91
- package/src/aptos/aptos-processor.ts +42 -34
- package/src/aptos/aptos-resource-processor-template.ts +15 -6
- package/src/aptos/context.ts +8 -7
- package/src/aptos/data.ts +4 -4
- package/src/core/base-context.ts +19 -12
- package/src/core/core-plugin.ts +10 -7
- package/src/core/event-logger.ts +63 -34
- package/src/core/exporter.ts +5 -4
- package/src/core/handler-options.ts +1 -1
- package/src/core/handler-register.ts +3 -3
- package/src/core/meter.ts +9 -7
- package/src/core/normalization.ts +53 -31
- package/src/core/numberish.ts +46 -30
- package/src/core/partition-handler-manager.ts +13 -11
- package/src/cosmos/context.ts +4 -3
- package/src/cosmos/cosmos-plugin.ts +19 -15
- package/src/cosmos/cosmos-processor.ts +2 -2
- package/src/eth/abi-decoder/decode-worker.ts +2 -2
- package/src/eth/account-processor.ts +21 -12
- package/src/eth/base-processor-template.ts +27 -11
- package/src/eth/base-processor.ts +77 -65
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +177 -116
- package/src/eth/builtin/internal/erc1155-processor.ts +73 -38
- package/src/eth/builtin/internal/erc20-processor.ts +152 -91
- package/src/eth/builtin/internal/erc20bytes-processor.ts +80 -46
- package/src/eth/builtin/internal/erc721-processor.ts +109 -65
- package/src/eth/builtin/internal/weth9-processor.ts +95 -56
- package/src/eth/codegen/file.ts +2 -1
- package/src/eth/codegen/function-calls.ts +1 -1
- package/src/eth/context.ts +18 -11
- package/src/eth/eth-plugin.ts +135 -118
- package/src/eth/eth.ts +29 -20
- package/src/eth/index.ts +1 -1
- package/src/fuel/asset-processor.ts +16 -8
- package/src/fuel/context.ts +4 -3
- package/src/fuel/fuel-plugin.ts +71 -73
- package/src/fuel/fuel-processor-template.ts +10 -7
- package/src/fuel/fuel-processor.ts +35 -23
- package/src/fuel/global-processor.ts +3 -3
- package/src/fuel/types.ts +10 -4
- package/src/iota/context.ts +8 -7
- package/src/iota/iota-object-processor-template.ts +25 -15
- package/src/iota/iota-object-processor.ts +33 -22
- package/src/iota/iota-plugin-part.ts +41 -34
- package/src/iota/iota-processor.ts +35 -27
- package/src/iota/network.ts +2 -2
- package/src/move/filter.ts +1 -1
- package/src/move/index.ts +1 -1
- package/src/solana/codegen/codegen.ts +2 -2
- package/src/solana/solana-context.ts +4 -3
- package/src/solana/solana-plugin.ts +27 -24
- package/src/solana/solana-processor.ts +23 -11
- package/src/store/cache.ts +22 -18
- package/src/store/codegen.ts +2 -2
- package/src/store/convert.ts +68 -104
- package/src/store/decorators.ts +3 -2
- package/src/store/store.ts +31 -23
- package/src/store/types.ts +24 -33
- package/src/store/util.ts +13 -18
- package/src/sui/context.ts +8 -7
- package/src/sui/sui-object-processor-template.ts +25 -15
- package/src/sui/sui-object-processor.ts +33 -22
- package/src/sui/sui-plugin-part.ts +41 -34
- package/src/sui/sui-plugin.ts +49 -47
- package/src/sui/sui-processor.ts +35 -27
- package/src/testing/aptos-facet.ts +18 -11
- package/src/testing/cosmos-facet.ts +10 -6
- package/src/testing/eth-facet.ts +40 -18
- package/src/testing/fuel-facet.ts +28 -18
- package/src/testing/iota-facet.ts +32 -20
- package/src/testing/memory-database.ts +109 -82
- package/src/testing/metric-utils.ts +15 -14
- package/src/testing/solana-facet.ts +11 -6
- package/src/testing/sui-facet.ts +30 -20
- package/src/testing/test-processor-server.ts +64 -58
- package/src/utils/price.ts +20 -13
|
@@ -24,7 +24,13 @@ import {
|
|
|
24
24
|
PreprocessResult,
|
|
25
25
|
encodeCallData,
|
|
26
26
|
} from "@sentio/sdk/eth";
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
EthCallParam,
|
|
29
|
+
EthCallContext,
|
|
30
|
+
EthCallContextSchema,
|
|
31
|
+
PreparedData,
|
|
32
|
+
} from "@sentio/protos";
|
|
33
|
+
import { create } from "@bufbuild/protobuf";
|
|
28
34
|
|
|
29
35
|
import { ERC721__factory } from "./index.js";
|
|
30
36
|
import {
|
|
@@ -754,57 +760,78 @@ export class ERC721BoundContractView extends BoundContractView<
|
|
|
754
760
|
tokenId: BigNumberish,
|
|
755
761
|
overrides?: Overrides,
|
|
756
762
|
): EthCallParam {
|
|
757
|
-
return this.view.encodeCall.approve(
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
763
|
+
return this.view.encodeCall.approve(
|
|
764
|
+
to,
|
|
765
|
+
tokenId,
|
|
766
|
+
create(EthCallContextSchema, {
|
|
767
|
+
chainId: this.context.chainId.toString(),
|
|
768
|
+
address: this.context.address,
|
|
769
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
770
|
+
}),
|
|
771
|
+
);
|
|
762
772
|
},
|
|
763
773
|
totalSupply(overrides?: Overrides): EthCallParam {
|
|
764
|
-
return this.view.encodeCall.totalSupply(
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
774
|
+
return this.view.encodeCall.totalSupply(
|
|
775
|
+
create(EthCallContextSchema, {
|
|
776
|
+
chainId: this.context.chainId.toString(),
|
|
777
|
+
address: this.context.address,
|
|
778
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
779
|
+
}),
|
|
780
|
+
);
|
|
769
781
|
},
|
|
770
782
|
balanceOf(owner: string, overrides?: Overrides): EthCallParam {
|
|
771
|
-
return this.view.encodeCall.balanceOf(
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
783
|
+
return this.view.encodeCall.balanceOf(
|
|
784
|
+
owner,
|
|
785
|
+
create(EthCallContextSchema, {
|
|
786
|
+
chainId: this.context.chainId.toString(),
|
|
787
|
+
address: this.context.address,
|
|
788
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
789
|
+
}),
|
|
790
|
+
);
|
|
776
791
|
},
|
|
777
792
|
getApproved(tokenId: BigNumberish, overrides?: Overrides): EthCallParam {
|
|
778
|
-
return this.view.encodeCall.getApproved(
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
793
|
+
return this.view.encodeCall.getApproved(
|
|
794
|
+
tokenId,
|
|
795
|
+
create(EthCallContextSchema, {
|
|
796
|
+
chainId: this.context.chainId.toString(),
|
|
797
|
+
address: this.context.address,
|
|
798
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
799
|
+
}),
|
|
800
|
+
);
|
|
783
801
|
},
|
|
784
802
|
isApprovedForAll(
|
|
785
803
|
owner: string,
|
|
786
804
|
operator: string,
|
|
787
805
|
overrides?: Overrides,
|
|
788
806
|
): EthCallParam {
|
|
789
|
-
return this.view.encodeCall.isApprovedForAll(
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
807
|
+
return this.view.encodeCall.isApprovedForAll(
|
|
808
|
+
owner,
|
|
809
|
+
operator,
|
|
810
|
+
create(EthCallContextSchema, {
|
|
811
|
+
chainId: this.context.chainId.toString(),
|
|
812
|
+
address: this.context.address,
|
|
813
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
814
|
+
}),
|
|
815
|
+
);
|
|
794
816
|
},
|
|
795
817
|
name(overrides?: Overrides): EthCallParam {
|
|
796
|
-
return this.view.encodeCall.name(
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
818
|
+
return this.view.encodeCall.name(
|
|
819
|
+
create(EthCallContextSchema, {
|
|
820
|
+
chainId: this.context.chainId.toString(),
|
|
821
|
+
address: this.context.address,
|
|
822
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
823
|
+
}),
|
|
824
|
+
);
|
|
801
825
|
},
|
|
802
826
|
ownerOf(tokenId: BigNumberish, overrides?: Overrides): EthCallParam {
|
|
803
|
-
return this.view.encodeCall.ownerOf(
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
827
|
+
return this.view.encodeCall.ownerOf(
|
|
828
|
+
tokenId,
|
|
829
|
+
create(EthCallContextSchema, {
|
|
830
|
+
chainId: this.context.chainId.toString(),
|
|
831
|
+
address: this.context.address,
|
|
832
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
833
|
+
}),
|
|
834
|
+
);
|
|
808
835
|
},
|
|
809
836
|
safeTransferFrom_address_address_uint256(
|
|
810
837
|
from: string,
|
|
@@ -816,11 +843,11 @@ export class ERC721BoundContractView extends BoundContractView<
|
|
|
816
843
|
from,
|
|
817
844
|
to,
|
|
818
845
|
tokenId,
|
|
819
|
-
{
|
|
846
|
+
create(EthCallContextSchema, {
|
|
820
847
|
chainId: this.context.chainId.toString(),
|
|
821
848
|
address: this.context.address,
|
|
822
849
|
blockTag: this.context.getBlockTag(overrides),
|
|
823
|
-
},
|
|
850
|
+
}),
|
|
824
851
|
);
|
|
825
852
|
},
|
|
826
853
|
safeTransferFrom_address_address_uint256_bytes(
|
|
@@ -835,11 +862,11 @@ export class ERC721BoundContractView extends BoundContractView<
|
|
|
835
862
|
to,
|
|
836
863
|
tokenId,
|
|
837
864
|
data,
|
|
838
|
-
{
|
|
865
|
+
create(EthCallContextSchema, {
|
|
839
866
|
chainId: this.context.chainId.toString(),
|
|
840
867
|
address: this.context.address,
|
|
841
868
|
blockTag: this.context.getBlockTag(overrides),
|
|
842
|
-
},
|
|
869
|
+
}),
|
|
843
870
|
);
|
|
844
871
|
},
|
|
845
872
|
setApprovalForAll(
|
|
@@ -847,35 +874,47 @@ export class ERC721BoundContractView extends BoundContractView<
|
|
|
847
874
|
_approved: boolean,
|
|
848
875
|
overrides?: Overrides,
|
|
849
876
|
): EthCallParam {
|
|
850
|
-
return this.view.encodeCall.setApprovalForAll(
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
877
|
+
return this.view.encodeCall.setApprovalForAll(
|
|
878
|
+
operator,
|
|
879
|
+
_approved,
|
|
880
|
+
create(EthCallContextSchema, {
|
|
881
|
+
chainId: this.context.chainId.toString(),
|
|
882
|
+
address: this.context.address,
|
|
883
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
884
|
+
}),
|
|
885
|
+
);
|
|
855
886
|
},
|
|
856
887
|
supportsInterface(
|
|
857
888
|
interfaceId: BytesLike,
|
|
858
889
|
overrides?: Overrides,
|
|
859
890
|
): EthCallParam {
|
|
860
|
-
return this.view.encodeCall.supportsInterface(
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
891
|
+
return this.view.encodeCall.supportsInterface(
|
|
892
|
+
interfaceId,
|
|
893
|
+
create(EthCallContextSchema, {
|
|
894
|
+
chainId: this.context.chainId.toString(),
|
|
895
|
+
address: this.context.address,
|
|
896
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
897
|
+
}),
|
|
898
|
+
);
|
|
865
899
|
},
|
|
866
900
|
symbol(overrides?: Overrides): EthCallParam {
|
|
867
|
-
return this.view.encodeCall.symbol(
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
901
|
+
return this.view.encodeCall.symbol(
|
|
902
|
+
create(EthCallContextSchema, {
|
|
903
|
+
chainId: this.context.chainId.toString(),
|
|
904
|
+
address: this.context.address,
|
|
905
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
906
|
+
}),
|
|
907
|
+
);
|
|
872
908
|
},
|
|
873
909
|
tokenURI(tokenId: BigNumberish, overrides?: Overrides): EthCallParam {
|
|
874
|
-
return this.view.encodeCall.tokenURI(
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
910
|
+
return this.view.encodeCall.tokenURI(
|
|
911
|
+
tokenId,
|
|
912
|
+
create(EthCallContextSchema, {
|
|
913
|
+
chainId: this.context.chainId.toString(),
|
|
914
|
+
address: this.context.address,
|
|
915
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
916
|
+
}),
|
|
917
|
+
);
|
|
879
918
|
},
|
|
880
919
|
transferFrom(
|
|
881
920
|
from: string,
|
|
@@ -883,11 +922,16 @@ export class ERC721BoundContractView extends BoundContractView<
|
|
|
883
922
|
tokenId: BigNumberish,
|
|
884
923
|
overrides?: Overrides,
|
|
885
924
|
): EthCallParam {
|
|
886
|
-
return this.view.encodeCall.transferFrom(
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
925
|
+
return this.view.encodeCall.transferFrom(
|
|
926
|
+
from,
|
|
927
|
+
to,
|
|
928
|
+
tokenId,
|
|
929
|
+
create(EthCallContextSchema, {
|
|
930
|
+
chainId: this.context.chainId.toString(),
|
|
931
|
+
address: this.context.address,
|
|
932
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
933
|
+
}),
|
|
934
|
+
);
|
|
891
935
|
},
|
|
892
936
|
};
|
|
893
937
|
}
|
|
@@ -24,7 +24,13 @@ import {
|
|
|
24
24
|
PreprocessResult,
|
|
25
25
|
encodeCallData,
|
|
26
26
|
} from "@sentio/sdk/eth";
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
EthCallParam,
|
|
29
|
+
EthCallContext,
|
|
30
|
+
EthCallContextSchema,
|
|
31
|
+
PreparedData,
|
|
32
|
+
} from "@sentio/protos";
|
|
33
|
+
import { create } from "@bufbuild/protobuf";
|
|
28
34
|
|
|
29
35
|
import { WETH9__factory } from "./index.js";
|
|
30
36
|
import {
|
|
@@ -534,29 +540,37 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
|
534
540
|
context: this.context,
|
|
535
541
|
|
|
536
542
|
name(overrides?: Overrides): EthCallParam {
|
|
537
|
-
return this.view.encodeCall.name(
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
543
|
+
return this.view.encodeCall.name(
|
|
544
|
+
create(EthCallContextSchema, {
|
|
545
|
+
chainId: this.context.chainId.toString(),
|
|
546
|
+
address: this.context.address,
|
|
547
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
548
|
+
}),
|
|
549
|
+
);
|
|
542
550
|
},
|
|
543
551
|
approve(
|
|
544
552
|
guy: string,
|
|
545
553
|
wad: BigNumberish,
|
|
546
554
|
overrides?: Overrides,
|
|
547
555
|
): EthCallParam {
|
|
548
|
-
return this.view.encodeCall.approve(
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
556
|
+
return this.view.encodeCall.approve(
|
|
557
|
+
guy,
|
|
558
|
+
wad,
|
|
559
|
+
create(EthCallContextSchema, {
|
|
560
|
+
chainId: this.context.chainId.toString(),
|
|
561
|
+
address: this.context.address,
|
|
562
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
563
|
+
}),
|
|
564
|
+
);
|
|
553
565
|
},
|
|
554
566
|
totalSupply(overrides?: Overrides): EthCallParam {
|
|
555
|
-
return this.view.encodeCall.totalSupply(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
567
|
+
return this.view.encodeCall.totalSupply(
|
|
568
|
+
create(EthCallContextSchema, {
|
|
569
|
+
chainId: this.context.chainId.toString(),
|
|
570
|
+
address: this.context.address,
|
|
571
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
572
|
+
}),
|
|
573
|
+
);
|
|
560
574
|
},
|
|
561
575
|
transferFrom(
|
|
562
576
|
src: string,
|
|
@@ -564,64 +578,89 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
|
564
578
|
wad: BigNumberish,
|
|
565
579
|
overrides?: Overrides,
|
|
566
580
|
): EthCallParam {
|
|
567
|
-
return this.view.encodeCall.transferFrom(
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
581
|
+
return this.view.encodeCall.transferFrom(
|
|
582
|
+
src,
|
|
583
|
+
dst,
|
|
584
|
+
wad,
|
|
585
|
+
create(EthCallContextSchema, {
|
|
586
|
+
chainId: this.context.chainId.toString(),
|
|
587
|
+
address: this.context.address,
|
|
588
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
589
|
+
}),
|
|
590
|
+
);
|
|
572
591
|
},
|
|
573
592
|
withdraw(wad: BigNumberish, overrides?: Overrides): EthCallParam {
|
|
574
|
-
return this.view.encodeCall.withdraw(
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
593
|
+
return this.view.encodeCall.withdraw(
|
|
594
|
+
wad,
|
|
595
|
+
create(EthCallContextSchema, {
|
|
596
|
+
chainId: this.context.chainId.toString(),
|
|
597
|
+
address: this.context.address,
|
|
598
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
599
|
+
}),
|
|
600
|
+
);
|
|
579
601
|
},
|
|
580
602
|
decimals(overrides?: Overrides): EthCallParam {
|
|
581
|
-
return this.view.encodeCall.decimals(
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
603
|
+
return this.view.encodeCall.decimals(
|
|
604
|
+
create(EthCallContextSchema, {
|
|
605
|
+
chainId: this.context.chainId.toString(),
|
|
606
|
+
address: this.context.address,
|
|
607
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
608
|
+
}),
|
|
609
|
+
);
|
|
586
610
|
},
|
|
587
611
|
balanceOf(arg0: string, overrides?: Overrides): EthCallParam {
|
|
588
|
-
return this.view.encodeCall.balanceOf(
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
612
|
+
return this.view.encodeCall.balanceOf(
|
|
613
|
+
arg0,
|
|
614
|
+
create(EthCallContextSchema, {
|
|
615
|
+
chainId: this.context.chainId.toString(),
|
|
616
|
+
address: this.context.address,
|
|
617
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
618
|
+
}),
|
|
619
|
+
);
|
|
593
620
|
},
|
|
594
621
|
symbol(overrides?: Overrides): EthCallParam {
|
|
595
|
-
return this.view.encodeCall.symbol(
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
622
|
+
return this.view.encodeCall.symbol(
|
|
623
|
+
create(EthCallContextSchema, {
|
|
624
|
+
chainId: this.context.chainId.toString(),
|
|
625
|
+
address: this.context.address,
|
|
626
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
627
|
+
}),
|
|
628
|
+
);
|
|
600
629
|
},
|
|
601
630
|
transfer(
|
|
602
631
|
dst: string,
|
|
603
632
|
wad: BigNumberish,
|
|
604
633
|
overrides?: Overrides,
|
|
605
634
|
): EthCallParam {
|
|
606
|
-
return this.view.encodeCall.transfer(
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
635
|
+
return this.view.encodeCall.transfer(
|
|
636
|
+
dst,
|
|
637
|
+
wad,
|
|
638
|
+
create(EthCallContextSchema, {
|
|
639
|
+
chainId: this.context.chainId.toString(),
|
|
640
|
+
address: this.context.address,
|
|
641
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
642
|
+
}),
|
|
643
|
+
);
|
|
611
644
|
},
|
|
612
645
|
deposit(overrides?: Overrides): EthCallParam {
|
|
613
|
-
return this.view.encodeCall.deposit(
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
646
|
+
return this.view.encodeCall.deposit(
|
|
647
|
+
create(EthCallContextSchema, {
|
|
648
|
+
chainId: this.context.chainId.toString(),
|
|
649
|
+
address: this.context.address,
|
|
650
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
651
|
+
}),
|
|
652
|
+
);
|
|
618
653
|
},
|
|
619
654
|
allowance(arg0: string, arg1: string, overrides?: Overrides): EthCallParam {
|
|
620
|
-
return this.view.encodeCall.allowance(
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
655
|
+
return this.view.encodeCall.allowance(
|
|
656
|
+
arg0,
|
|
657
|
+
arg1,
|
|
658
|
+
create(EthCallContextSchema, {
|
|
659
|
+
chainId: this.context.chainId.toString(),
|
|
660
|
+
address: this.context.address,
|
|
661
|
+
blockTag: this.context.getBlockTag(overrides),
|
|
662
|
+
}),
|
|
663
|
+
);
|
|
625
664
|
},
|
|
626
665
|
};
|
|
627
666
|
}
|
package/src/eth/codegen/file.ts
CHANGED
|
@@ -223,7 +223,8 @@ export class ${contract.name}ProcessorTemplate extends BaseProcessorTemplate<${c
|
|
|
223
223
|
],
|
|
224
224
|
// '@sentio/sdk/eth': ['BaseContext'],
|
|
225
225
|
// '@sentio/protos': ['EthFetchConfig'],
|
|
226
|
-
'@sentio/protos': ['EthCallParam', 'EthCallContext', 'PreparedData'],
|
|
226
|
+
'@sentio/protos': ['EthCallParam', 'EthCallContext', 'EthCallContextSchema', 'PreparedData'],
|
|
227
|
+
'@bufbuild/protobuf': ['create'],
|
|
227
228
|
'./common.js': ['PromiseOrValue'],
|
|
228
229
|
'./index.js': [`${contract.name}__factory`],
|
|
229
230
|
[`./${contract.name}.js`]: [`${contract.name}`, ...eventsImports, ...uniqueStructImports]
|
|
@@ -123,7 +123,7 @@ export function generateBoundFunctionCallEncoder(fn: FunctionDeclaration, includ
|
|
|
123
123
|
})}overrides?: Overrides): EthCallParam {
|
|
124
124
|
return this.view.encodeCall.${declName}(${
|
|
125
125
|
fn.inputs.length > 0 ? fn.inputs.map((input, index) => input.name || `arg${index}`).join(',') + ',' : ''
|
|
126
|
-
}{chainId: this.context.chainId.toString(), address: this.context.address, blockTag: this.context.getBlockTag(overrides)})
|
|
126
|
+
}create(EthCallContextSchema, {chainId: this.context.chainId.toString(), address: this.context.address, blockTag: this.context.getBlockTag(overrides)}))
|
|
127
127
|
}
|
|
128
128
|
`
|
|
129
129
|
]
|
package/src/eth/context.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { BaseContract, Overrides } from 'ethers'
|
|
2
2
|
import { LogParams, BlockParams, TransactionReceiptParams, TransactionResponseParams } from 'ethers/providers'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
type EthCallContext,
|
|
6
|
+
EthCallContextSchema,
|
|
7
|
+
type PreparedData,
|
|
8
|
+
type RecordMetaData,
|
|
9
|
+
RecordMetaDataSchema
|
|
10
|
+
} from '@sentio/protos'
|
|
11
|
+
import { create } from '@bufbuild/protobuf'
|
|
5
12
|
import { Trace } from './eth.js'
|
|
6
13
|
import { Labels, normalizeLabels } from '../core/index.js'
|
|
7
14
|
import { BaseContext } from '../core/base-context.js'
|
|
@@ -63,7 +70,7 @@ export abstract class EthContext extends BaseContext {
|
|
|
63
70
|
|
|
64
71
|
getMetaDataInternal(name: string, labels: Labels): RecordMetaData {
|
|
65
72
|
if (this.log) {
|
|
66
|
-
return {
|
|
73
|
+
return create(RecordMetaDataSchema, {
|
|
67
74
|
address: this.address,
|
|
68
75
|
contractName: this.getContractName(),
|
|
69
76
|
blockNumber: BigInt(this.blockNumber),
|
|
@@ -73,10 +80,10 @@ export abstract class EthContext extends BaseContext {
|
|
|
73
80
|
chainId: this.chainId,
|
|
74
81
|
name: name,
|
|
75
82
|
labels: normalizeLabels(labels)
|
|
76
|
-
}
|
|
83
|
+
})
|
|
77
84
|
}
|
|
78
85
|
if (this.trace) {
|
|
79
|
-
return {
|
|
86
|
+
return create(RecordMetaDataSchema, {
|
|
80
87
|
address: this.address,
|
|
81
88
|
contractName: this.getContractName(),
|
|
82
89
|
blockNumber: BigInt(this.blockNumber),
|
|
@@ -86,10 +93,10 @@ export abstract class EthContext extends BaseContext {
|
|
|
86
93
|
chainId: this.chainId.toString(),
|
|
87
94
|
name: name,
|
|
88
95
|
labels: normalizeLabels(labels)
|
|
89
|
-
}
|
|
96
|
+
})
|
|
90
97
|
}
|
|
91
98
|
if (this.transaction) {
|
|
92
|
-
return {
|
|
99
|
+
return create(RecordMetaDataSchema, {
|
|
93
100
|
address: this.address,
|
|
94
101
|
contractName: this.getContractName(),
|
|
95
102
|
blockNumber: BigInt(this.blockNumber),
|
|
@@ -99,10 +106,10 @@ export abstract class EthContext extends BaseContext {
|
|
|
99
106
|
chainId: this.chainId.toString(),
|
|
100
107
|
name: name,
|
|
101
108
|
labels: normalizeLabels(labels)
|
|
102
|
-
}
|
|
109
|
+
})
|
|
103
110
|
}
|
|
104
111
|
if (this.block) {
|
|
105
|
-
return {
|
|
112
|
+
return create(RecordMetaDataSchema, {
|
|
106
113
|
address: this.address,
|
|
107
114
|
contractName: this.getContractName(),
|
|
108
115
|
blockNumber: BigInt(this.blockNumber),
|
|
@@ -112,7 +119,7 @@ export abstract class EthContext extends BaseContext {
|
|
|
112
119
|
chainId: this.chainId.toString(),
|
|
113
120
|
name: name,
|
|
114
121
|
labels: normalizeLabels(labels)
|
|
115
|
-
}
|
|
122
|
+
})
|
|
116
123
|
}
|
|
117
124
|
throw new Error("Invaid ctx argument can't happen")
|
|
118
125
|
}
|
|
@@ -127,11 +134,11 @@ export abstract class EthContext extends BaseContext {
|
|
|
127
134
|
}
|
|
128
135
|
|
|
129
136
|
getEthCallContext(): EthCallContext {
|
|
130
|
-
return {
|
|
137
|
+
return create(EthCallContextSchema, {
|
|
131
138
|
chainId: this.chainId,
|
|
132
139
|
blockTag: '0x' + this.blockNumber.toString(16),
|
|
133
140
|
address: this.address
|
|
134
|
-
}
|
|
141
|
+
})
|
|
135
142
|
}
|
|
136
143
|
}
|
|
137
144
|
|