@scallop-io/sui-scallop-sdk 2.3.2 → 2.3.5
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 +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +5 -5
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/src/constants/queryKeys.ts +7 -1
- package/src/models/scallopQuery.ts +1 -1
- package/src/models/scallopSuiKit.ts +1 -56
- package/src/models/scallopUtils.ts +48 -33
- package/src/types/constant/queryKeys.ts +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
|
|
2
|
-
import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef } from '@mysten/sui/
|
|
2
|
+
import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectResponse, DynamicFieldPage, CoinBalance, GetBalanceParams, DevInspectResults, SuiObjectRef, SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
3
3
|
import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
|
|
4
4
|
import { SuiObjectArg, SuiTxArg, NetworkType, SuiKit, Transaction, SuiTxBlock, DerivePathParams, SuiKitParams, SuiVecTxArg, SuiAmountsArg, SuiAddressArg, TransactionResult as TransactionResult$1 } from '@scallop-io/sui-kit';
|
|
5
5
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
6
6
|
import { QueryClient, QueryClientConfig, QueryKey } from '@tanstack/query-core';
|
|
7
7
|
import { AxiosInstance, AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
8
|
-
import { SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse, SuiObjectRef as SuiObjectRef$1 } from '@mysten/sui/client';
|
|
9
8
|
import { Transaction as Transaction$1, TransactionObjectArgument, TransactionResult, Argument } from '@mysten/sui/transactions';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -103,7 +102,8 @@ declare const queryKeys: {
|
|
|
103
102
|
getNormalizedMoveFunction: (props?: QueryKeys.RPC.GetNormalizedMoveFunction) => (string | QueryKeys.RPC.GetNormalizedMoveFunction | undefined)[];
|
|
104
103
|
};
|
|
105
104
|
oracle: {
|
|
106
|
-
getPythLatestPriceFeeds: (priceIds
|
|
105
|
+
getPythLatestPriceFeeds: (endpoint?: string, priceIds?: string[]) => (string | string[] | undefined)[];
|
|
106
|
+
getCoinPrices: (priceIds: string[]) => (string | string[])[];
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
109
|
|
|
@@ -487,21 +487,21 @@ declare class ScallopSuiKit extends ScallopQueryClient {
|
|
|
487
487
|
* @param QueryObjectParams
|
|
488
488
|
* @returns Promise<SuiObjectResponse>
|
|
489
489
|
*/
|
|
490
|
-
queryGetObject(objectId: string, options?: SuiObjectDataOptions
|
|
490
|
+
queryGetObject(objectId: string, options?: SuiObjectDataOptions): Promise<SuiObjectResponse>;
|
|
491
491
|
/**
|
|
492
492
|
* @description Provides cache for getObjects of the SuiKit.
|
|
493
493
|
* @param objectIds
|
|
494
494
|
* @returns Promise<SuiObjectData[]>
|
|
495
495
|
*/
|
|
496
|
-
queryGetObjects(objectIds: string[], options?: SuiObjectDataOptions
|
|
496
|
+
queryGetObjects(objectIds: string[], options?: SuiObjectDataOptions): Promise<SuiObjectData[]>;
|
|
497
497
|
/**
|
|
498
498
|
* @description Provides cache for getOwnedObjects of the SuiKit.
|
|
499
499
|
* @param input
|
|
500
500
|
* @returns Promise<PaginatedObjectsResponse>
|
|
501
501
|
*/
|
|
502
|
-
queryGetOwnedObjects(input: GetOwnedObjectsParams
|
|
503
|
-
queryGetDynamicFields(input: GetDynamicFieldsParams
|
|
504
|
-
queryGetDynamicFieldObject(input: GetDynamicFieldObjectParams
|
|
502
|
+
queryGetOwnedObjects(input: GetOwnedObjectsParams): Promise<_mysten_sui_dist_cjs_client.PaginatedObjectsResponse>;
|
|
503
|
+
queryGetDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage | null>;
|
|
504
|
+
queryGetDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse | null>;
|
|
505
505
|
queryGetAllCoinBalances(owner: string): Promise<{
|
|
506
506
|
[k: string]: CoinBalance;
|
|
507
507
|
}>;
|
|
@@ -1987,26 +1987,26 @@ type VeScaQuickMethods = {
|
|
|
1987
1987
|
amountOrCoin?: SuiObjectArg | number;
|
|
1988
1988
|
lockPeriodInDays?: number;
|
|
1989
1989
|
autoCheck?: boolean;
|
|
1990
|
-
veScaKey?: SuiObjectData
|
|
1990
|
+
veScaKey?: SuiObjectData | string;
|
|
1991
1991
|
}): Promise<void>;
|
|
1992
1992
|
extendLockPeriodQuick: (params: {
|
|
1993
1993
|
lockPeriodInDays: number;
|
|
1994
1994
|
autoCheck?: boolean;
|
|
1995
|
-
veScaKey?: SuiObjectData
|
|
1995
|
+
veScaKey?: SuiObjectData | string;
|
|
1996
1996
|
}) => Promise<void>;
|
|
1997
1997
|
extendLockAmountQuick: (params: {
|
|
1998
1998
|
scaAmount: number;
|
|
1999
1999
|
autoCheck?: boolean;
|
|
2000
|
-
veScaKey?: SuiObjectData
|
|
2000
|
+
veScaKey?: SuiObjectData | string;
|
|
2001
2001
|
}) => Promise<void>;
|
|
2002
2002
|
renewExpiredVeScaQuick: (params: {
|
|
2003
2003
|
scaAmount: number;
|
|
2004
2004
|
lockPeriodInDays: number;
|
|
2005
2005
|
autoCheck?: boolean;
|
|
2006
|
-
veScaKey?: SuiObjectData
|
|
2006
|
+
veScaKey?: SuiObjectData | string;
|
|
2007
2007
|
}) => Promise<void>;
|
|
2008
2008
|
redeemScaQuick: <T extends boolean>(params: {
|
|
2009
|
-
veScaKey?: SuiObjectData
|
|
2009
|
+
veScaKey?: SuiObjectData | string;
|
|
2010
2010
|
transferSca?: T;
|
|
2011
2011
|
}) => Promise<QuickMethodReturnType<T> | undefined>;
|
|
2012
2012
|
splitVeScaQuick: <T extends boolean>(params: {
|
|
@@ -2985,8 +2985,8 @@ type sCoinBalance = number;
|
|
|
2985
2985
|
type Vesca = {
|
|
2986
2986
|
id: string;
|
|
2987
2987
|
keyId: string;
|
|
2988
|
-
keyObject?: SuiObjectRef
|
|
2989
|
-
object: SuiObjectRef
|
|
2988
|
+
keyObject?: SuiObjectRef;
|
|
2989
|
+
object: SuiObjectRef;
|
|
2990
2990
|
lockedScaAmount: string;
|
|
2991
2991
|
lockedScaCoin: number;
|
|
2992
2992
|
currentVeScaBalance: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
|
|
2
|
-
import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef } from '@mysten/sui/
|
|
2
|
+
import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectResponse, DynamicFieldPage, CoinBalance, GetBalanceParams, DevInspectResults, SuiObjectRef, SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
3
3
|
import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
|
|
4
4
|
import { SuiObjectArg, SuiTxArg, NetworkType, SuiKit, Transaction, SuiTxBlock, DerivePathParams, SuiKitParams, SuiVecTxArg, SuiAmountsArg, SuiAddressArg, TransactionResult as TransactionResult$1 } from '@scallop-io/sui-kit';
|
|
5
5
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
6
6
|
import { QueryClient, QueryClientConfig, QueryKey } from '@tanstack/query-core';
|
|
7
7
|
import { AxiosInstance, AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
8
|
-
import { SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse, SuiObjectRef as SuiObjectRef$1 } from '@mysten/sui/client';
|
|
9
8
|
import { Transaction as Transaction$1, TransactionObjectArgument, TransactionResult, Argument } from '@mysten/sui/transactions';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -103,7 +102,8 @@ declare const queryKeys: {
|
|
|
103
102
|
getNormalizedMoveFunction: (props?: QueryKeys.RPC.GetNormalizedMoveFunction) => (string | QueryKeys.RPC.GetNormalizedMoveFunction | undefined)[];
|
|
104
103
|
};
|
|
105
104
|
oracle: {
|
|
106
|
-
getPythLatestPriceFeeds: (priceIds
|
|
105
|
+
getPythLatestPriceFeeds: (endpoint?: string, priceIds?: string[]) => (string | string[] | undefined)[];
|
|
106
|
+
getCoinPrices: (priceIds: string[]) => (string | string[])[];
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
109
|
|
|
@@ -487,21 +487,21 @@ declare class ScallopSuiKit extends ScallopQueryClient {
|
|
|
487
487
|
* @param QueryObjectParams
|
|
488
488
|
* @returns Promise<SuiObjectResponse>
|
|
489
489
|
*/
|
|
490
|
-
queryGetObject(objectId: string, options?: SuiObjectDataOptions
|
|
490
|
+
queryGetObject(objectId: string, options?: SuiObjectDataOptions): Promise<SuiObjectResponse>;
|
|
491
491
|
/**
|
|
492
492
|
* @description Provides cache for getObjects of the SuiKit.
|
|
493
493
|
* @param objectIds
|
|
494
494
|
* @returns Promise<SuiObjectData[]>
|
|
495
495
|
*/
|
|
496
|
-
queryGetObjects(objectIds: string[], options?: SuiObjectDataOptions
|
|
496
|
+
queryGetObjects(objectIds: string[], options?: SuiObjectDataOptions): Promise<SuiObjectData[]>;
|
|
497
497
|
/**
|
|
498
498
|
* @description Provides cache for getOwnedObjects of the SuiKit.
|
|
499
499
|
* @param input
|
|
500
500
|
* @returns Promise<PaginatedObjectsResponse>
|
|
501
501
|
*/
|
|
502
|
-
queryGetOwnedObjects(input: GetOwnedObjectsParams
|
|
503
|
-
queryGetDynamicFields(input: GetDynamicFieldsParams
|
|
504
|
-
queryGetDynamicFieldObject(input: GetDynamicFieldObjectParams
|
|
502
|
+
queryGetOwnedObjects(input: GetOwnedObjectsParams): Promise<_mysten_sui_dist_cjs_client.PaginatedObjectsResponse>;
|
|
503
|
+
queryGetDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage | null>;
|
|
504
|
+
queryGetDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse | null>;
|
|
505
505
|
queryGetAllCoinBalances(owner: string): Promise<{
|
|
506
506
|
[k: string]: CoinBalance;
|
|
507
507
|
}>;
|
|
@@ -1987,26 +1987,26 @@ type VeScaQuickMethods = {
|
|
|
1987
1987
|
amountOrCoin?: SuiObjectArg | number;
|
|
1988
1988
|
lockPeriodInDays?: number;
|
|
1989
1989
|
autoCheck?: boolean;
|
|
1990
|
-
veScaKey?: SuiObjectData
|
|
1990
|
+
veScaKey?: SuiObjectData | string;
|
|
1991
1991
|
}): Promise<void>;
|
|
1992
1992
|
extendLockPeriodQuick: (params: {
|
|
1993
1993
|
lockPeriodInDays: number;
|
|
1994
1994
|
autoCheck?: boolean;
|
|
1995
|
-
veScaKey?: SuiObjectData
|
|
1995
|
+
veScaKey?: SuiObjectData | string;
|
|
1996
1996
|
}) => Promise<void>;
|
|
1997
1997
|
extendLockAmountQuick: (params: {
|
|
1998
1998
|
scaAmount: number;
|
|
1999
1999
|
autoCheck?: boolean;
|
|
2000
|
-
veScaKey?: SuiObjectData
|
|
2000
|
+
veScaKey?: SuiObjectData | string;
|
|
2001
2001
|
}) => Promise<void>;
|
|
2002
2002
|
renewExpiredVeScaQuick: (params: {
|
|
2003
2003
|
scaAmount: number;
|
|
2004
2004
|
lockPeriodInDays: number;
|
|
2005
2005
|
autoCheck?: boolean;
|
|
2006
|
-
veScaKey?: SuiObjectData
|
|
2006
|
+
veScaKey?: SuiObjectData | string;
|
|
2007
2007
|
}) => Promise<void>;
|
|
2008
2008
|
redeemScaQuick: <T extends boolean>(params: {
|
|
2009
|
-
veScaKey?: SuiObjectData
|
|
2009
|
+
veScaKey?: SuiObjectData | string;
|
|
2010
2010
|
transferSca?: T;
|
|
2011
2011
|
}) => Promise<QuickMethodReturnType<T> | undefined>;
|
|
2012
2012
|
splitVeScaQuick: <T extends boolean>(params: {
|
|
@@ -2985,8 +2985,8 @@ type sCoinBalance = number;
|
|
|
2985
2985
|
type Vesca = {
|
|
2986
2986
|
id: string;
|
|
2987
2987
|
keyId: string;
|
|
2988
|
-
keyObject?: SuiObjectRef
|
|
2989
|
-
object: SuiObjectRef
|
|
2988
|
+
keyObject?: SuiObjectRef;
|
|
2989
|
+
object: SuiObjectRef;
|
|
2990
2990
|
lockedScaAmount: string;
|
|
2991
2991
|
lockedScaCoin: number;
|
|
2992
2992
|
currentVeScaBalance: number;
|