Skip to content

Commit df73b5e

Browse files
committed
Merge branch 'main' into permits
2 parents bbef7f0 + f67fffd commit df73b5e

File tree

9 files changed

+81
-59
lines changed

9 files changed

+81
-59
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [3.5.2](https://github.com/lifinance/sdk/compare/v3.5.1...v3.5.2) (2025-01-14)
6+
7+
8+
### Bug Fixes
9+
10+
* preserve transaction hash when creating new process ([#232](https://github.com/lifinance/sdk/issues/232)) ([7e8c829](https://github.com/lifinance/sdk/commit/7e8c829af53ba9e9333333df54b3a67e44702c4c))
11+
512
### [3.5.1](https://github.com/lifinance/sdk/compare/v3.5.0...v3.5.1) (2025-01-09)
613

714

examples/node/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@wagmi/connectors": "^5.7.3",
1313
"@wagmi/core": "^2.16.3",
1414
"dotenv": "^16.4.7",
15-
"viem": "^2.22.5"
15+
"viem": "^2.22.8"
1616
},
1717
"scripts": {
1818
"example:swap": "tsx examples/swap.ts",
@@ -24,7 +24,7 @@
2424
"example:yearn": "tsx examples/yearnDeposit.ts"
2525
},
2626
"devDependencies": {
27-
"@types/node": "^22.10.5",
27+
"@types/node": "^22.10.6",
2828
"tsx": "^4.19.2",
2929
"typescript": "^5.7.3"
3030
}

examples/node/pnpm-lock.yaml

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lifi/sdk",
3-
"version": "3.6.0-beta.0",
3+
"version": "3.5.2",
44
"description": "LI.FI Any-to-Any Cross-Chain-Swap SDK",
55
"keywords": [
66
"bridge",
@@ -100,7 +100,7 @@
100100
"bech32": "^2.0.0",
101101
"bitcoinjs-lib": "^7.0.0-rc.0",
102102
"bs58": "^6.0.0",
103-
"viem": "^2.22.5"
103+
"viem": "^2.22.8"
104104
},
105105
"devDependencies": {
106106
"@biomejs/biome": "^1.9.4",

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/EVM/EVMStepExecutor.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,10 @@ export class EVMStepExecutor extends BaseStepExecutor {
508508
}
509509

510510
// Wait for the transaction status on the destination chain
511+
const transactionHash = process.txHash
512+
if (!transactionHash) {
513+
throw new Error('Transaction hash is undefined.')
514+
}
511515
if (isBridgeExecution) {
512516
process = this.statusManager.findOrCreateProcess({
513517
step,
@@ -519,9 +523,10 @@ export class EVMStepExecutor extends BaseStepExecutor {
519523

520524
await waitForDestinationChainTransaction(
521525
step,
522-
process,
523-
this.statusManager,
524-
toChain
526+
process.type,
527+
transactionHash,
528+
toChain,
529+
this.statusManager
525530
)
526531

527532
// DONE

src/core/Solana/SolanaStepExecutor.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ export class SolanaStepExecutor extends BaseStepExecutor {
218218
}
219219

220220
// Wait for the transaction status on the destination chain
221+
const transactionHash = process.txHash
222+
if (!transactionHash) {
223+
throw new Error('Transaction hash is undefined.')
224+
}
221225
if (isBridgeExecution) {
222226
process = this.statusManager.findOrCreateProcess({
223227
step,
@@ -229,9 +233,10 @@ export class SolanaStepExecutor extends BaseStepExecutor {
229233

230234
await waitForDestinationChainTransaction(
231235
step,
232-
process,
233-
this.statusManager,
234-
toChain
236+
process.type,
237+
transactionHash,
238+
toChain,
239+
this.statusManager
235240
)
236241

237242
// DONE

src/core/UTXO/UTXOStepExecutor.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ export class UTXOStepExecutor extends BaseStepExecutor {
264264
}
265265

266266
// Wait for the transaction status on the destination chain
267+
const transactionHash = process.txHash
268+
if (!transactionHash) {
269+
throw new Error('Transaction hash is undefined.')
270+
}
267271
if (isBridgeExecution) {
268272
process = this.statusManager.findOrCreateProcess({
269273
step,
@@ -275,9 +279,10 @@ export class UTXOStepExecutor extends BaseStepExecutor {
275279

276280
await waitForDestinationChainTransaction(
277281
step,
278-
process,
279-
this.statusManager,
282+
process.type,
283+
transactionHash,
280284
toChain,
285+
this.statusManager,
281286
10_000
282287
)
283288

src/core/waitForDestinationChainTransaction.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {
22
ExtendedChain,
33
ExtendedTransactionInfo,
44
FullStatusData,
5-
Process,
5+
ProcessType,
66
} from '@lifi/types'
77
import { LiFiErrorCode } from '../errors/constants.js'
88
import { getTransactionFailedMessage } from '../utils/getTransactionMessage.js'
@@ -12,28 +12,25 @@ import { waitForTransactionStatus } from './waitForTransactionStatus.js'
1212

1313
export async function waitForDestinationChainTransaction(
1414
step: LiFiStepExtended,
15-
process: Process,
16-
statusManager: StatusManager,
15+
processType: ProcessType,
16+
transactionHash: string,
1717
toChain: ExtendedChain,
18+
statusManager: StatusManager,
1819
pollingInterval?: number
1920
): Promise<LiFiStepExtended> {
20-
if (!process.txHash) {
21-
throw new Error('Transaction hash is undefined.')
22-
}
23-
2421
try {
2522
const statusResponse = (await waitForTransactionStatus(
26-
process.txHash,
23+
transactionHash,
2724
statusManager,
28-
process.type,
25+
processType,
2926
step,
3027
pollingInterval
3128
)) as FullStatusData
3229

3330
const statusReceiving = statusResponse.receiving as ExtendedTransactionInfo
3431

3532
// Update process status
36-
statusManager.updateProcess(step, process.type, 'DONE', {
33+
statusManager.updateProcess(step, processType, 'DONE', {
3734
substatus: statusResponse.substatus,
3835
substatusMessage: statusResponse.substatusMessage,
3936
txHash: statusReceiving?.txHash,
@@ -62,9 +59,12 @@ export async function waitForDestinationChainTransaction(
6259

6360
return step
6461
} catch (e: unknown) {
65-
const htmlMessage = await getTransactionFailedMessage(step, process.txLink)
62+
const htmlMessage = await getTransactionFailedMessage(
63+
step,
64+
`${toChain.metamask.blockExplorerUrls[0]}tx/${transactionHash}`
65+
)
6666

67-
statusManager.updateProcess(step, process.type, 'FAILED', {
67+
statusManager.updateProcess(step, processType, 'FAILED', {
6868
error: {
6969
code: LiFiErrorCode.TransactionFailed,
7070
message:

0 commit comments

Comments
 (0)