@coin-voyage/paykit 2.4.0-beta.2 → 2.4.0-beta.4

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.
@@ -30,8 +30,8 @@ function getConfirmationState(payOrder, isDeposit, locales, optimisticConfirmati
30
30
  }
31
31
  const payment = payOrder.payment;
32
32
  const confirmOptimistically = optimisticConfirmation && !isDeposit;
33
- const sourceTxURL = payment?.src.chain_id && payOrder.deposit_tx_hash
34
- ? getChainExplorerTxUrl(payment.src.chain_id, payOrder.deposit_tx_hash)
33
+ const sourceTxURL = payment?.src.chain_id && payment?.source_tx_hash
34
+ ? getChainExplorerTxUrl(payment.src.chain_id, payment.source_tx_hash)
35
35
  : undefined;
36
36
  if (payOrder.status === PayOrderStatus.FAILED) {
37
37
  return {
@@ -55,7 +55,7 @@ function getConfirmationState(payOrder, isDeposit, locales, optimisticConfirmati
55
55
  };
56
56
  }
57
57
  if (payOrder.status === PayOrderStatus.COMPLETED) {
58
- const receivingTxHash = payOrder.receiving_tx_hash;
58
+ const receivingTxHash = payment?.destination_tx_hash;
59
59
  const destChainId = payment?.dst.chain_id;
60
60
  const txURL = isDeposit && destChainId && receivingTxHash ? getChainExplorerTxUrl(destChainId, receivingTxHash) : sourceTxURL;
61
61
  return {
@@ -42,9 +42,9 @@ export function usePayFromWallet({ senderAddr, payOrder, setPayOrder, chainType,
42
42
  ? { address: paymentData.src.address, decimals: paymentData.src.decimals }
43
43
  : undefined,
44
44
  });
45
+ paymentData.source_tx_hash = txHash;
45
46
  setPayOrder({
46
47
  ...payOrder,
47
- deposit_tx_hash: txHash,
48
48
  payment: paymentData,
49
49
  status: paymentDetails.status,
50
50
  });
@@ -55,6 +55,7 @@ export function usePaymentLifecycle(order, handlers) {
55
55
  payorder_id: order.id,
56
56
  status: order.status,
57
57
  metadata: order.metadata,
58
+ payment_data: order.payment,
58
59
  refund_address: order.payment.refund_address,
59
60
  refund_tx_hash: order.payment.refund_tx_hash ?? "",
60
61
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coin-voyage/paykit",
3
3
  "description": "Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.",
4
- "version": "2.4.0-beta.2",
4
+ "version": "2.4.0-beta.4",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "author": "Lars <lars@coinvoyage.io>",
@@ -63,8 +63,8 @@
63
63
  "@stripe/crypto": "0.0.4",
64
64
  "styled-components": "^5.3.11",
65
65
  "uuid": "13.0.0",
66
- "@coin-voyage/crypto": "2.4.0-beta.0",
67
- "@coin-voyage/shared": "2.4.0-beta.0"
66
+ "@coin-voyage/shared": "2.4.0-beta.2",
67
+ "@coin-voyage/crypto": "2.4.0-beta.0"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/qrcode": "1.5.5",