@coinflowlabs/react-native 2.1.6 → 2.1.8

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
@@ -16,6 +16,14 @@ Props:
16
16
  * `env` (optional): This defaults to `prod`
17
17
  - For testing set to `staging`
18
18
  * `onSuccess` (optional): function to run when the withdrawal process is successful
19
+ * `lockAmount` (optional): Whether to let the user select the amount to withdraw or to disable the input
20
+ * `amount` (optional): The amount to withdraw - required if `lockAmount=true`
21
+ * `tokens` (optional): Define a list to filter the available tokens
22
+ * `lockDefaultToken` (optional): Only allow the default token to be used
23
+ * `email` (optional): Set the default email to be used in entry fields
24
+ * `bankAccountLinkRedirect` (optional): The URL to be used for bank account setup
25
+ * `supportsVersionedTransactions` (optional): Instruct the system that versioned transactions are supported
26
+ * `additionalWallets` (optional): Define additional wallets to assign to the user
19
27
 
20
28
  ## Purchase Usage
21
29
  ```
@@ -36,6 +44,22 @@ Props:
36
44
  * `transaction` (optional): transaction for the user to run which redeems their credits with your smart contract. Create this transaction just like you would for a normal user who has USDC in their account.
37
45
  * `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
46
  * `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.
47
+ * `token` (optional): The token to use for the purchase. Defaults to USDC. Currently only supported for the Solana Blockchain.
48
+ * `planCode` (optional): When a subscription is being purchased, the code of the subscription plan.
49
+ * `settlementType` (optional): The settlement method to use for the proceeds of a purchase. (Credits, USDC, or Bank)
50
+ * `amount` (optional): Fix the amount of purchase
51
+ * `webhookInfo` (optional): Product or transaction based information that you want transmitted when you receive webhooks regarding the purchase
52
+ * `email` (optional): Set the default email to use in email entry fields
53
+ * `chargebackProtectionData` (optional):
54
+ * `disableApplePay` (optional): Ability to disable Apple Pay
55
+ * `disableGooglePay` (optional): Ability to disable Google Pay
56
+ * `customerInfo` (optional): Additional information about the customer
57
+ * `supportsVersionedTransactions` (optional): Instruct the system that you support versioned transactions
58
+ * `rent` (optional): Specify the blockchain rent amount to add to the total
59
+
60
+ ## 2.1.7
61
+
62
+ - Settlement type param for settlement control
39
63
 
40
64
  ## 2.1.6
41
65
 
@@ -5,7 +5,7 @@ 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
- import { CustomerInfo } from '@coinflow/common';
8
+ import { CustomerInfo, SettlementType } from '@coinflow/common';
9
9
  /** Coinflow Types **/
10
10
  export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon';
11
11
  export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
@@ -54,6 +54,7 @@ export type CoinflowWebViewProps = Omit<CoinflowIFrameProps, 'IFrameRef'> & {
54
54
  bankAccountLinkRedirect?: string;
55
55
  lockDefaultToken?: boolean;
56
56
  supportsVersionedTransactions?: boolean;
57
+ lockAmount?: boolean;
57
58
  };
58
59
  export type WithStyles = {
59
60
  style?: StyleProp<ViewStyle>;
@@ -132,6 +133,8 @@ export interface CoinflowIFrameProps {
132
133
  };
133
134
  disableApplePay?: boolean;
134
135
  disableGooglePay?: boolean;
136
+ planCode?: string;
137
+ settlementType?: SettlementType;
135
138
  }
136
139
  /** Transactions **/
137
140
  export type NearFtTransferCallAction = {
@@ -153,6 +156,7 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
153
156
  chargebackProtectionData?: ChargebackProtectionData;
154
157
  disableApplePay?: boolean;
155
158
  disableGooglePay?: boolean;
159
+ settlementType?: SettlementType;
156
160
  }
157
161
  export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
158
162
  wallet: SolanaWallet;
@@ -197,6 +201,7 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
197
201
  blockchain: 'solana' | 'eth' | 'near' | 'polygon';
198
202
  }[];
199
203
  supportsVersionedTransactions?: boolean;
204
+ lockAmount?: boolean;
200
205
  }
201
206
  export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
202
207
  wallet: SolanaWallet;
@@ -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, }: 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, }: 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;
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;
20
20
  if (!publicKey)
21
21
  return '';
22
22
  var url = new URL("/".concat(blockchain) + route, ReactNativeCoinflowUtils.getCoinflowBaseUrl(env));
@@ -55,6 +55,12 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
55
55
  url.searchParams.append('disableApplePay', 'true');
56
56
  if (disableGooglePay)
57
57
  url.searchParams.append('disableGooglePay', 'true');
58
+ if (planCode)
59
+ url.searchParams.append('planCode', planCode);
60
+ if (settlementType)
61
+ url.searchParams.append('settlementType', settlementType);
62
+ if (lockAmount)
63
+ url.searchParams.append('lockAmount', 'true');
58
64
  return url.toString();
59
65
  };
60
66
  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,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AE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAE9D,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IACH,+BAAC;AAAD,CAAC,AA1GD,IA0GC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinflowlabs/react-native",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "description": "React Native Component for Coinflow",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -33,14 +33,14 @@
33
33
  "react-native-get-random-values": "^1.10.0",
34
34
  "bs58": "^5.0.0",
35
35
  "bn.js": "^5.2.1",
36
- "@solana/web3.js": "^1.87.3"
36
+ "@solana/web3.js": "^1.89.1"
37
37
  },
38
38
  "devDependencies": {
39
- "@types/react": "^18.2.47",
39
+ "@types/react": "^18.2.48",
40
40
  "@types/react-native": "^0.72.7",
41
41
  "eslint-config-react-app": "^7.0.1",
42
42
  "typescript": "^5.3.2",
43
43
  "@solana/wallet-adapter-react": "^0.15.32",
44
- "@near-wallet-selector/core": "^8.9.1"
44
+ "@near-wallet-selector/core": "^8.9.2"
45
45
  }
46
46
  }