@suigar/sdk 2.0.0-beta.14 → 2.0.0-beta.15
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 +8 -0
- package/README.md +22 -8
- package/dist/client.d.mts +258 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +291 -0
- package/dist/client.mjs.map +1 -0
- package/dist/configs/package.mainnet.mjs +23 -0
- package/dist/configs/package.mainnet.mjs.map +1 -0
- package/dist/configs/package.mjs +19 -0
- package/dist/configs/package.mjs.map +1 -0
- package/dist/configs/package.testnet.mjs +23 -0
- package/dist/configs/package.testnet.mjs.map +1 -0
- package/dist/configs/registry.mainnet.mjs +6 -0
- package/dist/configs/registry.mainnet.mjs.map +1 -0
- package/dist/configs/registry.mjs +11 -0
- package/dist/configs/registry.mjs.map +1 -0
- package/dist/configs/registry.testnet.mjs +6 -0
- package/dist/configs/registry.testnet.mjs.map +1 -0
- package/dist/contracts/coinflip/coinflip.mjs +46 -0
- package/dist/contracts/coinflip/coinflip.mjs.map +1 -0
- package/dist/contracts/core/core.d.mts +55 -0
- package/dist/contracts/core/core.d.mts.map +1 -0
- package/dist/contracts/core/core.mjs +22 -0
- package/dist/contracts/core/core.mjs.map +1 -0
- package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs +10 -0
- package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs.map +1 -0
- package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
- package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
- package/dist/contracts/core/float.d.mts +14 -0
- package/dist/contracts/core/float.d.mts.map +1 -0
- package/dist/contracts/core/float.mjs +15 -0
- package/dist/contracts/core/float.mjs.map +1 -0
- package/dist/contracts/core/i64.mjs +10 -0
- package/dist/contracts/core/i64.mjs.map +1 -0
- package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
- package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
- package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
- package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
- package/dist/contracts/limbo/limbo.mjs +53 -0
- package/dist/contracts/limbo/limbo.mjs.map +1 -0
- package/dist/contracts/plinko/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
- package/dist/contracts/plinko/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
- package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
- package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
- package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
- package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
- package/dist/contracts/plinko/plinko.mjs +59 -0
- package/dist/contracts/plinko/plinko.mjs.map +1 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs +10 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs.map +1 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs +10 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs.map +1 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
- package/dist/contracts/pvp-coinflip/pvp_coinflip.d.mts +34 -0
- package/dist/contracts/pvp-coinflip/pvp_coinflip.d.mts.map +1 -0
- package/dist/contracts/pvp-coinflip/pvp_coinflip.mjs +131 -0
- package/dist/contracts/pvp-coinflip/pvp_coinflip.mjs.map +1 -0
- package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
- package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
- package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
- package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
- package/dist/contracts/range/range.mjs +53 -0
- package/dist/contracts/range/range.mjs.map +1 -0
- package/dist/contracts/utils/index.d.mts +33 -0
- package/dist/contracts/utils/index.d.mts.map +1 -0
- package/dist/contracts/utils/index.mjs +119 -0
- package/dist/contracts/utils/index.mjs.map +1 -0
- package/dist/contracts/wheel/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
- package/dist/contracts/wheel/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
- package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
- package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
- package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
- package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
- package/dist/contracts/wheel/wheel.mjs +59 -0
- package/dist/contracts/wheel/wheel.mjs.map +1 -0
- package/dist/games.d.mts +3 -0
- package/dist/games.mjs +1 -0
- package/dist/helpers/config.mjs +51 -0
- package/dist/helpers/config.mjs.map +1 -0
- package/dist/helpers/game-settings.mjs +19 -0
- package/dist/helpers/game-settings.mjs.map +1 -0
- package/dist/helpers/metadata.mjs +42 -0
- package/dist/helpers/metadata.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +2 -0
- package/dist/transactions/coinflip.mjs +27 -0
- package/dist/transactions/coinflip.mjs.map +1 -0
- package/dist/transactions/limbo.mjs +31 -0
- package/dist/transactions/limbo.mjs.map +1 -0
- package/dist/transactions/plinko.mjs +29 -0
- package/dist/transactions/plinko.mjs.map +1 -0
- package/dist/transactions/pvp-coinflip.mjs +70 -0
- package/dist/transactions/pvp-coinflip.mjs.map +1 -0
- package/dist/transactions/range.mjs +33 -0
- package/dist/transactions/range.mjs.map +1 -0
- package/dist/transactions/shared.mjs +49 -0
- package/dist/transactions/shared.mjs.map +1 -0
- package/dist/transactions/wheel.mjs +29 -0
- package/dist/transactions/wheel.mjs.map +1 -0
- package/dist/ttl-cache.mjs +60 -0
- package/dist/ttl-cache.mjs.map +1 -0
- package/dist/types/bet-metadata.type.d.mts +7 -0
- package/dist/types/bet-metadata.type.d.mts.map +1 -0
- package/dist/types/build-game-transaction-options.type.d.mts +9 -0
- package/dist/types/build-game-transaction-options.type.d.mts.map +1 -0
- package/dist/types/game-details.type.d.mts +73 -0
- package/dist/types/game-details.type.d.mts.map +1 -0
- package/dist/types/game-details.type.mjs +59 -0
- package/dist/types/game-details.type.mjs.map +1 -0
- package/dist/types/game-settings.type.d.mts +201 -0
- package/dist/types/game-settings.type.d.mts.map +1 -0
- package/dist/types/game-settings.type.mjs +37 -0
- package/dist/types/game-settings.type.mjs.map +1 -0
- package/dist/types/game.type.d.mts +15 -0
- package/dist/types/game.type.d.mts.map +1 -0
- package/dist/types/game.type.mjs +19 -0
- package/dist/types/game.type.mjs.map +1 -0
- package/dist/types/index.d.mts +7 -0
- package/dist/types/move-float.type.d.mts +7 -0
- package/dist/types/move-float.type.d.mts.map +1 -0
- package/dist/types/network.type.d.mts +1 -0
- package/dist/types/network.type.mjs +6 -0
- package/dist/types/network.type.mjs.map +1 -0
- package/dist/types/suigar-config.type.d.mts +33 -0
- package/dist/types/suigar-config.type.d.mts.map +1 -0
- package/dist/types/transaction-options.type.d.mts +63 -0
- package/dist/types/transaction-options.type.d.mts.map +1 -0
- package/dist/utils/constants.d.mts +8 -0
- package/dist/utils/constants.d.mts.map +1 -0
- package/dist/utils/constants.mjs +10 -0
- package/dist/utils/constants.mjs.map +1 -0
- package/dist/utils/numeric.d.mts +86 -0
- package/dist/utils/numeric.d.mts.map +1 -0
- package/dist/utils/numeric.mjs +148 -0
- package/dist/utils/numeric.mjs.map +1 -0
- package/dist/utils/parser.d.mts +54 -0
- package/dist/utils/parser.d.mts.map +1 -0
- package/dist/utils/parser.mjs +94 -0
- package/dist/utils/parser.mjs.map +1 -0
- package/dist/utils.d.mts +4 -0
- package/dist/utils.mjs +4 -0
- package/package.json +16 -17
- package/dist/chunk-7N55D2TV.js +0 -343
- package/dist/games-Da2uZvVJ.d.cts +0 -98
- package/dist/games-Da2uZvVJ.d.ts +0 -98
- package/dist/games.cjs +0 -2
- package/dist/games.d.cts +0 -2
- package/dist/games.d.ts +0 -2
- package/dist/games.js +0 -1
- package/dist/index-3P_LBbDM.d.cts +0 -25
- package/dist/index-3P_LBbDM.d.ts +0 -25
- package/dist/index.cjs +0 -1692
- package/dist/index.d.cts +0 -467
- package/dist/index.d.ts +0 -467
- package/dist/index.js +0 -1470
- package/dist/utils.cjs +0 -243
- package/dist/utils.d.cts +0 -180
- package/dist/utils.d.ts +0 -180
- package/dist/utils.js +0 -1
package/dist/chunk-7N55D2TV.js
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import { parseToMist, normalizeSuiAddress, parseStructTag, normalizeStructTag } from '@mysten/sui/utils';
|
|
2
|
-
import { bcs, BcsStruct, TypeTagSerializer } from '@mysten/sui/bcs';
|
|
3
|
-
import { isArgument } from '@mysten/sui/transactions';
|
|
4
|
-
|
|
5
|
-
// src/utils/constants.ts
|
|
6
|
-
var DEFAULT_GAS_BUDGET_MIST = parseToMist("0.05");
|
|
7
|
-
var DEFAULT_RANGE_SCALE = 1e6;
|
|
8
|
-
var RANGE_POINT_LIMIT = DEFAULT_RANGE_SCALE * 100;
|
|
9
|
-
var DEFAULT_LIMBO_MULTIPLIER_SCALE = 100;
|
|
10
|
-
|
|
11
|
-
// src/utils/numeric.ts
|
|
12
|
-
function assertFiniteNumber(value, errorMessage) {
|
|
13
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
14
|
-
throw new TypeError(`${errorMessage}: ${String(value)}`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function toBigInt(value) {
|
|
18
|
-
let result;
|
|
19
|
-
try {
|
|
20
|
-
if (typeof value === "bigint" || typeof value === "string" || typeof value === "boolean") {
|
|
21
|
-
result = BigInt(value);
|
|
22
|
-
} else {
|
|
23
|
-
assertFiniteNumber(
|
|
24
|
-
value,
|
|
25
|
-
"Value must be a bigint, number, integer string, or boolean"
|
|
26
|
-
);
|
|
27
|
-
result = BigInt(Math.trunc(value));
|
|
28
|
-
}
|
|
29
|
-
} catch {
|
|
30
|
-
throw new TypeError(
|
|
31
|
-
`Value must be a bigint, number, integer string, or boolean: ${value}`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
if (result < 0n) {
|
|
35
|
-
throw new RangeError(`Value must be non-negative: ${value}`);
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
function toBoundedInt(value, max, typeName) {
|
|
40
|
-
const num = typeof value === "string" && value.trim() === "" ? NaN : Number(value);
|
|
41
|
-
assertFiniteNumber(num, "Value must be a finite number or integer string");
|
|
42
|
-
if (typeof value === "boolean" || value == null || !Number.isInteger(num) || num < 0 || num > max) {
|
|
43
|
-
throw new RangeError(
|
|
44
|
-
`Value must be a ${typeName} integer (0-${max}): ${value}`
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
return num;
|
|
48
|
-
}
|
|
49
|
-
function toU8(value) {
|
|
50
|
-
return toBoundedInt(value, 255, "u8");
|
|
51
|
-
}
|
|
52
|
-
function toU16(value) {
|
|
53
|
-
return toBoundedInt(value, 65535, "u16");
|
|
54
|
-
}
|
|
55
|
-
var MOVE_STDLIB_ADDRESS = normalizeSuiAddress("0x1");
|
|
56
|
-
var SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress("0x2");
|
|
57
|
-
function getPureBcsSchema(typeTag) {
|
|
58
|
-
const parsedTag = typeof typeTag === "string" ? TypeTagSerializer.parseFromStr(typeTag) : typeTag;
|
|
59
|
-
if ("u8" in parsedTag) {
|
|
60
|
-
return bcs.U8;
|
|
61
|
-
} else if ("u16" in parsedTag) {
|
|
62
|
-
return bcs.U16;
|
|
63
|
-
} else if ("u32" in parsedTag) {
|
|
64
|
-
return bcs.U32;
|
|
65
|
-
} else if ("u64" in parsedTag) {
|
|
66
|
-
return bcs.U64;
|
|
67
|
-
} else if ("u128" in parsedTag) {
|
|
68
|
-
return bcs.U128;
|
|
69
|
-
} else if ("u256" in parsedTag) {
|
|
70
|
-
return bcs.U256;
|
|
71
|
-
} else if ("address" in parsedTag) {
|
|
72
|
-
return bcs.Address;
|
|
73
|
-
} else if ("bool" in parsedTag) {
|
|
74
|
-
return bcs.Bool;
|
|
75
|
-
} else if ("vector" in parsedTag) {
|
|
76
|
-
const type = getPureBcsSchema(parsedTag.vector);
|
|
77
|
-
return type ? bcs.vector(type) : null;
|
|
78
|
-
} else if ("struct" in parsedTag) {
|
|
79
|
-
const structTag = parsedTag.struct;
|
|
80
|
-
const pkg = normalizeSuiAddress(structTag.address);
|
|
81
|
-
if (pkg === MOVE_STDLIB_ADDRESS) {
|
|
82
|
-
if ((structTag.module === "ascii" || structTag.module === "string") && structTag.name === "String") {
|
|
83
|
-
return bcs.String;
|
|
84
|
-
}
|
|
85
|
-
if (structTag.module === "option" && structTag.name === "Option") {
|
|
86
|
-
const inner = structTag.typeParams[0];
|
|
87
|
-
const type = inner ? getPureBcsSchema(inner) : null;
|
|
88
|
-
return type ? bcs.option(type) : null;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (pkg === SUI_FRAMEWORK_ADDRESS && structTag.module === "object" && (structTag.name === "ID" || structTag.name === "UID")) {
|
|
92
|
-
return bcs.Address;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
function normalizeMoveArguments(args, argTypes, parameterNames) {
|
|
98
|
-
const argLen = Array.isArray(args) ? args.length : Object.keys(args).length;
|
|
99
|
-
if (parameterNames && argLen !== parameterNames.length) {
|
|
100
|
-
throw new Error(
|
|
101
|
-
`Invalid number of arguments, expected ${parameterNames.length}, got ${argLen}`
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
const normalizedArgs = [];
|
|
105
|
-
let index = 0;
|
|
106
|
-
for (const argType of argTypes) {
|
|
107
|
-
if (argType === "0x2::clock::Clock") {
|
|
108
|
-
normalizedArgs.push((tx) => tx.object.clock());
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
if (argType === "0x2::random::Random") {
|
|
112
|
-
normalizedArgs.push((tx) => tx.object.random());
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
if (argType === "0x2::deny_list::DenyList") {
|
|
116
|
-
normalizedArgs.push((tx) => tx.object.denyList());
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
if (argType === "0x3::sui_system::SuiSystemState") {
|
|
120
|
-
normalizedArgs.push((tx) => tx.object.system());
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
let arg;
|
|
124
|
-
if (Array.isArray(args)) {
|
|
125
|
-
if (index >= args.length) {
|
|
126
|
-
throw new Error(
|
|
127
|
-
`Invalid number of arguments, expected at least ${index + 1}, got ${args.length}`
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
arg = args[index];
|
|
131
|
-
} else {
|
|
132
|
-
if (!parameterNames) {
|
|
133
|
-
throw new Error(`Expected arguments to be passed as an array`);
|
|
134
|
-
}
|
|
135
|
-
const name = parameterNames[index];
|
|
136
|
-
arg = args[name];
|
|
137
|
-
if (arg === void 0) {
|
|
138
|
-
throw new Error(`Parameter ${name} is required`);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
index += 1;
|
|
142
|
-
if (typeof arg === "function" || isArgument(arg)) {
|
|
143
|
-
normalizedArgs.push(arg);
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
const bcsType = argType === null ? null : getPureBcsSchema(argType);
|
|
147
|
-
if (bcsType) {
|
|
148
|
-
const bytes = bcsType.serialize(arg);
|
|
149
|
-
normalizedArgs.push((tx) => tx.pure(bytes));
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
if (typeof arg === "string") {
|
|
153
|
-
normalizedArgs.push((tx) => tx.object(arg));
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
throw new Error(`Invalid argument ${stringify(arg)} for type ${argType}`);
|
|
157
|
-
}
|
|
158
|
-
return normalizedArgs;
|
|
159
|
-
}
|
|
160
|
-
var MoveStruct = class extends BcsStruct {
|
|
161
|
-
async get({
|
|
162
|
-
objectId,
|
|
163
|
-
...options
|
|
164
|
-
}) {
|
|
165
|
-
const [res] = await this.getMany({
|
|
166
|
-
...options,
|
|
167
|
-
objectIds: [objectId]
|
|
168
|
-
});
|
|
169
|
-
if (!res) {
|
|
170
|
-
throw new Error(`No object found for id ${objectId}`);
|
|
171
|
-
}
|
|
172
|
-
return res;
|
|
173
|
-
}
|
|
174
|
-
async getMany({
|
|
175
|
-
client,
|
|
176
|
-
...options
|
|
177
|
-
}) {
|
|
178
|
-
const response = await client.core.getObjects({
|
|
179
|
-
...options,
|
|
180
|
-
include: {
|
|
181
|
-
...options.include,
|
|
182
|
-
content: true
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
return response.objects.map((obj) => {
|
|
186
|
-
if (obj instanceof Error) {
|
|
187
|
-
throw obj;
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
...obj,
|
|
191
|
-
json: this.parse(obj.content)
|
|
192
|
-
};
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
function stringify(val) {
|
|
197
|
-
if (typeof val === "object") {
|
|
198
|
-
return JSON.stringify(val, (val2) => val2);
|
|
199
|
-
}
|
|
200
|
-
if (typeof val === "bigint") {
|
|
201
|
-
return val.toString();
|
|
202
|
-
}
|
|
203
|
-
return val;
|
|
204
|
-
}
|
|
205
|
-
var $moduleName = "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64";
|
|
206
|
-
var I64 = new MoveStruct({
|
|
207
|
-
name: `${$moduleName}::I64`,
|
|
208
|
-
fields: {
|
|
209
|
-
bits: bcs.u64()
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
// src/contracts/core/float.ts
|
|
214
|
-
var $moduleName2 = "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float";
|
|
215
|
-
var Float = new MoveStruct({
|
|
216
|
-
name: `${$moduleName2}::Float`,
|
|
217
|
-
fields: {
|
|
218
|
-
is_negative: bcs.bool(),
|
|
219
|
-
exp: I64,
|
|
220
|
-
mant: bcs.u64()
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
// src/types/game-details.type.ts
|
|
225
|
-
var COINFLIP_GAME_DETAILS_SCHEMA = {
|
|
226
|
-
player_bet: "string",
|
|
227
|
-
coin_outcome: "string"
|
|
228
|
-
};
|
|
229
|
-
var PVP_COINFLIP_GAME_DETAILS_SCHEMA = {
|
|
230
|
-
pvp_result: "string"
|
|
231
|
-
};
|
|
232
|
-
var LIMBO_GAME_DETAILS_SCHEMA = {
|
|
233
|
-
payout_amount: "u64",
|
|
234
|
-
win: "bool",
|
|
235
|
-
roll_multiplier: "float",
|
|
236
|
-
payout_multiplier: "float",
|
|
237
|
-
target_multiplier: "float",
|
|
238
|
-
actual_rtp: "float"
|
|
239
|
-
};
|
|
240
|
-
var RANGE_GAME_DETAILS_SCHEMA = {
|
|
241
|
-
roll_value: "u64",
|
|
242
|
-
win: "bool",
|
|
243
|
-
payout_amount: "u64",
|
|
244
|
-
payout_multiplier: "float",
|
|
245
|
-
left_point: "u64",
|
|
246
|
-
right_point: "u64",
|
|
247
|
-
zone_size: "u64",
|
|
248
|
-
winning_zone_size: "u64",
|
|
249
|
-
is_out_range: "bool",
|
|
250
|
-
bet_threshold: "u64",
|
|
251
|
-
roll_under: "bool",
|
|
252
|
-
range_mode: "u8",
|
|
253
|
-
win_probability: "float",
|
|
254
|
-
win_multiplier: "float",
|
|
255
|
-
actual_rtp: "float"
|
|
256
|
-
};
|
|
257
|
-
var PLINKO_GAME_DETAILS_SCHEMA = {
|
|
258
|
-
slot_index: "u8",
|
|
259
|
-
multiplier: "float",
|
|
260
|
-
payout_amount: "u64",
|
|
261
|
-
plinko_config: "u8"
|
|
262
|
-
};
|
|
263
|
-
var WHEEL_GAME_DETAILS_SCHEMA = {
|
|
264
|
-
case_index: "u8",
|
|
265
|
-
multiplier: "float",
|
|
266
|
-
payout_amount: "u64",
|
|
267
|
-
wheel_config: "u8",
|
|
268
|
-
spin_value: "u64"
|
|
269
|
-
};
|
|
270
|
-
var GAME_DETAILS_SCHEMA = {
|
|
271
|
-
...COINFLIP_GAME_DETAILS_SCHEMA,
|
|
272
|
-
...PVP_COINFLIP_GAME_DETAILS_SCHEMA,
|
|
273
|
-
...LIMBO_GAME_DETAILS_SCHEMA,
|
|
274
|
-
...RANGE_GAME_DETAILS_SCHEMA,
|
|
275
|
-
...PLINKO_GAME_DETAILS_SCHEMA,
|
|
276
|
-
...WHEEL_GAME_DETAILS_SCHEMA
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
// src/utils/parser.ts
|
|
280
|
-
var textDecoder = new TextDecoder();
|
|
281
|
-
var GAME_DETAIL_BCS = {
|
|
282
|
-
u8: bcs.U8,
|
|
283
|
-
u64: bcs.U64,
|
|
284
|
-
bool: bcs.Bool,
|
|
285
|
-
float: Float,
|
|
286
|
-
string: bcs.String
|
|
287
|
-
};
|
|
288
|
-
function fromMoveI64(i64) {
|
|
289
|
-
try {
|
|
290
|
-
return Number(BigInt.asIntN(64, BigInt(i64.bits ?? 0)));
|
|
291
|
-
} catch {
|
|
292
|
-
return 0;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
function fromMoveFloat(float) {
|
|
296
|
-
const mantissa = BigInt(float.mant ?? 0);
|
|
297
|
-
if (mantissa === 0n) {
|
|
298
|
-
return 0;
|
|
299
|
-
}
|
|
300
|
-
const exponent = fromMoveI64(float.exp) - 52;
|
|
301
|
-
const magnitude = Number(mantissa) * 2 ** exponent;
|
|
302
|
-
return float.is_negative ? -magnitude : magnitude;
|
|
303
|
-
}
|
|
304
|
-
function parseCoinType(type) {
|
|
305
|
-
const coinType = parseStructTag(type).typeParams[0];
|
|
306
|
-
if (!coinType) {
|
|
307
|
-
throw new TypeError(`Unable to parse coin type from ${type}`);
|
|
308
|
-
}
|
|
309
|
-
return normalizeStructTag(coinType);
|
|
310
|
-
}
|
|
311
|
-
function normalizeGameDetailValue(valueType, parsed) {
|
|
312
|
-
if (valueType === "float") {
|
|
313
|
-
return fromMoveFloat(parsed);
|
|
314
|
-
}
|
|
315
|
-
if (valueType === "u64") {
|
|
316
|
-
return Number(parsed);
|
|
317
|
-
}
|
|
318
|
-
return parsed;
|
|
319
|
-
}
|
|
320
|
-
function parseStringGameDetail(value) {
|
|
321
|
-
const bytes = Uint8Array.from(value);
|
|
322
|
-
try {
|
|
323
|
-
return bcs.String.parse(bytes);
|
|
324
|
-
} catch {
|
|
325
|
-
return textDecoder.decode(bytes);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
function parseGameDetail(valueType, value) {
|
|
329
|
-
if (valueType === "string") {
|
|
330
|
-
return parseStringGameDetail(value);
|
|
331
|
-
}
|
|
332
|
-
const parsed = GAME_DETAIL_BCS[valueType].parse(Uint8Array.from(value));
|
|
333
|
-
return normalizeGameDetailValue(valueType, parsed);
|
|
334
|
-
}
|
|
335
|
-
function parseGameDetails(gameDetails) {
|
|
336
|
-
return gameDetails.contents.reduce((details, entry) => {
|
|
337
|
-
const valueType = GAME_DETAILS_SCHEMA[entry.key] ?? "string";
|
|
338
|
-
details[entry.key] = parseGameDetail(valueType, entry.value);
|
|
339
|
-
return details;
|
|
340
|
-
}, {});
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
export { DEFAULT_GAS_BUDGET_MIST, DEFAULT_LIMBO_MULTIPLIER_SCALE, DEFAULT_RANGE_SCALE, Float, MoveStruct, RANGE_POINT_LIMIT, fromMoveFloat, fromMoveI64, normalizeMoveArguments, parseCoinType, parseGameDetails, toBigInt, toU16, toU8 };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@mysten/sui/transactions';
|
|
2
|
-
|
|
3
|
-
declare const GAMES: readonly ["coinflip", "limbo", "plinko", "pvp-coinflip", "range", "wheel"];
|
|
4
|
-
type Game = (typeof GAMES)[number];
|
|
5
|
-
type StandardGame = Exclude<Game, PvPGame>;
|
|
6
|
-
type PvPGame = 'pvp-coinflip';
|
|
7
|
-
type CoinSide = 'heads' | 'tails';
|
|
8
|
-
|
|
9
|
-
type BetMetadataPrimitive = string | number | boolean | bigint;
|
|
10
|
-
type BetMetadataValue = BetMetadataPrimitive | Uint8Array | number[];
|
|
11
|
-
type BetMetadataInput = Record<string, BetMetadataValue | null | undefined>;
|
|
12
|
-
|
|
13
|
-
interface SuigarExtensionOptions<Name = 'suigar'> {
|
|
14
|
-
name?: Name;
|
|
15
|
-
/**
|
|
16
|
-
* Partner wallet address injected into bet metadata for attribution.
|
|
17
|
-
*
|
|
18
|
-
* Configure this once when registering the `suigar()` client extension
|
|
19
|
-
* instead of passing partner data through per-transaction metadata.
|
|
20
|
-
*/
|
|
21
|
-
partner?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Cache TTL in milliseconds for SDK-managed on-chain config lookups.
|
|
24
|
-
*
|
|
25
|
-
* Defaults to 30 minutes.
|
|
26
|
-
*/
|
|
27
|
-
cacheTtl?: number;
|
|
28
|
-
}
|
|
29
|
-
type SuigarCoin = 'sui' | 'usdc';
|
|
30
|
-
type SuigarCoinTypes = Record<SuigarCoin, string>;
|
|
31
|
-
type SuigarPackage = 'sweetHouse' | 'core' | 'coinflip' | 'limbo' | 'plinko' | 'pvpCoinflip' | 'range' | 'wheel';
|
|
32
|
-
type SuigarPackageIds = Record<SuigarPackage, string>;
|
|
33
|
-
type SuigarRegistry = 'pvpCoinflip';
|
|
34
|
-
type SuigarRegistryIds = Record<SuigarRegistry, string>;
|
|
35
|
-
type SuigarPriceInfoObjectIds = Record<SuigarCoin, string>;
|
|
36
|
-
type SuigarConfig = {
|
|
37
|
-
packageIds: SuigarPackageIds;
|
|
38
|
-
registryIds: SuigarRegistryIds;
|
|
39
|
-
coinTypes: SuigarCoinTypes;
|
|
40
|
-
priceInfoObjectIds: SuigarPriceInfoObjectIds;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
type WithGasBudget = {
|
|
44
|
-
gasBudget?: Parameters<Transaction['setGasBudgetIfNotSet']>[0];
|
|
45
|
-
};
|
|
46
|
-
type WithThrowOnError<T = object> = T & {
|
|
47
|
-
throwOnError?: boolean;
|
|
48
|
-
};
|
|
49
|
-
type BaseTransactionOptions = WithGasBudget & {
|
|
50
|
-
config: SuigarConfig;
|
|
51
|
-
playerAddress: string;
|
|
52
|
-
};
|
|
53
|
-
type CoinTransactionOptions = {
|
|
54
|
-
coinType: string;
|
|
55
|
-
metadata?: BetMetadataInput;
|
|
56
|
-
allowGasCoinShortcut?: boolean;
|
|
57
|
-
};
|
|
58
|
-
type StakeTransactionOptions = {
|
|
59
|
-
stake: number | bigint;
|
|
60
|
-
cashStake?: number | bigint;
|
|
61
|
-
betCount?: number | bigint;
|
|
62
|
-
};
|
|
63
|
-
type SharedBetTransactionOptions = BaseTransactionOptions & CoinTransactionOptions & StakeTransactionOptions;
|
|
64
|
-
type BuildCoinflipTransactionOptions = SharedBetTransactionOptions & {
|
|
65
|
-
side: CoinSide;
|
|
66
|
-
};
|
|
67
|
-
type BuildLimboTransactionOptions = SharedBetTransactionOptions & {
|
|
68
|
-
targetMultiplier: number;
|
|
69
|
-
scale?: number;
|
|
70
|
-
};
|
|
71
|
-
type BuildPlinkoTransactionOptions = SharedBetTransactionOptions & {
|
|
72
|
-
configId: number;
|
|
73
|
-
};
|
|
74
|
-
type BuildRangeTransactionOptions = SharedBetTransactionOptions & {
|
|
75
|
-
leftPoint: number;
|
|
76
|
-
rightPoint: number;
|
|
77
|
-
outOfRange?: boolean;
|
|
78
|
-
scale?: number;
|
|
79
|
-
};
|
|
80
|
-
type BuildWheelTransactionOptions = SharedBetTransactionOptions & {
|
|
81
|
-
configId: number;
|
|
82
|
-
};
|
|
83
|
-
type PvPCoinflipAction = 'create' | 'join' | 'cancel';
|
|
84
|
-
type SharedPvPCoinflipTransactionOptions = BaseTransactionOptions & CoinTransactionOptions;
|
|
85
|
-
type BuildCreatePvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
86
|
-
stake: StakeTransactionOptions['stake'];
|
|
87
|
-
side: CoinSide;
|
|
88
|
-
isPrivate?: boolean;
|
|
89
|
-
};
|
|
90
|
-
type BuildJoinPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
91
|
-
gameId: string;
|
|
92
|
-
};
|
|
93
|
-
type BuildCancelPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
94
|
-
gameId: string;
|
|
95
|
-
};
|
|
96
|
-
type BuildPvPCoinflipTransactionOptions<Action extends PvPCoinflipAction = PvPCoinflipAction> = Action extends 'create' ? BuildCreatePvPCoinflipTransactionOptions : Action extends 'join' ? BuildJoinPvPCoinflipTransactionOptions : Action extends 'cancel' ? BuildCancelPvPCoinflipTransactionOptions : never;
|
|
97
|
-
|
|
98
|
-
export type { BuildCoinflipTransactionOptions as B, CoinSide as C, Game as G, PvPCoinflipAction as P, StandardGame as S, WithThrowOnError as W, BuildWheelTransactionOptions as a, BuildLimboTransactionOptions as b, BuildPlinkoTransactionOptions as c, BuildRangeTransactionOptions as d, SuigarConfig as e, BuildPvPCoinflipTransactionOptions as f, SuigarExtensionOptions as g, BuildCancelPvPCoinflipTransactionOptions as h, BuildCreatePvPCoinflipTransactionOptions as i, BuildJoinPvPCoinflipTransactionOptions as j };
|
package/dist/games-Da2uZvVJ.d.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@mysten/sui/transactions';
|
|
2
|
-
|
|
3
|
-
declare const GAMES: readonly ["coinflip", "limbo", "plinko", "pvp-coinflip", "range", "wheel"];
|
|
4
|
-
type Game = (typeof GAMES)[number];
|
|
5
|
-
type StandardGame = Exclude<Game, PvPGame>;
|
|
6
|
-
type PvPGame = 'pvp-coinflip';
|
|
7
|
-
type CoinSide = 'heads' | 'tails';
|
|
8
|
-
|
|
9
|
-
type BetMetadataPrimitive = string | number | boolean | bigint;
|
|
10
|
-
type BetMetadataValue = BetMetadataPrimitive | Uint8Array | number[];
|
|
11
|
-
type BetMetadataInput = Record<string, BetMetadataValue | null | undefined>;
|
|
12
|
-
|
|
13
|
-
interface SuigarExtensionOptions<Name = 'suigar'> {
|
|
14
|
-
name?: Name;
|
|
15
|
-
/**
|
|
16
|
-
* Partner wallet address injected into bet metadata for attribution.
|
|
17
|
-
*
|
|
18
|
-
* Configure this once when registering the `suigar()` client extension
|
|
19
|
-
* instead of passing partner data through per-transaction metadata.
|
|
20
|
-
*/
|
|
21
|
-
partner?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Cache TTL in milliseconds for SDK-managed on-chain config lookups.
|
|
24
|
-
*
|
|
25
|
-
* Defaults to 30 minutes.
|
|
26
|
-
*/
|
|
27
|
-
cacheTtl?: number;
|
|
28
|
-
}
|
|
29
|
-
type SuigarCoin = 'sui' | 'usdc';
|
|
30
|
-
type SuigarCoinTypes = Record<SuigarCoin, string>;
|
|
31
|
-
type SuigarPackage = 'sweetHouse' | 'core' | 'coinflip' | 'limbo' | 'plinko' | 'pvpCoinflip' | 'range' | 'wheel';
|
|
32
|
-
type SuigarPackageIds = Record<SuigarPackage, string>;
|
|
33
|
-
type SuigarRegistry = 'pvpCoinflip';
|
|
34
|
-
type SuigarRegistryIds = Record<SuigarRegistry, string>;
|
|
35
|
-
type SuigarPriceInfoObjectIds = Record<SuigarCoin, string>;
|
|
36
|
-
type SuigarConfig = {
|
|
37
|
-
packageIds: SuigarPackageIds;
|
|
38
|
-
registryIds: SuigarRegistryIds;
|
|
39
|
-
coinTypes: SuigarCoinTypes;
|
|
40
|
-
priceInfoObjectIds: SuigarPriceInfoObjectIds;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
type WithGasBudget = {
|
|
44
|
-
gasBudget?: Parameters<Transaction['setGasBudgetIfNotSet']>[0];
|
|
45
|
-
};
|
|
46
|
-
type WithThrowOnError<T = object> = T & {
|
|
47
|
-
throwOnError?: boolean;
|
|
48
|
-
};
|
|
49
|
-
type BaseTransactionOptions = WithGasBudget & {
|
|
50
|
-
config: SuigarConfig;
|
|
51
|
-
playerAddress: string;
|
|
52
|
-
};
|
|
53
|
-
type CoinTransactionOptions = {
|
|
54
|
-
coinType: string;
|
|
55
|
-
metadata?: BetMetadataInput;
|
|
56
|
-
allowGasCoinShortcut?: boolean;
|
|
57
|
-
};
|
|
58
|
-
type StakeTransactionOptions = {
|
|
59
|
-
stake: number | bigint;
|
|
60
|
-
cashStake?: number | bigint;
|
|
61
|
-
betCount?: number | bigint;
|
|
62
|
-
};
|
|
63
|
-
type SharedBetTransactionOptions = BaseTransactionOptions & CoinTransactionOptions & StakeTransactionOptions;
|
|
64
|
-
type BuildCoinflipTransactionOptions = SharedBetTransactionOptions & {
|
|
65
|
-
side: CoinSide;
|
|
66
|
-
};
|
|
67
|
-
type BuildLimboTransactionOptions = SharedBetTransactionOptions & {
|
|
68
|
-
targetMultiplier: number;
|
|
69
|
-
scale?: number;
|
|
70
|
-
};
|
|
71
|
-
type BuildPlinkoTransactionOptions = SharedBetTransactionOptions & {
|
|
72
|
-
configId: number;
|
|
73
|
-
};
|
|
74
|
-
type BuildRangeTransactionOptions = SharedBetTransactionOptions & {
|
|
75
|
-
leftPoint: number;
|
|
76
|
-
rightPoint: number;
|
|
77
|
-
outOfRange?: boolean;
|
|
78
|
-
scale?: number;
|
|
79
|
-
};
|
|
80
|
-
type BuildWheelTransactionOptions = SharedBetTransactionOptions & {
|
|
81
|
-
configId: number;
|
|
82
|
-
};
|
|
83
|
-
type PvPCoinflipAction = 'create' | 'join' | 'cancel';
|
|
84
|
-
type SharedPvPCoinflipTransactionOptions = BaseTransactionOptions & CoinTransactionOptions;
|
|
85
|
-
type BuildCreatePvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
86
|
-
stake: StakeTransactionOptions['stake'];
|
|
87
|
-
side: CoinSide;
|
|
88
|
-
isPrivate?: boolean;
|
|
89
|
-
};
|
|
90
|
-
type BuildJoinPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
91
|
-
gameId: string;
|
|
92
|
-
};
|
|
93
|
-
type BuildCancelPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
94
|
-
gameId: string;
|
|
95
|
-
};
|
|
96
|
-
type BuildPvPCoinflipTransactionOptions<Action extends PvPCoinflipAction = PvPCoinflipAction> = Action extends 'create' ? BuildCreatePvPCoinflipTransactionOptions : Action extends 'join' ? BuildJoinPvPCoinflipTransactionOptions : Action extends 'cancel' ? BuildCancelPvPCoinflipTransactionOptions : never;
|
|
97
|
-
|
|
98
|
-
export type { BuildCoinflipTransactionOptions as B, CoinSide as C, Game as G, PvPCoinflipAction as P, StandardGame as S, WithThrowOnError as W, BuildWheelTransactionOptions as a, BuildLimboTransactionOptions as b, BuildPlinkoTransactionOptions as c, BuildRangeTransactionOptions as d, SuigarConfig as e, BuildPvPCoinflipTransactionOptions as f, SuigarExtensionOptions as g, BuildCancelPvPCoinflipTransactionOptions as h, BuildCreatePvPCoinflipTransactionOptions as i, BuildJoinPvPCoinflipTransactionOptions as j };
|
package/dist/games.cjs
DELETED
package/dist/games.d.cts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { h as BuildCancelPvPCoinflipTransactionOptions, B as BuildCoinflipTransactionOptions, i as BuildCreatePvPCoinflipTransactionOptions, j as BuildJoinPvPCoinflipTransactionOptions, b as BuildLimboTransactionOptions, c as BuildPlinkoTransactionOptions, d as BuildRangeTransactionOptions, a as BuildWheelTransactionOptions, C as CoinSide, P as PvPCoinflipAction } from './games-Da2uZvVJ.cjs';
|
|
2
|
-
import '@mysten/sui/transactions';
|
package/dist/games.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { h as BuildCancelPvPCoinflipTransactionOptions, B as BuildCoinflipTransactionOptions, i as BuildCreatePvPCoinflipTransactionOptions, j as BuildJoinPvPCoinflipTransactionOptions, b as BuildLimboTransactionOptions, c as BuildPlinkoTransactionOptions, d as BuildRangeTransactionOptions, a as BuildWheelTransactionOptions, C as CoinSide, P as PvPCoinflipAction } from './games-Da2uZvVJ.js';
|
|
2
|
-
import '@mysten/sui/transactions';
|
package/dist/games.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { BcsType, BcsStruct } from '@mysten/sui/bcs';
|
|
2
|
-
import { SuiClientTypes, ClientWithCoreApi } from '@mysten/sui/client';
|
|
3
|
-
|
|
4
|
-
type GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> = SuiClientTypes.GetObjectOptions<Include> & {
|
|
5
|
-
client: ClientWithCoreApi;
|
|
6
|
-
};
|
|
7
|
-
type GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> = SuiClientTypes.GetObjectsOptions<Include> & {
|
|
8
|
-
client: ClientWithCoreApi;
|
|
9
|
-
};
|
|
10
|
-
declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
|
|
11
|
-
get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ objectId, ...options }: GetOptions<Include>): Promise<SuiClientTypes.Object<Include & {
|
|
12
|
-
content: true;
|
|
13
|
-
json: true;
|
|
14
|
-
}> & {
|
|
15
|
-
json: BcsStruct<T>['$inferType'];
|
|
16
|
-
}>;
|
|
17
|
-
getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ client, ...options }: GetManyOptions<Include>): Promise<Array<SuiClientTypes.Object<Include & {
|
|
18
|
-
content: true;
|
|
19
|
-
json: true;
|
|
20
|
-
}> & {
|
|
21
|
-
json: BcsStruct<T>['$inferType'];
|
|
22
|
-
}>>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { MoveStruct as M };
|
package/dist/index-3P_LBbDM.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { BcsType, BcsStruct } from '@mysten/sui/bcs';
|
|
2
|
-
import { SuiClientTypes, ClientWithCoreApi } from '@mysten/sui/client';
|
|
3
|
-
|
|
4
|
-
type GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> = SuiClientTypes.GetObjectOptions<Include> & {
|
|
5
|
-
client: ClientWithCoreApi;
|
|
6
|
-
};
|
|
7
|
-
type GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> = SuiClientTypes.GetObjectsOptions<Include> & {
|
|
8
|
-
client: ClientWithCoreApi;
|
|
9
|
-
};
|
|
10
|
-
declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
|
|
11
|
-
get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ objectId, ...options }: GetOptions<Include>): Promise<SuiClientTypes.Object<Include & {
|
|
12
|
-
content: true;
|
|
13
|
-
json: true;
|
|
14
|
-
}> & {
|
|
15
|
-
json: BcsStruct<T>['$inferType'];
|
|
16
|
-
}>;
|
|
17
|
-
getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ client, ...options }: GetManyOptions<Include>): Promise<Array<SuiClientTypes.Object<Include & {
|
|
18
|
-
content: true;
|
|
19
|
-
json: true;
|
|
20
|
-
}> & {
|
|
21
|
-
json: BcsStruct<T>['$inferType'];
|
|
22
|
-
}>>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { MoveStruct as M };
|