@scallop-io/sui-scallop-sdk 2.3.0 → 2.3.2
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 +23 -19
- package/dist/index.d.ts +23 -19
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/src/builders/oracles/pyth.ts +11 -3
- package/src/builders/spoolBuilder.ts +3 -6
- package/src/constants/queryKeys.ts +5 -1
- package/src/constants/rpc.ts +0 -1
- package/src/models/interface.ts +1 -1
- package/src/models/scallop.ts +1 -1
- package/src/models/scallopAddress.ts +2 -2
- package/src/models/scallopBuilder.ts +6 -2
- package/src/models/scallopClient.ts +16 -19
- package/src/models/scallopQuery.ts +1 -1
- package/src/models/scallopUtils.ts +2 -1
- package/src/queries/poolAddressesQuery.ts +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -103,7 +103,7 @@ declare const queryKeys: {
|
|
|
103
103
|
getNormalizedMoveFunction: (props?: QueryKeys.RPC.GetNormalizedMoveFunction) => (string | QueryKeys.RPC.GetNormalizedMoveFunction | undefined)[];
|
|
104
104
|
};
|
|
105
105
|
oracle: {
|
|
106
|
-
getPythLatestPriceFeeds: () => string[];
|
|
106
|
+
getPythLatestPriceFeeds: (priceIds: string[]) => (string | string[])[];
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
109
|
|
|
@@ -152,7 +152,7 @@ type ScallopAddressParams = {
|
|
|
152
152
|
addresses?: string[];
|
|
153
153
|
};
|
|
154
154
|
auth?: string;
|
|
155
|
-
|
|
155
|
+
networkType?: NetworkType;
|
|
156
156
|
forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
157
157
|
defaultValues?: {
|
|
158
158
|
addresses?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
@@ -522,7 +522,7 @@ type ScallopQueryParams = {
|
|
|
522
522
|
declare class ScallopQuery implements ScallopQueryInterface {
|
|
523
523
|
readonly indexer: ScallopIndexer;
|
|
524
524
|
readonly utils: ScallopUtils;
|
|
525
|
-
constructor(params
|
|
525
|
+
constructor(params?: ScallopQueryParams);
|
|
526
526
|
initIndexerFallback(): void;
|
|
527
527
|
/**
|
|
528
528
|
* Request the scallop API to initialize data.
|
|
@@ -1117,7 +1117,7 @@ declare class ScallopBuilder implements ScallopBuilderInterface {
|
|
|
1117
1117
|
readonly usePythPullModel: boolean;
|
|
1118
1118
|
readonly useOnChainXOracleList: boolean;
|
|
1119
1119
|
readonly sponsoredFeeds: string[];
|
|
1120
|
-
constructor(params
|
|
1120
|
+
constructor(params?: ScallopBuilderParams);
|
|
1121
1121
|
get utils(): ScallopUtils;
|
|
1122
1122
|
get constants(): ScallopConstants;
|
|
1123
1123
|
get walletAddress(): string;
|
|
@@ -1153,9 +1153,11 @@ declare class ScallopBuilder implements ScallopBuilderInterface {
|
|
|
1153
1153
|
NestedResult: [number, number];
|
|
1154
1154
|
};
|
|
1155
1155
|
leftCoin?: undefined;
|
|
1156
|
+
totalAmount?: undefined;
|
|
1156
1157
|
} | {
|
|
1157
1158
|
takeCoin: TransactionObjectArgument;
|
|
1158
1159
|
leftCoin: TransactionObjectArgument;
|
|
1160
|
+
totalAmount: number;
|
|
1159
1161
|
}>;
|
|
1160
1162
|
/**
|
|
1161
1163
|
* Specifying the sender's amount of market coins to get coins args from transaction result.
|
|
@@ -1216,7 +1218,7 @@ interface ScallopQueryInterface extends ScallopUtilsInterface {
|
|
|
1216
1218
|
interface ScallopBuilderInterface extends ScallopQueryInterface {
|
|
1217
1219
|
query: ScallopQuery;
|
|
1218
1220
|
}
|
|
1219
|
-
interface ScallopClientInterface extends
|
|
1221
|
+
interface ScallopClientInterface extends ScallopBuilderInterface {
|
|
1220
1222
|
builder: ScallopBuilder;
|
|
1221
1223
|
}
|
|
1222
1224
|
|
|
@@ -1461,7 +1463,7 @@ type ScallopClientVeScaReturnType<T extends boolean> = T extends true ? SuiTrans
|
|
|
1461
1463
|
declare class ScallopClient implements ScallopClientInterface {
|
|
1462
1464
|
readonly builder: ScallopBuilder;
|
|
1463
1465
|
networkType: NetworkType;
|
|
1464
|
-
constructor(params
|
|
1466
|
+
constructor(params?: ScallopClientParams);
|
|
1465
1467
|
get query(): ScallopQuery;
|
|
1466
1468
|
get utils(): ScallopUtils;
|
|
1467
1469
|
get constants(): ScallopConstants;
|
|
@@ -1476,18 +1478,18 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1476
1478
|
init(force?: boolean): Promise<void>;
|
|
1477
1479
|
/**
|
|
1478
1480
|
* Query market data.
|
|
1479
|
-
*
|
|
1481
|
+
* @deprecated use ScallopQuery instance instead
|
|
1480
1482
|
* @description
|
|
1481
|
-
* This method might be
|
|
1483
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1482
1484
|
*
|
|
1483
1485
|
* @return Market data.
|
|
1484
1486
|
*/
|
|
1485
1487
|
queryMarket(): Promise<Market>;
|
|
1486
1488
|
/**
|
|
1487
1489
|
* Get obligations data.
|
|
1488
|
-
*
|
|
1490
|
+
* @deprecated use ScallopQuery instance instead
|
|
1489
1491
|
* @description
|
|
1490
|
-
* This method might be
|
|
1492
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1491
1493
|
*
|
|
1492
1494
|
* @param ownerAddress - The owner address.
|
|
1493
1495
|
* @return Obligations data.
|
|
@@ -1495,9 +1497,9 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1495
1497
|
getObligations(ownerAddress?: string): Promise<Obligation[]>;
|
|
1496
1498
|
/**
|
|
1497
1499
|
* Query obligation data.
|
|
1498
|
-
*
|
|
1500
|
+
* @deprecated use ScallopQuery instance instead
|
|
1499
1501
|
* @description
|
|
1500
|
-
* This method might be
|
|
1502
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1501
1503
|
*
|
|
1502
1504
|
* @param obligationId - The obligation id.
|
|
1503
1505
|
* @return Obligation data.
|
|
@@ -1505,9 +1507,9 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1505
1507
|
queryObligation(obligationId: string): Promise<ObligationQueryInterface | undefined>;
|
|
1506
1508
|
/**
|
|
1507
1509
|
* Query all stake accounts data.
|
|
1508
|
-
*
|
|
1510
|
+
* @deprecated use ScallopQuery instance instead
|
|
1509
1511
|
* @description
|
|
1510
|
-
* This method might be
|
|
1512
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1511
1513
|
*
|
|
1512
1514
|
* @param ownerAddress - The owner address.
|
|
1513
1515
|
* @return All stake accounts data.
|
|
@@ -1515,9 +1517,9 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1515
1517
|
getAllStakeAccounts(ownerAddress?: string): Promise<StakeAccounts>;
|
|
1516
1518
|
/**
|
|
1517
1519
|
* Query stake account data.
|
|
1518
|
-
*
|
|
1520
|
+
* @deprecated use ScallopQuery instance instead
|
|
1519
1521
|
* @description
|
|
1520
|
-
* This method might be
|
|
1522
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1521
1523
|
*
|
|
1522
1524
|
* @param stakeMarketCoinName - Support stake market coin.
|
|
1523
1525
|
* @param ownerAddress - The owner address.
|
|
@@ -1526,9 +1528,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1526
1528
|
getStakeAccounts(stakeMarketCoinName: string, ownerAddress?: string): Promise<StakeAccount[]>;
|
|
1527
1529
|
/**
|
|
1528
1530
|
* Query stake pool data.
|
|
1531
|
+
* @deprecated use ScallopQuery instance instead
|
|
1529
1532
|
*
|
|
1530
1533
|
* @description
|
|
1531
|
-
* This method might be
|
|
1534
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1532
1535
|
*
|
|
1533
1536
|
* @param stakeMarketCoinName - Support stake market coin.
|
|
1534
1537
|
* @return Stake pool data.
|
|
@@ -1536,9 +1539,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1536
1539
|
getStakePool(stakeMarketCoinName: string): Promise<StakePool | undefined>;
|
|
1537
1540
|
/**
|
|
1538
1541
|
* Query reward pool data.
|
|
1542
|
+
* @deprecated use ScallopQuery instance instead
|
|
1539
1543
|
*
|
|
1540
1544
|
* @description
|
|
1541
|
-
* This method might be
|
|
1545
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1542
1546
|
*
|
|
1543
1547
|
* @param stakeMarketCoinName - Support stake market coin.
|
|
1544
1548
|
* @return Reward pool data.
|
|
@@ -1784,7 +1788,7 @@ type ScallopParams = {
|
|
|
1784
1788
|
} & ScallopClientParams;
|
|
1785
1789
|
declare class Scallop {
|
|
1786
1790
|
readonly client: ScallopClient;
|
|
1787
|
-
constructor(params
|
|
1791
|
+
constructor(params?: ScallopParams);
|
|
1788
1792
|
init(force?: boolean): Promise<void>;
|
|
1789
1793
|
/**
|
|
1790
1794
|
* Create a scallop client instance that already has initial data.
|
package/dist/index.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ declare const queryKeys: {
|
|
|
103
103
|
getNormalizedMoveFunction: (props?: QueryKeys.RPC.GetNormalizedMoveFunction) => (string | QueryKeys.RPC.GetNormalizedMoveFunction | undefined)[];
|
|
104
104
|
};
|
|
105
105
|
oracle: {
|
|
106
|
-
getPythLatestPriceFeeds: () => string[];
|
|
106
|
+
getPythLatestPriceFeeds: (priceIds: string[]) => (string | string[])[];
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
109
|
|
|
@@ -152,7 +152,7 @@ type ScallopAddressParams = {
|
|
|
152
152
|
addresses?: string[];
|
|
153
153
|
};
|
|
154
154
|
auth?: string;
|
|
155
|
-
|
|
155
|
+
networkType?: NetworkType;
|
|
156
156
|
forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
157
157
|
defaultValues?: {
|
|
158
158
|
addresses?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
@@ -522,7 +522,7 @@ type ScallopQueryParams = {
|
|
|
522
522
|
declare class ScallopQuery implements ScallopQueryInterface {
|
|
523
523
|
readonly indexer: ScallopIndexer;
|
|
524
524
|
readonly utils: ScallopUtils;
|
|
525
|
-
constructor(params
|
|
525
|
+
constructor(params?: ScallopQueryParams);
|
|
526
526
|
initIndexerFallback(): void;
|
|
527
527
|
/**
|
|
528
528
|
* Request the scallop API to initialize data.
|
|
@@ -1117,7 +1117,7 @@ declare class ScallopBuilder implements ScallopBuilderInterface {
|
|
|
1117
1117
|
readonly usePythPullModel: boolean;
|
|
1118
1118
|
readonly useOnChainXOracleList: boolean;
|
|
1119
1119
|
readonly sponsoredFeeds: string[];
|
|
1120
|
-
constructor(params
|
|
1120
|
+
constructor(params?: ScallopBuilderParams);
|
|
1121
1121
|
get utils(): ScallopUtils;
|
|
1122
1122
|
get constants(): ScallopConstants;
|
|
1123
1123
|
get walletAddress(): string;
|
|
@@ -1153,9 +1153,11 @@ declare class ScallopBuilder implements ScallopBuilderInterface {
|
|
|
1153
1153
|
NestedResult: [number, number];
|
|
1154
1154
|
};
|
|
1155
1155
|
leftCoin?: undefined;
|
|
1156
|
+
totalAmount?: undefined;
|
|
1156
1157
|
} | {
|
|
1157
1158
|
takeCoin: TransactionObjectArgument;
|
|
1158
1159
|
leftCoin: TransactionObjectArgument;
|
|
1160
|
+
totalAmount: number;
|
|
1159
1161
|
}>;
|
|
1160
1162
|
/**
|
|
1161
1163
|
* Specifying the sender's amount of market coins to get coins args from transaction result.
|
|
@@ -1216,7 +1218,7 @@ interface ScallopQueryInterface extends ScallopUtilsInterface {
|
|
|
1216
1218
|
interface ScallopBuilderInterface extends ScallopQueryInterface {
|
|
1217
1219
|
query: ScallopQuery;
|
|
1218
1220
|
}
|
|
1219
|
-
interface ScallopClientInterface extends
|
|
1221
|
+
interface ScallopClientInterface extends ScallopBuilderInterface {
|
|
1220
1222
|
builder: ScallopBuilder;
|
|
1221
1223
|
}
|
|
1222
1224
|
|
|
@@ -1461,7 +1463,7 @@ type ScallopClientVeScaReturnType<T extends boolean> = T extends true ? SuiTrans
|
|
|
1461
1463
|
declare class ScallopClient implements ScallopClientInterface {
|
|
1462
1464
|
readonly builder: ScallopBuilder;
|
|
1463
1465
|
networkType: NetworkType;
|
|
1464
|
-
constructor(params
|
|
1466
|
+
constructor(params?: ScallopClientParams);
|
|
1465
1467
|
get query(): ScallopQuery;
|
|
1466
1468
|
get utils(): ScallopUtils;
|
|
1467
1469
|
get constants(): ScallopConstants;
|
|
@@ -1476,18 +1478,18 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1476
1478
|
init(force?: boolean): Promise<void>;
|
|
1477
1479
|
/**
|
|
1478
1480
|
* Query market data.
|
|
1479
|
-
*
|
|
1481
|
+
* @deprecated use ScallopQuery instance instead
|
|
1480
1482
|
* @description
|
|
1481
|
-
* This method might be
|
|
1483
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1482
1484
|
*
|
|
1483
1485
|
* @return Market data.
|
|
1484
1486
|
*/
|
|
1485
1487
|
queryMarket(): Promise<Market>;
|
|
1486
1488
|
/**
|
|
1487
1489
|
* Get obligations data.
|
|
1488
|
-
*
|
|
1490
|
+
* @deprecated use ScallopQuery instance instead
|
|
1489
1491
|
* @description
|
|
1490
|
-
* This method might be
|
|
1492
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1491
1493
|
*
|
|
1492
1494
|
* @param ownerAddress - The owner address.
|
|
1493
1495
|
* @return Obligations data.
|
|
@@ -1495,9 +1497,9 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1495
1497
|
getObligations(ownerAddress?: string): Promise<Obligation[]>;
|
|
1496
1498
|
/**
|
|
1497
1499
|
* Query obligation data.
|
|
1498
|
-
*
|
|
1500
|
+
* @deprecated use ScallopQuery instance instead
|
|
1499
1501
|
* @description
|
|
1500
|
-
* This method might be
|
|
1502
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1501
1503
|
*
|
|
1502
1504
|
* @param obligationId - The obligation id.
|
|
1503
1505
|
* @return Obligation data.
|
|
@@ -1505,9 +1507,9 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1505
1507
|
queryObligation(obligationId: string): Promise<ObligationQueryInterface | undefined>;
|
|
1506
1508
|
/**
|
|
1507
1509
|
* Query all stake accounts data.
|
|
1508
|
-
*
|
|
1510
|
+
* @deprecated use ScallopQuery instance instead
|
|
1509
1511
|
* @description
|
|
1510
|
-
* This method might be
|
|
1512
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1511
1513
|
*
|
|
1512
1514
|
* @param ownerAddress - The owner address.
|
|
1513
1515
|
* @return All stake accounts data.
|
|
@@ -1515,9 +1517,9 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1515
1517
|
getAllStakeAccounts(ownerAddress?: string): Promise<StakeAccounts>;
|
|
1516
1518
|
/**
|
|
1517
1519
|
* Query stake account data.
|
|
1518
|
-
*
|
|
1520
|
+
* @deprecated use ScallopQuery instance instead
|
|
1519
1521
|
* @description
|
|
1520
|
-
* This method might be
|
|
1522
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1521
1523
|
*
|
|
1522
1524
|
* @param stakeMarketCoinName - Support stake market coin.
|
|
1523
1525
|
* @param ownerAddress - The owner address.
|
|
@@ -1526,9 +1528,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1526
1528
|
getStakeAccounts(stakeMarketCoinName: string, ownerAddress?: string): Promise<StakeAccount[]>;
|
|
1527
1529
|
/**
|
|
1528
1530
|
* Query stake pool data.
|
|
1531
|
+
* @deprecated use ScallopQuery instance instead
|
|
1529
1532
|
*
|
|
1530
1533
|
* @description
|
|
1531
|
-
* This method might be
|
|
1534
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1532
1535
|
*
|
|
1533
1536
|
* @param stakeMarketCoinName - Support stake market coin.
|
|
1534
1537
|
* @return Stake pool data.
|
|
@@ -1536,9 +1539,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1536
1539
|
getStakePool(stakeMarketCoinName: string): Promise<StakePool | undefined>;
|
|
1537
1540
|
/**
|
|
1538
1541
|
* Query reward pool data.
|
|
1542
|
+
* @deprecated use ScallopQuery instance instead
|
|
1539
1543
|
*
|
|
1540
1544
|
* @description
|
|
1541
|
-
* This method might be
|
|
1545
|
+
* This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
1542
1546
|
*
|
|
1543
1547
|
* @param stakeMarketCoinName - Support stake market coin.
|
|
1544
1548
|
* @return Reward pool data.
|
|
@@ -1784,7 +1788,7 @@ type ScallopParams = {
|
|
|
1784
1788
|
} & ScallopClientParams;
|
|
1785
1789
|
declare class Scallop {
|
|
1786
1790
|
readonly client: ScallopClient;
|
|
1787
|
-
constructor(params
|
|
1791
|
+
constructor(params?: ScallopParams);
|
|
1788
1792
|
init(force?: boolean): Promise<void>;
|
|
1789
1793
|
/**
|
|
1790
1794
|
* Create a scallop client instance that already has initial data.
|