@lifi/sdk-provider-sui 4.1.12 → 4.2.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/CHANGELOG.md +26 -0
- package/README.md +24 -8
- package/dist/esm/SuiProvider.d.ts +1 -2
- package/dist/esm/SuiProvider.d.ts.map +1 -1
- package/dist/esm/SuiProvider.js +6 -1
- package/dist/esm/SuiProvider.js.map +1 -1
- package/dist/esm/actions/getSuiBalance.d.ts +1 -2
- package/dist/esm/actions/getSuiBalance.d.ts.map +1 -1
- package/dist/esm/actions/getSuiNSAddress.d.ts +1 -2
- package/dist/esm/actions/getSuiNSAddress.d.ts.map +1 -1
- package/dist/esm/actions/resolveSuiAddress.d.ts +1 -2
- package/dist/esm/actions/resolveSuiAddress.d.ts.map +1 -1
- package/dist/esm/client/suiClient.d.ts +1 -2
- package/dist/esm/client/suiClient.d.ts.map +1 -1
- package/dist/esm/core/SuiStepExecutor.d.ts +1 -2
- package/dist/esm/core/SuiStepExecutor.d.ts.map +1 -1
- package/dist/esm/core/tasks/SuiSignAndExecuteTask.d.ts +1 -2
- package/dist/esm/core/tasks/SuiSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/SuiWaitForTransactionTask.d.ts +1 -2
- package/dist/esm/core/tasks/SuiWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/errors/parseSuiErrors.d.ts +1 -2
- package/dist/esm/errors/parseSuiErrors.d.ts.map +1 -1
- package/dist/esm/types.d.ts +8 -9
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/version.d.ts +2 -3
- package/dist/esm/version.d.ts.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/package.json +3 -3
- package/src/SuiProvider.ts +7 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @lifi/sdk-provider-sui
|
|
2
2
|
|
|
3
|
+
## 4.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#484](https://github.com/lifinance/sdk/pull/484) [`13c19c4`](https://github.com/lifinance/sdk/commit/13c19c4441341683b9dbaa8943e950b8f7571304) Thanks [@chybisov](https://github.com/chybisov)! - Refresh runtime dependencies: `@lifi/types` to `^18.10.0`, `viem` to `^2.56.8`,
|
|
8
|
+
`@mysten/sui` to `^2.31.3`, `@solana/kit` to `^8.3.0`,
|
|
9
|
+
`@solana/wallet-standard-features` to `^1.5.0`, `@stellar/stellar-sdk` to `^17.1.0`,
|
|
10
|
+
`@bigmi/core` to `^0.9.2` and `tronweb` to `^6.5.1`.
|
|
11
|
+
- Updated dependencies [[`13c19c4`](https://github.com/lifinance/sdk/commit/13c19c4441341683b9dbaa8943e950b8f7571304), [`252a06d`](https://github.com/lifinance/sdk/commit/252a06de1db75fad3d8501e05cc128b0a4c9d914), [`252a06d`](https://github.com/lifinance/sdk/commit/252a06de1db75fad3d8501e05cc128b0a4c9d914)]:
|
|
12
|
+
- @lifi/sdk@4.8.0
|
|
13
|
+
|
|
14
|
+
## 4.2.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [#471](https://github.com/lifinance/sdk/pull/471) [`a57b439`](https://github.com/lifinance/sdk/commit/a57b4391b52d9bc535577dcbfad1523ab4d2e32f) Thanks [@chybisov](https://github.com/chybisov)! - Add optional `SDKProvider.isTokenAddress`, so callers can validate a token identifier without knowing how each ecosystem shapes one: `C…` contract ids on Stellar, `0x…::module::TYPE` coin types on Sui, an address in any letter case on Ethereum, and the wallet format on Solana and Tron. `BitcoinProvider` omits the method, because the token list names its native coin `bitcoin` rather than giving it an address. A missing method means the ecosystem has no token address format, so a caller must not fall back to `isAddress`.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#473](https://github.com/lifinance/sdk/pull/473) [`d7d8abb`](https://github.com/lifinance/sdk/commit/d7d8abb776aa943aafda62d17926b8575f770478) Thanks [@chybisov](https://github.com/chybisov)! - Bump runtime dependencies. `@lifi/sdk` moves `@lifi/types` to `^18.5.0`;
|
|
23
|
+
`@lifi/sdk-provider-bitcoin` moves `@bigmi/core` to `^0.9.1` and `bitcoinjs-lib` to
|
|
24
|
+
`^7.0.2`; `@lifi/sdk-provider-sui` moves `@mysten/sui` to `^2.29.0`; and
|
|
25
|
+
`@lifi/sdk-provider-tron` moves `@tronweb3/tronwallet-abstract-adapter` to `^1.3.0`.
|
|
26
|
+
- Updated dependencies [[`d7d8abb`](https://github.com/lifinance/sdk/commit/d7d8abb776aa943aafda62d17926b8575f770478), [`a57b439`](https://github.com/lifinance/sdk/commit/a57b4391b52d9bc535577dcbfad1523ab4d2e32f)]:
|
|
27
|
+
- @lifi/sdk@4.7.0
|
|
28
|
+
|
|
3
29
|
## 4.1.12
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
|
|
14
14
|
[**LI.FI SDK**](https://docs.li.fi/sdk/overview) features include:
|
|
15
15
|
|
|
16
|
-
- **Modular architecture** - Install only the provider packages you need for your supported blockchain ecosystems (EVM, Solana, Bitcoin, Sui, Tron)
|
|
16
|
+
- **Modular architecture** - Install only the provider packages you need for your supported blockchain ecosystems (EVM, Solana, Bitcoin, Sui, Tron, Stellar)
|
|
17
17
|
- All ecosystems, chains, bridges, exchanges, and solvers that [LI.FI](https://docs.li.fi/introduction/chains) supports
|
|
18
18
|
- Complete functionality covering full-cycle from obtaining routes/quotes to executing transactions
|
|
19
19
|
- Easy tracking of the route and quote execution through the robust event and hooks handling
|
|
20
20
|
- Highly customizable settings to tailor the SDK to your specific needs including configuration of RPCs and options to allow or deny certain chains, tokens, bridges, exchanges, solvers
|
|
21
21
|
- Supports widely adopted industry standards, including [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792), [ERC-2612](https://eips.ethereum.org/EIPS/eip-2612), [EIP-712](https://eips.ethereum.org/EIPS/eip-712), and [Permit2](https://github.com/Uniswap/permit2)
|
|
22
|
-
- SDK ecosystem providers are based on industry-standard libraries ([Viem](https://viem.sh/) for EVM, [Solana Kit](https://github.com/
|
|
22
|
+
- SDK ecosystem providers are based on industry-standard libraries ([Viem](https://viem.sh/) for EVM, [Solana Kit](https://github.com/anza-xyz/kit) for Solana, [Bigmi](https://github.com/lifinance/bigmi) for Bitcoin, [Mysten Sui SDK](https://github.com/MystenLabs/sui/tree/main/sdk) for Sui, [TronWeb](https://tronweb.network/) for Tron, [Stellar SDK](https://github.com/stellar/js-stellar-sdk) for Stellar)
|
|
23
23
|
- Support for arbitrary contract calls on the destination chain
|
|
24
24
|
- Designed for optimal performance with tree-shaking and dead-code elimination, ensuring minimal bundle sizes and faster page load times in front-end environments
|
|
25
25
|
- Compatibility tested with Node.js and popular front-end tools like Vite
|
|
@@ -42,33 +42,47 @@ npm install --save @lifi/sdk
|
|
|
42
42
|
|
|
43
43
|
### Provider Packages
|
|
44
44
|
|
|
45
|
-
Install provider packages based on the blockchain ecosystems you want to support
|
|
45
|
+
Install provider packages based on the blockchain ecosystems you want to support.
|
|
46
|
+
|
|
47
|
+
Each provider bundles its ecosystem library, but you configure a provider by handing it a
|
|
48
|
+
wallet or client object that **you** construct — so install the ecosystem library alongside
|
|
49
|
+
the provider whenever you import from it in your own code:
|
|
46
50
|
|
|
47
51
|
**EVM Chains (Ethereum, Polygon, Arbitrum, Optimism, etc.)**
|
|
48
52
|
```bash
|
|
49
|
-
pnpm add @lifi/sdk-provider-ethereum
|
|
53
|
+
pnpm add @lifi/sdk-provider-ethereum viem
|
|
50
54
|
```
|
|
51
55
|
|
|
52
56
|
**Solana**
|
|
53
57
|
```bash
|
|
54
|
-
pnpm add @lifi/sdk-provider-solana
|
|
58
|
+
pnpm add @lifi/sdk-provider-solana @wallet-standard/base
|
|
55
59
|
```
|
|
56
60
|
|
|
57
61
|
**Bitcoin**
|
|
58
62
|
```bash
|
|
59
|
-
pnpm add @lifi/sdk-provider-bitcoin
|
|
63
|
+
pnpm add @lifi/sdk-provider-bitcoin @bigmi/core
|
|
60
64
|
```
|
|
61
65
|
|
|
62
66
|
**Sui**
|
|
63
67
|
```bash
|
|
64
|
-
pnpm add @lifi/sdk-provider-sui
|
|
68
|
+
pnpm add @lifi/sdk-provider-sui @mysten/sui
|
|
65
69
|
```
|
|
66
70
|
|
|
67
71
|
**Tron**
|
|
68
72
|
```bash
|
|
69
|
-
pnpm add @lifi/sdk-provider-tron
|
|
73
|
+
pnpm add @lifi/sdk-provider-tron @tronweb3/tronwallet-abstract-adapter
|
|
70
74
|
```
|
|
71
75
|
|
|
76
|
+
**Stellar**
|
|
77
|
+
```bash
|
|
78
|
+
pnpm add @lifi/sdk-provider-stellar
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`StellarProvider` takes a small `StellarWallet` interface the package defines itself, so it
|
|
82
|
+
needs no ecosystem library. To discover and connect browser wallets such as Freighter,
|
|
83
|
+
xBull, or Lobstr, we recommend
|
|
84
|
+
[Stellar Wallets Kit](https://github.com/Creit-Tech/Stellar-Wallets-Kit).
|
|
85
|
+
|
|
72
86
|
## Architecture
|
|
73
87
|
|
|
74
88
|
The LI.FI SDK uses a modular provider architecture:
|
|
@@ -119,6 +133,7 @@ import { SolanaProvider } from '@lifi/sdk-provider-solana'
|
|
|
119
133
|
import { BitcoinProvider } from '@lifi/sdk-provider-bitcoin'
|
|
120
134
|
import { SuiProvider } from '@lifi/sdk-provider-sui'
|
|
121
135
|
import { TronProvider } from '@lifi/sdk-provider-tron'
|
|
136
|
+
import { StellarProvider } from '@lifi/sdk-provider-stellar'
|
|
122
137
|
|
|
123
138
|
const client = createClient({
|
|
124
139
|
integrator: 'Your dApp/company name',
|
|
@@ -128,6 +143,7 @@ const client = createClient({
|
|
|
128
143
|
BitcoinProvider({ /* options */ }),
|
|
129
144
|
SuiProvider({ /* options */ }),
|
|
130
145
|
TronProvider({ /* options */ }),
|
|
146
|
+
StellarProvider({ /* options */ }),
|
|
131
147
|
],
|
|
132
148
|
})
|
|
133
149
|
```
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SuiProviderOptions, SuiSDKProvider } from "./types.js";
|
|
2
2
|
//#region src/SuiProvider.d.ts
|
|
3
|
-
declare function SuiProvider(options?: SuiProviderOptions): SuiSDKProvider;
|
|
3
|
+
export declare function SuiProvider(options?: SuiProviderOptions): SuiSDKProvider;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { SuiProvider };
|
|
6
5
|
//# sourceMappingURL=SuiProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiProvider.d.ts","names":[],"sources":["../../src/SuiProvider.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"SuiProvider.d.ts","names":[],"sources":["../../src/SuiProvider.ts"],"mappings":";;wBAiBgB,YAAY,UAAU,qBAAqB"}
|
package/dist/esm/SuiProvider.js
CHANGED
|
@@ -2,8 +2,12 @@ import { getSuiBalance } from "./actions/getSuiBalance.js";
|
|
|
2
2
|
import { resolveSuiAddress } from "./actions/resolveSuiAddress.js";
|
|
3
3
|
import { SuiStepExecutor } from "./core/SuiStepExecutor.js";
|
|
4
4
|
import { ChainType, LiFiErrorCode, ProviderError } from "@lifi/sdk";
|
|
5
|
-
import { isValidSuiAddress } from "@mysten/sui/utils";
|
|
5
|
+
import { isValidStructTag, isValidSuiAddress } from "@mysten/sui/utils";
|
|
6
6
|
//#region src/SuiProvider.ts
|
|
7
|
+
/** Tokens are Move coin types, which `isValidSuiAddress` rejects. */
|
|
8
|
+
function isSuiTokenAddress(address) {
|
|
9
|
+
return isValidStructTag(address);
|
|
10
|
+
}
|
|
7
11
|
function SuiProvider(options) {
|
|
8
12
|
const _options = options ?? {};
|
|
9
13
|
return {
|
|
@@ -11,6 +15,7 @@ function SuiProvider(options) {
|
|
|
11
15
|
return ChainType.MVM;
|
|
12
16
|
},
|
|
13
17
|
isAddress: isValidSuiAddress,
|
|
18
|
+
isTokenAddress: isSuiTokenAddress,
|
|
14
19
|
resolveAddress: resolveSuiAddress,
|
|
15
20
|
getBalance: getSuiBalance,
|
|
16
21
|
async getStepExecutor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiProvider.js","names":[],"sources":["../../src/SuiProvider.ts"],"sourcesContent":["import {\n ChainType,\n LiFiErrorCode,\n ProviderError,\n type StepExecutorOptions,\n} from '@lifi/sdk'\nimport { isValidSuiAddress } from '@mysten/sui/utils'\nimport { getSuiBalance } from './actions/getSuiBalance.js'\nimport { resolveSuiAddress } from './actions/resolveSuiAddress.js'\nimport { SuiStepExecutor } from './core/SuiStepExecutor.js'\nimport type { SuiProviderOptions, SuiSDKProvider } from './types.js'\n\nexport function SuiProvider(options?: SuiProviderOptions): SuiSDKProvider {\n const _options: SuiProviderOptions = options ?? {}\n return {\n get type() {\n return ChainType.MVM\n },\n isAddress: isValidSuiAddress,\n resolveAddress: resolveSuiAddress,\n getBalance: getSuiBalance,\n async getStepExecutor(\n options: StepExecutorOptions\n ): Promise<SuiStepExecutor> {\n if (!_options.getClient) {\n throw new ProviderError(\n LiFiErrorCode.ProviderUnavailable,\n 'getClient is not provided.'\n )\n }\n if (!_options.getSigner) {\n throw new ProviderError(\n LiFiErrorCode.ProviderUnavailable,\n 'getSigner is not provided.'\n )\n }\n\n const client = await _options.getClient()\n const signer = await _options.getSigner()\n\n const executor = new SuiStepExecutor({\n client,\n signer,\n routeId: options.routeId,\n executionOptions: {\n ...options.executionOptions,\n },\n })\n\n return executor\n },\n setOptions(options: SuiProviderOptions) {\n Object.assign(_options, options)\n },\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SuiProvider.js","names":[],"sources":["../../src/SuiProvider.ts"],"sourcesContent":["import {\n ChainType,\n LiFiErrorCode,\n ProviderError,\n type StepExecutorOptions,\n} from '@lifi/sdk'\nimport { isValidStructTag, isValidSuiAddress } from '@mysten/sui/utils'\nimport { getSuiBalance } from './actions/getSuiBalance.js'\nimport { resolveSuiAddress } from './actions/resolveSuiAddress.js'\nimport { SuiStepExecutor } from './core/SuiStepExecutor.js'\nimport type { SuiProviderOptions, SuiSDKProvider } from './types.js'\n\n/** Tokens are Move coin types, which `isValidSuiAddress` rejects. */\nfunction isSuiTokenAddress(address: string): boolean {\n return isValidStructTag(address)\n}\n\nexport function SuiProvider(options?: SuiProviderOptions): SuiSDKProvider {\n const _options: SuiProviderOptions = options ?? {}\n return {\n get type() {\n return ChainType.MVM\n },\n isAddress: isValidSuiAddress,\n isTokenAddress: isSuiTokenAddress,\n resolveAddress: resolveSuiAddress,\n getBalance: getSuiBalance,\n async getStepExecutor(\n options: StepExecutorOptions\n ): Promise<SuiStepExecutor> {\n if (!_options.getClient) {\n throw new ProviderError(\n LiFiErrorCode.ProviderUnavailable,\n 'getClient is not provided.'\n )\n }\n if (!_options.getSigner) {\n throw new ProviderError(\n LiFiErrorCode.ProviderUnavailable,\n 'getSigner is not provided.'\n )\n }\n\n const client = await _options.getClient()\n const signer = await _options.getSigner()\n\n const executor = new SuiStepExecutor({\n client,\n signer,\n routeId: options.routeId,\n executionOptions: {\n ...options.executionOptions,\n },\n })\n\n return executor\n },\n setOptions(options: SuiProviderOptions) {\n Object.assign(_options, options)\n },\n }\n}\n"],"mappings":";;;;;;;AAaA,SAAS,kBAAkB,SAA0B;CACnD,OAAO,iBAAiB,OAAO;AACjC;AAEA,SAAgB,YAAY,SAA8C;CACxE,MAAM,WAA+B,WAAW,CAAC;CACjD,OAAO;EACL,IAAI,OAAO;GACT,OAAO,UAAU;EACnB;EACA,WAAW;EACX,gBAAgB;EAChB,gBAAgB;EAChB,YAAY;EACZ,MAAM,gBACJ,SAC0B;GAC1B,IAAI,CAAC,SAAS,WACZ,MAAM,IAAI,cACR,cAAc,qBACd,4BACF;GAEF,IAAI,CAAC,SAAS,WACZ,MAAM,IAAI,cACR,cAAc,qBACd,4BACF;GAGF,MAAM,SAAS,MAAM,SAAS,UAAU;GACxC,MAAM,SAAS,MAAM,SAAS,UAAU;GAWxC,OAAO,IATc,gBAAgB;IACnC;IACA;IACA,SAAS,QAAQ;IACjB,kBAAkB,EAChB,GAAG,QAAQ,iBACb;GACF,CAEc;EAChB;EACA,WAAW,SAA6B;GACtC,OAAO,OAAO,UAAU,OAAO;EACjC;CACF;AACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SDKClient, Token, TokenAmount } from "@lifi/sdk";
|
|
2
2
|
//#region src/actions/getSuiBalance.d.ts
|
|
3
|
-
declare function getSuiBalance(client: SDKClient, walletAddress: string, tokens: Token[]): Promise<TokenAmount[]>;
|
|
3
|
+
export declare function getSuiBalance(client: SDKClient, walletAddress: string, tokens: Token[]): Promise<TokenAmount[]>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { getSuiBalance };
|
|
6
5
|
//# sourceMappingURL=getSuiBalance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSuiBalance.d.ts","names":[],"sources":["../../../src/actions/getSuiBalance.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getSuiBalance.d.ts","names":[],"sources":["../../../src/actions/getSuiBalance.ts"],"mappings":";;wBAUsB,cACpB,QAAQ,WACR,uBACA,QAAQ,UACP,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SuiClientTypes } from "@mysten/sui/client";
|
|
2
2
|
//#region src/actions/getSuiNSAddress.d.ts
|
|
3
|
-
declare function getSuiNSAddress(name: string, rpcUrl?: string, network?: SuiClientTypes.Network): Promise<string | undefined>;
|
|
3
|
+
export declare function getSuiNSAddress(name: string, rpcUrl?: string, network?: SuiClientTypes.Network): Promise<string | undefined>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { getSuiNSAddress };
|
|
6
5
|
//# sourceMappingURL=getSuiNSAddress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSuiNSAddress.d.ts","names":[],"sources":["../../../src/actions/getSuiNSAddress.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getSuiNSAddress.d.ts","names":[],"sources":["../../../src/actions/getSuiNSAddress.ts"],"mappings":";;wBAIsB,gBACpB,cACA,iBACA,UAAU,eAAe,UACxB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/actions/resolveSuiAddress.d.ts
|
|
2
|
-
declare function resolveSuiAddress(name: string): Promise<string | undefined>;
|
|
2
|
+
export declare function resolveSuiAddress(name: string): Promise<string | undefined>;
|
|
3
3
|
//#endregion
|
|
4
|
-
export { resolveSuiAddress };
|
|
5
4
|
//# sourceMappingURL=resolveSuiAddress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSuiAddress.d.ts","names":[],"sources":["../../../src/actions/resolveSuiAddress.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"resolveSuiAddress.d.ts","names":[],"sources":["../../../src/actions/resolveSuiAddress.ts"],"mappings":";wBAEsB,kBACpB,eACC"}
|
|
@@ -7,7 +7,6 @@ import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
|
7
7
|
* @param fn - The function to call, which receives a SuiGrpcClient instance.
|
|
8
8
|
* @returns - The result of the function call.
|
|
9
9
|
*/
|
|
10
|
-
declare function callSuiWithRetry<R>(client: SDKClient, fn: (client: SuiGrpcClient) => Promise<R>): Promise<R>;
|
|
10
|
+
export declare function callSuiWithRetry<R>(client: SDKClient, fn: (client: SuiGrpcClient) => Promise<R>): Promise<R>;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { callSuiWithRetry };
|
|
13
12
|
//# sourceMappingURL=suiClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suiClient.d.ts","names":[],"sources":["../../../src/client/suiClient.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"suiClient.d.ts","names":[],"sources":["../../../src/client/suiClient.ts"],"mappings":";;;;;;;;;wBAyBsB,iBAAiB,GACrC,QAAQ,WACR,KAAK,QAAQ,kBAAkB,QAAQ,KACtC,QAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SuiStepExecutorContext, SuiStepExecutorOptions } from "../types.js";
|
|
2
2
|
import { BaseStepExecutor, ExecutionAction, LiFiStepExtended, SDKError, StepExecutorBaseContext, TaskPipeline } from "@lifi/sdk";
|
|
3
3
|
//#region src/core/SuiStepExecutor.d.ts
|
|
4
|
-
declare class SuiStepExecutor extends BaseStepExecutor {
|
|
4
|
+
export declare class SuiStepExecutor extends BaseStepExecutor {
|
|
5
5
|
private client;
|
|
6
6
|
private signer;
|
|
7
7
|
constructor(options: SuiStepExecutorOptions);
|
|
@@ -11,5 +11,4 @@ declare class SuiStepExecutor extends BaseStepExecutor {
|
|
|
11
11
|
override createPipeline: (context: SuiStepExecutorContext) => TaskPipeline;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
|
-
export { SuiStepExecutor };
|
|
15
14
|
//# sourceMappingURL=SuiStepExecutor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiStepExecutor.d.ts","names":[],"sources":["../../../src/core/SuiStepExecutor.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SuiStepExecutor.d.ts","names":[],"sources":["../../../src/core/SuiStepExecutor.ts"],"mappings":";;;qBAuBa,wBAAwB;UAC3B;UACA;EAER,YAAY,SAAS;EAMrB,cAAe,MAAM;WAWZ,cACP,OAAO,OACP,OAAO,kBACP,SAAS,oBACR,QAAQ;WAEF,gBACP,aAAa,4BACZ,QAAQ;WASF,iBAAkB,SAAS,2BAAyB"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SuiStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
3
|
//#region src/core/tasks/SuiSignAndExecuteTask.d.ts
|
|
4
|
-
declare class SuiSignAndExecuteTask extends BaseStepExecutionTask {
|
|
4
|
+
export declare class SuiSignAndExecuteTask extends BaseStepExecutionTask {
|
|
5
5
|
run(context: SuiStepExecutorContext): Promise<TaskResult>;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
|
-
export { SuiSignAndExecuteTask };
|
|
9
8
|
//# sourceMappingURL=SuiSignAndExecuteTask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SuiSignAndExecuteTask.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SuiSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SuiSignAndExecuteTask.ts"],"mappings":";;;qBAUa,8BAA8B;EACzC,IAAU,SAAS,yBAAyB,QAAQ"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SuiStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
3
|
//#region src/core/tasks/SuiWaitForTransactionTask.d.ts
|
|
4
|
-
declare class SuiWaitForTransactionTask extends BaseStepExecutionTask {
|
|
4
|
+
export declare class SuiWaitForTransactionTask extends BaseStepExecutionTask {
|
|
5
5
|
run(context: SuiStepExecutorContext): Promise<TaskResult>;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
|
-
export { SuiWaitForTransactionTask };
|
|
9
8
|
//# sourceMappingURL=SuiWaitForTransactionTask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SuiWaitForTransactionTask.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SuiWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SuiWaitForTransactionTask.ts"],"mappings":";;;qBASa,kCAAkC;EAC7C,IAAU,SAAS,yBAAyB,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ExecutionAction, LiFiStep, SDKError } from "@lifi/sdk";
|
|
2
2
|
//#region src/errors/parseSuiErrors.d.ts
|
|
3
|
-
declare const parseSuiErrors: (e: Error, step?: LiFiStep, action?: ExecutionAction) => Promise<SDKError>;
|
|
3
|
+
export declare const parseSuiErrors: (e: Error, step?: LiFiStep, action?: ExecutionAction) => Promise<SDKError>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { parseSuiErrors };
|
|
6
5
|
//# sourceMappingURL=parseSuiErrors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseSuiErrors.d.ts","names":[],"sources":["../../../src/errors/parseSuiErrors.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"parseSuiErrors.d.ts","names":[],"sources":["../../../src/errors/parseSuiErrors.ts"],"mappings":";;qBAWa,iBACX,GAAG,OACH,OAAO,UACP,SAAS,oBACR,QAAQ"}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -2,28 +2,27 @@ import { LiFiStepExtended, SDKProvider, StepExecutorContext, StepExecutorOptions
|
|
|
2
2
|
import { ClientWithCoreApi, SuiClientTypes } from "@mysten/sui/client";
|
|
3
3
|
import { Signer } from "@mysten/sui/cryptography";
|
|
4
4
|
//#region src/types.d.ts
|
|
5
|
-
interface SuiProviderOptions {
|
|
5
|
+
export interface SuiProviderOptions {
|
|
6
6
|
getClient?: () => Promise<ClientWithCoreApi>;
|
|
7
7
|
getSigner?: () => Promise<Signer>;
|
|
8
8
|
}
|
|
9
|
-
interface SuiTaskContext {
|
|
9
|
+
export interface SuiTaskContext {
|
|
10
10
|
signedTransaction?: SuiClientTypes.Transaction;
|
|
11
11
|
}
|
|
12
|
-
interface SuiStepExecutorContext extends StepExecutorContext, SuiTaskContext {
|
|
12
|
+
export interface SuiStepExecutorContext extends StepExecutorContext, SuiTaskContext {
|
|
13
13
|
suiClient: ClientWithCoreApi;
|
|
14
14
|
signer: Signer;
|
|
15
15
|
checkWallet: (step: LiFiStepExtended) => void;
|
|
16
16
|
}
|
|
17
|
-
interface SuiSDKProvider extends SDKProvider {
|
|
17
|
+
export interface SuiSDKProvider extends SDKProvider {
|
|
18
18
|
setOptions(options: SuiProviderOptions): void;
|
|
19
19
|
}
|
|
20
|
-
declare function isSuiProvider(provider: SDKProvider): provider is SuiSDKProvider;
|
|
21
|
-
interface SuiStepExecutorOptions extends StepExecutorOptions {
|
|
20
|
+
export declare function isSuiProvider(provider: SDKProvider): provider is SuiSDKProvider;
|
|
21
|
+
export interface SuiStepExecutorOptions extends StepExecutorOptions {
|
|
22
22
|
client: ClientWithCoreApi;
|
|
23
23
|
signer: Signer;
|
|
24
24
|
}
|
|
25
|
-
declare const SuiTokenShortAddress = "0x2::sui::SUI";
|
|
26
|
-
declare const SuiTokenLongAddress = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
25
|
+
export declare const SuiTokenShortAddress = "0x2::sui::SUI";
|
|
26
|
+
export declare const SuiTokenLongAddress = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
27
27
|
//#endregion
|
|
28
|
-
export { SuiProviderOptions, SuiSDKProvider, SuiStepExecutorContext, SuiStepExecutorOptions, SuiTaskContext, SuiTokenLongAddress, SuiTokenShortAddress, isSuiProvider };
|
|
29
28
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"mappings":";;;;iBAUiB;EACf,kBAAkB,QAAQ;EAC1B,kBAAkB,QAAQ;;iBAGX;EACf,oBAAoB,eAAe;;iBAGpB,+BACP,qBACN;EACF,WAAW;EACX,QAAQ;EACR,cAAc,MAAM;;iBAGL,uBAAuB;EACtC,WAAW,SAAS;;wBAGN,cACd,UAAU,cACT,YAAY;iBAIE,+BAA+B;EAC9C,QAAQ;EACR,QAAQ;;qBAGG;qBACA"}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/version.d.ts
|
|
2
|
-
declare const name = "@lifi/sdk-provider-sui";
|
|
3
|
-
declare const version = "4.1
|
|
2
|
+
export declare const name = "@lifi/sdk-provider-sui";
|
|
3
|
+
export declare const version = "4.2.1";
|
|
4
4
|
//#endregion
|
|
5
|
-
export { name, version };
|
|
6
5
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","names":[],"sources":["../../src/version.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"version.d.ts","names":[],"sources":["../../src/version.ts"],"mappings":";qBAAa;qBACA"}
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk-provider-sui'\nexport const version = '4.1
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk-provider-sui'\nexport const version = '4.2.1'\n"],"mappings":";AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/sdk-provider-sui",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "LI.FI Sui SDK Provider for Any-to-Any Cross-Chain-Swap",
|
|
5
5
|
"homepage": "https://github.com/lifinance/sdk",
|
|
6
6
|
"bugs": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@lifi/sdk": "4.
|
|
32
|
-
"@mysten/sui": "^2.
|
|
31
|
+
"@lifi/sdk": "4.8.0",
|
|
32
|
+
"@mysten/sui": "^2.31.3"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
package/src/SuiProvider.ts
CHANGED
|
@@ -4,12 +4,17 @@ import {
|
|
|
4
4
|
ProviderError,
|
|
5
5
|
type StepExecutorOptions,
|
|
6
6
|
} from '@lifi/sdk'
|
|
7
|
-
import { isValidSuiAddress } from '@mysten/sui/utils'
|
|
7
|
+
import { isValidStructTag, isValidSuiAddress } from '@mysten/sui/utils'
|
|
8
8
|
import { getSuiBalance } from './actions/getSuiBalance.js'
|
|
9
9
|
import { resolveSuiAddress } from './actions/resolveSuiAddress.js'
|
|
10
10
|
import { SuiStepExecutor } from './core/SuiStepExecutor.js'
|
|
11
11
|
import type { SuiProviderOptions, SuiSDKProvider } from './types.js'
|
|
12
12
|
|
|
13
|
+
/** Tokens are Move coin types, which `isValidSuiAddress` rejects. */
|
|
14
|
+
function isSuiTokenAddress(address: string): boolean {
|
|
15
|
+
return isValidStructTag(address)
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
export function SuiProvider(options?: SuiProviderOptions): SuiSDKProvider {
|
|
14
19
|
const _options: SuiProviderOptions = options ?? {}
|
|
15
20
|
return {
|
|
@@ -17,6 +22,7 @@ export function SuiProvider(options?: SuiProviderOptions): SuiSDKProvider {
|
|
|
17
22
|
return ChainType.MVM
|
|
18
23
|
},
|
|
19
24
|
isAddress: isValidSuiAddress,
|
|
25
|
+
isTokenAddress: isSuiTokenAddress,
|
|
20
26
|
resolveAddress: resolveSuiAddress,
|
|
21
27
|
getBalance: getSuiBalance,
|
|
22
28
|
async getStepExecutor(
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk-provider-sui'
|
|
2
|
-
export const version = '4.1
|
|
2
|
+
export const version = '4.2.1'
|