@getpara/react-common 1.8.0 → 1.9.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.
@@ -154,8 +154,7 @@ const MoonPayEmbed = ({ para, isDark, isEmbedded, onRampConfig, onRampPurchase,
154
154
  borderRadius: 0,
155
155
  margin: 0
156
156
  },
157
- showOnlyCurrencies: currencyCodes.join(","),
158
- defaultCurrencyCode: currencyCodes[0],
157
+ defaultBaseCurrencyCode: currencyCodes[0],
159
158
  onInitiateDeposit,
160
159
  onTransactionCompleted,
161
160
  onUrlSignatureRequested
@@ -37,7 +37,10 @@ function reverseCurrencyLookup(data, provider, code) {
37
37
  );
38
38
  return [row == null ? void 0 : row[1], row == null ? void 0 : row[2]];
39
39
  }
40
- const TestNetworks = [{ main: Network.ETHEREUM, test: Network.SEPOLIA }];
40
+ const TestNetworks = [
41
+ { main: Network.ETHEREUM, test: Network.SEPOLIA },
42
+ { main: Network.SOLANA, test: Network.SOLANA_DEVNET }
43
+ ];
41
44
  function getNetworkTestEquivalent(network) {
42
45
  var _a;
43
46
  return (_a = TestNetworks.find(({ main }) => main === network)) == null ? void 0 : _a.test;
@@ -72,7 +75,9 @@ const NetworkAssetAddresses = [
72
75
  { network: Network.ARBITRUM, asset: OnRampAsset.USDC, address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831" },
73
76
  { network: Network.OPTIMISM, asset: OnRampAsset.USDC, address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85" },
74
77
  { network: Network.SOLANA, asset: OnRampAsset.USDC, address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" },
75
- { network: Network.SEPOLIA, asset: OnRampAsset.USDC, address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238" }
78
+ { network: Network.SOLANA_DEVNET, asset: OnRampAsset.USDC, address: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU" },
79
+ { network: Network.SEPOLIA, asset: OnRampAsset.USDC, address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238" },
80
+ { network: Network.SOLANA_DEVNET, asset: OnRampAsset.TETHER, address: "EJwZgeZrdC8TXTQbQBoL6bfuAnFUUy1PVCMB4DYPzVaS" }
76
81
  ];
77
82
  function getAssetFromContractAddress(network, contractAddress) {
78
83
  var _a, _b;
@@ -12,12 +12,12 @@ function offRampSend(_0, _1, _2, _3) {
12
12
  destinationAddress,
13
13
  contractAddress
14
14
  }) {
15
- var _a, _b;
15
+ var _a, _b, _c;
16
16
  if (!purchaseId || !walletId || !walletType || !provider) {
17
17
  throw new Error("Missing required fields");
18
18
  }
19
19
  try {
20
- const { tx, network, asset } = yield para.ctx.client.generateOffRampTx(para.getUserId(), {
20
+ const { tx, message, network, asset } = yield para.ctx.client.generateOffRampTx(para.getUserId(), {
21
21
  walletId,
22
22
  walletType,
23
23
  provider,
@@ -37,12 +37,16 @@ function offRampSend(_0, _1, _2, _3) {
37
37
  chainId
38
38
  })) == null ? void 0 : _a.signature;
39
39
  break;
40
+ case WalletType.SOLANA:
41
+ signature = (_b = yield para.signMessage({ walletId, messageBase64: message })) == null ? void 0 : _b.signature;
42
+ break;
40
43
  default:
41
44
  throw new Error(`Unsupported wallet type: ${walletType}`);
42
45
  }
43
46
  const { txHash } = yield para.ctx.client.sendOffRampTx(para.getUserId(), {
44
47
  tx,
45
48
  signature: walletType === "EVM" ? `0x${signature}` : signature,
49
+ sourceAddress: address,
46
50
  network,
47
51
  walletId,
48
52
  walletType
@@ -62,7 +66,7 @@ function offRampSend(_0, _1, _2, _3) {
62
66
  setOnRampPurchase(updated);
63
67
  return txHash;
64
68
  } catch (e) {
65
- throw new Error(((_b = e.response) == null ? void 0 : _b.data) || e.message);
69
+ throw new Error(((_c = e.response) == null ? void 0 : _c.data) || e.message);
66
70
  }
67
71
  });
68
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-common",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,8 +11,8 @@
11
11
  "*.css"
12
12
  ],
13
13
  "dependencies": {
14
- "@getpara/react-components": "1.8.0",
15
- "@getpara/web-sdk": "1.8.0",
14
+ "@getpara/react-components": "1.9.0",
15
+ "@getpara/web-sdk": "1.9.0",
16
16
  "@moonpay/moonpay-react": "^1.8.3",
17
17
  "@ramp-network/ramp-instant-sdk": "^4.0.5",
18
18
  "@stripe/crypto": "^0.0.4",
@@ -43,5 +43,5 @@
43
43
  "resolutions": {
44
44
  "styled-components": "^6"
45
45
  },
46
- "gitHead": "ef96e79558695ccbe148d25a8e3611c4596d1954"
46
+ "gitHead": "3d749844bf071e2c8de2769dd16e17c026951109"
47
47
  }