@mysten/kiosk 0.14.6 → 1.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/CHANGELOG.md +105 -2
- package/dist/client/kiosk-client.d.mts +126 -0
- package/dist/client/kiosk-client.d.mts.map +1 -0
- package/dist/client/kiosk-client.mjs +124 -0
- package/dist/client/kiosk-client.mjs.map +1 -0
- package/dist/client/kiosk-transaction.d.mts +236 -0
- package/dist/client/kiosk-transaction.d.mts.map +1 -0
- package/dist/client/kiosk-transaction.mjs +472 -0
- package/dist/client/kiosk-transaction.mjs.map +1 -0
- package/dist/client/tp-transaction.d.mts +139 -0
- package/dist/client/tp-transaction.d.mts.map +1 -0
- package/dist/client/tp-transaction.mjs +273 -0
- package/dist/client/tp-transaction.mjs.map +1 -0
- package/dist/constants.d.mts +42 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +62 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/contracts/0x2/bag.mjs +19 -0
- package/dist/contracts/0x2/bag.mjs.map +1 -0
- package/dist/contracts/0x2/balance.mjs +20 -0
- package/dist/contracts/0x2/balance.mjs.map +1 -0
- package/dist/contracts/0x2/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs +16 -0
- package/dist/contracts/0x2/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs.map +1 -0
- package/dist/contracts/0x2/kiosk.mjs +244 -0
- package/dist/contracts/0x2/kiosk.mjs.map +1 -0
- package/dist/contracts/0x2/kiosk_extension.mjs +25 -0
- package/dist/contracts/0x2/kiosk_extension.mjs.map +1 -0
- package/dist/contracts/0x2/transfer_policy.mjs +99 -0
- package/dist/contracts/0x2/transfer_policy.mjs.map +1 -0
- package/dist/contracts/0x2/vec_set.mjs +18 -0
- package/dist/contracts/0x2/vec_set.mjs.map +1 -0
- package/dist/contracts/kiosk/deps/sui/kiosk.mjs +98 -0
- package/dist/contracts/kiosk/deps/sui/kiosk.mjs.map +1 -0
- package/dist/contracts/kiosk/floor_price_rule.mjs +70 -0
- package/dist/contracts/kiosk/floor_price_rule.mjs.map +1 -0
- package/dist/contracts/kiosk/kiosk_lock_rule.mjs +72 -0
- package/dist/contracts/kiosk/kiosk_lock_rule.mjs.map +1 -0
- package/dist/contracts/kiosk/personal_kiosk.mjs +102 -0
- package/dist/contracts/kiosk/personal_kiosk.mjs.map +1 -0
- package/dist/contracts/kiosk/personal_kiosk_rule.mjs +66 -0
- package/dist/contracts/kiosk/personal_kiosk_rule.mjs.map +1 -0
- package/dist/contracts/kiosk/royalty_rule.mjs +115 -0
- package/dist/contracts/kiosk/royalty_rule.mjs.map +1 -0
- package/dist/contracts/utils/index.mjs +118 -0
- package/dist/contracts/utils/index.mjs.map +1 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +9 -0
- package/dist/query/client-utils.mjs +30 -0
- package/dist/query/client-utils.mjs.map +1 -0
- package/dist/query/kiosk.mjs +154 -0
- package/dist/query/kiosk.mjs.map +1 -0
- package/dist/query/transfer-policy.mjs +110 -0
- package/dist/query/transfer-policy.mjs.map +1 -0
- package/dist/tx/kiosk.mjs +20 -0
- package/dist/tx/kiosk.mjs.map +1 -0
- package/dist/tx/rules/resolve.mjs +114 -0
- package/dist/tx/rules/resolve.mjs.map +1 -0
- package/dist/tx/transfer-policy.mjs +38 -0
- package/dist/tx/transfer-policy.mjs.map +1 -0
- package/dist/types/index.d.mts +23 -0
- package/dist/types/index.d.mts.map +1 -0
- package/dist/types/kiosk.d.mts +165 -0
- package/dist/types/kiosk.d.mts.map +1 -0
- package/dist/types/kiosk.mjs +21 -0
- package/dist/types/kiosk.mjs.map +1 -0
- package/dist/types/transfer-policy.d.mts +56 -0
- package/dist/types/transfer-policy.d.mts.map +1 -0
- package/dist/types/transfer-policy.mjs +19 -0
- package/dist/types/transfer-policy.mjs.map +1 -0
- package/dist/utils.d.mts +45 -0
- package/dist/utils.d.mts.map +1 -0
- package/dist/utils.mjs +156 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +31 -20
- package/src/client/kiosk-client.ts +42 -5
- package/src/client/kiosk-transaction.ts +144 -65
- package/src/client/tp-transaction.ts +149 -95
- package/src/constants.ts +19 -24
- package/src/contracts/0x2/accumulator.ts +24 -0
- package/src/contracts/0x2/accumulator_metadata.ts +38 -0
- package/src/contracts/0x2/accumulator_settlement.ts +14 -0
- package/src/contracts/0x2/address.ts +145 -0
- package/src/contracts/0x2/address_alias.ts +92 -0
- package/src/contracts/0x2/authenticator_state.ts +44 -0
- package/src/contracts/0x2/bag.ts +192 -0
- package/src/contracts/0x2/balance.ts +269 -0
- package/src/contracts/0x2/bcs.ts +495 -0
- package/src/contracts/0x2/bls12381.ts +717 -0
- package/src/contracts/0x2/borrow.ts +99 -0
- package/src/contracts/0x2/clock.ts +30 -0
- package/src/contracts/0x2/coin.ts +977 -0
- package/src/contracts/0x2/coin_registry.ts +874 -0
- package/src/contracts/0x2/config.ts +30 -0
- package/src/contracts/0x2/deny_list.ts +55 -0
- package/src/contracts/0x2/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.ts +12 -0
- package/src/contracts/0x2/derived_object.ts +95 -0
- package/src/contracts/0x2/display.ts +258 -0
- package/src/contracts/0x2/dynamic_field.ts +171 -0
- package/src/contracts/0x2/dynamic_object_field.ts +167 -0
- package/src/contracts/0x2/ecdsa_k1.ts +65 -0
- package/src/contracts/0x2/ecdsa_r1.ts +49 -0
- package/src/contracts/0x2/ecvrf.ts +29 -0
- package/src/contracts/0x2/ed25519.ts +25 -0
- package/src/contracts/0x2/event.ts +42 -0
- package/src/contracts/0x2/funds_accumulator.ts +86 -0
- package/src/contracts/0x2/groth16.ts +171 -0
- package/src/contracts/0x2/group_ops.ts +49 -0
- package/src/contracts/0x2/hash.ts +37 -0
- package/src/contracts/0x2/hex.ts +37 -0
- package/src/contracts/0x2/hmac.ts +21 -0
- package/src/contracts/0x2/kiosk.ts +797 -0
- package/src/contracts/0x2/kiosk_extension.ts +270 -0
- package/src/contracts/0x2/linked_table.ts +354 -0
- package/src/contracts/0x2/math.ts +117 -0
- package/src/contracts/0x2/nitro_attestation.ts +186 -0
- package/src/contracts/0x2/object.ts +249 -0
- package/src/contracts/0x2/object_bag.ts +210 -0
- package/src/contracts/0x2/object_table.ts +200 -0
- package/src/contracts/0x2/package.ts +414 -0
- package/src/contracts/0x2/party.ts +37 -0
- package/src/contracts/0x2/pay.ts +153 -0
- package/src/contracts/0x2/poseidon.ts +21 -0
- package/src/contracts/0x2/priority_queue.ts +139 -0
- package/src/contracts/0x2/random.ts +294 -0
- package/src/contracts/0x2/sui.ts +29 -0
- package/src/contracts/0x2/table.ts +200 -0
- package/src/contracts/0x2/table_vec.ts +232 -0
- package/src/contracts/0x2/token.ts +873 -0
- package/src/contracts/0x2/transfer.ts +216 -0
- package/src/contracts/0x2/transfer_policy.ts +400 -0
- package/src/contracts/0x2/tx_context.ts +129 -0
- package/src/contracts/0x2/types.ts +24 -0
- package/src/contracts/0x2/url.ts +77 -0
- package/src/contracts/0x2/vdf.ts +45 -0
- package/src/contracts/0x2/vec_map.ts +401 -0
- package/src/contracts/0x2/vec_set.ts +211 -0
- package/src/contracts/0x2/versioned.ts +153 -0
- package/src/contracts/0x2/zklogin_verified_id.ts +172 -0
- package/src/contracts/0x2/zklogin_verified_issuer.ts +99 -0
- package/src/contracts/kiosk/deps/sui/kiosk.ts +94 -0
- package/src/contracts/kiosk/deps/sui/object.ts +15 -0
- package/src/contracts/kiosk/floor_price_rule.ts +92 -0
- package/src/contracts/kiosk/kiosk_lock_rule.ts +97 -0
- package/src/contracts/kiosk/personal_kiosk.ts +295 -0
- package/src/contracts/kiosk/personal_kiosk_rule.ts +89 -0
- package/src/contracts/kiosk/royalty_rule.ts +144 -0
- package/src/contracts/kiosk/witness_rule.ts +92 -0
- package/src/contracts/utils/index.ts +234 -0
- package/src/query/client-utils.ts +51 -0
- package/src/query/kiosk.ts +128 -100
- package/src/query/transfer-policy.ts +112 -78
- package/src/tx/kiosk.ts +7 -231
- package/src/tx/rules/resolve.ts +97 -48
- package/src/tx/transfer-policy.ts +25 -86
- package/src/types/index.ts +3 -14
- package/src/types/kiosk.ts +10 -12
- package/src/types/transfer-policy.ts +4 -4
- package/src/utils.ts +90 -128
- package/dist/cjs/bcs.d.ts +0 -23
- package/dist/cjs/bcs.js +0 -50
- package/dist/cjs/bcs.js.map +0 -7
- package/dist/cjs/client/kiosk-client.d.ts +0 -76
- package/dist/cjs/client/kiosk-client.js +0 -123
- package/dist/cjs/client/kiosk-client.js.map +0 -7
- package/dist/cjs/client/kiosk-transaction.d.ts +0 -186
- package/dist/cjs/client/kiosk-transaction.js +0 -462
- package/dist/cjs/client/kiosk-transaction.js.map +0 -7
- package/dist/cjs/client/tp-transaction.d.ts +0 -114
- package/dist/cjs/client/tp-transaction.js +0 -307
- package/dist/cjs/client/tp-transaction.js.map +0 -7
- package/dist/cjs/constants.d.ts +0 -31
- package/dist/cjs/constants.js +0 -102
- package/dist/cjs/constants.js.map +0 -7
- package/dist/cjs/index.d.ts +0 -6
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/package.json +0 -5
- package/dist/cjs/query/kiosk.d.ts +0 -8
- package/dist/cjs/query/kiosk.js +0 -181
- package/dist/cjs/query/kiosk.js.map +0 -7
- package/dist/cjs/query/transfer-policy.d.ts +0 -29
- package/dist/cjs/query/transfer-policy.js +0 -92
- package/dist/cjs/query/transfer-policy.js.map +0 -7
- package/dist/cjs/tx/kiosk.d.ts +0 -71
- package/dist/cjs/tx/kiosk.js +0 -130
- package/dist/cjs/tx/kiosk.js.map +0 -7
- package/dist/cjs/tx/personal-kiosk.d.ts +0 -7
- package/dist/cjs/tx/personal-kiosk.js +0 -38
- package/dist/cjs/tx/personal-kiosk.js.map +0 -7
- package/dist/cjs/tx/rules/attach.d.ts +0 -7
- package/dist/cjs/tx/rules/attach.js +0 -62
- package/dist/cjs/tx/rules/attach.js.map +0 -7
- package/dist/cjs/tx/rules/resolve.d.ts +0 -15
- package/dist/cjs/tx/rules/resolve.js +0 -109
- package/dist/cjs/tx/rules/resolve.js.map +0 -7
- package/dist/cjs/tx/transfer-policy.d.ts +0 -29
- package/dist/cjs/tx/transfer-policy.js +0 -78
- package/dist/cjs/tx/transfer-policy.js.map +0 -7
- package/dist/cjs/types/index.d.ts +0 -27
- package/dist/cjs/types/index.js +0 -33
- package/dist/cjs/types/index.js.map +0 -7
- package/dist/cjs/types/kiosk.d.ts +0 -160
- package/dist/cjs/types/kiosk.js +0 -37
- package/dist/cjs/types/kiosk.js.map +0 -7
- package/dist/cjs/types/transfer-policy.d.ts +0 -53
- package/dist/cjs/types/transfer-policy.js +0 -35
- package/dist/cjs/types/transfer-policy.js.map +0 -7
- package/dist/cjs/utils.d.ts +0 -51
- package/dist/cjs/utils.js +0 -198
- package/dist/cjs/utils.js.map +0 -7
- package/dist/esm/bcs.d.ts +0 -23
- package/dist/esm/bcs.js +0 -35
- package/dist/esm/bcs.js.map +0 -7
- package/dist/esm/client/kiosk-client.d.ts +0 -76
- package/dist/esm/client/kiosk-client.js +0 -114
- package/dist/esm/client/kiosk-client.js.map +0 -7
- package/dist/esm/client/kiosk-transaction.d.ts +0 -186
- package/dist/esm/client/kiosk-transaction.js +0 -432
- package/dist/esm/client/kiosk-transaction.js.map +0 -7
- package/dist/esm/client/tp-transaction.d.ts +0 -114
- package/dist/esm/client/tp-transaction.js +0 -298
- package/dist/esm/client/tp-transaction.js.map +0 -7
- package/dist/esm/constants.d.ts +0 -31
- package/dist/esm/constants.js +0 -87
- package/dist/esm/constants.js.map +0 -7
- package/dist/esm/index.d.ts +0 -6
- package/dist/esm/index.js +0 -7
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/package.json +0 -5
- package/dist/esm/query/kiosk.d.ts +0 -8
- package/dist/esm/query/kiosk.js +0 -169
- package/dist/esm/query/kiosk.js.map +0 -7
- package/dist/esm/query/transfer-policy.d.ts +0 -29
- package/dist/esm/query/transfer-policy.js +0 -76
- package/dist/esm/query/transfer-policy.js.map +0 -7
- package/dist/esm/tx/kiosk.d.ts +0 -71
- package/dist/esm/tx/kiosk.js +0 -110
- package/dist/esm/tx/kiosk.js.map +0 -7
- package/dist/esm/tx/personal-kiosk.d.ts +0 -7
- package/dist/esm/tx/personal-kiosk.js +0 -18
- package/dist/esm/tx/personal-kiosk.js.map +0 -7
- package/dist/esm/tx/rules/attach.d.ts +0 -7
- package/dist/esm/tx/rules/attach.js +0 -42
- package/dist/esm/tx/rules/attach.js.map +0 -7
- package/dist/esm/tx/rules/resolve.d.ts +0 -15
- package/dist/esm/tx/rules/resolve.js +0 -89
- package/dist/esm/tx/rules/resolve.js.map +0 -7
- package/dist/esm/tx/transfer-policy.d.ts +0 -29
- package/dist/esm/tx/transfer-policy.js +0 -58
- package/dist/esm/tx/transfer-policy.js.map +0 -7
- package/dist/esm/types/index.d.ts +0 -27
- package/dist/esm/types/index.js +0 -12
- package/dist/esm/types/index.js.map +0 -7
- package/dist/esm/types/kiosk.d.ts +0 -160
- package/dist/esm/types/kiosk.js +0 -17
- package/dist/esm/types/kiosk.js.map +0 -7
- package/dist/esm/types/transfer-policy.d.ts +0 -53
- package/dist/esm/types/transfer-policy.js +0 -15
- package/dist/esm/types/transfer-policy.js.map +0 -7
- package/dist/esm/utils.d.ts +0 -51
- package/dist/esm/utils.js +0 -183
- package/dist/esm/utils.js.map +0 -7
- package/dist/tsconfig.esm.tsbuildinfo +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/bcs.ts +0 -39
- package/src/tx/personal-kiosk.ts +0 -34
- package/src/tx/rules/attach.ts +0 -73
|
@@ -0,0 +1,873 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
5
|
+
import { bcs, type BcsType } from '@mysten/sui/bcs';
|
|
6
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
7
|
+
import * as balance from './balance.js';
|
|
8
|
+
import * as vec_map from './vec_map.js';
|
|
9
|
+
import * as vec_set from './vec_set.js';
|
|
10
|
+
import * as type_name from './deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.js';
|
|
11
|
+
const $moduleName = '0x2::token';
|
|
12
|
+
export const Token = new MoveStruct({
|
|
13
|
+
name: `${$moduleName}::Token`,
|
|
14
|
+
fields: {
|
|
15
|
+
id: bcs.Address,
|
|
16
|
+
balance: balance.Balance,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export const TokenPolicyCap = new MoveStruct({
|
|
20
|
+
name: `${$moduleName}::TokenPolicyCap`,
|
|
21
|
+
fields: {
|
|
22
|
+
id: bcs.Address,
|
|
23
|
+
for: bcs.Address,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
export const TokenPolicy = new MoveStruct({
|
|
27
|
+
name: `${$moduleName}::TokenPolicy`,
|
|
28
|
+
fields: {
|
|
29
|
+
id: bcs.Address,
|
|
30
|
+
spent_balance: balance.Balance,
|
|
31
|
+
rules: vec_map.VecMap(bcs.string(), vec_set.VecSet(type_name.TypeName)),
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export const ActionRequest = new MoveStruct({
|
|
35
|
+
name: `${$moduleName}::ActionRequest`,
|
|
36
|
+
fields: {
|
|
37
|
+
name: bcs.string(),
|
|
38
|
+
amount: bcs.u64(),
|
|
39
|
+
sender: bcs.Address,
|
|
40
|
+
recipient: bcs.option(bcs.Address),
|
|
41
|
+
spent_balance: bcs.option(balance.Balance),
|
|
42
|
+
approvals: vec_set.VecSet(type_name.TypeName),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
export const RuleKey = new MoveStruct({
|
|
46
|
+
name: `${$moduleName}::RuleKey`,
|
|
47
|
+
fields: {
|
|
48
|
+
is_protected: bcs.bool(),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export const TokenPolicyCreated = new MoveStruct({
|
|
52
|
+
name: `${$moduleName}::TokenPolicyCreated`,
|
|
53
|
+
fields: {
|
|
54
|
+
id: bcs.Address,
|
|
55
|
+
is_mutable: bcs.bool(),
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
export interface NewPolicyOptions {
|
|
59
|
+
package?: string;
|
|
60
|
+
arguments: [RawTransactionArgument<string>];
|
|
61
|
+
typeArguments: [string];
|
|
62
|
+
}
|
|
63
|
+
export function newPolicy(options: NewPolicyOptions) {
|
|
64
|
+
const packageAddress =
|
|
65
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
66
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
67
|
+
return (tx: Transaction) =>
|
|
68
|
+
tx.moveCall({
|
|
69
|
+
package: packageAddress,
|
|
70
|
+
module: 'token',
|
|
71
|
+
function: 'new_policy',
|
|
72
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
73
|
+
typeArguments: options.typeArguments,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export interface SharePolicyOptions {
|
|
77
|
+
package?: string;
|
|
78
|
+
arguments: [RawTransactionArgument<string>];
|
|
79
|
+
typeArguments: [string];
|
|
80
|
+
}
|
|
81
|
+
export function sharePolicy(options: SharePolicyOptions) {
|
|
82
|
+
const packageAddress =
|
|
83
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
84
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
85
|
+
return (tx: Transaction) =>
|
|
86
|
+
tx.moveCall({
|
|
87
|
+
package: packageAddress,
|
|
88
|
+
module: 'token',
|
|
89
|
+
function: 'share_policy',
|
|
90
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
91
|
+
typeArguments: options.typeArguments,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export interface TransferOptions {
|
|
95
|
+
package?: string;
|
|
96
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
97
|
+
typeArguments: [string];
|
|
98
|
+
}
|
|
99
|
+
export function transfer(options: TransferOptions) {
|
|
100
|
+
const packageAddress =
|
|
101
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
102
|
+
const argumentsTypes = [null, 'address'] satisfies (string | null)[];
|
|
103
|
+
return (tx: Transaction) =>
|
|
104
|
+
tx.moveCall({
|
|
105
|
+
package: packageAddress,
|
|
106
|
+
module: 'token',
|
|
107
|
+
function: 'transfer',
|
|
108
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
109
|
+
typeArguments: options.typeArguments,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
export interface SpendOptions {
|
|
113
|
+
package?: string;
|
|
114
|
+
arguments: [RawTransactionArgument<string>];
|
|
115
|
+
typeArguments: [string];
|
|
116
|
+
}
|
|
117
|
+
export function spend(options: SpendOptions) {
|
|
118
|
+
const packageAddress =
|
|
119
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
120
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
121
|
+
return (tx: Transaction) =>
|
|
122
|
+
tx.moveCall({
|
|
123
|
+
package: packageAddress,
|
|
124
|
+
module: 'token',
|
|
125
|
+
function: 'spend',
|
|
126
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
127
|
+
typeArguments: options.typeArguments,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
export interface ToCoinOptions {
|
|
131
|
+
package?: string;
|
|
132
|
+
arguments: [RawTransactionArgument<string>];
|
|
133
|
+
typeArguments: [string];
|
|
134
|
+
}
|
|
135
|
+
export function toCoin(options: ToCoinOptions) {
|
|
136
|
+
const packageAddress =
|
|
137
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
138
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
139
|
+
return (tx: Transaction) =>
|
|
140
|
+
tx.moveCall({
|
|
141
|
+
package: packageAddress,
|
|
142
|
+
module: 'token',
|
|
143
|
+
function: 'to_coin',
|
|
144
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
145
|
+
typeArguments: options.typeArguments,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
export interface FromCoinOptions {
|
|
149
|
+
package?: string;
|
|
150
|
+
arguments: [RawTransactionArgument<string>];
|
|
151
|
+
typeArguments: [string];
|
|
152
|
+
}
|
|
153
|
+
export function fromCoin(options: FromCoinOptions) {
|
|
154
|
+
const packageAddress =
|
|
155
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
156
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
157
|
+
return (tx: Transaction) =>
|
|
158
|
+
tx.moveCall({
|
|
159
|
+
package: packageAddress,
|
|
160
|
+
module: 'token',
|
|
161
|
+
function: 'from_coin',
|
|
162
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
163
|
+
typeArguments: options.typeArguments,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
export interface JoinOptions {
|
|
167
|
+
package?: string;
|
|
168
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
169
|
+
typeArguments: [string];
|
|
170
|
+
}
|
|
171
|
+
export function join(options: JoinOptions) {
|
|
172
|
+
const packageAddress =
|
|
173
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
174
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
175
|
+
return (tx: Transaction) =>
|
|
176
|
+
tx.moveCall({
|
|
177
|
+
package: packageAddress,
|
|
178
|
+
module: 'token',
|
|
179
|
+
function: 'join',
|
|
180
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
181
|
+
typeArguments: options.typeArguments,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
export interface SplitOptions {
|
|
185
|
+
package?: string;
|
|
186
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<number | bigint>];
|
|
187
|
+
typeArguments: [string];
|
|
188
|
+
}
|
|
189
|
+
export function split(options: SplitOptions) {
|
|
190
|
+
const packageAddress =
|
|
191
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
192
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
193
|
+
return (tx: Transaction) =>
|
|
194
|
+
tx.moveCall({
|
|
195
|
+
package: packageAddress,
|
|
196
|
+
module: 'token',
|
|
197
|
+
function: 'split',
|
|
198
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
199
|
+
typeArguments: options.typeArguments,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
export interface ZeroOptions {
|
|
203
|
+
package?: string;
|
|
204
|
+
arguments?: [];
|
|
205
|
+
typeArguments: [string];
|
|
206
|
+
}
|
|
207
|
+
export function zero(options: ZeroOptions) {
|
|
208
|
+
const packageAddress =
|
|
209
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
210
|
+
return (tx: Transaction) =>
|
|
211
|
+
tx.moveCall({
|
|
212
|
+
package: packageAddress,
|
|
213
|
+
module: 'token',
|
|
214
|
+
function: 'zero',
|
|
215
|
+
typeArguments: options.typeArguments,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
export interface DestroyZeroOptions {
|
|
219
|
+
package?: string;
|
|
220
|
+
arguments: [RawTransactionArgument<string>];
|
|
221
|
+
typeArguments: [string];
|
|
222
|
+
}
|
|
223
|
+
export function destroyZero(options: DestroyZeroOptions) {
|
|
224
|
+
const packageAddress =
|
|
225
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
226
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
227
|
+
return (tx: Transaction) =>
|
|
228
|
+
tx.moveCall({
|
|
229
|
+
package: packageAddress,
|
|
230
|
+
module: 'token',
|
|
231
|
+
function: 'destroy_zero',
|
|
232
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
233
|
+
typeArguments: options.typeArguments,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
export interface KeepOptions {
|
|
237
|
+
package?: string;
|
|
238
|
+
arguments: [RawTransactionArgument<string>];
|
|
239
|
+
typeArguments: [string];
|
|
240
|
+
}
|
|
241
|
+
export function keep(options: KeepOptions) {
|
|
242
|
+
const packageAddress =
|
|
243
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
244
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
245
|
+
return (tx: Transaction) =>
|
|
246
|
+
tx.moveCall({
|
|
247
|
+
package: packageAddress,
|
|
248
|
+
module: 'token',
|
|
249
|
+
function: 'keep',
|
|
250
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
251
|
+
typeArguments: options.typeArguments,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
export interface NewRequestOptions {
|
|
255
|
+
package?: string;
|
|
256
|
+
arguments: [
|
|
257
|
+
RawTransactionArgument<string>,
|
|
258
|
+
RawTransactionArgument<number | bigint>,
|
|
259
|
+
RawTransactionArgument<string | null>,
|
|
260
|
+
RawTransactionArgument<string | null>,
|
|
261
|
+
];
|
|
262
|
+
typeArguments: [string];
|
|
263
|
+
}
|
|
264
|
+
export function newRequest(options: NewRequestOptions) {
|
|
265
|
+
const packageAddress =
|
|
266
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
267
|
+
const argumentsTypes = [
|
|
268
|
+
'0x1::string::String',
|
|
269
|
+
'u64',
|
|
270
|
+
'0x1::option::Option<address>',
|
|
271
|
+
'0x1::option::Option<null>',
|
|
272
|
+
] satisfies (string | null)[];
|
|
273
|
+
return (tx: Transaction) =>
|
|
274
|
+
tx.moveCall({
|
|
275
|
+
package: packageAddress,
|
|
276
|
+
module: 'token',
|
|
277
|
+
function: 'new_request',
|
|
278
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
279
|
+
typeArguments: options.typeArguments,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
export interface ConfirmRequestOptions {
|
|
283
|
+
package?: string;
|
|
284
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
285
|
+
typeArguments: [string];
|
|
286
|
+
}
|
|
287
|
+
export function confirmRequest(options: ConfirmRequestOptions) {
|
|
288
|
+
const packageAddress =
|
|
289
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
290
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
291
|
+
return (tx: Transaction) =>
|
|
292
|
+
tx.moveCall({
|
|
293
|
+
package: packageAddress,
|
|
294
|
+
module: 'token',
|
|
295
|
+
function: 'confirm_request',
|
|
296
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
297
|
+
typeArguments: options.typeArguments,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
export interface ConfirmRequestMutOptions {
|
|
301
|
+
package?: string;
|
|
302
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
303
|
+
typeArguments: [string];
|
|
304
|
+
}
|
|
305
|
+
export function confirmRequestMut(options: ConfirmRequestMutOptions) {
|
|
306
|
+
const packageAddress =
|
|
307
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
308
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
309
|
+
return (tx: Transaction) =>
|
|
310
|
+
tx.moveCall({
|
|
311
|
+
package: packageAddress,
|
|
312
|
+
module: 'token',
|
|
313
|
+
function: 'confirm_request_mut',
|
|
314
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
315
|
+
typeArguments: options.typeArguments,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
export interface ConfirmWithPolicyCapOptions {
|
|
319
|
+
package?: string;
|
|
320
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
321
|
+
typeArguments: [string];
|
|
322
|
+
}
|
|
323
|
+
export function confirmWithPolicyCap(options: ConfirmWithPolicyCapOptions) {
|
|
324
|
+
const packageAddress =
|
|
325
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
326
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
327
|
+
return (tx: Transaction) =>
|
|
328
|
+
tx.moveCall({
|
|
329
|
+
package: packageAddress,
|
|
330
|
+
module: 'token',
|
|
331
|
+
function: 'confirm_with_policy_cap',
|
|
332
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
333
|
+
typeArguments: options.typeArguments,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
export interface ConfirmWithTreasuryCapOptions {
|
|
337
|
+
package?: string;
|
|
338
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
339
|
+
typeArguments: [string];
|
|
340
|
+
}
|
|
341
|
+
export function confirmWithTreasuryCap(options: ConfirmWithTreasuryCapOptions) {
|
|
342
|
+
const packageAddress =
|
|
343
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
344
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
345
|
+
return (tx: Transaction) =>
|
|
346
|
+
tx.moveCall({
|
|
347
|
+
package: packageAddress,
|
|
348
|
+
module: 'token',
|
|
349
|
+
function: 'confirm_with_treasury_cap',
|
|
350
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
351
|
+
typeArguments: options.typeArguments,
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
export interface AddApprovalOptions<T1 extends BcsType<any>> {
|
|
355
|
+
package?: string;
|
|
356
|
+
arguments: [RawTransactionArgument<T1>, RawTransactionArgument<string>];
|
|
357
|
+
typeArguments: [string, string];
|
|
358
|
+
}
|
|
359
|
+
export function addApproval<T1 extends BcsType<any>>(options: AddApprovalOptions<T1>) {
|
|
360
|
+
const packageAddress =
|
|
361
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
362
|
+
const argumentsTypes = [`${options.typeArguments[1]}`, null] satisfies (string | null)[];
|
|
363
|
+
return (tx: Transaction) =>
|
|
364
|
+
tx.moveCall({
|
|
365
|
+
package: packageAddress,
|
|
366
|
+
module: 'token',
|
|
367
|
+
function: 'add_approval',
|
|
368
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
369
|
+
typeArguments: options.typeArguments,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
export interface AddRuleConfigOptions<T1 extends BcsType<any>, T2 extends BcsType<any>> {
|
|
373
|
+
package?: string;
|
|
374
|
+
arguments: [
|
|
375
|
+
RawTransactionArgument<T1>,
|
|
376
|
+
RawTransactionArgument<string>,
|
|
377
|
+
RawTransactionArgument<string>,
|
|
378
|
+
RawTransactionArgument<T2>,
|
|
379
|
+
];
|
|
380
|
+
typeArguments: [string, string, string];
|
|
381
|
+
}
|
|
382
|
+
export function addRuleConfig<T1 extends BcsType<any>, T2 extends BcsType<any>>(
|
|
383
|
+
options: AddRuleConfigOptions<T1, T2>,
|
|
384
|
+
) {
|
|
385
|
+
const packageAddress =
|
|
386
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
387
|
+
const argumentsTypes = [
|
|
388
|
+
`${options.typeArguments[1]}`,
|
|
389
|
+
null,
|
|
390
|
+
null,
|
|
391
|
+
`${options.typeArguments[2]}`,
|
|
392
|
+
] satisfies (string | null)[];
|
|
393
|
+
return (tx: Transaction) =>
|
|
394
|
+
tx.moveCall({
|
|
395
|
+
package: packageAddress,
|
|
396
|
+
module: 'token',
|
|
397
|
+
function: 'add_rule_config',
|
|
398
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
399
|
+
typeArguments: options.typeArguments,
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
export interface RuleConfigOptions<T1 extends BcsType<any>> {
|
|
403
|
+
package?: string;
|
|
404
|
+
arguments: [RawTransactionArgument<T1>, RawTransactionArgument<string>];
|
|
405
|
+
typeArguments: [string, string, string];
|
|
406
|
+
}
|
|
407
|
+
export function ruleConfig<T1 extends BcsType<any>>(options: RuleConfigOptions<T1>) {
|
|
408
|
+
const packageAddress =
|
|
409
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
410
|
+
const argumentsTypes = [`${options.typeArguments[1]}`, null] satisfies (string | null)[];
|
|
411
|
+
return (tx: Transaction) =>
|
|
412
|
+
tx.moveCall({
|
|
413
|
+
package: packageAddress,
|
|
414
|
+
module: 'token',
|
|
415
|
+
function: 'rule_config',
|
|
416
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
417
|
+
typeArguments: options.typeArguments,
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
export interface RuleConfigMutOptions<T1 extends BcsType<any>> {
|
|
421
|
+
package?: string;
|
|
422
|
+
arguments: [
|
|
423
|
+
RawTransactionArgument<T1>,
|
|
424
|
+
RawTransactionArgument<string>,
|
|
425
|
+
RawTransactionArgument<string>,
|
|
426
|
+
];
|
|
427
|
+
typeArguments: [string, string, string];
|
|
428
|
+
}
|
|
429
|
+
export function ruleConfigMut<T1 extends BcsType<any>>(options: RuleConfigMutOptions<T1>) {
|
|
430
|
+
const packageAddress =
|
|
431
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
432
|
+
const argumentsTypes = [`${options.typeArguments[1]}`, null, null] satisfies (string | null)[];
|
|
433
|
+
return (tx: Transaction) =>
|
|
434
|
+
tx.moveCall({
|
|
435
|
+
package: packageAddress,
|
|
436
|
+
module: 'token',
|
|
437
|
+
function: 'rule_config_mut',
|
|
438
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
439
|
+
typeArguments: options.typeArguments,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
export interface RemoveRuleConfigOptions {
|
|
443
|
+
package?: string;
|
|
444
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
445
|
+
typeArguments: [string, string, string];
|
|
446
|
+
}
|
|
447
|
+
export function removeRuleConfig(options: RemoveRuleConfigOptions) {
|
|
448
|
+
const packageAddress =
|
|
449
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
450
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
451
|
+
return (tx: Transaction) =>
|
|
452
|
+
tx.moveCall({
|
|
453
|
+
package: packageAddress,
|
|
454
|
+
module: 'token',
|
|
455
|
+
function: 'remove_rule_config',
|
|
456
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
457
|
+
typeArguments: options.typeArguments,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
export interface HasRuleConfigOptions {
|
|
461
|
+
package?: string;
|
|
462
|
+
arguments: [RawTransactionArgument<string>];
|
|
463
|
+
typeArguments: [string, string];
|
|
464
|
+
}
|
|
465
|
+
export function hasRuleConfig(options: HasRuleConfigOptions) {
|
|
466
|
+
const packageAddress =
|
|
467
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
468
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
469
|
+
return (tx: Transaction) =>
|
|
470
|
+
tx.moveCall({
|
|
471
|
+
package: packageAddress,
|
|
472
|
+
module: 'token',
|
|
473
|
+
function: 'has_rule_config',
|
|
474
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
475
|
+
typeArguments: options.typeArguments,
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
export interface HasRuleConfigWithTypeOptions {
|
|
479
|
+
package?: string;
|
|
480
|
+
arguments: [RawTransactionArgument<string>];
|
|
481
|
+
typeArguments: [string, string, string];
|
|
482
|
+
}
|
|
483
|
+
export function hasRuleConfigWithType(options: HasRuleConfigWithTypeOptions) {
|
|
484
|
+
const packageAddress =
|
|
485
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
486
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
487
|
+
return (tx: Transaction) =>
|
|
488
|
+
tx.moveCall({
|
|
489
|
+
package: packageAddress,
|
|
490
|
+
module: 'token',
|
|
491
|
+
function: 'has_rule_config_with_type',
|
|
492
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
493
|
+
typeArguments: options.typeArguments,
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
export interface AllowOptions {
|
|
497
|
+
package?: string;
|
|
498
|
+
arguments: [
|
|
499
|
+
RawTransactionArgument<string>,
|
|
500
|
+
RawTransactionArgument<string>,
|
|
501
|
+
RawTransactionArgument<string>,
|
|
502
|
+
];
|
|
503
|
+
typeArguments: [string];
|
|
504
|
+
}
|
|
505
|
+
export function allow(options: AllowOptions) {
|
|
506
|
+
const packageAddress =
|
|
507
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
508
|
+
const argumentsTypes = [null, null, '0x1::string::String'] satisfies (string | null)[];
|
|
509
|
+
return (tx: Transaction) =>
|
|
510
|
+
tx.moveCall({
|
|
511
|
+
package: packageAddress,
|
|
512
|
+
module: 'token',
|
|
513
|
+
function: 'allow',
|
|
514
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
515
|
+
typeArguments: options.typeArguments,
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
export interface DisallowOptions {
|
|
519
|
+
package?: string;
|
|
520
|
+
arguments: [
|
|
521
|
+
RawTransactionArgument<string>,
|
|
522
|
+
RawTransactionArgument<string>,
|
|
523
|
+
RawTransactionArgument<string>,
|
|
524
|
+
];
|
|
525
|
+
typeArguments: [string];
|
|
526
|
+
}
|
|
527
|
+
export function disallow(options: DisallowOptions) {
|
|
528
|
+
const packageAddress =
|
|
529
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
530
|
+
const argumentsTypes = [null, null, '0x1::string::String'] satisfies (string | null)[];
|
|
531
|
+
return (tx: Transaction) =>
|
|
532
|
+
tx.moveCall({
|
|
533
|
+
package: packageAddress,
|
|
534
|
+
module: 'token',
|
|
535
|
+
function: 'disallow',
|
|
536
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
537
|
+
typeArguments: options.typeArguments,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
export interface AddRuleForActionOptions {
|
|
541
|
+
package?: string;
|
|
542
|
+
arguments: [
|
|
543
|
+
RawTransactionArgument<string>,
|
|
544
|
+
RawTransactionArgument<string>,
|
|
545
|
+
RawTransactionArgument<string>,
|
|
546
|
+
];
|
|
547
|
+
typeArguments: [string, string];
|
|
548
|
+
}
|
|
549
|
+
export function addRuleForAction(options: AddRuleForActionOptions) {
|
|
550
|
+
const packageAddress =
|
|
551
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
552
|
+
const argumentsTypes = [null, null, '0x1::string::String'] satisfies (string | null)[];
|
|
553
|
+
return (tx: Transaction) =>
|
|
554
|
+
tx.moveCall({
|
|
555
|
+
package: packageAddress,
|
|
556
|
+
module: 'token',
|
|
557
|
+
function: 'add_rule_for_action',
|
|
558
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
559
|
+
typeArguments: options.typeArguments,
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
export interface RemoveRuleForActionOptions {
|
|
563
|
+
package?: string;
|
|
564
|
+
arguments: [
|
|
565
|
+
RawTransactionArgument<string>,
|
|
566
|
+
RawTransactionArgument<string>,
|
|
567
|
+
RawTransactionArgument<string>,
|
|
568
|
+
];
|
|
569
|
+
typeArguments: [string, string];
|
|
570
|
+
}
|
|
571
|
+
export function removeRuleForAction(options: RemoveRuleForActionOptions) {
|
|
572
|
+
const packageAddress =
|
|
573
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
574
|
+
const argumentsTypes = [null, null, '0x1::string::String'] satisfies (string | null)[];
|
|
575
|
+
return (tx: Transaction) =>
|
|
576
|
+
tx.moveCall({
|
|
577
|
+
package: packageAddress,
|
|
578
|
+
module: 'token',
|
|
579
|
+
function: 'remove_rule_for_action',
|
|
580
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
581
|
+
typeArguments: options.typeArguments,
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
export interface MintOptions {
|
|
585
|
+
package?: string;
|
|
586
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<number | bigint>];
|
|
587
|
+
typeArguments: [string];
|
|
588
|
+
}
|
|
589
|
+
export function mint(options: MintOptions) {
|
|
590
|
+
const packageAddress =
|
|
591
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
592
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
593
|
+
return (tx: Transaction) =>
|
|
594
|
+
tx.moveCall({
|
|
595
|
+
package: packageAddress,
|
|
596
|
+
module: 'token',
|
|
597
|
+
function: 'mint',
|
|
598
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
599
|
+
typeArguments: options.typeArguments,
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
export interface BurnOptions {
|
|
603
|
+
package?: string;
|
|
604
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
605
|
+
typeArguments: [string];
|
|
606
|
+
}
|
|
607
|
+
export function burn(options: BurnOptions) {
|
|
608
|
+
const packageAddress =
|
|
609
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
610
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
611
|
+
return (tx: Transaction) =>
|
|
612
|
+
tx.moveCall({
|
|
613
|
+
package: packageAddress,
|
|
614
|
+
module: 'token',
|
|
615
|
+
function: 'burn',
|
|
616
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
617
|
+
typeArguments: options.typeArguments,
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
export interface FlushOptions {
|
|
621
|
+
package?: string;
|
|
622
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
623
|
+
typeArguments: [string];
|
|
624
|
+
}
|
|
625
|
+
export function flush(options: FlushOptions) {
|
|
626
|
+
const packageAddress =
|
|
627
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
628
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
629
|
+
return (tx: Transaction) =>
|
|
630
|
+
tx.moveCall({
|
|
631
|
+
package: packageAddress,
|
|
632
|
+
module: 'token',
|
|
633
|
+
function: 'flush',
|
|
634
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
635
|
+
typeArguments: options.typeArguments,
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
export interface IsAllowedOptions {
|
|
639
|
+
package?: string;
|
|
640
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
641
|
+
typeArguments: [string];
|
|
642
|
+
}
|
|
643
|
+
export function isAllowed(options: IsAllowedOptions) {
|
|
644
|
+
const packageAddress =
|
|
645
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
646
|
+
const argumentsTypes = [null, '0x1::string::String'] satisfies (string | null)[];
|
|
647
|
+
return (tx: Transaction) =>
|
|
648
|
+
tx.moveCall({
|
|
649
|
+
package: packageAddress,
|
|
650
|
+
module: 'token',
|
|
651
|
+
function: 'is_allowed',
|
|
652
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
653
|
+
typeArguments: options.typeArguments,
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
export interface RulesOptions {
|
|
657
|
+
package?: string;
|
|
658
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
|
|
659
|
+
typeArguments: [string];
|
|
660
|
+
}
|
|
661
|
+
export function rules(options: RulesOptions) {
|
|
662
|
+
const packageAddress =
|
|
663
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
664
|
+
const argumentsTypes = [null, '0x1::string::String'] satisfies (string | null)[];
|
|
665
|
+
return (tx: Transaction) =>
|
|
666
|
+
tx.moveCall({
|
|
667
|
+
package: packageAddress,
|
|
668
|
+
module: 'token',
|
|
669
|
+
function: 'rules',
|
|
670
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
671
|
+
typeArguments: options.typeArguments,
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
export interface SpentBalanceOptions {
|
|
675
|
+
package?: string;
|
|
676
|
+
arguments: [RawTransactionArgument<string>];
|
|
677
|
+
typeArguments: [string];
|
|
678
|
+
}
|
|
679
|
+
export function spentBalance(options: SpentBalanceOptions) {
|
|
680
|
+
const packageAddress =
|
|
681
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
682
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
683
|
+
return (tx: Transaction) =>
|
|
684
|
+
tx.moveCall({
|
|
685
|
+
package: packageAddress,
|
|
686
|
+
module: 'token',
|
|
687
|
+
function: 'spent_balance',
|
|
688
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
689
|
+
typeArguments: options.typeArguments,
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
export interface ValueOptions {
|
|
693
|
+
package?: string;
|
|
694
|
+
arguments: [RawTransactionArgument<string>];
|
|
695
|
+
typeArguments: [string];
|
|
696
|
+
}
|
|
697
|
+
export function value(options: ValueOptions) {
|
|
698
|
+
const packageAddress =
|
|
699
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
700
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
701
|
+
return (tx: Transaction) =>
|
|
702
|
+
tx.moveCall({
|
|
703
|
+
package: packageAddress,
|
|
704
|
+
module: 'token',
|
|
705
|
+
function: 'value',
|
|
706
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
707
|
+
typeArguments: options.typeArguments,
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
export interface TransferActionOptions {
|
|
711
|
+
package?: string;
|
|
712
|
+
arguments?: [];
|
|
713
|
+
}
|
|
714
|
+
export function transferAction(options: TransferActionOptions = {}) {
|
|
715
|
+
const packageAddress =
|
|
716
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
717
|
+
return (tx: Transaction) =>
|
|
718
|
+
tx.moveCall({
|
|
719
|
+
package: packageAddress,
|
|
720
|
+
module: 'token',
|
|
721
|
+
function: 'transfer_action',
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
export interface SpendActionOptions {
|
|
725
|
+
package?: string;
|
|
726
|
+
arguments?: [];
|
|
727
|
+
}
|
|
728
|
+
export function spendAction(options: SpendActionOptions = {}) {
|
|
729
|
+
const packageAddress =
|
|
730
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
731
|
+
return (tx: Transaction) =>
|
|
732
|
+
tx.moveCall({
|
|
733
|
+
package: packageAddress,
|
|
734
|
+
module: 'token',
|
|
735
|
+
function: 'spend_action',
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
export interface ToCoinActionOptions {
|
|
739
|
+
package?: string;
|
|
740
|
+
arguments?: [];
|
|
741
|
+
}
|
|
742
|
+
export function toCoinAction(options: ToCoinActionOptions = {}) {
|
|
743
|
+
const packageAddress =
|
|
744
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
745
|
+
return (tx: Transaction) =>
|
|
746
|
+
tx.moveCall({
|
|
747
|
+
package: packageAddress,
|
|
748
|
+
module: 'token',
|
|
749
|
+
function: 'to_coin_action',
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
export interface FromCoinActionOptions {
|
|
753
|
+
package?: string;
|
|
754
|
+
arguments?: [];
|
|
755
|
+
}
|
|
756
|
+
export function fromCoinAction(options: FromCoinActionOptions = {}) {
|
|
757
|
+
const packageAddress =
|
|
758
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
759
|
+
return (tx: Transaction) =>
|
|
760
|
+
tx.moveCall({
|
|
761
|
+
package: packageAddress,
|
|
762
|
+
module: 'token',
|
|
763
|
+
function: 'from_coin_action',
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
export interface ActionOptions {
|
|
767
|
+
package?: string;
|
|
768
|
+
arguments: [RawTransactionArgument<string>];
|
|
769
|
+
typeArguments: [string];
|
|
770
|
+
}
|
|
771
|
+
export function action(options: ActionOptions) {
|
|
772
|
+
const packageAddress =
|
|
773
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
774
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
775
|
+
return (tx: Transaction) =>
|
|
776
|
+
tx.moveCall({
|
|
777
|
+
package: packageAddress,
|
|
778
|
+
module: 'token',
|
|
779
|
+
function: 'action',
|
|
780
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
781
|
+
typeArguments: options.typeArguments,
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
export interface AmountOptions {
|
|
785
|
+
package?: string;
|
|
786
|
+
arguments: [RawTransactionArgument<string>];
|
|
787
|
+
typeArguments: [string];
|
|
788
|
+
}
|
|
789
|
+
export function amount(options: AmountOptions) {
|
|
790
|
+
const packageAddress =
|
|
791
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
792
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
793
|
+
return (tx: Transaction) =>
|
|
794
|
+
tx.moveCall({
|
|
795
|
+
package: packageAddress,
|
|
796
|
+
module: 'token',
|
|
797
|
+
function: 'amount',
|
|
798
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
799
|
+
typeArguments: options.typeArguments,
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
export interface SenderOptions {
|
|
803
|
+
package?: string;
|
|
804
|
+
arguments: [RawTransactionArgument<string>];
|
|
805
|
+
typeArguments: [string];
|
|
806
|
+
}
|
|
807
|
+
export function sender(options: SenderOptions) {
|
|
808
|
+
const packageAddress =
|
|
809
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
810
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
811
|
+
return (tx: Transaction) =>
|
|
812
|
+
tx.moveCall({
|
|
813
|
+
package: packageAddress,
|
|
814
|
+
module: 'token',
|
|
815
|
+
function: 'sender',
|
|
816
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
817
|
+
typeArguments: options.typeArguments,
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
export interface RecipientOptions {
|
|
821
|
+
package?: string;
|
|
822
|
+
arguments: [RawTransactionArgument<string>];
|
|
823
|
+
typeArguments: [string];
|
|
824
|
+
}
|
|
825
|
+
export function recipient(options: RecipientOptions) {
|
|
826
|
+
const packageAddress =
|
|
827
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
828
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
829
|
+
return (tx: Transaction) =>
|
|
830
|
+
tx.moveCall({
|
|
831
|
+
package: packageAddress,
|
|
832
|
+
module: 'token',
|
|
833
|
+
function: 'recipient',
|
|
834
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
835
|
+
typeArguments: options.typeArguments,
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
export interface ApprovalsOptions {
|
|
839
|
+
package?: string;
|
|
840
|
+
arguments: [RawTransactionArgument<string>];
|
|
841
|
+
typeArguments: [string];
|
|
842
|
+
}
|
|
843
|
+
export function approvals(options: ApprovalsOptions) {
|
|
844
|
+
const packageAddress =
|
|
845
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
846
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
847
|
+
return (tx: Transaction) =>
|
|
848
|
+
tx.moveCall({
|
|
849
|
+
package: packageAddress,
|
|
850
|
+
module: 'token',
|
|
851
|
+
function: 'approvals',
|
|
852
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
853
|
+
typeArguments: options.typeArguments,
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
export interface SpentOptions {
|
|
857
|
+
package?: string;
|
|
858
|
+
arguments: [RawTransactionArgument<string>];
|
|
859
|
+
typeArguments: [string];
|
|
860
|
+
}
|
|
861
|
+
export function spent(options: SpentOptions) {
|
|
862
|
+
const packageAddress =
|
|
863
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
864
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
865
|
+
return (tx: Transaction) =>
|
|
866
|
+
tx.moveCall({
|
|
867
|
+
package: packageAddress,
|
|
868
|
+
module: 'token',
|
|
869
|
+
function: 'spent',
|
|
870
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
871
|
+
typeArguments: options.typeArguments,
|
|
872
|
+
});
|
|
873
|
+
}
|