@sentio/sdk 2.57.12-rc.j → 2.57.13-rc.1
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/core/template.d.ts +1 -5
- package/lib/core/template.d.ts.map +1 -1
- package/lib/core/template.js +1 -4
- package/lib/core/template.js.map +1 -1
- package/lib/store/store.d.ts +2 -2
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js.map +1 -1
- package/package.json +3 -3
- package/src/core/template.ts +1 -6
- package/src/store/store.ts +2 -3
- package/lib/chunk-2F2KNF4Z.js +0 -71905
- package/lib/chunk-2F2KNF4Z.js.map +0 -1
- package/lib/chunk-43HP4DQZ.js +0 -47
- package/lib/chunk-43HP4DQZ.js.map +0 -1
- package/lib/chunk-4HPFNKDX.js +0 -6763
- package/lib/chunk-4HPFNKDX.js.map +0 -1
- package/lib/chunk-4OCWUYSJ.js +0 -898
- package/lib/chunk-4OCWUYSJ.js.map +0 -1
- package/lib/chunk-6UVWNOIX.js +0 -4207
- package/lib/chunk-6UVWNOIX.js.map +0 -1
- package/lib/chunk-73SHERGU.js +0 -23970
- package/lib/chunk-73SHERGU.js.map +0 -1
- package/lib/chunk-742S42NO.js +0 -1323
- package/lib/chunk-742S42NO.js.map +0 -1
- package/lib/chunk-7ECRTQD7.js +0 -26757
- package/lib/chunk-7ECRTQD7.js.map +0 -1
- package/lib/chunk-7IDGS56O.js +0 -5058
- package/lib/chunk-7IDGS56O.js.map +0 -1
- package/lib/chunk-7S6WQ4RL.js +0 -1069
- package/lib/chunk-7S6WQ4RL.js.map +0 -1
- package/lib/chunk-AZFMPZRN.js +0 -3613
- package/lib/chunk-AZFMPZRN.js.map +0 -1
- package/lib/chunk-BZCXYTDE.js +0 -1333
- package/lib/chunk-BZCXYTDE.js.map +0 -1
- package/lib/chunk-E2DS6WZF.js +0 -1690
- package/lib/chunk-E2DS6WZF.js.map +0 -1
- package/lib/chunk-GE6BRIGS.js +0 -1721
- package/lib/chunk-GE6BRIGS.js.map +0 -1
- package/lib/chunk-J3I3VNTV.js +0 -767
- package/lib/chunk-J3I3VNTV.js.map +0 -1
- package/lib/chunk-J3QOJ2RV.js +0 -661
- package/lib/chunk-J3QOJ2RV.js.map +0 -1
- package/lib/chunk-J5UEW4B7.js +0 -1351
- package/lib/chunk-J5UEW4B7.js.map +0 -1
- package/lib/chunk-LPSNAS2G.js +0 -460
- package/lib/chunk-LPSNAS2G.js.map +0 -1
- package/lib/chunk-LR232ZJV.js +0 -2593
- package/lib/chunk-LR232ZJV.js.map +0 -1
- package/lib/chunk-N36N7RXJ.js +0 -653
- package/lib/chunk-N36N7RXJ.js.map +0 -1
- package/lib/chunk-OJG2VJ5T.js +0 -7063
- package/lib/chunk-OJG2VJ5T.js.map +0 -1
- package/lib/chunk-ONBEMKI5.js +0 -323
- package/lib/chunk-ONBEMKI5.js.map +0 -1
- package/lib/chunk-PVX2LIM5.js +0 -205
- package/lib/chunk-PVX2LIM5.js.map +0 -1
- package/lib/chunk-R7PMHHKJ.js +0 -52
- package/lib/chunk-R7PMHHKJ.js.map +0 -1
- package/lib/chunk-RMT2JEWA.js +0 -7740
- package/lib/chunk-RMT2JEWA.js.map +0 -1
- package/lib/chunk-S6MJ3KIL.js +0 -27798
- package/lib/chunk-S6MJ3KIL.js.map +0 -1
- package/lib/chunk-UEFVZL4I.js +0 -199
- package/lib/chunk-UEFVZL4I.js.map +0 -1
- package/lib/chunk-UIBPOKNT.js +0 -945
- package/lib/chunk-UIBPOKNT.js.map +0 -1
- package/lib/chunk-ZR7UHHH2.js +0 -5
- package/lib/chunk-ZR7UHHH2.js.map +0 -1
- package/lib/multipart-parser-SQIYSR67.js +0 -368
- package/lib/multipart-parser-SQIYSR67.js.map +0 -1
- package/src/aptos/builtin/0x1.d.ts +0 -6451
- package/src/aptos/builtin/0x1.d.ts.map +0 -1
- package/src/aptos/builtin/0x1.js +0 -7138
- package/src/aptos/builtin/0x1.js.map +0 -1
- package/src/aptos/builtin/0x3.d.ts +0 -1122
- package/src/aptos/builtin/0x3.d.ts.map +0 -1
- package/src/aptos/builtin/0x3.js +0 -937
- package/src/aptos/builtin/0x3.js.map +0 -1
- package/src/aptos/builtin/0x4.d.ts +0 -551
- package/src/aptos/builtin/0x4.d.ts.map +0 -1
- package/src/aptos/builtin/0x4.js +0 -529
- package/src/aptos/builtin/0x4.js.map +0 -1
- package/src/aptos/builtin/index.d.ts +0 -4
- package/src/aptos/builtin/index.d.ts.map +0 -1
- package/src/aptos/builtin/index.js +0 -7
- package/src/aptos/builtin/index.js.map +0 -1
- package/src/eth/builtin/eacaggregatorproxy.d.ts +0 -5
- package/src/eth/builtin/eacaggregatorproxy.d.ts.map +0 -1
- package/src/eth/builtin/eacaggregatorproxy.js +0 -8
- package/src/eth/builtin/eacaggregatorproxy.js.map +0 -1
- package/src/eth/builtin/erc1155.d.ts +0 -5
- package/src/eth/builtin/erc1155.d.ts.map +0 -1
- package/src/eth/builtin/erc1155.js +0 -8
- package/src/eth/builtin/erc1155.js.map +0 -1
- package/src/eth/builtin/erc20.d.ts +0 -5
- package/src/eth/builtin/erc20.d.ts.map +0 -1
- package/src/eth/builtin/erc20.js +0 -8
- package/src/eth/builtin/erc20.js.map +0 -1
- package/src/eth/builtin/erc20bytes.d.ts +0 -5
- package/src/eth/builtin/erc20bytes.d.ts.map +0 -1
- package/src/eth/builtin/erc20bytes.js +0 -8
- package/src/eth/builtin/erc20bytes.js.map +0 -1
- package/src/eth/builtin/erc721.d.ts +0 -5
- package/src/eth/builtin/erc721.d.ts.map +0 -1
- package/src/eth/builtin/erc721.js +0 -8
- package/src/eth/builtin/erc721.js.map +0 -1
- package/src/eth/builtin/index.d.ts +0 -13
- package/src/eth/builtin/index.d.ts.map +0 -1
- package/src/eth/builtin/index.js +0 -16
- package/src/eth/builtin/index.js.map +0 -1
- package/src/eth/builtin/internal/EACAggregatorProxy.d.ts +0 -50
- package/src/eth/builtin/internal/EACAggregatorProxy.d.ts.map +0 -1
- package/src/eth/builtin/internal/EACAggregatorProxy.js +0 -2
- package/src/eth/builtin/internal/EACAggregatorProxy.js.map +0 -1
- package/src/eth/builtin/internal/ERC1155.d.ts +0 -57
- package/src/eth/builtin/internal/ERC1155.d.ts.map +0 -1
- package/src/eth/builtin/internal/ERC1155.js +0 -2
- package/src/eth/builtin/internal/ERC1155.js.map +0 -1
- package/src/eth/builtin/internal/ERC20.d.ts +0 -41
- package/src/eth/builtin/internal/ERC20.d.ts.map +0 -1
- package/src/eth/builtin/internal/ERC20.js +0 -2
- package/src/eth/builtin/internal/ERC20.js.map +0 -1
- package/src/eth/builtin/internal/ERC20Bytes.d.ts +0 -32
- package/src/eth/builtin/internal/ERC20Bytes.d.ts.map +0 -1
- package/src/eth/builtin/internal/ERC20Bytes.js +0 -2
- package/src/eth/builtin/internal/ERC20Bytes.js.map +0 -1
- package/src/eth/builtin/internal/ERC721.d.ts +0 -43
- package/src/eth/builtin/internal/ERC721.d.ts.map +0 -1
- package/src/eth/builtin/internal/ERC721.js +0 -2
- package/src/eth/builtin/internal/ERC721.js.map +0 -1
- package/src/eth/builtin/internal/WETH9.d.ts +0 -47
- package/src/eth/builtin/internal/WETH9.d.ts.map +0 -1
- package/src/eth/builtin/internal/WETH9.js +0 -2
- package/src/eth/builtin/internal/WETH9.js.map +0 -1
- package/src/eth/builtin/internal/common.d.ts +0 -3
- package/src/eth/builtin/internal/common.d.ts.map +0 -1
- package/src/eth/builtin/internal/common.js +0 -8
- package/src/eth/builtin/internal/common.js.map +0 -1
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +0 -373
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +0 -1
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.js +0 -1355
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.js.map +0 -1
- package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.d.ts +0 -7
- package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.d.ts.map +0 -1
- package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.js +0 -55
- package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.js.map +0 -1
- package/src/eth/builtin/internal/erc1155-processor.d.ts +0 -173
- package/src/eth/builtin/internal/erc1155-processor.d.ts.map +0 -1
- package/src/eth/builtin/internal/erc1155-processor.js +0 -596
- package/src/eth/builtin/internal/erc1155-processor.js.map +0 -1
- package/src/eth/builtin/internal/erc1155-test-utils.d.ts +0 -7
- package/src/eth/builtin/internal/erc1155-test-utils.d.ts.map +0 -1
- package/src/eth/builtin/internal/erc1155-test-utils.js +0 -55
- package/src/eth/builtin/internal/erc1155-test-utils.js.map +0 -1
- package/src/eth/builtin/internal/erc20-processor.d.ts +0 -244
- package/src/eth/builtin/internal/erc20-processor.d.ts.map +0 -1
- package/src/eth/builtin/internal/erc20-processor.js +0 -1109
- package/src/eth/builtin/internal/erc20-processor.js.map +0 -1
- package/src/eth/builtin/internal/erc20-test-utils.d.ts +0 -6
- package/src/eth/builtin/internal/erc20-test-utils.d.ts.map +0 -1
- package/src/eth/builtin/internal/erc20-test-utils.js +0 -44
- package/src/eth/builtin/internal/erc20-test-utils.js.map +0 -1
- package/src/eth/builtin/internal/erc20bytes-processor.d.ts +0 -144
- package/src/eth/builtin/internal/erc20bytes-processor.d.ts.map +0 -1
- package/src/eth/builtin/internal/erc20bytes-processor.js +0 -594
- package/src/eth/builtin/internal/erc20bytes-processor.js.map +0 -1
- package/src/eth/builtin/internal/erc20bytes-test-utils.d.ts +0 -5
- package/src/eth/builtin/internal/erc20bytes-test-utils.d.ts.map +0 -1
- package/src/eth/builtin/internal/erc20bytes-test-utils.js +0 -33
- package/src/eth/builtin/internal/erc20bytes-test-utils.js.map +0 -1
- package/src/eth/builtin/internal/erc721-processor.d.ts +0 -215
- package/src/eth/builtin/internal/erc721-processor.d.ts.map +0 -1
- package/src/eth/builtin/internal/erc721-processor.js +0 -895
- package/src/eth/builtin/internal/erc721-processor.js.map +0 -1
- package/src/eth/builtin/internal/erc721-test-utils.d.ts +0 -6
- package/src/eth/builtin/internal/erc721-test-utils.d.ts.map +0 -1
- package/src/eth/builtin/internal/erc721-test-utils.js +0 -44
- package/src/eth/builtin/internal/erc721-test-utils.js.map +0 -1
- package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.d.ts +0 -400
- package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.d.ts.map +0 -1
- package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.js +0 -524
- package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.js.map +0 -1
- package/src/eth/builtin/internal/factories/ERC1155__factory.d.ts +0 -251
- package/src/eth/builtin/internal/factories/ERC1155__factory.d.ts.map +0 -1
- package/src/eth/builtin/internal/factories/ERC1155__factory.js +0 -329
- package/src/eth/builtin/internal/factories/ERC1155__factory.js.map +0 -1
- package/src/eth/builtin/internal/factories/ERC20Bytes__factory.d.ts +0 -185
- package/src/eth/builtin/internal/factories/ERC20Bytes__factory.d.ts.map +0 -1
- package/src/eth/builtin/internal/factories/ERC20Bytes__factory.js +0 -251
- package/src/eth/builtin/internal/factories/ERC20Bytes__factory.js.map +0 -1
- package/src/eth/builtin/internal/factories/ERC20__factory.d.ts +0 -303
- package/src/eth/builtin/internal/factories/ERC20__factory.d.ts.map +0 -1
- package/src/eth/builtin/internal/factories/ERC20__factory.js +0 -401
- package/src/eth/builtin/internal/factories/ERC20__factory.js.map +0 -1
- package/src/eth/builtin/internal/factories/ERC721__factory.d.ts +0 -273
- package/src/eth/builtin/internal/factories/ERC721__factory.d.ts.map +0 -1
- package/src/eth/builtin/internal/factories/ERC721__factory.js +0 -361
- package/src/eth/builtin/internal/factories/ERC721__factory.js.map +0 -1
- package/src/eth/builtin/internal/factories/WETH9__factory.d.ts +0 -220
- package/src/eth/builtin/internal/factories/WETH9__factory.d.ts.map +0 -1
- package/src/eth/builtin/internal/factories/WETH9__factory.js +0 -294
- package/src/eth/builtin/internal/factories/WETH9__factory.js.map +0 -1
- package/src/eth/builtin/internal/factories/index.d.ts +0 -7
- package/src/eth/builtin/internal/factories/index.d.ts.map +0 -1
- package/src/eth/builtin/internal/factories/index.js +0 -10
- package/src/eth/builtin/internal/factories/index.js.map +0 -1
- package/src/eth/builtin/internal/index.d.ts +0 -14
- package/src/eth/builtin/internal/index.d.ts.map +0 -1
- package/src/eth/builtin/internal/index.js +0 -8
- package/src/eth/builtin/internal/index.js.map +0 -1
- package/src/eth/builtin/internal/weth9-processor.d.ts +0 -172
- package/src/eth/builtin/internal/weth9-processor.d.ts.map +0 -1
- package/src/eth/builtin/internal/weth9-processor.js +0 -729
- package/src/eth/builtin/internal/weth9-processor.js.map +0 -1
- package/src/eth/builtin/internal/weth9-test-utils.d.ts +0 -7
- package/src/eth/builtin/internal/weth9-test-utils.d.ts.map +0 -1
- package/src/eth/builtin/internal/weth9-test-utils.js +0 -55
- package/src/eth/builtin/internal/weth9-test-utils.js.map +0 -1
- package/src/eth/builtin/weth9.d.ts +0 -5
- package/src/eth/builtin/weth9.d.ts.map +0 -1
- package/src/eth/builtin/weth9.js +0 -8
- package/src/eth/builtin/weth9.js.map +0 -1
- package/src/solana/builtin/index.d.ts +0 -2
- package/src/solana/builtin/index.d.ts.map +0 -1
- package/src/solana/builtin/index.js +0 -2
- package/src/solana/builtin/index.js.map +0 -1
- package/src/solana/builtin/spl-token-processor.d.ts +0 -40
- package/src/solana/builtin/spl-token-processor.d.ts.map +0 -1
- package/src/solana/builtin/spl-token-processor.js +0 -254
- package/src/solana/builtin/spl-token-processor.js.map +0 -1
- package/src/solana/builtin/types.d.ts +0 -428
- package/src/solana/builtin/types.d.ts.map +0 -1
- package/src/solana/builtin/types.js +0 -201
- package/src/solana/builtin/types.js.map +0 -1
- package/src/sui/builtin/0x1.d.ts +0 -114
- package/src/sui/builtin/0x1.d.ts.map +0 -1
- package/src/sui/builtin/0x1.js +0 -159
- package/src/sui/builtin/0x1.js.map +0 -1
- package/src/sui/builtin/0x2.d.ts +0 -1250
- package/src/sui/builtin/0x2.d.ts.map +0 -1
- package/src/sui/builtin/0x2.js +0 -1511
- package/src/sui/builtin/0x2.js.map +0 -1
- package/src/sui/builtin/0x3.d.ts +0 -774
- package/src/sui/builtin/0x3.d.ts.map +0 -1
- package/src/sui/builtin/0x3.js +0 -720
- package/src/sui/builtin/0x3.js.map +0 -1
- package/src/sui/builtin/index.d.ts +0 -4
- package/src/sui/builtin/index.d.ts.map +0 -1
- package/src/sui/builtin/index.js +0 -7
- package/src/sui/builtin/index.js.map +0 -1
package/lib/chunk-4OCWUYSJ.js
DELETED
@@ -1,898 +0,0 @@
|
|
1
|
-
import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
|
2
|
-
import {
|
3
|
-
BaseContext
|
4
|
-
} from "./chunk-2F2KNF4Z.js";
|
5
|
-
import {
|
6
|
-
__name
|
7
|
-
} from "./chunk-R7PMHHKJ.js";
|
8
|
-
|
9
|
-
// src/move/filter.ts
|
10
|
-
var EventHandler = class {
|
11
|
-
static {
|
12
|
-
__name(this, "EventHandler");
|
13
|
-
}
|
14
|
-
filters;
|
15
|
-
handlerName;
|
16
|
-
handler;
|
17
|
-
fetchConfig;
|
18
|
-
};
|
19
|
-
var CallHandler = class {
|
20
|
-
static {
|
21
|
-
__name(this, "CallHandler");
|
22
|
-
}
|
23
|
-
filters;
|
24
|
-
handlerName;
|
25
|
-
handler;
|
26
|
-
fetchConfig;
|
27
|
-
};
|
28
|
-
var ObjectChangeHandler = class {
|
29
|
-
static {
|
30
|
-
__name(this, "ObjectChangeHandler");
|
31
|
-
}
|
32
|
-
handlerName;
|
33
|
-
handler;
|
34
|
-
type;
|
35
|
-
};
|
36
|
-
var ResourceChangeHandler = class {
|
37
|
-
static {
|
38
|
-
__name(this, "ResourceChangeHandler");
|
39
|
-
}
|
40
|
-
handlerName;
|
41
|
-
handler;
|
42
|
-
type;
|
43
|
-
};
|
44
|
-
var ResourceIntervalHandler = class {
|
45
|
-
static {
|
46
|
-
__name(this, "ResourceIntervalHandler");
|
47
|
-
}
|
48
|
-
type;
|
49
|
-
versionInterval;
|
50
|
-
timeIntervalInMinutes;
|
51
|
-
handler;
|
52
|
-
handlerName;
|
53
|
-
fetchConfig;
|
54
|
-
};
|
55
|
-
var TransactionIntervalHandler = class {
|
56
|
-
static {
|
57
|
-
__name(this, "TransactionIntervalHandler");
|
58
|
-
}
|
59
|
-
versionInterval;
|
60
|
-
timeIntervalInMinutes;
|
61
|
-
handler;
|
62
|
-
handlerName;
|
63
|
-
fetchConfig;
|
64
|
-
};
|
65
|
-
import("node:process").then((p) => p.stdout.write(""));
|
66
|
-
|
67
|
-
// src/move/move-context.ts
|
68
|
-
var MoveContext = class extends BaseContext {
|
69
|
-
static {
|
70
|
-
__name(this, "MoveContext");
|
71
|
-
}
|
72
|
-
address;
|
73
|
-
coder;
|
74
|
-
network;
|
75
|
-
};
|
76
|
-
var MoveAccountContext = class extends BaseContext {
|
77
|
-
static {
|
78
|
-
__name(this, "MoveAccountContext");
|
79
|
-
}
|
80
|
-
address;
|
81
|
-
coder;
|
82
|
-
network;
|
83
|
-
};
|
84
|
-
import("node:process").then((p) => p.stdout.write(""));
|
85
|
-
|
86
|
-
// ../../node_modules/.pnpm/radash@12.1.0/node_modules/radash/dist/esm/string.mjs
|
87
|
-
var capitalize = /* @__PURE__ */ __name((str) => {
|
88
|
-
if (!str || str.length === 0)
|
89
|
-
return "";
|
90
|
-
const lower = str.toLowerCase();
|
91
|
-
return lower.substring(0, 1).toUpperCase() + lower.substring(1, lower.length);
|
92
|
-
}, "capitalize");
|
93
|
-
var camel = /* @__PURE__ */ __name((str) => {
|
94
|
-
const parts = str?.replace(/([A-Z])+/g, capitalize)?.split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
95
|
-
if (parts.length === 0)
|
96
|
-
return "";
|
97
|
-
if (parts.length === 1)
|
98
|
-
return parts[0];
|
99
|
-
return parts.reduce((acc, part) => {
|
100
|
-
return `${acc}${part.charAt(0).toUpperCase()}${part.slice(1)}`;
|
101
|
-
});
|
102
|
-
}, "camel");
|
103
|
-
|
104
|
-
// ../../node_modules/.pnpm/@typemove+move@1.9.0/node_modules/@typemove/move/dist/esm/utils.js
|
105
|
-
var SPLITTER = "::";
|
106
|
-
var VECTOR_STR = "vector";
|
107
|
-
function isFrameworkAccount(account) {
|
108
|
-
const n = parseInt(account, 16);
|
109
|
-
if (Number.isNaN(n)) {
|
110
|
-
return false;
|
111
|
-
}
|
112
|
-
return n >= 0 && n < 16;
|
113
|
-
}
|
114
|
-
__name(isFrameworkAccount, "isFrameworkAccount");
|
115
|
-
function accountTypeString(account) {
|
116
|
-
const withoutPrefix = account.toLowerCase().replace(/^(0x)/, "");
|
117
|
-
return "0x" + withoutPrefix.replace(/^0*/, "");
|
118
|
-
}
|
119
|
-
__name(accountTypeString, "accountTypeString");
|
120
|
-
var MOVE_ADDRESS_LENGTH = 32;
|
121
|
-
function isHex(value) {
|
122
|
-
return /^(0x|0X)?[a-fA-F0-9]+$/.test(value);
|
123
|
-
}
|
124
|
-
__name(isHex, "isHex");
|
125
|
-
function getHexByteLength(value) {
|
126
|
-
return /^(0x|0X)/.test(value) ? (value.length - 2) / 2 : value.length / 2;
|
127
|
-
}
|
128
|
-
__name(getHexByteLength, "getHexByteLength");
|
129
|
-
function isValidMoveAddress(value) {
|
130
|
-
return isHex(value) && getHexByteLength(value) <= MOVE_ADDRESS_LENGTH;
|
131
|
-
}
|
132
|
-
__name(isValidMoveAddress, "isValidMoveAddress");
|
133
|
-
function accountAddressString(account) {
|
134
|
-
if (!isValidMoveAddress(account)) {
|
135
|
-
throw Error("Not valid move address");
|
136
|
-
}
|
137
|
-
const address = account.toLowerCase().replace(/^(0x)/, "");
|
138
|
-
return `0x${address.padStart(MOVE_ADDRESS_LENGTH * 2, "0")}`;
|
139
|
-
}
|
140
|
-
__name(accountAddressString, "accountAddressString");
|
141
|
-
var KEYWORDS = /* @__PURE__ */ new Set([
|
142
|
-
"break",
|
143
|
-
"case",
|
144
|
-
"catch",
|
145
|
-
"class",
|
146
|
-
"const",
|
147
|
-
"continue",
|
148
|
-
"debugger",
|
149
|
-
"default",
|
150
|
-
"delete",
|
151
|
-
"do",
|
152
|
-
"else",
|
153
|
-
"enum",
|
154
|
-
"export",
|
155
|
-
"extends",
|
156
|
-
"false",
|
157
|
-
"finally",
|
158
|
-
"for",
|
159
|
-
"function",
|
160
|
-
"if",
|
161
|
-
"import",
|
162
|
-
"in",
|
163
|
-
"instanceof",
|
164
|
-
"new",
|
165
|
-
"null",
|
166
|
-
"return",
|
167
|
-
"super",
|
168
|
-
"switch",
|
169
|
-
"this",
|
170
|
-
"throw",
|
171
|
-
"true",
|
172
|
-
"try",
|
173
|
-
"typeof",
|
174
|
-
"var",
|
175
|
-
"void",
|
176
|
-
"while",
|
177
|
-
"with",
|
178
|
-
"as",
|
179
|
-
"implements",
|
180
|
-
"interface",
|
181
|
-
"let",
|
182
|
-
"package",
|
183
|
-
"private",
|
184
|
-
"protected",
|
185
|
-
"public",
|
186
|
-
"static",
|
187
|
-
"yield",
|
188
|
-
"any",
|
189
|
-
"boolean",
|
190
|
-
"constructor",
|
191
|
-
"declare",
|
192
|
-
// 'get',
|
193
|
-
"module",
|
194
|
-
// 'require',
|
195
|
-
"number",
|
196
|
-
// 'set',
|
197
|
-
"string",
|
198
|
-
"symbol",
|
199
|
-
"type",
|
200
|
-
"from",
|
201
|
-
// 'of',
|
202
|
-
"async",
|
203
|
-
"await",
|
204
|
-
"bigint",
|
205
|
-
"object",
|
206
|
-
"volatile",
|
207
|
-
"namespace"
|
208
|
-
]);
|
209
|
-
function normalizeToJSName(name) {
|
210
|
-
if (KEYWORDS.has(name)) {
|
211
|
-
return name + "$";
|
212
|
-
}
|
213
|
-
return name;
|
214
|
-
}
|
215
|
-
__name(normalizeToJSName, "normalizeToJSName");
|
216
|
-
function moduleQnameForType(type) {
|
217
|
-
const parts = type.split(SPLITTER).slice(0, 2);
|
218
|
-
return [parts[0], parts[1]];
|
219
|
-
}
|
220
|
-
__name(moduleQnameForType, "moduleQnameForType");
|
221
|
-
function moduleQname(module) {
|
222
|
-
return accountTypeString(module.address) + SPLITTER + module.name;
|
223
|
-
}
|
224
|
-
__name(moduleQname, "moduleQname");
|
225
|
-
function structQname(module, struct) {
|
226
|
-
return [accountTypeString(module.address), module.name, struct.name].join(SPLITTER);
|
227
|
-
}
|
228
|
-
__name(structQname, "structQname");
|
229
|
-
function upperFirst(str) {
|
230
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
231
|
-
}
|
232
|
-
__name(upperFirst, "upperFirst");
|
233
|
-
function camel2(str) {
|
234
|
-
const base = camel(str);
|
235
|
-
return str.endsWith("_") ? base + "_" : base;
|
236
|
-
}
|
237
|
-
__name(camel2, "camel");
|
238
|
-
|
239
|
-
// ../../node_modules/.pnpm/@typemove+move@1.9.0/node_modules/@typemove/move/dist/esm/types.js
|
240
|
-
var TypeDescriptor = class _TypeDescriptor {
|
241
|
-
static {
|
242
|
-
__name(this, "TypeDescriptor");
|
243
|
-
}
|
244
|
-
qname;
|
245
|
-
reference;
|
246
|
-
mutable;
|
247
|
-
typeArgs;
|
248
|
-
constructor(symbol, typeParams) {
|
249
|
-
this.qname = symbol;
|
250
|
-
this.reference = false;
|
251
|
-
this.mutable = false;
|
252
|
-
this.typeArgs = typeParams || [];
|
253
|
-
}
|
254
|
-
apply(...typeArgs) {
|
255
|
-
const newObj = this.clone();
|
256
|
-
newObj.typeArgs = typeArgs;
|
257
|
-
return newObj;
|
258
|
-
}
|
259
|
-
clone() {
|
260
|
-
const newObj = new _TypeDescriptor(this.qname, this.typeArgs);
|
261
|
-
newObj.reference = this.reference;
|
262
|
-
newObj.mutable = this.mutable;
|
263
|
-
return newObj;
|
264
|
-
}
|
265
|
-
// compare qname without consider case for system type
|
266
|
-
compareQname(t) {
|
267
|
-
let t1 = this.qname;
|
268
|
-
if (BUILTIN_TYPES_SET.has(this.qname.toLowerCase())) {
|
269
|
-
t1 = this.qname.toLowerCase();
|
270
|
-
}
|
271
|
-
let t2 = t.qname;
|
272
|
-
if (BUILTIN_TYPES_SET.has(t.qname.toLowerCase())) {
|
273
|
-
t2 = t.qname;
|
274
|
-
}
|
275
|
-
return t1 === t2;
|
276
|
-
}
|
277
|
-
getSignature() {
|
278
|
-
if (this.typeArgs.length > 0) {
|
279
|
-
return this.qname + "<" + this.typeArgs.map((t) => t.getSignature()).join(", ") + ">";
|
280
|
-
}
|
281
|
-
return this.qname;
|
282
|
-
}
|
283
|
-
// Make U8, U16, etc => u8, u16
|
284
|
-
getNormalizedSignature() {
|
285
|
-
let qname = this.qname;
|
286
|
-
switch (qname) {
|
287
|
-
case "U8":
|
288
|
-
case "U16":
|
289
|
-
case "U32":
|
290
|
-
case "U64":
|
291
|
-
case "U128":
|
292
|
-
case "U256":
|
293
|
-
case "Vector":
|
294
|
-
case "Bool":
|
295
|
-
case "Address":
|
296
|
-
qname = qname.toLowerCase();
|
297
|
-
}
|
298
|
-
if (this.typeArgs.length > 0) {
|
299
|
-
return qname + "<" + this.typeArgs.map((t) => t.getNormalizedSignature()).join(", ") + ">";
|
300
|
-
}
|
301
|
-
return qname;
|
302
|
-
}
|
303
|
-
// Replace T0, T1 with more concrete type
|
304
|
-
applyTypeArgs(ctx) {
|
305
|
-
const replace = ctx.get(this.qname);
|
306
|
-
if (replace) {
|
307
|
-
return replace;
|
308
|
-
}
|
309
|
-
if (ctx.size === 0 || this.typeArgs.length === 0) {
|
310
|
-
return this;
|
311
|
-
}
|
312
|
-
const typeArgs = [];
|
313
|
-
for (const arg of this.typeArgs) {
|
314
|
-
const replace2 = ctx.get(arg.qname);
|
315
|
-
if (replace2) {
|
316
|
-
typeArgs.push(replace2);
|
317
|
-
} else {
|
318
|
-
typeArgs.push(arg.applyTypeArgs(ctx));
|
319
|
-
}
|
320
|
-
}
|
321
|
-
return new _TypeDescriptor(this.qname, typeArgs);
|
322
|
-
}
|
323
|
-
// all depended types including itself, not include system type
|
324
|
-
dependedTypes() {
|
325
|
-
if (this.qname.startsWith("&")) {
|
326
|
-
console.error("Not expected &");
|
327
|
-
return [];
|
328
|
-
}
|
329
|
-
if (this.isVector()) {
|
330
|
-
return this.typeArgs[0].dependedTypes();
|
331
|
-
}
|
332
|
-
if (BUILTIN_TYPES_SET.has(this.qname.toLowerCase())) {
|
333
|
-
return [];
|
334
|
-
}
|
335
|
-
switch (this.qname) {
|
336
|
-
case "signer":
|
337
|
-
case "0x1::string::String":
|
338
|
-
return [];
|
339
|
-
}
|
340
|
-
if (this.qname.indexOf(SPLITTER) == -1) {
|
341
|
-
if (this.qname.startsWith("T")) {
|
342
|
-
return [];
|
343
|
-
}
|
344
|
-
}
|
345
|
-
const types = /* @__PURE__ */ new Set();
|
346
|
-
for (const param of this.typeArgs) {
|
347
|
-
param.dependedTypes().forEach((t) => types.add(t));
|
348
|
-
}
|
349
|
-
types.add(this.qname);
|
350
|
-
return Array.from(types);
|
351
|
-
}
|
352
|
-
isVector() {
|
353
|
-
return this.qname.toLowerCase() === VECTOR_STR;
|
354
|
-
}
|
355
|
-
existAnyType() {
|
356
|
-
if (this.qname === "any") {
|
357
|
-
return true;
|
358
|
-
}
|
359
|
-
for (const param of this.typeArgs) {
|
360
|
-
if (param.existAnyType()) {
|
361
|
-
return true;
|
362
|
-
}
|
363
|
-
}
|
364
|
-
return false;
|
365
|
-
}
|
366
|
-
name() {
|
367
|
-
const parts = this.qname.split(SPLITTER);
|
368
|
-
return parts[parts.length - 1];
|
369
|
-
}
|
370
|
-
module() {
|
371
|
-
const parts = this.qname.split(SPLITTER);
|
372
|
-
return parts[parts.length - 2];
|
373
|
-
}
|
374
|
-
};
|
375
|
-
function parseMoveType(type) {
|
376
|
-
const stack = [new TypeDescriptor("")];
|
377
|
-
let buffer = [];
|
378
|
-
if (type === void 0) {
|
379
|
-
console.log("");
|
380
|
-
}
|
381
|
-
for (let i = 0; i < type.length; i++) {
|
382
|
-
const ch = type[i];
|
383
|
-
if (ch === " ") {
|
384
|
-
continue;
|
385
|
-
}
|
386
|
-
if (ch === "<") {
|
387
|
-
const symbol = buffer.join("");
|
388
|
-
buffer = [];
|
389
|
-
stack[stack.length - 1].qname = symbol;
|
390
|
-
adjustType(stack[stack.length - 1]);
|
391
|
-
stack.push(new TypeDescriptor(""));
|
392
|
-
continue;
|
393
|
-
}
|
394
|
-
if (ch === ">" || ch === ",") {
|
395
|
-
const typeParam = stack.pop();
|
396
|
-
if (!typeParam) {
|
397
|
-
throw Error("Unexpected stack size");
|
398
|
-
}
|
399
|
-
if (buffer.length > 0) {
|
400
|
-
typeParam.qname = buffer.join("");
|
401
|
-
buffer = [];
|
402
|
-
}
|
403
|
-
adjustType(typeParam);
|
404
|
-
stack[stack.length - 1].typeArgs.push(typeParam);
|
405
|
-
if (ch === ",") {
|
406
|
-
stack.push(new TypeDescriptor(""));
|
407
|
-
}
|
408
|
-
continue;
|
409
|
-
}
|
410
|
-
buffer.push(ch);
|
411
|
-
}
|
412
|
-
if (buffer.length > 0) {
|
413
|
-
stack[stack.length - 1].qname = buffer.join("");
|
414
|
-
}
|
415
|
-
adjustType(stack[stack.length - 1]);
|
416
|
-
const res = stack.pop();
|
417
|
-
if (!res || stack.length > 0) {
|
418
|
-
throw Error("Unexpected stack size");
|
419
|
-
}
|
420
|
-
return res;
|
421
|
-
}
|
422
|
-
__name(parseMoveType, "parseMoveType");
|
423
|
-
function adjustType(type) {
|
424
|
-
if (type.qname.startsWith("&")) {
|
425
|
-
type.reference = true;
|
426
|
-
type.qname = type.qname.slice(1);
|
427
|
-
}
|
428
|
-
if (type.qname.startsWith("mut")) {
|
429
|
-
type.mutable = true;
|
430
|
-
type.qname = type.qname.slice(3);
|
431
|
-
}
|
432
|
-
const parts = type.qname.split(SPLITTER);
|
433
|
-
if (parts.length > 1) {
|
434
|
-
const [account, module, name] = parts;
|
435
|
-
type.qname = [accountTypeString(account), module, name].join(SPLITTER);
|
436
|
-
}
|
437
|
-
}
|
438
|
-
__name(adjustType, "adjustType");
|
439
|
-
var ANY_TYPE = new TypeDescriptor("any");
|
440
|
-
function vectorType(t = ANY_TYPE) {
|
441
|
-
return BUILTIN_TYPES.VECTOR_TYPE_ANY.apply(t);
|
442
|
-
}
|
443
|
-
__name(vectorType, "vectorType");
|
444
|
-
var BUILTIN_TYPES = {
|
445
|
-
ADDRESS_TYPE: new TypeDescriptor("address"),
|
446
|
-
// export const Address = new TypeDescriptor<string>("Address")
|
447
|
-
VECTOR_TYPE_ANY: new TypeDescriptor("vector"),
|
448
|
-
VECTOR_TYPE: vectorType,
|
449
|
-
BOOL_TYPE: new TypeDescriptor("bool"),
|
450
|
-
U8_TYPE: new TypeDescriptor("u8"),
|
451
|
-
// export const U8 = new TypeDescriptor<number>("U8")
|
452
|
-
U16_TYPE: new TypeDescriptor("u16"),
|
453
|
-
// export const U16 = new TypeDescriptor<number>("U16")
|
454
|
-
U32_TYPE: new TypeDescriptor("u32"),
|
455
|
-
// export const U32 = new TypeDescriptor<number>("U32")
|
456
|
-
U64_TYPE: new TypeDescriptor("u64"),
|
457
|
-
// export const U64 = new TypeDescriptor<number>("U64")
|
458
|
-
U128_TYPE: new TypeDescriptor("u128"),
|
459
|
-
// export const U128 = new TypeDescriptor<number>("U128")
|
460
|
-
U256_TYPE: new TypeDescriptor("u256")
|
461
|
-
// export const U256 = new TypeDescriptor<number>("U256")
|
462
|
-
};
|
463
|
-
var BUILTIN_TYPES_SET = new Set(Object.values(BUILTIN_TYPES).flatMap((t) => {
|
464
|
-
if (typeof t === "object") {
|
465
|
-
return [t.qname.toLowerCase()];
|
466
|
-
}
|
467
|
-
return [];
|
468
|
-
}));
|
469
|
-
function matchType(matcher, type) {
|
470
|
-
if (matcher.qname === "any") {
|
471
|
-
return true;
|
472
|
-
}
|
473
|
-
if (!matcher.compareQname(type)) {
|
474
|
-
return false;
|
475
|
-
}
|
476
|
-
for (const [idx, matcherTarg] of matcher.typeArgs.entries()) {
|
477
|
-
const targ = type.typeArgs[idx];
|
478
|
-
if (!matchType(matcherTarg, targ)) {
|
479
|
-
return false;
|
480
|
-
}
|
481
|
-
}
|
482
|
-
return true;
|
483
|
-
}
|
484
|
-
__name(matchType, "matchType");
|
485
|
-
|
486
|
-
// ../../node_modules/.pnpm/@typemove+move@1.9.0/node_modules/@typemove/move/dist/esm/account.js
|
487
|
-
var AccountModulesImportInfo = class {
|
488
|
-
static {
|
489
|
-
__name(this, "AccountModulesImportInfo");
|
490
|
-
}
|
491
|
-
// account to module
|
492
|
-
imports;
|
493
|
-
account;
|
494
|
-
moduleName;
|
495
|
-
constructor(account, tsModuleName) {
|
496
|
-
this.account = account;
|
497
|
-
this.moduleName = tsModuleName;
|
498
|
-
this.imports = /* @__PURE__ */ new Map();
|
499
|
-
}
|
500
|
-
addImport(account, module) {
|
501
|
-
if (account === this.account) {
|
502
|
-
return;
|
503
|
-
}
|
504
|
-
let accountModules = this.imports.get(account);
|
505
|
-
if (!accountModules) {
|
506
|
-
accountModules = /* @__PURE__ */ new Set();
|
507
|
-
this.imports.set(account, accountModules);
|
508
|
-
}
|
509
|
-
accountModules.add(module);
|
510
|
-
}
|
511
|
-
};
|
512
|
-
var AccountRegister = class {
|
513
|
-
static {
|
514
|
-
__name(this, "AccountRegister");
|
515
|
-
}
|
516
|
-
accountImports = /* @__PURE__ */ new Map();
|
517
|
-
pendingAccounts = /* @__PURE__ */ new Set();
|
518
|
-
register(module, tsModuleName) {
|
519
|
-
const currentModuleFqn = moduleQname(module);
|
520
|
-
let accountModuleImports = this.accountImports.get(module.address);
|
521
|
-
if (!accountModuleImports) {
|
522
|
-
accountModuleImports = new AccountModulesImportInfo(module.address, tsModuleName);
|
523
|
-
this.accountImports.set(module.address, accountModuleImports);
|
524
|
-
this.pendingAccounts.delete(module.address);
|
525
|
-
}
|
526
|
-
this.registerStruct(module, accountModuleImports);
|
527
|
-
this.registerFunctions(module, accountModuleImports);
|
528
|
-
this.accountImports.set(currentModuleFqn, accountModuleImports);
|
529
|
-
return accountModuleImports;
|
530
|
-
}
|
531
|
-
registerFunctions(module, accountModuleImports) {
|
532
|
-
for (const func of module.exposedFunctions) {
|
533
|
-
for (const param of func.params.concat(func.return)) {
|
534
|
-
for (const type of param.dependedTypes()) {
|
535
|
-
const [account, module2] = moduleQnameForType(type);
|
536
|
-
accountModuleImports.addImport(account, module2);
|
537
|
-
if (!this.accountImports.has(account)) {
|
538
|
-
this.pendingAccounts.add(account);
|
539
|
-
}
|
540
|
-
}
|
541
|
-
}
|
542
|
-
}
|
543
|
-
}
|
544
|
-
registerStruct(module, accountModuleImports) {
|
545
|
-
for (const struct of module.structs) {
|
546
|
-
for (const field of struct.fields) {
|
547
|
-
for (const type of field.type.dependedTypes()) {
|
548
|
-
const [account, module2] = moduleQnameForType(type);
|
549
|
-
accountModuleImports.addImport(account, module2);
|
550
|
-
if (!this.accountImports.has(account)) {
|
551
|
-
this.pendingAccounts.add(account);
|
552
|
-
}
|
553
|
-
}
|
554
|
-
}
|
555
|
-
}
|
556
|
-
}
|
557
|
-
};
|
558
|
-
|
559
|
-
// ../../node_modules/.pnpm/@typemove+move@1.9.0/node_modules/@typemove/move/dist/esm/chain-adapter.js
|
560
|
-
var ChainAdapter = class {
|
561
|
-
static {
|
562
|
-
__name(this, "ChainAdapter");
|
563
|
-
}
|
564
|
-
};
|
565
|
-
|
566
|
-
// ../../node_modules/.pnpm/@typemove+move@1.9.0/node_modules/@typemove/move/dist/esm/abstract-move-coder.js
|
567
|
-
var AbstractMoveCoder = class {
|
568
|
-
static {
|
569
|
-
__name(this, "AbstractMoveCoder");
|
570
|
-
}
|
571
|
-
moduleMapping = /* @__PURE__ */ new Map();
|
572
|
-
accounts = /* @__PURE__ */ new Set();
|
573
|
-
typeMapping = /* @__PURE__ */ new Map();
|
574
|
-
enumMapping = /* @__PURE__ */ new Map();
|
575
|
-
funcMapping = /* @__PURE__ */ new Map();
|
576
|
-
// network: string
|
577
|
-
adapter;
|
578
|
-
constructor(adapter) {
|
579
|
-
this.adapter = adapter;
|
580
|
-
}
|
581
|
-
contains(account, name) {
|
582
|
-
return this.moduleMapping.has(moduleQname({ address: account, name }));
|
583
|
-
}
|
584
|
-
loadInternal(module, address) {
|
585
|
-
const account = accountAddressString(module.address);
|
586
|
-
const declareAccount = accountAddressString(address);
|
587
|
-
this._loadInternal(module, account);
|
588
|
-
if (account !== declareAccount) {
|
589
|
-
this._loadInternal(module, declareAccount);
|
590
|
-
}
|
591
|
-
}
|
592
|
-
_loadInternal(module, account) {
|
593
|
-
if (this.contains(account, module.name)) {
|
594
|
-
return;
|
595
|
-
}
|
596
|
-
this.moduleMapping.set(moduleQname({ address: account, name: module.name }), module);
|
597
|
-
for (const enumType of module.enums) {
|
598
|
-
const key = [account, module.name, enumType.name].join(SPLITTER);
|
599
|
-
this.enumMapping.set(key, enumType);
|
600
|
-
}
|
601
|
-
for (const struct of module.structs) {
|
602
|
-
const key = [account, module.name, struct.name].join(SPLITTER);
|
603
|
-
this.typeMapping.set(key, struct);
|
604
|
-
}
|
605
|
-
for (const func of module.exposedFunctions) {
|
606
|
-
const key = [account, module.name, func.name].join(SPLITTER);
|
607
|
-
this.funcMapping.set(key, func);
|
608
|
-
}
|
609
|
-
}
|
610
|
-
decodeBigInt(data) {
|
611
|
-
if (Array.isArray(data)) {
|
612
|
-
throw new Error("data is in byte array");
|
613
|
-
}
|
614
|
-
return BigInt(data);
|
615
|
-
}
|
616
|
-
requestMap = /* @__PURE__ */ new Map();
|
617
|
-
async getMoveStruct(type) {
|
618
|
-
const [account_, module, typeName] = type.split(SPLITTER);
|
619
|
-
const account = accountAddressString(account_);
|
620
|
-
type = [account, module, typeName].join(SPLITTER);
|
621
|
-
let struct = this.typeMapping.get(type);
|
622
|
-
if (struct) {
|
623
|
-
return struct;
|
624
|
-
}
|
625
|
-
if (this.accounts.has(account)) {
|
626
|
-
throw new Error("Failed to load struct " + type + " for imported account");
|
627
|
-
}
|
628
|
-
let resp = this.requestMap.get(account);
|
629
|
-
if (!resp) {
|
630
|
-
resp = this.adapter.fetchModules(account).then((modules) => {
|
631
|
-
for (const m of modules) {
|
632
|
-
this.load(m, account);
|
633
|
-
}
|
634
|
-
});
|
635
|
-
this.requestMap.set(account, resp);
|
636
|
-
}
|
637
|
-
await resp;
|
638
|
-
struct = this.typeMapping.get(type);
|
639
|
-
if (struct) {
|
640
|
-
return struct;
|
641
|
-
}
|
642
|
-
throw new Error("Failed to load function " + type + " type are not imported anywhere");
|
643
|
-
}
|
644
|
-
async maybeGetMoveEnum(type) {
|
645
|
-
const [account_, module, typeName] = type.split(SPLITTER);
|
646
|
-
const account = accountAddressString(account_);
|
647
|
-
type = [account, module, typeName].join(SPLITTER);
|
648
|
-
let enumType = this.enumMapping.get(type);
|
649
|
-
if (enumType) {
|
650
|
-
return enumType;
|
651
|
-
}
|
652
|
-
if (this.accounts.has(account)) {
|
653
|
-
return void 0;
|
654
|
-
}
|
655
|
-
let resp = this.requestMap.get(account);
|
656
|
-
if (!resp) {
|
657
|
-
resp = this.adapter.fetchModules(account).then((modules) => {
|
658
|
-
for (const m of modules) {
|
659
|
-
this.load(m, account);
|
660
|
-
}
|
661
|
-
});
|
662
|
-
this.requestMap.set(account, resp);
|
663
|
-
}
|
664
|
-
await resp;
|
665
|
-
enumType = this.enumMapping.get(type);
|
666
|
-
if (enumType) {
|
667
|
-
return enumType;
|
668
|
-
}
|
669
|
-
return void 0;
|
670
|
-
}
|
671
|
-
async getMoveFunction(type) {
|
672
|
-
const [account_, module, typeName] = type.split(SPLITTER);
|
673
|
-
const account = accountAddressString(account_);
|
674
|
-
type = [account, module, typeName].join(SPLITTER);
|
675
|
-
let func = this.funcMapping.get(type);
|
676
|
-
if (func) {
|
677
|
-
return func;
|
678
|
-
}
|
679
|
-
if (this.accounts.has(account)) {
|
680
|
-
throw new Error("Failed to load function " + type + " for imported account");
|
681
|
-
}
|
682
|
-
let resp = this.requestMap.get(account);
|
683
|
-
if (!resp) {
|
684
|
-
resp = this.adapter.fetchModules(account).then((modules) => {
|
685
|
-
for (const m of modules) {
|
686
|
-
this.load(m, account);
|
687
|
-
}
|
688
|
-
}).catch((e) => {
|
689
|
-
this.requestMap.delete(account);
|
690
|
-
});
|
691
|
-
this.requestMap.set(account, resp);
|
692
|
-
}
|
693
|
-
await resp;
|
694
|
-
func = this.funcMapping.get(type);
|
695
|
-
if (func) {
|
696
|
-
return func;
|
697
|
-
}
|
698
|
-
throw new Error("Failed to load function " + type + " type are not imported anywhere");
|
699
|
-
}
|
700
|
-
async decode(data, type) {
|
701
|
-
if (type.reference) {
|
702
|
-
return data;
|
703
|
-
}
|
704
|
-
switch (type.qname) {
|
705
|
-
case "signer":
|
706
|
-
// TODO check this, aptos only
|
707
|
-
case "address":
|
708
|
-
case "Address":
|
709
|
-
case "0x1::string::String":
|
710
|
-
case "bool":
|
711
|
-
case "Bool":
|
712
|
-
case "u8":
|
713
|
-
case "U8":
|
714
|
-
case "u16":
|
715
|
-
case "U16":
|
716
|
-
case "u32":
|
717
|
-
case "U32":
|
718
|
-
return data;
|
719
|
-
case "u64":
|
720
|
-
case "U64":
|
721
|
-
case "u128":
|
722
|
-
case "U128":
|
723
|
-
case "u256":
|
724
|
-
case "U256":
|
725
|
-
return this.decodeBigInt(data);
|
726
|
-
}
|
727
|
-
if (type.qname.toLowerCase() === VECTOR_STR) {
|
728
|
-
if (type.typeArgs[0].qname === "u8" || type.typeArgs[0].qname === "U8") {
|
729
|
-
return data;
|
730
|
-
}
|
731
|
-
const res = [];
|
732
|
-
for (const entry of data) {
|
733
|
-
res.push(await this.decode(entry, type.typeArgs[0]));
|
734
|
-
}
|
735
|
-
return res;
|
736
|
-
}
|
737
|
-
const enumType = await this.maybeGetMoveEnum(type.qname);
|
738
|
-
if (enumType) {
|
739
|
-
return data;
|
740
|
-
}
|
741
|
-
const struct = await this.getMoveStruct(type.qname);
|
742
|
-
const typeCtx = /* @__PURE__ */ new Map();
|
743
|
-
for (const [idx, typeArg] of type.typeArgs.entries()) {
|
744
|
-
typeCtx.set("T" + idx, typeArg);
|
745
|
-
}
|
746
|
-
const typedData = {};
|
747
|
-
for (const field of struct.fields) {
|
748
|
-
let filedType = field.type;
|
749
|
-
filedType = filedType.applyTypeArgs(typeCtx);
|
750
|
-
const fieldValue = this.adapter.getData(data)[field.name];
|
751
|
-
const value = await this.decode(fieldValue, filedType);
|
752
|
-
typedData[field.name] = value;
|
753
|
-
}
|
754
|
-
return typedData;
|
755
|
-
}
|
756
|
-
async decodeArray(entries, types, strict = true) {
|
757
|
-
const entriesDecoded = [];
|
758
|
-
for (const [idx, arg] of entries.entries()) {
|
759
|
-
const argType = types[idx];
|
760
|
-
try {
|
761
|
-
if (!strict && arg === void 0) {
|
762
|
-
entriesDecoded.push(arg);
|
763
|
-
} else {
|
764
|
-
entriesDecoded.push(await this.decode(arg, argType));
|
765
|
-
}
|
766
|
-
} catch (e) {
|
767
|
-
throw Error("Decoding error for " + JSON.stringify(arg) + "using type" + argType + e.toString());
|
768
|
-
}
|
769
|
-
}
|
770
|
-
return entriesDecoded;
|
771
|
-
}
|
772
|
-
encode(data) {
|
773
|
-
if (data === void 0 || data === null) {
|
774
|
-
return void 0;
|
775
|
-
}
|
776
|
-
if (typeof data === "bigint") {
|
777
|
-
return data.toString();
|
778
|
-
}
|
779
|
-
if (Array.isArray(data)) {
|
780
|
-
return this.encodeArray(data);
|
781
|
-
}
|
782
|
-
for (const [key, value] of Object.entries(data)) {
|
783
|
-
if (!value) {
|
784
|
-
continue;
|
785
|
-
}
|
786
|
-
if (typeof value === "bigint") {
|
787
|
-
data[key] = value.toString();
|
788
|
-
}
|
789
|
-
}
|
790
|
-
return data;
|
791
|
-
}
|
792
|
-
encodeArray(entriesDecoded) {
|
793
|
-
const entries = [];
|
794
|
-
for (const [idx, arg] of entriesDecoded.entries()) {
|
795
|
-
entries.push(this.encode(arg));
|
796
|
-
}
|
797
|
-
return entries;
|
798
|
-
}
|
799
|
-
async decodeCallResult(res, func) {
|
800
|
-
const f = await this.getMoveFunction(func);
|
801
|
-
return this.decodeArray(res, f.return);
|
802
|
-
}
|
803
|
-
async filterAndDecodeStruct(typeMatcher, structsWithTags) {
|
804
|
-
if (!structsWithTags) {
|
805
|
-
return [];
|
806
|
-
}
|
807
|
-
const results = [];
|
808
|
-
for (const resource of structsWithTags) {
|
809
|
-
const resourceType = this.adapter.getType(resource);
|
810
|
-
const resourceTypeDescriptor = parseMoveType(resourceType);
|
811
|
-
if (!matchType(typeMatcher, resourceTypeDescriptor)) {
|
812
|
-
continue;
|
813
|
-
}
|
814
|
-
const result = await this.decodedStruct(resource);
|
815
|
-
if (result) {
|
816
|
-
results.push(result);
|
817
|
-
} else {
|
818
|
-
console.error("decoding error");
|
819
|
-
}
|
820
|
-
}
|
821
|
-
return results;
|
822
|
-
}
|
823
|
-
async decodedStruct(typeStruct) {
|
824
|
-
const typeDescriptor = parseMoveType(this.adapter.getType(typeStruct));
|
825
|
-
const typeArguments = typeDescriptor.typeArgs.map((t) => t.getSignature());
|
826
|
-
let dataTyped = void 0;
|
827
|
-
try {
|
828
|
-
dataTyped = await this.decode(typeStruct, typeDescriptor);
|
829
|
-
} catch (e) {
|
830
|
-
throw Error("Decoding error for struct" + JSON.stringify(typeStruct) + e.toString());
|
831
|
-
}
|
832
|
-
return {
|
833
|
-
...typeStruct,
|
834
|
-
data_decoded: dataTyped,
|
835
|
-
type_arguments: typeArguments
|
836
|
-
};
|
837
|
-
}
|
838
|
-
async decodeType(typeStruct, type) {
|
839
|
-
if (typeStruct === null || typeStruct == void 0) {
|
840
|
-
return typeStruct;
|
841
|
-
}
|
842
|
-
if (typeof typeStruct === "object") {
|
843
|
-
if ("type" in typeStruct) {
|
844
|
-
const typeInStruct = parseMoveType(typeStruct.type.toString() || "");
|
845
|
-
if (!matchType(type, typeInStruct)) {
|
846
|
-
return void 0;
|
847
|
-
}
|
848
|
-
}
|
849
|
-
}
|
850
|
-
return await this.decode(typeStruct, type);
|
851
|
-
}
|
852
|
-
};
|
853
|
-
|
854
|
-
// ../../node_modules/.pnpm/@typemove+move@1.9.0/node_modules/@typemove/move/dist/esm/internal-models.js
|
855
|
-
var InternalMoveFunctionVisibility;
|
856
|
-
(function(InternalMoveFunctionVisibility2) {
|
857
|
-
InternalMoveFunctionVisibility2["PRIVATE"] = "private";
|
858
|
-
InternalMoveFunctionVisibility2["PUBLIC"] = "public";
|
859
|
-
InternalMoveFunctionVisibility2["FRIEND"] = "friend";
|
860
|
-
})(InternalMoveFunctionVisibility || (InternalMoveFunctionVisibility = {}));
|
861
|
-
|
862
|
-
// src/move/index.ts
|
863
|
-
import("node:process").then((p) => p.stdout.write(""));
|
864
|
-
|
865
|
-
export {
|
866
|
-
SPLITTER,
|
867
|
-
VECTOR_STR,
|
868
|
-
isFrameworkAccount,
|
869
|
-
accountTypeString,
|
870
|
-
isValidMoveAddress,
|
871
|
-
accountAddressString,
|
872
|
-
normalizeToJSName,
|
873
|
-
moduleQnameForType,
|
874
|
-
moduleQname,
|
875
|
-
structQname,
|
876
|
-
upperFirst,
|
877
|
-
camel2 as camel,
|
878
|
-
TypeDescriptor,
|
879
|
-
parseMoveType,
|
880
|
-
ANY_TYPE,
|
881
|
-
vectorType,
|
882
|
-
BUILTIN_TYPES,
|
883
|
-
matchType,
|
884
|
-
AccountModulesImportInfo,
|
885
|
-
AccountRegister,
|
886
|
-
ChainAdapter,
|
887
|
-
AbstractMoveCoder,
|
888
|
-
InternalMoveFunctionVisibility,
|
889
|
-
EventHandler,
|
890
|
-
CallHandler,
|
891
|
-
ObjectChangeHandler,
|
892
|
-
ResourceChangeHandler,
|
893
|
-
ResourceIntervalHandler,
|
894
|
-
TransactionIntervalHandler,
|
895
|
-
MoveContext,
|
896
|
-
MoveAccountContext
|
897
|
-
};
|
898
|
-
//# sourceMappingURL=chunk-4OCWUYSJ.js.map
|