@coinflowlabs/react-native 1.2.8 → 1.3.1
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
CHANGED
|
@@ -41,6 +41,14 @@ Props:
|
|
|
41
41
|
|
|
42
42
|
`CoinflowUtils`
|
|
43
43
|
|
|
44
|
+
### 1.3.1
|
|
45
|
+
|
|
46
|
+
- Added new property lockDefaultToken which locks the withdrawal option to the users default currency (USDC or EUROe)
|
|
47
|
+
|
|
48
|
+
### 1.3.0
|
|
49
|
+
|
|
50
|
+
- Added support for paying solana rent for a transaction
|
|
51
|
+
|
|
44
52
|
# 1.2.8
|
|
45
53
|
|
|
46
54
|
* Fix external linking for Coinflow URLs
|
package/build/CoinflowTypes.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export type CoinflowWebViewProps = Omit<CoinflowIFrameProps, 'IFrameRef'> & {
|
|
|
49
49
|
WebViewRef: React.RefObject<WebView>;
|
|
50
50
|
onLoad?: () => void;
|
|
51
51
|
bankAccountLinkRedirect?: string;
|
|
52
|
+
lockDefaultToken?: boolean;
|
|
52
53
|
};
|
|
53
54
|
export type WithStyles = {
|
|
54
55
|
style?: StyleProp<ViewStyle>;
|
|
@@ -122,6 +123,9 @@ export interface CoinflowIFrameProps {
|
|
|
122
123
|
wallet: string;
|
|
123
124
|
blockchain: 'solana' | 'eth' | 'near' | 'polygon';
|
|
124
125
|
}[];
|
|
126
|
+
rent?: {
|
|
127
|
+
lamports: string | number;
|
|
128
|
+
};
|
|
125
129
|
}
|
|
126
130
|
/** Transactions **/
|
|
127
131
|
export type NearFtTransferCallAction = {
|
|
@@ -166,6 +170,9 @@ export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps
|
|
|
166
170
|
blockchain: 'solana';
|
|
167
171
|
token?: PublicKey | string;
|
|
168
172
|
supportsVersionedTransactions?: boolean;
|
|
173
|
+
rent?: {
|
|
174
|
+
lamports: string | number;
|
|
175
|
+
};
|
|
169
176
|
}
|
|
170
177
|
export interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
171
178
|
wallet: NearWallet;
|
|
@@ -183,6 +190,7 @@ export type CoinflowPurchaseProps = CoinflowSolanaPurchaseProps | CoinflowNearPu
|
|
|
183
190
|
export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
184
191
|
onSuccess?: OnSuccessMethod;
|
|
185
192
|
token?: string;
|
|
193
|
+
lockDefaultToken?: boolean;
|
|
186
194
|
amount?: number;
|
|
187
195
|
email?: string;
|
|
188
196
|
bankAccountLinkRedirect?: string;
|
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PublicKey } from '@solana/web3.js';
|
|
1
|
+
import { CoinflowEnvs, CoinflowWebViewProps } from './CoinflowTypes';
|
|
3
2
|
export declare class ReactNativeCoinflowUtils {
|
|
4
3
|
env: CoinflowEnvs;
|
|
5
4
|
url: string;
|
|
6
5
|
constructor(env?: CoinflowEnvs);
|
|
7
6
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
8
|
-
static getCoinflowUrl({ blockchain, route, env, amount, publicKey, transaction, bankAccountLinkRedirect, additionalWallets, token, webhookInfo, deviceId, chargebackProtectionData, }:
|
|
9
|
-
blockchain: CoinflowBlockchain;
|
|
10
|
-
token?: string | PublicKey;
|
|
11
|
-
route: string;
|
|
12
|
-
publicKey: string | null | undefined;
|
|
13
|
-
env?: CoinflowEnvs;
|
|
14
|
-
amount?: number;
|
|
15
|
-
transaction?: string;
|
|
16
|
-
bankAccountLinkRedirect?: string;
|
|
17
|
-
additionalWallets?: {
|
|
18
|
-
wallet: string;
|
|
19
|
-
blockchain: 'solana' | 'eth' | 'near' | 'polygon';
|
|
20
|
-
}[];
|
|
21
|
-
webhookInfo?: object;
|
|
22
|
-
deviceId?: string;
|
|
23
|
-
chargebackProtectionData?: ChargebackProtectionData;
|
|
24
|
-
}): string;
|
|
7
|
+
static getCoinflowUrl({ blockchain, route, env, amount, publicKey, transaction, bankAccountLinkRedirect, additionalWallets, token, webhookInfo, deviceId, chargebackProtectionData, rent, lockDefaultToken, }: CoinflowWebViewProps): string;
|
|
25
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;
|
|
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;
|
|
20
20
|
if (!publicKey)
|
|
21
21
|
return '';
|
|
22
22
|
var url = new URL("/".concat(blockchain) + route, ReactNativeCoinflowUtils.getCoinflowBaseUrl(env));
|
|
@@ -40,6 +40,10 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
|
|
|
40
40
|
url.searchParams.append('deviceId', deviceId);
|
|
41
41
|
if (chargebackProtectionData)
|
|
42
42
|
url.searchParams.append('chargebackProtectionData', JSON.stringify(chargebackProtectionData));
|
|
43
|
+
if (rent)
|
|
44
|
+
url.searchParams.append('rent', rent.lamports.toString());
|
|
45
|
+
if (lockDefaultToken)
|
|
46
|
+
url.searchParams.append('lockDefaultToken', 'true');
|
|
43
47
|
return url.toString();
|
|
44
48
|
};
|
|
45
49
|
return ReactNativeCoinflowUtils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNativeCoinflowUtils.js","sourceRoot":"","sources":["../src/ReactNativeCoinflowUtils.ts"],"names":[],"mappings":"
|
|
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,EAeC;YAdrB,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,GAAG,SAAA,EACH,MAAM,YAAA,EACN,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,uBAAuB,6BAAA,EACvB,iBAAiB,uBAAA,EACjB,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,QAAQ,cAAA,EACR,wBAAwB,8BAAA,EACxB,IAAI,UAAA,EACJ,gBAAgB,sBAAA;QAEhB,IAAI,CAAC,SAAS;YAAE,OAAO,EAAE,CAAC;QAE1B,IAAM,GAAG,GAAG,IAAI,GAAG,CACjB,WAAI,UAAU,CAAE,GAAG,KAAK,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ACpE,IAAI,gBAAgB;YAAE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QAE1E,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IACH,+BAAC;AAAD,CAAC,AAhFD,IAgFC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "React Native Component for Coinflow",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -33,13 +33,14 @@
|
|
|
33
33
|
"react-native-get-random-values": "^1.9.0",
|
|
34
34
|
"bs58": "^5.0.0",
|
|
35
35
|
"bn.js": "^5.2.1",
|
|
36
|
-
"@solana/web3.js": "^1.
|
|
36
|
+
"@solana/web3.js": "^1.87.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/react": "^18.2.
|
|
40
|
-
"@types/react-native": "^0.72.
|
|
39
|
+
"@types/react": "^18.2.36",
|
|
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
|
}
|