@bitgo-beta/sdk-coin-sui 1.4.1-alpha.9 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/CHANGELOG.md +122 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/lib/constants.d.ts +7 -8
- package/dist/src/lib/constants.d.ts.map +1 -1
- package/dist/src/lib/constants.js +10 -13
- package/dist/src/lib/iface.d.ts +53 -51
- package/dist/src/lib/iface.d.ts.map +1 -1
- package/dist/src/lib/iface.js +26 -1
- package/dist/src/lib/index.d.ts +5 -0
- package/dist/src/lib/index.d.ts.map +1 -1
- package/dist/src/lib/index.js +12 -2
- package/dist/src/lib/keyPair.d.ts +11 -0
- package/dist/src/lib/keyPair.d.ts.map +1 -1
- package/dist/src/lib/keyPair.js +21 -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 +62 -0
- package/dist/src/lib/stakingBuilder.d.ts.map +1 -0
- package/dist/src/lib/stakingBuilder.js +187 -0
- package/dist/src/lib/stakingTransaction.d.ts +51 -0
- package/dist/src/lib/stakingTransaction.d.ts.map +1 -0
- package/dist/src/lib/stakingTransaction.js +211 -0
- package/dist/src/lib/transaction.d.ts +36 -33
- package/dist/src/lib/transaction.d.ts.map +1 -1
- package/dist/src/lib/transaction.js +89 -252
- package/dist/src/lib/transactionBuilder.d.ts +18 -33
- package/dist/src/lib/transactionBuilder.d.ts.map +1 -1
- package/dist/src/lib/transactionBuilder.js +39 -169
- package/dist/src/lib/transactionBuilderFactory.d.ts +10 -3
- package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/lib/transactionBuilderFactory.js +29 -7
- package/dist/src/lib/transferBuilder.d.ts +31 -2
- package/dist/src/lib/transferBuilder.d.ts.map +1 -1
- package/dist/src/lib/transferBuilder.js +102 -1
- package/dist/src/lib/transferTransaction.d.ts +54 -0
- package/dist/src/lib/transferTransaction.d.ts.map +1 -0
- package/dist/src/lib/transferTransaction.js +180 -0
- 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 +49 -3
- package/dist/src/lib/utils.d.ts.map +1 -1
- package/dist/src/lib/utils.js +151 -10
- package/dist/src/register.d.ts +3 -0
- package/dist/src/register.d.ts.map +1 -0
- package/dist/src/register.js +11 -0
- package/dist/src/sui.d.ts +3 -0
- package/dist/src/sui.d.ts.map +1 -1
- package/dist/src/sui.js +34 -14
- package/package.json +11 -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 -82
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isMutableSharedObjectInput = exports.isSharedObjectInput = exports.getSharedObjectInput = exports.getIdFromCallArg = exports.Inputs = exports.BuilderCallArg = exports.ObjectCallArg = exports.PureCallArg = void 0;
|
|
4
|
+
const superstruct_1 = require("superstruct");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const bcs_1 = require("./bcs");
|
|
7
|
+
const ObjectArg = superstruct_1.union([
|
|
8
|
+
superstruct_1.object({ ImmOrOwned: types_1.SuiObjectRef }),
|
|
9
|
+
superstruct_1.object({
|
|
10
|
+
Shared: superstruct_1.object({
|
|
11
|
+
objectId: superstruct_1.string(),
|
|
12
|
+
initialSharedVersion: superstruct_1.union([superstruct_1.integer(), superstruct_1.string()]),
|
|
13
|
+
mutable: superstruct_1.boolean(),
|
|
14
|
+
}),
|
|
15
|
+
}),
|
|
16
|
+
]);
|
|
17
|
+
exports.PureCallArg = superstruct_1.object({ Pure: superstruct_1.array(superstruct_1.integer()) });
|
|
18
|
+
exports.ObjectCallArg = superstruct_1.object({ Object: ObjectArg });
|
|
19
|
+
exports.BuilderCallArg = superstruct_1.union([exports.PureCallArg, exports.ObjectCallArg]);
|
|
20
|
+
exports.Inputs = {
|
|
21
|
+
Pure(data, type) {
|
|
22
|
+
return {
|
|
23
|
+
Pure: Array.from(data instanceof Uint8Array ? data : bcs_1.builder.ser(type, data).toBytes()),
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
ObjectRef(ref) {
|
|
27
|
+
return { Object: { ImmOrOwned: ref } };
|
|
28
|
+
},
|
|
29
|
+
SharedObjectRef(ref) {
|
|
30
|
+
return { Object: { Shared: ref } };
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
function getIdFromCallArg(arg) {
|
|
34
|
+
if (typeof arg === 'string') {
|
|
35
|
+
return types_1.normalizeSuiAddress(arg);
|
|
36
|
+
}
|
|
37
|
+
if ('ImmOrOwned' in arg.Object) {
|
|
38
|
+
return arg.Object.ImmOrOwned.objectId;
|
|
39
|
+
}
|
|
40
|
+
return arg.Object.Shared.objectId;
|
|
41
|
+
}
|
|
42
|
+
exports.getIdFromCallArg = getIdFromCallArg;
|
|
43
|
+
function getSharedObjectInput(arg) {
|
|
44
|
+
return typeof arg === 'object' && 'Object' in arg && 'Shared' in arg.Object ? arg.Object.Shared : undefined;
|
|
45
|
+
}
|
|
46
|
+
exports.getSharedObjectInput = getSharedObjectInput;
|
|
47
|
+
function isSharedObjectInput(arg) {
|
|
48
|
+
return !!getSharedObjectInput(arg);
|
|
49
|
+
}
|
|
50
|
+
exports.isSharedObjectInput = isSharedObjectInput;
|
|
51
|
+
function isMutableSharedObjectInput(arg) {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
return (_b = (_a = getSharedObjectInput(arg)) === null || _a === void 0 ? void 0 : _a.mutable) !== null && _b !== void 0 ? _b : false;
|
|
54
|
+
}
|
|
55
|
+
exports.isMutableSharedObjectInput = isMutableSharedObjectInput;
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW5wdXRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2xpYi9teXN0ZW5sYWIvYnVpbGRlci9JbnB1dHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkNBQW9GO0FBQ3BGLG9DQUF3RjtBQUN4RiwrQkFBZ0M7QUFFaEMsTUFBTSxTQUFTLEdBQUcsbUJBQUssQ0FBQztJQUN0QixvQkFBTSxDQUFDLEVBQUUsVUFBVSxFQUFFLG9CQUFZLEVBQUUsQ0FBQztJQUNwQyxvQkFBTSxDQUFDO1FBQ0wsTUFBTSxFQUFFLG9CQUFNLENBQUM7WUFDYixRQUFRLEVBQUUsb0JBQU0sRUFBRTtZQUNsQixvQkFBb0IsRUFBRSxtQkFBSyxDQUFDLENBQUMscUJBQU8sRUFBRSxFQUFFLG9CQUFNLEVBQUUsQ0FBQyxDQUFDO1lBQ2xELE9BQU8sRUFBRSxxQkFBTyxFQUFFO1NBQ25CLENBQUM7S0FDSCxDQUFDO0NBQ0gsQ0FBQyxDQUFDO0FBRVUsUUFBQSxXQUFXLEdBQUcsb0JBQU0sQ0FBQyxFQUFFLElBQUksR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jdElucHV0KGFyZzogQnVpbGRlckNhbGxBcmcpOiBib29sZWFuIHtcbiAgcmV0dXJuIGdldFNoYXJlZE9iamVjdElucHV0KGFyZyk/Lm11dGFibGUgPz8gZmFsc2U7XG59XG4iXX0=
|
|
@@ -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
|
+
kind: "TransferObjects";
|
|
117
|
+
objects: ({
|
|
118
|
+
kind: "Input";
|
|
119
|
+
index: number;
|
|
120
|
+
type?: "object" | "pure" | undefined;
|
|
121
|
+
value?: any;
|
|
122
|
+
} | {
|
|
123
|
+
kind: "GasCoin";
|
|
124
|
+
} | {
|
|
125
|
+
kind: "Result";
|
|
126
|
+
index: number;
|
|
127
|
+
} | {
|
|
128
|
+
kind: "NestedResult";
|
|
129
|
+
index: number;
|
|
130
|
+
resultIndex: number;
|
|
131
|
+
})[];
|
|
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
|
+
modules: number[][];
|
|
273
|
+
dependencies: string[];
|
|
274
|
+
};
|
|
275
|
+
MakeMoveVec({ type, objects, }: Omit<{
|
|
276
|
+
kind: "MakeMoveVec";
|
|
277
|
+
objects: ({
|
|
278
|
+
kind: "Input";
|
|
279
|
+
index: number;
|
|
280
|
+
type?: "object" | "pure" | undefined;
|
|
281
|
+
value?: any;
|
|
282
|
+
} | {
|
|
283
|
+
kind: "GasCoin";
|
|
284
|
+
} | {
|
|
285
|
+
kind: "Result";
|
|
286
|
+
index: number;
|
|
287
|
+
} | {
|
|
288
|
+
kind: "NestedResult";
|
|
289
|
+
index: number;
|
|
290
|
+
resultIndex: number;
|
|
291
|
+
})[];
|
|
292
|
+
type?: {
|
|
293
|
+
None: null;
|
|
294
|
+
} | {
|
|
295
|
+
Some: string;
|
|
296
|
+
} | undefined;
|
|
297
|
+
}, "type" | "kind"> & {
|
|
298
|
+
type?: string | undefined;
|
|
299
|
+
}): {
|
|
300
|
+
kind: "MakeMoveVec";
|
|
301
|
+
objects: ({
|
|
302
|
+
kind: "Input";
|
|
303
|
+
index: number;
|
|
304
|
+
type?: "object" | "pure" | undefined;
|
|
305
|
+
value?: any;
|
|
306
|
+
} | {
|
|
307
|
+
kind: "GasCoin";
|
|
308
|
+
} | {
|
|
309
|
+
kind: "Result";
|
|
310
|
+
index: number;
|
|
311
|
+
} | {
|
|
312
|
+
kind: "NestedResult";
|
|
313
|
+
index: number;
|
|
314
|
+
resultIndex: number;
|
|
315
|
+
})[];
|
|
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
|
+
kind: "TransferObjects";
|
|
398
|
+
objects: ({
|
|
399
|
+
kind: "Input";
|
|
400
|
+
index: number;
|
|
401
|
+
type?: "object" | "pure" | undefined;
|
|
402
|
+
value?: any;
|
|
403
|
+
} | {
|
|
404
|
+
kind: "GasCoin";
|
|
405
|
+
} | {
|
|
406
|
+
kind: "Result";
|
|
407
|
+
index: number;
|
|
408
|
+
} | {
|
|
409
|
+
kind: "NestedResult";
|
|
410
|
+
index: number;
|
|
411
|
+
resultIndex: number;
|
|
412
|
+
})[];
|
|
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
|
+
kind: "Publish";
|
|
494
|
+
modules: number[][];
|
|
495
|
+
dependencies: string[];
|
|
496
|
+
} | {
|
|
497
|
+
kind: "MakeMoveVec";
|
|
498
|
+
objects: ({
|
|
499
|
+
kind: "Input";
|
|
500
|
+
index: number;
|
|
501
|
+
type?: "object" | "pure" | undefined;
|
|
502
|
+
value?: any;
|
|
503
|
+
} | {
|
|
504
|
+
kind: "GasCoin";
|
|
505
|
+
} | {
|
|
506
|
+
kind: "Result";
|
|
507
|
+
index: number;
|
|
508
|
+
} | {
|
|
509
|
+
kind: "NestedResult";
|
|
510
|
+
index: number;
|
|
511
|
+
resultIndex: number;
|
|
512
|
+
})[];
|
|
513
|
+
type?: {
|
|
514
|
+
None: null;
|
|
515
|
+
} | {
|
|
516
|
+
Some: string;
|
|
517
|
+
} | undefined;
|
|
518
|
+
})[];
|
|
519
|
+
inputs: {
|
|
520
|
+
kind: "Input";
|
|
521
|
+
index: number;
|
|
522
|
+
type?: "object" | "pure" | undefined;
|
|
523
|
+
value?: any;
|
|
524
|
+
}[];
|
|
525
|
+
gasConfig: {
|
|
526
|
+
budget?: string | undefined;
|
|
527
|
+
price?: string | undefined;
|
|
528
|
+
payment?: {
|
|
529
|
+
objectId: string;
|
|
530
|
+
version: string | number;
|
|
531
|
+
digest: string;
|
|
532
|
+
}[] | undefined;
|
|
533
|
+
owner?: 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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