@scallop-io/sui-scallop-sdk 2.2.3-pyth-sponsored-transaction-alpha.3 → 2.2.4
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 +33 -8
- package/dist/index.d.ts +33 -8
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/builders/coreBuilder.ts +53 -35
- package/src/builders/oracles/pyth.ts +1 -2
- package/src/builders/referralBuilder.ts +2 -8
- package/src/models/scallopBuilder.ts +1 -0
- package/src/models/scallopClient.ts +27 -11
- package/src/types/builder/core.ts +29 -5
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<{
|
|
@@ -1523,6 +1524,7 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1523
1524
|
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
1524
1525
|
* @param obligationId - The obligation object.
|
|
1525
1526
|
* @param walletAddress - The wallet address of the owner.
|
|
1527
|
+
* @param isSponsoredTx - Whether the transaction is sponsored.
|
|
1526
1528
|
* @return Transaction block response or transaction block.
|
|
1527
1529
|
*/
|
|
1528
1530
|
depositCollateral(collateralCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
@@ -1536,9 +1538,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1536
1538
|
* @param obligationId - The obligation object.
|
|
1537
1539
|
* @param obligationKey - The obligation key object to verifying obligation authority.
|
|
1538
1540
|
* @param walletAddress - The wallet address of the owner.
|
|
1541
|
+
* @param isSponsoredTx - Whether the transaction is sponsored.
|
|
1539
1542
|
* @return Transaction block response or transaction block.
|
|
1540
1543
|
*/
|
|
1541
|
-
withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1544
|
+
withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
|
|
1542
1545
|
/**
|
|
1543
1546
|
* Deposit asset into the specific pool.
|
|
1544
1547
|
*
|
|
@@ -1582,9 +1585,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1582
1585
|
* @param obligationId - The obligation object.
|
|
1583
1586
|
* @param obligationKey - The obligation key object to verifying obligation authority.
|
|
1584
1587
|
* @param walletAddress - The wallet address of the owner.
|
|
1588
|
+
* @param isSponsoredTx - Whether the transaction is sponsored.
|
|
1585
1589
|
* @return Transaction block response or transaction block.
|
|
1586
1590
|
*/
|
|
1587
|
-
borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1591
|
+
borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
|
|
1588
1592
|
/**
|
|
1589
1593
|
* Repay asset into the specific pool.
|
|
1590
1594
|
*
|
|
@@ -1593,9 +1597,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1593
1597
|
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
1594
1598
|
* @param obligationId - The obligation object.
|
|
1595
1599
|
* @param walletAddress - The wallet address of the owner.
|
|
1600
|
+
* @param isSponsoredTx - Whether the transaction is sponsored.
|
|
1596
1601
|
* @return Transaction block response or transaction block.
|
|
1597
1602
|
*/
|
|
1598
|
-
repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1603
|
+
repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
|
|
1599
1604
|
/**
|
|
1600
1605
|
* FlashLoan asset from the specific pool.
|
|
1601
1606
|
*
|
|
@@ -1813,14 +1818,34 @@ type CoreNormalMethods = {
|
|
|
1813
1818
|
repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName: string) => void;
|
|
1814
1819
|
};
|
|
1815
1820
|
type CoreQuickMethods = {
|
|
1816
|
-
addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg) => Promise<void>;
|
|
1817
|
-
takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg,
|
|
1818
|
-
|
|
1819
|
-
|
|
1821
|
+
addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
|
|
1822
|
+
takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1823
|
+
usePythPullModel?: boolean;
|
|
1824
|
+
useOnChainXOracleList?: boolean;
|
|
1825
|
+
sponsoredFeeds?: string[];
|
|
1826
|
+
isSponsoredTx?: boolean;
|
|
1827
|
+
}) => Promise<TransactionResult>;
|
|
1828
|
+
borrowQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1829
|
+
usePythPullModel?: boolean;
|
|
1830
|
+
useOnChainXOracleList?: boolean;
|
|
1831
|
+
sponsoredFeeds?: string[];
|
|
1832
|
+
isSponsoredTx?: boolean;
|
|
1833
|
+
}) => Promise<TransactionResult>;
|
|
1834
|
+
borrowWithReferralQuick: (amount: number, poolCoinName: string, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1835
|
+
usePythPullModel?: boolean;
|
|
1836
|
+
useOnChainXOracleList?: boolean;
|
|
1837
|
+
sponsoredFeeds?: string[];
|
|
1838
|
+
isSponsoredTx?: boolean;
|
|
1839
|
+
}) => Promise<TransactionResult>;
|
|
1820
1840
|
depositQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean) => Promise<TransactionResult>;
|
|
1821
1841
|
withdrawQuick: (amount: number, poolCoinName: string) => Promise<TransactionResult>;
|
|
1822
1842
|
repayQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
|
|
1823
|
-
updateAssetPricesQuick: (assetCoinNames?: string[]
|
|
1843
|
+
updateAssetPricesQuick: (assetCoinNames?: string[], updateOracleOptions?: {
|
|
1844
|
+
usePythPullModel?: boolean;
|
|
1845
|
+
useOnChainXOracleList?: boolean;
|
|
1846
|
+
sponsoredFeeds?: string[];
|
|
1847
|
+
isSponsoredTx?: boolean;
|
|
1848
|
+
}) => Promise<void>;
|
|
1824
1849
|
};
|
|
1825
1850
|
type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
|
|
1826
1851
|
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<{
|
|
@@ -1523,6 +1524,7 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1523
1524
|
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
1524
1525
|
* @param obligationId - The obligation object.
|
|
1525
1526
|
* @param walletAddress - The wallet address of the owner.
|
|
1527
|
+
* @param isSponsoredTx - Whether the transaction is sponsored.
|
|
1526
1528
|
* @return Transaction block response or transaction block.
|
|
1527
1529
|
*/
|
|
1528
1530
|
depositCollateral(collateralCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
@@ -1536,9 +1538,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1536
1538
|
* @param obligationId - The obligation object.
|
|
1537
1539
|
* @param obligationKey - The obligation key object to verifying obligation authority.
|
|
1538
1540
|
* @param walletAddress - The wallet address of the owner.
|
|
1541
|
+
* @param isSponsoredTx - Whether the transaction is sponsored.
|
|
1539
1542
|
* @return Transaction block response or transaction block.
|
|
1540
1543
|
*/
|
|
1541
|
-
withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1544
|
+
withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
|
|
1542
1545
|
/**
|
|
1543
1546
|
* Deposit asset into the specific pool.
|
|
1544
1547
|
*
|
|
@@ -1582,9 +1585,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1582
1585
|
* @param obligationId - The obligation object.
|
|
1583
1586
|
* @param obligationKey - The obligation key object to verifying obligation authority.
|
|
1584
1587
|
* @param walletAddress - The wallet address of the owner.
|
|
1588
|
+
* @param isSponsoredTx - Whether the transaction is sponsored.
|
|
1585
1589
|
* @return Transaction block response or transaction block.
|
|
1586
1590
|
*/
|
|
1587
|
-
borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1591
|
+
borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
|
|
1588
1592
|
/**
|
|
1589
1593
|
* Repay asset into the specific pool.
|
|
1590
1594
|
*
|
|
@@ -1593,9 +1597,10 @@ declare class ScallopClient implements ScallopClientInterface {
|
|
|
1593
1597
|
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
1594
1598
|
* @param obligationId - The obligation object.
|
|
1595
1599
|
* @param walletAddress - The wallet address of the owner.
|
|
1600
|
+
* @param isSponsoredTx - Whether the transaction is sponsored.
|
|
1596
1601
|
* @return Transaction block response or transaction block.
|
|
1597
1602
|
*/
|
|
1598
|
-
repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1603
|
+
repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
|
|
1599
1604
|
/**
|
|
1600
1605
|
* FlashLoan asset from the specific pool.
|
|
1601
1606
|
*
|
|
@@ -1813,14 +1818,34 @@ type CoreNormalMethods = {
|
|
|
1813
1818
|
repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName: string) => void;
|
|
1814
1819
|
};
|
|
1815
1820
|
type CoreQuickMethods = {
|
|
1816
|
-
addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg) => Promise<void>;
|
|
1817
|
-
takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg,
|
|
1818
|
-
|
|
1819
|
-
|
|
1821
|
+
addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
|
|
1822
|
+
takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1823
|
+
usePythPullModel?: boolean;
|
|
1824
|
+
useOnChainXOracleList?: boolean;
|
|
1825
|
+
sponsoredFeeds?: string[];
|
|
1826
|
+
isSponsoredTx?: boolean;
|
|
1827
|
+
}) => Promise<TransactionResult>;
|
|
1828
|
+
borrowQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1829
|
+
usePythPullModel?: boolean;
|
|
1830
|
+
useOnChainXOracleList?: boolean;
|
|
1831
|
+
sponsoredFeeds?: string[];
|
|
1832
|
+
isSponsoredTx?: boolean;
|
|
1833
|
+
}) => Promise<TransactionResult>;
|
|
1834
|
+
borrowWithReferralQuick: (amount: number, poolCoinName: string, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
|
|
1835
|
+
usePythPullModel?: boolean;
|
|
1836
|
+
useOnChainXOracleList?: boolean;
|
|
1837
|
+
sponsoredFeeds?: string[];
|
|
1838
|
+
isSponsoredTx?: boolean;
|
|
1839
|
+
}) => Promise<TransactionResult>;
|
|
1820
1840
|
depositQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean) => Promise<TransactionResult>;
|
|
1821
1841
|
withdrawQuick: (amount: number, poolCoinName: string) => Promise<TransactionResult>;
|
|
1822
1842
|
repayQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
|
|
1823
|
-
updateAssetPricesQuick: (assetCoinNames?: string[]
|
|
1843
|
+
updateAssetPricesQuick: (assetCoinNames?: string[], updateOracleOptions?: {
|
|
1844
|
+
usePythPullModel?: boolean;
|
|
1845
|
+
useOnChainXOracleList?: boolean;
|
|
1846
|
+
sponsoredFeeds?: string[];
|
|
1847
|
+
isSponsoredTx?: boolean;
|
|
1848
|
+
}) => Promise<void>;
|
|
1824
1849
|
};
|
|
1825
1850
|
type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
|
|
1826
1851
|
type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
|