@scallop-io/sui-scallop-sdk 2.2.3-pyth-sponsored-transaction-alpha.2 → 2.2.3
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 +26 -4
- package/dist/index.d.ts +26 -4
- package/dist/index.js +17 -17
- package/dist/index.mjs +4 -4
- package/package.json +3 -2
- package/src/builders/coreBuilder.ts +29 -10
- package/src/builders/oracles/pyth.ts +93 -10
- package/src/constants/testAddress.ts +1 -4
- package/src/models/scallopBuilder.ts +1 -0
- package/src/models/scallopUtils.ts +4 -2
- package/src/types/builder/core.ts +28 -4
package/dist/index.d.mts
CHANGED
|
@@ -1108,6 +1108,7 @@ declare class ScallopBuilder implements ScallopBuilderInterface {
|
|
|
1108
1108
|
* @param assetCoinName - Specific support asset coin name.
|
|
1109
1109
|
* @param amount - Amount of coins to be selected.
|
|
1110
1110
|
* @param sender - Sender address.
|
|
1111
|
+
* @param isSponsored - Whether the transaction is a sponsored transaction.
|
|
1111
1112
|
* @return Take coin and left coin.
|
|
1112
1113
|
*/
|
|
1113
1114
|
selectCoin(txBlock: ScallopTxBlock | SuiTxBlock, assetCoinName: string, amount: number, sender?: string, isSponsored?: boolean): Promise<{
|
|
@@ -1192,6 +1193,7 @@ declare class ScallopUtils implements ScallopUtilsInterface {
|
|
|
1192
1193
|
pythEndpoints: string[];
|
|
1193
1194
|
readonly scallopSuiKit: ScallopSuiKit;
|
|
1194
1195
|
readonly constants: ScallopConstants;
|
|
1196
|
+
readonly timeout: number;
|
|
1195
1197
|
constructor(params?: ScallopUtilsParams);
|
|
1196
1198
|
get walletAddress(): string;
|
|
1197
1199
|
get suiKit(): _scallop_io_sui_kit.SuiKit;
|
|
@@ -1813,13 +1815,33 @@ type CoreNormalMethods = {
|
|
|
1813
1815
|
};
|
|
1814
1816
|
type CoreQuickMethods = {
|
|
1815
1817
|
addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg) => Promise<void>;
|
|
1816
|
-
takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg
|
|
1817
|
-
|
|
1818
|
-
|
|
1818
|
+
takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1819
|
+
usePythPullModel?: boolean;
|
|
1820
|
+
useOnChainXOracleList?: boolean;
|
|
1821
|
+
sponsoredFeeds?: string[];
|
|
1822
|
+
isSponsoredTx?: boolean;
|
|
1823
|
+
}) => Promise<TransactionResult>;
|
|
1824
|
+
borrowQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1825
|
+
usePythPullModel?: boolean;
|
|
1826
|
+
useOnChainXOracleList?: boolean;
|
|
1827
|
+
sponsoredFeeds?: string[];
|
|
1828
|
+
isSponsoredTx?: boolean;
|
|
1829
|
+
}) => Promise<TransactionResult>;
|
|
1830
|
+
borrowWithReferralQuick: (amount: number, poolCoinName: string, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1831
|
+
usePythPullModel?: boolean;
|
|
1832
|
+
useOnChainXOracleList?: boolean;
|
|
1833
|
+
sponsoredFeeds?: string[];
|
|
1834
|
+
isSponsoredTx?: boolean;
|
|
1835
|
+
}) => Promise<TransactionResult>;
|
|
1819
1836
|
depositQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean) => Promise<TransactionResult>;
|
|
1820
1837
|
withdrawQuick: (amount: number, poolCoinName: string) => Promise<TransactionResult>;
|
|
1821
1838
|
repayQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
|
|
1822
|
-
updateAssetPricesQuick: (assetCoinNames?: string[]
|
|
1839
|
+
updateAssetPricesQuick: (assetCoinNames?: string[], updateOracleOptions?: {
|
|
1840
|
+
usePythPullModel?: boolean;
|
|
1841
|
+
useOnChainXOracleList?: boolean;
|
|
1842
|
+
sponsoredFeeds?: string[];
|
|
1843
|
+
isSponsoredTx?: boolean;
|
|
1844
|
+
}) => Promise<void>;
|
|
1823
1845
|
};
|
|
1824
1846
|
type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
|
|
1825
1847
|
type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
|
package/dist/index.d.ts
CHANGED
|
@@ -1108,6 +1108,7 @@ declare class ScallopBuilder implements ScallopBuilderInterface {
|
|
|
1108
1108
|
* @param assetCoinName - Specific support asset coin name.
|
|
1109
1109
|
* @param amount - Amount of coins to be selected.
|
|
1110
1110
|
* @param sender - Sender address.
|
|
1111
|
+
* @param isSponsored - Whether the transaction is a sponsored transaction.
|
|
1111
1112
|
* @return Take coin and left coin.
|
|
1112
1113
|
*/
|
|
1113
1114
|
selectCoin(txBlock: ScallopTxBlock | SuiTxBlock, assetCoinName: string, amount: number, sender?: string, isSponsored?: boolean): Promise<{
|
|
@@ -1192,6 +1193,7 @@ declare class ScallopUtils implements ScallopUtilsInterface {
|
|
|
1192
1193
|
pythEndpoints: string[];
|
|
1193
1194
|
readonly scallopSuiKit: ScallopSuiKit;
|
|
1194
1195
|
readonly constants: ScallopConstants;
|
|
1196
|
+
readonly timeout: number;
|
|
1195
1197
|
constructor(params?: ScallopUtilsParams);
|
|
1196
1198
|
get walletAddress(): string;
|
|
1197
1199
|
get suiKit(): _scallop_io_sui_kit.SuiKit;
|
|
@@ -1813,13 +1815,33 @@ type CoreNormalMethods = {
|
|
|
1813
1815
|
};
|
|
1814
1816
|
type CoreQuickMethods = {
|
|
1815
1817
|
addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg) => Promise<void>;
|
|
1816
|
-
takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg
|
|
1817
|
-
|
|
1818
|
-
|
|
1818
|
+
takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1819
|
+
usePythPullModel?: boolean;
|
|
1820
|
+
useOnChainXOracleList?: boolean;
|
|
1821
|
+
sponsoredFeeds?: string[];
|
|
1822
|
+
isSponsoredTx?: boolean;
|
|
1823
|
+
}) => Promise<TransactionResult>;
|
|
1824
|
+
borrowQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1825
|
+
usePythPullModel?: boolean;
|
|
1826
|
+
useOnChainXOracleList?: boolean;
|
|
1827
|
+
sponsoredFeeds?: string[];
|
|
1828
|
+
isSponsoredTx?: boolean;
|
|
1829
|
+
}) => Promise<TransactionResult>;
|
|
1830
|
+
borrowWithReferralQuick: (amount: number, poolCoinName: string, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1831
|
+
usePythPullModel?: boolean;
|
|
1832
|
+
useOnChainXOracleList?: boolean;
|
|
1833
|
+
sponsoredFeeds?: string[];
|
|
1834
|
+
isSponsoredTx?: boolean;
|
|
1835
|
+
}) => Promise<TransactionResult>;
|
|
1819
1836
|
depositQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean) => Promise<TransactionResult>;
|
|
1820
1837
|
withdrawQuick: (amount: number, poolCoinName: string) => Promise<TransactionResult>;
|
|
1821
1838
|
repayQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
|
|
1822
|
-
updateAssetPricesQuick: (assetCoinNames?: string[]
|
|
1839
|
+
updateAssetPricesQuick: (assetCoinNames?: string[], updateOracleOptions?: {
|
|
1840
|
+
usePythPullModel?: boolean;
|
|
1841
|
+
useOnChainXOracleList?: boolean;
|
|
1842
|
+
sponsoredFeeds?: string[];
|
|
1843
|
+
isSponsoredTx?: boolean;
|
|
1844
|
+
}) => Promise<void>;
|
|
1823
1845
|
};
|
|
1824
1846
|
type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
|
|
1825
1847
|
type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
|