@layerzerolabs/common-suimove 1.2.68 → 1.2.70
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/2RWPJSYR.js +11 -0
- package/dist/2RWPJSYR.js.map +1 -0
- package/dist/DMFKLZKD.js +3 -0
- package/dist/DMFKLZKD.js.map +1 -0
- package/dist/JZMKCXBO.js +25 -0
- package/dist/JZMKCXBO.js.map +1 -0
- package/dist/QRJFMNTB.js +3 -0
- package/dist/QRJFMNTB.js.map +1 -0
- package/dist/UWX3Y5ZB.js +273 -0
- package/dist/UWX3Y5ZB.js.map +1 -0
- package/dist/VABOX5FT.js +22 -0
- package/dist/VABOX5FT.js.map +1 -0
- package/dist/VUOMXK5T.js +6 -0
- package/dist/VUOMXK5T.js.map +1 -0
- package/dist/Y5EOMP5J.js +3 -0
- package/dist/Y5EOMP5J.js.map +1 -0
- package/dist/error.d.ts +7 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +4 -0
- package/dist/error.js.map +1 -0
- package/{src/index.ts → dist/index.d.ts} +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/multiSigTransaction.d.ts +90 -0
- package/dist/multiSigTransaction.d.ts.map +1 -0
- package/dist/multiSigTransaction.js +4 -0
- package/dist/multiSigTransaction.js.map +1 -0
- package/{src/provider.ts → dist/provider.d.ts} +11 -44
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +3 -0
- package/dist/provider.js.map +1 -0
- package/dist/transaction.d.ts +117 -0
- package/dist/transaction.d.ts.map +1 -0
- package/dist/transaction.js +3 -0
- package/dist/transaction.js.map +1 -0
- package/dist/types.d.ts +73 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +83 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +5 -0
- package/dist/utils.js.map +1 -0
- package/{src/verification.ts → dist/verification.d.ts} +6 -8
- package/dist/verification.d.ts.map +1 -0
- package/dist/verification.js +4 -0
- package/dist/verification.js.map +1 -0
- package/package.json +9 -6
- package/src/error.ts +0 -9
- package/src/multiSigTransaction.ts +0 -39
- package/src/transaction.ts +0 -137
- package/src/types.ts +0 -163
- package/src/utils.ts +0 -488
- package/tsconfig.json +0 -20
- package/tsup.config.ts +0 -8
package/src/transaction.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
TransactionArgument as IotaTransactionArgument,
|
|
3
|
-
TransactionResult as IotaTransactionResult,
|
|
4
|
-
} from '@iota/iota-sdk/transactions';
|
|
5
|
-
import type { Transaction as IotaTransaction } from '@iota/iota-sdk/transactions';
|
|
6
|
-
import type {
|
|
7
|
-
TransactionArgument as SuiTransactionArgument,
|
|
8
|
-
TransactionResult as SuiTransactionResult,
|
|
9
|
-
} from '@mysten/sui/transactions';
|
|
10
|
-
import type { Transaction as SuiTransaction } from '@mysten/sui/transactions';
|
|
11
|
-
|
|
12
|
-
import type { SuiMoveProvider } from './provider';
|
|
13
|
-
|
|
14
|
-
export type SuiMoveArgument = SuiTransactionArgument | IotaTransactionArgument;
|
|
15
|
-
|
|
16
|
-
export type SuiMoveTransactionResult = SuiTransactionResult | IotaTransactionResult;
|
|
17
|
-
|
|
18
|
-
export type SuiMoveClock = SuiTransaction['object']['clock'] | IotaTransaction['object']['clock'];
|
|
19
|
-
|
|
20
|
-
// Extract types from SuiTransaction.getData() return type
|
|
21
|
-
export type SuiMoveTransactionData =
|
|
22
|
-
| ReturnType<SuiTransaction['getData']>
|
|
23
|
-
| ReturnType<IotaTransaction['getData']>;
|
|
24
|
-
export type SuiMoveTransactionInput = SuiMoveTransactionData['inputs'][number];
|
|
25
|
-
|
|
26
|
-
// Extract command types - filter out the undefined case
|
|
27
|
-
export type SuiMoveCommand = SuiMoveTransactionData['commands'][number];
|
|
28
|
-
export type SuiMoveCall = Extract<SuiMoveCommand, { $kind: 'MoveCall' }>['MoveCall'];
|
|
29
|
-
export type SuiMoveCallArgument = SuiMoveCall['arguments'][number];
|
|
30
|
-
|
|
31
|
-
export type SuiMoveGas = SuiTransaction['gas'] | IotaTransaction['gas'];
|
|
32
|
-
|
|
33
|
-
export interface SuiMoveTransaction {
|
|
34
|
-
gas: SuiMoveGas;
|
|
35
|
-
|
|
36
|
-
getNew(): SuiMoveTransaction;
|
|
37
|
-
|
|
38
|
-
from(tx: SuiMoveTransaction | string): SuiMoveTransaction;
|
|
39
|
-
|
|
40
|
-
setSender(sender: string): void;
|
|
41
|
-
|
|
42
|
-
suiMoveObjectRef(args: {
|
|
43
|
-
objectId: string;
|
|
44
|
-
digest: string;
|
|
45
|
-
version: string | number;
|
|
46
|
-
}): SuiMoveArgument;
|
|
47
|
-
|
|
48
|
-
suiMoveSharedObjectRef(args: {
|
|
49
|
-
objectId: string;
|
|
50
|
-
initialSharedVersion: string | number;
|
|
51
|
-
mutable: boolean;
|
|
52
|
-
}): SuiMoveArgument;
|
|
53
|
-
|
|
54
|
-
suiMoveReceivingRef(args: {
|
|
55
|
-
objectId: string;
|
|
56
|
-
digest: string;
|
|
57
|
-
version: string | number;
|
|
58
|
-
}): SuiMoveArgument;
|
|
59
|
-
|
|
60
|
-
suiMoveCall(args: {
|
|
61
|
-
target: string;
|
|
62
|
-
arguments: SuiMoveArgument[];
|
|
63
|
-
typeArguments: string[];
|
|
64
|
-
}): SuiMoveTransactionResult;
|
|
65
|
-
|
|
66
|
-
suiMovePublish(args: {
|
|
67
|
-
modules: number[][] | string[];
|
|
68
|
-
dependencies: string[];
|
|
69
|
-
}): SuiMoveTransactionResult;
|
|
70
|
-
|
|
71
|
-
suiMoveTransferObjects(
|
|
72
|
-
objects: (SuiMoveArgument | string)[],
|
|
73
|
-
target: string | SuiMoveArgument,
|
|
74
|
-
): SuiMoveTransactionResult;
|
|
75
|
-
|
|
76
|
-
suiMakeMoveVec(args: {
|
|
77
|
-
type: string | undefined;
|
|
78
|
-
elements: SuiMoveArgument[];
|
|
79
|
-
}): SuiMoveTransactionResult;
|
|
80
|
-
|
|
81
|
-
toJSON(): Promise<string>;
|
|
82
|
-
|
|
83
|
-
getData(): SuiMoveTransactionData;
|
|
84
|
-
|
|
85
|
-
getDigest(args: { client: SuiMoveProvider }): Promise<string>;
|
|
86
|
-
|
|
87
|
-
suiMoveSplitCoins(args: {
|
|
88
|
-
coin?: SuiMoveArgument;
|
|
89
|
-
amounts: SuiMoveArgument[];
|
|
90
|
-
}): SuiMoveTransactionResult;
|
|
91
|
-
|
|
92
|
-
upgrade(args: {
|
|
93
|
-
modules: number[][] | string[];
|
|
94
|
-
dependencies: string[];
|
|
95
|
-
package: string;
|
|
96
|
-
ticket: string | SuiMoveArgument;
|
|
97
|
-
}): SuiMoveTransactionResult;
|
|
98
|
-
|
|
99
|
-
mergeCoins(
|
|
100
|
-
destination: string | SuiMoveArgument,
|
|
101
|
-
sources: (string | SuiMoveArgument)[],
|
|
102
|
-
): SuiMoveTransactionResult;
|
|
103
|
-
|
|
104
|
-
buildSuiMove(args: { client: SuiMoveProvider }): Promise<Uint8Array>;
|
|
105
|
-
|
|
106
|
-
setExpiration(args: { Epoch: string }): void;
|
|
107
|
-
|
|
108
|
-
asObject(args: { objectId: string | SuiMoveArgument }): SuiMoveArgument;
|
|
109
|
-
|
|
110
|
-
asAddress(args: { address: string | SuiMoveArgument }): SuiMoveArgument;
|
|
111
|
-
|
|
112
|
-
asAddressVector(args: { addresses: string[] | SuiMoveArgument }): SuiMoveArgument;
|
|
113
|
-
|
|
114
|
-
asBytesVector(args: { bytes: Uint8Array[] | SuiMoveArgument }): SuiMoveArgument;
|
|
115
|
-
|
|
116
|
-
asBytes(args: { bytes: Uint8Array | SuiMoveArgument }): SuiMoveArgument;
|
|
117
|
-
|
|
118
|
-
asPure(args: { bytes: Uint8Array | SuiMoveArgument }): SuiMoveArgument;
|
|
119
|
-
|
|
120
|
-
asU8(args: { value: number | SuiMoveArgument }): SuiMoveArgument;
|
|
121
|
-
|
|
122
|
-
asU16(args: { value: number | SuiMoveArgument }): SuiMoveArgument;
|
|
123
|
-
|
|
124
|
-
asU32(args: { value: number | SuiMoveArgument }): SuiMoveArgument;
|
|
125
|
-
|
|
126
|
-
asU64(args: { value: bigint | number | string | SuiMoveArgument }): SuiMoveArgument;
|
|
127
|
-
|
|
128
|
-
asU128(args: { value: bigint | number | string | SuiMoveArgument }): SuiMoveArgument;
|
|
129
|
-
|
|
130
|
-
asU256(args: { value: bigint | number | string | SuiMoveArgument }): SuiMoveArgument;
|
|
131
|
-
|
|
132
|
-
asString(args: { value: string | SuiMoveArgument }): SuiMoveArgument;
|
|
133
|
-
|
|
134
|
-
asBool(args: { value: boolean | SuiMoveArgument }): SuiMoveArgument;
|
|
135
|
-
|
|
136
|
-
getClock(): ReturnType<SuiMoveClock>;
|
|
137
|
-
}
|
package/src/types.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import type { bcs as iotaBcs, BcsType as IotaBcsType } from '@iota/iota-sdk/bcs';
|
|
2
|
-
import type {
|
|
3
|
-
DevInspectResults as IotaDevInspectResults,
|
|
4
|
-
IotaExecutionResult,
|
|
5
|
-
IotaObjectData,
|
|
6
|
-
IotaObjectResponse,
|
|
7
|
-
IotaTransactionBlockResponse,
|
|
8
|
-
LatestIotaSystemStateSummary,
|
|
9
|
-
PaginatedObjectsResponse as IotaPaginatedObjectsResponse,
|
|
10
|
-
PaginatedTransactionResponse as IotaPaginatedTransactionResponse,
|
|
11
|
-
QueryTransactionBlocksParams as IotaQueryTransactionBlocksParams,
|
|
12
|
-
} from '@iota/iota-sdk/client';
|
|
13
|
-
import type { bcs as suiBcs, BcsType as SuiBcsType } from '@mysten/sui/bcs';
|
|
14
|
-
import type {
|
|
15
|
-
Checkpoint,
|
|
16
|
-
DevInspectResults as SuiDevInspectResults,
|
|
17
|
-
GetAllCoinsParams,
|
|
18
|
-
GetObjectParams,
|
|
19
|
-
GetOwnedObjectsParams,
|
|
20
|
-
GetTransactionBlockParams,
|
|
21
|
-
PaginatedCoins,
|
|
22
|
-
PaginatedObjectsResponse as SuiPaginatedObjectsResponse,
|
|
23
|
-
PaginatedTransactionResponse as SuiPaginatedTransactionResponse,
|
|
24
|
-
QueryTransactionBlocksParams as SuiQueryTransactionBlocksParams,
|
|
25
|
-
SuiExecutionResult,
|
|
26
|
-
SuiObjectData,
|
|
27
|
-
SuiObjectResponse,
|
|
28
|
-
SuiSystemStateSummary,
|
|
29
|
-
SuiTransactionBlockResponse,
|
|
30
|
-
} from '@mysten/sui/client';
|
|
31
|
-
|
|
32
|
-
export type SuiMoveBcsType<T, U> = SuiBcsType<T, U> | IotaBcsType<T, U>;
|
|
33
|
-
|
|
34
|
-
export type SuiTypes =
|
|
35
|
-
| typeof suiBcs.U256
|
|
36
|
-
| typeof suiBcs.U64
|
|
37
|
-
| typeof suiBcs.U32
|
|
38
|
-
| typeof suiBcs.U16
|
|
39
|
-
| typeof suiBcs.U8
|
|
40
|
-
| typeof suiBcs.bool
|
|
41
|
-
| typeof suiBcs.Address
|
|
42
|
-
| typeof suiBcs.vector
|
|
43
|
-
| SuiBcsType<
|
|
44
|
-
string[],
|
|
45
|
-
Iterable<string | Uint8Array> & {
|
|
46
|
-
length: number;
|
|
47
|
-
}
|
|
48
|
-
>;
|
|
49
|
-
|
|
50
|
-
export type IotaTypes =
|
|
51
|
-
| typeof iotaBcs.U256
|
|
52
|
-
| typeof iotaBcs.U64
|
|
53
|
-
| typeof iotaBcs.U32
|
|
54
|
-
| typeof iotaBcs.U16
|
|
55
|
-
| typeof iotaBcs.U8
|
|
56
|
-
| typeof iotaBcs.bool
|
|
57
|
-
| typeof iotaBcs.Address
|
|
58
|
-
| typeof iotaBcs.vector
|
|
59
|
-
| IotaBcsType<
|
|
60
|
-
string[],
|
|
61
|
-
Iterable<string | Uint8Array> & {
|
|
62
|
-
length: number;
|
|
63
|
-
}
|
|
64
|
-
>;
|
|
65
|
-
|
|
66
|
-
export type SuiMoveTypes = SuiTypes | IotaTypes;
|
|
67
|
-
|
|
68
|
-
export interface SuiMoveBcs {
|
|
69
|
-
u256: typeof suiBcs.U256 | typeof iotaBcs.U256;
|
|
70
|
-
u128: typeof suiBcs.U128 | typeof iotaBcs.U128;
|
|
71
|
-
u64: typeof suiBcs.U64 | typeof iotaBcs.U64;
|
|
72
|
-
u32: typeof suiBcs.U32 | typeof iotaBcs.U32;
|
|
73
|
-
u16: typeof suiBcs.U16 | typeof iotaBcs.U16;
|
|
74
|
-
u8: typeof suiBcs.U8 | typeof iotaBcs.U8;
|
|
75
|
-
bool: typeof suiBcs.bool | typeof iotaBcs.bool;
|
|
76
|
-
address: typeof suiBcs.Address | typeof iotaBcs.Address;
|
|
77
|
-
vectorAddress: SuiMoveBcsType<
|
|
78
|
-
string[],
|
|
79
|
-
Iterable<string | Uint8Array> & {
|
|
80
|
-
length: number;
|
|
81
|
-
}
|
|
82
|
-
>;
|
|
83
|
-
|
|
84
|
-
toAddress(bytes: Uint8Array): string;
|
|
85
|
-
toU64(bytes: Uint8Array): string;
|
|
86
|
-
toU16(bytes: Uint8Array): number;
|
|
87
|
-
toU8(bytes: Uint8Array): number;
|
|
88
|
-
toU8Vector(bytes: Uint8Array): number[];
|
|
89
|
-
toBool(bytes: Uint8Array): boolean;
|
|
90
|
-
toStruct<T>(bytes: Uint8Array, structName: string, fields: Record<string, SuiMoveTypes>): T;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface SuiMoveEventCursor {
|
|
94
|
-
txDigest: string;
|
|
95
|
-
eventSeq: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface SuiMoveEvent {
|
|
99
|
-
type: string;
|
|
100
|
-
data: unknown;
|
|
101
|
-
txHash: string;
|
|
102
|
-
blockSequenceNumber?: number;
|
|
103
|
-
blockDigest?: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Generic Move event shape, deliberately duplicated in each Move cluster's common package
|
|
107
|
-
// (common-aptosmove and common-suimove) rather than shared, so neither cluster carries a
|
|
108
|
-
// cross-cluster dependency for this ~4-line type. Kept as a generic `MoveEvent` (not
|
|
109
|
-
// cluster-prefixed) because the normalized shape is identical across Move VMs.
|
|
110
|
-
export interface MoveEvent {
|
|
111
|
-
type: string;
|
|
112
|
-
data: unknown;
|
|
113
|
-
txHash: string;
|
|
114
|
-
blockHeight: number;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface SuiMoveCoinBalance {
|
|
118
|
-
coinType: string;
|
|
119
|
-
totalBalance: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface SuiMoveViewResult {
|
|
123
|
-
value: Uint8Array;
|
|
124
|
-
type: string;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export type SuiMoveCheckpoint = Checkpoint;
|
|
128
|
-
|
|
129
|
-
export type SuiMoveGetTransactionBlockParams = GetTransactionBlockParams;
|
|
130
|
-
|
|
131
|
-
export type SuiMoveTransactionBlockResponse =
|
|
132
|
-
| SuiTransactionBlockResponse
|
|
133
|
-
| IotaTransactionBlockResponse;
|
|
134
|
-
|
|
135
|
-
export type SuiMoveGetAllCoinsParams = GetAllCoinsParams;
|
|
136
|
-
|
|
137
|
-
export type SuiMoveGetAllCoinsResponse = PaginatedCoins;
|
|
138
|
-
|
|
139
|
-
export type SuiMoveGetObjectParams = GetObjectParams;
|
|
140
|
-
|
|
141
|
-
export type SuiMoveObjectResponse = SuiObjectResponse | IotaObjectResponse;
|
|
142
|
-
|
|
143
|
-
export type SuiMoveGetOwnedObjectsParams = GetOwnedObjectsParams;
|
|
144
|
-
|
|
145
|
-
export type SuiMoveGetOwnedObjectsResponse =
|
|
146
|
-
| SuiPaginatedObjectsResponse
|
|
147
|
-
| IotaPaginatedObjectsResponse;
|
|
148
|
-
|
|
149
|
-
export type SuiMoveDevInspectResult = SuiDevInspectResults | IotaDevInspectResults;
|
|
150
|
-
|
|
151
|
-
export type SuiMoveExecutionResult = SuiExecutionResult | IotaExecutionResult;
|
|
152
|
-
|
|
153
|
-
export type SuiMoveObjectData = SuiObjectData | IotaObjectData;
|
|
154
|
-
|
|
155
|
-
export type SuiMoveSystemStateSummary = SuiSystemStateSummary | LatestIotaSystemStateSummary;
|
|
156
|
-
|
|
157
|
-
export type SuiMoveQueryTransactionBlocksParams =
|
|
158
|
-
| SuiQueryTransactionBlocksParams
|
|
159
|
-
| IotaQueryTransactionBlocksParams;
|
|
160
|
-
|
|
161
|
-
export type SuiMovePaginatedTransactionResponse =
|
|
162
|
-
| SuiPaginatedTransactionResponse
|
|
163
|
-
| IotaPaginatedTransactionResponse;
|