@coinflowlabs/react-native 1.3.0 → 2.0.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 +8 -2
- package/build/CoinflowTypes.d.ts +4 -0
- package/build/CoinflowWithdraw.js +2 -1
- package/build/CoinflowWithdraw.js.map +1 -1
- package/build/ReactNativeCoinflowUtils.d.ts +1 -1
- package/build/ReactNativeCoinflowUtils.js +6 -1
- package/build/ReactNativeCoinflowUtils.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -37,10 +37,16 @@ Props:
|
|
|
37
37
|
* `partialSigners` (optional): Keypairs of Partial Signers to sign the transaction with, this is necessary when initializing new accounts as the new account Keypair must sign the transaction.
|
|
38
38
|
* `debugTx` (optional): Setting this to `true` will sign the transaction with the wallet, and send the transaction with no preflight checks allowing for easier debug of any issues.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
### 2.0.0
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
**Breaking Changes**
|
|
43
43
|
|
|
44
|
+
- Added supportsVersionedTransactions to CoinflowWithdraw allowing platforms with wallets that support versioned transactions to Withdraw non-USDC/EuroE tokens in a single transaction with better prices.
|
|
45
|
+
- This is enabled to true by default. If you are using a wallet that does not support versioned transactions, you must set `supportsVersionedTransactions` in `CoinflowWithdraw` to `false`.
|
|
46
|
+
|
|
47
|
+
### 1.3.1
|
|
48
|
+
|
|
49
|
+
- Added new property lockDefaultToken which locks the withdrawal option to the users default currency (USDC or EUROe)
|
|
44
50
|
|
|
45
51
|
### 1.3.0
|
|
46
52
|
|
package/build/CoinflowTypes.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export type CoinflowWebViewProps = Omit<CoinflowIFrameProps, 'IFrameRef'> & {
|
|
|
49
49
|
WebViewRef: React.RefObject<WebView>;
|
|
50
50
|
onLoad?: () => void;
|
|
51
51
|
bankAccountLinkRedirect?: string;
|
|
52
|
+
lockDefaultToken?: boolean;
|
|
53
|
+
supportsVersionedTransactions?: boolean;
|
|
52
54
|
};
|
|
53
55
|
export type WithStyles = {
|
|
54
56
|
style?: StyleProp<ViewStyle>;
|
|
@@ -189,6 +191,7 @@ export type CoinflowPurchaseProps = CoinflowSolanaPurchaseProps | CoinflowNearPu
|
|
|
189
191
|
export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
190
192
|
onSuccess?: OnSuccessMethod;
|
|
191
193
|
token?: string;
|
|
194
|
+
lockDefaultToken?: boolean;
|
|
192
195
|
amount?: number;
|
|
193
196
|
email?: string;
|
|
194
197
|
bankAccountLinkRedirect?: string;
|
|
@@ -196,6 +199,7 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
|
196
199
|
wallet: string;
|
|
197
200
|
blockchain: 'solana' | 'eth' | 'near' | 'polygon';
|
|
198
201
|
}[];
|
|
202
|
+
supportsVersionedTransactions?: boolean;
|
|
199
203
|
}
|
|
200
204
|
export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
201
205
|
wallet: SolanaWallet;
|
|
@@ -23,7 +23,8 @@ function SolanaContent(props) {
|
|
|
23
23
|
var _a;
|
|
24
24
|
var handlers = useSolanaIFrameMessageHandlers(props);
|
|
25
25
|
var _b = useWebViewWallet(handlers, props), WebViewRef = _b.WebViewRef, handleIframeMessages = _b.handleIframeMessages;
|
|
26
|
-
|
|
26
|
+
var webviewProps = __assign(__assign({}, props), { supportsVersionedTransactions: props.supportsVersionedTransactions !== false });
|
|
27
|
+
return (React.createElement(CoinflowWebView, __assign({ publicKey: (_a = props.wallet.publicKey) === null || _a === void 0 ? void 0 : _a.toString(), WebViewRef: WebViewRef, route: "/withdraw/".concat(props.merchantId) }, webviewProps, { handleIframeMessages: handleIframeMessages })));
|
|
27
28
|
}
|
|
28
29
|
function EvmContent(props) {
|
|
29
30
|
var handlers = useEthIFrameMessageHandlers(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAC,8BAA8B,EAAC,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,2BAA2B,EAAC,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAC,4BAA4B,EAAC,MAAM,oCAAoC,CAAC;AAEhF,MAAM,UAAU,gBAAgB,CAAC,KAAyC;IACxE,QAAQ,KAAK,CAAC,UAAU,EAAE;QACxB,KAAK,QAAQ;YACX,OAAO,oBAAC,aAAa,eAAK,KAAK,EAAI,CAAC;QACtC,KAAK,SAAS;YACZ,OAAO,oBAAC,UAAU,eAAK,KAAK,EAAI,CAAC;QACnC,KAAK,KAAK;YACR,OAAO,oBAAC,UAAU,eAAK,KAAK,EAAI,CAAC;QACnC,KAAK,MAAM;YACT,OAAO,oBAAC,YAAY,eAAK,KAAK,EAAI,CAAC;QACrC;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC;AAED,SAAS,aAAa,CAAC,KAA+C;;IACpE,IAAM,QAAQ,GAAG,8BAA8B,CAAC,KAAK,CAAC,CAAC;IACjD,IAAA,KAAqC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,EAArE,UAAU,gBAAA,EAAE,oBAAoB,0BAAqC,CAAC;IAE7E,OAAO,CACL,oBAAC,eAAe,aACd,SAAS,EAAE,MAAA,KAAK,CAAC,MAAM,CAAC,SAAS,0CAAE,QAAQ,EAAE,EAC7C,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,oBAAa,KAAK,CAAC,UAAU,CAAE,IAClC,
|
|
1
|
+
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";AAAA,OA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AS,UAAU,CACjB,KAA6E;IAE7E,IAAM,QAAQ,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAA,KAAqC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,EAArE,UAAU,gBAAA,EAAE,oBAAoB,0BAAqC,CAAC;IAE7E,OAAO,CACL,oBAAC,eAAe,aACd,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,EAC/B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,oBAAa,KAAK,CAAC,UAAU,CAAE,IAClC,KAAK,IACT,oBAAoB,EAAE,oBAAoB,IAC1C,CACH,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,KAA6C;IACjE,IAAM,QAAQ,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAA,KAAqC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,EAArE,UAAU,gBAAA,EAAE,oBAAoB,0BAAqC,CAAC;IAE7E,OAAO,CACL,oBAAC,eAAe,aACd,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,EACjC,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,oBAAa,KAAK,CAAC,UAAU,CAAE,IAClC,KAAK,IACT,oBAAoB,EAAE,oBAAoB,IAC1C,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -4,5 +4,5 @@ export declare class ReactNativeCoinflowUtils {
|
|
|
4
4
|
url: string;
|
|
5
5
|
constructor(env?: CoinflowEnvs);
|
|
6
6
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
7
|
-
static getCoinflowUrl({ blockchain, route, env, amount, publicKey, transaction, bankAccountLinkRedirect, additionalWallets, token, webhookInfo, deviceId, chargebackProtectionData, rent, }: CoinflowWebViewProps): string;
|
|
7
|
+
static getCoinflowUrl({ blockchain, route, env, amount, publicKey, transaction, bankAccountLinkRedirect, additionalWallets, token, webhookInfo, deviceId, chargebackProtectionData, rent, lockDefaultToken, supportsVersionedTransactions, }: CoinflowWebViewProps): string;
|
|
8
8
|
}
|
|
@@ -16,7 +16,7 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
|
|
|
16
16
|
return "https://".concat(env, ".coinflow.cash");
|
|
17
17
|
};
|
|
18
18
|
ReactNativeCoinflowUtils.getCoinflowUrl = function (_a) {
|
|
19
|
-
var blockchain = _a.blockchain, route = _a.route, env = _a.env, amount = _a.amount, publicKey = _a.publicKey, transaction = _a.transaction, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets, token = _a.token, webhookInfo = _a.webhookInfo, deviceId = _a.deviceId, chargebackProtectionData = _a.chargebackProtectionData, rent = _a.rent;
|
|
19
|
+
var blockchain = _a.blockchain, route = _a.route, env = _a.env, amount = _a.amount, publicKey = _a.publicKey, transaction = _a.transaction, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets, token = _a.token, webhookInfo = _a.webhookInfo, deviceId = _a.deviceId, chargebackProtectionData = _a.chargebackProtectionData, rent = _a.rent, lockDefaultToken = _a.lockDefaultToken, supportsVersionedTransactions = _a.supportsVersionedTransactions;
|
|
20
20
|
if (!publicKey)
|
|
21
21
|
return '';
|
|
22
22
|
var url = new URL("/".concat(blockchain) + route, ReactNativeCoinflowUtils.getCoinflowBaseUrl(env));
|
|
@@ -34,6 +34,9 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
|
|
|
34
34
|
url.searchParams.append('additionalWallets', JSON.stringify(additionalWallets));
|
|
35
35
|
if (token)
|
|
36
36
|
url.searchParams.append('token', token.toString());
|
|
37
|
+
if (supportsVersionedTransactions) {
|
|
38
|
+
url.searchParams.append('supportsVersionedTransactions', 'true');
|
|
39
|
+
}
|
|
37
40
|
if (webhookInfo)
|
|
38
41
|
url.searchParams.append('webhookInfo', Buffer.from(JSON.stringify(webhookInfo)).toString('base64'));
|
|
39
42
|
if (deviceId)
|
|
@@ -42,6 +45,8 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
|
|
|
42
45
|
url.searchParams.append('chargebackProtectionData', JSON.stringify(chargebackProtectionData));
|
|
43
46
|
if (rent)
|
|
44
47
|
url.searchParams.append('rent', rent.lamports.toString());
|
|
48
|
+
if (lockDefaultToken)
|
|
49
|
+
url.searchParams.append('lockDefaultToken', 'true');
|
|
45
50
|
return url.toString();
|
|
46
51
|
};
|
|
47
52
|
return ReactNativeCoinflowUtils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNativeCoinflowUtils.js","sourceRoot":"","sources":["../src/ReactNativeCoinflowUtils.ts"],"names":[],"mappings":"AAEA;IAIE,kCAAY,GAAkB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,MAAM,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,KAAK,MAAM;YAAE,IAAI,CAAC,GAAG,GAAG,2BAA2B,CAAC;aAC3D,IAAI,IAAI,CAAC,GAAG,KAAK,OAAO;YAAE,IAAI,CAAC,GAAG,GAAG,uBAAuB,CAAC;;YAC7D,IAAI,CAAC,GAAG,GAAG,sBAAe,IAAI,CAAC,GAAG,mBAAgB,CAAC;IAC1D,CAAC;IAEM,2CAAkB,GAAzB,UAA0B,GAAkB;QAC1C,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,MAAM;YAAE,OAAO,uBAAuB,CAAC;QAC3D,IAAI,GAAG,KAAK,OAAO;YAAE,OAAO,uBAAuB,CAAC;QAEpD,OAAO,kBAAW,GAAG,mBAAgB,CAAC;IACxC,CAAC;IAEM,uCAAc,GAArB,UAAsB,
|
|
1
|
+
{"version":3,"file":"ReactNativeCoinflowUtils.js","sourceRoot":"","sources":["../src/ReactNativeCoinflowUtils.ts"],"names":[],"mappings":"AAEA;IAIE,kCAAY,GAAkB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,MAAM,CAAC;QACzB,IAAI,IAAI,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,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "React Native Component for Coinflow",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@types/react-native": "^0.72.5",
|
|
41
41
|
"eslint-config-react-app": "^7.0.1",
|
|
42
42
|
"typescript": "^5.2.2",
|
|
43
|
-
"@solana/wallet-adapter-react": "^0.15.32"
|
|
43
|
+
"@solana/wallet-adapter-react": "^0.15.32",
|
|
44
|
+
"@near-wallet-selector/core": "^8.7.0"
|
|
44
45
|
}
|
|
45
46
|
}
|