@typemove/iota 1.14.0-rc.1 → 2.0.0
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/package.json +3 -3
- package/dist/esm/builtin/0x1.d.ts +0 -733
- package/dist/esm/builtin/0x1.d.ts.map +0 -1
- package/dist/esm/builtin/0x1.js +0 -4293
- package/dist/esm/builtin/0x1.js.map +0 -1
- package/dist/esm/builtin/0x2.d.ts +0 -4607
- package/dist/esm/builtin/0x2.d.ts.map +0 -1
- package/dist/esm/builtin/0x2.js +0 -19016
- package/dist/esm/builtin/0x2.js.map +0 -1
- package/dist/esm/builtin/0x3.d.ts +0 -1901
- package/dist/esm/builtin/0x3.d.ts.map +0 -1
- package/dist/esm/builtin/0x3.js +0 -6165
- package/dist/esm/builtin/0x3.js.map +0 -1
- package/dist/esm/builtin/index.d.ts +0 -4
- package/dist/esm/builtin/index.d.ts.map +0 -1
- package/dist/esm/builtin/index.js +0 -7
- package/dist/esm/builtin/index.js.map +0 -1
- package/dist/esm/codegen/codegen.d.ts +0 -20
- package/dist/esm/codegen/codegen.d.ts.map +0 -1
- package/dist/esm/codegen/codegen.js +0 -245
- package/dist/esm/codegen/codegen.js.map +0 -1
- package/dist/esm/codegen/index.d.ts +0 -2
- package/dist/esm/codegen/index.d.ts.map +0 -1
- package/dist/esm/codegen/index.js +0 -2
- package/dist/esm/codegen/index.js.map +0 -1
- package/dist/esm/codegen/run.d.ts +0 -3
- package/dist/esm/codegen/run.d.ts.map +0 -1
- package/dist/esm/codegen/run.js.map +0 -1
- package/dist/esm/index.d.ts +0 -4
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/models.d.ts +0 -18
- package/dist/esm/models.d.ts.map +0 -1
- package/dist/esm/models.js +0 -2
- package/dist/esm/models.js.map +0 -1
- package/dist/esm/move-coder.d.ts +0 -26
- package/dist/esm/move-coder.d.ts.map +0 -1
- package/dist/esm/move-coder.js +0 -266
- package/dist/esm/move-coder.js.map +0 -1
- package/dist/esm/sui-chain-adapter.d.ts +0 -15
- package/dist/esm/sui-chain-adapter.d.ts.map +0 -1
- package/dist/esm/sui-chain-adapter.js +0 -84
- package/dist/esm/sui-chain-adapter.js.map +0 -1
- package/dist/esm/to-internal.d.ts +0 -4
- package/dist/esm/to-internal.d.ts.map +0 -1
- package/dist/esm/to-internal.js +0 -96
- package/dist/esm/to-internal.js.map +0 -1
- package/dist/esm/transaction.d.ts +0 -15
- package/dist/esm/transaction.d.ts.map +0 -1
- package/dist/esm/transaction.js +0 -83
- package/dist/esm/transaction.js.map +0 -1
- package/src/abis/0x1.json +0 -4213
- package/src/abis/0x2.json +0 -30623
- package/src/abis/0x3.json +0 -10691
- package/src/builtin/0x1.ts +0 -6065
- package/src/builtin/0x2.ts +0 -28181
- package/src/builtin/0x3.ts +0 -9666
- package/src/builtin/index.ts +0 -6
- package/src/codegen/codegen.ts +0 -288
- package/src/codegen/index.ts +0 -1
- package/src/codegen/run.ts +0 -57
- package/src/index.ts +0 -4
- package/src/models.ts +0 -21
- package/src/move-coder.ts +0 -316
- package/src/sui-chain-adapter.ts +0 -113
- package/src/tests/abis/testnet/0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5.json +0 -265
- package/src/tests/abis/testnet/0x6c4a21e3e7e6b6d51c4604021633e1d97e24e37a696f8c082cd48f37503e602a.json +0 -2429
- package/src/tests/abis/testnet/0x7f7a37c826c88bcfe9aecc042453395ddfa9df6f29cb7c97590bf86cf2b0a75e.json +0 -1356
- package/src/tests/abis/testnet/0xebaa2ad3eacc230f309cd933958cc52684df0a41ae7ac214d186b80f830867d2.json +0 -10060
- package/src/tests/types/testnet/0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5.ts +0 -288
- package/src/tests/types/testnet/0x6c4a21e3e7e6b6d51c4604021633e1d97e24e37a696f8c082cd48f37503e602a.ts +0 -2468
- package/src/tests/types/testnet/0x7f7a37c826c88bcfe9aecc042453395ddfa9df6f29cb7c97590bf86cf2b0a75e.ts +0 -1371
- package/src/tests/types/testnet/0xebaa2ad3eacc230f309cd933958cc52684df0a41ae7ac214d186b80f830867d2.ts +0 -9495
- package/src/tests/types/testnet/index.ts +0 -7
- package/src/to-internal.ts +0 -127
- package/src/transaction.ts +0 -127
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
/* Autogenerated file. Do not edit manually. */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
|
|
5
|
-
/* Generated types for 0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5, original address 0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5 */
|
|
6
|
-
|
|
7
|
-
import { TypeDescriptor, ANY_TYPE } from "@typemove/move";
|
|
8
|
-
import { MoveCoder, TypedEventInstance } from "@typemove/iota";
|
|
9
|
-
|
|
10
|
-
import { defaultMoveCoder } from "@typemove/iota";
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
ZERO_ADDRESS,
|
|
14
|
-
TypedDevInspectResults,
|
|
15
|
-
getMoveCoder,
|
|
16
|
-
} from "@typemove/iota";
|
|
17
|
-
import {
|
|
18
|
-
Transaction,
|
|
19
|
-
TransactionArgument,
|
|
20
|
-
TransactionObjectArgument,
|
|
21
|
-
} from "@iota/iota-sdk/transactions";
|
|
22
|
-
import { IotaClient } from "@iota/iota-sdk/client";
|
|
23
|
-
import {
|
|
24
|
-
transactionArgumentOrObject,
|
|
25
|
-
transactionArgumentOrVec,
|
|
26
|
-
transactionArgumentOrPure,
|
|
27
|
-
transactionArgumentOrPureU8,
|
|
28
|
-
transactionArgumentOrPureU16,
|
|
29
|
-
transactionArgumentOrPureU32,
|
|
30
|
-
transactionArgumentOrPureU64,
|
|
31
|
-
transactionArgumentOrPureU128,
|
|
32
|
-
transactionArgumentOrPureU256,
|
|
33
|
-
transactionArgumentOrPureBool,
|
|
34
|
-
transactionArgumentOrPureString,
|
|
35
|
-
transactionArgumentOrPureAddress,
|
|
36
|
-
} from "@typemove/iota";
|
|
37
|
-
|
|
38
|
-
import * as _0x2 from "@typemove/iota/builtin/0x2";
|
|
39
|
-
import * as _0x1 from "@typemove/iota/builtin/0x1";
|
|
40
|
-
|
|
41
|
-
export namespace oracle {
|
|
42
|
-
export interface Key<T0> {
|
|
43
|
-
id: _0x2.object$.UID;
|
|
44
|
-
for: _0x2.object$.ID;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export namespace Key {
|
|
48
|
-
export const TYPE_QNAME =
|
|
49
|
-
"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5::oracle::Key";
|
|
50
|
-
|
|
51
|
-
const TYPE = new TypeDescriptor<Key<any>>(Key.TYPE_QNAME);
|
|
52
|
-
|
|
53
|
-
export function type<T0>(
|
|
54
|
-
arg0: TypeDescriptor<T0> = ANY_TYPE,
|
|
55
|
-
): TypeDescriptor<Key<T0>> {
|
|
56
|
-
return TYPE.apply(arg0);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface Oracle<T0> {
|
|
61
|
-
id: _0x2.object$.UID;
|
|
62
|
-
decimal: bigint;
|
|
63
|
-
price: bigint;
|
|
64
|
-
twap_price_1h: bigint;
|
|
65
|
-
ts_ms: bigint;
|
|
66
|
-
epoch: bigint;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export namespace Oracle {
|
|
70
|
-
export const TYPE_QNAME =
|
|
71
|
-
"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5::oracle::Oracle";
|
|
72
|
-
|
|
73
|
-
const TYPE = new TypeDescriptor<Oracle<any>>(Oracle.TYPE_QNAME);
|
|
74
|
-
|
|
75
|
-
export function type<T0>(
|
|
76
|
-
arg0: TypeDescriptor<T0> = ANY_TYPE,
|
|
77
|
-
): TypeDescriptor<Oracle<T0>> {
|
|
78
|
-
return TYPE.apply(arg0);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface PriceEvent {
|
|
83
|
-
token: _0x1.ascii.String;
|
|
84
|
-
price: bigint;
|
|
85
|
-
ts_ms: bigint;
|
|
86
|
-
epoch: bigint;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export namespace PriceEvent {
|
|
90
|
-
export const TYPE_QNAME =
|
|
91
|
-
"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5::oracle::PriceEvent";
|
|
92
|
-
|
|
93
|
-
const TYPE = new TypeDescriptor<PriceEvent>(PriceEvent.TYPE_QNAME);
|
|
94
|
-
|
|
95
|
-
export function type(): TypeDescriptor<PriceEvent> {
|
|
96
|
-
return TYPE.apply();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export type PriceEventInstance = TypedEventInstance<PriceEvent> & {
|
|
101
|
-
data_decoded: PriceEvent;
|
|
102
|
-
type_arguments: [];
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export namespace builder {
|
|
106
|
-
export function copyKey<T0 = any>(
|
|
107
|
-
tx: Transaction,
|
|
108
|
-
args: [string | TransactionObjectArgument, string | TransactionArgument],
|
|
109
|
-
typeArguments: [TypeDescriptor<T0> | string],
|
|
110
|
-
): TransactionArgument & [TransactionArgument, TransactionArgument] {
|
|
111
|
-
const _args: any[] = [];
|
|
112
|
-
_args.push(transactionArgumentOrObject(args[0], tx));
|
|
113
|
-
_args.push(transactionArgumentOrPureAddress(args[1], tx));
|
|
114
|
-
|
|
115
|
-
// @ts-ignore
|
|
116
|
-
return tx.moveCall({
|
|
117
|
-
target:
|
|
118
|
-
"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5::oracle::copy_key",
|
|
119
|
-
arguments: _args,
|
|
120
|
-
typeArguments: [
|
|
121
|
-
typeof typeArguments[0] === "string"
|
|
122
|
-
? typeArguments[0]
|
|
123
|
-
: typeArguments[0].getSignature(),
|
|
124
|
-
],
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
export function getOracle<T0 = any>(
|
|
128
|
-
tx: Transaction,
|
|
129
|
-
args: [string | TransactionObjectArgument],
|
|
130
|
-
typeArguments: [TypeDescriptor<T0> | string],
|
|
131
|
-
): TransactionArgument & [TransactionArgument] {
|
|
132
|
-
const _args: any[] = [];
|
|
133
|
-
_args.push(transactionArgumentOrObject(args[0], tx));
|
|
134
|
-
|
|
135
|
-
// @ts-ignore
|
|
136
|
-
return tx.moveCall({
|
|
137
|
-
target:
|
|
138
|
-
"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5::oracle::get_oracle",
|
|
139
|
-
arguments: _args,
|
|
140
|
-
typeArguments: [
|
|
141
|
-
typeof typeArguments[0] === "string"
|
|
142
|
-
? typeArguments[0]
|
|
143
|
-
: typeArguments[0].getSignature(),
|
|
144
|
-
],
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
export function newOracle<T0 = any>(
|
|
148
|
-
tx: Transaction,
|
|
149
|
-
args: [bigint | TransactionArgument],
|
|
150
|
-
typeArguments: [TypeDescriptor<T0> | string],
|
|
151
|
-
): TransactionArgument & [TransactionArgument] {
|
|
152
|
-
const _args: any[] = [];
|
|
153
|
-
_args.push(transactionArgumentOrPureU64(args[0], tx));
|
|
154
|
-
|
|
155
|
-
// @ts-ignore
|
|
156
|
-
return tx.moveCall({
|
|
157
|
-
target:
|
|
158
|
-
"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5::oracle::new_oracle",
|
|
159
|
-
arguments: _args,
|
|
160
|
-
typeArguments: [
|
|
161
|
-
typeof typeArguments[0] === "string"
|
|
162
|
-
? typeArguments[0]
|
|
163
|
-
: typeArguments[0].getSignature(),
|
|
164
|
-
],
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
export function update<T0 = any>(
|
|
168
|
-
tx: Transaction,
|
|
169
|
-
args: [
|
|
170
|
-
string | TransactionObjectArgument,
|
|
171
|
-
string | TransactionObjectArgument,
|
|
172
|
-
bigint | TransactionArgument,
|
|
173
|
-
bigint | TransactionArgument,
|
|
174
|
-
bigint | TransactionArgument,
|
|
175
|
-
],
|
|
176
|
-
typeArguments: [TypeDescriptor<T0> | string],
|
|
177
|
-
): TransactionArgument &
|
|
178
|
-
[
|
|
179
|
-
TransactionArgument,
|
|
180
|
-
TransactionArgument,
|
|
181
|
-
TransactionArgument,
|
|
182
|
-
TransactionArgument,
|
|
183
|
-
TransactionArgument,
|
|
184
|
-
] {
|
|
185
|
-
const _args: any[] = [];
|
|
186
|
-
_args.push(transactionArgumentOrObject(args[0], tx));
|
|
187
|
-
_args.push(transactionArgumentOrObject(args[1], tx));
|
|
188
|
-
_args.push(transactionArgumentOrPureU64(args[2], tx));
|
|
189
|
-
_args.push(transactionArgumentOrPureU64(args[3], tx));
|
|
190
|
-
_args.push(transactionArgumentOrPureU64(args[4], tx));
|
|
191
|
-
|
|
192
|
-
// @ts-ignore
|
|
193
|
-
return tx.moveCall({
|
|
194
|
-
target:
|
|
195
|
-
"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5::oracle::update",
|
|
196
|
-
arguments: _args,
|
|
197
|
-
typeArguments: [
|
|
198
|
-
typeof typeArguments[0] === "string"
|
|
199
|
-
? typeArguments[0]
|
|
200
|
-
: typeArguments[0].getSignature(),
|
|
201
|
-
],
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
export namespace view {
|
|
206
|
-
export async function copyKey<T0 = any>(
|
|
207
|
-
client: IotaClient,
|
|
208
|
-
args: [string, string],
|
|
209
|
-
typeArguments: [TypeDescriptor<T0> | string],
|
|
210
|
-
): Promise<TypedDevInspectResults<[]>> {
|
|
211
|
-
const tx = new Transaction();
|
|
212
|
-
builder.copyKey(tx, args, typeArguments);
|
|
213
|
-
const inspectRes = await client.devInspectTransactionBlock({
|
|
214
|
-
transactionBlock: tx,
|
|
215
|
-
sender: ZERO_ADDRESS,
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
return (await getMoveCoder(client)).decodeDevInspectResult<[]>(
|
|
219
|
-
inspectRes,
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
export async function getOracle<T0 = any>(
|
|
223
|
-
client: IotaClient,
|
|
224
|
-
args: [string],
|
|
225
|
-
typeArguments: [TypeDescriptor<T0> | string],
|
|
226
|
-
): Promise<TypedDevInspectResults<[bigint, bigint, bigint, bigint]>> {
|
|
227
|
-
const tx = new Transaction();
|
|
228
|
-
builder.getOracle(tx, args, typeArguments);
|
|
229
|
-
const inspectRes = await client.devInspectTransactionBlock({
|
|
230
|
-
transactionBlock: tx,
|
|
231
|
-
sender: ZERO_ADDRESS,
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
return (await getMoveCoder(client)).decodeDevInspectResult<
|
|
235
|
-
[bigint, bigint, bigint, bigint]
|
|
236
|
-
>(inspectRes);
|
|
237
|
-
}
|
|
238
|
-
export async function newOracle<T0 = any>(
|
|
239
|
-
client: IotaClient,
|
|
240
|
-
args: [bigint],
|
|
241
|
-
typeArguments: [TypeDescriptor<T0> | string],
|
|
242
|
-
): Promise<TypedDevInspectResults<[]>> {
|
|
243
|
-
const tx = new Transaction();
|
|
244
|
-
builder.newOracle(tx, args, typeArguments);
|
|
245
|
-
const inspectRes = await client.devInspectTransactionBlock({
|
|
246
|
-
transactionBlock: tx,
|
|
247
|
-
sender: ZERO_ADDRESS,
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
return (await getMoveCoder(client)).decodeDevInspectResult<[]>(
|
|
251
|
-
inspectRes,
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
export async function update<T0 = any>(
|
|
255
|
-
client: IotaClient,
|
|
256
|
-
args: [string, string, bigint, bigint, bigint],
|
|
257
|
-
typeArguments: [TypeDescriptor<T0> | string],
|
|
258
|
-
): Promise<TypedDevInspectResults<[]>> {
|
|
259
|
-
const tx = new Transaction();
|
|
260
|
-
builder.update(tx, args, typeArguments);
|
|
261
|
-
const inspectRes = await client.devInspectTransactionBlock({
|
|
262
|
-
transactionBlock: tx,
|
|
263
|
-
sender: ZERO_ADDRESS,
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
return (await getMoveCoder(client)).decodeDevInspectResult<[]>(
|
|
267
|
-
inspectRes,
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
const MODULES = JSON.parse(
|
|
274
|
-
'[{"fileFormatVersion":6,"address":"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5","name":"oracle","friends":[],"structs":{"Key":{"abilities":{"abilities":["Key"]},"typeParameters":[{"constraints":{"abilities":[]},"isPhantom":true}],"fields":[{"name":"id","type":{"Struct":{"address":"0x2","module":"object","name":"UID","typeArguments":[]}}},{"name":"for","type":{"Struct":{"address":"0x2","module":"object","name":"ID","typeArguments":[]}}}]},"Oracle":{"abilities":{"abilities":["Key"]},"typeParameters":[{"constraints":{"abilities":[]},"isPhantom":true}],"fields":[{"name":"id","type":{"Struct":{"address":"0x2","module":"object","name":"UID","typeArguments":[]}}},{"name":"decimal","type":"U64"},{"name":"price","type":"U64"},{"name":"twap_price_1h","type":"U64"},{"name":"ts_ms","type":"U64"},{"name":"epoch","type":"U64"}]},"PriceEvent":{"abilities":{"abilities":["Copy","Drop"]},"typeParameters":[],"fields":[{"name":"token","type":{"Struct":{"address":"0x1","module":"ascii","name":"String","typeArguments":[]}}},{"name":"price","type":"U64"},{"name":"ts_ms","type":"U64"},{"name":"epoch","type":"U64"}]}},"exposedFunctions":{"copy_key":{"visibility":"Public","isEntry":true,"typeParameters":[{"abilities":[]}],"parameters":[{"Reference":{"Struct":{"address":"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5","module":"oracle","name":"Key","typeArguments":[{"TypeParameter":0}]}}},"Address",{"MutableReference":{"Struct":{"address":"0x2","module":"tx_context","name":"TxContext","typeArguments":[]}}}],"return":[]},"get_oracle":{"visibility":"Public","isEntry":false,"typeParameters":[{"abilities":[]}],"parameters":[{"Reference":{"Struct":{"address":"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5","module":"oracle","name":"Oracle","typeArguments":[{"TypeParameter":0}]}}}],"return":["U64","U64","U64","U64"]},"new_oracle":{"visibility":"Public","isEntry":true,"typeParameters":[{"abilities":[]}],"parameters":["U64",{"MutableReference":{"Struct":{"address":"0x2","module":"tx_context","name":"TxContext","typeArguments":[]}}}],"return":[]},"update":{"visibility":"Public","isEntry":true,"typeParameters":[{"abilities":[]}],"parameters":[{"MutableReference":{"Struct":{"address":"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5","module":"oracle","name":"Oracle","typeArguments":[{"TypeParameter":0}]}}},{"Reference":{"Struct":{"address":"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5","module":"oracle","name":"Key","typeArguments":[{"TypeParameter":0}]}}},"U64","U64","U64",{"MutableReference":{"Struct":{"address":"0x2","module":"tx_context","name":"TxContext","typeArguments":[]}}}],"return":[]}}}]',
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
export function loadAllTypes(coder: MoveCoder) {
|
|
278
|
-
_0x2.loadAllTypes(coder);
|
|
279
|
-
_0x1.loadAllTypes(coder);
|
|
280
|
-
for (const m of Object.values(MODULES)) {
|
|
281
|
-
coder.load(
|
|
282
|
-
m as any,
|
|
283
|
-
"0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5",
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
loadAllTypes(defaultMoveCoder());
|