@gardenfi/swap 0.0.2-beta.2 → 0.0.2-beta.4
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/dist/index104.cjs +1 -1
- package/dist/index104.js +4 -4
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +3 -3
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +3 -3
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +12 -12
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +2 -2
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +7 -7
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +1 -1
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +1 -1
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +1 -1
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +1 -1
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +2 -2
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +2 -2
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +1 -1
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +2 -2
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +2 -2
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +2 -2
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +2 -2
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +2 -2
- package/dist/index272.cjs +1 -1
- package/dist/index272.js +9 -174
- package/dist/index273.cjs +1 -2
- package/dist/index273.js +30 -91
- package/dist/index274.cjs +1 -1
- package/dist/index274.js +2 -41
- package/dist/index275.cjs +1 -1
- package/dist/index275.js +47 -4
- package/dist/index276.cjs +1 -1
- package/dist/index276.js +11 -9
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +174 -30
- package/dist/index278.cjs +2 -1
- package/dist/index278.js +92 -2
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +38 -45
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +4 -11
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +3 -3
- package/dist/index283.cjs +1 -2
- package/dist/index283.js +42 -41
- package/dist/index284.cjs +1 -1
- package/dist/index284.js +321 -2
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +605 -5
- package/dist/index286.cjs +1 -1
- package/dist/index286.js +109 -10
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +167 -19
- package/dist/index288.cjs +1 -1
- package/dist/index288.js +301 -8
- package/dist/index289.cjs +1 -1
- package/dist/index289.js +93 -72
- package/dist/index290.cjs +1 -1
- package/dist/index290.js +54 -63
- package/dist/index291.cjs +1 -1
- package/dist/index291.js +51 -186
- package/dist/index292.cjs +1 -1
- package/dist/index292.js +42 -20
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +14 -41
- package/dist/index294.cjs +1 -1
- package/dist/index294.js +315 -23
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +57 -88
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +19 -40
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +28 -15
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +3 -13
- package/dist/index299.cjs +7 -1
- package/dist/index299.js +237 -7
- package/dist/index300.cjs +1 -1
- package/dist/index300.js +48 -38
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +211 -14
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +77 -38
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +25 -316
- package/dist/index304.cjs +1 -1
- package/dist/index304.js +73 -602
- package/dist/index305.cjs +2 -1
- package/dist/index305.js +41 -109
- package/dist/index306.cjs +1 -1
- package/dist/index306.js +2 -168
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +5 -301
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +10 -93
- package/dist/index309.cjs +1 -1
- package/dist/index309.js +18 -55
- package/dist/index310.cjs +1 -1
- package/dist/index310.js +8 -53
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +72 -44
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +64 -14
- package/dist/index313.cjs +1 -1
- package/dist/index313.js +184 -313
- package/dist/index314.cjs +1 -1
- package/dist/index314.js +19 -56
- package/dist/index315.cjs +1 -1
- package/dist/index315.js +42 -19
- package/dist/index316.cjs +1 -1
- package/dist/index316.js +23 -27
- package/dist/index317.cjs +1 -1
- package/dist/index317.js +90 -3
- package/dist/index318.cjs +1 -7
- package/dist/index318.js +33 -230
- package/dist/index319.cjs +1 -1
- package/dist/index319.js +17 -48
- package/dist/index320.cjs +1 -1
- package/dist/index320.js +11 -210
- package/dist/index321.cjs +1 -1
- package/dist/index321.js +7 -81
- package/dist/index322.cjs +1 -1
- package/dist/index322.js +36 -28
- package/dist/index323.cjs +1 -1
- package/dist/index323.js +15 -76
- package/dist/index326.cjs +1 -1
- package/dist/index326.js +1 -1
- package/dist/index327.cjs +1 -1
- package/dist/index327.js +1 -1
- package/dist/index333.cjs +1 -1
- package/dist/index333.js +2 -2
- package/dist/index334.cjs +1 -1
- package/dist/index334.js +2 -2
- package/dist/index340.cjs +1 -1
- package/dist/index340.js +1 -1
- package/dist/index341.cjs +1 -1
- package/dist/index341.js +1 -1
- package/dist/index343.cjs +1 -1
- package/dist/index343.js +1 -1
- package/dist/index346.cjs +1 -1
- package/dist/index346.js +1 -1
- package/dist/index347.cjs +1 -1
- package/dist/index347.js +1 -1
- package/dist/index348.cjs +1 -1
- package/dist/index348.js +3 -3
- package/dist/index349.cjs +1 -2
- package/dist/index349.js +4 -193
- package/dist/index350.cjs +2 -1
- package/dist/index350.js +168 -52
- package/dist/index351.cjs +1 -1
- package/dist/index351.js +65 -331
- package/dist/index352.cjs +1 -1
- package/dist/index352.js +332 -149
- package/dist/index353.cjs +1 -1
- package/dist/index353.js +161 -5
- package/dist/index354.cjs +1 -1
- package/dist/index354.js +5 -5
- package/dist/index357.cjs +1 -1
- package/dist/index357.js +8 -205
- package/dist/index359.cjs +1 -1
- package/dist/index359.js +205 -8
- package/dist/index360.cjs +1 -1
- package/dist/index360.js +94 -68
- package/dist/index361.cjs +1 -1
- package/dist/index361.js +28 -94
- package/dist/index362.cjs +1 -1
- package/dist/index362.js +147 -27
- package/dist/index363.cjs +1 -1
- package/dist/index363.js +324 -118
- package/dist/index364.cjs +1 -1
- package/dist/index364.js +72 -353
- package/dist/index365.cjs +1 -1
- package/dist/index365.js +29 -71
- package/dist/index366.cjs +1 -1
- package/dist/index366.js +5 -31
- package/dist/index367.cjs +1 -1
- package/dist/index367.js +275 -5
- package/dist/index368.cjs +1 -1
- package/dist/index368.js +171 -4
- package/dist/index369.cjs +1 -1
- package/dist/index369.js +10 -141
- package/dist/index370.cjs +1 -1
- package/dist/index370.js +105 -273
- package/dist/index371.cjs +1 -1
- package/dist/index371.js +10 -171
- package/dist/index372.cjs +1 -1
- package/dist/index372.js +69 -10
- package/dist/index373.cjs +1 -1
- package/dist/index373.js +3 -107
- package/dist/index374.cjs +1 -1
- package/dist/index374.js +140 -9
- package/dist/index375.cjs +1 -1
- package/dist/index375.js +4 -4
- package/dist/index376.cjs +1 -1
- package/dist/index376.js +2 -79
- package/dist/index377.cjs +1 -1
- package/dist/index377.js +79 -2
- package/dist/index379.cjs +1 -1
- package/dist/index379.js +1 -1
- package/dist/index380.cjs +1 -1
- package/dist/index380.js +1 -1
- package/dist/index381.cjs +1 -1
- package/dist/index381.js +2 -22
- package/dist/index382.cjs +1 -1
- package/dist/index382.js +22 -2
- package/dist/index385.cjs +1 -1
- package/dist/index385.js +2 -2
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +13 -13
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +1 -1
- package/dist/src/lib/store/swapStore.d.ts +1 -1
- package/package.json +5 -5
package/dist/index289.js
CHANGED
|
@@ -1,75 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import { object as e, optional as i, array as n, nullish as g, literal as b, nullable as o, string as s, union as O, boolean as v, unknown as S, record as j, tuple as I, pipe as l, integer as u, number as d } from "./index285.js";
|
|
2
|
+
import { SuiAddress as h, ObjectRefSchema as m, JsonU64 as r, ObjectID as a, BCSBytes as p } from "./index287.js";
|
|
3
|
+
function c(C) {
|
|
4
|
+
return O(
|
|
5
|
+
Object.entries(C).map(([f, y]) => e({ [f]: y }))
|
|
6
|
+
);
|
|
5
7
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
8
|
+
const t = c({
|
|
9
|
+
GasCoin: b(!0),
|
|
10
|
+
Input: l(d(), u()),
|
|
11
|
+
Result: l(d(), u()),
|
|
12
|
+
NestedResult: I([l(d(), u()), l(d(), u())])
|
|
13
|
+
}), k = e({
|
|
14
|
+
budget: o(r),
|
|
15
|
+
price: o(r),
|
|
16
|
+
owner: o(h),
|
|
17
|
+
payment: o(n(m))
|
|
18
|
+
}), A = e({
|
|
19
|
+
package: a,
|
|
20
|
+
module: s(),
|
|
21
|
+
function: s(),
|
|
22
|
+
// snake case in rust
|
|
23
|
+
typeArguments: n(s()),
|
|
24
|
+
arguments: n(t)
|
|
25
|
+
}), M = e({
|
|
26
|
+
name: s(),
|
|
27
|
+
inputs: j(s(), O([t, n(t)])),
|
|
28
|
+
data: j(s(), S())
|
|
29
|
+
}), U = c({
|
|
30
|
+
MoveCall: A,
|
|
31
|
+
TransferObjects: e({
|
|
32
|
+
objects: n(t),
|
|
33
|
+
address: t
|
|
34
|
+
}),
|
|
35
|
+
SplitCoins: e({
|
|
36
|
+
coin: t,
|
|
37
|
+
amounts: n(t)
|
|
38
|
+
}),
|
|
39
|
+
MergeCoins: e({
|
|
40
|
+
destination: t,
|
|
41
|
+
sources: n(t)
|
|
42
|
+
}),
|
|
43
|
+
Publish: e({
|
|
44
|
+
modules: n(p),
|
|
45
|
+
dependencies: n(a)
|
|
46
|
+
}),
|
|
47
|
+
MakeMoveVec: e({
|
|
48
|
+
type: o(s()),
|
|
49
|
+
elements: n(t)
|
|
50
|
+
}),
|
|
51
|
+
Upgrade: e({
|
|
52
|
+
modules: n(p),
|
|
53
|
+
dependencies: n(a),
|
|
54
|
+
package: a,
|
|
55
|
+
ticket: t
|
|
56
|
+
}),
|
|
57
|
+
$Intent: M
|
|
58
|
+
}), D = c({
|
|
59
|
+
ImmOrOwnedObject: m,
|
|
60
|
+
SharedObject: e({
|
|
61
|
+
objectId: a,
|
|
62
|
+
// snake case in rust
|
|
63
|
+
initialSharedVersion: r,
|
|
64
|
+
mutable: v()
|
|
65
|
+
}),
|
|
66
|
+
Receiving: m
|
|
67
|
+
}), P = c({
|
|
68
|
+
Object: D,
|
|
69
|
+
Pure: e({
|
|
70
|
+
bytes: p
|
|
71
|
+
}),
|
|
72
|
+
UnresolvedPure: e({
|
|
73
|
+
value: S()
|
|
74
|
+
}),
|
|
75
|
+
UnresolvedObject: e({
|
|
76
|
+
objectId: a,
|
|
77
|
+
version: i(o(r)),
|
|
78
|
+
digest: i(o(s())),
|
|
79
|
+
initialSharedVersion: i(o(r)),
|
|
80
|
+
mutable: i(o(v()))
|
|
81
|
+
})
|
|
82
|
+
}), R = c({
|
|
83
|
+
None: b(!0),
|
|
84
|
+
Epoch: r
|
|
85
|
+
}), x = e({
|
|
86
|
+
version: b(2),
|
|
87
|
+
sender: g(h),
|
|
88
|
+
expiration: g(R),
|
|
89
|
+
gasData: k,
|
|
90
|
+
inputs: n(P),
|
|
91
|
+
commands: n(U),
|
|
92
|
+
digest: i(o(s()))
|
|
93
|
+
});
|
|
58
94
|
export {
|
|
59
|
-
|
|
60
|
-
y as execConstructorSignature,
|
|
61
|
-
S as execErrorSignature,
|
|
62
|
-
f as execEventSignature,
|
|
63
|
-
v as execFallbackSignature,
|
|
64
|
-
p as execFunctionSignature,
|
|
65
|
-
$ as execStructSignature,
|
|
66
|
-
Z as functionModifiers,
|
|
67
|
-
b as isConstructorSignature,
|
|
68
|
-
g as isErrorSignature,
|
|
69
|
-
l as isEventSignature,
|
|
70
|
-
d as isFallbackSignature,
|
|
71
|
-
x as isFunctionSignature,
|
|
72
|
-
z as isReceiveSignature,
|
|
73
|
-
m as isStructSignature,
|
|
74
|
-
A as modifiers
|
|
95
|
+
x as SerializedTransactionDataV2Schema
|
|
75
96
|
};
|
package/dist/index290.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index114.cjs"),n=require("./index117.cjs");function c(e){return{$kind:"Pure",Pure:{bytes:e instanceof Uint8Array?i.toBase64(e):e.toBase64()}}}const d={Pure:c,ObjectRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{digest:t,version:r,objectId:n.normalizeSuiAddress(e)}}}},SharedObjectRef({objectId:e,mutable:t,initialSharedVersion:r}){return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{mutable:t,initialSharedVersion:r,objectId:n.normalizeSuiAddress(e)}}}},ReceivingRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{digest:t,version:r,objectId:n.normalizeSuiAddress(e)}}}}};exports.Inputs=d;
|
package/dist/index290.js
CHANGED
|
@@ -1,68 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function C(s) {
|
|
9
|
-
const n = {}, c = s.length;
|
|
10
|
-
for (let t = 0; t < c; t++) {
|
|
11
|
-
const i = s[t];
|
|
12
|
-
if (!E(i))
|
|
13
|
-
continue;
|
|
14
|
-
const r = b(i);
|
|
15
|
-
if (!r)
|
|
16
|
-
throw new T({ signature: i, type: "struct" });
|
|
17
|
-
const u = r.properties.split(";"), e = [], h = u.length;
|
|
18
|
-
for (let l = 0; l < h; l++) {
|
|
19
|
-
const m = u[l].trim();
|
|
20
|
-
if (!m)
|
|
21
|
-
continue;
|
|
22
|
-
const y = A(m, {
|
|
23
|
-
type: "struct"
|
|
24
|
-
});
|
|
25
|
-
e.push(y);
|
|
1
|
+
import { toBase64 as c } from "./index114.js";
|
|
2
|
+
import { normalizeSuiAddress as n } from "./index117.js";
|
|
3
|
+
function i(e) {
|
|
4
|
+
return {
|
|
5
|
+
$kind: "Pure",
|
|
6
|
+
Pure: {
|
|
7
|
+
bytes: e instanceof Uint8Array ? c(e) : e.toBase64()
|
|
26
8
|
}
|
|
27
|
-
|
|
28
|
-
throw new v({ signature: i });
|
|
29
|
-
n[r.name] = e;
|
|
30
|
-
}
|
|
31
|
-
const o = {}, a = Object.entries(n), p = a.length;
|
|
32
|
-
for (let t = 0; t < p; t++) {
|
|
33
|
-
const [i, r] = a[t];
|
|
34
|
-
o[i] = f(r, n);
|
|
35
|
-
}
|
|
36
|
-
return o;
|
|
9
|
+
};
|
|
37
10
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
11
|
+
const d = {
|
|
12
|
+
Pure: i,
|
|
13
|
+
ObjectRef({ objectId: e, digest: t, version: r }) {
|
|
14
|
+
return {
|
|
15
|
+
$kind: "Object",
|
|
16
|
+
Object: {
|
|
17
|
+
$kind: "ImmOrOwnedObject",
|
|
18
|
+
ImmOrOwnedObject: {
|
|
19
|
+
digest: t,
|
|
20
|
+
version: r,
|
|
21
|
+
objectId: n(e)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
SharedObjectRef({
|
|
27
|
+
objectId: e,
|
|
28
|
+
mutable: t,
|
|
29
|
+
initialSharedVersion: r
|
|
30
|
+
}) {
|
|
31
|
+
return {
|
|
32
|
+
$kind: "Object",
|
|
33
|
+
Object: {
|
|
34
|
+
$kind: "SharedObject",
|
|
35
|
+
SharedObject: {
|
|
36
|
+
mutable: t,
|
|
37
|
+
initialSharedVersion: r,
|
|
38
|
+
objectId: n(e)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
ReceivingRef({ objectId: e, digest: t, version: r }) {
|
|
44
|
+
return {
|
|
45
|
+
$kind: "Object",
|
|
46
|
+
Object: {
|
|
47
|
+
$kind: "Receiving",
|
|
48
|
+
Receiving: {
|
|
49
|
+
digest: t,
|
|
50
|
+
version: r,
|
|
51
|
+
objectId: n(e)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
63
55
|
}
|
|
64
|
-
|
|
65
|
-
}
|
|
56
|
+
};
|
|
66
57
|
export {
|
|
67
|
-
|
|
58
|
+
d as Inputs
|
|
68
59
|
};
|
package/dist/index291.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index290.cjs"),t=require("./index300.cjs"),d=require("./index301.cjs");function c(e,n){return!!(e.inputs.some(r=>r.UnresolvedObject||r.UnresolvedPure)||!n.onlyTransactionKind&&(!e.gasConfig.price||!e.gasConfig.budget||!e.gasConfig.payment))}async function a(e,n,r){var s;if(g(e),!c(e,n))return await o(e),r();const i=l(n);return(((s=i.core)==null?void 0:s.resolveTransactionPlugin())??d.jsonRpcClientResolveTransactionPlugin(i))(e,n,async()=>{await o(e),await r()})}function o(e){e.inputs.forEach((n,r)=>{if(n.$kind!=="Object"&&n.$kind!=="Pure")throw new Error(`Input at index ${r} has not been resolved. Expected a Pure or Object input, but found ${JSON.stringify(n)}`)})}function l(e){if(!e.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return e.client}function g(e){for(const n of e.commands)switch(n.$kind){case"SplitCoins":n.SplitCoins.amounts.forEach(r=>{u(r,t.bcs.U64,e)});break;case"TransferObjects":u(n.TransferObjects.address,t.bcs.Address,e);break}}function u(e,n,r){if(e.$kind!=="Input")return;const i=r.inputs[e.Input];i.$kind==="UnresolvedPure"&&(r.inputs[e.Input]=f.Inputs.Pure(n.serialize(i.UnresolvedPure.value)))}exports.getClient=l;exports.needsTransactionResolution=c;exports.resolveTransactionPlugin=a;
|
package/dist/index291.js
CHANGED
|
@@ -1,191 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
type: "function"
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
name: n.name,
|
|
49
|
-
type: "function",
|
|
50
|
-
stateMutability: n.stateMutability ?? "nonpayable",
|
|
51
|
-
inputs: r,
|
|
52
|
-
outputs: i
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function H(e, t = {}) {
|
|
56
|
-
const n = D(e);
|
|
57
|
-
if (!n)
|
|
58
|
-
throw new m({ signature: e, type: "event" });
|
|
59
|
-
const a = u(n.parameters), r = [], c = a.length;
|
|
60
|
-
for (let i = 0; i < c; i++)
|
|
61
|
-
r.push(l(a[i], {
|
|
62
|
-
modifiers: V,
|
|
63
|
-
structs: t,
|
|
64
|
-
type: "event"
|
|
65
|
-
}));
|
|
66
|
-
return { name: n.name, type: "event", inputs: r };
|
|
67
|
-
}
|
|
68
|
-
function J(e, t = {}) {
|
|
69
|
-
const n = j(e);
|
|
70
|
-
if (!n)
|
|
71
|
-
throw new m({ signature: e, type: "error" });
|
|
72
|
-
const a = u(n.parameters), r = [], c = a.length;
|
|
73
|
-
for (let i = 0; i < c; i++)
|
|
74
|
-
r.push(l(a[i], { structs: t, type: "error" }));
|
|
75
|
-
return { name: n.name, type: "error", inputs: r };
|
|
76
|
-
}
|
|
77
|
-
function N(e, t = {}) {
|
|
78
|
-
const n = q(e);
|
|
79
|
-
if (!n)
|
|
80
|
-
throw new m({ signature: e, type: "constructor" });
|
|
81
|
-
const a = u(n.parameters), r = [], c = a.length;
|
|
82
|
-
for (let i = 0; i < c; i++)
|
|
83
|
-
r.push(l(a[i], { structs: t, type: "constructor" }));
|
|
84
|
-
return {
|
|
85
|
-
type: "constructor",
|
|
86
|
-
stateMutability: n.stateMutability ?? "nonpayable",
|
|
87
|
-
inputs: r
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function O(e) {
|
|
91
|
-
const t = B(e);
|
|
92
|
-
if (!t)
|
|
93
|
-
throw new m({ signature: e, type: "fallback" });
|
|
94
|
-
return {
|
|
95
|
-
type: "fallback",
|
|
96
|
-
stateMutability: t.stateMutability ?? "nonpayable"
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
const Q = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, X = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, Y = /^u?int$/;
|
|
100
|
-
function l(e, t) {
|
|
101
|
-
var y, b;
|
|
102
|
-
const n = _(e, t == null ? void 0 : t.type, t == null ? void 0 : t.structs);
|
|
103
|
-
if (p.has(n))
|
|
104
|
-
return p.get(n);
|
|
105
|
-
const a = P.test(e), r = E(a ? X : Q, e);
|
|
106
|
-
if (!r)
|
|
107
|
-
throw new R({ param: e });
|
|
108
|
-
if (r.name && re(r.name))
|
|
109
|
-
throw new k({ param: e, name: r.name });
|
|
110
|
-
const c = r.name ? { name: r.name } : {}, i = r.modifier === "indexed" ? { indexed: !0 } : {}, o = (t == null ? void 0 : t.structs) ?? {};
|
|
111
|
-
let s, f = {};
|
|
112
|
-
if (a) {
|
|
113
|
-
s = "tuple";
|
|
114
|
-
const w = u(r.type), S = [], v = w.length;
|
|
115
|
-
for (let d = 0; d < v; d++)
|
|
116
|
-
S.push(l(w[d], { structs: o }));
|
|
117
|
-
f = { components: S };
|
|
118
|
-
} else if (r.type in o)
|
|
119
|
-
s = "tuple", f = { components: o[r.type] };
|
|
120
|
-
else if (Y.test(r.type))
|
|
121
|
-
s = `${r.type}256`;
|
|
122
|
-
else if (r.type === "address payable")
|
|
123
|
-
s = "address";
|
|
124
|
-
else if (s = r.type, (t == null ? void 0 : t.type) !== "struct" && !ee(s))
|
|
125
|
-
throw new M({ type: s });
|
|
126
|
-
if (r.modifier) {
|
|
127
|
-
if (!((b = (y = t == null ? void 0 : t.modifiers) == null ? void 0 : y.has) != null && b.call(y, r.modifier)))
|
|
128
|
-
throw new z({
|
|
129
|
-
param: e,
|
|
130
|
-
type: t == null ? void 0 : t.type,
|
|
131
|
-
modifier: r.modifier
|
|
132
|
-
});
|
|
133
|
-
if (h.has(r.modifier) && !ne(s, !!r.array))
|
|
134
|
-
throw new A({
|
|
135
|
-
param: e,
|
|
136
|
-
type: t == null ? void 0 : t.type,
|
|
137
|
-
modifier: r.modifier
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
const g = {
|
|
141
|
-
type: `${s}${r.array ?? ""}`,
|
|
142
|
-
...c,
|
|
143
|
-
...i,
|
|
144
|
-
...f
|
|
145
|
-
};
|
|
146
|
-
return p.set(n, g), g;
|
|
147
|
-
}
|
|
148
|
-
function u(e, t = [], n = "", a = 0) {
|
|
149
|
-
const r = e.trim().length;
|
|
150
|
-
for (let c = 0; c < r; c++) {
|
|
151
|
-
const i = e[c], o = e.slice(c + 1);
|
|
152
|
-
switch (i) {
|
|
153
|
-
case ",":
|
|
154
|
-
return a === 0 ? u(o, [...t, n.trim()]) : u(o, t, `${n}${i}`, a);
|
|
155
|
-
case "(":
|
|
156
|
-
return u(o, t, `${n}${i}`, a + 1);
|
|
157
|
-
case ")":
|
|
158
|
-
return u(o, t, `${n}${i}`, a - 1);
|
|
159
|
-
default:
|
|
160
|
-
return u(o, t, `${n}${i}`, a);
|
|
1
|
+
import { Inputs as c } from "./index290.js";
|
|
2
|
+
import { bcs as o } from "./index300.js";
|
|
3
|
+
import { jsonRpcClientResolveTransactionPlugin as f } from "./index301.js";
|
|
4
|
+
function l(n, e) {
|
|
5
|
+
return !!(n.inputs.some((r) => r.UnresolvedObject || r.UnresolvedPure) || !e.onlyTransactionKind && (!n.gasConfig.price || !n.gasConfig.budget || !n.gasConfig.payment));
|
|
6
|
+
}
|
|
7
|
+
async function w(n, e, r) {
|
|
8
|
+
var s;
|
|
9
|
+
if (a(n), !l(n, e))
|
|
10
|
+
return await t(n), r();
|
|
11
|
+
const i = d(e);
|
|
12
|
+
return (((s = i.core) == null ? void 0 : s.resolveTransactionPlugin()) ?? f(i))(n, e, async () => {
|
|
13
|
+
await t(n), await r();
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function t(n) {
|
|
17
|
+
n.inputs.forEach((e, r) => {
|
|
18
|
+
if (e.$kind !== "Object" && e.$kind !== "Pure")
|
|
19
|
+
throw new Error(
|
|
20
|
+
`Input at index ${r} has not been resolved. Expected a Pure or Object input, but found ${JSON.stringify(
|
|
21
|
+
e
|
|
22
|
+
)}`
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function d(n) {
|
|
27
|
+
if (!n.client)
|
|
28
|
+
throw new Error(
|
|
29
|
+
"No sui client passed to Transaction#build, but transaction data was not sufficient to build offline."
|
|
30
|
+
);
|
|
31
|
+
return n.client;
|
|
32
|
+
}
|
|
33
|
+
function a(n) {
|
|
34
|
+
for (const e of n.commands)
|
|
35
|
+
switch (e.$kind) {
|
|
36
|
+
case "SplitCoins":
|
|
37
|
+
e.SplitCoins.amounts.forEach((r) => {
|
|
38
|
+
u(r, o.U64, n);
|
|
39
|
+
});
|
|
40
|
+
break;
|
|
41
|
+
case "TransferObjects":
|
|
42
|
+
u(e.TransferObjects.address, o.Address, n);
|
|
43
|
+
break;
|
|
161
44
|
}
|
|
162
|
-
}
|
|
163
|
-
if (n === "")
|
|
164
|
-
return t;
|
|
165
|
-
if (a !== 0)
|
|
166
|
-
throw new T({ current: n, depth: a });
|
|
167
|
-
return t.push(n.trim()), t;
|
|
168
|
-
}
|
|
169
|
-
function ee(e) {
|
|
170
|
-
return e === "address" || e === "bool" || e === "function" || e === "string" || x.test(e) || $.test(e);
|
|
171
|
-
}
|
|
172
|
-
const te = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;
|
|
173
|
-
function re(e) {
|
|
174
|
-
return e === "address" || e === "bool" || e === "function" || e === "string" || e === "tuple" || x.test(e) || $.test(e) || te.test(e);
|
|
175
45
|
}
|
|
176
|
-
function
|
|
177
|
-
|
|
46
|
+
function u(n, e, r) {
|
|
47
|
+
if (n.$kind !== "Input")
|
|
48
|
+
return;
|
|
49
|
+
const i = r.inputs[n.Input];
|
|
50
|
+
i.$kind === "UnresolvedPure" && (r.inputs[n.Input] = c.Pure(e.serialize(i.UnresolvedPure.value)));
|
|
178
51
|
}
|
|
179
52
|
export {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
l as parseAbiParameter,
|
|
184
|
-
N as parseConstructorSignature,
|
|
185
|
-
J as parseErrorSignature,
|
|
186
|
-
H as parseEventSignature,
|
|
187
|
-
O as parseFallbackSignature,
|
|
188
|
-
G as parseFunctionSignature,
|
|
189
|
-
le as parseSignature,
|
|
190
|
-
u as splitParameters
|
|
53
|
+
d as getClient,
|
|
54
|
+
l as needsTransactionResolution,
|
|
55
|
+
w as resolveTransactionPlugin
|
|
191
56
|
};
|
package/dist/index292.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index290.cjs");function b(d){function e(t){return d(t)}return e.system=t=>{const r=t==null?void 0:t.mutable;return e(r!==void 0?c.Inputs.SharedObjectRef({objectId:"0x5",initialSharedVersion:1,mutable:r}):{$kind:"UnresolvedObject",UnresolvedObject:{objectId:"0x5",initialSharedVersion:1}})},e.clock=()=>e(c.Inputs.SharedObjectRef({objectId:"0x6",initialSharedVersion:1,mutable:!1})),e.random=()=>e({$kind:"UnresolvedObject",UnresolvedObject:{objectId:"0x8",mutable:!1}}),e.denyList=t=>e({$kind:"UnresolvedObject",UnresolvedObject:{objectId:"0x403",mutable:t==null?void 0:t.mutable}}),e.option=({type:t,value:r})=>n=>n.moveCall({typeArguments:[t],target:`0x1::option::${r===null?"none":"some"}`,arguments:r===null?[]:[n.object(r)]}),e}exports.createObjectMethods=b;
|
package/dist/index292.js
CHANGED
|
@@ -1,25 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { Inputs as d } from "./index290.js";
|
|
2
|
+
function l(b) {
|
|
3
|
+
function e(t) {
|
|
4
|
+
return b(t);
|
|
5
|
+
}
|
|
6
|
+
return e.system = (t) => {
|
|
7
|
+
const r = t == null ? void 0 : t.mutable;
|
|
8
|
+
return e(
|
|
9
|
+
r !== void 0 ? d.SharedObjectRef({
|
|
10
|
+
objectId: "0x5",
|
|
11
|
+
initialSharedVersion: 1,
|
|
12
|
+
mutable: r
|
|
13
|
+
}) : {
|
|
14
|
+
$kind: "UnresolvedObject",
|
|
15
|
+
UnresolvedObject: {
|
|
16
|
+
objectId: "0x5",
|
|
17
|
+
initialSharedVersion: 1
|
|
18
|
+
}
|
|
16
19
|
}
|
|
20
|
+
);
|
|
21
|
+
}, e.clock = () => e(
|
|
22
|
+
d.SharedObjectRef({
|
|
23
|
+
objectId: "0x6",
|
|
24
|
+
initialSharedVersion: 1,
|
|
25
|
+
mutable: !1
|
|
26
|
+
})
|
|
27
|
+
), e.random = () => e({
|
|
28
|
+
$kind: "UnresolvedObject",
|
|
29
|
+
UnresolvedObject: {
|
|
30
|
+
objectId: "0x8",
|
|
31
|
+
mutable: !1
|
|
17
32
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
}), e.denyList = (t) => e({
|
|
34
|
+
$kind: "UnresolvedObject",
|
|
35
|
+
UnresolvedObject: {
|
|
36
|
+
objectId: "0x403",
|
|
37
|
+
mutable: t == null ? void 0 : t.mutable
|
|
38
|
+
}
|
|
39
|
+
}), e.option = ({ type: t, value: r }) => (n) => n.moveCall({
|
|
40
|
+
typeArguments: [t],
|
|
41
|
+
target: `0x1::option::${r === null ? "none" : "some"}`,
|
|
42
|
+
arguments: r === null ? [] : [n.object(r)]
|
|
43
|
+
}), e;
|
|
22
44
|
}
|
|
23
45
|
export {
|
|
24
|
-
|
|
46
|
+
l as createObjectMethods
|
|
25
47
|
};
|