@lifi/sdk 4.7.0 → 4.8.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/CHANGELOG.md +22 -0
- package/README.md +24 -8
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.js +4 -2
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.js.map +1 -1
- package/dist/cjs/utils/checkPackageUpdates.js +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.js +4 -2
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.js.map +1 -1
- package/dist/esm/utils/checkPackageUpdates.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/package.json +2 -2
- package/src/core/tasks/helpers/waitForTransactionStatus.ts +8 -2
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @lifi/sdk
|
|
2
2
|
|
|
3
|
+
## 4.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#475](https://github.com/lifinance/sdk/pull/475) [`252a06d`](https://github.com/lifinance/sdk/commit/252a06de1db75fad3d8501e05cc128b0a4c9d914) Thanks [@chybisov](https://github.com/chybisov)! - Bump the `@lifi/types` pin to `^18.10.0`.
|
|
8
|
+
|
|
9
|
+
`18.6.0` adds `PermitSingle` to `TypedDataPrimaryTypes`, so the Ethereum
|
|
10
|
+
provider's typed-data lane classifier can compare `primaryType` against the
|
|
11
|
+
declared union instead of a module-private string allowlist.
|
|
12
|
+
|
|
13
|
+
`@lifi/sdk` re-exports `@lifi/types` wholesale, so the addition widens its own
|
|
14
|
+
public type surface — additive only, nothing is removed or narrowed.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#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`,
|
|
19
|
+
`@mysten/sui` to `^2.31.3`, `@solana/kit` to `^8.3.0`,
|
|
20
|
+
`@solana/wallet-standard-features` to `^1.5.0`, `@stellar/stellar-sdk` to `^17.1.0`,
|
|
21
|
+
`@bigmi/core` to `^0.9.2` and `tronweb` to `^6.5.1`.
|
|
22
|
+
|
|
23
|
+
- [#475](https://github.com/lifinance/sdk/pull/475) [`252a06d`](https://github.com/lifinance/sdk/commit/252a06de1db75fad3d8501e05cc128b0a4c9d914) Thanks [@chybisov](https://github.com/chybisov)! - Give a pending bridge a link to follow. While waiting for the destination, the status poll only forwarded `bridgeExplorerLink`, which most bridges do not provide, so the receiving action had nothing to open for the whole wait. It now falls back to `lifiExplorerLink`, which every recorded transfer carries and which shows both legs.
|
|
24
|
+
|
|
3
25
|
## 4.7.0
|
|
4
26
|
|
|
5
27
|
### Minor 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
|
```
|
|
@@ -17,13 +17,15 @@ async function waitForTransactionStatus(client, statusManager, txHash, step, act
|
|
|
17
17
|
}).then((statusResponse) => {
|
|
18
18
|
switch (statusResponse.status) {
|
|
19
19
|
case "DONE": return statusResponse;
|
|
20
|
-
case "PENDING":
|
|
20
|
+
case "PENDING": {
|
|
21
|
+
const pendingStatus = statusResponse;
|
|
21
22
|
statusManager?.updateAction(step, actionType, "PENDING", {
|
|
22
23
|
substatus: statusResponse.substatus,
|
|
23
24
|
substatusMessage: statusResponse.substatusMessage || require_core_actionMessages.getSubstatusMessage(statusResponse.status, statusResponse.substatus),
|
|
24
|
-
txLink:
|
|
25
|
+
txLink: pendingStatus.bridgeExplorerLink ?? pendingStatus.lifiExplorerLink
|
|
25
26
|
});
|
|
26
27
|
return;
|
|
28
|
+
}
|
|
27
29
|
case "NOT_FOUND": return;
|
|
28
30
|
default: return Promise.reject();
|
|
29
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForTransactionStatus.js","names":["getStatus","getSubstatusMessage","waitForResult","ServerError"],"sources":["../../../../../src/core/tasks/helpers/waitForTransactionStatus.ts"],"sourcesContent":["import type { FullStatusData, LiFiStep, StatusResponse } from '@lifi/types'\nimport { getStatus } from '../../../actions/getStatus.js'\nimport { ServerError } from '../../../errors/errors.js'\nimport type { ExecutionActionType, SDKClient } from '../../../types/core.js'\nimport { waitForResult } from '../../../utils/waitForResult.js'\nimport { getSubstatusMessage } from '../../actionMessages.js'\nimport type { StatusManager } from '../../StatusManager.js'\n\nconst TRANSACTION_HASH_OBSERVERS: Record<string, Promise<StatusResponse>> = {}\n\nexport async function waitForTransactionStatus(\n client: SDKClient,\n statusManager: StatusManager,\n txHash: string,\n step: LiFiStep,\n actionType: ExecutionActionType,\n interval = 5_000\n): Promise<StatusResponse> {\n const _getStatus = (): Promise<StatusResponse | undefined> => {\n return getStatus(client, {\n fromChain: step.action.fromChainId,\n fromAddress: step.action.fromAddress,\n toChain: step.action.toChainId,\n txHash,\n ...(step.tool !== 'custom' && { bridge: step.tool }),\n ...(step.transactionId && { transactionId: step.transactionId }),\n })\n .then((statusResponse) => {\n switch (statusResponse.status) {\n case 'DONE':\n return statusResponse\n case 'PENDING'
|
|
1
|
+
{"version":3,"file":"waitForTransactionStatus.js","names":["getStatus","getSubstatusMessage","waitForResult","ServerError"],"sources":["../../../../../src/core/tasks/helpers/waitForTransactionStatus.ts"],"sourcesContent":["import type { FullStatusData, LiFiStep, StatusResponse } from '@lifi/types'\nimport { getStatus } from '../../../actions/getStatus.js'\nimport { ServerError } from '../../../errors/errors.js'\nimport type { ExecutionActionType, SDKClient } from '../../../types/core.js'\nimport { waitForResult } from '../../../utils/waitForResult.js'\nimport { getSubstatusMessage } from '../../actionMessages.js'\nimport type { StatusManager } from '../../StatusManager.js'\n\nconst TRANSACTION_HASH_OBSERVERS: Record<string, Promise<StatusResponse>> = {}\n\nexport async function waitForTransactionStatus(\n client: SDKClient,\n statusManager: StatusManager,\n txHash: string,\n step: LiFiStep,\n actionType: ExecutionActionType,\n interval = 5_000\n): Promise<StatusResponse> {\n const _getStatus = (): Promise<StatusResponse | undefined> => {\n return getStatus(client, {\n fromChain: step.action.fromChainId,\n fromAddress: step.action.fromAddress,\n toChain: step.action.toChainId,\n txHash,\n ...(step.tool !== 'custom' && { bridge: step.tool }),\n ...(step.transactionId && { transactionId: step.transactionId }),\n })\n .then((statusResponse) => {\n switch (statusResponse.status) {\n case 'DONE':\n return statusResponse\n case 'PENDING': {\n const pendingStatus = statusResponse as FullStatusData\n statusManager?.updateAction(step, actionType, 'PENDING', {\n substatus: statusResponse.substatus,\n substatusMessage:\n statusResponse.substatusMessage ||\n getSubstatusMessage(\n statusResponse.status,\n statusResponse.substatus\n ),\n // Most bridges implement no `getExplorerLink`, so fall back to\n // the LI.FI explorer rather than leave the user with no link.\n txLink:\n pendingStatus.bridgeExplorerLink ??\n pendingStatus.lifiExplorerLink,\n })\n return undefined\n }\n case 'NOT_FOUND':\n return undefined\n default:\n return Promise.reject()\n }\n })\n .catch((e) => {\n if (process.env.NODE_ENV === 'development') {\n console.debug('Fetching status from backend failed.', e)\n }\n return undefined\n })\n }\n\n let status = TRANSACTION_HASH_OBSERVERS[txHash]\n\n if (!status) {\n status = waitForResult(_getStatus, interval).finally(() => {\n delete TRANSACTION_HASH_OBSERVERS[txHash]\n })\n TRANSACTION_HASH_OBSERVERS[txHash] = status\n }\n\n const resolvedStatus = await status\n\n if (!('receiving' in resolvedStatus)) {\n throw new ServerError(\n \"Status doesn't contain destination chain information.\"\n )\n }\n\n return resolvedStatus\n}\n"],"mappings":";;;;;;AAQA,MAAM,6BAAsE,CAAC;AAE7E,eAAsB,yBACpB,QACA,eACA,QACA,MACA,YACA,WAAW,KACc;CACzB,MAAM,mBAAwD;EAC5D,OAAOA,0BAAAA,UAAU,QAAQ;GACvB,WAAW,KAAK,OAAO;GACvB,aAAa,KAAK,OAAO;GACzB,SAAS,KAAK,OAAO;GACrB;GACA,GAAI,KAAK,SAAS,YAAY,EAAE,QAAQ,KAAK,KAAK;GAClD,GAAI,KAAK,iBAAiB,EAAE,eAAe,KAAK,cAAc;EAChE,CAAC,CAAC,CACC,MAAM,mBAAmB;GACxB,QAAQ,eAAe,QAAvB;IACE,KAAK,QACH,OAAO;IACT,KAAK,WAAW;KACd,MAAM,gBAAgB;KACtB,eAAe,aAAa,MAAM,YAAY,WAAW;MACvD,WAAW,eAAe;MAC1B,kBACE,eAAe,oBACfC,4BAAAA,oBACE,eAAe,QACf,eAAe,SACjB;MAGF,QACE,cAAc,sBACd,cAAc;KAClB,CAAC;KACD;IACF;IACA,KAAK,aACH;IACF,SACE,OAAO,QAAQ,OAAO;GAC1B;EACF,CAAC,CAAC,CACD,OAAO,MAAM;GACZ,IAAI,QAAQ,IAAI,aAAa,eAC3B,QAAQ,MAAM,wCAAwC,CAAC;EAG3D,CAAC;CACL;CAEA,IAAI,SAAS,2BAA2B;CAExC,IAAI,CAAC,QAAQ;EACX,SAASC,4BAAAA,cAAc,YAAY,QAAQ,CAAC,CAAC,cAAc;GACzD,OAAO,2BAA2B;EACpC,CAAC;EACD,2BAA2B,UAAU;CACvC;CAEA,MAAM,iBAAiB,MAAM;CAE7B,IAAI,EAAE,eAAe,iBACnB,MAAM,IAAIC,sBAAAA,YACR,uDACF;CAGF,OAAO;AACT"}
|
|
@@ -5,7 +5,7 @@ const checkPackageUpdates = async (packageName, packageVersion) => {
|
|
|
5
5
|
try {
|
|
6
6
|
const pkgName = packageName ?? "@lifi/sdk";
|
|
7
7
|
const latestVersion = (await (await fetch(`https://registry.npmjs.org/${pkgName}/latest`)).json()).version;
|
|
8
|
-
const currentVersion = packageVersion ?? "4.
|
|
8
|
+
const currentVersion = packageVersion ?? "4.8.0";
|
|
9
9
|
if (latestVersion > currentVersion) console.warn(`${pkgName}: new package version is available. Please update as soon as possible to enjoy the newest features. Current version: ${currentVersion}. Latest version: ${latestVersion}.`);
|
|
10
10
|
} catch (_error) {}
|
|
11
11
|
};
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
package/dist/cjs/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk'\nexport const version = '4.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk'\nexport const version = '4.8.0'\n"],"mappings":";;AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
|
@@ -16,13 +16,15 @@ async function waitForTransactionStatus(client, statusManager, txHash, step, act
|
|
|
16
16
|
}).then((statusResponse) => {
|
|
17
17
|
switch (statusResponse.status) {
|
|
18
18
|
case "DONE": return statusResponse;
|
|
19
|
-
case "PENDING":
|
|
19
|
+
case "PENDING": {
|
|
20
|
+
const pendingStatus = statusResponse;
|
|
20
21
|
statusManager?.updateAction(step, actionType, "PENDING", {
|
|
21
22
|
substatus: statusResponse.substatus,
|
|
22
23
|
substatusMessage: statusResponse.substatusMessage || getSubstatusMessage(statusResponse.status, statusResponse.substatus),
|
|
23
|
-
txLink:
|
|
24
|
+
txLink: pendingStatus.bridgeExplorerLink ?? pendingStatus.lifiExplorerLink
|
|
24
25
|
});
|
|
25
26
|
return;
|
|
27
|
+
}
|
|
26
28
|
case "NOT_FOUND": return;
|
|
27
29
|
default: return Promise.reject();
|
|
28
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForTransactionStatus.js","names":[],"sources":["../../../../../src/core/tasks/helpers/waitForTransactionStatus.ts"],"sourcesContent":["import type { FullStatusData, LiFiStep, StatusResponse } from '@lifi/types'\nimport { getStatus } from '../../../actions/getStatus.js'\nimport { ServerError } from '../../../errors/errors.js'\nimport type { ExecutionActionType, SDKClient } from '../../../types/core.js'\nimport { waitForResult } from '../../../utils/waitForResult.js'\nimport { getSubstatusMessage } from '../../actionMessages.js'\nimport type { StatusManager } from '../../StatusManager.js'\n\nconst TRANSACTION_HASH_OBSERVERS: Record<string, Promise<StatusResponse>> = {}\n\nexport async function waitForTransactionStatus(\n client: SDKClient,\n statusManager: StatusManager,\n txHash: string,\n step: LiFiStep,\n actionType: ExecutionActionType,\n interval = 5_000\n): Promise<StatusResponse> {\n const _getStatus = (): Promise<StatusResponse | undefined> => {\n return getStatus(client, {\n fromChain: step.action.fromChainId,\n fromAddress: step.action.fromAddress,\n toChain: step.action.toChainId,\n txHash,\n ...(step.tool !== 'custom' && { bridge: step.tool }),\n ...(step.transactionId && { transactionId: step.transactionId }),\n })\n .then((statusResponse) => {\n switch (statusResponse.status) {\n case 'DONE':\n return statusResponse\n case 'PENDING'
|
|
1
|
+
{"version":3,"file":"waitForTransactionStatus.js","names":[],"sources":["../../../../../src/core/tasks/helpers/waitForTransactionStatus.ts"],"sourcesContent":["import type { FullStatusData, LiFiStep, StatusResponse } from '@lifi/types'\nimport { getStatus } from '../../../actions/getStatus.js'\nimport { ServerError } from '../../../errors/errors.js'\nimport type { ExecutionActionType, SDKClient } from '../../../types/core.js'\nimport { waitForResult } from '../../../utils/waitForResult.js'\nimport { getSubstatusMessage } from '../../actionMessages.js'\nimport type { StatusManager } from '../../StatusManager.js'\n\nconst TRANSACTION_HASH_OBSERVERS: Record<string, Promise<StatusResponse>> = {}\n\nexport async function waitForTransactionStatus(\n client: SDKClient,\n statusManager: StatusManager,\n txHash: string,\n step: LiFiStep,\n actionType: ExecutionActionType,\n interval = 5_000\n): Promise<StatusResponse> {\n const _getStatus = (): Promise<StatusResponse | undefined> => {\n return getStatus(client, {\n fromChain: step.action.fromChainId,\n fromAddress: step.action.fromAddress,\n toChain: step.action.toChainId,\n txHash,\n ...(step.tool !== 'custom' && { bridge: step.tool }),\n ...(step.transactionId && { transactionId: step.transactionId }),\n })\n .then((statusResponse) => {\n switch (statusResponse.status) {\n case 'DONE':\n return statusResponse\n case 'PENDING': {\n const pendingStatus = statusResponse as FullStatusData\n statusManager?.updateAction(step, actionType, 'PENDING', {\n substatus: statusResponse.substatus,\n substatusMessage:\n statusResponse.substatusMessage ||\n getSubstatusMessage(\n statusResponse.status,\n statusResponse.substatus\n ),\n // Most bridges implement no `getExplorerLink`, so fall back to\n // the LI.FI explorer rather than leave the user with no link.\n txLink:\n pendingStatus.bridgeExplorerLink ??\n pendingStatus.lifiExplorerLink,\n })\n return undefined\n }\n case 'NOT_FOUND':\n return undefined\n default:\n return Promise.reject()\n }\n })\n .catch((e) => {\n if (process.env.NODE_ENV === 'development') {\n console.debug('Fetching status from backend failed.', e)\n }\n return undefined\n })\n }\n\n let status = TRANSACTION_HASH_OBSERVERS[txHash]\n\n if (!status) {\n status = waitForResult(_getStatus, interval).finally(() => {\n delete TRANSACTION_HASH_OBSERVERS[txHash]\n })\n TRANSACTION_HASH_OBSERVERS[txHash] = status\n }\n\n const resolvedStatus = await status\n\n if (!('receiving' in resolvedStatus)) {\n throw new ServerError(\n \"Status doesn't contain destination chain information.\"\n )\n }\n\n return resolvedStatus\n}\n"],"mappings":";;;;;AAQA,MAAM,6BAAsE,CAAC;AAE7E,eAAsB,yBACpB,QACA,eACA,QACA,MACA,YACA,WAAW,KACc;CACzB,MAAM,mBAAwD;EAC5D,OAAO,UAAU,QAAQ;GACvB,WAAW,KAAK,OAAO;GACvB,aAAa,KAAK,OAAO;GACzB,SAAS,KAAK,OAAO;GACrB;GACA,GAAI,KAAK,SAAS,YAAY,EAAE,QAAQ,KAAK,KAAK;GAClD,GAAI,KAAK,iBAAiB,EAAE,eAAe,KAAK,cAAc;EAChE,CAAC,CAAC,CACC,MAAM,mBAAmB;GACxB,QAAQ,eAAe,QAAvB;IACE,KAAK,QACH,OAAO;IACT,KAAK,WAAW;KACd,MAAM,gBAAgB;KACtB,eAAe,aAAa,MAAM,YAAY,WAAW;MACvD,WAAW,eAAe;MAC1B,kBACE,eAAe,oBACf,oBACE,eAAe,QACf,eAAe,SACjB;MAGF,QACE,cAAc,sBACd,cAAc;KAClB,CAAC;KACD;IACF;IACA,KAAK,aACH;IACF,SACE,OAAO,QAAQ,OAAO;GAC1B;EACF,CAAC,CAAC,CACD,OAAO,MAAM;GACZ,IAAI,QAAQ,IAAI,aAAa,eAC3B,QAAQ,MAAM,wCAAwC,CAAC;EAG3D,CAAC;CACL;CAEA,IAAI,SAAS,2BAA2B;CAExC,IAAI,CAAC,QAAQ;EACX,SAAS,cAAc,YAAY,QAAQ,CAAC,CAAC,cAAc;GACzD,OAAO,2BAA2B;EACpC,CAAC;EACD,2BAA2B,UAAU;CACvC;CAEA,MAAM,iBAAiB,MAAM;CAE7B,IAAI,EAAE,eAAe,iBACnB,MAAM,IAAI,YACR,uDACF;CAGF,OAAO;AACT"}
|
|
@@ -4,7 +4,7 @@ const checkPackageUpdates = async (packageName, packageVersion) => {
|
|
|
4
4
|
try {
|
|
5
5
|
const pkgName = packageName ?? "@lifi/sdk";
|
|
6
6
|
const latestVersion = (await (await fetch(`https://registry.npmjs.org/${pkgName}/latest`)).json()).version;
|
|
7
|
-
const currentVersion = packageVersion ?? "4.
|
|
7
|
+
const currentVersion = packageVersion ?? "4.8.0";
|
|
8
8
|
if (latestVersion > currentVersion) console.warn(`${pkgName}: new package version is available. Please update as soon as possible to enjoy the newest features. Current version: ${currentVersion}. Latest version: ${latestVersion}.`);
|
|
9
9
|
} catch (_error) {}
|
|
10
10
|
};
|
package/dist/esm/version.d.ts
CHANGED
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'\nexport const version = '4.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk'\nexport const version = '4.8.0'\n"],"mappings":";AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "LI.FI SDK for Any-to-Any Cross-Chain-Swap",
|
|
5
5
|
"homepage": "https://github.com/lifinance/sdk",
|
|
6
6
|
"bugs": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@lifi/types": "^18.
|
|
31
|
+
"@lifi/types": "^18.10.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
@@ -29,7 +29,8 @@ export async function waitForTransactionStatus(
|
|
|
29
29
|
switch (statusResponse.status) {
|
|
30
30
|
case 'DONE':
|
|
31
31
|
return statusResponse
|
|
32
|
-
case 'PENDING':
|
|
32
|
+
case 'PENDING': {
|
|
33
|
+
const pendingStatus = statusResponse as FullStatusData
|
|
33
34
|
statusManager?.updateAction(step, actionType, 'PENDING', {
|
|
34
35
|
substatus: statusResponse.substatus,
|
|
35
36
|
substatusMessage:
|
|
@@ -38,9 +39,14 @@ export async function waitForTransactionStatus(
|
|
|
38
39
|
statusResponse.status,
|
|
39
40
|
statusResponse.substatus
|
|
40
41
|
),
|
|
41
|
-
|
|
42
|
+
// Most bridges implement no `getExplorerLink`, so fall back to
|
|
43
|
+
// the LI.FI explorer rather than leave the user with no link.
|
|
44
|
+
txLink:
|
|
45
|
+
pendingStatus.bridgeExplorerLink ??
|
|
46
|
+
pendingStatus.lifiExplorerLink,
|
|
42
47
|
})
|
|
43
48
|
return undefined
|
|
49
|
+
}
|
|
44
50
|
case 'NOT_FOUND':
|
|
45
51
|
return undefined
|
|
46
52
|
default:
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk'
|
|
2
|
-
export const version = '4.
|
|
2
|
+
export const version = '4.8.0'
|