@scallop-io/sui-scallop-sdk 2.0.0 → 2.0.2-switchboard-alpha.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/README.md +8 -7
- package/dist/index.d.mts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +30 -28
- package/dist/index.mjs +6 -4
- package/package.json +6 -3
- package/src/builders/oracles/index.ts +16 -15
- package/src/builders/oracles/switchboard.ts +222 -259
- package/src/constants/common.ts +0 -125
- package/src/models/scallop.ts +14 -1
- package/src/models/scallopAddress.ts +1 -1
- package/src/models/scallopBuilder.ts +0 -42
- package/src/models/scallopCache.ts +3 -7
- package/src/models/scallopConstants.ts +3 -1
- package/src/models/scallopQuery.ts +0 -7
- package/src/models/suiKit.ts +19 -4
- package/src/queries/coreQuery.ts +0 -15
- package/src/queries/poolAddressesQuery.ts +0 -2
- package/src/queries/portfolioQuery.ts +0 -2
- package/src/queries/xOracleQuery.ts +0 -10
- package/src/types/builder/core.ts +2 -23
- package/src/types/model.ts +3 -2
- package/src/constants/pyth.ts +0 -25
package/README.md
CHANGED
|
@@ -45,12 +45,13 @@ This SDK is used to interact with [sui-lending-protocol](https://github.com/scal
|
|
|
45
45
|
```typescript
|
|
46
46
|
// Create an instance quickly through the`Scallop` class to construct other models.
|
|
47
47
|
const scallopSDK = new Scallop({
|
|
48
|
-
addressId: '
|
|
48
|
+
addressId: '67c44a103fe1b8c454eb9699',
|
|
49
49
|
networkType: 'mainnet',
|
|
50
50
|
...
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
const scallopAddress = await scallopSDK.getScallopAddress(...);
|
|
54
|
+
const scallopConstants = await scallopSDK.getScallopConstants(...);
|
|
54
55
|
const scallopQuery = await scallopSDK.createScallopQuery(...);
|
|
55
56
|
const scallopBuilder = await scallopSDK.createScallopBuilder(...);
|
|
56
57
|
const scallopUtils = await scallopSDK.createScallopUtils(...);
|
|
@@ -69,27 +70,27 @@ This SDK is used to interact with [sui-lending-protocol](https://github.com/scal
|
|
|
69
70
|
} from '@scallop-io/sui-scallop-sdk'
|
|
70
71
|
|
|
71
72
|
const scallopAddress = new ScallopAddress(
|
|
72
|
-
addressId: '
|
|
73
|
+
addressId: '67c44a103fe1b8c454eb9699',
|
|
73
74
|
...
|
|
74
75
|
);
|
|
75
76
|
const scallopConstants = new ScallopConstants(
|
|
76
|
-
addressId: '
|
|
77
|
+
addressId: '67c44a103fe1b8c454eb9699',
|
|
77
78
|
...
|
|
78
79
|
);
|
|
79
80
|
const ScallopQuery = new ScallopQuery(
|
|
80
|
-
addressId: '
|
|
81
|
+
addressId: '67c44a103fe1b8c454eb9699',
|
|
81
82
|
...
|
|
82
83
|
);
|
|
83
84
|
const ScallopBuilder = new ScallopBuilder(
|
|
84
|
-
addressId: '
|
|
85
|
+
addressId: '67c44a103fe1b8c454eb9699',
|
|
85
86
|
...
|
|
86
87
|
);
|
|
87
88
|
const ScallopUtils = new ScallopUtils(
|
|
88
|
-
addressId: '
|
|
89
|
+
addressId: '67c44a103fe1b8c454eb9699',
|
|
89
90
|
...
|
|
90
91
|
);
|
|
91
92
|
const scallopClient = new ScallopClient(
|
|
92
|
-
addressId: '
|
|
93
|
+
addressId: '67c44a103fe1b8c454eb9699',
|
|
93
94
|
...
|
|
94
95
|
);
|
|
95
96
|
const ScallopIndexer = new ScallopIndexer();
|
package/dist/index.d.mts
CHANGED
|
@@ -134,7 +134,7 @@ declare class ScallopCache {
|
|
|
134
134
|
* @returns Promise<DevInspectResults>
|
|
135
135
|
*/
|
|
136
136
|
queryInspectTxn({ queryTarget, args, typeArgs, }: QueryInspectTxnParams): Promise<DevInspectResults | null>;
|
|
137
|
-
queryGetNormalizedMoveFunction
|
|
137
|
+
private queryGetNormalizedMoveFunction;
|
|
138
138
|
/**
|
|
139
139
|
* @description Provides cache for getObject of the SuiKit.
|
|
140
140
|
* @param objectId
|
|
@@ -1690,6 +1690,11 @@ declare class Scallop {
|
|
|
1690
1690
|
* @return Scallop Address.
|
|
1691
1691
|
*/
|
|
1692
1692
|
getScallopAddress(id?: string): Promise<ScallopAddress>;
|
|
1693
|
+
/**
|
|
1694
|
+
* Get a scallop constants instance that already has initial data.
|
|
1695
|
+
* @returns Scallop Constants
|
|
1696
|
+
*/
|
|
1697
|
+
getScallopConstants(params?: Partial<ScallopConstantsParams>): Promise<ScallopConstants>;
|
|
1693
1698
|
/**
|
|
1694
1699
|
* Create a scallop builder instance that already has initial data.
|
|
1695
1700
|
*
|
|
@@ -3019,7 +3024,7 @@ type ScallopCacheParams = {
|
|
|
3019
3024
|
walletAddress?: string;
|
|
3020
3025
|
cacheOptions?: QueryClientConfig;
|
|
3021
3026
|
config?: ScallopCacheConfig;
|
|
3022
|
-
} & SuiKitParams
|
|
3027
|
+
} & Partial<SuiKitParams>;
|
|
3023
3028
|
type ScallopIndexerParams = ScallopCacheParams & {
|
|
3024
3029
|
indexerApiUrl?: string;
|
|
3025
3030
|
axios?: AxiosInstance;
|
|
@@ -3039,6 +3044,7 @@ type ScallopConstantsParams = ScallopAddressParams & {
|
|
|
3039
3044
|
};
|
|
3040
3045
|
type ScallopUtilsParams = ScallopAddressParams & ScallopConstantsParams & {
|
|
3041
3046
|
pythEndpoints?: string[];
|
|
3047
|
+
switchboardSolanaRpc?: string;
|
|
3042
3048
|
};
|
|
3043
3049
|
type ScallopQueryParams = ScallopUtilsParams & ScallopIndexerParams;
|
|
3044
3050
|
type ScallopBuilderParams = ScallopQueryParams & {
|
|
@@ -3046,7 +3052,7 @@ type ScallopBuilderParams = ScallopQueryParams & {
|
|
|
3046
3052
|
useOnChainXOracleList?: boolean;
|
|
3047
3053
|
};
|
|
3048
3054
|
type ScallopClientParams = ScallopBuilderParams;
|
|
3049
|
-
type ScallopParams = SuiKitParams & ScallopAddressParams & ScallopConstantsParams & {
|
|
3055
|
+
type ScallopParams = Partial<SuiKitParams> & ScallopAddressParams & ScallopConstantsParams & {
|
|
3050
3056
|
walletAddress?: string;
|
|
3051
3057
|
};
|
|
3052
3058
|
|
package/dist/index.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ declare class ScallopCache {
|
|
|
134
134
|
* @returns Promise<DevInspectResults>
|
|
135
135
|
*/
|
|
136
136
|
queryInspectTxn({ queryTarget, args, typeArgs, }: QueryInspectTxnParams): Promise<DevInspectResults | null>;
|
|
137
|
-
queryGetNormalizedMoveFunction
|
|
137
|
+
private queryGetNormalizedMoveFunction;
|
|
138
138
|
/**
|
|
139
139
|
* @description Provides cache for getObject of the SuiKit.
|
|
140
140
|
* @param objectId
|
|
@@ -1690,6 +1690,11 @@ declare class Scallop {
|
|
|
1690
1690
|
* @return Scallop Address.
|
|
1691
1691
|
*/
|
|
1692
1692
|
getScallopAddress(id?: string): Promise<ScallopAddress>;
|
|
1693
|
+
/**
|
|
1694
|
+
* Get a scallop constants instance that already has initial data.
|
|
1695
|
+
* @returns Scallop Constants
|
|
1696
|
+
*/
|
|
1697
|
+
getScallopConstants(params?: Partial<ScallopConstantsParams>): Promise<ScallopConstants>;
|
|
1693
1698
|
/**
|
|
1694
1699
|
* Create a scallop builder instance that already has initial data.
|
|
1695
1700
|
*
|
|
@@ -3019,7 +3024,7 @@ type ScallopCacheParams = {
|
|
|
3019
3024
|
walletAddress?: string;
|
|
3020
3025
|
cacheOptions?: QueryClientConfig;
|
|
3021
3026
|
config?: ScallopCacheConfig;
|
|
3022
|
-
} & SuiKitParams
|
|
3027
|
+
} & Partial<SuiKitParams>;
|
|
3023
3028
|
type ScallopIndexerParams = ScallopCacheParams & {
|
|
3024
3029
|
indexerApiUrl?: string;
|
|
3025
3030
|
axios?: AxiosInstance;
|
|
@@ -3039,6 +3044,7 @@ type ScallopConstantsParams = ScallopAddressParams & {
|
|
|
3039
3044
|
};
|
|
3040
3045
|
type ScallopUtilsParams = ScallopAddressParams & ScallopConstantsParams & {
|
|
3041
3046
|
pythEndpoints?: string[];
|
|
3047
|
+
switchboardSolanaRpc?: string;
|
|
3042
3048
|
};
|
|
3043
3049
|
type ScallopQueryParams = ScallopUtilsParams & ScallopIndexerParams;
|
|
3044
3050
|
type ScallopBuilderParams = ScallopQueryParams & {
|
|
@@ -3046,7 +3052,7 @@ type ScallopBuilderParams = ScallopQueryParams & {
|
|
|
3046
3052
|
useOnChainXOracleList?: boolean;
|
|
3047
3053
|
};
|
|
3048
3054
|
type ScallopClientParams = ScallopBuilderParams;
|
|
3049
|
-
type ScallopParams = SuiKitParams & ScallopAddressParams & ScallopConstantsParams & {
|
|
3055
|
+
type ScallopParams = Partial<SuiKitParams> & ScallopAddressParams & ScallopConstantsParams & {
|
|
3050
3056
|
walletAddress?: string;
|
|
3051
3057
|
};
|
|
3052
3058
|
|