@permissionless-technologies/upp-sdk 0.4.16 → 0.4.17
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/react/index.cjs +13 -3
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +13 -3
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.cjs
CHANGED
|
@@ -2533,13 +2533,18 @@ function useSwap(config) {
|
|
|
2533
2533
|
);
|
|
2534
2534
|
}
|
|
2535
2535
|
const zeroHex = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
2536
|
+
const { encodePacked: encodePacked3 } = await import('viem');
|
|
2537
|
+
const packNote = (note) => encodePacked3(
|
|
2538
|
+
["uint64", "uint256", "bytes"],
|
|
2539
|
+
[note.searchTag, note.ownerHash, note.encryptedNote]
|
|
2540
|
+
);
|
|
2536
2541
|
return {
|
|
2537
2542
|
orderId,
|
|
2538
2543
|
cancelSecret,
|
|
2539
2544
|
buyOutputCommitment: buyNoteData ? viem.toHex(buyNoteData.commitment, { size: 32 }) : zeroHex,
|
|
2540
2545
|
refundCommitment: refundNoteData ? viem.toHex(refundNoteData.commitment, { size: 32 }) : zeroHex,
|
|
2541
|
-
buyEncryptedNote: buyNoteData ? buyNoteData
|
|
2542
|
-
refundEncryptedNote: refundNoteData ? refundNoteData
|
|
2546
|
+
buyEncryptedNote: buyNoteData ? packNote(buyNoteData) : "0x",
|
|
2547
|
+
refundEncryptedNote: refundNoteData ? packNote(refundNoteData) : "0x",
|
|
2543
2548
|
buyNoteData,
|
|
2544
2549
|
refundNoteData
|
|
2545
2550
|
};
|
|
@@ -2570,11 +2575,16 @@ function useSwap(config) {
|
|
|
2570
2575
|
cancelOrigin,
|
|
2571
2576
|
BigInt(sellToken)
|
|
2572
2577
|
);
|
|
2578
|
+
const { encodePacked: encodePacked3 } = await import('viem');
|
|
2579
|
+
const packedRefund = encodePacked3(
|
|
2580
|
+
["uint64", "uint256", "bytes"],
|
|
2581
|
+
[refundNoteData.searchTag, refundNoteData.ownerHash, refundNoteData.encryptedNote]
|
|
2582
|
+
);
|
|
2573
2583
|
return {
|
|
2574
2584
|
orderId,
|
|
2575
2585
|
cancelSecret,
|
|
2576
2586
|
refundCommitment: viem.toHex(refundNoteData.commitment, { size: 32 }),
|
|
2577
|
-
refundEncryptedNote:
|
|
2587
|
+
refundEncryptedNote: packedRefund,
|
|
2578
2588
|
refundNoteData
|
|
2579
2589
|
};
|
|
2580
2590
|
} catch (err) {
|