@scallop-io/sui-scallop-sdk 1.5.0-alpha.1 → 1.5.1
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.mts +3161 -0
- package/dist/index.d.ts +3161 -3
- package/dist/index.js +78 -9966
- package/dist/index.mjs +15 -9892
- package/package.json +5 -6
- package/src/builders/coreBuilder.ts +10 -14
- package/src/builders/oracle.ts +10 -2
- package/src/constants/coinGecko.ts +14 -4
- package/src/constants/common.ts +8 -1
- package/src/constants/enum.ts +28 -57
- package/src/constants/poolAddress.ts +294 -344
- package/src/constants/pyth.ts +4 -1
- package/src/constants/testAddress.ts +487 -61
- package/src/constants/xoracle.ts +18 -16
- package/src/models/scallopAddress.ts +54 -0
- package/src/models/scallopQuery.ts +8 -12
- package/src/queries/coreQuery.ts +4 -4
- package/src/queries/poolAddressesQuery.ts +2 -2
- package/src/queries/portfolioQuery.ts +7 -8
- package/src/queries/xOracleQuery.ts +15 -7
- package/src/types/address.ts +5 -0
- package/src/types/model.ts +1 -0
- package/src/utils/util.ts +8 -3
- package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
- package/dist/builders/coreBuilder.d.ts +0 -12
- package/dist/builders/index.d.ts +0 -12
- package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
- package/dist/builders/oracle.d.ts +0 -14
- package/dist/builders/referralBuilder.d.ts +0 -12
- package/dist/builders/sCoinBuilder.d.ts +0 -4
- package/dist/builders/spoolBuilder.d.ts +0 -12
- package/dist/builders/vescaBuilder.d.ts +0 -25
- package/dist/constants/cache.d.ts +0 -14
- package/dist/constants/coinGecko.d.ts +0 -2
- package/dist/constants/common.d.ts +0 -20
- package/dist/constants/enum.d.ts +0 -14
- package/dist/constants/flashloan.d.ts +0 -2
- package/dist/constants/index.d.ts +0 -13
- package/dist/constants/poolAddress.d.ts +0 -27
- package/dist/constants/pyth.d.ts +0 -5
- package/dist/constants/queryKeys.d.ts +0 -54
- package/dist/constants/rpc.d.ts +0 -1
- package/dist/constants/testAddress.d.ts +0 -2
- package/dist/constants/vesca.d.ts +0 -5
- package/dist/constants/xoracle.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/models/index.d.ts +0 -8
- package/dist/models/scallop.d.ts +0 -73
- package/dist/models/scallopAddress.d.ts +0 -150
- package/dist/models/scallopBuilder.d.ts +0 -90
- package/dist/models/scallopCache.d.ts +0 -81
- package/dist/models/scallopClient.d.ts +0 -321
- package/dist/models/scallopIndexer.d.ts +0 -90
- package/dist/models/scallopPrice.d.ts +0 -0
- package/dist/models/scallopQuery.d.ts +0 -704
- package/dist/models/scallopUtils.d.ts +0 -229
- package/dist/models/suiKit.d.ts +0 -2
- package/dist/queries/borrowIncentiveQuery.d.ts +0 -82
- package/dist/queries/borrowLimitQuery.d.ts +0 -9
- package/dist/queries/coreQuery.d.ts +0 -171
- package/dist/queries/index.d.ts +0 -15
- package/dist/queries/isolatedAssetQuery.d.ts +0 -14
- package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
- package/dist/queries/objectsQuery.d.ts +0 -2
- package/dist/queries/poolAddressesQuery.d.ts +0 -29
- package/dist/queries/portfolioQuery.d.ts +0 -143
- package/dist/queries/priceQuery.d.ts +0 -58
- package/dist/queries/referralQuery.d.ts +0 -7
- package/dist/queries/sCoinQuery.d.ts +0 -41
- package/dist/queries/spoolQuery.d.ts +0 -74
- package/dist/queries/supplyLimitQuery.d.ts +0 -9
- package/dist/queries/vescaQuery.d.ts +0 -36
- package/dist/queries/xOracleQuery.d.ts +0 -13
- package/dist/types/address.d.ts +0 -108
- package/dist/types/builder/borrowIncentive.d.ts +0 -35
- package/dist/types/builder/core.d.ts +0 -56
- package/dist/types/builder/index.d.ts +0 -24
- package/dist/types/builder/loyaltyProgram.d.ts +0 -23
- package/dist/types/builder/referral.d.ts +0 -30
- package/dist/types/builder/sCoin.d.ts +0 -37
- package/dist/types/builder/spool.d.ts +0 -29
- package/dist/types/builder/vesca.d.ts +0 -51
- package/dist/types/constant/common.d.ts +0 -24
- package/dist/types/constant/enum.d.ts +0 -48
- package/dist/types/constant/index.d.ts +0 -3
- package/dist/types/constant/xOracle.d.ts +0 -9
- package/dist/types/index.d.ts +0 -6
- package/dist/types/model.d.ts +0 -60
- package/dist/types/query/borrowIncentive.d.ts +0 -124
- package/dist/types/query/core.d.ts +0 -380
- package/dist/types/query/index.d.ts +0 -7
- package/dist/types/query/loyaltyProgram.d.ts +0 -5
- package/dist/types/query/portfolio.d.ts +0 -119
- package/dist/types/query/sCoin.d.ts +0 -1
- package/dist/types/query/spool.d.ts +0 -142
- package/dist/types/query/vesca.d.ts +0 -26
- package/dist/types/utils.d.ts +0 -22
- package/dist/utils/builder.d.ts +0 -15
- package/dist/utils/core.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/indexer.d.ts +0 -17
- package/dist/utils/query.d.ts +0 -62
- package/dist/utils/util.d.ts +0 -27
package/dist/models/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './scallop';
|
|
2
|
-
export * from './scallopAddress';
|
|
3
|
-
export * from './scallopClient';
|
|
4
|
-
export * from './scallopBuilder';
|
|
5
|
-
export * from './scallopQuery';
|
|
6
|
-
export * from './scallopUtils';
|
|
7
|
-
export * from './scallopIndexer';
|
|
8
|
-
export * from './scallopCache';
|
package/dist/models/scallop.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { SuiKit } from '@scallop-io/sui-kit';
|
|
2
|
-
import { ScallopAddress } from './scallopAddress';
|
|
3
|
-
import { ScallopClient } from './scallopClient';
|
|
4
|
-
import { ScallopBuilder } from './scallopBuilder';
|
|
5
|
-
import { ScallopQuery } from './scallopQuery';
|
|
6
|
-
import { ScallopUtils } from './scallopUtils';
|
|
7
|
-
import type { ScallopBuilderParams, ScallopClientParams, ScallopParams, ScallopQueryParams, ScallopUtilsParams } from '../types/';
|
|
8
|
-
import { ScallopIndexer } from './scallopIndexer';
|
|
9
|
-
import { ScallopCache } from './scallopCache';
|
|
10
|
-
import { QueryClientConfig } from '@tanstack/query-core';
|
|
11
|
-
import type { QueryClient } from '@tanstack/query-core';
|
|
12
|
-
/**
|
|
13
|
-
* @argument params - The parameters for the Scallop instance.
|
|
14
|
-
* @argument cacheOptions - The cache options for the QueryClient.
|
|
15
|
-
*
|
|
16
|
-
* @description
|
|
17
|
-
* The main instance that controls interaction with the Scallop contract.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* const sdk = new Scallop(<parameters>);
|
|
22
|
-
* const scallopAddress = await sdk.getScallopAddress();
|
|
23
|
-
* const scallopBuilder = await sdk.createScallopBuilder();
|
|
24
|
-
* const scallopClient = await sdk.createScallopClient();
|
|
25
|
-
* const scallopIndexer= await sdk.createScallopIndexer();
|
|
26
|
-
* const scallopUtils= await sdk.createScallopUtils();
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare class Scallop {
|
|
30
|
-
params: ScallopParams;
|
|
31
|
-
suiKit: SuiKit;
|
|
32
|
-
cache: ScallopCache;
|
|
33
|
-
private address;
|
|
34
|
-
constructor(params: ScallopParams, cacheOptions?: QueryClientConfig, queryClient?: QueryClient);
|
|
35
|
-
/**
|
|
36
|
-
* Get a scallop address instance that already has read addresses.
|
|
37
|
-
*
|
|
38
|
-
* @param id - The API id of the addresses.
|
|
39
|
-
* @return Scallop Address.
|
|
40
|
-
*/
|
|
41
|
-
getScallopAddress(id?: string): Promise<ScallopAddress>;
|
|
42
|
-
/**
|
|
43
|
-
* Create a scallop builder instance that already has initial data.
|
|
44
|
-
*
|
|
45
|
-
* @return Scallop Builder.
|
|
46
|
-
*/
|
|
47
|
-
createScallopBuilder(params?: ScallopBuilderParams): Promise<ScallopBuilder>;
|
|
48
|
-
/**
|
|
49
|
-
* Create a scallop client instance that already has initial data.
|
|
50
|
-
*
|
|
51
|
-
* @param walletAddress - When user cannot provide a secret key or mnemonic, the scallop client cannot directly derive the address of the transaction the user wants to sign. This argument specifies the wallet address for signing the transaction.
|
|
52
|
-
* @return Scallop Client.
|
|
53
|
-
*/
|
|
54
|
-
createScallopClient(params?: ScallopClientParams): Promise<ScallopClient>;
|
|
55
|
-
/**
|
|
56
|
-
* Create a scallop query instance.
|
|
57
|
-
*
|
|
58
|
-
* @return Scallop Query.
|
|
59
|
-
*/
|
|
60
|
-
createScallopQuery(params?: ScallopQueryParams): Promise<ScallopQuery>;
|
|
61
|
-
/**
|
|
62
|
-
* Create a scallop indexer instance.
|
|
63
|
-
*
|
|
64
|
-
* @return Scallop Indexer.
|
|
65
|
-
*/
|
|
66
|
-
createScallopIndexer(): Promise<ScallopIndexer>;
|
|
67
|
-
/**
|
|
68
|
-
* Create a scallop utils instance.
|
|
69
|
-
*
|
|
70
|
-
* @return Scallop Utils.
|
|
71
|
-
*/
|
|
72
|
-
createScallopUtils(params?: ScallopUtilsParams): Promise<ScallopUtils>;
|
|
73
|
-
}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { type NetworkType } from '@scallop-io/sui-kit';
|
|
2
|
-
import type { ScallopAddressParams, AddressesInterface, AddressStringPath, ScallopAddressInstanceParams } from '../types';
|
|
3
|
-
import { ScallopCache } from './scallopCache';
|
|
4
|
-
/**
|
|
5
|
-
* @description
|
|
6
|
-
* It provides methods for managing addresses.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* const scallopAddress = new ScallopAddress(<parameters>);
|
|
11
|
-
* scallopAddress.<address functions>();
|
|
12
|
-
* await scallopAddress.<address async functions>();
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export declare class ScallopAddress {
|
|
16
|
-
private readonly _auth?;
|
|
17
|
-
private readonly _requestClient;
|
|
18
|
-
private _id?;
|
|
19
|
-
private _network;
|
|
20
|
-
private _currentAddresses?;
|
|
21
|
-
private _addressesMap;
|
|
22
|
-
cache: ScallopCache;
|
|
23
|
-
constructor(params: ScallopAddressParams, instance?: ScallopAddressInstanceParams);
|
|
24
|
-
/**
|
|
25
|
-
* Get addresses API id.
|
|
26
|
-
*
|
|
27
|
-
* @return The addresses API id.
|
|
28
|
-
*/
|
|
29
|
-
getId(): string | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Get the address at the provided path.
|
|
32
|
-
*
|
|
33
|
-
* @param path - The path of the address to get.
|
|
34
|
-
* @return The address at the provided path.
|
|
35
|
-
*/
|
|
36
|
-
get(path: AddressStringPath): any;
|
|
37
|
-
/**
|
|
38
|
-
* Sets the address for the specified path, it does not interact with the API.
|
|
39
|
-
*
|
|
40
|
-
* @param path - The path of the address to set.
|
|
41
|
-
* @param address - The address be setted to the tartget path.
|
|
42
|
-
* @return The addresses.
|
|
43
|
-
*/
|
|
44
|
-
set(path: AddressStringPath, address: string): AddressesInterface | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Synchronize the specified network addresses from the addresses map to the
|
|
47
|
-
* current addresses and change the default network to specified network.
|
|
48
|
-
*
|
|
49
|
-
* @param network - Specifies which network's addresses you want to get.
|
|
50
|
-
* @return Current addresses.
|
|
51
|
-
*/
|
|
52
|
-
switchCurrentAddresses(network: NetworkType): AddressesInterface | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Get the addresses, If `network` is not provided, returns the current
|
|
55
|
-
* addresses or the default network addresses in the addresses map.
|
|
56
|
-
*
|
|
57
|
-
* @param network - Specifies which network's addresses you want to get.
|
|
58
|
-
*/
|
|
59
|
-
getAddresses(network?: NetworkType): AddressesInterface | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* Set the addresses into addresses map. If the specified network is the same
|
|
62
|
-
* as the current network, the current addresses will be updated at the same time.
|
|
63
|
-
*
|
|
64
|
-
* @param addresses - The addresses be setted to the tartget network.
|
|
65
|
-
* @param network - Specifies which network's addresses you want to set.
|
|
66
|
-
* @return The addresses.
|
|
67
|
-
*/
|
|
68
|
-
setAddresses(addresses: AddressesInterface, network?: NetworkType): void;
|
|
69
|
-
/**
|
|
70
|
-
* Get all addresses.
|
|
71
|
-
*
|
|
72
|
-
* @return All addresses.
|
|
73
|
-
*/
|
|
74
|
-
getAllAddresses(): {
|
|
75
|
-
[k: string]: AddressesInterface;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Create a new addresses through the API and synchronize it back to the
|
|
79
|
-
* instance.
|
|
80
|
-
*
|
|
81
|
-
* @description
|
|
82
|
-
* If the `network` is not specified, the mainnet is used by default.
|
|
83
|
-
* If no `addresses` from instance or parameter is provided, an addresses with
|
|
84
|
-
* all empty strings is created by default.
|
|
85
|
-
*
|
|
86
|
-
* This function only allows for one addresses to be input into a specific network
|
|
87
|
-
* at a time, and does not provide an addresses map for setting addresses
|
|
88
|
-
* across all networks at once.
|
|
89
|
-
*
|
|
90
|
-
* @param params.addresses - The addresses be setted to the tartget network.
|
|
91
|
-
* @param params.network - Specifies which network's addresses you want to set.
|
|
92
|
-
* @param params.auth - The authentication API key.
|
|
93
|
-
* @param params.memo - Add memo to the addresses created in the API.
|
|
94
|
-
* @return All addresses.
|
|
95
|
-
*/
|
|
96
|
-
create(params?: {
|
|
97
|
-
addresses?: AddressesInterface | undefined;
|
|
98
|
-
network?: NetworkType | undefined;
|
|
99
|
-
auth?: string | undefined;
|
|
100
|
-
memo?: string | undefined;
|
|
101
|
-
}): Promise<{
|
|
102
|
-
[k: string]: AddressesInterface;
|
|
103
|
-
}>;
|
|
104
|
-
/**
|
|
105
|
-
* Read and synchronizes all addresses from the API into instance.
|
|
106
|
-
*
|
|
107
|
-
* @param id - The id of the addresses to get.
|
|
108
|
-
* @return All addresses.
|
|
109
|
-
*/
|
|
110
|
-
read(id?: string): Promise<{
|
|
111
|
-
[k: string]: AddressesInterface;
|
|
112
|
-
}>;
|
|
113
|
-
/**
|
|
114
|
-
* Update the addresses through the API and synchronize it back to the
|
|
115
|
-
* instance.
|
|
116
|
-
*
|
|
117
|
-
* @description
|
|
118
|
-
* If the `network` is not specified, the mainnet is used by default.
|
|
119
|
-
* If no `addresses` from instance or parameter is provided, an addresses with
|
|
120
|
-
* all empty strings is created by default.
|
|
121
|
-
*
|
|
122
|
-
* This function only allows for one addresses to be input into a specific network
|
|
123
|
-
* at a time, and does not provide an addresses map for setting addresses
|
|
124
|
-
* across all networks at once.
|
|
125
|
-
*
|
|
126
|
-
* @param params.id - The id of the addresses to update.
|
|
127
|
-
* @param params.addresses - The addresses be setted to the tartget network.
|
|
128
|
-
* @param params.network - Specifies which network's addresses you want to set.
|
|
129
|
-
* @param params.auth - The authentication api key.
|
|
130
|
-
* @param params.memo - Add memo to the addresses created in the API.
|
|
131
|
-
* @return All addresses.
|
|
132
|
-
*/
|
|
133
|
-
update(params?: {
|
|
134
|
-
id?: string;
|
|
135
|
-
addresses?: AddressesInterface | undefined;
|
|
136
|
-
network?: NetworkType | undefined;
|
|
137
|
-
auth?: string | undefined;
|
|
138
|
-
memo?: string | undefined;
|
|
139
|
-
}): Promise<{
|
|
140
|
-
[k: string]: AddressesInterface;
|
|
141
|
-
}>;
|
|
142
|
-
/**
|
|
143
|
-
* Deletes all addresses of a specified id through the API and clear all
|
|
144
|
-
* addresses in the instance.
|
|
145
|
-
*
|
|
146
|
-
* @param id - The id of the addresses to delete.
|
|
147
|
-
* @param auth - The authentication API key.
|
|
148
|
-
*/
|
|
149
|
-
delete(id?: string, auth?: string): Promise<void>;
|
|
150
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { SuiKit } from '@scallop-io/sui-kit';
|
|
2
|
-
import { ScallopAddress } from './scallopAddress';
|
|
3
|
-
import { ScallopQuery } from './scallopQuery';
|
|
4
|
-
import { ScallopUtils } from './scallopUtils';
|
|
5
|
-
import type { SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
6
|
-
import type { Transaction } from '@mysten/sui/transactions';
|
|
7
|
-
import type { SuiAmountsArg, SuiTxBlock as SuiKitTxBlock, SuiObjectArg, SuiTxArg, SuiVecTxArg } from '@scallop-io/sui-kit';
|
|
8
|
-
import type { ScallopBuilderParams, ScallopTxBlock, SupportMarketCoins, SupportAssetCoins, SupportSCoin, ScallopBuilderInstanceParams, SelectCoinReturnType } from '../types';
|
|
9
|
-
import { ScallopCache } from './scallopCache';
|
|
10
|
-
/**
|
|
11
|
-
* @description
|
|
12
|
-
* It provides methods for operating the transaction block, making it more convenient to organize transaction combinations.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* const scallopBuilder = new ScallopBuilder(<parameters>);
|
|
17
|
-
* await scallopBuilder.init();
|
|
18
|
-
* const txBlock = scallopBuilder.<builder functions>();
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare class ScallopBuilder {
|
|
22
|
-
readonly params: ScallopBuilderParams;
|
|
23
|
-
readonly isTestnet: boolean;
|
|
24
|
-
suiKit: SuiKit;
|
|
25
|
-
address: ScallopAddress;
|
|
26
|
-
query: ScallopQuery;
|
|
27
|
-
utils: ScallopUtils;
|
|
28
|
-
walletAddress: string;
|
|
29
|
-
cache: ScallopCache;
|
|
30
|
-
constructor(params?: ScallopBuilderParams, instance?: ScallopBuilderInstanceParams);
|
|
31
|
-
/**
|
|
32
|
-
* Request the scallop API to initialize data.
|
|
33
|
-
*
|
|
34
|
-
* @param force - Whether to force initialization.
|
|
35
|
-
* @param address - ScallopAddress instance.
|
|
36
|
-
*/
|
|
37
|
-
init(force?: boolean, address?: ScallopAddress): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Create a scallop txBlock instance that enhances transaction block.
|
|
40
|
-
*
|
|
41
|
-
* @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
|
|
42
|
-
* @return Scallop txBlock.
|
|
43
|
-
*/
|
|
44
|
-
createTxBlock(txBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction): ScallopTxBlock;
|
|
45
|
-
/**
|
|
46
|
-
* Specifying the sender's amount of coins to get coins args from transaction result.
|
|
47
|
-
*
|
|
48
|
-
* @param txBlock - Scallop txBlock or txBlock created by SuiKit .
|
|
49
|
-
* @param assetCoinName - Specific support asset coin name.
|
|
50
|
-
* @param amount - Amount of coins to be selected.
|
|
51
|
-
* @param sender - Sender address.
|
|
52
|
-
* @return Take coin and left coin.
|
|
53
|
-
*/
|
|
54
|
-
selectCoin<T extends SupportAssetCoins>(txBlock: ScallopTxBlock | SuiKitTxBlock, assetCoinName: T, amount: number, sender?: string): Promise<SelectCoinReturnType<T>>;
|
|
55
|
-
/**
|
|
56
|
-
* Specifying the sender's amount of market coins to get coins args from transaction result.
|
|
57
|
-
*
|
|
58
|
-
* @param txBlock - Scallop txBlock or txBlock created by SuiKit .
|
|
59
|
-
* @param marketCoinName - Specific support market coin name.
|
|
60
|
-
* @param amount - Amount of coins to be selected.
|
|
61
|
-
* @param sender - Sender address.
|
|
62
|
-
* @return Take coin and left coin.
|
|
63
|
-
*/
|
|
64
|
-
selectMarketCoin(txBlock: ScallopTxBlock | SuiKitTxBlock, marketCoinName: SupportMarketCoins, amount: number, sender?: string): Promise<{
|
|
65
|
-
takeCoin: import("@scallop-io/sui-kit").TransactionObjectArgument;
|
|
66
|
-
leftCoin: import("@scallop-io/sui-kit").TransactionObjectArgument;
|
|
67
|
-
totalAmount: number;
|
|
68
|
-
}>;
|
|
69
|
-
/**
|
|
70
|
-
* Specifying the sender's amount of sCoins to get coins args from transaction result.
|
|
71
|
-
*
|
|
72
|
-
* @param txBlock - Scallop txBlock or txBlock created by SuiKit .
|
|
73
|
-
* @param marketCoinName - Specific support sCoin name.
|
|
74
|
-
* @param amount - Amount of coins to be selected.
|
|
75
|
-
* @param sender - Sender address.
|
|
76
|
-
* @return Take coin and left coin.
|
|
77
|
-
*/
|
|
78
|
-
selectSCoin(txBlock: ScallopTxBlock | SuiKitTxBlock, sCoinName: SupportSCoin, amount: number, sender?: string): Promise<{
|
|
79
|
-
takeCoin: import("@scallop-io/sui-kit").TransactionObjectArgument;
|
|
80
|
-
leftCoin: import("@scallop-io/sui-kit").TransactionObjectArgument;
|
|
81
|
-
totalAmount: number;
|
|
82
|
-
}>;
|
|
83
|
-
/**
|
|
84
|
-
* Execute Scallop txBlock using the `signAndSendTxn` methods in suikit.
|
|
85
|
-
*
|
|
86
|
-
* @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
|
|
87
|
-
*/
|
|
88
|
-
signAndSendTxBlock(txBlock: ScallopTxBlock | SuiKitTxBlock | Transaction): Promise<SuiTransactionBlockResponse>;
|
|
89
|
-
moveCall(txb: ScallopTxBlock | SuiKitTxBlock, target: string, args?: (SuiTxArg | SuiVecTxArg | SuiObjectArg | SuiAmountsArg)[], typeArgs?: string[]): import("@scallop-io/sui-kit").TransactionResult;
|
|
90
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { QueryClient } from '@tanstack/query-core';
|
|
2
|
-
import { SuiObjectArg } from '@scallop-io/sui-kit';
|
|
3
|
-
import { SuiKit } from '@scallop-io/sui-kit';
|
|
4
|
-
import type { SuiObjectResponse, SuiObjectDataOptions, SuiObjectData, GetOwnedObjectsParams, DevInspectResults, GetDynamicFieldsParams, DynamicFieldPage, GetDynamicFieldObjectParams, GetBalanceParams, CoinBalance } from '@mysten/sui/client';
|
|
5
|
-
import { ScallopCacheInstanceParams, ScallopCacheParams } from 'src/types';
|
|
6
|
-
type QueryInspectTxnParams = {
|
|
7
|
-
queryTarget: string;
|
|
8
|
-
args: SuiObjectArg[];
|
|
9
|
-
typeArgs?: any[];
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* @description
|
|
13
|
-
* It provides caching for moveCall, RPC Request, and API Request.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const scallopCache = new scallopCache(<parameters>);
|
|
19
|
-
* scallopCache.<indexer functions>();
|
|
20
|
-
* await scallopCache.<indexer async functions>();
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare class ScallopCache {
|
|
24
|
-
readonly params: ScallopCacheParams;
|
|
25
|
-
queryClient: QueryClient;
|
|
26
|
-
suiKit: SuiKit;
|
|
27
|
-
walletAddress: string;
|
|
28
|
-
private tokensPerInterval;
|
|
29
|
-
private interval;
|
|
30
|
-
private tokens;
|
|
31
|
-
private lastRefill;
|
|
32
|
-
constructor(params?: ScallopCacheParams, instance?: ScallopCacheInstanceParams);
|
|
33
|
-
private get client();
|
|
34
|
-
private refill;
|
|
35
|
-
private removeTokens;
|
|
36
|
-
private callWithRateLimit;
|
|
37
|
-
/**
|
|
38
|
-
* @description Invalidate cache based on the refetchType parameter
|
|
39
|
-
* @param refetchType Determines the type of queries to be refetched. Defaults to `active`.
|
|
40
|
-
*
|
|
41
|
-
* - `active`: Only queries that match the refetch predicate and are actively being rendered via useQuery and related functions will be refetched in the background.
|
|
42
|
-
* - `inactive`: Only queries that match the refetch predicate and are NOT actively being rendered via useQuery and related functions will be refetched in the background.
|
|
43
|
-
* - `all`: All queries that match the refetch predicate will be refetched in the background.
|
|
44
|
-
* - `none`: No queries will be refetched. Queries that match the refetch predicate will only be marked as invalid.
|
|
45
|
-
*/
|
|
46
|
-
private retryFn;
|
|
47
|
-
/**
|
|
48
|
-
* @description Provides cache for inspectTxn of the SuiKit.
|
|
49
|
-
* @param QueryInspectTxnParams
|
|
50
|
-
* @param txBlock
|
|
51
|
-
* @returns Promise<DevInspectResults>
|
|
52
|
-
*/
|
|
53
|
-
queryInspectTxn({ queryTarget, args, typeArgs, }: QueryInspectTxnParams): Promise<DevInspectResults | null>;
|
|
54
|
-
queryGetNormalizedMoveFunction(target: string): Promise<import("@mysten/sui/client").SuiMoveNormalizedFunction | null>;
|
|
55
|
-
/**
|
|
56
|
-
* @description Provides cache for getObject of the SuiKit.
|
|
57
|
-
* @param objectId
|
|
58
|
-
* @param QueryObjectParams
|
|
59
|
-
* @returns Promise<SuiObjectResponse>
|
|
60
|
-
*/
|
|
61
|
-
queryGetObject(objectId: string, options?: SuiObjectDataOptions): Promise<SuiObjectResponse | null>;
|
|
62
|
-
/**
|
|
63
|
-
* @description Provides cache for getObjects of the SuiKit.
|
|
64
|
-
* @param objectIds
|
|
65
|
-
* @returns Promise<SuiObjectData[]>
|
|
66
|
-
*/
|
|
67
|
-
queryGetObjects(objectIds: string[]): Promise<SuiObjectData[]>;
|
|
68
|
-
/**
|
|
69
|
-
* @description Provides cache for getOwnedObjects of the SuiKit.
|
|
70
|
-
* @param input
|
|
71
|
-
* @returns Promise<PaginatedObjectsResponse>
|
|
72
|
-
*/
|
|
73
|
-
queryGetOwnedObjects(input: GetOwnedObjectsParams): Promise<import("@mysten/sui/client").PaginatedObjectsResponse | null>;
|
|
74
|
-
queryGetDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage | null>;
|
|
75
|
-
queryGetDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse | null>;
|
|
76
|
-
queryGetAllCoinBalances(owner: string): Promise<{
|
|
77
|
-
[k: string]: CoinBalance;
|
|
78
|
-
}>;
|
|
79
|
-
queryGetCoinBalance(input: GetBalanceParams): Promise<CoinBalance | null>;
|
|
80
|
-
}
|
|
81
|
-
export {};
|