@sentio/sdk-bundle 2.61.0-rc.2 → 2.61.0-rc.4
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/builtin/0x1.js +5 -7
- package/lib/aptos/builtin/0x3.js +6 -8
- package/lib/aptos/builtin/0x4.js +6 -8
- package/lib/aptos/builtin/index.js +7 -9
- package/lib/aptos/builtin/index.js.map +1 -1
- package/lib/aptos/ext/index.js +5 -7
- package/lib/aptos/ext/index.js.map +1 -1
- package/lib/aptos/index.js +5 -7
- package/lib/btc/index.js +2 -3
- package/lib/btc/index.js.map +1 -1
- package/lib/{chunk-OD6FL4VS.js → chunk-3U72IHGI.js} +3 -5
- package/lib/{chunk-OD6FL4VS.js.map → chunk-3U72IHGI.js.map} +1 -1
- package/lib/{chunk-4BUIMDJ2.js → chunk-63C2SM23.js} +3 -5
- package/lib/{chunk-4BUIMDJ2.js.map → chunk-63C2SM23.js.map} +1 -1
- package/lib/{chunk-43HP4DQZ.js → chunk-B4NQDXHJ.js} +51 -3
- package/lib/chunk-B4NQDXHJ.js.map +1 -0
- package/lib/{chunk-SA6EVEF3.js → chunk-FSFHO32Q.js} +8 -12
- package/lib/{chunk-SA6EVEF3.js.map → chunk-FSFHO32Q.js.map} +1 -1
- package/lib/{chunk-DHPXVIOI.js → chunk-GXWFPPVN.js} +3 -5
- package/lib/{chunk-DHPXVIOI.js.map → chunk-GXWFPPVN.js.map} +1 -1
- package/lib/{chunk-742S42NO.js → chunk-HFODIGHI.js} +449 -1
- package/lib/chunk-HFODIGHI.js.map +1 -0
- package/lib/{chunk-63RPKHNV.js → chunk-JM77GOBI.js} +5 -5
- package/lib/{chunk-GNJ4FJ6M.js → chunk-NEDO74L4.js} +2 -2
- package/lib/{chunk-AIRBHETL.js → chunk-NF66PTSR.js} +4 -4
- package/lib/{chunk-Y4VWRXPJ.js → chunk-O2FX3ST4.js} +2 -2
- package/lib/{chunk-5LEP7IFP.js → chunk-OUQN675E.js} +16 -16
- package/lib/{chunk-2UBTY7RU.js → chunk-P4MCMQEQ.js} +2 -2
- package/lib/{chunk-LP3F7TLM.js → chunk-PSLT5TLU.js} +554 -3
- package/lib/chunk-PSLT5TLU.js.map +1 -0
- package/lib/{chunk-C33DZMWZ.js → chunk-RNKAUU7M.js} +3 -3
- package/lib/{chunk-KORR4KWH.js → chunk-RQEJ6VYV.js} +1684 -267
- package/lib/chunk-RQEJ6VYV.js.map +1 -0
- package/lib/{chunk-DNXKWX3C.js → chunk-TBCNZKOI.js} +15 -15
- package/lib/{chunk-23ATGE5K.js → chunk-V7GMUFEU.js} +11 -11
- package/lib/{chunk-GQ543QK7.js → chunk-VOZ7XW36.js} +2 -2
- package/lib/{chunk-XBLI6KNQ.js → chunk-W5VWFQZQ.js} +18 -18
- package/lib/{chunk-6RTCDLBK.js → chunk-XLNIFS5I.js} +2 -2
- package/lib/eth/builtin/eacaggregatorproxy.js +2 -3
- package/lib/eth/builtin/erc1155.js +3 -4
- package/lib/eth/builtin/erc20.js +2 -3
- package/lib/eth/builtin/erc721.js +2 -3
- package/lib/eth/builtin/index.js +4 -5
- package/lib/eth/builtin/index.js.map +1 -1
- package/lib/eth/builtin/weth9.js +3 -4
- package/lib/eth/index.js +2 -3
- package/lib/fuel/index.js +2 -3
- package/lib/iota/builtin/0x1.js +11 -6
- package/lib/iota/builtin/0x2.js +12 -7
- package/lib/iota/builtin/0x3.js +13 -8
- package/lib/iota/builtin/index.js +13 -8
- package/lib/iota/builtin/index.js.map +1 -1
- package/lib/iota/ext/index.js +5 -8
- package/lib/iota/ext/index.js.map +1 -1
- package/lib/iota/index.js +10 -5
- package/lib/stark/index.js +2 -4
- package/lib/stark/index.js.map +1 -1
- package/lib/sui/builtin/0x1.js +9 -13
- package/lib/sui/builtin/0x2.js +10 -14
- package/lib/sui/builtin/0x3.js +11 -15
- package/lib/sui/builtin/index.js +11 -15
- package/lib/sui/builtin/index.js.map +1 -1
- package/lib/sui/ext/index.js +5 -7
- package/lib/sui/ext/index.js.map +1 -1
- package/lib/sui/index.js +10 -14
- package/lib/testing/index.js +18 -23
- package/lib/testing/index.js.map +1 -1
- package/lib/utils/index.js +2 -3
- package/package.json +2 -2
- package/lib/chunk-43HP4DQZ.js.map +0 -1
- package/lib/chunk-742S42NO.js.map +0 -1
- package/lib/chunk-KORR4KWH.js.map +0 -1
- package/lib/chunk-LP3F7TLM.js.map +0 -1
- package/lib/chunk-OZTZ5YWM.js +0 -456
- package/lib/chunk-OZTZ5YWM.js.map +0 -1
- package/lib/chunk-P7O6NN6M.js +0 -562
- package/lib/chunk-P7O6NN6M.js.map +0 -1
- package/lib/chunk-XEXUSO2Q.js +0 -1469
- package/lib/chunk-XEXUSO2Q.js.map +0 -1
- package/lib/chunk-Z2CE3JTO.js +0 -56
- package/lib/chunk-Z2CE3JTO.js.map +0 -1
- /package/lib/{chunk-63RPKHNV.js.map → chunk-JM77GOBI.js.map} +0 -0
- /package/lib/{chunk-GNJ4FJ6M.js.map → chunk-NEDO74L4.js.map} +0 -0
- /package/lib/{chunk-AIRBHETL.js.map → chunk-NF66PTSR.js.map} +0 -0
- /package/lib/{chunk-Y4VWRXPJ.js.map → chunk-O2FX3ST4.js.map} +0 -0
- /package/lib/{chunk-5LEP7IFP.js.map → chunk-OUQN675E.js.map} +0 -0
- /package/lib/{chunk-2UBTY7RU.js.map → chunk-P4MCMQEQ.js.map} +0 -0
- /package/lib/{chunk-C33DZMWZ.js.map → chunk-RNKAUU7M.js.map} +0 -0
- /package/lib/{chunk-DNXKWX3C.js.map → chunk-TBCNZKOI.js.map} +0 -0
- /package/lib/{chunk-23ATGE5K.js.map → chunk-V7GMUFEU.js.map} +0 -0
- /package/lib/{chunk-GQ543QK7.js.map → chunk-VOZ7XW36.js.map} +0 -0
- /package/lib/{chunk-XBLI6KNQ.js.map → chunk-W5VWFQZQ.js.map} +0 -0
- /package/lib/{chunk-6RTCDLBK.js.map → chunk-XLNIFS5I.js.map} +0 -0
|
@@ -2,32 +2,26 @@ import { createRequire as createRequireSdkShim } from 'module'; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
SuiClient,
|
|
4
4
|
SuiNetwork,
|
|
5
|
-
getClient,
|
|
5
|
+
getClient as getClient2,
|
|
6
6
|
initCoinList,
|
|
7
7
|
normalizeSuiAddress,
|
|
8
8
|
normalizeSuiObjectId,
|
|
9
9
|
suiBcs
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
initCoinList as initCoinList2
|
|
13
|
-
} from "./chunk-P7O6NN6M.js";
|
|
14
|
-
import {
|
|
15
|
-
HandlerRegister
|
|
16
|
-
} from "./chunk-Z2CE3JTO.js";
|
|
17
|
-
import {
|
|
18
|
-
IotaAccountProcessorState,
|
|
19
|
-
IotaAccountProcessorTemplateState,
|
|
20
|
-
IotaAddressProcessor,
|
|
21
|
-
IotaContext,
|
|
22
|
-
IotaProcessorState
|
|
23
|
-
} from "./chunk-XEXUSO2Q.js";
|
|
10
|
+
} from "./chunk-V7GMUFEU.js";
|
|
24
11
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
IotaClient,
|
|
13
|
+
IotaNetwork,
|
|
14
|
+
getClient,
|
|
15
|
+
initCoinList as initCoinList2,
|
|
16
|
+
iotaBcs,
|
|
17
|
+
normalizeIotaAddress,
|
|
18
|
+
normalizeIotaObjectId
|
|
19
|
+
} from "./chunk-PSLT5TLU.js";
|
|
27
20
|
import {
|
|
21
|
+
HandlerRegister,
|
|
28
22
|
getHandlerName,
|
|
29
23
|
proxyProcessor
|
|
30
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-B4NQDXHJ.js";
|
|
31
25
|
import {
|
|
32
26
|
ANY_TYPE,
|
|
33
27
|
AbstractMoveCoder,
|
|
@@ -569,7 +563,7 @@ var CODERS = /* @__PURE__ */ new Map();
|
|
|
569
563
|
function defaultMoveCoder2(network = SuiNetwork.MAIN_NET) {
|
|
570
564
|
let coder = CODERS.get(network);
|
|
571
565
|
if (!coder) {
|
|
572
|
-
coder = new MoveCoder(
|
|
566
|
+
coder = new MoveCoder(getClient2(network));
|
|
573
567
|
CODERS.set(network, coder);
|
|
574
568
|
}
|
|
575
569
|
return coder;
|
|
@@ -622,7 +616,7 @@ var SuiContext = class extends MoveContext {
|
|
|
622
616
|
};
|
|
623
617
|
}
|
|
624
618
|
get client() {
|
|
625
|
-
return
|
|
619
|
+
return getClient2(this.network);
|
|
626
620
|
}
|
|
627
621
|
};
|
|
628
622
|
var SuiObjectChangeContext = class extends MoveContext {
|
|
@@ -662,7 +656,7 @@ var SuiObjectChangeContext = class extends MoveContext {
|
|
|
662
656
|
};
|
|
663
657
|
}
|
|
664
658
|
get client() {
|
|
665
|
-
return
|
|
659
|
+
return getClient2(this.network);
|
|
666
660
|
}
|
|
667
661
|
};
|
|
668
662
|
var SuiAddressContext = class extends MoveAccountContext {
|
|
@@ -700,7 +694,7 @@ var SuiAddressContext = class extends MoveAccountContext {
|
|
|
700
694
|
};
|
|
701
695
|
}
|
|
702
696
|
get client() {
|
|
703
|
-
return
|
|
697
|
+
return getClient2(this.network);
|
|
704
698
|
}
|
|
705
699
|
getTimestamp() {
|
|
706
700
|
return this.timestamp.getDate();
|
|
@@ -1450,7 +1444,7 @@ import("node:process").then((p) => p.stdout.write(""));
|
|
|
1450
1444
|
|
|
1451
1445
|
// src/sui/sui-plugin.ts
|
|
1452
1446
|
import { errorString, mergeProcessResults, Plugin, PluginManager } from "@sentio/runtime";
|
|
1453
|
-
var
|
|
1447
|
+
var import_nice_grpc7 = __toESM(require_lib(), 1);
|
|
1454
1448
|
import { SuiChainId as SuiChainId3 } from "@sentio/chain";
|
|
1455
1449
|
|
|
1456
1450
|
// src/sui/sui-plugin-part.ts
|
|
@@ -1631,252 +1625,1644 @@ import("node:process").then((p) => p.stdout.write(""));
|
|
|
1631
1625
|
|
|
1632
1626
|
// src/iota/iota-plugin-part.ts
|
|
1633
1627
|
import { USER_PROCESSOR as USER_PROCESSOR2 } from "@sentio/runtime";
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1628
|
+
|
|
1629
|
+
// src/iota/iota-processor.ts
|
|
1630
|
+
import { ListStateStorage as ListStateStorage6 } from "@sentio/runtime";
|
|
1631
|
+
var import_nice_grpc6 = __toESM(require_lib(), 1);
|
|
1632
|
+
|
|
1633
|
+
// ../../node_modules/.pnpm/@typemove+iota@1.11.0_typescript@5.5.2/node_modules/@typemove/iota/dist/esm/models.js
|
|
1634
|
+
var ZERO_ADDRESS2 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
1635
|
+
|
|
1636
|
+
// ../../node_modules/.pnpm/@typemove+iota@1.11.0_typescript@5.5.2/node_modules/@typemove/iota/dist/esm/transaction.js
|
|
1637
|
+
function isTransactionArgument2(value) {
|
|
1638
|
+
if (typeof value !== "object")
|
|
1639
|
+
return false;
|
|
1640
|
+
if (value === null || value === void 0)
|
|
1641
|
+
return false;
|
|
1642
|
+
return value.$kind === "GasCoin" || value.$kind === "Result" || value.$kind === "NestedResult" || value.$kind === "Input";
|
|
1643
|
+
}
|
|
1644
|
+
__name(isTransactionArgument2, "isTransactionArgument");
|
|
1645
|
+
function transactionArgumentOrObject2(value, transactionBlock) {
|
|
1646
|
+
if (isTransactionArgument2(value)) {
|
|
1647
|
+
return value;
|
|
1639
1648
|
}
|
|
1640
|
-
|
|
1641
|
-
|
|
1649
|
+
return transactionBlock.object(value);
|
|
1650
|
+
}
|
|
1651
|
+
__name(transactionArgumentOrObject2, "transactionArgumentOrObject");
|
|
1652
|
+
function transactionArgumentOrPure2(value, transactionBlock) {
|
|
1653
|
+
if (isTransactionArgument2(value)) {
|
|
1654
|
+
return value;
|
|
1642
1655
|
}
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
continue;
|
|
1650
|
-
}
|
|
1651
|
-
console.log("start template instance", instance.templateId);
|
|
1652
|
-
const template = IotaAccountProcessorTemplateState.INSTANCE.getValues()[instance.templateId];
|
|
1653
|
-
template.bind(
|
|
1654
|
-
{
|
|
1655
|
-
address: instance.contract?.address || "",
|
|
1656
|
-
objectId: instance.contract?.address || "",
|
|
1657
|
-
network: instance.contract?.chainId || IotaNetwork.MAIN_NET,
|
|
1658
|
-
startCheckpoint: instance.startBlock || 0n,
|
|
1659
|
-
endCheckpoint: instance.endBlock || 0n,
|
|
1660
|
-
baseLabels: instance.baseLabels
|
|
1661
|
-
},
|
|
1662
|
-
NoopContext2
|
|
1663
|
-
);
|
|
1664
|
-
}
|
|
1656
|
+
return typeof value == "string" ? transactionBlock.pure.string(value) : transactionBlock.pure.u64(value);
|
|
1657
|
+
}
|
|
1658
|
+
__name(transactionArgumentOrPure2, "transactionArgumentOrPure");
|
|
1659
|
+
function transactionArgumentOrPureAddress2(value, transactionBlock) {
|
|
1660
|
+
if (isTransactionArgument2(value)) {
|
|
1661
|
+
return value;
|
|
1665
1662
|
}
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1663
|
+
return transactionBlock.pure.address(value);
|
|
1664
|
+
}
|
|
1665
|
+
__name(transactionArgumentOrPureAddress2, "transactionArgumentOrPureAddress");
|
|
1666
|
+
function transactionArgumentOrPureU82(value, transactionBlock) {
|
|
1667
|
+
if (isTransactionArgument2(value)) {
|
|
1668
|
+
return value;
|
|
1672
1669
|
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
const contractConfig = ContractConfig.fromPartial({
|
|
1680
|
-
transactionConfig: [],
|
|
1681
|
-
processorType: USER_PROCESSOR2,
|
|
1682
|
-
contract: {
|
|
1683
|
-
name: suiProcessor.moduleName,
|
|
1684
|
-
chainId: suiProcessor.config.network,
|
|
1685
|
-
address: suiProcessor.config.address,
|
|
1686
|
-
abi: ""
|
|
1687
|
-
},
|
|
1688
|
-
startBlock: suiProcessor.config.startCheckpoint,
|
|
1689
|
-
endBlock: suiProcessor.config.endCheckpoint
|
|
1690
|
-
});
|
|
1691
|
-
for (const handler of suiProcessor.eventHandlers) {
|
|
1692
|
-
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
1693
|
-
this.partitionManager.registerPartitionHandler(HandlerType.SUI_EVENT, handlerId, handler.partitionHandler);
|
|
1694
|
-
const eventHandlerConfig = {
|
|
1695
|
-
filters: handler.filters.map((f) => {
|
|
1696
|
-
return {
|
|
1697
|
-
type: f.type,
|
|
1698
|
-
account: f.account || "",
|
|
1699
|
-
eventAccount: f.eventAccount || ""
|
|
1700
|
-
};
|
|
1701
|
-
}),
|
|
1702
|
-
fetchConfig: handler.fetchConfig,
|
|
1703
|
-
handlerId,
|
|
1704
|
-
handlerName: handler.handlerName
|
|
1705
|
-
};
|
|
1706
|
-
contractConfig.moveEventConfigs.push(eventHandlerConfig);
|
|
1707
|
-
}
|
|
1708
|
-
for (const handler of suiProcessor.callHandlers) {
|
|
1709
|
-
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
1710
|
-
this.partitionManager.registerPartitionHandler(HandlerType.SUI_CALL, handlerId, handler.partitionHandler);
|
|
1711
|
-
const functionHandlerConfig = {
|
|
1712
|
-
filters: handler.filters.map((filter) => {
|
|
1713
|
-
return {
|
|
1714
|
-
function: filter.function,
|
|
1715
|
-
typeArguments: filter.typeArguments || [],
|
|
1716
|
-
withTypeArguments: !!filter.typeArguments,
|
|
1717
|
-
includeFailed: filter.includeFailed || false,
|
|
1718
|
-
publicKeyPrefix: filter.publicKeyPrefix || "",
|
|
1719
|
-
fromAndToAddress: filter.fromAndToAddress
|
|
1720
|
-
};
|
|
1721
|
-
}),
|
|
1722
|
-
fetchConfig: handler.fetchConfig,
|
|
1723
|
-
handlerId,
|
|
1724
|
-
handlerName: handler.handlerName
|
|
1725
|
-
};
|
|
1726
|
-
contractConfig.moveCallConfigs.push(functionHandlerConfig);
|
|
1727
|
-
}
|
|
1728
|
-
for (const handler of suiProcessor.objectChangeHandlers) {
|
|
1729
|
-
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
1730
|
-
const objectChangeHandler = {
|
|
1731
|
-
type: handler.type,
|
|
1732
|
-
handlerId,
|
|
1733
|
-
handlerName: handler.handlerName,
|
|
1734
|
-
includeDeleted: false
|
|
1735
|
-
};
|
|
1736
|
-
contractConfig.moveResourceChangeConfigs.push(objectChangeHandler);
|
|
1737
|
-
}
|
|
1738
|
-
config.contractConfigs.push(contractConfig);
|
|
1739
|
-
}
|
|
1740
|
-
for (const processor of IotaAccountProcessorState.INSTANCE.getValues()) {
|
|
1741
|
-
const chainId = processor.getChainId();
|
|
1742
|
-
if (forChainId !== void 0 && forChainId !== chainId.toString()) {
|
|
1743
|
-
continue;
|
|
1744
|
-
}
|
|
1745
|
-
const accountConfig = AccountConfig.fromPartial({
|
|
1746
|
-
address: processor.config.address,
|
|
1747
|
-
chainId: processor.getChainId(),
|
|
1748
|
-
startBlock: processor.config.startCheckpoint,
|
|
1749
|
-
// TODO maybe use another field
|
|
1750
|
-
endBlock: processor.config.endCheckpoint
|
|
1751
|
-
});
|
|
1752
|
-
for (const handler of processor.objectChangeHandlers) {
|
|
1753
|
-
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
1754
|
-
const objectChangeHandler = {
|
|
1755
|
-
type: handler.type,
|
|
1756
|
-
handlerId,
|
|
1757
|
-
handlerName: handler.handlerName,
|
|
1758
|
-
includeDeleted: false
|
|
1759
|
-
};
|
|
1760
|
-
accountConfig.moveResourceChangeConfigs.push(objectChangeHandler);
|
|
1761
|
-
}
|
|
1762
|
-
for (const handler of processor.objectHandlers) {
|
|
1763
|
-
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
1764
|
-
accountConfig.moveIntervalConfigs.push({
|
|
1765
|
-
intervalConfig: {
|
|
1766
|
-
handlerId,
|
|
1767
|
-
handlerName: handler.handlerName,
|
|
1768
|
-
minutes: 0,
|
|
1769
|
-
minutesInterval: handler.timeIntervalInMinutes,
|
|
1770
|
-
slot: 0,
|
|
1771
|
-
slotInterval: handler.checkPointInterval,
|
|
1772
|
-
fetchConfig: void 0
|
|
1773
|
-
},
|
|
1774
|
-
type: handler.type || "",
|
|
1775
|
-
ownerType: processor.ownerType,
|
|
1776
|
-
resourceFetchConfig: handler.fetchConfig,
|
|
1777
|
-
fetchConfig: void 0
|
|
1778
|
-
});
|
|
1779
|
-
}
|
|
1780
|
-
if (processor instanceof IotaAddressProcessor) {
|
|
1781
|
-
for (const handler of processor.callHandlers) {
|
|
1782
|
-
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
1783
|
-
const functionHandlerConfig = {
|
|
1784
|
-
filters: handler.filters.map((filter) => {
|
|
1785
|
-
return {
|
|
1786
|
-
function: filter.function,
|
|
1787
|
-
typeArguments: filter.typeArguments || [],
|
|
1788
|
-
withTypeArguments: !!filter.typeArguments,
|
|
1789
|
-
includeFailed: filter.includeFailed || false,
|
|
1790
|
-
publicKeyPrefix: filter.publicKeyPrefix || "",
|
|
1791
|
-
fromAndToAddress: filter.fromAndToAddress
|
|
1792
|
-
};
|
|
1793
|
-
}),
|
|
1794
|
-
fetchConfig: handler.fetchConfig,
|
|
1795
|
-
handlerId,
|
|
1796
|
-
handlerName: handler.handlerName
|
|
1797
|
-
};
|
|
1798
|
-
accountConfig.moveCallConfigs.push(functionHandlerConfig);
|
|
1799
|
-
}
|
|
1800
|
-
}
|
|
1801
|
-
config.accountConfigs.push(accountConfig);
|
|
1802
|
-
}
|
|
1670
|
+
return transactionBlock.pure.u8(value);
|
|
1671
|
+
}
|
|
1672
|
+
__name(transactionArgumentOrPureU82, "transactionArgumentOrPureU8");
|
|
1673
|
+
function transactionArgumentOrPureU162(value, transactionBlock) {
|
|
1674
|
+
if (isTransactionArgument2(value)) {
|
|
1675
|
+
return value;
|
|
1803
1676
|
}
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
static {
|
|
1811
|
-
__name(this, "SuiPlugin");
|
|
1677
|
+
return transactionBlock.pure.u16(value);
|
|
1678
|
+
}
|
|
1679
|
+
__name(transactionArgumentOrPureU162, "transactionArgumentOrPureU16");
|
|
1680
|
+
function transactionArgumentOrPureU322(value, transactionBlock) {
|
|
1681
|
+
if (isTransactionArgument2(value)) {
|
|
1682
|
+
return value;
|
|
1812
1683
|
}
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
await this.suiPart.start(request);
|
|
1820
|
-
await this.iotaPart.start(request);
|
|
1684
|
+
return transactionBlock.pure.u32(value);
|
|
1685
|
+
}
|
|
1686
|
+
__name(transactionArgumentOrPureU322, "transactionArgumentOrPureU32");
|
|
1687
|
+
function transactionArgumentOrPureU642(value, transactionBlock) {
|
|
1688
|
+
if (isTransactionArgument2(value)) {
|
|
1689
|
+
return value;
|
|
1821
1690
|
}
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1691
|
+
return transactionBlock.pure.u64(value);
|
|
1692
|
+
}
|
|
1693
|
+
__name(transactionArgumentOrPureU642, "transactionArgumentOrPureU64");
|
|
1694
|
+
function transactionArgumentOrPureU1282(value, transactionBlock) {
|
|
1695
|
+
if (isTransactionArgument2(value)) {
|
|
1696
|
+
return value;
|
|
1825
1697
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1698
|
+
return transactionBlock.pure.u128(value);
|
|
1699
|
+
}
|
|
1700
|
+
__name(transactionArgumentOrPureU1282, "transactionArgumentOrPureU128");
|
|
1701
|
+
function transactionArgumentOrPureU2562(value, transactionBlock) {
|
|
1702
|
+
if (isTransactionArgument2(value)) {
|
|
1703
|
+
return value;
|
|
1830
1704
|
}
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
processBinding(request) {
|
|
1838
|
-
switch (request.handlerType) {
|
|
1839
|
-
case HandlerType.SUI_EVENT:
|
|
1840
|
-
return this.processSuiEvent(request);
|
|
1841
|
-
case HandlerType.SUI_CALL:
|
|
1842
|
-
return this.processSuiFunctionCall(request);
|
|
1843
|
-
case HandlerType.SUI_OBJECT:
|
|
1844
|
-
return this.processSuiObject(request);
|
|
1845
|
-
case HandlerType.SUI_OBJECT_CHANGE:
|
|
1846
|
-
return this.processSuiObjectChange(request);
|
|
1847
|
-
default:
|
|
1848
|
-
throw new import_nice_grpc4.ServerError(import_nice_grpc4.Status.INVALID_ARGUMENT, "No handle type registered " + request.handlerType);
|
|
1849
|
-
}
|
|
1705
|
+
return transactionBlock.pure.u256(value);
|
|
1706
|
+
}
|
|
1707
|
+
__name(transactionArgumentOrPureU2562, "transactionArgumentOrPureU256");
|
|
1708
|
+
function transactionArgumentOrPureBool2(value, transactionBlock) {
|
|
1709
|
+
if (isTransactionArgument2(value)) {
|
|
1710
|
+
return value;
|
|
1850
1711
|
}
|
|
1851
|
-
|
|
1852
|
-
|
|
1712
|
+
return transactionBlock.pure.bool(value);
|
|
1713
|
+
}
|
|
1714
|
+
__name(transactionArgumentOrPureBool2, "transactionArgumentOrPureBool");
|
|
1715
|
+
function transactionArgumentOrVec2(value, transactionBlock) {
|
|
1716
|
+
if (isTransactionArgument2(value)) {
|
|
1717
|
+
return value;
|
|
1718
|
+
}
|
|
1719
|
+
return transactionBlock.makeMoveVec({
|
|
1720
|
+
elements: value.map((a) => transactionBlock.object(a))
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
__name(transactionArgumentOrVec2, "transactionArgumentOrVec");
|
|
1724
|
+
|
|
1725
|
+
// ../../node_modules/.pnpm/@typemove+iota@1.11.0_typescript@5.5.2/node_modules/@typemove/iota/dist/esm/to-internal.js
|
|
1726
|
+
function toInternalModule2(module) {
|
|
1727
|
+
return {
|
|
1728
|
+
address: module.address,
|
|
1729
|
+
exposedFunctions: Object.entries(module.exposedFunctions).map(([n, f]) => toInternalFunction2(n, f)),
|
|
1730
|
+
name: module.name,
|
|
1731
|
+
structs: Object.entries(module.structs).map(([n, s]) => toInternalStruct2(n, s)),
|
|
1732
|
+
enums: []
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
__name(toInternalModule2, "toInternalModule");
|
|
1736
|
+
function toInternalFunction2(name, func) {
|
|
1737
|
+
let visibility;
|
|
1738
|
+
switch (func.visibility) {
|
|
1739
|
+
case "Private":
|
|
1740
|
+
visibility = InternalMoveFunctionVisibility.PRIVATE;
|
|
1741
|
+
break;
|
|
1742
|
+
case "Public":
|
|
1743
|
+
visibility = InternalMoveFunctionVisibility.PUBLIC;
|
|
1744
|
+
break;
|
|
1745
|
+
case "Friend":
|
|
1746
|
+
visibility = InternalMoveFunctionVisibility.FRIEND;
|
|
1747
|
+
break;
|
|
1748
|
+
default:
|
|
1749
|
+
throw Error("No visibility for function" + name);
|
|
1750
|
+
}
|
|
1751
|
+
return {
|
|
1752
|
+
typeParams: func.typeParameters.map((p) => {
|
|
1753
|
+
return { constraints: p.abilities };
|
|
1754
|
+
}),
|
|
1755
|
+
isEntry: func.isEntry,
|
|
1756
|
+
name,
|
|
1757
|
+
params: func.parameters.map(toTypeDescriptor2),
|
|
1758
|
+
return: func.return.map(toTypeDescriptor2),
|
|
1759
|
+
visibility
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
__name(toInternalFunction2, "toInternalFunction");
|
|
1763
|
+
function toInternalStruct2(name, struct) {
|
|
1764
|
+
return {
|
|
1765
|
+
abilities: struct.abilities.abilities,
|
|
1766
|
+
fields: struct.fields.map(toInternalField2),
|
|
1767
|
+
typeParams: struct.typeParameters.map((p) => {
|
|
1768
|
+
return { constraints: p.constraints.abilities };
|
|
1769
|
+
}),
|
|
1770
|
+
isNative: false,
|
|
1771
|
+
isEvent: false,
|
|
1772
|
+
name
|
|
1773
|
+
};
|
|
1774
|
+
}
|
|
1775
|
+
__name(toInternalStruct2, "toInternalStruct");
|
|
1776
|
+
function toInternalField2(module) {
|
|
1777
|
+
return {
|
|
1778
|
+
name: module.name,
|
|
1779
|
+
type: toTypeDescriptor2(module.type)
|
|
1780
|
+
};
|
|
1781
|
+
}
|
|
1782
|
+
__name(toInternalField2, "toInternalField");
|
|
1783
|
+
function toTypeDescriptor2(normalizedType) {
|
|
1784
|
+
if (typeof normalizedType === "string") {
|
|
1785
|
+
return new TypeDescriptor(normalizedType);
|
|
1786
|
+
}
|
|
1787
|
+
if ("Struct" in normalizedType) {
|
|
1788
|
+
const qname = [normalizedType.Struct.address, normalizedType.Struct.module, normalizedType.Struct.name].join(SPLITTER);
|
|
1789
|
+
const args = normalizedType.Struct.typeArguments.map(toTypeDescriptor2);
|
|
1790
|
+
return new TypeDescriptor(qname, args);
|
|
1791
|
+
}
|
|
1792
|
+
if ("Vector" in normalizedType) {
|
|
1793
|
+
return new TypeDescriptor("Vector", [toTypeDescriptor2(normalizedType.Vector)]);
|
|
1794
|
+
}
|
|
1795
|
+
if ("TypeParameter" in normalizedType) {
|
|
1796
|
+
return new TypeDescriptor("T" + normalizedType.TypeParameter);
|
|
1797
|
+
}
|
|
1798
|
+
if ("Reference" in normalizedType) {
|
|
1799
|
+
const res = toTypeDescriptor2(normalizedType.Reference);
|
|
1800
|
+
res.reference = true;
|
|
1801
|
+
return res;
|
|
1802
|
+
}
|
|
1803
|
+
if ("MutableReference" in normalizedType) {
|
|
1804
|
+
const res = toTypeDescriptor2(normalizedType.MutableReference);
|
|
1805
|
+
res.reference = true;
|
|
1806
|
+
res.mutable = true;
|
|
1807
|
+
return res;
|
|
1808
|
+
}
|
|
1809
|
+
throw new Error("Unexpected sui type");
|
|
1810
|
+
}
|
|
1811
|
+
__name(toTypeDescriptor2, "toTypeDescriptor");
|
|
1812
|
+
|
|
1813
|
+
// ../../node_modules/.pnpm/@typemove+iota@1.11.0_typescript@5.5.2/node_modules/@typemove/iota/dist/esm/sui-chain-adapter.js
|
|
1814
|
+
var IotaChainAdapter = class extends ChainAdapter {
|
|
1815
|
+
static {
|
|
1816
|
+
__name(this, "IotaChainAdapter");
|
|
1817
|
+
}
|
|
1818
|
+
async getChainId() {
|
|
1819
|
+
return this.client.getChainIdentifier();
|
|
1820
|
+
}
|
|
1821
|
+
// static INSTANCE = new IotaChainAdapter()
|
|
1822
|
+
client;
|
|
1823
|
+
constructor(client) {
|
|
1824
|
+
super();
|
|
1825
|
+
this.client = client;
|
|
1826
|
+
}
|
|
1827
|
+
async fetchModule(account, module) {
|
|
1828
|
+
return await this.client.getNormalizedMoveModule({ package: account, module });
|
|
1829
|
+
}
|
|
1830
|
+
async fetchModules(account) {
|
|
1831
|
+
const modules = await this.client.getNormalizedMoveModulesByPackage({
|
|
1832
|
+
package: account
|
|
1833
|
+
});
|
|
1834
|
+
return Object.values(modules);
|
|
1835
|
+
}
|
|
1836
|
+
getMeaningfulFunctionParams(params) {
|
|
1837
|
+
return params;
|
|
1838
|
+
}
|
|
1839
|
+
toInternalModules(modules) {
|
|
1840
|
+
return Object.values(modules).map(toInternalModule2);
|
|
1841
|
+
}
|
|
1842
|
+
getAllEventStructs(modules) {
|
|
1843
|
+
const eventMap = /* @__PURE__ */ new Map();
|
|
1844
|
+
for (const module of modules) {
|
|
1845
|
+
const qname = moduleQname(module);
|
|
1846
|
+
for (const struct of module.structs) {
|
|
1847
|
+
const abilities = new Set(struct.abilities);
|
|
1848
|
+
if (abilities.has("Drop") && abilities.has("Copy")) {
|
|
1849
|
+
eventMap.set(qname + SPLITTER + struct.name, struct);
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
return eventMap;
|
|
1854
|
+
}
|
|
1855
|
+
getType(base) {
|
|
1856
|
+
return base.type;
|
|
1857
|
+
}
|
|
1858
|
+
getData(val) {
|
|
1859
|
+
if (val === void 0) {
|
|
1860
|
+
throw Error("val is undefined");
|
|
1861
|
+
}
|
|
1862
|
+
if ("parsedJson" in val) {
|
|
1863
|
+
return val.parsedJson;
|
|
1864
|
+
}
|
|
1865
|
+
if (val.dataType === "moveObject") {
|
|
1866
|
+
return val.fields;
|
|
1867
|
+
}
|
|
1868
|
+
if ("fields" in val) {
|
|
1869
|
+
if ("type" in val && Object.keys(val).length === 2) {
|
|
1870
|
+
return val.fields;
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
return val;
|
|
1874
|
+
}
|
|
1875
|
+
};
|
|
1876
|
+
|
|
1877
|
+
// ../../node_modules/.pnpm/@typemove+iota@1.11.0_typescript@5.5.2/node_modules/@typemove/iota/dist/esm/move-coder.js
|
|
1878
|
+
var MoveCoder3 = class extends AbstractMoveCoder {
|
|
1879
|
+
static {
|
|
1880
|
+
__name(this, "MoveCoder");
|
|
1881
|
+
}
|
|
1882
|
+
constructor(client) {
|
|
1883
|
+
super(new IotaChainAdapter(client));
|
|
1884
|
+
}
|
|
1885
|
+
async maybeGetMoveEnum(type) {
|
|
1886
|
+
return void 0;
|
|
1887
|
+
}
|
|
1888
|
+
load(module, address) {
|
|
1889
|
+
let m = this.moduleMapping.get(module.address + "::" + module.name);
|
|
1890
|
+
const mDeclared = this.moduleMapping.get(address + "::" + module.name);
|
|
1891
|
+
if (m && mDeclared) {
|
|
1892
|
+
return m;
|
|
1893
|
+
}
|
|
1894
|
+
this.accounts.add(module.address);
|
|
1895
|
+
m = toInternalModule2(module);
|
|
1896
|
+
this.loadInternal(m, address);
|
|
1897
|
+
return m;
|
|
1898
|
+
}
|
|
1899
|
+
async decode(data, type) {
|
|
1900
|
+
switch (type.qname) {
|
|
1901
|
+
case "0x1::ascii::Char":
|
|
1902
|
+
if (data !== void 0 && typeof data !== "string") {
|
|
1903
|
+
const byte = (await super.decode(data, type)).byte;
|
|
1904
|
+
return String.fromCharCode(byte);
|
|
1905
|
+
}
|
|
1906
|
+
case "0x1::ascii::String":
|
|
1907
|
+
if (data !== void 0 && typeof data !== "string") {
|
|
1908
|
+
const bytes = (await super.decode(data, type)).bytes;
|
|
1909
|
+
return new TextDecoder().decode(new Uint8Array(bytes));
|
|
1910
|
+
}
|
|
1911
|
+
case "0x2::object::ID":
|
|
1912
|
+
if (data !== void 0 && typeof data !== "string") {
|
|
1913
|
+
const bytes = (await super.decode(data, type)).bytes;
|
|
1914
|
+
return normalizeIotaObjectId(bytes);
|
|
1915
|
+
}
|
|
1916
|
+
case "0x2::url::Url":
|
|
1917
|
+
if (data !== void 0 && typeof data !== "string") {
|
|
1918
|
+
return (await super.decode(data, type)).url;
|
|
1919
|
+
}
|
|
1920
|
+
case "0x2::coin::Coin":
|
|
1921
|
+
if (data !== void 0 && typeof data !== "string") {
|
|
1922
|
+
const bytes = (await super.decode(data, type)).id.id.bytes;
|
|
1923
|
+
return new TextDecoder().decode(new Uint8Array(bytes));
|
|
1924
|
+
}
|
|
1925
|
+
return data;
|
|
1926
|
+
case "0x2::balance::Balance":
|
|
1927
|
+
if (data.value) {
|
|
1928
|
+
const balance = await super.decode(data, type);
|
|
1929
|
+
return balance.value;
|
|
1930
|
+
}
|
|
1931
|
+
return BigInt(data);
|
|
1932
|
+
case "0x1::option::Option":
|
|
1933
|
+
if (data === null) {
|
|
1934
|
+
return data;
|
|
1935
|
+
}
|
|
1936
|
+
if (data.vec) {
|
|
1937
|
+
let vec = await super.decode(data, type);
|
|
1938
|
+
vec = vec.vec;
|
|
1939
|
+
if (vec.length === 0) {
|
|
1940
|
+
return null;
|
|
1941
|
+
}
|
|
1942
|
+
return vec[0];
|
|
1943
|
+
}
|
|
1944
|
+
return this.decode(data, type.typeArgs[0]);
|
|
1945
|
+
case "Address":
|
|
1946
|
+
const str = data;
|
|
1947
|
+
return normalizeIotaAddress(str);
|
|
1948
|
+
case "0x1::string::String":
|
|
1949
|
+
if (typeof data !== "string") {
|
|
1950
|
+
return new TextDecoder().decode(new Uint8Array(data.bytes));
|
|
1951
|
+
}
|
|
1952
|
+
default:
|
|
1953
|
+
return super.decode(data, type);
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
decodeEvent(event) {
|
|
1957
|
+
return this.decodedStruct(event);
|
|
1958
|
+
}
|
|
1959
|
+
filterAndDecodeEvents(type, resources) {
|
|
1960
|
+
if (typeof type === "string") {
|
|
1961
|
+
type = parseMoveType(type);
|
|
1962
|
+
}
|
|
1963
|
+
return this.filterAndDecodeStruct(type, resources);
|
|
1964
|
+
}
|
|
1965
|
+
async getDynamicFields(objects, keyType = ANY_TYPE, valueType = ANY_TYPE) {
|
|
1966
|
+
const type = new TypeDescriptor("0x2::dynamic_field::Field");
|
|
1967
|
+
type.typeArgs = [keyType, valueType];
|
|
1968
|
+
const res = await this.filterAndDecodeObjects(type, objects);
|
|
1969
|
+
return res.map((o) => o.data_decoded);
|
|
1970
|
+
}
|
|
1971
|
+
filterAndDecodeObjects(type, objects) {
|
|
1972
|
+
return this.filterAndDecodeStruct(type, objects);
|
|
1973
|
+
}
|
|
1974
|
+
async decodeFunctionPayload(payload, inputs) {
|
|
1975
|
+
const functionType = [payload.package, payload.module, payload.function].join(SPLITTER);
|
|
1976
|
+
const func = await this.getMoveFunction(functionType);
|
|
1977
|
+
const params = this.adapter.getMeaningfulFunctionParams(func.params);
|
|
1978
|
+
const args = [];
|
|
1979
|
+
for (const value of payload.arguments || []) {
|
|
1980
|
+
const argValue = value;
|
|
1981
|
+
if ("Input" in argValue) {
|
|
1982
|
+
const idx = argValue.Input;
|
|
1983
|
+
const arg = inputs[idx];
|
|
1984
|
+
if (arg.type === "pure") {
|
|
1985
|
+
args.push(arg.value);
|
|
1986
|
+
} else if (arg.type === "object") {
|
|
1987
|
+
args.push(void 0);
|
|
1988
|
+
} else {
|
|
1989
|
+
console.error("unexpected function arg value");
|
|
1990
|
+
args.push(void 0);
|
|
1991
|
+
}
|
|
1992
|
+
} else {
|
|
1993
|
+
args.push(void 0);
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
const argumentsTyped = await this.decodeArray(args, params, false);
|
|
1997
|
+
return {
|
|
1998
|
+
...payload,
|
|
1999
|
+
arguments_decoded: argumentsTyped
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
bcsRegistered = /* @__PURE__ */ new Set();
|
|
2003
|
+
bcsRegistry = /* @__PURE__ */ new Map();
|
|
2004
|
+
async getBCSTypeWithArgs(type, args = []) {
|
|
2005
|
+
const qname = type.qname;
|
|
2006
|
+
const sig = type.getNormalizedSignature();
|
|
2007
|
+
const cached = this.bcsRegistry.get(sig);
|
|
2008
|
+
if (cached) {
|
|
2009
|
+
return cached;
|
|
2010
|
+
}
|
|
2011
|
+
const lowerQname = qname.toLowerCase();
|
|
2012
|
+
switch (lowerQname) {
|
|
2013
|
+
case "u8":
|
|
2014
|
+
case "u16":
|
|
2015
|
+
case "u32":
|
|
2016
|
+
case "u64":
|
|
2017
|
+
case "u128":
|
|
2018
|
+
case "u256":
|
|
2019
|
+
case "bool":
|
|
2020
|
+
return iotaBcs[lowerQname]();
|
|
2021
|
+
case "address":
|
|
2022
|
+
return iotaBcs.Address;
|
|
2023
|
+
case "vector":
|
|
2024
|
+
return iotaBcs.vector(args[0]);
|
|
2025
|
+
default:
|
|
2026
|
+
if (!qname.includes("::")) {
|
|
2027
|
+
throw `Unimplemented builtin type ${qname}`;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
let moveStruct;
|
|
2031
|
+
try {
|
|
2032
|
+
moveStruct = await this.getMoveStruct(qname);
|
|
2033
|
+
} catch (e) {
|
|
2034
|
+
console.error("Invalid move address", qname);
|
|
2035
|
+
throw e;
|
|
2036
|
+
}
|
|
2037
|
+
const structDef = {};
|
|
2038
|
+
for (const field of moveStruct.fields) {
|
|
2039
|
+
if (field.type.qname.startsWith("T") && args.length) {
|
|
2040
|
+
const index = +field.type.qname.slice(1);
|
|
2041
|
+
structDef[field.name] = args[index];
|
|
2042
|
+
} else if (field.type.typeArgs.length && args.length) {
|
|
2043
|
+
structDef[field.name] = await this.getBCSTypeWithArgs(field.type, args);
|
|
2044
|
+
} else {
|
|
2045
|
+
structDef[field.name] = await this.getBCSType(field.type);
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
return iotaBcs.struct(qname, structDef);
|
|
2049
|
+
}
|
|
2050
|
+
async getBCSType(type) {
|
|
2051
|
+
const args = await Promise.all(type.typeArgs.map((x) => this.getBCSType(x)));
|
|
2052
|
+
const bcsType = await this.getBCSTypeWithArgs(type, args);
|
|
2053
|
+
this.bcsRegistry.set(type.getNormalizedSignature(), bcsType);
|
|
2054
|
+
return bcsType;
|
|
2055
|
+
}
|
|
2056
|
+
async registerBCSTypes(type) {
|
|
2057
|
+
const sig = type.getNormalizedSignature();
|
|
2058
|
+
if (this.bcsRegistered.has(sig)) {
|
|
2059
|
+
return;
|
|
2060
|
+
}
|
|
2061
|
+
this.bcsRegistered.add(sig);
|
|
2062
|
+
const bcsType = await this.getBCSType(type);
|
|
2063
|
+
this.bcsRegistry.set(type.getNormalizedSignature(), bcsType);
|
|
2064
|
+
}
|
|
2065
|
+
async decodeBCS(type, data, encoding) {
|
|
2066
|
+
await this.registerBCSTypes(type);
|
|
2067
|
+
if (typeof data == "string") {
|
|
2068
|
+
const buf = Buffer.from(data, encoding);
|
|
2069
|
+
data = new Uint8Array(buf, buf.byteOffset, buf.byteLength);
|
|
2070
|
+
}
|
|
2071
|
+
const bcsType = this.bcsRegistry.get(type.getNormalizedSignature());
|
|
2072
|
+
return bcsType?.parse(data);
|
|
2073
|
+
}
|
|
2074
|
+
async decodeDevInspectResult(inspectRes) {
|
|
2075
|
+
const returnValues = [];
|
|
2076
|
+
if (inspectRes.results != null) {
|
|
2077
|
+
for (const r of inspectRes.results) {
|
|
2078
|
+
if (r.returnValues) {
|
|
2079
|
+
for (const returnValue of r.returnValues) {
|
|
2080
|
+
const type = parseMoveType(returnValue[1]);
|
|
2081
|
+
const bcsDecoded = await this.decodeBCS(type, new Uint8Array(returnValue[0]));
|
|
2082
|
+
const decoded = await this.decodeType(bcsDecoded, type);
|
|
2083
|
+
returnValues.push(decoded);
|
|
2084
|
+
}
|
|
2085
|
+
} else {
|
|
2086
|
+
returnValues.push(null);
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
return { ...inspectRes, results_decoded: returnValues };
|
|
2091
|
+
}
|
|
2092
|
+
};
|
|
2093
|
+
var DEFAULT_ENDPOINT2 = "https://api.mainnet.iota.cafe/";
|
|
2094
|
+
var CODER_MAP2 = /* @__PURE__ */ new Map();
|
|
2095
|
+
function defaultMoveCoder3(endpoint = DEFAULT_ENDPOINT2) {
|
|
2096
|
+
let coder = CODER_MAP2.get(endpoint);
|
|
2097
|
+
if (!coder) {
|
|
2098
|
+
coder = new MoveCoder3(new IotaClient({ url: endpoint }));
|
|
2099
|
+
CODER_MAP2.set(endpoint, coder);
|
|
2100
|
+
}
|
|
2101
|
+
return coder;
|
|
2102
|
+
}
|
|
2103
|
+
__name(defaultMoveCoder3, "defaultMoveCoder");
|
|
2104
|
+
var PROVIDER_CODER_MAP2 = /* @__PURE__ */ new Map();
|
|
2105
|
+
var DEFAULT_CHAIN_ID2;
|
|
2106
|
+
async function getMoveCoder2(client) {
|
|
2107
|
+
let coder = PROVIDER_CODER_MAP2.get(client);
|
|
2108
|
+
if (!coder) {
|
|
2109
|
+
coder = new MoveCoder3(client);
|
|
2110
|
+
const id = await client.getChainIdentifier();
|
|
2111
|
+
const defaultCoder = defaultMoveCoder3();
|
|
2112
|
+
if (!DEFAULT_CHAIN_ID2) {
|
|
2113
|
+
DEFAULT_CHAIN_ID2 = await defaultCoder.adapter.getChainId();
|
|
2114
|
+
}
|
|
2115
|
+
if (id === DEFAULT_CHAIN_ID2) {
|
|
2116
|
+
coder = defaultCoder;
|
|
2117
|
+
}
|
|
2118
|
+
PROVIDER_CODER_MAP2.set(client, coder);
|
|
2119
|
+
}
|
|
2120
|
+
return coder;
|
|
2121
|
+
}
|
|
2122
|
+
__name(getMoveCoder2, "getMoveCoder");
|
|
2123
|
+
|
|
2124
|
+
// src/iota/move-coder.ts
|
|
2125
|
+
var CODERS2 = /* @__PURE__ */ new Map();
|
|
2126
|
+
function defaultMoveCoder4(network = IotaNetwork.MAIN_NET) {
|
|
2127
|
+
let coder = CODERS2.get(network);
|
|
2128
|
+
if (!coder) {
|
|
2129
|
+
coder = new MoveCoder3(getClient(network));
|
|
2130
|
+
CODERS2.set(network, coder);
|
|
2131
|
+
}
|
|
2132
|
+
return coder;
|
|
2133
|
+
}
|
|
2134
|
+
__name(defaultMoveCoder4, "defaultMoveCoder");
|
|
2135
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
2136
|
+
|
|
2137
|
+
// src/iota/context.ts
|
|
2138
|
+
var IotaContext = class extends MoveContext {
|
|
2139
|
+
static {
|
|
2140
|
+
__name(this, "IotaContext");
|
|
2141
|
+
}
|
|
2142
|
+
moduleName;
|
|
2143
|
+
timestamp;
|
|
2144
|
+
checkpoint;
|
|
2145
|
+
transaction;
|
|
2146
|
+
eventIndex;
|
|
2147
|
+
coder;
|
|
2148
|
+
constructor(moduleName, network, address, timestamp, checkpoint, transaction, eventIndex, baseLabels) {
|
|
2149
|
+
super(baseLabels);
|
|
2150
|
+
this.address = address.toLowerCase();
|
|
2151
|
+
this.network = network;
|
|
2152
|
+
this.moduleName = moduleName;
|
|
2153
|
+
this.timestamp = timestamp;
|
|
2154
|
+
this.checkpoint = checkpoint;
|
|
2155
|
+
this.eventIndex = eventIndex;
|
|
2156
|
+
this.coder = defaultMoveCoder4(network);
|
|
2157
|
+
if (transaction) {
|
|
2158
|
+
this.transaction = transaction;
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
getChainId() {
|
|
2162
|
+
return this.network;
|
|
2163
|
+
}
|
|
2164
|
+
getTimestamp() {
|
|
2165
|
+
return this.timestamp.getDate();
|
|
2166
|
+
}
|
|
2167
|
+
getMetaDataInternal(name, labels) {
|
|
2168
|
+
return {
|
|
2169
|
+
address: this.address,
|
|
2170
|
+
contractName: this.moduleName,
|
|
2171
|
+
blockNumber: this.checkpoint,
|
|
2172
|
+
transactionIndex: 0,
|
|
2173
|
+
transactionHash: this.transaction?.digest || "",
|
|
2174
|
+
// TODO
|
|
2175
|
+
logIndex: this.eventIndex,
|
|
2176
|
+
chainId: this.getChainId(),
|
|
2177
|
+
name,
|
|
2178
|
+
labels: normalizeLabels(labels)
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
get client() {
|
|
2182
|
+
return getClient(this.network);
|
|
2183
|
+
}
|
|
2184
|
+
};
|
|
2185
|
+
var IotaObjectChangeContext = class extends MoveContext {
|
|
2186
|
+
static {
|
|
2187
|
+
__name(this, "IotaObjectChangeContext");
|
|
2188
|
+
}
|
|
2189
|
+
timestamp;
|
|
2190
|
+
checkpoint;
|
|
2191
|
+
coder;
|
|
2192
|
+
txDigest;
|
|
2193
|
+
constructor(network, address, timestamp, checkpoint, txDigest, baseLabels) {
|
|
2194
|
+
super(baseLabels);
|
|
2195
|
+
this.address = address;
|
|
2196
|
+
this.network = network;
|
|
2197
|
+
this.timestamp = timestamp;
|
|
2198
|
+
this.checkpoint = checkpoint;
|
|
2199
|
+
this.txDigest = txDigest;
|
|
2200
|
+
this.coder = defaultMoveCoder4(network);
|
|
2201
|
+
}
|
|
2202
|
+
getChainId() {
|
|
2203
|
+
return this.network;
|
|
2204
|
+
}
|
|
2205
|
+
getTimestamp() {
|
|
2206
|
+
return this.timestamp.getDate();
|
|
2207
|
+
}
|
|
2208
|
+
getMetaDataInternal(name, labels) {
|
|
2209
|
+
return {
|
|
2210
|
+
address: this.address,
|
|
2211
|
+
contractName: "*",
|
|
2212
|
+
blockNumber: this.checkpoint,
|
|
2213
|
+
transactionIndex: -1,
|
|
2214
|
+
transactionHash: this.txDigest,
|
|
2215
|
+
logIndex: 0,
|
|
2216
|
+
chainId: this.getChainId(),
|
|
2217
|
+
name,
|
|
2218
|
+
labels: normalizeLabels(labels)
|
|
2219
|
+
};
|
|
2220
|
+
}
|
|
2221
|
+
get client() {
|
|
2222
|
+
return getClient(this.network);
|
|
2223
|
+
}
|
|
2224
|
+
};
|
|
2225
|
+
var IotaAddressContext = class extends MoveAccountContext {
|
|
2226
|
+
static {
|
|
2227
|
+
__name(this, "IotaAddressContext");
|
|
2228
|
+
}
|
|
2229
|
+
address;
|
|
2230
|
+
network;
|
|
2231
|
+
checkpoint;
|
|
2232
|
+
timestamp;
|
|
2233
|
+
coder;
|
|
2234
|
+
contractName = "address";
|
|
2235
|
+
constructor(network, address, checkpoint, timestamp, baseLabels) {
|
|
2236
|
+
super(baseLabels);
|
|
2237
|
+
this.address = address;
|
|
2238
|
+
this.network = network;
|
|
2239
|
+
this.checkpoint = checkpoint;
|
|
2240
|
+
this.timestamp = timestamp;
|
|
2241
|
+
this.coder = defaultMoveCoder4(network);
|
|
2242
|
+
}
|
|
2243
|
+
getChainId() {
|
|
2244
|
+
return this.network;
|
|
2245
|
+
}
|
|
2246
|
+
getMetaDataInternal(name, labels) {
|
|
2247
|
+
return {
|
|
2248
|
+
address: this.address,
|
|
2249
|
+
contractName: this.contractName,
|
|
2250
|
+
blockNumber: this.checkpoint,
|
|
2251
|
+
transactionIndex: 0,
|
|
2252
|
+
transactionHash: "",
|
|
2253
|
+
logIndex: 0,
|
|
2254
|
+
chainId: this.getChainId(),
|
|
2255
|
+
name,
|
|
2256
|
+
labels: normalizeLabels(labels)
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
get client() {
|
|
2260
|
+
return getClient(this.network);
|
|
2261
|
+
}
|
|
2262
|
+
getTimestamp() {
|
|
2263
|
+
return this.timestamp.getDate();
|
|
2264
|
+
}
|
|
2265
|
+
};
|
|
2266
|
+
var IotaObjectContext = class extends IotaAddressContext {
|
|
2267
|
+
static {
|
|
2268
|
+
__name(this, "IotaObjectContext");
|
|
2269
|
+
}
|
|
2270
|
+
contractName = "object";
|
|
2271
|
+
objectId;
|
|
2272
|
+
objectVersion;
|
|
2273
|
+
constructor(network, objectId, objectVersion, checkpoint, timestamp, baseLabels) {
|
|
2274
|
+
super(network, objectId, checkpoint, timestamp, baseLabels);
|
|
2275
|
+
this.objectId = objectId;
|
|
2276
|
+
this.objectVersion = objectVersion;
|
|
2277
|
+
}
|
|
2278
|
+
};
|
|
2279
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
2280
|
+
|
|
2281
|
+
// src/iota/utils.ts
|
|
2282
|
+
function getMoveCalls2(txBlock) {
|
|
2283
|
+
const txKind = txBlock.transaction?.data.transaction;
|
|
2284
|
+
if (!txKind) {
|
|
2285
|
+
return [];
|
|
2286
|
+
}
|
|
2287
|
+
const programmableTx = txKind.kind === "ProgrammableTransaction" ? txKind : void 0;
|
|
2288
|
+
if (!programmableTx) {
|
|
2289
|
+
return [];
|
|
2290
|
+
}
|
|
2291
|
+
return programmableTx.transactions.flatMap((tx) => {
|
|
2292
|
+
if ("MoveCall" in tx) {
|
|
2293
|
+
const call = tx.MoveCall;
|
|
2294
|
+
call.package = accountTypeString(call.package);
|
|
2295
|
+
return [call];
|
|
2296
|
+
}
|
|
2297
|
+
return [];
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
__name(getMoveCalls2, "getMoveCalls");
|
|
2301
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
2302
|
+
|
|
2303
|
+
// src/iota/iota-object-processor.ts
|
|
2304
|
+
import { ListStateStorage as ListStateStorage4 } from "@sentio/runtime";
|
|
2305
|
+
var import_nice_grpc4 = __toESM(require_lib(), 1);
|
|
2306
|
+
var DEFAULT_ACCOUNT_FETCH_CONFIG2 = {
|
|
2307
|
+
owned: false
|
|
2308
|
+
};
|
|
2309
|
+
var IotaAccountProcessorState = class _IotaAccountProcessorState extends ListStateStorage4 {
|
|
2310
|
+
static {
|
|
2311
|
+
__name(this, "IotaAccountProcessorState");
|
|
2312
|
+
}
|
|
2313
|
+
static INSTANCE = new _IotaAccountProcessorState();
|
|
2314
|
+
};
|
|
2315
|
+
var IotaBaseObjectOrAddressProcessor = class {
|
|
2316
|
+
static {
|
|
2317
|
+
__name(this, "IotaBaseObjectOrAddressProcessor");
|
|
2318
|
+
}
|
|
2319
|
+
config;
|
|
2320
|
+
ownerType;
|
|
2321
|
+
templateId;
|
|
2322
|
+
objectHandlers = [];
|
|
2323
|
+
objectChangeHandlers = [];
|
|
2324
|
+
// static bind(options: IotaObjectsBindOptions): IotaBaseObjectsProcessor<any> {
|
|
2325
|
+
// return new IotaBaseObjectsProcessor(options)
|
|
2326
|
+
// }
|
|
2327
|
+
constructor(options) {
|
|
2328
|
+
if (options.ownerType === MoveOwnerType.TYPE) {
|
|
2329
|
+
this.config = {
|
|
2330
|
+
startCheckpoint: options.startCheckpoint || 0n,
|
|
2331
|
+
endCheckpoint: options.endCheckpoint,
|
|
2332
|
+
address: options.address === "*" ? "*" : accountTypeString(options.address),
|
|
2333
|
+
network: options.network || IotaNetwork.MAIN_NET,
|
|
2334
|
+
baseLabels: options.baseLabels
|
|
2335
|
+
};
|
|
2336
|
+
} else {
|
|
2337
|
+
this.config = configure2(options);
|
|
2338
|
+
}
|
|
2339
|
+
this.ownerType = options.ownerType;
|
|
2340
|
+
IotaAccountProcessorState.INSTANCE.addValue(this);
|
|
2341
|
+
return proxyProcessor(this);
|
|
2342
|
+
}
|
|
2343
|
+
getChainId() {
|
|
2344
|
+
return this.config.network;
|
|
2345
|
+
}
|
|
2346
|
+
onInterval(handler, timeInterval, checkpointInterval, type, fetchConfig, handlerName = getHandlerName()) {
|
|
2347
|
+
const processor = this;
|
|
2348
|
+
this.objectHandlers.push({
|
|
2349
|
+
handlerName,
|
|
2350
|
+
handler: /* @__PURE__ */ __name(async function(data) {
|
|
2351
|
+
const ctx = new IotaObjectContext(
|
|
2352
|
+
processor.config.network,
|
|
2353
|
+
data.objectId,
|
|
2354
|
+
data.objectVersion,
|
|
2355
|
+
data.slot,
|
|
2356
|
+
data.timestamp || /* @__PURE__ */ new Date(0),
|
|
2357
|
+
processor.config.baseLabels
|
|
2358
|
+
);
|
|
2359
|
+
await processor.doHandle(handler, data, ctx);
|
|
2360
|
+
return ctx.stopAndGetResult();
|
|
2361
|
+
}, "handler"),
|
|
2362
|
+
timeIntervalInMinutes: timeInterval,
|
|
2363
|
+
checkPointInterval: checkpointInterval,
|
|
2364
|
+
type,
|
|
2365
|
+
fetchConfig: { ...DEFAULT_ACCOUNT_FETCH_CONFIG2, ...fetchConfig }
|
|
2366
|
+
});
|
|
2367
|
+
return this;
|
|
2368
|
+
}
|
|
2369
|
+
};
|
|
2370
|
+
var IotaBaseObjectOrAddressProcessorInternal = class extends IotaBaseObjectOrAddressProcessor {
|
|
2371
|
+
static {
|
|
2372
|
+
__name(this, "IotaBaseObjectOrAddressProcessorInternal");
|
|
2373
|
+
}
|
|
2374
|
+
onTimeInterval(handler, timeIntervalInMinutes = 60, backfillTimeIntervalInMinutes = 240, type, fetchConfig) {
|
|
2375
|
+
return this.onInterval(
|
|
2376
|
+
handler,
|
|
2377
|
+
{
|
|
2378
|
+
recentInterval: timeIntervalInMinutes,
|
|
2379
|
+
backfillInterval: backfillTimeIntervalInMinutes
|
|
2380
|
+
},
|
|
2381
|
+
void 0,
|
|
2382
|
+
type,
|
|
2383
|
+
fetchConfig
|
|
2384
|
+
);
|
|
2385
|
+
}
|
|
2386
|
+
onCheckpointInterval(handler, checkpointInterval = 1e5, backfillCheckpointInterval = 4e5, type, fetchConfig) {
|
|
2387
|
+
return this.onInterval(
|
|
2388
|
+
handler,
|
|
2389
|
+
void 0,
|
|
2390
|
+
{ recentInterval: checkpointInterval, backfillInterval: backfillCheckpointInterval },
|
|
2391
|
+
type,
|
|
2392
|
+
fetchConfig
|
|
2393
|
+
);
|
|
2394
|
+
}
|
|
2395
|
+
};
|
|
2396
|
+
var IotaAddressProcessor = class _IotaAddressProcessor extends IotaBaseObjectOrAddressProcessorInternal {
|
|
2397
|
+
static {
|
|
2398
|
+
__name(this, "IotaAddressProcessor");
|
|
2399
|
+
}
|
|
2400
|
+
callHandlers = [];
|
|
2401
|
+
static bind(options) {
|
|
2402
|
+
return new _IotaAddressProcessor({ ...options, ownerType: MoveOwnerType.ADDRESS });
|
|
2403
|
+
}
|
|
2404
|
+
async doHandle(handler, data, ctx) {
|
|
2405
|
+
return handler(data.rawObjects.map((o) => JSON.parse(o)), ctx);
|
|
2406
|
+
}
|
|
2407
|
+
onTransactionBlock(handler, filter, fetchConfig) {
|
|
2408
|
+
const _fetchConfig = MoveFetchConfig.fromPartial({ ...DEFAULT_FETCH_CONFIG2, ...fetchConfig });
|
|
2409
|
+
const _filter = {
|
|
2410
|
+
fromAndToAddress: {
|
|
2411
|
+
from: "",
|
|
2412
|
+
to: this.config.address
|
|
2413
|
+
},
|
|
2414
|
+
...filter
|
|
2415
|
+
};
|
|
2416
|
+
const processor = this;
|
|
2417
|
+
this.callHandlers.push({
|
|
2418
|
+
handlerName: getHandlerName(),
|
|
2419
|
+
handler: /* @__PURE__ */ __name(async function(data) {
|
|
2420
|
+
if (!data.rawTransaction) {
|
|
2421
|
+
throw new import_nice_grpc4.ServerError(import_nice_grpc4.Status.INVALID_ARGUMENT, "transaction is null");
|
|
2422
|
+
}
|
|
2423
|
+
const tx = JSON.parse(data.rawTransaction);
|
|
2424
|
+
const ctx = new IotaContext(
|
|
2425
|
+
"object",
|
|
2426
|
+
processor.config.network,
|
|
2427
|
+
processor.config.address,
|
|
2428
|
+
data.timestamp || /* @__PURE__ */ new Date(0),
|
|
2429
|
+
data.slot,
|
|
2430
|
+
tx,
|
|
2431
|
+
0,
|
|
2432
|
+
processor.config.baseLabels
|
|
2433
|
+
);
|
|
2434
|
+
if (tx) {
|
|
2435
|
+
await handler(tx, ctx);
|
|
2436
|
+
}
|
|
2437
|
+
return ctx.stopAndGetResult();
|
|
2438
|
+
}, "handler"),
|
|
2439
|
+
filters: [{ ..._filter, function: "" }],
|
|
2440
|
+
fetchConfig: _fetchConfig
|
|
2441
|
+
});
|
|
2442
|
+
return this;
|
|
2443
|
+
}
|
|
2444
|
+
};
|
|
2445
|
+
var IotaObjectProcessor = class _IotaObjectProcessor extends IotaBaseObjectOrAddressProcessorInternal {
|
|
2446
|
+
static {
|
|
2447
|
+
__name(this, "IotaObjectProcessor");
|
|
2448
|
+
}
|
|
2449
|
+
static bind(options) {
|
|
2450
|
+
return new _IotaObjectProcessor({
|
|
2451
|
+
address: options.objectId,
|
|
2452
|
+
network: options.network,
|
|
2453
|
+
startCheckpoint: options.startCheckpoint,
|
|
2454
|
+
endCheckpoint: options.endCheckpoint,
|
|
2455
|
+
ownerType: MoveOwnerType.OBJECT,
|
|
2456
|
+
baseLabels: options.baseLabels
|
|
2457
|
+
});
|
|
2458
|
+
}
|
|
2459
|
+
async doHandle(handler, data, ctx) {
|
|
2460
|
+
if (!data.rawSelf) {
|
|
2461
|
+
console.log(`Iota object not existed in ${ctx.checkpoint}, please specific a start time`);
|
|
2462
|
+
return;
|
|
2463
|
+
}
|
|
2464
|
+
return handler(
|
|
2465
|
+
JSON.parse(data.rawSelf),
|
|
2466
|
+
data.rawObjects.map((o) => JSON.parse(o)),
|
|
2467
|
+
ctx
|
|
2468
|
+
);
|
|
2469
|
+
}
|
|
2470
|
+
};
|
|
2471
|
+
var IotaObjectTypeProcessor = class _IotaObjectTypeProcessor extends IotaBaseObjectOrAddressProcessor {
|
|
2472
|
+
static {
|
|
2473
|
+
__name(this, "IotaObjectTypeProcessor");
|
|
2474
|
+
}
|
|
2475
|
+
objectType;
|
|
2476
|
+
static bind(options) {
|
|
2477
|
+
const processor = new _IotaObjectTypeProcessor({
|
|
2478
|
+
address: ALL_ADDRESS,
|
|
2479
|
+
// current only support on all address
|
|
2480
|
+
network: options.network,
|
|
2481
|
+
startCheckpoint: options.startCheckpoint,
|
|
2482
|
+
endCheckpoint: options.endCheckpoint,
|
|
2483
|
+
ownerType: MoveOwnerType.TYPE,
|
|
2484
|
+
baseLabels: options.baseLabels
|
|
2485
|
+
});
|
|
2486
|
+
processor.objectType = options.objectType;
|
|
2487
|
+
return processor;
|
|
2488
|
+
}
|
|
2489
|
+
async doHandle(handler, data, ctx) {
|
|
2490
|
+
if (!data.rawSelf) {
|
|
2491
|
+
console.log(`Iota object not existed in ${ctx.checkpoint}, please specific a start time`);
|
|
2492
|
+
return;
|
|
2493
|
+
}
|
|
2494
|
+
const object = await ctx.coder.filterAndDecodeObjects(this.objectType, [JSON.parse(data.rawSelf)]);
|
|
2495
|
+
return handler(object[0], data.rawObjects.map((o) => JSON.parse(o)), ctx);
|
|
2496
|
+
}
|
|
2497
|
+
onObjectChange(handler) {
|
|
2498
|
+
if (this.config.network === IotaNetwork.TEST_NET) {
|
|
2499
|
+
throw new import_nice_grpc4.ServerError(import_nice_grpc4.Status.INVALID_ARGUMENT, "object change not supported in testnet");
|
|
2500
|
+
}
|
|
2501
|
+
const processor = this;
|
|
2502
|
+
this.objectChangeHandlers.push({
|
|
2503
|
+
handlerName: getHandlerName(),
|
|
2504
|
+
handler: /* @__PURE__ */ __name(async function(data) {
|
|
2505
|
+
const ctx = new IotaObjectChangeContext(
|
|
2506
|
+
processor.config.network,
|
|
2507
|
+
processor.config.address,
|
|
2508
|
+
data.timestamp || /* @__PURE__ */ new Date(0),
|
|
2509
|
+
data.slot,
|
|
2510
|
+
data.txDigest,
|
|
2511
|
+
processor.config.baseLabels
|
|
2512
|
+
);
|
|
2513
|
+
await handler(data.rawChanges.map((r) => JSON.parse(r)), ctx);
|
|
2514
|
+
return ctx.stopAndGetResult();
|
|
2515
|
+
}, "handler"),
|
|
2516
|
+
type: this.objectType.getSignature()
|
|
2517
|
+
});
|
|
2518
|
+
return this;
|
|
2519
|
+
}
|
|
2520
|
+
onTimeInterval(handler, timeIntervalInMinutes = 60, backfillTimeIntervalInMinutes = 240, fetchConfig) {
|
|
2521
|
+
return this.onInterval(
|
|
2522
|
+
handler,
|
|
2523
|
+
{
|
|
2524
|
+
recentInterval: timeIntervalInMinutes,
|
|
2525
|
+
backfillInterval: backfillTimeIntervalInMinutes
|
|
2526
|
+
},
|
|
2527
|
+
void 0,
|
|
2528
|
+
this.objectType.getSignature(),
|
|
2529
|
+
fetchConfig
|
|
2530
|
+
);
|
|
2531
|
+
}
|
|
2532
|
+
onCheckpointInterval(handler, checkpointInterval = 1e5, backfillCheckpointInterval = 4e5, fetchConfig) {
|
|
2533
|
+
return this.onInterval(
|
|
2534
|
+
handler,
|
|
2535
|
+
void 0,
|
|
2536
|
+
{ recentInterval: checkpointInterval, backfillInterval: backfillCheckpointInterval },
|
|
2537
|
+
this.objectType.qname,
|
|
2538
|
+
fetchConfig
|
|
2539
|
+
);
|
|
2540
|
+
}
|
|
2541
|
+
};
|
|
2542
|
+
var IotaWrappedObjectProcessor = class _IotaWrappedObjectProcessor extends IotaBaseObjectOrAddressProcessorInternal {
|
|
2543
|
+
static {
|
|
2544
|
+
__name(this, "IotaWrappedObjectProcessor");
|
|
2545
|
+
}
|
|
2546
|
+
static bind(options) {
|
|
2547
|
+
return new _IotaWrappedObjectProcessor({
|
|
2548
|
+
address: options.objectId,
|
|
2549
|
+
network: options.network,
|
|
2550
|
+
startCheckpoint: options.startCheckpoint,
|
|
2551
|
+
endCheckpoint: options.endCheckpoint,
|
|
2552
|
+
ownerType: MoveOwnerType.WRAPPED_OBJECT,
|
|
2553
|
+
baseLabels: options.baseLabels
|
|
2554
|
+
});
|
|
2555
|
+
}
|
|
2556
|
+
async doHandle(handler, data, ctx) {
|
|
2557
|
+
return handler(data.rawObjects.map((o) => JSON.parse(o)), ctx);
|
|
2558
|
+
}
|
|
2559
|
+
};
|
|
2560
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
2561
|
+
|
|
2562
|
+
// src/iota/iota-object-processor-template.ts
|
|
2563
|
+
import { ListStateStorage as ListStateStorage5 } from "@sentio/runtime";
|
|
2564
|
+
var import_nice_grpc5 = __toESM(require_lib(), 1);
|
|
2565
|
+
var IotaAccountProcessorTemplateState = class _IotaAccountProcessorTemplateState extends ListStateStorage5 {
|
|
2566
|
+
static {
|
|
2567
|
+
__name(this, "IotaAccountProcessorTemplateState");
|
|
2568
|
+
}
|
|
2569
|
+
static INSTANCE = new _IotaAccountProcessorTemplateState();
|
|
2570
|
+
};
|
|
2571
|
+
var IotaObjectOrAddressProcessorTemplate = class {
|
|
2572
|
+
static {
|
|
2573
|
+
__name(this, "IotaObjectOrAddressProcessorTemplate");
|
|
2574
|
+
}
|
|
2575
|
+
id;
|
|
2576
|
+
objectHandlers = [];
|
|
2577
|
+
binds = /* @__PURE__ */ new Set();
|
|
2578
|
+
constructor() {
|
|
2579
|
+
this.id = IotaAccountProcessorTemplateState.INSTANCE.getValues().length;
|
|
2580
|
+
IotaAccountProcessorTemplateState.INSTANCE.addValue(this);
|
|
2581
|
+
return proxyProcessor(this);
|
|
2582
|
+
}
|
|
2583
|
+
bind(options, ctx) {
|
|
2584
|
+
options.network = options.network || ctx.network;
|
|
2585
|
+
options.startCheckpoint = options.startCheckpoint || ctx.checkpoint;
|
|
2586
|
+
let id = options.objectId || options.address;
|
|
2587
|
+
if (id === "*") {
|
|
2588
|
+
throw new import_nice_grpc5.ServerError(import_nice_grpc5.Status.INVALID_ARGUMENT, "can't bind template instance with *");
|
|
2589
|
+
}
|
|
2590
|
+
id = accountAddressString(id);
|
|
2591
|
+
const sig = [options.network, id].join("_");
|
|
2592
|
+
if (this.binds.has(sig)) {
|
|
2593
|
+
console.log(`Same object id can be bind to one template only once, ignore duplicate bind: ${sig}`);
|
|
2594
|
+
return;
|
|
2595
|
+
}
|
|
2596
|
+
this.binds.add(sig);
|
|
2597
|
+
const processor = this.createProcessor(options);
|
|
2598
|
+
for (const h of this.objectHandlers) {
|
|
2599
|
+
processor.onInterval(
|
|
2600
|
+
h.handler,
|
|
2601
|
+
h.timeIntervalInMinutes,
|
|
2602
|
+
h.checkpointInterval,
|
|
2603
|
+
h.type,
|
|
2604
|
+
h.fetchConfig,
|
|
2605
|
+
h.handlerName
|
|
2606
|
+
);
|
|
2607
|
+
}
|
|
2608
|
+
const config = processor.config;
|
|
2609
|
+
ctx.update({
|
|
2610
|
+
states: {
|
|
2611
|
+
configUpdated: true
|
|
2612
|
+
}
|
|
2613
|
+
});
|
|
2614
|
+
TemplateInstanceState.INSTANCE.addValue({
|
|
2615
|
+
templateId: this.id,
|
|
2616
|
+
contract: {
|
|
2617
|
+
name: "",
|
|
2618
|
+
chainId: config.network,
|
|
2619
|
+
address: config.address,
|
|
2620
|
+
abi: ""
|
|
2621
|
+
},
|
|
2622
|
+
startBlock: config.startCheckpoint,
|
|
2623
|
+
endBlock: config.endCheckpoint || 0n,
|
|
2624
|
+
baseLabels: config.baseLabels
|
|
2625
|
+
});
|
|
2626
|
+
console.log(`successfully bind template ${sig}`);
|
|
2627
|
+
}
|
|
2628
|
+
unbind(options, ctx) {
|
|
2629
|
+
options.network = options.network || ctx.network;
|
|
2630
|
+
options.startCheckpoint = options.startCheckpoint || ctx.checkpoint;
|
|
2631
|
+
let id = options.objectId || options.address;
|
|
2632
|
+
if (id === "*") {
|
|
2633
|
+
throw new import_nice_grpc5.ServerError(import_nice_grpc5.Status.INVALID_ARGUMENT, "can't delete template instance bind with *");
|
|
2634
|
+
}
|
|
2635
|
+
id = accountAddressString(id);
|
|
2636
|
+
const sig = [options.network, id].join("_");
|
|
2637
|
+
if (!this.binds.has(sig)) {
|
|
2638
|
+
console.log(`the template instance ${sig} not existed or already unbind`);
|
|
2639
|
+
return;
|
|
2640
|
+
}
|
|
2641
|
+
this.binds.delete(sig);
|
|
2642
|
+
let deleted = 0;
|
|
2643
|
+
const oldTemplateInstances = TemplateInstanceState.INSTANCE.unregister();
|
|
2644
|
+
for (const templateInstance of oldTemplateInstances) {
|
|
2645
|
+
if (templateInstance.contract?.chainId === options.network && templateInstance.contract.address == id) {
|
|
2646
|
+
deleted++;
|
|
2647
|
+
continue;
|
|
2648
|
+
}
|
|
2649
|
+
TemplateInstanceState.INSTANCE.addValue(templateInstance);
|
|
2650
|
+
}
|
|
2651
|
+
if (deleted !== 1) {
|
|
2652
|
+
throw new import_nice_grpc5.ServerError(
|
|
2653
|
+
import_nice_grpc5.Status.INVALID_ARGUMENT,
|
|
2654
|
+
`Failed to delete template instance ${sig}, deleted ${deleted} times`
|
|
2655
|
+
);
|
|
2656
|
+
}
|
|
2657
|
+
const oldProcessors = IotaAccountProcessorState.INSTANCE.unregister();
|
|
2658
|
+
deleted = 0;
|
|
2659
|
+
for (const processor of oldProcessors) {
|
|
2660
|
+
if (processor.templateId === this.id) {
|
|
2661
|
+
if (processor.config.network == options.network && processor.config.address === id) {
|
|
2662
|
+
deleted++;
|
|
2663
|
+
continue;
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
IotaAccountProcessorState.INSTANCE.addValue(processor);
|
|
2667
|
+
}
|
|
2668
|
+
if (deleted !== 1) {
|
|
2669
|
+
throw new import_nice_grpc5.ServerError(
|
|
2670
|
+
import_nice_grpc5.Status.INVALID_ARGUMENT,
|
|
2671
|
+
`Failed to delete processor for template ${this.id}, ${sig}. deleted ${deleted} times`
|
|
2672
|
+
);
|
|
2673
|
+
}
|
|
2674
|
+
console.log(`successfully unbind template ${sig}`);
|
|
2675
|
+
ctx.update({
|
|
2676
|
+
states: {
|
|
2677
|
+
configUpdated: true
|
|
2678
|
+
}
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
onInterval(handler, timeInterval, checkpointInterval, type, fetchConfig) {
|
|
2682
|
+
this.objectHandlers.push({
|
|
2683
|
+
handlerName: getHandlerName(),
|
|
2684
|
+
handler,
|
|
2685
|
+
timeIntervalInMinutes: timeInterval,
|
|
2686
|
+
checkpointInterval,
|
|
2687
|
+
type,
|
|
2688
|
+
fetchConfig: { ...DEFAULT_ACCOUNT_FETCH_CONFIG2, ...fetchConfig }
|
|
2689
|
+
});
|
|
2690
|
+
return this;
|
|
2691
|
+
}
|
|
2692
|
+
onTimeInterval(handler, timeIntervalInMinutes = 60, backfillTimeIntervalInMinutes = 240, type, fetchConfig) {
|
|
2693
|
+
return this.onInterval(
|
|
2694
|
+
handler,
|
|
2695
|
+
{
|
|
2696
|
+
recentInterval: timeIntervalInMinutes,
|
|
2697
|
+
backfillInterval: backfillTimeIntervalInMinutes
|
|
2698
|
+
},
|
|
2699
|
+
void 0,
|
|
2700
|
+
type,
|
|
2701
|
+
fetchConfig
|
|
2702
|
+
);
|
|
2703
|
+
}
|
|
2704
|
+
onCheckpointInterval(handler, checkpointInterval = 1e5, backfillCheckpointInterval = 4e5, type, fetchConfig) {
|
|
2705
|
+
return this.onInterval(
|
|
2706
|
+
handler,
|
|
2707
|
+
void 0,
|
|
2708
|
+
{ recentInterval: checkpointInterval, backfillInterval: backfillCheckpointInterval },
|
|
2709
|
+
type,
|
|
2710
|
+
fetchConfig
|
|
2711
|
+
);
|
|
2712
|
+
}
|
|
2713
|
+
};
|
|
2714
|
+
var IotaAddressProcessorTemplate = class extends IotaObjectOrAddressProcessorTemplate {
|
|
2715
|
+
static {
|
|
2716
|
+
__name(this, "IotaAddressProcessorTemplate");
|
|
2717
|
+
}
|
|
2718
|
+
handlers = [];
|
|
2719
|
+
createProcessor(options) {
|
|
2720
|
+
const p = IotaAddressProcessor.bind(options);
|
|
2721
|
+
for (const handler of this.handlers) {
|
|
2722
|
+
p.onTransactionBlock(handler.handler, handler.filter, handler.fetchConfig);
|
|
2723
|
+
}
|
|
2724
|
+
p.templateId = this.id;
|
|
2725
|
+
return p;
|
|
2726
|
+
}
|
|
2727
|
+
onTransactionBlock(handler, filter, fetchConfig) {
|
|
2728
|
+
this.handlers.push({
|
|
2729
|
+
handler,
|
|
2730
|
+
filter,
|
|
2731
|
+
fetchConfig
|
|
2732
|
+
});
|
|
2733
|
+
return this;
|
|
2734
|
+
}
|
|
2735
|
+
};
|
|
2736
|
+
var IotaObjectProcessorTemplate = class extends IotaObjectOrAddressProcessorTemplate {
|
|
2737
|
+
static {
|
|
2738
|
+
__name(this, "IotaObjectProcessorTemplate");
|
|
2739
|
+
}
|
|
2740
|
+
createProcessor(options) {
|
|
2741
|
+
const p = IotaObjectProcessor.bind(options);
|
|
2742
|
+
p.templateId = this.id;
|
|
2743
|
+
return p;
|
|
2744
|
+
}
|
|
2745
|
+
};
|
|
2746
|
+
var IotaWrappedObjectProcessorTemplate = class extends IotaObjectOrAddressProcessorTemplate {
|
|
2747
|
+
static {
|
|
2748
|
+
__name(this, "IotaWrappedObjectProcessorTemplate");
|
|
2749
|
+
}
|
|
2750
|
+
createProcessor(options) {
|
|
2751
|
+
const p = IotaWrappedObjectProcessor.bind(options);
|
|
2752
|
+
p.templateId = this.id;
|
|
2753
|
+
return p;
|
|
2754
|
+
}
|
|
2755
|
+
};
|
|
2756
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
2757
|
+
|
|
2758
|
+
// src/iota/models.ts
|
|
2759
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
2760
|
+
|
|
2761
|
+
// src/iota/iota-plugin.ts
|
|
2762
|
+
var IotaPlugin = class {
|
|
2763
|
+
static {
|
|
2764
|
+
__name(this, "IotaPlugin");
|
|
2765
|
+
}
|
|
2766
|
+
};
|
|
2767
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
2768
|
+
|
|
2769
|
+
// src/iota/index.ts
|
|
2770
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
2771
|
+
|
|
2772
|
+
// src/iota/iota-processor.ts
|
|
2773
|
+
var DEFAULT_FETCH_CONFIG2 = {
|
|
2774
|
+
resourceChanges: false,
|
|
2775
|
+
allEvents: true,
|
|
2776
|
+
inputs: true
|
|
2777
|
+
};
|
|
2778
|
+
function configure2(options) {
|
|
2779
|
+
return {
|
|
2780
|
+
startCheckpoint: options.startCheckpoint || 0n,
|
|
2781
|
+
endCheckpoint: options.endCheckpoint,
|
|
2782
|
+
address: options.address === ALL_ADDRESS ? ALL_ADDRESS : accountAddressString(options.address),
|
|
2783
|
+
network: options.network || IotaNetwork.MAIN_NET,
|
|
2784
|
+
baseLabels: options.baseLabels
|
|
2785
|
+
};
|
|
2786
|
+
}
|
|
2787
|
+
__name(configure2, "configure");
|
|
2788
|
+
var IotaProcessorState = class _IotaProcessorState extends ListStateStorage6 {
|
|
2789
|
+
static {
|
|
2790
|
+
__name(this, "IotaProcessorState");
|
|
2791
|
+
}
|
|
2792
|
+
static INSTANCE = new _IotaProcessorState();
|
|
2793
|
+
};
|
|
2794
|
+
var IotaBaseProcessor = class {
|
|
2795
|
+
static {
|
|
2796
|
+
__name(this, "IotaBaseProcessor");
|
|
2797
|
+
}
|
|
2798
|
+
moduleName;
|
|
2799
|
+
config;
|
|
2800
|
+
eventHandlers = [];
|
|
2801
|
+
callHandlers = [];
|
|
2802
|
+
objectChangeHandlers = [];
|
|
2803
|
+
coder;
|
|
2804
|
+
constructor(name, options) {
|
|
2805
|
+
this.moduleName = name;
|
|
2806
|
+
this.config = configure2(options);
|
|
2807
|
+
IotaProcessorState.INSTANCE.addValue(this);
|
|
2808
|
+
this.coder = defaultMoveCoder4(this.config.network);
|
|
2809
|
+
return proxyProcessor(this);
|
|
2810
|
+
}
|
|
2811
|
+
getChainId() {
|
|
2812
|
+
return this.config.network;
|
|
2813
|
+
}
|
|
2814
|
+
onMoveEvent(handler, filter, handlerOptions) {
|
|
2815
|
+
let _filters = [];
|
|
2816
|
+
const _fetchConfig = MoveFetchConfig.fromPartial({ ...DEFAULT_FETCH_CONFIG2, ...handlerOptions });
|
|
2817
|
+
if (Array.isArray(filter)) {
|
|
2818
|
+
_filters = filter;
|
|
2819
|
+
} else {
|
|
2820
|
+
_filters.push(filter);
|
|
2821
|
+
}
|
|
2822
|
+
const processor = this;
|
|
2823
|
+
this.eventHandlers.push({
|
|
2824
|
+
handlerName: getHandlerName(),
|
|
2825
|
+
handler: /* @__PURE__ */ __name(async function(data) {
|
|
2826
|
+
if (!data.rawTransaction) {
|
|
2827
|
+
throw new import_nice_grpc6.ServerError(import_nice_grpc6.Status.INVALID_ARGUMENT, "event is null");
|
|
2828
|
+
}
|
|
2829
|
+
const txn = JSON.parse(data.rawTransaction);
|
|
2830
|
+
if (txn.events == null) {
|
|
2831
|
+
txn.events = [];
|
|
2832
|
+
}
|
|
2833
|
+
const evt = JSON.parse(data.rawEvent);
|
|
2834
|
+
const idx = Number(evt.id.eventSeq) || 0;
|
|
2835
|
+
const ctx = new IotaContext(
|
|
2836
|
+
processor.moduleName,
|
|
2837
|
+
processor.config.network,
|
|
2838
|
+
processor.config.address,
|
|
2839
|
+
data.timestamp || /* @__PURE__ */ new Date(0),
|
|
2840
|
+
data.slot,
|
|
2841
|
+
txn,
|
|
2842
|
+
idx,
|
|
2843
|
+
processor.config.baseLabels
|
|
2844
|
+
);
|
|
2845
|
+
const decoded = await processor.coder.decodeEvent(evt);
|
|
2846
|
+
await handler(decoded || evt, ctx);
|
|
2847
|
+
return ctx.stopAndGetResult();
|
|
2848
|
+
}, "handler"),
|
|
2849
|
+
filters: _filters,
|
|
2850
|
+
fetchConfig: _fetchConfig,
|
|
2851
|
+
partitionHandler: /* @__PURE__ */ __name(async (data) => {
|
|
2852
|
+
const p = handlerOptions?.partitionKey;
|
|
2853
|
+
if (!p) return void 0;
|
|
2854
|
+
if (typeof p === "function") {
|
|
2855
|
+
const evt = JSON.parse(data.rawEvent);
|
|
2856
|
+
const decoded = await processor.coder.decodeEvent(evt);
|
|
2857
|
+
return p(decoded || evt);
|
|
2858
|
+
}
|
|
2859
|
+
return p;
|
|
2860
|
+
}, "partitionHandler")
|
|
2861
|
+
});
|
|
2862
|
+
return this;
|
|
2863
|
+
}
|
|
2864
|
+
onEntryFunctionCall(handler, filter, handlerOptions) {
|
|
2865
|
+
let _filters = [];
|
|
2866
|
+
const _fetchConfig = MoveFetchConfig.fromPartial({ ...DEFAULT_FETCH_CONFIG2, ...handlerOptions });
|
|
2867
|
+
if (Array.isArray(filter)) {
|
|
2868
|
+
_filters = filter;
|
|
2869
|
+
} else {
|
|
2870
|
+
_filters.push(filter);
|
|
2871
|
+
}
|
|
2872
|
+
const processor = this;
|
|
2873
|
+
const allFunctionType = new Set(_filters.map((f) => f.function));
|
|
2874
|
+
this.callHandlers.push({
|
|
2875
|
+
handlerName: getHandlerName(),
|
|
2876
|
+
handler: /* @__PURE__ */ __name(async function(data) {
|
|
2877
|
+
if (!data.rawTransaction) {
|
|
2878
|
+
throw new import_nice_grpc6.ServerError(import_nice_grpc6.Status.INVALID_ARGUMENT, "call is null");
|
|
2879
|
+
}
|
|
2880
|
+
const tx = JSON.parse(data.rawTransaction);
|
|
2881
|
+
const ctx = new IotaContext(
|
|
2882
|
+
processor.moduleName,
|
|
2883
|
+
processor.config.network,
|
|
2884
|
+
processor.config.address,
|
|
2885
|
+
data.timestamp || /* @__PURE__ */ new Date(0),
|
|
2886
|
+
data.slot,
|
|
2887
|
+
tx,
|
|
2888
|
+
0,
|
|
2889
|
+
processor.config.baseLabels
|
|
2890
|
+
);
|
|
2891
|
+
if (tx) {
|
|
2892
|
+
const calls = getMoveCalls2(tx);
|
|
2893
|
+
const txKind = tx.transaction?.data?.transaction;
|
|
2894
|
+
if (!txKind) {
|
|
2895
|
+
throw new import_nice_grpc6.ServerError(import_nice_grpc6.Status.INVALID_ARGUMENT, "Unexpected getTransactionKind get empty");
|
|
2896
|
+
}
|
|
2897
|
+
const programmableTx = txKind.kind === "ProgrammableTransaction" ? txKind : void 0;
|
|
2898
|
+
for (const call of calls) {
|
|
2899
|
+
const functionType = [call.module, call.function].join(SPLITTER);
|
|
2900
|
+
if (!allFunctionType.has(functionType)) {
|
|
2901
|
+
continue;
|
|
2902
|
+
}
|
|
2903
|
+
const decoded = await processor.coder.decodeFunctionPayload(call, programmableTx?.inputs || []);
|
|
2904
|
+
await handler(decoded, ctx);
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
return ctx.stopAndGetResult();
|
|
2908
|
+
}, "handler"),
|
|
2909
|
+
filters: _filters,
|
|
2910
|
+
fetchConfig: _fetchConfig,
|
|
2911
|
+
partitionHandler: /* @__PURE__ */ __name(async (data) => {
|
|
2912
|
+
const p = handlerOptions?.partitionKey;
|
|
2913
|
+
if (!p) return void 0;
|
|
2914
|
+
if (typeof p === "function") {
|
|
2915
|
+
const tx = JSON.parse(data.rawTransaction);
|
|
2916
|
+
const calls = getMoveCalls2(tx);
|
|
2917
|
+
if (calls.length > 0) {
|
|
2918
|
+
return p(calls[0]);
|
|
2919
|
+
}
|
|
2920
|
+
return void 0;
|
|
2921
|
+
}
|
|
2922
|
+
return p;
|
|
2923
|
+
}, "partitionHandler")
|
|
2924
|
+
});
|
|
2925
|
+
return this;
|
|
2926
|
+
}
|
|
2927
|
+
onEvent(handler, handlerOptions) {
|
|
2928
|
+
this.onMoveEvent(handler, { type: "" }, handlerOptions);
|
|
2929
|
+
return this;
|
|
2930
|
+
}
|
|
2931
|
+
onTransactionBlock(handler, filter, handlerOptions) {
|
|
2932
|
+
const _fetchConfig = MoveFetchConfig.fromPartial({ ...DEFAULT_FETCH_CONFIG2, ...handlerOptions });
|
|
2933
|
+
const processor = this;
|
|
2934
|
+
this.callHandlers.push({
|
|
2935
|
+
handlerName: getHandlerName(),
|
|
2936
|
+
handler: /* @__PURE__ */ __name(async function(data) {
|
|
2937
|
+
if (!data.rawTransaction) {
|
|
2938
|
+
throw new import_nice_grpc6.ServerError(import_nice_grpc6.Status.INVALID_ARGUMENT, "transaction is null");
|
|
2939
|
+
}
|
|
2940
|
+
const tx = JSON.parse(data.rawTransaction);
|
|
2941
|
+
const ctx = new IotaContext(
|
|
2942
|
+
processor.moduleName,
|
|
2943
|
+
processor.config.network,
|
|
2944
|
+
processor.config.address,
|
|
2945
|
+
data.timestamp || /* @__PURE__ */ new Date(0),
|
|
2946
|
+
data.slot,
|
|
2947
|
+
tx,
|
|
2948
|
+
0,
|
|
2949
|
+
processor.config.baseLabels
|
|
2950
|
+
);
|
|
2951
|
+
if (tx) {
|
|
2952
|
+
await handler(tx, ctx);
|
|
2953
|
+
}
|
|
2954
|
+
return ctx.stopAndGetResult();
|
|
2955
|
+
}, "handler"),
|
|
2956
|
+
filters: [{ ...filter, function: "" }],
|
|
2957
|
+
fetchConfig: _fetchConfig,
|
|
2958
|
+
partitionHandler: /* @__PURE__ */ __name(async (data) => {
|
|
2959
|
+
const p = handlerOptions?.partitionKey;
|
|
2960
|
+
if (!p) return void 0;
|
|
2961
|
+
if (typeof p === "function") {
|
|
2962
|
+
const tx = JSON.parse(data.rawTransaction);
|
|
2963
|
+
return p(tx);
|
|
2964
|
+
}
|
|
2965
|
+
return p;
|
|
2966
|
+
}, "partitionHandler")
|
|
2967
|
+
});
|
|
2968
|
+
return this;
|
|
2969
|
+
}
|
|
2970
|
+
onObjectChange(handler, type) {
|
|
2971
|
+
if (this.config.network === IotaNetwork.TEST_NET) {
|
|
2972
|
+
throw new import_nice_grpc6.ServerError(import_nice_grpc6.Status.INVALID_ARGUMENT, "object change not supported in testnet");
|
|
2973
|
+
}
|
|
2974
|
+
const processor = this;
|
|
2975
|
+
this.objectChangeHandlers.push({
|
|
2976
|
+
handlerName: getHandlerName(),
|
|
2977
|
+
handler: /* @__PURE__ */ __name(async function(data) {
|
|
2978
|
+
const ctx = new IotaObjectChangeContext(
|
|
2979
|
+
processor.config.network,
|
|
2980
|
+
processor.config.address,
|
|
2981
|
+
data.timestamp || /* @__PURE__ */ new Date(0),
|
|
2982
|
+
data.slot,
|
|
2983
|
+
data.txDigest,
|
|
2984
|
+
processor.config.baseLabels
|
|
2985
|
+
);
|
|
2986
|
+
await handler(data.rawChanges.map((r) => JSON.parse(r)), ctx);
|
|
2987
|
+
return ctx.stopAndGetResult();
|
|
2988
|
+
}, "handler"),
|
|
2989
|
+
type
|
|
2990
|
+
});
|
|
2991
|
+
return this;
|
|
2992
|
+
}
|
|
2993
|
+
};
|
|
2994
|
+
var IotaModulesProcessor = class _IotaModulesProcessor extends IotaBaseProcessor {
|
|
2995
|
+
static {
|
|
2996
|
+
__name(this, "IotaModulesProcessor");
|
|
2997
|
+
}
|
|
2998
|
+
static bind(options) {
|
|
2999
|
+
return new _IotaModulesProcessor(ALL_ADDRESS, options);
|
|
3000
|
+
}
|
|
3001
|
+
};
|
|
3002
|
+
var IotaGlobalProcessor = class _IotaGlobalProcessor extends IotaBaseProcessor {
|
|
3003
|
+
static {
|
|
3004
|
+
__name(this, "IotaGlobalProcessor");
|
|
3005
|
+
}
|
|
3006
|
+
static bind(options) {
|
|
3007
|
+
return new _IotaGlobalProcessor(ALL_ADDRESS, { ...options, address: ALL_ADDRESS });
|
|
3008
|
+
}
|
|
3009
|
+
onTransactionBlock(handler, filter, fetchConfig) {
|
|
3010
|
+
return super.onTransactionBlock(handler, filter, fetchConfig);
|
|
3011
|
+
}
|
|
3012
|
+
// deprecated,, use object type processor
|
|
3013
|
+
onObjectChange(handler, type) {
|
|
3014
|
+
return super.onObjectChange(handler, type);
|
|
3015
|
+
}
|
|
3016
|
+
};
|
|
3017
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
3018
|
+
|
|
3019
|
+
// src/iota/iota-plugin-part.ts
|
|
3020
|
+
import { SuiChainId as SuiChainId2 } from "@sentio/chain";
|
|
3021
|
+
var IotaPluginPart = class {
|
|
3022
|
+
constructor(handlerRegister, partitionManager) {
|
|
3023
|
+
this.handlerRegister = handlerRegister;
|
|
3024
|
+
this.partitionManager = partitionManager;
|
|
3025
|
+
}
|
|
3026
|
+
static {
|
|
3027
|
+
__name(this, "IotaPluginPart");
|
|
3028
|
+
}
|
|
3029
|
+
async start(request) {
|
|
3030
|
+
await initCoinList2();
|
|
3031
|
+
console.log("total instances:", request.templateInstances.length);
|
|
3032
|
+
const allowedChainIds = /* @__PURE__ */ new Set([SuiChainId2.IOTA_MAINNET, SuiChainId2.IOTA_TESTNET]);
|
|
3033
|
+
for (const instance of request.templateInstances) {
|
|
3034
|
+
if (!allowedChainIds.has(instance.contract?.chainId || "")) {
|
|
3035
|
+
continue;
|
|
3036
|
+
}
|
|
3037
|
+
console.log("start template instance", instance.templateId);
|
|
3038
|
+
const template = IotaAccountProcessorTemplateState.INSTANCE.getValues()[instance.templateId];
|
|
3039
|
+
template.bind(
|
|
3040
|
+
{
|
|
3041
|
+
address: instance.contract?.address || "",
|
|
3042
|
+
objectId: instance.contract?.address || "",
|
|
3043
|
+
network: instance.contract?.chainId || IotaNetwork.MAIN_NET,
|
|
3044
|
+
startCheckpoint: instance.startBlock || 0n,
|
|
3045
|
+
endCheckpoint: instance.endBlock || 0n,
|
|
3046
|
+
baseLabels: instance.baseLabels
|
|
3047
|
+
},
|
|
3048
|
+
NoopContext2
|
|
3049
|
+
);
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
async init(config) {
|
|
3053
|
+
for (const state of [IotaProcessorState.INSTANCE, IotaAccountProcessorState.INSTANCE]) {
|
|
3054
|
+
for (const suiProcessor of state.getValues()) {
|
|
3055
|
+
config.chainIds.push(suiProcessor.config.network);
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
async configure(config, forChainId) {
|
|
3060
|
+
for (const suiProcessor of IotaProcessorState.INSTANCE.getValues()) {
|
|
3061
|
+
const chainId = suiProcessor.config.network;
|
|
3062
|
+
if (forChainId !== void 0 && forChainId !== chainId.toString()) {
|
|
3063
|
+
continue;
|
|
3064
|
+
}
|
|
3065
|
+
const contractConfig = ContractConfig.fromPartial({
|
|
3066
|
+
transactionConfig: [],
|
|
3067
|
+
processorType: USER_PROCESSOR2,
|
|
3068
|
+
contract: {
|
|
3069
|
+
name: suiProcessor.moduleName,
|
|
3070
|
+
chainId: suiProcessor.config.network,
|
|
3071
|
+
address: suiProcessor.config.address,
|
|
3072
|
+
abi: ""
|
|
3073
|
+
},
|
|
3074
|
+
startBlock: suiProcessor.config.startCheckpoint,
|
|
3075
|
+
endBlock: suiProcessor.config.endCheckpoint
|
|
3076
|
+
});
|
|
3077
|
+
for (const handler of suiProcessor.eventHandlers) {
|
|
3078
|
+
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
3079
|
+
this.partitionManager.registerPartitionHandler(HandlerType.SUI_EVENT, handlerId, handler.partitionHandler);
|
|
3080
|
+
const eventHandlerConfig = {
|
|
3081
|
+
filters: handler.filters.map((f) => {
|
|
3082
|
+
return {
|
|
3083
|
+
type: f.type,
|
|
3084
|
+
account: f.account || "",
|
|
3085
|
+
eventAccount: f.eventAccount || ""
|
|
3086
|
+
};
|
|
3087
|
+
}),
|
|
3088
|
+
fetchConfig: handler.fetchConfig,
|
|
3089
|
+
handlerId,
|
|
3090
|
+
handlerName: handler.handlerName
|
|
3091
|
+
};
|
|
3092
|
+
contractConfig.moveEventConfigs.push(eventHandlerConfig);
|
|
3093
|
+
}
|
|
3094
|
+
for (const handler of suiProcessor.callHandlers) {
|
|
3095
|
+
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
3096
|
+
this.partitionManager.registerPartitionHandler(HandlerType.SUI_CALL, handlerId, handler.partitionHandler);
|
|
3097
|
+
const functionHandlerConfig = {
|
|
3098
|
+
filters: handler.filters.map((filter) => {
|
|
3099
|
+
return {
|
|
3100
|
+
function: filter.function,
|
|
3101
|
+
typeArguments: filter.typeArguments || [],
|
|
3102
|
+
withTypeArguments: !!filter.typeArguments,
|
|
3103
|
+
includeFailed: filter.includeFailed || false,
|
|
3104
|
+
publicKeyPrefix: filter.publicKeyPrefix || "",
|
|
3105
|
+
fromAndToAddress: filter.fromAndToAddress
|
|
3106
|
+
};
|
|
3107
|
+
}),
|
|
3108
|
+
fetchConfig: handler.fetchConfig,
|
|
3109
|
+
handlerId,
|
|
3110
|
+
handlerName: handler.handlerName
|
|
3111
|
+
};
|
|
3112
|
+
contractConfig.moveCallConfigs.push(functionHandlerConfig);
|
|
3113
|
+
}
|
|
3114
|
+
for (const handler of suiProcessor.objectChangeHandlers) {
|
|
3115
|
+
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
3116
|
+
const objectChangeHandler = {
|
|
3117
|
+
type: handler.type,
|
|
3118
|
+
handlerId,
|
|
3119
|
+
handlerName: handler.handlerName,
|
|
3120
|
+
includeDeleted: false
|
|
3121
|
+
};
|
|
3122
|
+
contractConfig.moveResourceChangeConfigs.push(objectChangeHandler);
|
|
3123
|
+
}
|
|
3124
|
+
config.contractConfigs.push(contractConfig);
|
|
3125
|
+
}
|
|
3126
|
+
for (const processor of IotaAccountProcessorState.INSTANCE.getValues()) {
|
|
3127
|
+
const chainId = processor.getChainId();
|
|
3128
|
+
if (forChainId !== void 0 && forChainId !== chainId.toString()) {
|
|
3129
|
+
continue;
|
|
3130
|
+
}
|
|
3131
|
+
const accountConfig = AccountConfig.fromPartial({
|
|
3132
|
+
address: processor.config.address,
|
|
3133
|
+
chainId: processor.getChainId(),
|
|
3134
|
+
startBlock: processor.config.startCheckpoint,
|
|
3135
|
+
// TODO maybe use another field
|
|
3136
|
+
endBlock: processor.config.endCheckpoint
|
|
3137
|
+
});
|
|
3138
|
+
for (const handler of processor.objectChangeHandlers) {
|
|
3139
|
+
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
3140
|
+
const objectChangeHandler = {
|
|
3141
|
+
type: handler.type,
|
|
3142
|
+
handlerId,
|
|
3143
|
+
handlerName: handler.handlerName,
|
|
3144
|
+
includeDeleted: false
|
|
3145
|
+
};
|
|
3146
|
+
accountConfig.moveResourceChangeConfigs.push(objectChangeHandler);
|
|
3147
|
+
}
|
|
3148
|
+
for (const handler of processor.objectHandlers) {
|
|
3149
|
+
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
3150
|
+
accountConfig.moveIntervalConfigs.push({
|
|
3151
|
+
intervalConfig: {
|
|
3152
|
+
handlerId,
|
|
3153
|
+
handlerName: handler.handlerName,
|
|
3154
|
+
minutes: 0,
|
|
3155
|
+
minutesInterval: handler.timeIntervalInMinutes,
|
|
3156
|
+
slot: 0,
|
|
3157
|
+
slotInterval: handler.checkPointInterval,
|
|
3158
|
+
fetchConfig: void 0
|
|
3159
|
+
},
|
|
3160
|
+
type: handler.type || "",
|
|
3161
|
+
ownerType: processor.ownerType,
|
|
3162
|
+
resourceFetchConfig: handler.fetchConfig,
|
|
3163
|
+
fetchConfig: void 0
|
|
3164
|
+
});
|
|
3165
|
+
}
|
|
3166
|
+
if (processor instanceof IotaAddressProcessor) {
|
|
3167
|
+
for (const handler of processor.callHandlers) {
|
|
3168
|
+
const handlerId = this.handlerRegister.register(handler.handler, chainId);
|
|
3169
|
+
const functionHandlerConfig = {
|
|
3170
|
+
filters: handler.filters.map((filter) => {
|
|
3171
|
+
return {
|
|
3172
|
+
function: filter.function,
|
|
3173
|
+
typeArguments: filter.typeArguments || [],
|
|
3174
|
+
withTypeArguments: !!filter.typeArguments,
|
|
3175
|
+
includeFailed: filter.includeFailed || false,
|
|
3176
|
+
publicKeyPrefix: filter.publicKeyPrefix || "",
|
|
3177
|
+
fromAndToAddress: filter.fromAndToAddress
|
|
3178
|
+
};
|
|
3179
|
+
}),
|
|
3180
|
+
fetchConfig: handler.fetchConfig,
|
|
3181
|
+
handlerId,
|
|
3182
|
+
handlerName: handler.handlerName
|
|
3183
|
+
};
|
|
3184
|
+
accountConfig.moveCallConfigs.push(functionHandlerConfig);
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
config.accountConfigs.push(accountConfig);
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
};
|
|
3191
|
+
var NoopContext2 = new IotaContext("", SuiChainId2.IOTA_MAINNET, "", /* @__PURE__ */ new Date(), 0n, {}, 0, {});
|
|
3192
|
+
import("node:process").then((p) => p.stdout.write(""));
|
|
3193
|
+
|
|
3194
|
+
// src/sui/sui-plugin.ts
|
|
3195
|
+
var SuiPlugin = class extends Plugin {
|
|
3196
|
+
static {
|
|
3197
|
+
__name(this, "SuiPlugin");
|
|
3198
|
+
}
|
|
3199
|
+
name = "SuiPlugin";
|
|
3200
|
+
handlerRegister = new HandlerRegister();
|
|
3201
|
+
partitionManager = new PartitionHandlerManager();
|
|
3202
|
+
suiPart = new SuiPluginPart(this.handlerRegister, this.partitionManager);
|
|
3203
|
+
iotaPart = new IotaPluginPart(this.handlerRegister, this.partitionManager);
|
|
3204
|
+
async start(request) {
|
|
3205
|
+
await this.suiPart.start(request);
|
|
3206
|
+
await this.iotaPart.start(request);
|
|
3207
|
+
}
|
|
3208
|
+
async init(config) {
|
|
3209
|
+
await this.suiPart.init(config);
|
|
3210
|
+
await this.iotaPart.init(config);
|
|
3211
|
+
}
|
|
3212
|
+
async configure(config, forChainId) {
|
|
3213
|
+
this.handlerRegister.clear(forChainId);
|
|
3214
|
+
await this.suiPart.configure(config);
|
|
3215
|
+
await this.iotaPart.configure(config);
|
|
3216
|
+
}
|
|
3217
|
+
supportedHandlers = [
|
|
3218
|
+
HandlerType.SUI_EVENT,
|
|
3219
|
+
HandlerType.SUI_CALL,
|
|
3220
|
+
HandlerType.SUI_OBJECT,
|
|
3221
|
+
HandlerType.SUI_OBJECT_CHANGE
|
|
3222
|
+
];
|
|
3223
|
+
processBinding(request) {
|
|
3224
|
+
switch (request.handlerType) {
|
|
3225
|
+
case HandlerType.SUI_EVENT:
|
|
3226
|
+
return this.processSuiEvent(request);
|
|
3227
|
+
case HandlerType.SUI_CALL:
|
|
3228
|
+
return this.processSuiFunctionCall(request);
|
|
3229
|
+
case HandlerType.SUI_OBJECT:
|
|
3230
|
+
return this.processSuiObject(request);
|
|
3231
|
+
case HandlerType.SUI_OBJECT_CHANGE:
|
|
3232
|
+
return this.processSuiObjectChange(request);
|
|
3233
|
+
default:
|
|
3234
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "No handle type registered " + request.handlerType);
|
|
3235
|
+
}
|
|
3236
|
+
}
|
|
3237
|
+
async partition(request) {
|
|
3238
|
+
let data;
|
|
1853
3239
|
switch (request.handlerType) {
|
|
1854
3240
|
case HandlerType.SUI_EVENT:
|
|
1855
3241
|
if (!request.data?.suiEvent) {
|
|
1856
|
-
throw new
|
|
3242
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "suiEvent can't be empty");
|
|
1857
3243
|
}
|
|
1858
3244
|
data = request.data.suiEvent;
|
|
1859
3245
|
break;
|
|
1860
3246
|
case HandlerType.SUI_CALL:
|
|
1861
3247
|
if (!request.data?.suiCall) {
|
|
1862
|
-
throw new
|
|
3248
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "suiCall can't be empty");
|
|
1863
3249
|
}
|
|
1864
3250
|
data = request.data.suiCall;
|
|
1865
3251
|
break;
|
|
1866
3252
|
case HandlerType.SUI_OBJECT:
|
|
1867
3253
|
if (!request.data?.suiObject) {
|
|
1868
|
-
throw new
|
|
3254
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "suiObject can't be empty");
|
|
1869
3255
|
}
|
|
1870
3256
|
data = request.data.suiObject;
|
|
1871
3257
|
break;
|
|
1872
3258
|
case HandlerType.SUI_OBJECT_CHANGE:
|
|
1873
3259
|
if (!request.data?.suiObjectChange) {
|
|
1874
|
-
throw new
|
|
3260
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "suiObjectChange can't be empty");
|
|
1875
3261
|
}
|
|
1876
3262
|
data = request.data.suiObjectChange;
|
|
1877
3263
|
break;
|
|
1878
3264
|
default:
|
|
1879
|
-
throw new
|
|
3265
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "No handle type registered " + request.handlerType);
|
|
1880
3266
|
}
|
|
1881
3267
|
const partitions = await this.partitionManager.processPartitionForHandlerType(
|
|
1882
3268
|
request.handlerType,
|
|
@@ -1889,7 +3275,7 @@ var SuiPlugin = class extends Plugin {
|
|
|
1889
3275
|
}
|
|
1890
3276
|
async processSuiEvent(binding) {
|
|
1891
3277
|
if (!binding.data?.suiEvent) {
|
|
1892
|
-
throw new
|
|
3278
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "Event can't be empty");
|
|
1893
3279
|
}
|
|
1894
3280
|
const promises = [];
|
|
1895
3281
|
const event = binding.data.suiEvent;
|
|
@@ -1899,8 +3285,8 @@ var SuiPlugin = class extends Plugin {
|
|
|
1899
3285
|
binding.chainId,
|
|
1900
3286
|
handlerId
|
|
1901
3287
|
)(event).catch((e) => {
|
|
1902
|
-
throw new
|
|
1903
|
-
|
|
3288
|
+
throw new import_nice_grpc7.ServerError(
|
|
3289
|
+
import_nice_grpc7.Status.INTERNAL,
|
|
1904
3290
|
"error processing event: " + JSON.stringify(event) + "\n" + errorString(e)
|
|
1905
3291
|
);
|
|
1906
3292
|
})
|
|
@@ -1910,7 +3296,7 @@ var SuiPlugin = class extends Plugin {
|
|
|
1910
3296
|
}
|
|
1911
3297
|
async processSuiFunctionCall(binding) {
|
|
1912
3298
|
if (!binding.data?.suiCall) {
|
|
1913
|
-
throw new
|
|
3299
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "Call can't be empty");
|
|
1914
3300
|
}
|
|
1915
3301
|
const call = binding.data.suiCall;
|
|
1916
3302
|
const promises = [];
|
|
@@ -1919,8 +3305,8 @@ var SuiPlugin = class extends Plugin {
|
|
|
1919
3305
|
binding.chainId,
|
|
1920
3306
|
handlerId
|
|
1921
3307
|
)(call).catch((e) => {
|
|
1922
|
-
throw new
|
|
1923
|
-
|
|
3308
|
+
throw new import_nice_grpc7.ServerError(
|
|
3309
|
+
import_nice_grpc7.Status.INTERNAL,
|
|
1924
3310
|
"error processing call: " + JSON.stringify(call) + "\n" + errorString(e)
|
|
1925
3311
|
);
|
|
1926
3312
|
});
|
|
@@ -1930,7 +3316,7 @@ var SuiPlugin = class extends Plugin {
|
|
|
1930
3316
|
}
|
|
1931
3317
|
async processSuiObject(binding) {
|
|
1932
3318
|
if (!binding.data?.suiObject) {
|
|
1933
|
-
throw new
|
|
3319
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "Object can't be empty");
|
|
1934
3320
|
}
|
|
1935
3321
|
const object = binding.data.suiObject;
|
|
1936
3322
|
const promises = [];
|
|
@@ -1940,8 +3326,8 @@ var SuiPlugin = class extends Plugin {
|
|
|
1940
3326
|
binding.chainId,
|
|
1941
3327
|
handlerId
|
|
1942
3328
|
)(object).catch((e) => {
|
|
1943
|
-
throw new
|
|
1944
|
-
|
|
3329
|
+
throw new import_nice_grpc7.ServerError(
|
|
3330
|
+
import_nice_grpc7.Status.INTERNAL,
|
|
1945
3331
|
"error processing object: " + JSON.stringify(object) + "\n" + errorString(e)
|
|
1946
3332
|
);
|
|
1947
3333
|
})
|
|
@@ -1951,7 +3337,7 @@ var SuiPlugin = class extends Plugin {
|
|
|
1951
3337
|
}
|
|
1952
3338
|
async processSuiObjectChange(binding) {
|
|
1953
3339
|
if (!binding.data?.suiObjectChange) {
|
|
1954
|
-
throw new
|
|
3340
|
+
throw new import_nice_grpc7.ServerError(import_nice_grpc7.Status.INVALID_ARGUMENT, "Object change can't be empty");
|
|
1955
3341
|
}
|
|
1956
3342
|
const objectChange = binding.data.suiObjectChange;
|
|
1957
3343
|
const promises = [];
|
|
@@ -1961,8 +3347,8 @@ var SuiPlugin = class extends Plugin {
|
|
|
1961
3347
|
binding.chainId,
|
|
1962
3348
|
handlerId
|
|
1963
3349
|
)(objectChange).catch((e) => {
|
|
1964
|
-
throw new
|
|
1965
|
-
|
|
3350
|
+
throw new import_nice_grpc7.ServerError(
|
|
3351
|
+
import_nice_grpc7.Status.INTERNAL,
|
|
1966
3352
|
"error processing object change: " + JSON.stringify(objectChange) + "\n" + errorString(e)
|
|
1967
3353
|
);
|
|
1968
3354
|
})
|
|
@@ -1979,26 +3365,56 @@ import("node:process").then((p) => p.stdout.write(""));
|
|
|
1979
3365
|
import("node:process").then((p) => p.stdout.write(""));
|
|
1980
3366
|
|
|
1981
3367
|
export {
|
|
1982
|
-
ZERO_ADDRESS,
|
|
1983
|
-
transactionArgumentOrObject,
|
|
1984
|
-
transactionArgumentOrPure,
|
|
1985
|
-
transactionArgumentOrPureAddress,
|
|
1986
|
-
transactionArgumentOrPureU8,
|
|
1987
|
-
transactionArgumentOrPureU16,
|
|
1988
|
-
transactionArgumentOrPureU32,
|
|
1989
|
-
transactionArgumentOrPureU64,
|
|
1990
|
-
transactionArgumentOrPureU128,
|
|
1991
|
-
transactionArgumentOrPureU256,
|
|
1992
|
-
transactionArgumentOrPureBool,
|
|
1993
|
-
transactionArgumentOrVec,
|
|
1994
|
-
MoveCoder,
|
|
1995
|
-
getMoveCoder,
|
|
1996
|
-
|
|
3368
|
+
ZERO_ADDRESS2 as ZERO_ADDRESS,
|
|
3369
|
+
transactionArgumentOrObject2 as transactionArgumentOrObject,
|
|
3370
|
+
transactionArgumentOrPure2 as transactionArgumentOrPure,
|
|
3371
|
+
transactionArgumentOrPureAddress2 as transactionArgumentOrPureAddress,
|
|
3372
|
+
transactionArgumentOrPureU82 as transactionArgumentOrPureU8,
|
|
3373
|
+
transactionArgumentOrPureU162 as transactionArgumentOrPureU16,
|
|
3374
|
+
transactionArgumentOrPureU322 as transactionArgumentOrPureU32,
|
|
3375
|
+
transactionArgumentOrPureU642 as transactionArgumentOrPureU64,
|
|
3376
|
+
transactionArgumentOrPureU1282 as transactionArgumentOrPureU128,
|
|
3377
|
+
transactionArgumentOrPureU2562 as transactionArgumentOrPureU256,
|
|
3378
|
+
transactionArgumentOrPureBool2 as transactionArgumentOrPureBool,
|
|
3379
|
+
transactionArgumentOrVec2 as transactionArgumentOrVec,
|
|
3380
|
+
MoveCoder3 as MoveCoder,
|
|
3381
|
+
getMoveCoder2 as getMoveCoder,
|
|
3382
|
+
defaultMoveCoder4 as defaultMoveCoder,
|
|
3383
|
+
IotaContext,
|
|
3384
|
+
IotaObjectChangeContext,
|
|
3385
|
+
IotaAddressContext,
|
|
3386
|
+
IotaObjectContext,
|
|
3387
|
+
getMoveCalls2 as getMoveCalls,
|
|
3388
|
+
IotaBaseProcessor,
|
|
3389
|
+
IotaModulesProcessor,
|
|
3390
|
+
IotaGlobalProcessor,
|
|
3391
|
+
IotaAddressProcessor,
|
|
3392
|
+
IotaObjectProcessor,
|
|
3393
|
+
IotaObjectTypeProcessor,
|
|
3394
|
+
IotaWrappedObjectProcessor,
|
|
3395
|
+
IotaAddressProcessorTemplate,
|
|
3396
|
+
IotaObjectProcessorTemplate,
|
|
3397
|
+
IotaWrappedObjectProcessorTemplate,
|
|
3398
|
+
ZERO_ADDRESS as ZERO_ADDRESS2,
|
|
3399
|
+
transactionArgumentOrObject as transactionArgumentOrObject2,
|
|
3400
|
+
transactionArgumentOrPure as transactionArgumentOrPure2,
|
|
3401
|
+
transactionArgumentOrPureAddress as transactionArgumentOrPureAddress2,
|
|
3402
|
+
transactionArgumentOrPureU8 as transactionArgumentOrPureU82,
|
|
3403
|
+
transactionArgumentOrPureU16 as transactionArgumentOrPureU162,
|
|
3404
|
+
transactionArgumentOrPureU32 as transactionArgumentOrPureU322,
|
|
3405
|
+
transactionArgumentOrPureU64 as transactionArgumentOrPureU642,
|
|
3406
|
+
transactionArgumentOrPureU128 as transactionArgumentOrPureU1282,
|
|
3407
|
+
transactionArgumentOrPureU256 as transactionArgumentOrPureU2562,
|
|
3408
|
+
transactionArgumentOrPureBool as transactionArgumentOrPureBool2,
|
|
3409
|
+
transactionArgumentOrVec as transactionArgumentOrVec2,
|
|
3410
|
+
MoveCoder as MoveCoder2,
|
|
3411
|
+
getMoveCoder as getMoveCoder2,
|
|
3412
|
+
defaultMoveCoder2,
|
|
1997
3413
|
SuiContext,
|
|
1998
3414
|
SuiObjectChangeContext,
|
|
1999
3415
|
SuiAddressContext,
|
|
2000
3416
|
SuiObjectContext,
|
|
2001
|
-
getMoveCalls,
|
|
3417
|
+
getMoveCalls as getMoveCalls2,
|
|
2002
3418
|
SuiBaseProcessor,
|
|
2003
3419
|
SuiModulesProcessor,
|
|
2004
3420
|
SuiGlobalProcessor,
|
|
@@ -2009,6 +3425,7 @@ export {
|
|
|
2009
3425
|
SuiAddressProcessorTemplate,
|
|
2010
3426
|
SuiObjectProcessorTemplate,
|
|
2011
3427
|
SuiWrappedObjectProcessorTemplate,
|
|
2012
|
-
SuiPlugin
|
|
3428
|
+
SuiPlugin,
|
|
3429
|
+
IotaPlugin
|
|
2013
3430
|
};
|
|
2014
|
-
//# sourceMappingURL=chunk-
|
|
3431
|
+
//# sourceMappingURL=chunk-RQEJ6VYV.js.map
|