@getpara/react-common 2.0.0-fc.3 → 2.1.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/README.md +13 -0
- package/dist/{chunk-GOCCUU3Z.js → chunk-MMUBH76A.js} +17 -0
- package/dist/classes/ParaInternal.d.ts +18 -5
- package/dist/classes/ParaInternal.js +15 -1
- package/dist/components/HeroSpinner.d.ts +2 -1
- package/dist/components/HeroSpinner.js +9 -3
- package/dist/components/KnownDevices.js +1 -1
- package/dist/components/MoonPayEmbed.d.ts +3 -1
- package/dist/components/MoonPayEmbed.js +56 -82
- package/dist/components/NetworkSpeedBanner.js +2 -4
- package/dist/components/QRCode.js +1 -1
- package/dist/components/RampEmbed.d.ts +1 -1
- package/dist/components/RampEmbed.js +17 -29
- package/dist/components/UserIdentifier.d.ts +8 -0
- package/dist/components/UserIdentifier.js +25 -16
- package/dist/components/WalletSelect.d.ts +33 -0
- package/dist/components/WalletSelect.js +171 -0
- package/dist/components/WalletTypeIcon.d.ts +9 -0
- package/dist/components/WalletTypeIcon.js +45 -0
- package/dist/components/WarningBanner.d.ts +7 -0
- package/dist/components/WarningBanner.js +60 -0
- package/dist/components/common.js +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/constants/aaguiMetadata.js +1 -1
- package/dist/constants/externalWalletDefaults.d.ts +10 -1
- package/dist/constants/externalWalletDefaults.js +8 -3
- package/dist/constants/index.d.ts +37 -0
- package/dist/constants/index.js +152 -0
- package/dist/constants/oAuthLogos.d.ts +12 -0
- package/dist/constants/oAuthLogos.js +160 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useCopyToClipboard.js +1 -1
- package/dist/hooks/useDropdownPosition.d.ts +7 -0
- package/dist/hooks/useDropdownPosition.js +33 -0
- package/dist/hooks/useUserAgent.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/types/commonTypes.d.ts +15 -0
- package/dist/types/commonTypes.js +1 -0
- package/dist/types/externalWalletCommon.d.ts +14 -4
- package/dist/types/index.d.ts +7 -4
- package/dist/types/index.js +1 -0
- package/dist/utils/formatBiometricHints.js +1 -1
- package/dist/utils/getBrowserName.js +1 -1
- package/dist/utils/getDeviceLogo.js +1 -1
- package/dist/utils/getDeviceModelName.js +1 -1
- package/dist/utils/getExternalWalletDisplayName.d.ts +3 -1
- package/dist/utils/getExternalWalletDisplayName.js +7 -15
- package/dist/utils/getExternalWalletIcon.d.ts +5 -0
- package/dist/utils/getExternalWalletIcon.js +17 -0
- package/dist/utils/index.d.ts +17 -16
- package/dist/utils/index.js +26 -31
- package/dist/utils/openMobileUrl.d.ts +1 -0
- package/dist/utils/openMobileUrl.js +34 -0
- package/dist/utils/safeStyled.js +1 -1
- package/package.json +4 -4
- package/dist/utils/offRampSend.d.ts +0 -7
- package/dist/utils/offRampSend.js +0 -75
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@getpara/react-components": "2.
|
|
6
|
-
"@getpara/web-sdk": "2.
|
|
5
|
+
"@getpara/react-components": "2.1.0",
|
|
6
|
+
"@getpara/web-sdk": "2.1.0",
|
|
7
7
|
"@moonpay/moonpay-react": "^1.8.3",
|
|
8
8
|
"@ramp-network/ramp-instant-sdk": "^4.0.5",
|
|
9
9
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
],
|
|
41
41
|
"type": "module",
|
|
42
42
|
"types": "dist/index.d.ts",
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "3ae7f836324a3a2a8a57156e16304aeaf0d37b42"
|
|
44
44
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OnRampPurchaseUpdateParams } from '@getpara/user-management-client';
|
|
2
|
-
import Para, { OnRampPurchase } from '@getpara/web-sdk';
|
|
3
|
-
export declare function offRampSend(para: Para, { id: purchaseId, provider, walletId, walletType, address, testMode }: Partial<OnRampPurchase>, setOnRampPurchase: (_: OnRampPurchase) => void, { assetQuantity, fiat, fiatQuantity, chainId, destinationAddress, contractAddress, }: OnRampPurchaseUpdateParams & {
|
|
4
|
-
chainId?: string;
|
|
5
|
-
destinationAddress: string;
|
|
6
|
-
contractAddress?: string | null;
|
|
7
|
-
}): Promise<string | undefined>;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../chunk-GOCCUU3Z.js";
|
|
5
|
-
import { hexStringToBase64 } from "@getpara/web-sdk";
|
|
6
|
-
function offRampSend(_0, _1, _2, _3) {
|
|
7
|
-
return __async(this, arguments, function* (para, { id: purchaseId, provider, walletId, walletType, address, testMode = false }, setOnRampPurchase, {
|
|
8
|
-
assetQuantity,
|
|
9
|
-
fiat,
|
|
10
|
-
fiatQuantity,
|
|
11
|
-
chainId,
|
|
12
|
-
destinationAddress,
|
|
13
|
-
contractAddress
|
|
14
|
-
}) {
|
|
15
|
-
var _a, _b, _c;
|
|
16
|
-
if (!purchaseId || !walletId || !walletType || !provider) {
|
|
17
|
-
throw new Error("Missing required fields");
|
|
18
|
-
}
|
|
19
|
-
try {
|
|
20
|
-
const { tx, message, network, asset } = yield para.ctx.client.generateOffRampTx(para.getUserId(), {
|
|
21
|
-
walletId,
|
|
22
|
-
walletType,
|
|
23
|
-
provider,
|
|
24
|
-
chainId,
|
|
25
|
-
destinationAddress,
|
|
26
|
-
sourceAddress: address,
|
|
27
|
-
contractAddress,
|
|
28
|
-
testMode,
|
|
29
|
-
assetQuantity
|
|
30
|
-
});
|
|
31
|
-
let signature;
|
|
32
|
-
switch (walletType) {
|
|
33
|
-
case "EVM":
|
|
34
|
-
signature = (_a = yield para.signTransaction({
|
|
35
|
-
walletId,
|
|
36
|
-
rlpEncodedTxBase64: hexStringToBase64(tx),
|
|
37
|
-
chainId
|
|
38
|
-
})) == null ? void 0 : _a.signature;
|
|
39
|
-
break;
|
|
40
|
-
case "SOLANA":
|
|
41
|
-
signature = (_b = yield para.signMessage({ walletId, messageBase64: message })) == null ? void 0 : _b.signature;
|
|
42
|
-
break;
|
|
43
|
-
default:
|
|
44
|
-
throw new Error(`Unsupported wallet type: ${walletType}`);
|
|
45
|
-
}
|
|
46
|
-
const { txHash } = yield para.ctx.client.sendOffRampTx(para.getUserId(), {
|
|
47
|
-
tx,
|
|
48
|
-
signature: walletType === "EVM" ? `0x${signature}` : signature,
|
|
49
|
-
sourceAddress: address,
|
|
50
|
-
network,
|
|
51
|
-
walletId,
|
|
52
|
-
walletType
|
|
53
|
-
});
|
|
54
|
-
const updated = yield para.ctx.client.updateOnRampPurchase({
|
|
55
|
-
userId: para.getUserId(),
|
|
56
|
-
walletId,
|
|
57
|
-
purchaseId,
|
|
58
|
-
updates: {
|
|
59
|
-
fiat,
|
|
60
|
-
fiatQuantity,
|
|
61
|
-
assetQuantity,
|
|
62
|
-
network,
|
|
63
|
-
asset
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
setOnRampPurchase(updated);
|
|
67
|
-
return txHash;
|
|
68
|
-
} catch (e) {
|
|
69
|
-
throw new Error(((_c = e.response) == null ? void 0 : _c.data) || e.message);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
export {
|
|
74
|
-
offRampSend
|
|
75
|
-
};
|