@coinflowlabs/react-native 2.1.10 → 2.1.11
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 +4 -0
- package/build/CoinflowTypes.d.ts +36 -1
- package/build/CoinflowTypes.js +12 -0
- package/build/CoinflowTypes.js.map +1 -1
- package/build/ReactNativeCoinflowUtils.d.ts +1 -1
- package/build/ReactNativeCoinflowUtils.js +3 -1
- package/build/ReactNativeCoinflowUtils.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -58,6 +58,10 @@ Props:
|
|
|
58
58
|
* `rent` (optional, Solana only): Specify the blockchain rent amount to add to the total
|
|
59
59
|
* `nativeSolToConvert` (optional, Solana only): Specify the amount of native SOL to convert wSOL for the purchase
|
|
60
60
|
|
|
61
|
+
## 2.1.11
|
|
62
|
+
|
|
63
|
+
- Added `theme` props to Coinflow components for easy color control
|
|
64
|
+
-
|
|
61
65
|
## 2.1.10
|
|
62
66
|
|
|
63
67
|
- Added `orderId` option for reservoir items
|
package/build/CoinflowTypes.d.ts
CHANGED
|
@@ -5,7 +5,40 @@ import { Wallet } from '@near-wallet-selector/core';
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import WebView from 'react-native-webview';
|
|
7
7
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
8
|
-
|
|
8
|
+
declare enum SettlementType {
|
|
9
|
+
Credits = "Credits",
|
|
10
|
+
USDC = "USDC",
|
|
11
|
+
Bank = "Bank"
|
|
12
|
+
}
|
|
13
|
+
declare enum MerchantStyle {
|
|
14
|
+
Rounded = "rounded",
|
|
15
|
+
Sharp = "sharp",
|
|
16
|
+
Pill = "pill"
|
|
17
|
+
}
|
|
18
|
+
type MerchantTheme = {
|
|
19
|
+
primary?: string;
|
|
20
|
+
background?: string;
|
|
21
|
+
backgroundAccent?: string;
|
|
22
|
+
backgroundAccent2?: string;
|
|
23
|
+
textColor?: string;
|
|
24
|
+
textColorAccent?: string;
|
|
25
|
+
textColorAction?: string;
|
|
26
|
+
font?: string;
|
|
27
|
+
style?: MerchantStyle;
|
|
28
|
+
};
|
|
29
|
+
interface CustomerInfo {
|
|
30
|
+
name?: string;
|
|
31
|
+
verificationId?: string;
|
|
32
|
+
displayName?: string;
|
|
33
|
+
address?: string;
|
|
34
|
+
city?: string;
|
|
35
|
+
state?: string;
|
|
36
|
+
zip?: string;
|
|
37
|
+
country?: string;
|
|
38
|
+
ip?: string;
|
|
39
|
+
lat?: string;
|
|
40
|
+
lng?: string;
|
|
41
|
+
}
|
|
9
42
|
/** Coinflow Types **/
|
|
10
43
|
export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon';
|
|
11
44
|
export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
|
|
@@ -39,6 +72,7 @@ export interface CoinflowTypes {
|
|
|
39
72
|
loaderBackground?: string;
|
|
40
73
|
blockchain: CoinflowBlockchain;
|
|
41
74
|
onLoad?: () => void;
|
|
75
|
+
theme?: MerchantTheme;
|
|
42
76
|
}
|
|
43
77
|
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
44
78
|
export type OnSuccessMethod = (params: string) => void | Promise<void>;
|
|
@@ -55,6 +89,7 @@ export type CoinflowWebViewProps = Omit<CoinflowIFrameProps, 'IFrameRef'> & {
|
|
|
55
89
|
lockDefaultToken?: boolean;
|
|
56
90
|
supportsVersionedTransactions?: boolean;
|
|
57
91
|
lockAmount?: boolean;
|
|
92
|
+
theme?: MerchantTheme;
|
|
58
93
|
};
|
|
59
94
|
export type WithStyles = {
|
|
60
95
|
style?: StyleProp<ViewStyle>;
|
package/build/CoinflowTypes.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
var SettlementType;
|
|
2
|
+
(function (SettlementType) {
|
|
3
|
+
SettlementType["Credits"] = "Credits";
|
|
4
|
+
SettlementType["USDC"] = "USDC";
|
|
5
|
+
SettlementType["Bank"] = "Bank";
|
|
6
|
+
})(SettlementType || (SettlementType = {}));
|
|
7
|
+
var MerchantStyle;
|
|
8
|
+
(function (MerchantStyle) {
|
|
9
|
+
MerchantStyle["Rounded"] = "rounded";
|
|
10
|
+
MerchantStyle["Sharp"] = "sharp";
|
|
11
|
+
MerchantStyle["Pill"] = "pill";
|
|
12
|
+
})(MerchantStyle || (MerchantStyle = {}));
|
|
1
13
|
export {};
|
|
2
14
|
//# sourceMappingURL=CoinflowTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../src/CoinflowTypes.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../src/CoinflowTypes.ts"],"names":[],"mappings":"AAQA,IAAK,cAIJ;AAJD,WAAK,cAAc;IACjB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJI,cAAc,KAAd,cAAc,QAIlB;AAED,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB"}
|
|
@@ -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, tokens, webhookInfo, deviceId, chargebackProtectionData, rent, lockDefaultToken, supportsVersionedTransactions, disableApplePay, disableGooglePay, customerInfo, planCode, settlementType, lockAmount, nativeSolToConvert, }: CoinflowWebViewProps): string;
|
|
7
|
+
static getCoinflowUrl({ blockchain, route, env, amount, publicKey, transaction, bankAccountLinkRedirect, additionalWallets, token, tokens, webhookInfo, deviceId, chargebackProtectionData, rent, lockDefaultToken, supportsVersionedTransactions, disableApplePay, disableGooglePay, customerInfo, planCode, settlementType, lockAmount, nativeSolToConvert, theme, }: 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, tokens = _a.tokens, webhookInfo = _a.webhookInfo, deviceId = _a.deviceId, chargebackProtectionData = _a.chargebackProtectionData, rent = _a.rent, lockDefaultToken = _a.lockDefaultToken, supportsVersionedTransactions = _a.supportsVersionedTransactions, disableApplePay = _a.disableApplePay, disableGooglePay = _a.disableGooglePay, customerInfo = _a.customerInfo, planCode = _a.planCode, settlementType = _a.settlementType, lockAmount = _a.lockAmount, nativeSolToConvert = _a.nativeSolToConvert;
|
|
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, tokens = _a.tokens, webhookInfo = _a.webhookInfo, deviceId = _a.deviceId, chargebackProtectionData = _a.chargebackProtectionData, rent = _a.rent, lockDefaultToken = _a.lockDefaultToken, supportsVersionedTransactions = _a.supportsVersionedTransactions, disableApplePay = _a.disableApplePay, disableGooglePay = _a.disableGooglePay, customerInfo = _a.customerInfo, planCode = _a.planCode, settlementType = _a.settlementType, lockAmount = _a.lockAmount, nativeSolToConvert = _a.nativeSolToConvert, theme = _a.theme;
|
|
20
20
|
if (!publicKey)
|
|
21
21
|
return '';
|
|
22
22
|
var url = new URL("/".concat(blockchain) + route, ReactNativeCoinflowUtils.getCoinflowBaseUrl(env));
|
|
@@ -41,6 +41,8 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
|
|
|
41
41
|
}
|
|
42
42
|
if (webhookInfo)
|
|
43
43
|
url.searchParams.append('webhookInfo', Buffer.from(JSON.stringify(webhookInfo)).toString('base64'));
|
|
44
|
+
if (theme)
|
|
45
|
+
url.searchParams.append('theme', Buffer.from(JSON.stringify(theme)).toString('base64'));
|
|
44
46
|
if (customerInfo)
|
|
45
47
|
url.searchParams.append('customerInfo', Buffer.from(JSON.stringify(customerInfo)).toString('base64'));
|
|
46
48
|
if (deviceId)
|
|
@@ -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":[],"mapp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AG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAE9D,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IACH,+BAAC;AAAD,CAAC,AAvHD,IAuHC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/react-native",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.11",
|
|
4
4
|
"description": "React Native Component for Coinflow",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@solana/web3.js": "^1.90.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/react": "^18.2.
|
|
40
|
-
"@types/react-native": "^0.
|
|
39
|
+
"@types/react": "^18.2.58",
|
|
40
|
+
"@types/react-native": "^0.73.0",
|
|
41
41
|
"eslint-config-react-app": "^7.0.1",
|
|
42
42
|
"typescript": "^5.3.2",
|
|
43
43
|
"@solana/wallet-adapter-react": "^0.15.32",
|