@0xobelisk/sui-client 0.5.16 → 0.5.18
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.js +360 -205
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +350 -195
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -5
- 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 +25 -6
- 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/suiInteractor.ts +4 -4
- package/src/libs/suiModel/suiOwnedObject.ts +6 -4
- package/src/libs/suiModel/suiSharedObject.ts +5 -3
- package/src/libs/suiTxBuilder/index.ts +102 -84
- package/src/libs/suiTxBuilder/util.ts +113 -42
- package/src/metadata/index.ts +2 -3
- package/src/obelisk.ts +200 -91
- package/src/types/index.ts +46 -32
- package/dist/index.d.ts +0 -14
- package/dist/libs/multiSig/client.d.ts +0 -15
- package/dist/libs/multiSig/index.d.ts +0 -1
- package/dist/libs/multiSig/publickey.d.ts +0 -2
- package/dist/libs/suiAccountManager/crypto.d.ts +0 -1
- package/dist/libs/suiAccountManager/index.d.ts +0 -35
- package/dist/libs/suiAccountManager/keypair.d.ts +0 -21
- package/dist/libs/suiAccountManager/util.d.ts +0 -29
- package/dist/libs/suiContractFactory/index.d.ts +0 -20
- package/dist/libs/suiContractFactory/types.d.ts +0 -49
- package/dist/libs/suiInteractor/index.d.ts +0 -1
- package/dist/libs/suiInteractor/suiInteractor.d.ts +0 -50
- package/dist/libs/suiInteractor/util.d.ts +0 -1
- package/dist/libs/suiModel/index.d.ts +0 -2
- package/dist/libs/suiModel/suiOwnedObject.d.ts +0 -24
- package/dist/libs/suiModel/suiSharedObject.d.ts +0 -11
- package/dist/libs/suiTxBuilder/index.d.ts +0 -333
- package/dist/libs/suiTxBuilder/util.d.ts +0 -58
- package/dist/metadata/index.d.ts +0 -3
- package/dist/obelisk.d.ts +0 -136
- package/dist/types/index.d.ts +0 -152
- package/dist/utils/index.d.ts +0 -3
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MultiSigPublicKey } from '@mysten/sui.js/multisig';
|
|
2
|
-
import type { PublicKey } from '@mysten/sui.js/src/cryptography';
|
|
3
|
-
export type PublicKeyWeightPair = {
|
|
4
|
-
publicKey: PublicKey;
|
|
5
|
-
weight: number;
|
|
6
|
-
};
|
|
7
|
-
export declare class MultiSigClient {
|
|
8
|
-
readonly pksWeightPairs: PublicKeyWeightPair[];
|
|
9
|
-
readonly threshold: number;
|
|
10
|
-
readonly multiSigPublicKey: MultiSigPublicKey;
|
|
11
|
-
constructor(pks: PublicKeyWeightPair[], threshold: number);
|
|
12
|
-
static fromRawEd25519PublicKeys(rawPublicKeys: string[], weights: number[], threshold: number): MultiSigClient;
|
|
13
|
-
multiSigAddress(): string;
|
|
14
|
-
combinePartialSigs(sigs: string[]): string;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MultiSigClient } from './client';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const generateMnemonic: (numberOfWords?: 12 | 24) => string;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Ed25519Keypair } from '@mysten/sui.js/keypairs/ed25519';
|
|
2
|
-
import type { AccountMangerParams, DerivePathParams } from '../../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/keypairs/ed25519';
|
|
2
|
-
import type { DerivePathParams } from '../../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,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description This regular expression matches any string that contains only hexadecimal digits (0-9, A-F, a-f).
|
|
3
|
-
* @param str
|
|
4
|
-
*/
|
|
5
|
-
export declare const isHex: (str: string) => boolean;
|
|
6
|
-
/**
|
|
7
|
-
* @description This regular expression matches any string that contains only base64 digits (0-9, A-Z, a-z, +, /, =).
|
|
8
|
-
* Note that the "=" signs at the end are optional padding characters that may be present in some base64 encoded strings.
|
|
9
|
-
* @param str
|
|
10
|
-
*/
|
|
11
|
-
export declare const isBase64: (str: string) => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Convert a hex string to Uint8Array
|
|
14
|
-
* @param hexStr
|
|
15
|
-
*/
|
|
16
|
-
export declare const fromHEX: (hexStr: string) => Uint8Array;
|
|
17
|
-
/**
|
|
18
|
-
* @description Convert a hex or base64 string to Uint8Array
|
|
19
|
-
*/
|
|
20
|
-
export declare const hexOrBase64ToUint8Array: (str: string) => Uint8Array;
|
|
21
|
-
/**
|
|
22
|
-
* normalize a private key
|
|
23
|
-
* A private key is a 32-byte array.
|
|
24
|
-
* But there are two different formats for private keys:
|
|
25
|
-
* 1. A 32-byte array
|
|
26
|
-
* 2. A 64-byte array with the first 32 bytes being the private key and the last 32 bytes being the public key
|
|
27
|
-
* 3. A 33-byte array with the first byte being 0x00 (sui.keystore key is a Base64 string with scheme flag 0x00 at the beginning)
|
|
28
|
-
*/
|
|
29
|
-
export declare const normalizePrivateKey: (key: Uint8Array) => Uint8Array;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { SuiMoveNormalizedModules } from '@mysten/sui.js/client';
|
|
2
|
-
import type { ContractFactoryParams } from './types';
|
|
3
|
-
export type ApiTypes = 'promise' | 'rxjs';
|
|
4
|
-
export declare class SuiContractFactory {
|
|
5
|
-
packageId: string;
|
|
6
|
-
metadata: SuiMoveNormalizedModules | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Support the following ways to init the SuiToolkit:
|
|
9
|
-
* 1. mnemonics
|
|
10
|
-
* 2. secretKey (base64 or hex)
|
|
11
|
-
* If none of them is provided, will generate a random mnemonics with 24 words.
|
|
12
|
-
*
|
|
13
|
-
* @param mnemonics, 12 or 24 mnemonics words, separated by space
|
|
14
|
-
* @param secretKey, base64 or hex string, when mnemonics is provided, secretKey will be ignored
|
|
15
|
-
*/
|
|
16
|
-
constructor({ packageId, metadata }?: ContractFactoryParams);
|
|
17
|
-
getFuncByModuleName(moduleName: string): void;
|
|
18
|
-
getAllFunc(): void;
|
|
19
|
-
getAllModule(): void;
|
|
20
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { SuiMoveNormalizedModules, SuiMoveNormalizedType } from '@mysten/sui.js/client';
|
|
2
|
-
export type ContractFactoryParams = {
|
|
3
|
-
packageId?: string;
|
|
4
|
-
metadata?: SuiMoveNormalizedModules;
|
|
5
|
-
};
|
|
6
|
-
export type SuiMoveMoudleValueType = {
|
|
7
|
-
address: string;
|
|
8
|
-
name: string;
|
|
9
|
-
fileFormatVersion: number;
|
|
10
|
-
friends: {
|
|
11
|
-
address: string;
|
|
12
|
-
name: string;
|
|
13
|
-
}[];
|
|
14
|
-
structs: Record<string, {
|
|
15
|
-
fields: {
|
|
16
|
-
type: SuiMoveNormalizedType;
|
|
17
|
-
name: string;
|
|
18
|
-
}[];
|
|
19
|
-
abilities: {
|
|
20
|
-
abilities: string[];
|
|
21
|
-
};
|
|
22
|
-
typeParameters: {
|
|
23
|
-
constraints: {
|
|
24
|
-
abilities: string[];
|
|
25
|
-
};
|
|
26
|
-
isPhantom: boolean;
|
|
27
|
-
}[];
|
|
28
|
-
}>;
|
|
29
|
-
exposedFunctions: Record<string, {
|
|
30
|
-
visibility: 'Private' | 'Public' | 'Friend';
|
|
31
|
-
isEntry: boolean;
|
|
32
|
-
typeParameters: {
|
|
33
|
-
abilities: string[];
|
|
34
|
-
}[];
|
|
35
|
-
parameters: SuiMoveNormalizedType[];
|
|
36
|
-
return: SuiMoveNormalizedType[];
|
|
37
|
-
}>;
|
|
38
|
-
};
|
|
39
|
-
export type SuiMoveMoudleFuncType = {
|
|
40
|
-
moduleName: string;
|
|
41
|
-
funcName: string;
|
|
42
|
-
visibility: 'Private' | 'Public' | 'Friend';
|
|
43
|
-
isEntry: boolean;
|
|
44
|
-
typeParameters: {
|
|
45
|
-
abilities: string[];
|
|
46
|
-
}[];
|
|
47
|
-
parameters: SuiMoveNormalizedType[];
|
|
48
|
-
return: SuiMoveNormalizedType[];
|
|
49
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SuiInteractor } from './suiInteractor';
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { SuiClient } from '@mysten/sui.js/client';
|
|
2
|
-
import type { SuiTransactionBlockResponse, SuiObjectDataOptions, SuiObjectData } from '@mysten/sui.js/client';
|
|
3
|
-
import type * as RpcTypes from '@mysten/sui.js/dist/cjs/client/types/generated';
|
|
4
|
-
import { FaucetNetworkType, NetworkType } from '../../types';
|
|
5
|
-
import { SuiOwnedObject, SuiSharedObject } from '../suiModel';
|
|
6
|
-
/**
|
|
7
|
-
* `SuiTransactionSender` is used to send transaction with a given gas coin.
|
|
8
|
-
* It always uses the gas coin to pay for the gas,
|
|
9
|
-
* and update the gas coin after the transaction.
|
|
10
|
-
*/
|
|
11
|
-
export declare class SuiInteractor {
|
|
12
|
-
readonly clients: SuiClient[];
|
|
13
|
-
currentClient: SuiClient;
|
|
14
|
-
readonly fullNodes: string[];
|
|
15
|
-
currentFullNode: string;
|
|
16
|
-
network?: NetworkType;
|
|
17
|
-
constructor(fullNodeUrls: string[], network?: NetworkType);
|
|
18
|
-
switchToNextClient(): void;
|
|
19
|
-
sendTx(transactionBlock: Uint8Array | string, signature: string | string[]): Promise<SuiTransactionBlockResponse>;
|
|
20
|
-
getObjects(ids: string[], options?: SuiObjectDataOptions): Promise<SuiObjectData[]>;
|
|
21
|
-
getObject(id: string): Promise<SuiObjectData>;
|
|
22
|
-
getDynamicFieldObject(parentId: string, name: RpcTypes.DynamicFieldName): Promise<RpcTypes.SuiObjectResponse>;
|
|
23
|
-
getDynamicFields(parentId: string, cursor?: string, limit?: number): Promise<import("@mysten/sui.js/client").DynamicFieldPage>;
|
|
24
|
-
getTxDetails(digest: string): Promise<SuiTransactionBlockResponse>;
|
|
25
|
-
getOwnedObjects(owner: string, cursor?: string, limit?: number): Promise<RpcTypes.PaginatedObjectsResponse>;
|
|
26
|
-
getNormalizedMoveModulesByPackage(packageId: string): Promise<import("@mysten/sui.js/client").SuiMoveNormalizedModules>;
|
|
27
|
-
/**
|
|
28
|
-
* @description Update objects in a batch
|
|
29
|
-
* @param suiObjects
|
|
30
|
-
*/
|
|
31
|
-
updateObjects(suiObjects: (SuiOwnedObject | SuiSharedObject)[]): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* @description Select coins that add up to the given amount.
|
|
34
|
-
* @param addr the address of the owner
|
|
35
|
-
* @param amount the amount that is needed for the coin
|
|
36
|
-
* @param coinType the coin type, default is '0x2::SUI::SUI'
|
|
37
|
-
*/
|
|
38
|
-
selectCoins(addr: string, amount: number, coinType?: string): Promise<{
|
|
39
|
-
objectId: string;
|
|
40
|
-
digest: string;
|
|
41
|
-
version: string;
|
|
42
|
-
}[]>;
|
|
43
|
-
/**
|
|
44
|
-
* @description Select owned objects with objectType.
|
|
45
|
-
* @param addr the address of the owner
|
|
46
|
-
* @param objectType the coin type, default is '0x2::SUI::SUI'
|
|
47
|
-
*/
|
|
48
|
-
selectObjects(addr: string, objectType: string): Promise<SuiObjectData[]>;
|
|
49
|
-
requestFaucet(address: string, network: FaucetNetworkType): Promise<void>;
|
|
50
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const delay: (ms: number) => Promise<unknown>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { SuiTransactionBlockResponse } from '@mysten/sui.js/client';
|
|
2
|
-
import type { CallArg } from '@mysten/sui.js/bcs';
|
|
3
|
-
export declare class SuiOwnedObject {
|
|
4
|
-
readonly objectId: string;
|
|
5
|
-
version?: string;
|
|
6
|
-
digest?: string;
|
|
7
|
-
constructor(param: {
|
|
8
|
-
objectId: string;
|
|
9
|
-
version?: string;
|
|
10
|
-
digest?: string;
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* Check if the object is fully initialized.
|
|
14
|
-
* So that when it's used as an input, it won't be necessary to fetch from fullnode again.
|
|
15
|
-
* Which can save time when sending transactions.
|
|
16
|
-
*/
|
|
17
|
-
isFullObject(): boolean;
|
|
18
|
-
asCallArg(): CallArg | string;
|
|
19
|
-
/**
|
|
20
|
-
* Update object version & digest based on the transaction response.
|
|
21
|
-
* @param txResponse
|
|
22
|
-
*/
|
|
23
|
-
updateFromTxResponse(txResponse: SuiTransactionBlockResponse): void;
|
|
24
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CallArg } from '@mysten/sui.js/bcs';
|
|
2
|
-
export declare class SuiSharedObject {
|
|
3
|
-
readonly objectId: string;
|
|
4
|
-
initialSharedVersion?: string;
|
|
5
|
-
constructor(param: {
|
|
6
|
-
objectId: string;
|
|
7
|
-
initialSharedVersion?: string;
|
|
8
|
-
mutable?: boolean;
|
|
9
|
-
});
|
|
10
|
-
asCallArg(mutable?: boolean): CallArg | string;
|
|
11
|
-
}
|
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
2
|
-
import type { SuiClient, SuiObjectRef } from '@mysten/sui.js/client';
|
|
3
|
-
import type { TransactionObjectArgument } from '@mysten/sui.js/transactions';
|
|
4
|
-
import type { TransactionExpiration, SharedObjectRef } from '@mysten/sui.js/bcs';
|
|
5
|
-
import type { Keypair } from '@mysten/sui.js/cryptography';
|
|
6
|
-
import type { ObjectCallArg, TransactionType, SuiTxArg, SuiAddressArg, SuiObjectArg, SuiVecTxArg } from '../../types';
|
|
7
|
-
export declare class SuiTxBlock {
|
|
8
|
-
txBlock: TransactionBlock;
|
|
9
|
-
constructor(transaction?: TransactionBlock);
|
|
10
|
-
get gas(): TransactionObjectArgument;
|
|
11
|
-
get blockData(): {
|
|
12
|
-
version: 1;
|
|
13
|
-
inputs: ({
|
|
14
|
-
index: number;
|
|
15
|
-
kind: "Input";
|
|
16
|
-
value?: any;
|
|
17
|
-
type?: "object" | undefined;
|
|
18
|
-
} | {
|
|
19
|
-
index: number;
|
|
20
|
-
kind: "Input";
|
|
21
|
-
type: "pure";
|
|
22
|
-
value?: any;
|
|
23
|
-
})[];
|
|
24
|
-
transactions: ({
|
|
25
|
-
kind: "MoveCall";
|
|
26
|
-
arguments: ({
|
|
27
|
-
index: number;
|
|
28
|
-
kind: "Input";
|
|
29
|
-
value?: any;
|
|
30
|
-
type?: "object" | undefined;
|
|
31
|
-
} | {
|
|
32
|
-
index: number;
|
|
33
|
-
kind: "Input";
|
|
34
|
-
type: "pure";
|
|
35
|
-
value?: any;
|
|
36
|
-
} | {
|
|
37
|
-
kind: "GasCoin";
|
|
38
|
-
} | {
|
|
39
|
-
index: number;
|
|
40
|
-
kind: "Result";
|
|
41
|
-
} | {
|
|
42
|
-
index: number;
|
|
43
|
-
resultIndex: number;
|
|
44
|
-
kind: "NestedResult";
|
|
45
|
-
})[];
|
|
46
|
-
target: `${string}::${string}::${string}`;
|
|
47
|
-
typeArguments: string[];
|
|
48
|
-
} | {
|
|
49
|
-
address: {
|
|
50
|
-
index: number;
|
|
51
|
-
kind: "Input";
|
|
52
|
-
value?: any;
|
|
53
|
-
type?: "object" | undefined;
|
|
54
|
-
} | {
|
|
55
|
-
index: number;
|
|
56
|
-
kind: "Input";
|
|
57
|
-
type: "pure";
|
|
58
|
-
value?: any;
|
|
59
|
-
} | {
|
|
60
|
-
kind: "GasCoin";
|
|
61
|
-
} | {
|
|
62
|
-
index: number;
|
|
63
|
-
kind: "Result";
|
|
64
|
-
} | {
|
|
65
|
-
index: number;
|
|
66
|
-
resultIndex: number;
|
|
67
|
-
kind: "NestedResult";
|
|
68
|
-
};
|
|
69
|
-
kind: "TransferObjects";
|
|
70
|
-
objects: ({
|
|
71
|
-
index: number;
|
|
72
|
-
kind: "Input";
|
|
73
|
-
value?: any;
|
|
74
|
-
type?: "object" | undefined;
|
|
75
|
-
} | {
|
|
76
|
-
index: number;
|
|
77
|
-
kind: "Input";
|
|
78
|
-
type: "pure";
|
|
79
|
-
value?: any;
|
|
80
|
-
} | {
|
|
81
|
-
kind: "GasCoin";
|
|
82
|
-
} | {
|
|
83
|
-
index: number;
|
|
84
|
-
kind: "Result";
|
|
85
|
-
} | {
|
|
86
|
-
index: number;
|
|
87
|
-
resultIndex: number;
|
|
88
|
-
kind: "NestedResult";
|
|
89
|
-
})[];
|
|
90
|
-
} | {
|
|
91
|
-
kind: "SplitCoins";
|
|
92
|
-
coin: {
|
|
93
|
-
index: number;
|
|
94
|
-
kind: "Input";
|
|
95
|
-
value?: any;
|
|
96
|
-
type?: "object" | undefined;
|
|
97
|
-
} | {
|
|
98
|
-
index: number;
|
|
99
|
-
kind: "Input";
|
|
100
|
-
type: "pure";
|
|
101
|
-
value?: any;
|
|
102
|
-
} | {
|
|
103
|
-
kind: "GasCoin";
|
|
104
|
-
} | {
|
|
105
|
-
index: number;
|
|
106
|
-
kind: "Result";
|
|
107
|
-
} | {
|
|
108
|
-
index: number;
|
|
109
|
-
resultIndex: number;
|
|
110
|
-
kind: "NestedResult";
|
|
111
|
-
};
|
|
112
|
-
amounts: ({
|
|
113
|
-
index: number;
|
|
114
|
-
kind: "Input";
|
|
115
|
-
value?: any;
|
|
116
|
-
type?: "object" | undefined;
|
|
117
|
-
} | {
|
|
118
|
-
index: number;
|
|
119
|
-
kind: "Input";
|
|
120
|
-
type: "pure";
|
|
121
|
-
value?: any;
|
|
122
|
-
} | {
|
|
123
|
-
kind: "GasCoin";
|
|
124
|
-
} | {
|
|
125
|
-
index: number;
|
|
126
|
-
kind: "Result";
|
|
127
|
-
} | {
|
|
128
|
-
index: number;
|
|
129
|
-
resultIndex: number;
|
|
130
|
-
kind: "NestedResult";
|
|
131
|
-
})[];
|
|
132
|
-
} | {
|
|
133
|
-
kind: "MergeCoins";
|
|
134
|
-
destination: {
|
|
135
|
-
index: number;
|
|
136
|
-
kind: "Input";
|
|
137
|
-
value?: any;
|
|
138
|
-
type?: "object" | undefined;
|
|
139
|
-
} | {
|
|
140
|
-
index: number;
|
|
141
|
-
kind: "Input";
|
|
142
|
-
type: "pure";
|
|
143
|
-
value?: any;
|
|
144
|
-
} | {
|
|
145
|
-
kind: "GasCoin";
|
|
146
|
-
} | {
|
|
147
|
-
index: number;
|
|
148
|
-
kind: "Result";
|
|
149
|
-
} | {
|
|
150
|
-
index: number;
|
|
151
|
-
resultIndex: number;
|
|
152
|
-
kind: "NestedResult";
|
|
153
|
-
};
|
|
154
|
-
sources: ({
|
|
155
|
-
index: number;
|
|
156
|
-
kind: "Input";
|
|
157
|
-
value?: any;
|
|
158
|
-
type?: "object" | undefined;
|
|
159
|
-
} | {
|
|
160
|
-
index: number;
|
|
161
|
-
kind: "Input";
|
|
162
|
-
type: "pure";
|
|
163
|
-
value?: any;
|
|
164
|
-
} | {
|
|
165
|
-
kind: "GasCoin";
|
|
166
|
-
} | {
|
|
167
|
-
index: number;
|
|
168
|
-
kind: "Result";
|
|
169
|
-
} | {
|
|
170
|
-
index: number;
|
|
171
|
-
resultIndex: number;
|
|
172
|
-
kind: "NestedResult";
|
|
173
|
-
})[];
|
|
174
|
-
} | {
|
|
175
|
-
kind: "Publish";
|
|
176
|
-
modules: number[][];
|
|
177
|
-
dependencies: string[];
|
|
178
|
-
} | {
|
|
179
|
-
kind: "Upgrade";
|
|
180
|
-
modules: number[][];
|
|
181
|
-
dependencies: string[];
|
|
182
|
-
packageId: string;
|
|
183
|
-
ticket: {
|
|
184
|
-
index: number;
|
|
185
|
-
kind: "Input";
|
|
186
|
-
value?: any;
|
|
187
|
-
type?: "object" | undefined;
|
|
188
|
-
} | {
|
|
189
|
-
index: number;
|
|
190
|
-
kind: "Input";
|
|
191
|
-
type: "pure";
|
|
192
|
-
value?: any;
|
|
193
|
-
} | {
|
|
194
|
-
kind: "GasCoin";
|
|
195
|
-
} | {
|
|
196
|
-
index: number;
|
|
197
|
-
kind: "Result";
|
|
198
|
-
} | {
|
|
199
|
-
index: number;
|
|
200
|
-
resultIndex: number;
|
|
201
|
-
kind: "NestedResult";
|
|
202
|
-
};
|
|
203
|
-
} | {
|
|
204
|
-
kind: "MakeMoveVec";
|
|
205
|
-
type: {
|
|
206
|
-
Some: import("@mysten/sui.js/bcs").TypeTag;
|
|
207
|
-
} | {
|
|
208
|
-
None: true | null;
|
|
209
|
-
};
|
|
210
|
-
objects: ({
|
|
211
|
-
index: number;
|
|
212
|
-
kind: "Input";
|
|
213
|
-
value?: any;
|
|
214
|
-
type?: "object" | undefined;
|
|
215
|
-
} | {
|
|
216
|
-
index: number;
|
|
217
|
-
kind: "Input";
|
|
218
|
-
type: "pure";
|
|
219
|
-
value?: any;
|
|
220
|
-
} | {
|
|
221
|
-
kind: "GasCoin";
|
|
222
|
-
} | {
|
|
223
|
-
index: number;
|
|
224
|
-
kind: "Result";
|
|
225
|
-
} | {
|
|
226
|
-
index: number;
|
|
227
|
-
resultIndex: number;
|
|
228
|
-
kind: "NestedResult";
|
|
229
|
-
})[];
|
|
230
|
-
})[];
|
|
231
|
-
gasConfig: {
|
|
232
|
-
payment?: {
|
|
233
|
-
digest: string;
|
|
234
|
-
objectId: string;
|
|
235
|
-
version: string | number | bigint;
|
|
236
|
-
}[] | undefined;
|
|
237
|
-
owner?: string | undefined;
|
|
238
|
-
price?: string | number | bigint | undefined;
|
|
239
|
-
budget?: string | number | bigint | undefined;
|
|
240
|
-
};
|
|
241
|
-
sender?: string | undefined;
|
|
242
|
-
expiration?: {
|
|
243
|
-
Epoch: number;
|
|
244
|
-
} | {
|
|
245
|
-
None: true | null;
|
|
246
|
-
} | null | undefined;
|
|
247
|
-
};
|
|
248
|
-
address(value: string): {
|
|
249
|
-
index: number;
|
|
250
|
-
kind: "Input";
|
|
251
|
-
value?: any;
|
|
252
|
-
type?: "object" | undefined;
|
|
253
|
-
} | {
|
|
254
|
-
index: number;
|
|
255
|
-
kind: "Input";
|
|
256
|
-
type: "pure";
|
|
257
|
-
value?: any;
|
|
258
|
-
};
|
|
259
|
-
pure(value: unknown, type?: string): {
|
|
260
|
-
index: number;
|
|
261
|
-
kind: "Input";
|
|
262
|
-
value?: any;
|
|
263
|
-
type?: "object" | undefined;
|
|
264
|
-
} | {
|
|
265
|
-
index: number;
|
|
266
|
-
kind: "Input";
|
|
267
|
-
type: "pure";
|
|
268
|
-
value?: any;
|
|
269
|
-
};
|
|
270
|
-
object(value: string | ObjectCallArg): TransactionObjectArgument;
|
|
271
|
-
objectRef(ref: SuiObjectRef): TransactionObjectArgument;
|
|
272
|
-
sharedObjectRef(ref: SharedObjectRef): TransactionObjectArgument;
|
|
273
|
-
setSender(sender: string): void;
|
|
274
|
-
setSenderIfNotSet(sender: string): void;
|
|
275
|
-
setExpiration(expiration?: TransactionExpiration): void;
|
|
276
|
-
setGasPrice(price: number | bigint): void;
|
|
277
|
-
setGasBudget(budget: number | bigint): void;
|
|
278
|
-
setGasOwner(owner: string): void;
|
|
279
|
-
setGasPayment(payments: SuiObjectRef[]): void;
|
|
280
|
-
serialize(): string;
|
|
281
|
-
sign(params: {
|
|
282
|
-
signer: Keypair;
|
|
283
|
-
client?: SuiClient;
|
|
284
|
-
onlyTransactionKind?: boolean;
|
|
285
|
-
}): Promise<import("@mysten/sui.js/cryptography").SignatureWithBytes>;
|
|
286
|
-
build(params?: {
|
|
287
|
-
client?: SuiClient;
|
|
288
|
-
onlyTransactionKind?: boolean;
|
|
289
|
-
}): Promise<Uint8Array>;
|
|
290
|
-
getDigest(params?: {
|
|
291
|
-
client?: SuiClient;
|
|
292
|
-
}): Promise<string>;
|
|
293
|
-
add(...args: TransactionType): import("@mysten/sui.js/transactions").TransactionResult;
|
|
294
|
-
publish({ modules, dependencies, }: {
|
|
295
|
-
modules: number[][] | string[];
|
|
296
|
-
dependencies: string[];
|
|
297
|
-
}): import("@mysten/sui.js/transactions").TransactionResult;
|
|
298
|
-
upgrade({ modules, dependencies, packageId, ticket, }: {
|
|
299
|
-
modules: number[][] | string[];
|
|
300
|
-
dependencies: string[];
|
|
301
|
-
packageId: string;
|
|
302
|
-
ticket: TransactionObjectArgument | string;
|
|
303
|
-
}): import("@mysten/sui.js/transactions").TransactionResult;
|
|
304
|
-
makeMoveVec({ objects, type, }: {
|
|
305
|
-
objects: (TransactionObjectArgument | string)[];
|
|
306
|
-
type?: string;
|
|
307
|
-
}): import("@mysten/sui.js/transactions").TransactionResult;
|
|
308
|
-
transferObjects(objects: SuiObjectArg[], address: SuiAddressArg): import("@mysten/sui.js/transactions").TransactionResult;
|
|
309
|
-
splitCoins(coin: SuiObjectArg, amounts: SuiTxArg[]): {
|
|
310
|
-
index: number;
|
|
311
|
-
resultIndex: number;
|
|
312
|
-
kind: "NestedResult";
|
|
313
|
-
}[];
|
|
314
|
-
mergeCoins(destination: SuiObjectArg, sources: SuiObjectArg[]): import("@mysten/sui.js/transactions").TransactionResult;
|
|
315
|
-
/**
|
|
316
|
-
* @description Move call
|
|
317
|
-
* @param target `${string}::${string}::${string}`, e.g. `0x3::sui_system::request_add_stake`
|
|
318
|
-
* @param args the arguments of the move call, such as `['0x1', '0x2']`
|
|
319
|
-
* @param typeArgs the type arguments of the move call, such as `['0x2::sui::SUI']`
|
|
320
|
-
*/
|
|
321
|
-
moveCall(target: string, args?: (SuiTxArg | SuiVecTxArg)[], typeArgs?: string[]): import("@mysten/sui.js/transactions").TransactionResult;
|
|
322
|
-
transferSuiToMany(recipients: SuiAddressArg[], amounts: SuiTxArg[]): this;
|
|
323
|
-
transferSui(address: SuiAddressArg, amount: SuiTxArg): this;
|
|
324
|
-
takeAmountFromCoins(coins: SuiObjectArg[], amount: SuiTxArg): TransactionObjectArgument[];
|
|
325
|
-
splitSUIFromGas(amounts: SuiTxArg[]): import("@mysten/sui.js/transactions").TransactionResult;
|
|
326
|
-
splitMultiCoins(coins: SuiObjectArg[], amounts: SuiTxArg[]): {
|
|
327
|
-
splitedCoins: import("@mysten/sui.js/transactions").TransactionResult;
|
|
328
|
-
mergedCoin: TransactionObjectArgument;
|
|
329
|
-
};
|
|
330
|
-
transferCoinToMany(coins: SuiObjectArg[], sender: SuiAddressArg, recipients: SuiAddressArg[], amounts: SuiTxArg[]): this;
|
|
331
|
-
transferCoin(coins: SuiObjectArg[], sender: SuiAddressArg, recipient: SuiAddressArg, amount: SuiTxArg): this;
|
|
332
|
-
stakeSui(amount: SuiTxArg, validatorAddr: SuiAddressArg): import("@mysten/sui.js/transactions").TransactionResult;
|
|
333
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { TransactionArgument, TransactionBlock, TransactionObjectArgument } from '@mysten/sui.js/transactions';
|
|
2
|
-
import type { SuiInputTypes, SuiObjectArg, SuiAddressArg, SuiTxArg, SuiVecTxArg } from '../../types';
|
|
3
|
-
export declare const getDefaultSuiInputType: (value: SuiTxArg) => SuiInputTypes | undefined;
|
|
4
|
-
/**
|
|
5
|
-
* Since we know the elements in the array are the same type
|
|
6
|
-
* If type is not provided, we will try to infer the type from the first element
|
|
7
|
-
* By default,
|
|
8
|
-
*
|
|
9
|
-
* string is hex and its length equal to 32 =====> object id
|
|
10
|
-
* number, bigint ====> u64
|
|
11
|
-
* boolean =====> bool
|
|
12
|
-
*
|
|
13
|
-
* If type is provided, we will use the type to convert the array
|
|
14
|
-
* @param args
|
|
15
|
-
* @param type 'address' | 'bool' | 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'signer' | 'object' | string
|
|
16
|
-
*/
|
|
17
|
-
export declare function makeVecParam(txBlock: TransactionBlock, args: SuiTxArg[], type?: SuiInputTypes): TransactionArgument;
|
|
18
|
-
/**
|
|
19
|
-
* Check whether it is an valid move vec input.
|
|
20
|
-
*
|
|
21
|
-
* @param arg The argument to check.
|
|
22
|
-
* @returns boolean.
|
|
23
|
-
*/
|
|
24
|
-
export declare function isMoveVecArg(arg: SuiTxArg | SuiVecTxArg): arg is SuiVecTxArg;
|
|
25
|
-
/**
|
|
26
|
-
* Convert any valid input into array of TransactionArgument.
|
|
27
|
-
*
|
|
28
|
-
* @param txb The Transaction Block
|
|
29
|
-
* @param args The array of argument to convert.
|
|
30
|
-
* @returns The converted array of TransactionArgument.
|
|
31
|
-
*/
|
|
32
|
-
export declare function convertArgs(txBlock: TransactionBlock, args: (SuiTxArg | SuiVecTxArg)[]): ({
|
|
33
|
-
index: number;
|
|
34
|
-
kind: "Input";
|
|
35
|
-
type: "pure";
|
|
36
|
-
value?: any;
|
|
37
|
-
} | TransactionObjectArgument | import("@mysten/bcs").SerializedBcs<unknown, unknown>)[];
|
|
38
|
-
/**
|
|
39
|
-
* Convert any valid address input into a TransactionArgument.
|
|
40
|
-
*
|
|
41
|
-
* @param txb The Transaction Block
|
|
42
|
-
* @param arg The address argument to convert.
|
|
43
|
-
* @returns The converted TransactionArgument.
|
|
44
|
-
*/
|
|
45
|
-
export declare function convertAddressArg(txBlock: TransactionBlock, arg: SuiAddressArg): TransactionObjectArgument | {
|
|
46
|
-
index: number;
|
|
47
|
-
kind: "Input";
|
|
48
|
-
type: "pure";
|
|
49
|
-
value?: any;
|
|
50
|
-
} | import("@mysten/bcs").SerializedBcs<unknown, unknown>;
|
|
51
|
-
/**
|
|
52
|
-
* Convert any valid object input into a TransactionArgument.
|
|
53
|
-
*
|
|
54
|
-
* @param txb The Transaction Block
|
|
55
|
-
* @param arg The object argument to convert.
|
|
56
|
-
* @returns The converted TransactionArgument.
|
|
57
|
-
*/
|
|
58
|
-
export declare function convertObjArg(txb: TransactionBlock, arg: SuiObjectArg): TransactionObjectArgument;
|