@0xobelisk/sui-client 0.5.17 → 0.5.19
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/index.d.ts +9 -8
- package/dist/index.js +309 -208
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +299 -201
- package/dist/index.mjs.map +1 -1
- package/dist/libs/multiSig/client.d.ts +2 -2
- package/dist/libs/multiSig/publickey.d.ts +1 -1
- package/dist/libs/suiAccountManager/index.d.ts +1 -1
- package/dist/libs/suiAccountManager/keypair.d.ts +1 -1
- package/dist/libs/suiContractFactory/index.d.ts +1 -1
- package/dist/libs/suiContractFactory/types.d.ts +1 -1
- package/dist/libs/suiInteractor/suiInteractor.d.ts +5 -5
- package/dist/libs/suiModel/suiOwnedObject.d.ts +2 -2
- package/dist/libs/suiModel/suiSharedObject.d.ts +1 -1
- package/dist/libs/suiTxBuilder/index.d.ts +365 -160
- package/dist/libs/suiTxBuilder/util.d.ts +8 -17
- package/dist/metadata/index.d.ts +1 -1
- package/dist/obelisk.d.ts +16 -12
- package/dist/types/index.d.ts +65 -15
- package/package.json +11 -8
- package/src/index.ts +9 -8
- package/src/libs/multiSig/client.ts +2 -2
- package/src/libs/multiSig/publickey.ts +3 -3
- package/src/libs/suiAccountManager/index.ts +2 -2
- package/src/libs/suiAccountManager/keypair.ts +1 -1
- package/src/libs/suiAccountManager/util.ts +1 -1
- package/src/libs/suiContractFactory/index.ts +1 -1
- package/src/libs/suiContractFactory/types.ts +1 -1
- package/src/libs/suiInteractor/index.ts +0 -1
- package/src/libs/suiInteractor/suiInteractor.ts +4 -4
- package/src/libs/suiModel/suiOwnedObject.ts +5 -3
- package/src/libs/suiModel/suiSharedObject.ts +4 -2
- package/src/libs/suiTxBuilder/index.ts +120 -108
- package/src/libs/suiTxBuilder/util.ts +55 -48
- package/src/metadata/index.ts +2 -3
- package/src/obelisk.ts +199 -90
- package/src/types/index.ts +82 -44
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TransactionArgument,
|
|
2
|
-
import type {
|
|
3
|
-
export declare const getDefaultSuiInputType: (value: SuiTxArg) =>
|
|
1
|
+
import type { TransactionArgument, Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
2
|
+
import type { SuiObjectArg, SuiAddressArg, SuiTxArg, SuiVecTxArg, SuiInputTypes } from 'src/types';
|
|
3
|
+
export declare const getDefaultSuiInputType: (value: SuiTxArg) => 'u64' | 'bool' | 'object' | undefined;
|
|
4
4
|
/**
|
|
5
5
|
* Since we know the elements in the array are the same type
|
|
6
6
|
* If type is not provided, we will try to infer the type from the first element
|
|
@@ -14,7 +14,7 @@ export declare const getDefaultSuiInputType: (value: SuiTxArg) => SuiInputTypes
|
|
|
14
14
|
* @param args
|
|
15
15
|
* @param type 'address' | 'bool' | 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'signer' | 'object' | string
|
|
16
16
|
*/
|
|
17
|
-
export declare function makeVecParam(txBlock:
|
|
17
|
+
export declare function makeVecParam(txBlock: Transaction, args: SuiTxArg[], type?: SuiInputTypes): TransactionArgument;
|
|
18
18
|
/**
|
|
19
19
|
* Check whether it is an valid move vec input.
|
|
20
20
|
*
|
|
@@ -29,12 +29,7 @@ export declare function isMoveVecArg(arg: SuiTxArg | SuiVecTxArg): arg is SuiVec
|
|
|
29
29
|
* @param args The array of argument to convert.
|
|
30
30
|
* @returns The converted array of TransactionArgument.
|
|
31
31
|
*/
|
|
32
|
-
export declare function convertArgs(txBlock:
|
|
33
|
-
index: number;
|
|
34
|
-
kind: "Input";
|
|
35
|
-
type: "pure";
|
|
36
|
-
value?: any;
|
|
37
|
-
} | TransactionObjectArgument | import("@mysten/bcs").SerializedBcs<unknown, unknown>)[];
|
|
32
|
+
export declare function convertArgs(txBlock: Transaction, args: (SuiTxArg | SuiVecTxArg)[]): TransactionArgument[];
|
|
38
33
|
/**
|
|
39
34
|
* Convert any valid address input into a TransactionArgument.
|
|
40
35
|
*
|
|
@@ -42,12 +37,7 @@ export declare function convertArgs(txBlock: TransactionBlock, args: (SuiTxArg |
|
|
|
42
37
|
* @param arg The address argument to convert.
|
|
43
38
|
* @returns The converted TransactionArgument.
|
|
44
39
|
*/
|
|
45
|
-
export declare function convertAddressArg(txBlock:
|
|
46
|
-
index: number;
|
|
47
|
-
kind: "Input";
|
|
48
|
-
type: "pure";
|
|
49
|
-
value?: any;
|
|
50
|
-
} | import("@mysten/bcs").SerializedBcs<unknown, unknown>;
|
|
40
|
+
export declare function convertAddressArg(txBlock: Transaction, arg: SuiAddressArg): TransactionArgument;
|
|
51
41
|
/**
|
|
52
42
|
* Convert any valid object input into a TransactionArgument.
|
|
53
43
|
*
|
|
@@ -55,4 +45,5 @@ export declare function convertAddressArg(txBlock: TransactionBlock, arg: SuiAdd
|
|
|
55
45
|
* @param arg The object argument to convert.
|
|
56
46
|
* @returns The converted TransactionArgument.
|
|
57
47
|
*/
|
|
58
|
-
export declare function convertObjArg(txb:
|
|
48
|
+
export declare function convertObjArg(txb: Transaction, arg: SuiObjectArg): TransactionObjectArgument;
|
|
49
|
+
export declare function convertAmounts(txBlock: Transaction, amounts: (SuiTxArg | number | bigint)[]): (TransactionArgument | number | bigint)[];
|
package/dist/metadata/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SuiMoveNormalizedModules } from '@mysten/sui
|
|
1
|
+
import { SuiMoveNormalizedModules } from '@mysten/sui/client';
|
|
2
2
|
import { NetworkType } from '../types';
|
|
3
3
|
export declare function loadMetadata(networkType: NetworkType, packageId: string): Promise<SuiMoveNormalizedModules | undefined>;
|
package/dist/obelisk.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
3
|
-
import type { SuiTransactionBlockResponse, DevInspectResults, SuiMoveNormalizedModules, SuiObjectData } from '@mysten/sui
|
|
2
|
+
import { Transaction } from '@mysten/sui/transactions';
|
|
3
|
+
import type { SuiTransactionBlockResponse, DevInspectResults, SuiMoveNormalizedModules, SuiObjectData } from '@mysten/sui/client';
|
|
4
4
|
import { SuiAccountManager } from './libs/suiAccountManager';
|
|
5
|
-
import {
|
|
5
|
+
import { SuiTx } from './libs/suiTxBuilder';
|
|
6
6
|
import { SuiInteractor } from './libs/suiInteractor';
|
|
7
|
+
import { MapMoudleStruct, NetworkType } from './types';
|
|
7
8
|
import { SuiContractFactory } from './libs/suiContractFactory';
|
|
8
9
|
import { SuiMoveMoudleFuncType } from './libs/suiContractFactory/types';
|
|
9
10
|
import { DerivePathParams, FaucetNetworkType, MapMoudleFuncQuery, MapMoudleFuncTx, ObeliskParams, SuiTxArg, SuiVecTxArg } from './types';
|
|
@@ -37,13 +38,14 @@ export declare class Obelisk {
|
|
|
37
38
|
constructor({ mnemonics, secretKey, networkType, fullnodeUrls, packageId, metadata, }?: ObeliskParams);
|
|
38
39
|
get query(): MapMoudleFuncQuery;
|
|
39
40
|
get tx(): MapMoudleFuncTx;
|
|
41
|
+
get struct(): MapMoudleStruct;
|
|
40
42
|
/**
|
|
41
43
|
* if derivePathParams is not provided or mnemonics is empty, it will return the keypair.
|
|
42
44
|
* else:
|
|
43
45
|
* it will generate signer from the mnemonic with the given derivePathParams.
|
|
44
46
|
* @param derivePathParams, such as { accountIndex: 2, isExternal: false, addressIndex: 10 }, comply with the BIP44 standard
|
|
45
47
|
*/
|
|
46
|
-
getKeypair(derivePathParams?: DerivePathParams): import("@mysten/sui
|
|
48
|
+
getKeypair(derivePathParams?: DerivePathParams): import("@mysten/sui/dist/cjs/keypairs/ed25519").Ed25519Keypair;
|
|
47
49
|
/**
|
|
48
50
|
* @description Switch the current account with the given derivePathParams
|
|
49
51
|
* @param derivePathParams, such as { accountIndex: 2, isExternal: false, addressIndex: 10 }, comply with the BIP44 standard
|
|
@@ -57,18 +59,20 @@ export declare class Obelisk {
|
|
|
57
59
|
currentAddress(): string;
|
|
58
60
|
getPackageId(): string;
|
|
59
61
|
getMetadata(): SuiMoveNormalizedModules | undefined;
|
|
62
|
+
getNetwork(): NetworkType | undefined;
|
|
60
63
|
/**
|
|
61
64
|
* Request some SUI from faucet
|
|
62
65
|
* @Returns {Promise<boolean>}, true if the request is successful, false otherwise.
|
|
63
66
|
*/
|
|
64
|
-
requestFaucet(address
|
|
65
|
-
getBalance(coinType?: string, derivePathParams?: DerivePathParams): Promise<import("@mysten/sui
|
|
66
|
-
balanceOf(accountAddress?: string, coinType?: string, derivePathParams?: DerivePathParams): Promise<import("@mysten/sui
|
|
67
|
-
client(): import("@mysten/sui
|
|
67
|
+
requestFaucet(address?: string, network?: FaucetNetworkType, derivePathParams?: DerivePathParams): Promise<void>;
|
|
68
|
+
getBalance(coinType?: string, derivePathParams?: DerivePathParams): Promise<import("@mysten/sui/client").CoinBalance>;
|
|
69
|
+
balanceOf(accountAddress?: string, coinType?: string, derivePathParams?: DerivePathParams): Promise<import("@mysten/sui/client").CoinBalance>;
|
|
70
|
+
client(): import("@mysten/sui/client").SuiClient;
|
|
68
71
|
getObject(objectId: string): Promise<SuiObjectData>;
|
|
69
72
|
getObjects(objectIds: string[]): Promise<SuiObjectData[]>;
|
|
70
|
-
signTxn(tx: Uint8Array |
|
|
71
|
-
signAndSendTxn(tx: Uint8Array |
|
|
73
|
+
signTxn(tx: Uint8Array | Transaction | SuiTx, derivePathParams?: DerivePathParams): Promise<import("@mysten/sui/dist/cjs/cryptography").SignatureWithBytes>;
|
|
74
|
+
signAndSendTxn(tx: Uint8Array | Transaction | SuiTx, derivePathParams?: DerivePathParams): Promise<SuiTransactionBlockResponse>;
|
|
75
|
+
sendTxn(transactionBlock: Uint8Array | string, signature: string | string[]): Promise<SuiTransactionBlockResponse>;
|
|
72
76
|
/**
|
|
73
77
|
* Transfer the given amount of SUI to the recipient
|
|
74
78
|
* @param recipient
|
|
@@ -121,7 +125,7 @@ export declare class Obelisk {
|
|
|
121
125
|
* @param derivePathParams the derive path params
|
|
122
126
|
* @returns the effects and events of the transaction, such as object changes, gas cost, event emitted.
|
|
123
127
|
*/
|
|
124
|
-
inspectTxn(tx: Uint8Array |
|
|
128
|
+
inspectTxn(tx: Uint8Array | Transaction | SuiTx, derivePathParams?: DerivePathParams): Promise<DevInspectResults>;
|
|
125
129
|
getWorld(worldObjectId: string): Promise<SuiObjectData>;
|
|
126
130
|
listSchemaNames(worldId: string): Promise<any>;
|
|
127
131
|
getEntity(worldId: string, schemaName: string, entityId?: string): Promise<any[] | undefined>;
|
|
@@ -132,5 +136,5 @@ export declare class Obelisk {
|
|
|
132
136
|
entity_key_from_address_with_seed(objectId: string, seed: string): Promise<string | undefined>;
|
|
133
137
|
entity_key_from_address_with_u256(objectId: string, x: number): Promise<string | undefined>;
|
|
134
138
|
entity_key_from_u256(x: number): Promise<string>;
|
|
135
|
-
|
|
139
|
+
autoFormatDryValue(value: DevInspectResults): Promise<(string | number | boolean | number[] | null)[] | undefined>;
|
|
136
140
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Infer } from 'superstruct';
|
|
2
|
-
import type { SerializedBcs } from '@mysten/bcs';
|
|
3
|
-
import type { TransactionArgument } from '@mysten/sui
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type { SharedObjectRef, ObjectArg } from '@mysten/sui.js/bcs';
|
|
2
|
+
import type { BcsType, SerializedBcs } from '@mysten/bcs';
|
|
3
|
+
import type { TransactionArgument } from '@mysten/sui/transactions';
|
|
4
|
+
import type { Transaction, TransactionObjectArgument, TransactionResult, Argument, Inputs } from '@mysten/sui/transactions';
|
|
5
|
+
import type { SuiMoveNormalizedModules, DevInspectResults, SuiTransactionBlockResponse, DisplayFieldsResponse, SuiMoveNormalizedType, MoveStruct } from '@mysten/sui/client';
|
|
7
6
|
import { SuiMoveMoudleFuncType } from '../libs/suiContractFactory/types';
|
|
8
7
|
export declare const ObjectContentFields: import("superstruct").Struct<Record<string, any>, null>;
|
|
9
8
|
export type ObjectContentFields = Infer<typeof ObjectContentFields>;
|
|
@@ -60,15 +59,38 @@ export interface MessageMeta {
|
|
|
60
59
|
readonly meta: SuiMoveMoudleFuncType;
|
|
61
60
|
}
|
|
62
61
|
export interface ContractQuery extends MessageMeta {
|
|
63
|
-
(tx:
|
|
62
|
+
(tx: Transaction, params: (TransactionArgument | SerializedBcs<any>)[], typeArguments?: string[], isRaw?: boolean): Promise<DevInspectResults | TransactionResult>;
|
|
64
63
|
}
|
|
65
64
|
export interface ContractTx extends MessageMeta {
|
|
66
|
-
(tx:
|
|
65
|
+
(tx: Transaction, params: (TransactionArgument | SerializedBcs<any>)[], typeArguments?: string[], isRaw?: boolean): Promise<SuiTransactionBlockResponse | TransactionResult>;
|
|
67
66
|
}
|
|
68
67
|
export type MapMessageTx = Record<string, ContractTx>;
|
|
69
68
|
export type MapMessageQuery = Record<string, ContractQuery>;
|
|
70
69
|
export type MapMoudleFuncTx = Record<string, MapMessageTx>;
|
|
71
70
|
export type MapMoudleFuncQuery = Record<string, MapMessageQuery>;
|
|
71
|
+
type MoveStructType = {
|
|
72
|
+
struct: Record<string, {
|
|
73
|
+
fields: {
|
|
74
|
+
type: SuiMoveNormalizedType;
|
|
75
|
+
name: string;
|
|
76
|
+
}[];
|
|
77
|
+
abilities: {
|
|
78
|
+
abilities: string[];
|
|
79
|
+
};
|
|
80
|
+
typeParameters: {
|
|
81
|
+
constraints: {
|
|
82
|
+
abilities: string[];
|
|
83
|
+
};
|
|
84
|
+
isPhantom: boolean;
|
|
85
|
+
}[];
|
|
86
|
+
}>;
|
|
87
|
+
bcs: BcsType<{
|
|
88
|
+
[x: string]: any;
|
|
89
|
+
}, {
|
|
90
|
+
[x: string]: any;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
export type MapMoudleStruct = Record<string, MoveStructType>;
|
|
72
94
|
export type MapMoudleFuncTest = Record<string, Record<string, string>>;
|
|
73
95
|
export type MapMoudleFuncQueryTest = Record<string, Record<string, string>>;
|
|
74
96
|
export type AccountMangerParams = {
|
|
@@ -98,17 +120,27 @@ export type ObjectData = {
|
|
|
98
120
|
objectDisplay: DisplayFieldsResponse;
|
|
99
121
|
objectFields: ObjectContentFields;
|
|
100
122
|
};
|
|
101
|
-
type TransactionBlockType = InstanceType<typeof
|
|
123
|
+
type TransactionBlockType = InstanceType<typeof Transaction>;
|
|
102
124
|
export type PureCallArg = {
|
|
103
125
|
Pure: number[];
|
|
104
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* An object argument.
|
|
129
|
+
*/
|
|
130
|
+
type ObjectArg = {
|
|
131
|
+
ImmOrOwnedObject: SuiObjectRef;
|
|
132
|
+
} | {
|
|
133
|
+
SharedObject: SharedObjectRef;
|
|
134
|
+
} | {
|
|
135
|
+
Receiving: SuiObjectRef;
|
|
136
|
+
};
|
|
105
137
|
export type ObjectCallArg = {
|
|
106
138
|
Object: ObjectArg;
|
|
107
139
|
};
|
|
108
140
|
export type TransactionType = Parameters<TransactionBlockType['add']>;
|
|
109
|
-
export type TransactionPureArgument = Extract<
|
|
110
|
-
kind: 'Input';
|
|
111
|
-
type
|
|
141
|
+
export type TransactionPureArgument = Extract<Argument, {
|
|
142
|
+
$kind: 'Input';
|
|
143
|
+
type?: 'pure';
|
|
112
144
|
}>;
|
|
113
145
|
export type ObjectFieldType = {
|
|
114
146
|
id: {
|
|
@@ -122,17 +154,35 @@ export type EntityData = {
|
|
|
122
154
|
index: string;
|
|
123
155
|
key: string;
|
|
124
156
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
157
|
+
type SharedObjectRef = {
|
|
158
|
+
/** Hex code as string representing the object id */
|
|
159
|
+
objectId: string;
|
|
160
|
+
/** The version the object was shared at */
|
|
161
|
+
initialSharedVersion: number | string;
|
|
162
|
+
/** Whether reference is mutable */
|
|
163
|
+
mutable: boolean;
|
|
164
|
+
};
|
|
165
|
+
type SuiObjectRef = {
|
|
166
|
+
/** Base64 string representing the object digest */
|
|
167
|
+
objectId: string;
|
|
168
|
+
/** Object version */
|
|
169
|
+
version: number | string;
|
|
170
|
+
/** Hex code as string representing the object id */
|
|
171
|
+
digest: string;
|
|
172
|
+
};
|
|
173
|
+
export type SuiTxArg = TransactionArgument | SerializedBcs<any>;
|
|
174
|
+
export type SuiAddressArg = Argument | SerializedBcs<any> | string;
|
|
175
|
+
export type SuiAmountsArg = SuiTxArg | number | bigint;
|
|
176
|
+
export type SuiObjectArg = TransactionObjectArgument | string | Parameters<typeof Inputs.ObjectRef>[0] | Parameters<typeof Inputs.SharedObjectRef>[0] | ObjectCallArg;
|
|
128
177
|
export type SuiVecTxArg = {
|
|
129
178
|
value: SuiTxArg[];
|
|
130
179
|
vecType: SuiInputTypes;
|
|
131
180
|
} | SuiTxArg[];
|
|
181
|
+
export type DryTxReturnValues = Array<[Uint8Array, string]>;
|
|
132
182
|
/**
|
|
133
183
|
* These are the basics types that can be used in the SUI
|
|
134
184
|
*/
|
|
135
|
-
export type SuiBasicTypes = 'address' | 'bool' | 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256'
|
|
185
|
+
export type SuiBasicTypes = 'address' | 'bool' | 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256';
|
|
136
186
|
export type SuiInputTypes = 'object' | SuiBasicTypes;
|
|
137
187
|
export type SuiReturnValues = {
|
|
138
188
|
returnValues: [number[], string][];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xobelisk/sui-client",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.19",
|
|
4
4
|
"description": "Tookit for interacting with move eps framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sui",
|
|
@@ -37,11 +37,14 @@
|
|
|
37
37
|
"src"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@mysten/bcs": "^0.
|
|
41
|
-
"@mysten/sui
|
|
40
|
+
"@mysten/bcs": "^1.0.2",
|
|
41
|
+
"@mysten/sui": "^1.1.2",
|
|
42
|
+
"@mysten/zklogin": "^0.7.8",
|
|
43
|
+
"@graphql-typed-document-node/core": "^3.2.0",
|
|
42
44
|
"@noble/curves": "^1.2.0",
|
|
43
45
|
"@noble/hashes": "^1.3.2",
|
|
44
46
|
"@scure/bip39": "^1.2.1",
|
|
47
|
+
"@suchipi/femver": "^1.0.0",
|
|
45
48
|
"assert": "^2.1.0",
|
|
46
49
|
"bech32": "^2.0.0",
|
|
47
50
|
"superstruct": "^1.0.3",
|
|
@@ -51,10 +54,10 @@
|
|
|
51
54
|
"husky": "^8.0.3",
|
|
52
55
|
"keccak256": "^1.0.6",
|
|
53
56
|
"process": "^0.11.10",
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
57
|
+
"gql.tada": "^1.7.0",
|
|
58
|
+
"graphql": "^16.8.1",
|
|
59
|
+
"tmp": "^0.2.1",
|
|
60
|
+
"valibot": "^0.25.0"
|
|
58
61
|
},
|
|
59
62
|
"devDependencies": {
|
|
60
63
|
"@commitlint/cli": "^18.0.0",
|
|
@@ -74,7 +77,7 @@
|
|
|
74
77
|
"tsconfig-paths": "^4.2.0",
|
|
75
78
|
"tsup": "^7.1.0",
|
|
76
79
|
"typedoc": "^0.25.2",
|
|
77
|
-
"typescript": "^5.
|
|
80
|
+
"typescript": "^5.2.2"
|
|
78
81
|
},
|
|
79
82
|
"lint-staged": {
|
|
80
83
|
"**/*.ts": [
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export * from '@mysten/sui
|
|
2
|
-
export * from '@mysten/sui
|
|
3
|
-
export * from '@mysten/sui
|
|
4
|
-
export * from '@mysten/sui
|
|
5
|
-
export * from '@mysten/sui
|
|
6
|
-
export * from '@mysten/sui
|
|
7
|
-
export
|
|
1
|
+
export * from '@mysten/sui/client';
|
|
2
|
+
export * from '@mysten/sui/utils';
|
|
3
|
+
export * from '@mysten/sui/transactions';
|
|
4
|
+
export * from '@mysten/sui/bcs';
|
|
5
|
+
export * from '@mysten/sui/keypairs/ed25519';
|
|
6
|
+
export * from '@mysten/sui/keypairs/secp256k1';
|
|
7
|
+
export * from '@mysten/sui/keypairs/secp256r1';
|
|
8
|
+
export { bcs, BcsType } from '@mysten/bcs';
|
|
8
9
|
export { Obelisk } from './obelisk';
|
|
9
10
|
export { SuiAccountManager } from './libs/suiAccountManager';
|
|
10
|
-
export {
|
|
11
|
+
export { SuiTx } from './libs/suiTxBuilder';
|
|
11
12
|
export { MultiSigClient } from './libs/multiSig';
|
|
12
13
|
export { SuiContractFactory } from './libs/suiContractFactory';
|
|
13
14
|
export { loadMetadata } from './metadata';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MultiSigPublicKey } from '@mysten/sui
|
|
2
|
-
import type { PublicKey } from '@mysten/sui
|
|
1
|
+
import { MultiSigPublicKey } from '@mysten/sui/multisig';
|
|
2
|
+
import type { PublicKey } from '@mysten/sui/cryptography';
|
|
3
3
|
import { ed25519PublicKeyFromBase64 } from './publickey';
|
|
4
4
|
|
|
5
5
|
export type PublicKeyWeightPair = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PublicKey } from '@mysten/sui
|
|
2
|
-
import { Ed25519PublicKey } from '@mysten/sui
|
|
3
|
-
import { fromB64 } from '@mysten/sui
|
|
1
|
+
import { PublicKey } from '@mysten/sui/cryptography';
|
|
2
|
+
import { Ed25519PublicKey } from '@mysten/sui/keypairs/ed25519';
|
|
3
|
+
import { fromB64 } from '@mysten/sui/utils';
|
|
4
4
|
|
|
5
5
|
export function ed25519PublicKeyFromBase64(rawPubkey: string): PublicKey {
|
|
6
6
|
let bytes = fromB64(rawPubkey);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ed25519Keypair } from '@mysten/sui
|
|
1
|
+
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
2
2
|
import { getKeyPair } from './keypair';
|
|
3
3
|
import { hexOrBase64ToUint8Array, normalizePrivateKey } from './util';
|
|
4
4
|
import { generateMnemonic } from './crypto';
|
|
@@ -6,7 +6,7 @@ import type { AccountMangerParams, DerivePathParams } from 'src/types';
|
|
|
6
6
|
import {
|
|
7
7
|
SUI_PRIVATE_KEY_PREFIX,
|
|
8
8
|
decodeSuiPrivateKey,
|
|
9
|
-
} from '@mysten/sui
|
|
9
|
+
} from '@mysten/sui/cryptography';
|
|
10
10
|
|
|
11
11
|
export class SuiAccountManager {
|
|
12
12
|
private mnemonics: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { SuiClient } from '@mysten/sui
|
|
1
|
+
import { SuiClient } from '@mysten/sui/client';
|
|
2
2
|
import type {
|
|
3
3
|
SuiTransactionBlockResponseOptions,
|
|
4
4
|
SuiTransactionBlockResponse,
|
|
5
5
|
SuiObjectDataOptions,
|
|
6
6
|
SuiObjectData,
|
|
7
|
-
} from '@mysten/sui
|
|
8
|
-
import type * as RpcTypes from '@mysten/sui
|
|
9
|
-
import { requestSuiFromFaucetV0, getFaucetHost } from '@mysten/sui
|
|
7
|
+
} from '@mysten/sui/client';
|
|
8
|
+
import type * as RpcTypes from '@mysten/sui/dist/cjs/client/types/generated';
|
|
9
|
+
import { requestSuiFromFaucetV0, getFaucetHost } from '@mysten/sui/faucet';
|
|
10
10
|
import { FaucetNetworkType, NetworkType, ObjectData } from '../../types';
|
|
11
11
|
import { SuiOwnedObject, SuiSharedObject } from '../suiModel';
|
|
12
12
|
import { delay } from './util';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SuiTransactionBlockResponse } from '@mysten/sui
|
|
2
|
-
import type { CallArg } from '@mysten/sui
|
|
1
|
+
import type { SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
2
|
+
import type { CallArg } from '@mysten/sui/transactions';
|
|
3
3
|
|
|
4
4
|
export class SuiOwnedObject {
|
|
5
5
|
public readonly objectId: string;
|
|
@@ -26,8 +26,10 @@ export class SuiOwnedObject {
|
|
|
26
26
|
return this.objectId;
|
|
27
27
|
}
|
|
28
28
|
return {
|
|
29
|
+
$kind: 'Object',
|
|
29
30
|
Object: {
|
|
30
|
-
|
|
31
|
+
$kind: 'ImmOrOwnedObject',
|
|
32
|
+
ImmOrOwnedObject: {
|
|
31
33
|
objectId: this.objectId,
|
|
32
34
|
version: this.version,
|
|
33
35
|
digest: this.digest,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CallArg } from '@mysten/sui
|
|
1
|
+
import type { CallArg } from '@mysten/sui/transactions';
|
|
2
2
|
|
|
3
3
|
export class SuiSharedObject {
|
|
4
4
|
public readonly objectId: string;
|
|
@@ -18,8 +18,10 @@ export class SuiSharedObject {
|
|
|
18
18
|
return this.objectId;
|
|
19
19
|
}
|
|
20
20
|
return {
|
|
21
|
+
$kind: 'Object',
|
|
21
22
|
Object: {
|
|
22
|
-
|
|
23
|
+
$kind: 'SharedObject',
|
|
24
|
+
SharedObject: {
|
|
23
25
|
objectId: this.objectId,
|
|
24
26
|
initialSharedVersion: this.initialSharedVersion,
|
|
25
27
|
mutable,
|