@naviprotocol/wallet-client 1.0.0 → 1.0.1-dev.0
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +385 -217
- package/dist/index.esm.js.map +1 -1
- package/dist/modules/lendingModule/index.d.ts +5 -0
- package/dist/modules/lendingModule/index.d.ts.map +1 -1
- package/dist/modules/lendingModule/migrate.d.ts +17 -0
- package/dist/modules/lendingModule/migrate.d.ts.map +1 -0
- package/dist/modules/lendingModule/utils.d.ts +5 -0
- package/dist/modules/lendingModule/utils.d.ts.map +1 -0
- package/dist/modules/swapModule/index.d.ts +29 -1
- package/dist/modules/swapModule/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/modules/lendingModule/utils.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAA;AAEpC,eAAO,MAAM,aAAa,KAAK,CAAA;AAE/B,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,OAAO,SAAI,UAO/E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Dex, FeeOption } from '@naviprotocol/astros-aggregator-sdk';
|
|
1
|
+
import { Dex, FeeOption, Quote } from '@naviprotocol/astros-aggregator-sdk';
|
|
2
|
+
import { Transaction } from '@mysten/sui/transactions';
|
|
2
3
|
import { Module } from '../module';
|
|
3
4
|
import { SuiTransactionBlockResponse, DryRunTransactionBlockResponse } from '@mysten/sui/client';
|
|
4
5
|
|
|
@@ -57,6 +58,33 @@ export declare class SwapModule extends Module<SwapModuleConfig, Events> {
|
|
|
57
58
|
* @returns Referral ID if API key is configured, otherwise 0
|
|
58
59
|
*/
|
|
59
60
|
get referral(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Get the swap options
|
|
63
|
+
* @returns The swap options
|
|
64
|
+
*/
|
|
65
|
+
get swapOptions(): {
|
|
66
|
+
baseUrl: string;
|
|
67
|
+
dexList: Dex[];
|
|
68
|
+
depth: number;
|
|
69
|
+
serviceFee: FeeOption | undefined;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Get a quote for a swap
|
|
73
|
+
* @param fromCoinType - The type of the coin being swapped from
|
|
74
|
+
* @param toCoinType - The type of the coin being swapped to
|
|
75
|
+
* @param fromAmount - The amount of the coin being swapped from
|
|
76
|
+
* @returns A promise that resolves with the quote
|
|
77
|
+
*/
|
|
78
|
+
getQuote(fromCoinType: string, toCoinType: string, fromAmount: number): Promise<Quote>;
|
|
79
|
+
/**
|
|
80
|
+
* Builds a swap transaction from a quote
|
|
81
|
+
* @param tx - The transaction to build the swap from
|
|
82
|
+
* @param quote - The quote to build the swap from
|
|
83
|
+
* @param fromCoin - The coin to swap from
|
|
84
|
+
* @param slippage - The slippage tolerance
|
|
85
|
+
* @returns The swap transaction
|
|
86
|
+
*/
|
|
87
|
+
buildSwapPTBFromQuote(tx: Transaction, quote: Quote, fromCoin: any, slippage: number): Promise<import('@mysten/sui/dist/cjs/transactions').TransactionResult>;
|
|
60
88
|
/**
|
|
61
89
|
* Executes a swap between two coin types
|
|
62
90
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/swapModule/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,GAAG,EACH,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/swapModule/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,GAAG,EACH,SAAS,EAET,KAAK,EACN,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD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