@0xobelisk/client 0.3.2 → 0.3.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/package.json +1 -1
- package/dist/index.d.ts +0 -9
- package/dist/libs/suiAccountManager/index.d.ts +0 -35
- package/dist/libs/suiAccountManager/keypair.d.ts +0 -21
- package/dist/libs/suiInteractor/defaultConfig.d.ts +0 -10
- package/dist/libs/suiInteractor/index.d.ts +0 -2
- package/dist/libs/suiInteractor/suiInteractor.d.ts +0 -205
- package/dist/libs/suiTxBuilder/index.d.ts +0 -544
- package/dist/libs/suiTxBuilder/util.d.ts +0 -76
- package/dist/metadata/index.d.ts +0 -34
- package/dist/obelisk.d.ts +0 -2566
- package/dist/types/index.d.ts +0 -141
package/package.json
CHANGED
package/dist/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from '@mysten/sui.js';
|
|
2
|
-
export { Ed25519Keypair } from '@mysten/sui.js/keypairs/ed25519';
|
|
3
|
-
export * from '@mysten/bcs';
|
|
4
|
-
export { Obelisk } from './obelisk';
|
|
5
|
-
export { SuiAccountManager } from './libs/suiAccountManager';
|
|
6
|
-
export { SuiTxBlock } from './libs/suiTxBuilder';
|
|
7
|
-
export { SuiContractFactory } from './libs/suiContractFactory';
|
|
8
|
-
export { getMetadata } from './metadata';
|
|
9
|
-
export type * from './types';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Ed25519Keypair } from '@mysten/sui.js';
|
|
2
|
-
import type { AccountMangerParams, DerivePathParams } from 'src/types';
|
|
3
|
-
export declare class SuiAccountManager {
|
|
4
|
-
private mnemonics;
|
|
5
|
-
private secretKey;
|
|
6
|
-
currentKeyPair: Ed25519Keypair;
|
|
7
|
-
currentAddress: string;
|
|
8
|
-
/**
|
|
9
|
-
* Support the following ways to init the SuiToolkit:
|
|
10
|
-
* 1. mnemonics
|
|
11
|
-
* 2. secretKey (base64 or hex)
|
|
12
|
-
* If none of them is provided, will generate a random mnemonics with 24 words.
|
|
13
|
-
*
|
|
14
|
-
* @param mnemonics, 12 or 24 mnemonics words, separated by space
|
|
15
|
-
* @param secretKey, base64 or hex string, when mnemonics is provided, secretKey will be ignored
|
|
16
|
-
*/
|
|
17
|
-
constructor({ mnemonics, secretKey }?: AccountMangerParams);
|
|
18
|
-
/**
|
|
19
|
-
* if derivePathParams is not provided or mnemonics is empty, it will return the currentKeyPair.
|
|
20
|
-
* else:
|
|
21
|
-
* it will generate keyPair from the mnemonic with the given derivePathParams.
|
|
22
|
-
*/
|
|
23
|
-
getKeyPair(derivePathParams?: DerivePathParams): Ed25519Keypair;
|
|
24
|
-
/**
|
|
25
|
-
* if derivePathParams is not provided or mnemonics is empty, it will return the currentAddress.
|
|
26
|
-
* else:
|
|
27
|
-
* it will generate address from the mnemonic with the given derivePathParams.
|
|
28
|
-
*/
|
|
29
|
-
getAddress(derivePathParams?: DerivePathParams): string;
|
|
30
|
-
/**
|
|
31
|
-
* Switch the current account with the given derivePathParams.
|
|
32
|
-
* This is only useful when the mnemonics is provided. For secretKey mode, it will always use the same account.
|
|
33
|
-
*/
|
|
34
|
-
switchAccount(derivePathParams: DerivePathParams): void;
|
|
35
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Ed25519Keypair } from '@mysten/sui.js';
|
|
2
|
-
import type { DerivePathParams } from 'src/types';
|
|
3
|
-
/**
|
|
4
|
-
* @description Get ed25519 derive path for SUI
|
|
5
|
-
* @param derivePathParams
|
|
6
|
-
*/
|
|
7
|
-
export declare const getDerivePathForSUI: (derivePathParams?: DerivePathParams) => string;
|
|
8
|
-
/**
|
|
9
|
-
* the format is m/44'/784'/accountIndex'/${isExternal ? 1 : 0}'/addressIndex'
|
|
10
|
-
*
|
|
11
|
-
* accountIndex is the index of the account, default is 0.
|
|
12
|
-
*
|
|
13
|
-
* isExternal is the type of the address, default is false. Usually, the external address is used to receive coins. The internal address is used to change coins.
|
|
14
|
-
*
|
|
15
|
-
* addressIndex is the index of the address, default is 0. It's used to generate multiple addresses for one account.
|
|
16
|
-
*
|
|
17
|
-
* @description Get keypair from mnemonics and derive path
|
|
18
|
-
* @param mnemonics
|
|
19
|
-
* @param derivePathParams
|
|
20
|
-
*/
|
|
21
|
-
export declare const getKeyPair: (mnemonics: string, derivePathParams?: DerivePathParams) => Ed25519Keypair;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Connection } from '@mysten/sui.js';
|
|
2
|
-
import type { NetworkType } from 'src/types';
|
|
3
|
-
export declare const defaultGasBudget: number;
|
|
4
|
-
export declare const defaultGasPrice = 1000;
|
|
5
|
-
/**
|
|
6
|
-
* @description Get the default fullnode url and faucet url for the given network type
|
|
7
|
-
* @param networkType, 'testnet' | 'mainnet' | 'devnet' | 'localnet', default is 'devnet'
|
|
8
|
-
* @returns { fullNode: string, websocket: string, faucet?: string }
|
|
9
|
-
*/
|
|
10
|
-
export declare const getDefaultConnection: (networkType?: NetworkType) => Connection;
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import { SuiTransactionBlockResponse, JsonRpcProvider, DynamicFieldName, SuiAddress } from '@mysten/sui.js';
|
|
2
|
-
import { FaucetNetworkType, NetworkType, ObjectData, EntityData } from 'src/types';
|
|
3
|
-
import { SuiOwnedObject, SuiSharedObject } from '../suiModel';
|
|
4
|
-
/**
|
|
5
|
-
* `SuiTransactionSender` is used to send transaction with a given gas coin.
|
|
6
|
-
* It always uses the gas coin to pay for the gas,
|
|
7
|
-
* and update the gas coin after the transaction.
|
|
8
|
-
*/
|
|
9
|
-
export declare class SuiInteractor {
|
|
10
|
-
readonly providers: JsonRpcProvider[];
|
|
11
|
-
currentProvider: JsonRpcProvider;
|
|
12
|
-
network?: NetworkType;
|
|
13
|
-
constructor(fullNodeUrls: string[], network?: NetworkType);
|
|
14
|
-
switchToNextProvider(): void;
|
|
15
|
-
sendTx(transactionBlock: Uint8Array | string, signature: string | string[]): Promise<SuiTransactionBlockResponse>;
|
|
16
|
-
getObjects(ids: string[]): Promise<ObjectData[]>;
|
|
17
|
-
getObject(id: string): Promise<ObjectData>;
|
|
18
|
-
getEntitiesObjects(ids: string[]): Promise<EntityData[]>;
|
|
19
|
-
getDynamicFieldObject(parentId: string, name: string | DynamicFieldName): Promise<{
|
|
20
|
-
data?: {
|
|
21
|
-
objectId: string;
|
|
22
|
-
version: string;
|
|
23
|
-
digest: string;
|
|
24
|
-
type?: string | null | undefined;
|
|
25
|
-
bcs?: {
|
|
26
|
-
type: string;
|
|
27
|
-
version: string;
|
|
28
|
-
hasPublicTransfer: boolean;
|
|
29
|
-
dataType: "moveObject";
|
|
30
|
-
bcsBytes: string;
|
|
31
|
-
} | {
|
|
32
|
-
id: string;
|
|
33
|
-
dataType: "package";
|
|
34
|
-
moduleMap: Record<string, string>;
|
|
35
|
-
} | null | undefined;
|
|
36
|
-
owner?: {
|
|
37
|
-
AddressOwner: string;
|
|
38
|
-
} | {
|
|
39
|
-
ObjectOwner: string;
|
|
40
|
-
} | {
|
|
41
|
-
Shared: {
|
|
42
|
-
initial_shared_version: string | null;
|
|
43
|
-
};
|
|
44
|
-
} | "Immutable" | null | undefined;
|
|
45
|
-
storageRebate?: string | null | undefined;
|
|
46
|
-
previousTransaction?: string | null | undefined;
|
|
47
|
-
content?: {
|
|
48
|
-
type: string;
|
|
49
|
-
fields: Record<string, any>;
|
|
50
|
-
hasPublicTransfer: boolean;
|
|
51
|
-
dataType: "moveObject";
|
|
52
|
-
} | {
|
|
53
|
-
disassembled: Record<string, unknown>;
|
|
54
|
-
dataType: "package";
|
|
55
|
-
} | null | undefined;
|
|
56
|
-
display?: Record<string, string> | {
|
|
57
|
-
data?: Record<string, string> | null | undefined;
|
|
58
|
-
error?: {
|
|
59
|
-
code: string;
|
|
60
|
-
version?: string | undefined;
|
|
61
|
-
digest?: string | undefined;
|
|
62
|
-
error?: string | undefined;
|
|
63
|
-
object_id?: string | undefined;
|
|
64
|
-
parent_object_id?: string | undefined;
|
|
65
|
-
} | null | undefined;
|
|
66
|
-
} | null | undefined;
|
|
67
|
-
} | null | undefined;
|
|
68
|
-
error?: {
|
|
69
|
-
code: string;
|
|
70
|
-
version?: string | undefined;
|
|
71
|
-
digest?: string | undefined;
|
|
72
|
-
error?: string | undefined;
|
|
73
|
-
object_id?: string | undefined;
|
|
74
|
-
parent_object_id?: string | undefined;
|
|
75
|
-
} | null | undefined;
|
|
76
|
-
}>;
|
|
77
|
-
getDynamicFields(parentId: string, cursor?: string, limit?: number): Promise<{
|
|
78
|
-
data: {
|
|
79
|
-
type: "DynamicField" | "DynamicObject";
|
|
80
|
-
objectType: string;
|
|
81
|
-
objectId: string;
|
|
82
|
-
version: number;
|
|
83
|
-
digest: string;
|
|
84
|
-
name: {
|
|
85
|
-
type: string;
|
|
86
|
-
value?: any;
|
|
87
|
-
};
|
|
88
|
-
bcsName: string;
|
|
89
|
-
}[];
|
|
90
|
-
nextCursor: string | null;
|
|
91
|
-
hasNextPage: boolean;
|
|
92
|
-
}>;
|
|
93
|
-
getOwnedObjects(owner: SuiAddress, cursor?: string, limit?: number): Promise<{
|
|
94
|
-
data: {
|
|
95
|
-
data?: {
|
|
96
|
-
objectId: string;
|
|
97
|
-
version: string;
|
|
98
|
-
digest: string;
|
|
99
|
-
type?: string | null | undefined;
|
|
100
|
-
bcs?: {
|
|
101
|
-
type: string;
|
|
102
|
-
version: string;
|
|
103
|
-
hasPublicTransfer: boolean;
|
|
104
|
-
dataType: "moveObject";
|
|
105
|
-
bcsBytes: string;
|
|
106
|
-
} | {
|
|
107
|
-
id: string;
|
|
108
|
-
dataType: "package";
|
|
109
|
-
moduleMap: Record<string, string>;
|
|
110
|
-
} | null | undefined;
|
|
111
|
-
owner?: "Immutable" | {
|
|
112
|
-
AddressOwner: string;
|
|
113
|
-
} | {
|
|
114
|
-
ObjectOwner: string;
|
|
115
|
-
} | {
|
|
116
|
-
Shared: {
|
|
117
|
-
initial_shared_version: string | null;
|
|
118
|
-
};
|
|
119
|
-
} | null | undefined;
|
|
120
|
-
storageRebate?: string | null | undefined;
|
|
121
|
-
previousTransaction?: string | null | undefined;
|
|
122
|
-
content?: {
|
|
123
|
-
type: string;
|
|
124
|
-
fields: Record<string, any>;
|
|
125
|
-
hasPublicTransfer: boolean;
|
|
126
|
-
dataType: "moveObject";
|
|
127
|
-
} | {
|
|
128
|
-
disassembled: Record<string, unknown>;
|
|
129
|
-
dataType: "package";
|
|
130
|
-
} | null | undefined;
|
|
131
|
-
display?: Record<string, string> | {
|
|
132
|
-
data?: Record<string, string> | null | undefined;
|
|
133
|
-
error?: {
|
|
134
|
-
code: string;
|
|
135
|
-
version?: string | undefined;
|
|
136
|
-
digest?: string | undefined;
|
|
137
|
-
error?: string | undefined;
|
|
138
|
-
object_id?: string | undefined;
|
|
139
|
-
parent_object_id?: string | undefined;
|
|
140
|
-
} | null | undefined;
|
|
141
|
-
} | null | undefined;
|
|
142
|
-
} | null | undefined;
|
|
143
|
-
error?: {
|
|
144
|
-
code: string;
|
|
145
|
-
version?: string | undefined;
|
|
146
|
-
digest?: string | undefined;
|
|
147
|
-
error?: string | undefined;
|
|
148
|
-
object_id?: string | undefined;
|
|
149
|
-
parent_object_id?: string | undefined;
|
|
150
|
-
} | null | undefined;
|
|
151
|
-
}[];
|
|
152
|
-
hasNextPage: boolean;
|
|
153
|
-
nextCursor?: string | null | undefined;
|
|
154
|
-
}>;
|
|
155
|
-
getNormalizedMoveModulesByPackage(packageId: string): Promise<Record<string, {
|
|
156
|
-
address: string;
|
|
157
|
-
name: string;
|
|
158
|
-
fileFormatVersion: number;
|
|
159
|
-
friends: {
|
|
160
|
-
address: string;
|
|
161
|
-
name: string;
|
|
162
|
-
}[];
|
|
163
|
-
structs: Record<string, {
|
|
164
|
-
fields: {
|
|
165
|
-
type: import("@mysten/sui.js").SuiMoveNormalizedType;
|
|
166
|
-
name: string;
|
|
167
|
-
}[];
|
|
168
|
-
abilities: {
|
|
169
|
-
abilities: string[];
|
|
170
|
-
};
|
|
171
|
-
typeParameters: {
|
|
172
|
-
constraints: {
|
|
173
|
-
abilities: string[];
|
|
174
|
-
};
|
|
175
|
-
isPhantom: boolean;
|
|
176
|
-
}[];
|
|
177
|
-
}>;
|
|
178
|
-
exposedFunctions: Record<string, {
|
|
179
|
-
visibility: "Private" | "Public" | "Friend";
|
|
180
|
-
isEntry: boolean;
|
|
181
|
-
typeParameters: {
|
|
182
|
-
abilities: string[];
|
|
183
|
-
}[];
|
|
184
|
-
parameters: import("@mysten/sui.js").SuiMoveNormalizedType[];
|
|
185
|
-
return: import("@mysten/sui.js").SuiMoveNormalizedType[];
|
|
186
|
-
}>;
|
|
187
|
-
}>>;
|
|
188
|
-
/**
|
|
189
|
-
* @description Update objects in a batch
|
|
190
|
-
* @param suiObjects
|
|
191
|
-
*/
|
|
192
|
-
updateObjects(suiObjects: (SuiOwnedObject | SuiSharedObject)[]): Promise<void>;
|
|
193
|
-
/**
|
|
194
|
-
* @description Select coins that add up to the given amount.
|
|
195
|
-
* @param addr the address of the owner
|
|
196
|
-
* @param amount the amount that is needed for the coin
|
|
197
|
-
* @param coinType the coin type, default is '0x2::SUI::SUI'
|
|
198
|
-
*/
|
|
199
|
-
selectCoins(addr: string, amount: number, coinType?: string): Promise<{
|
|
200
|
-
objectId: string;
|
|
201
|
-
digest: string;
|
|
202
|
-
version: string;
|
|
203
|
-
}[]>;
|
|
204
|
-
requestFaucet(address: SuiAddress, network: FaucetNetworkType): Promise<void>;
|
|
205
|
-
}
|