@bitgo/sdk-coin-sui 2.0.0 → 3.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/.eslintignore +1 -0
- package/CHANGELOG.md +37 -0
- package/dist/src/lib/constants.d.ts +3 -15
- package/dist/src/lib/constants.d.ts.map +1 -1
- package/dist/src/lib/constants.js +7 -20
- package/dist/src/lib/iface.d.ts +35 -181
- package/dist/src/lib/iface.d.ts.map +1 -1
- package/dist/src/lib/iface.js +11 -38
- package/dist/src/lib/index.d.ts +2 -0
- package/dist/src/lib/index.d.ts.map +1 -1
- package/dist/src/lib/index.js +6 -2
- package/dist/src/lib/keyPair.d.ts +4 -0
- package/dist/src/lib/keyPair.d.ts.map +1 -1
- package/dist/src/lib/keyPair.js +7 -10
- package/dist/src/lib/mystenlab/builder/Inputs.d.ts +66 -0
- package/dist/src/lib/mystenlab/builder/Inputs.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/builder/Inputs.js +56 -0
- package/dist/src/lib/mystenlab/builder/TransactionBlock.d.ts +616 -0
- package/dist/src/lib/mystenlab/builder/TransactionBlock.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/builder/TransactionBlock.js +260 -0
- package/dist/src/lib/mystenlab/builder/TransactionDataBlock.d.ts +566 -0
- package/dist/src/lib/mystenlab/builder/TransactionDataBlock.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/builder/TransactionDataBlock.js +171 -0
- package/dist/src/lib/mystenlab/builder/Transactions.d.ts +992 -0
- package/dist/src/lib/mystenlab/builder/Transactions.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/builder/Transactions.js +119 -0
- package/dist/src/lib/mystenlab/builder/bcs.d.ts +25 -0
- package/dist/src/lib/mystenlab/builder/bcs.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/builder/bcs.js +141 -0
- package/dist/src/lib/mystenlab/builder/index.d.ts +5 -0
- package/dist/src/lib/mystenlab/builder/index.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/builder/index.js +17 -0
- package/dist/src/lib/mystenlab/builder/serializer.d.ts +4 -0
- package/dist/src/lib/mystenlab/builder/serializer.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/builder/serializer.js +101 -0
- package/dist/src/lib/mystenlab/builder/utils.d.ts +10 -0
- package/dist/src/lib/mystenlab/builder/utils.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/builder/utils.js +10 -0
- package/dist/src/lib/mystenlab/cryptography/hash.d.ts +8 -0
- package/dist/src/lib/mystenlab/cryptography/hash.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/cryptography/hash.js +22 -0
- package/dist/src/lib/mystenlab/framework/framework.d.ts +93 -0
- package/dist/src/lib/mystenlab/framework/framework.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/framework/framework.js +138 -0
- package/dist/src/lib/mystenlab/framework/index.d.ts +3 -0
- package/dist/src/lib/mystenlab/framework/index.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/framework/index.js +15 -0
- package/dist/src/lib/mystenlab/framework/sui-system-state.d.ts +12 -0
- package/dist/src/lib/mystenlab/framework/sui-system-state.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/framework/sui-system-state.js +19 -0
- package/dist/src/lib/mystenlab/txn-data-serializers/type-tag-serializer.d.ts +7 -0
- package/dist/src/lib/mystenlab/txn-data-serializers/type-tag-serializer.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/txn-data-serializers/type-tag-serializer.js +119 -0
- package/dist/src/lib/mystenlab/types/coin.d.ts +89 -0
- package/dist/src/lib/mystenlab/types/coin.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/coin.js +32 -0
- package/dist/src/lib/mystenlab/types/common.d.ts +45 -0
- package/dist/src/lib/mystenlab/types/common.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/common.js +84 -0
- package/dist/src/lib/mystenlab/types/events.d.ts +198 -0
- package/dist/src/lib/mystenlab/types/events.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/events.js +46 -0
- package/dist/src/lib/mystenlab/types/index.d.ts +9 -0
- package/dist/src/lib/mystenlab/types/index.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/index.js +21 -0
- package/dist/src/lib/mystenlab/types/normalized.d.ts +254 -0
- package/dist/src/lib/mystenlab/types/normalized.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/normalized.js +111 -0
- package/dist/src/lib/mystenlab/types/objects.d.ts +806 -0
- package/dist/src/lib/mystenlab/types/objects.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/objects.js +302 -0
- package/dist/src/lib/mystenlab/types/option.d.ts +8 -0
- package/dist/src/lib/mystenlab/types/option.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/option.js +14 -0
- package/dist/src/lib/mystenlab/types/sui-bcs.d.ts +111 -0
- package/dist/src/lib/mystenlab/types/sui-bcs.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/sui-bcs.js +107 -0
- package/dist/src/lib/mystenlab/types/transactions.d.ts +6703 -0
- package/dist/src/lib/mystenlab/types/transactions.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/transactions.js +405 -0
- package/dist/src/lib/mystenlab/types/validator.d.ts +641 -0
- package/dist/src/lib/mystenlab/types/validator.d.ts.map +1 -0
- package/dist/src/lib/mystenlab/types/validator.js +156 -0
- package/dist/src/lib/stakingBuilder.d.ts +24 -35
- package/dist/src/lib/stakingBuilder.d.ts.map +1 -1
- package/dist/src/lib/stakingBuilder.js +93 -129
- package/dist/src/lib/stakingTransaction.d.ts +5 -21
- package/dist/src/lib/stakingTransaction.d.ts.map +1 -1
- package/dist/src/lib/stakingTransaction.js +77 -219
- package/dist/src/lib/transaction.d.ts +8 -6
- package/dist/src/lib/transaction.d.ts.map +1 -1
- package/dist/src/lib/transaction.js +74 -124
- package/dist/src/lib/transactionBuilder.d.ts +9 -9
- package/dist/src/lib/transactionBuilder.d.ts.map +1 -1
- package/dist/src/lib/transactionBuilder.js +27 -16
- package/dist/src/lib/transactionBuilderFactory.d.ts +8 -5
- package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/lib/transactionBuilderFactory.js +17 -11
- package/dist/src/lib/transferBuilder.d.ts +15 -10
- package/dist/src/lib/transferBuilder.d.ts.map +1 -1
- package/dist/src/lib/transferBuilder.js +38 -101
- package/dist/src/lib/transferTransaction.d.ts +5 -4
- package/dist/src/lib/transferTransaction.d.ts.map +1 -1
- package/dist/src/lib/transferTransaction.js +45 -96
- package/dist/src/lib/unstakingBuilder.d.ts +55 -0
- package/dist/src/lib/unstakingBuilder.d.ts.map +1 -0
- package/dist/src/lib/unstakingBuilder.js +148 -0
- package/dist/src/lib/unstakingTransaction.d.ts +51 -0
- package/dist/src/lib/unstakingTransaction.d.ts.map +1 -0
- package/dist/src/lib/unstakingTransaction.js +206 -0
- package/dist/src/lib/utils.d.ts +30 -92
- package/dist/src/lib/utils.d.ts.map +1 -1
- package/dist/src/lib/utils.js +115 -177
- package/dist/src/sui.d.ts.map +1 -1
- package/dist/src/sui.js +23 -13
- package/package.json +9 -9
- package/dist/src/lib/bcs.d.ts +0 -3
- package/dist/src/lib/bcs.d.ts.map +0 -1
- package/dist/src/lib/bcs.js +0 -109
- package/dist/src/lib/txnSchema.d.ts +0 -7
- package/dist/src/lib/txnSchema.d.ts.map +0 -1
- package/dist/src/lib/txnSchema.js +0 -81
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
import { ObjectId, SuiObjectRef } from '../types';
|
|
2
|
+
import { Transactions, TransactionArgument, TransactionType } from './Transactions';
|
|
3
|
+
import { ObjectCallArg } from './Inputs';
|
|
4
|
+
import { TransactionExpiration } from './TransactionDataBlock';
|
|
5
|
+
declare type TransactionResult = TransactionArgument & TransactionArgument[];
|
|
6
|
+
declare const TRANSACTION_BRAND: unique symbol;
|
|
7
|
+
interface BuildOptions {
|
|
8
|
+
onlyTransactionKind?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Transaction Builder
|
|
12
|
+
*/
|
|
13
|
+
export declare class TransactionBlock {
|
|
14
|
+
#private;
|
|
15
|
+
/** Returns `true` if the object is an instance of the Transaction builder class. */
|
|
16
|
+
static is(obj: unknown): obj is TransactionBlock;
|
|
17
|
+
/**
|
|
18
|
+
* Converts from a serialize transaction kind (built with `build({ onlyTransactionKind: true })`) to a `Transaction` class.
|
|
19
|
+
* Supports either a byte array, or base64-encoded bytes.
|
|
20
|
+
*/
|
|
21
|
+
static fromKind(serialized: string | Uint8Array): TransactionBlock;
|
|
22
|
+
/**
|
|
23
|
+
* Converts from a serialized transaction format to a `Transaction` class.
|
|
24
|
+
* There are two supported serialized formats:
|
|
25
|
+
* - A string returned from `Transaction#serialize`. The serialized format must be compatible, or it will throw an error.
|
|
26
|
+
* - A byte array (or base64-encoded bytes) containing BCS transaction data.
|
|
27
|
+
*/
|
|
28
|
+
static from(serialized: string | Uint8Array): TransactionBlock;
|
|
29
|
+
/** A helper to retrieve the Transaction builder `Transactions` */
|
|
30
|
+
static get Transactions(): {
|
|
31
|
+
MoveCall(input: Omit<{
|
|
32
|
+
arguments: ({
|
|
33
|
+
kind: "Input";
|
|
34
|
+
index: number;
|
|
35
|
+
type?: "object" | "pure" | undefined;
|
|
36
|
+
value?: any;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "GasCoin";
|
|
39
|
+
} | {
|
|
40
|
+
kind: "Result";
|
|
41
|
+
index: number;
|
|
42
|
+
} | {
|
|
43
|
+
kind: "NestedResult";
|
|
44
|
+
index: number;
|
|
45
|
+
resultIndex: number;
|
|
46
|
+
})[];
|
|
47
|
+
kind: "MoveCall";
|
|
48
|
+
target: `${string}::${string}::${string}`;
|
|
49
|
+
typeArguments: string[];
|
|
50
|
+
}, "arguments" | "kind" | "typeArguments"> & {
|
|
51
|
+
arguments?: ({
|
|
52
|
+
kind: "Input";
|
|
53
|
+
index: number;
|
|
54
|
+
type?: "object" | "pure" | undefined;
|
|
55
|
+
value?: any;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "GasCoin";
|
|
58
|
+
} | {
|
|
59
|
+
kind: "Result";
|
|
60
|
+
index: number;
|
|
61
|
+
} | {
|
|
62
|
+
kind: "NestedResult";
|
|
63
|
+
index: number;
|
|
64
|
+
resultIndex: number;
|
|
65
|
+
})[] | undefined;
|
|
66
|
+
typeArguments?: string[] | undefined;
|
|
67
|
+
}): {
|
|
68
|
+
arguments: ({
|
|
69
|
+
kind: "Input";
|
|
70
|
+
index: number;
|
|
71
|
+
type?: "object" | "pure" | undefined;
|
|
72
|
+
value?: any;
|
|
73
|
+
} | {
|
|
74
|
+
kind: "GasCoin";
|
|
75
|
+
} | {
|
|
76
|
+
kind: "Result";
|
|
77
|
+
index: number;
|
|
78
|
+
} | {
|
|
79
|
+
kind: "NestedResult";
|
|
80
|
+
index: number;
|
|
81
|
+
resultIndex: number;
|
|
82
|
+
})[];
|
|
83
|
+
kind: "MoveCall";
|
|
84
|
+
target: `${string}::${string}::${string}`;
|
|
85
|
+
typeArguments: string[];
|
|
86
|
+
};
|
|
87
|
+
TransferObjects(objects: ({
|
|
88
|
+
kind: "Input";
|
|
89
|
+
index: number;
|
|
90
|
+
type?: "object" | "pure" | undefined;
|
|
91
|
+
value?: any;
|
|
92
|
+
} | {
|
|
93
|
+
kind: "GasCoin";
|
|
94
|
+
} | {
|
|
95
|
+
kind: "Result";
|
|
96
|
+
index: number;
|
|
97
|
+
} | {
|
|
98
|
+
kind: "NestedResult";
|
|
99
|
+
index: number;
|
|
100
|
+
resultIndex: number;
|
|
101
|
+
})[], address: {
|
|
102
|
+
kind: "Input";
|
|
103
|
+
index: number;
|
|
104
|
+
type?: "object" | "pure" | undefined;
|
|
105
|
+
value?: any;
|
|
106
|
+
} | {
|
|
107
|
+
kind: "GasCoin";
|
|
108
|
+
} | {
|
|
109
|
+
kind: "Result";
|
|
110
|
+
index: number;
|
|
111
|
+
} | {
|
|
112
|
+
kind: "NestedResult";
|
|
113
|
+
index: number;
|
|
114
|
+
resultIndex: number;
|
|
115
|
+
}): {
|
|
116
|
+
objects: ({
|
|
117
|
+
kind: "Input";
|
|
118
|
+
index: number;
|
|
119
|
+
type?: "object" | "pure" | undefined;
|
|
120
|
+
value?: any;
|
|
121
|
+
} | {
|
|
122
|
+
kind: "GasCoin";
|
|
123
|
+
} | {
|
|
124
|
+
kind: "Result";
|
|
125
|
+
index: number;
|
|
126
|
+
} | {
|
|
127
|
+
kind: "NestedResult";
|
|
128
|
+
index: number;
|
|
129
|
+
resultIndex: number;
|
|
130
|
+
})[];
|
|
131
|
+
kind: "TransferObjects";
|
|
132
|
+
address: {
|
|
133
|
+
kind: "Input";
|
|
134
|
+
index: number;
|
|
135
|
+
type?: "object" | "pure" | undefined;
|
|
136
|
+
value?: any;
|
|
137
|
+
} | {
|
|
138
|
+
kind: "GasCoin";
|
|
139
|
+
} | {
|
|
140
|
+
kind: "Result";
|
|
141
|
+
index: number;
|
|
142
|
+
} | {
|
|
143
|
+
kind: "NestedResult";
|
|
144
|
+
index: number;
|
|
145
|
+
resultIndex: number;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
SplitCoins(coin: {
|
|
149
|
+
kind: "Input";
|
|
150
|
+
index: number;
|
|
151
|
+
type?: "object" | "pure" | undefined;
|
|
152
|
+
value?: any;
|
|
153
|
+
} | {
|
|
154
|
+
kind: "GasCoin";
|
|
155
|
+
} | {
|
|
156
|
+
kind: "Result";
|
|
157
|
+
index: number;
|
|
158
|
+
} | {
|
|
159
|
+
kind: "NestedResult";
|
|
160
|
+
index: number;
|
|
161
|
+
resultIndex: number;
|
|
162
|
+
}, amounts: ({
|
|
163
|
+
kind: "Input";
|
|
164
|
+
index: number;
|
|
165
|
+
type?: "object" | "pure" | undefined;
|
|
166
|
+
value?: any;
|
|
167
|
+
} | {
|
|
168
|
+
kind: "GasCoin";
|
|
169
|
+
} | {
|
|
170
|
+
kind: "Result";
|
|
171
|
+
index: number;
|
|
172
|
+
} | {
|
|
173
|
+
kind: "NestedResult";
|
|
174
|
+
index: number;
|
|
175
|
+
resultIndex: number;
|
|
176
|
+
})[]): {
|
|
177
|
+
kind: "SplitCoins";
|
|
178
|
+
coin: {
|
|
179
|
+
kind: "Input";
|
|
180
|
+
index: number;
|
|
181
|
+
type?: "object" | "pure" | undefined;
|
|
182
|
+
value?: any;
|
|
183
|
+
} | {
|
|
184
|
+
kind: "GasCoin";
|
|
185
|
+
} | {
|
|
186
|
+
kind: "Result";
|
|
187
|
+
index: number;
|
|
188
|
+
} | {
|
|
189
|
+
kind: "NestedResult";
|
|
190
|
+
index: number;
|
|
191
|
+
resultIndex: number;
|
|
192
|
+
};
|
|
193
|
+
amounts: ({
|
|
194
|
+
kind: "Input";
|
|
195
|
+
index: number;
|
|
196
|
+
type?: "object" | "pure" | undefined;
|
|
197
|
+
value?: any;
|
|
198
|
+
} | {
|
|
199
|
+
kind: "GasCoin";
|
|
200
|
+
} | {
|
|
201
|
+
kind: "Result";
|
|
202
|
+
index: number;
|
|
203
|
+
} | {
|
|
204
|
+
kind: "NestedResult";
|
|
205
|
+
index: number;
|
|
206
|
+
resultIndex: number;
|
|
207
|
+
})[];
|
|
208
|
+
};
|
|
209
|
+
MergeCoins(destination: {
|
|
210
|
+
kind: "Input";
|
|
211
|
+
index: number;
|
|
212
|
+
type?: "object" | "pure" | undefined;
|
|
213
|
+
value?: any;
|
|
214
|
+
} | {
|
|
215
|
+
kind: "GasCoin";
|
|
216
|
+
} | {
|
|
217
|
+
kind: "Result";
|
|
218
|
+
index: number;
|
|
219
|
+
} | {
|
|
220
|
+
kind: "NestedResult";
|
|
221
|
+
index: number;
|
|
222
|
+
resultIndex: number;
|
|
223
|
+
}, sources: ({
|
|
224
|
+
kind: "Input";
|
|
225
|
+
index: number;
|
|
226
|
+
type?: "object" | "pure" | undefined;
|
|
227
|
+
value?: any;
|
|
228
|
+
} | {
|
|
229
|
+
kind: "GasCoin";
|
|
230
|
+
} | {
|
|
231
|
+
kind: "Result";
|
|
232
|
+
index: number;
|
|
233
|
+
} | {
|
|
234
|
+
kind: "NestedResult";
|
|
235
|
+
index: number;
|
|
236
|
+
resultIndex: number;
|
|
237
|
+
})[]): {
|
|
238
|
+
kind: "MergeCoins";
|
|
239
|
+
destination: {
|
|
240
|
+
kind: "Input";
|
|
241
|
+
index: number;
|
|
242
|
+
type?: "object" | "pure" | undefined;
|
|
243
|
+
value?: any;
|
|
244
|
+
} | {
|
|
245
|
+
kind: "GasCoin";
|
|
246
|
+
} | {
|
|
247
|
+
kind: "Result";
|
|
248
|
+
index: number;
|
|
249
|
+
} | {
|
|
250
|
+
kind: "NestedResult";
|
|
251
|
+
index: number;
|
|
252
|
+
resultIndex: number;
|
|
253
|
+
};
|
|
254
|
+
sources: ({
|
|
255
|
+
kind: "Input";
|
|
256
|
+
index: number;
|
|
257
|
+
type?: "object" | "pure" | undefined;
|
|
258
|
+
value?: any;
|
|
259
|
+
} | {
|
|
260
|
+
kind: "GasCoin";
|
|
261
|
+
} | {
|
|
262
|
+
kind: "Result";
|
|
263
|
+
index: number;
|
|
264
|
+
} | {
|
|
265
|
+
kind: "NestedResult";
|
|
266
|
+
index: number;
|
|
267
|
+
resultIndex: number;
|
|
268
|
+
})[];
|
|
269
|
+
};
|
|
270
|
+
Publish(modules: number[][], dependencies: string[]): {
|
|
271
|
+
kind: "Publish";
|
|
272
|
+
dependencies: string[];
|
|
273
|
+
modules: number[][];
|
|
274
|
+
};
|
|
275
|
+
MakeMoveVec({ type, objects, }: Omit<{
|
|
276
|
+
objects: ({
|
|
277
|
+
kind: "Input";
|
|
278
|
+
index: number;
|
|
279
|
+
type?: "object" | "pure" | undefined;
|
|
280
|
+
value?: any;
|
|
281
|
+
} | {
|
|
282
|
+
kind: "GasCoin";
|
|
283
|
+
} | {
|
|
284
|
+
kind: "Result";
|
|
285
|
+
index: number;
|
|
286
|
+
} | {
|
|
287
|
+
kind: "NestedResult";
|
|
288
|
+
index: number;
|
|
289
|
+
resultIndex: number;
|
|
290
|
+
})[];
|
|
291
|
+
kind: "MakeMoveVec";
|
|
292
|
+
type?: {
|
|
293
|
+
None: null;
|
|
294
|
+
} | {
|
|
295
|
+
Some: string;
|
|
296
|
+
} | undefined;
|
|
297
|
+
}, "type" | "kind"> & {
|
|
298
|
+
type?: string | undefined;
|
|
299
|
+
}): {
|
|
300
|
+
objects: ({
|
|
301
|
+
kind: "Input";
|
|
302
|
+
index: number;
|
|
303
|
+
type?: "object" | "pure" | undefined;
|
|
304
|
+
value?: any;
|
|
305
|
+
} | {
|
|
306
|
+
kind: "GasCoin";
|
|
307
|
+
} | {
|
|
308
|
+
kind: "Result";
|
|
309
|
+
index: number;
|
|
310
|
+
} | {
|
|
311
|
+
kind: "NestedResult";
|
|
312
|
+
index: number;
|
|
313
|
+
resultIndex: number;
|
|
314
|
+
})[];
|
|
315
|
+
kind: "MakeMoveVec";
|
|
316
|
+
type?: {
|
|
317
|
+
None: null;
|
|
318
|
+
} | {
|
|
319
|
+
Some: string;
|
|
320
|
+
} | undefined;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
/** A helper to retrieve the Transaction builder `Inputs` */
|
|
324
|
+
static get Inputs(): {
|
|
325
|
+
Pure(data: unknown, type?: string | undefined): {
|
|
326
|
+
Pure: number[];
|
|
327
|
+
};
|
|
328
|
+
ObjectRef(ref: {
|
|
329
|
+
objectId: string;
|
|
330
|
+
version: string | number;
|
|
331
|
+
digest: string;
|
|
332
|
+
}): {
|
|
333
|
+
Object: {
|
|
334
|
+
ImmOrOwned: {
|
|
335
|
+
objectId: string;
|
|
336
|
+
version: string | number;
|
|
337
|
+
digest: string;
|
|
338
|
+
};
|
|
339
|
+
} | {
|
|
340
|
+
Shared: {
|
|
341
|
+
objectId: string;
|
|
342
|
+
initialSharedVersion: string | number;
|
|
343
|
+
mutable: boolean;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
SharedObjectRef(ref: import("../types").SharedObjectRef): {
|
|
348
|
+
Object: {
|
|
349
|
+
ImmOrOwned: {
|
|
350
|
+
objectId: string;
|
|
351
|
+
version: string | number;
|
|
352
|
+
digest: string;
|
|
353
|
+
};
|
|
354
|
+
} | {
|
|
355
|
+
Shared: {
|
|
356
|
+
objectId: string;
|
|
357
|
+
initialSharedVersion: string | number;
|
|
358
|
+
mutable: boolean;
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
setSender(sender: string): void;
|
|
364
|
+
/**
|
|
365
|
+
* Sets the sender only if it has not already been set.
|
|
366
|
+
* This is useful for sponsored transaction flows where the sender may not be the same as the signer address.
|
|
367
|
+
*/
|
|
368
|
+
setSenderIfNotSet(sender: string): void;
|
|
369
|
+
setExpiration(expiration?: TransactionExpiration): void;
|
|
370
|
+
setGasPrice(price: number | bigint): void;
|
|
371
|
+
setGasBudget(budget: number | bigint): void;
|
|
372
|
+
setGasOwner(owner: string): void;
|
|
373
|
+
setGasPayment(payments: SuiObjectRef[]): void;
|
|
374
|
+
/** Get a snapshot of the transaction data, in JSON form: */
|
|
375
|
+
get blockData(): {
|
|
376
|
+
version: 1;
|
|
377
|
+
transactions: ({
|
|
378
|
+
arguments: ({
|
|
379
|
+
kind: "Input";
|
|
380
|
+
index: number;
|
|
381
|
+
type?: "object" | "pure" | undefined;
|
|
382
|
+
value?: any;
|
|
383
|
+
} | {
|
|
384
|
+
kind: "GasCoin";
|
|
385
|
+
} | {
|
|
386
|
+
kind: "Result";
|
|
387
|
+
index: number;
|
|
388
|
+
} | {
|
|
389
|
+
kind: "NestedResult";
|
|
390
|
+
index: number;
|
|
391
|
+
resultIndex: number;
|
|
392
|
+
})[];
|
|
393
|
+
kind: "MoveCall";
|
|
394
|
+
target: `${string}::${string}::${string}`;
|
|
395
|
+
typeArguments: string[];
|
|
396
|
+
} | {
|
|
397
|
+
objects: ({
|
|
398
|
+
kind: "Input";
|
|
399
|
+
index: number;
|
|
400
|
+
type?: "object" | "pure" | undefined;
|
|
401
|
+
value?: any;
|
|
402
|
+
} | {
|
|
403
|
+
kind: "GasCoin";
|
|
404
|
+
} | {
|
|
405
|
+
kind: "Result";
|
|
406
|
+
index: number;
|
|
407
|
+
} | {
|
|
408
|
+
kind: "NestedResult";
|
|
409
|
+
index: number;
|
|
410
|
+
resultIndex: number;
|
|
411
|
+
})[];
|
|
412
|
+
kind: "TransferObjects";
|
|
413
|
+
address: {
|
|
414
|
+
kind: "Input";
|
|
415
|
+
index: number;
|
|
416
|
+
type?: "object" | "pure" | undefined;
|
|
417
|
+
value?: any;
|
|
418
|
+
} | {
|
|
419
|
+
kind: "GasCoin";
|
|
420
|
+
} | {
|
|
421
|
+
kind: "Result";
|
|
422
|
+
index: number;
|
|
423
|
+
} | {
|
|
424
|
+
kind: "NestedResult";
|
|
425
|
+
index: number;
|
|
426
|
+
resultIndex: number;
|
|
427
|
+
};
|
|
428
|
+
} | {
|
|
429
|
+
kind: "SplitCoins";
|
|
430
|
+
coin: {
|
|
431
|
+
kind: "Input";
|
|
432
|
+
index: number;
|
|
433
|
+
type?: "object" | "pure" | undefined;
|
|
434
|
+
value?: any;
|
|
435
|
+
} | {
|
|
436
|
+
kind: "GasCoin";
|
|
437
|
+
} | {
|
|
438
|
+
kind: "Result";
|
|
439
|
+
index: number;
|
|
440
|
+
} | {
|
|
441
|
+
kind: "NestedResult";
|
|
442
|
+
index: number;
|
|
443
|
+
resultIndex: number;
|
|
444
|
+
};
|
|
445
|
+
amounts: ({
|
|
446
|
+
kind: "Input";
|
|
447
|
+
index: number;
|
|
448
|
+
type?: "object" | "pure" | undefined;
|
|
449
|
+
value?: any;
|
|
450
|
+
} | {
|
|
451
|
+
kind: "GasCoin";
|
|
452
|
+
} | {
|
|
453
|
+
kind: "Result";
|
|
454
|
+
index: number;
|
|
455
|
+
} | {
|
|
456
|
+
kind: "NestedResult";
|
|
457
|
+
index: number;
|
|
458
|
+
resultIndex: number;
|
|
459
|
+
})[];
|
|
460
|
+
} | {
|
|
461
|
+
kind: "MergeCoins";
|
|
462
|
+
destination: {
|
|
463
|
+
kind: "Input";
|
|
464
|
+
index: number;
|
|
465
|
+
type?: "object" | "pure" | undefined;
|
|
466
|
+
value?: any;
|
|
467
|
+
} | {
|
|
468
|
+
kind: "GasCoin";
|
|
469
|
+
} | {
|
|
470
|
+
kind: "Result";
|
|
471
|
+
index: number;
|
|
472
|
+
} | {
|
|
473
|
+
kind: "NestedResult";
|
|
474
|
+
index: number;
|
|
475
|
+
resultIndex: number;
|
|
476
|
+
};
|
|
477
|
+
sources: ({
|
|
478
|
+
kind: "Input";
|
|
479
|
+
index: number;
|
|
480
|
+
type?: "object" | "pure" | undefined;
|
|
481
|
+
value?: any;
|
|
482
|
+
} | {
|
|
483
|
+
kind: "GasCoin";
|
|
484
|
+
} | {
|
|
485
|
+
kind: "Result";
|
|
486
|
+
index: number;
|
|
487
|
+
} | {
|
|
488
|
+
kind: "NestedResult";
|
|
489
|
+
index: number;
|
|
490
|
+
resultIndex: number;
|
|
491
|
+
})[];
|
|
492
|
+
} | {
|
|
493
|
+
objects: ({
|
|
494
|
+
kind: "Input";
|
|
495
|
+
index: number;
|
|
496
|
+
type?: "object" | "pure" | undefined;
|
|
497
|
+
value?: any;
|
|
498
|
+
} | {
|
|
499
|
+
kind: "GasCoin";
|
|
500
|
+
} | {
|
|
501
|
+
kind: "Result";
|
|
502
|
+
index: number;
|
|
503
|
+
} | {
|
|
504
|
+
kind: "NestedResult";
|
|
505
|
+
index: number;
|
|
506
|
+
resultIndex: number;
|
|
507
|
+
})[];
|
|
508
|
+
kind: "MakeMoveVec";
|
|
509
|
+
type?: {
|
|
510
|
+
None: null;
|
|
511
|
+
} | {
|
|
512
|
+
Some: string;
|
|
513
|
+
} | undefined;
|
|
514
|
+
} | {
|
|
515
|
+
kind: "Publish";
|
|
516
|
+
dependencies: string[];
|
|
517
|
+
modules: number[][];
|
|
518
|
+
})[];
|
|
519
|
+
inputs: {
|
|
520
|
+
kind: "Input";
|
|
521
|
+
index: number;
|
|
522
|
+
type?: "object" | "pure" | undefined;
|
|
523
|
+
value?: any;
|
|
524
|
+
}[];
|
|
525
|
+
gasConfig: {
|
|
526
|
+
payment?: {
|
|
527
|
+
objectId: string;
|
|
528
|
+
version: string | number;
|
|
529
|
+
digest: string;
|
|
530
|
+
}[] | undefined;
|
|
531
|
+
owner?: string | undefined;
|
|
532
|
+
price?: string | undefined;
|
|
533
|
+
budget?: string | undefined;
|
|
534
|
+
};
|
|
535
|
+
sender?: string | undefined;
|
|
536
|
+
expiration?: {
|
|
537
|
+
Epoch: number;
|
|
538
|
+
} | {
|
|
539
|
+
None: true | null;
|
|
540
|
+
} | null | undefined;
|
|
541
|
+
};
|
|
542
|
+
get [TRANSACTION_BRAND](): boolean;
|
|
543
|
+
constructor(transaction?: TransactionBlock);
|
|
544
|
+
/** Returns an argument for the gas coin, to be used in a transaction. */
|
|
545
|
+
get gas(): TransactionArgument;
|
|
546
|
+
/**
|
|
547
|
+
* Dynamically create a new input, which is separate from the `input`. This is important
|
|
548
|
+
* for generated clients to be able to define unique inputs that are non-overlapping with the
|
|
549
|
+
* defined inputs.
|
|
550
|
+
*
|
|
551
|
+
* For `Uint8Array` type automatically convert the input into a `Pure` CallArg, since this
|
|
552
|
+
* is the format required for custom serialization.
|
|
553
|
+
*
|
|
554
|
+
*/
|
|
555
|
+
input(type: 'object' | 'pure', value?: unknown): {
|
|
556
|
+
kind: "Input";
|
|
557
|
+
index: number;
|
|
558
|
+
type?: "object" | "pure" | undefined;
|
|
559
|
+
value?: any;
|
|
560
|
+
};
|
|
561
|
+
/**
|
|
562
|
+
* Add a new object input to the transaction.
|
|
563
|
+
*/
|
|
564
|
+
object(value: ObjectId | ObjectCallArg): {
|
|
565
|
+
kind: "Input";
|
|
566
|
+
index: number;
|
|
567
|
+
type?: "object" | "pure" | undefined;
|
|
568
|
+
value?: any;
|
|
569
|
+
};
|
|
570
|
+
/**
|
|
571
|
+
* Add a new non-object input to the transaction.
|
|
572
|
+
*/
|
|
573
|
+
pure(
|
|
574
|
+
/**
|
|
575
|
+
* The pure value that will be used as the input value. If this is a Uint8Array, then the value
|
|
576
|
+
* is assumed to be raw bytes, and will be used directly.
|
|
577
|
+
*/
|
|
578
|
+
value: unknown,
|
|
579
|
+
/**
|
|
580
|
+
* The BCS type to serialize the value into. If not provided, the type will automatically be determined
|
|
581
|
+
* based on how the input is used.
|
|
582
|
+
*/
|
|
583
|
+
type?: string): {
|
|
584
|
+
kind: "Input";
|
|
585
|
+
index: number;
|
|
586
|
+
type?: "object" | "pure" | undefined;
|
|
587
|
+
value?: any;
|
|
588
|
+
};
|
|
589
|
+
/** Add a transaction to the transaction block. */
|
|
590
|
+
add(transaction: TransactionType): TransactionResult;
|
|
591
|
+
splitCoins(...args: Parameters<typeof Transactions['SplitCoins']>): TransactionResult;
|
|
592
|
+
mergeCoins(...args: Parameters<typeof Transactions['MergeCoins']>): TransactionResult;
|
|
593
|
+
publish(...args: Parameters<typeof Transactions['Publish']>): TransactionResult;
|
|
594
|
+
moveCall(...args: Parameters<typeof Transactions['MoveCall']>): TransactionResult;
|
|
595
|
+
transferObjects(...args: Parameters<typeof Transactions['TransferObjects']>): TransactionResult;
|
|
596
|
+
makeMoveVec(...args: Parameters<typeof Transactions['MakeMoveVec']>): TransactionResult;
|
|
597
|
+
/**
|
|
598
|
+
* Serialize the transaction to a string so that it can be sent to a separate context.
|
|
599
|
+
* This is different from `build` in that it does not serialize to BCS bytes, and instead
|
|
600
|
+
* uses a separate format that is unique to the transaction builder. This allows
|
|
601
|
+
* us to serialize partially-complete transactions, that can then be completed and
|
|
602
|
+
* built in a separate context.
|
|
603
|
+
*
|
|
604
|
+
* For example, a dapp can construct a transaction, but not provide gas objects
|
|
605
|
+
* or a gas budget. The transaction then can be sent to the wallet, where this
|
|
606
|
+
* information is automatically filled in (e.g. by querying for coin objects
|
|
607
|
+
* and performing a dry run).
|
|
608
|
+
*/
|
|
609
|
+
serialize(): string;
|
|
610
|
+
/** Build the transaction to BCS bytes. */
|
|
611
|
+
build({ onlyTransactionKind }?: BuildOptions): Promise<Uint8Array>;
|
|
612
|
+
/** Derive transaction digest */
|
|
613
|
+
getDigest(): Promise<string>;
|
|
614
|
+
}
|
|
615
|
+
export {};
|
|
616
|
+
//# sourceMappingURL=TransactionBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransactionBlock.d.ts","sourceRoot":"","sources":["../../../../../src/lib/mystenlab/builder/TransactionBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAyB,MAAM,gBAAgB,CAAC;AAC3G,OAAO,EAA4C,aAAa,EAAE,MAAM,UAAU,CAAC;AACnF,OAAO,EAA+B,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG5F,aAAK,iBAAiB,GAAG,mBAAmB,GAAG,mBAAmB,EAAE,CAAC;AA8CrE,QAAA,MAAM,iBAAiB,eAAoC,CAAC;AAY5D,UAAU,YAAY;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,qBAAa,gBAAgB;;IAC3B,oFAAoF;IACpF,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,gBAAgB;IAIhD;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU;IAU/C;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU;IAe3C,kEAAkE;IAClE,MAAM,KAAK,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEtB;IAED,4DAA4D;IAC5D,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEhB;IAED,SAAS,CAAC,MAAM,EAAE,MAAM;IAGxB;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAKhC,aAAa,CAAC,UAAU,CAAC,EAAE,qBAAqB;IAGhD,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAGlC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAGpC,WAAW,CAAC,KAAK,EAAE,MAAM;IAGzB,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE;IAQtC,4DAA4D;IAC5D,IAAI,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEZ;IAID,IAAI,CAAC,iBAAiB,CAAC,YAEtB;gBAEW,WAAW,CAAC,EAAE,gBAAgB;IAI1C,yEAAyE;IACzE,IAAI,GAAG,IAAI,mBAAmB,CAE7B;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;;;;;;IAgB9C;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,aAAa;;;;;;IAOtC;;OAEG;IACH,IAAI;IACF;;;OAGG;IACH,KAAK,EAAE,OAAO;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM;;;;;;IASf,kDAAkD;IAClD,GAAG,CAAC,WAAW,EAAE,eAAe;IAOhC,UAAU,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,YAAY,CAAC,CAAC;IAGjE,UAAU,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,YAAY,CAAC,CAAC;IAGjE,OAAO,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;IAG3D,QAAQ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;IAG7D,eAAe,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAG3E,WAAW,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,aAAa,CAAC,CAAC;IAInE;;;;;;;;;;;OAWG;IACH,SAAS;IAIT,0CAA0C;IACpC,KAAK,CAAC,EAAE,mBAAmB,EAAE,GAAE,YAAiB,GAAG,OAAO,CAAC,UAAU,CAAC;IAI5E,gCAAgC;IAC1B,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;CAGnC"}
|