@coinflowlabs/react-native 2.1.6 → 2.1.7

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,7 @@ 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
19
20
 
20
21
  ## Purchase Usage
21
22
  ```
@@ -36,6 +37,12 @@ Props:
36
37
  * `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
38
  * `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
39
  * `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.
40
+ * `planCode` (optional): When a subscription is being purchased, the code of the subscription plan.
41
+ * `settlementType` (optional): The settlement method to use for the proceeds of a purchase. (Credits, USDC, or Bank)
42
+
43
+ ## 2.1.7
44
+
45
+ - Settlement type param for settlement control
39
46
 
40
47
  ## 2.1.6
41
48
 
@@ -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 = {
@@ -197,6 +200,7 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
197
200
  blockchain: 'solana' | 'eth' | 'near' | 'polygon';
198
201
  }[];
199
202
  supportsVersionedTransactions?: boolean;
203
+ lockAmount?: boolean;
200
204
  }
201
205
  export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
202
206
  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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AC,iBAAiB,EAAE,MAAM,CAAC,CAAC;QACxE,IAAI,gBAAgB;YAAE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QAC1E,IAAI,QAAQ;YAAE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC5D,IAAI,cAAc;YAChB,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;QAC5D,IAAI,UAAU;YAAE,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.7",
4
4
  "description": "React Native Component for Coinflow",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",