@coinflowlabs/react-native 2.1.7 → 2.1.9

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
@@ -17,6 +17,13 @@ Props:
17
17
  - For testing set to `staging`
18
18
  * `onSuccess` (optional): function to run when the withdrawal process is successful
19
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
20
27
 
21
28
  ## Purchase Usage
22
29
  ```
@@ -37,8 +44,23 @@ Props:
37
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.
38
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.
39
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.
40
48
  * `planCode` (optional): When a subscription is being purchased, the code of the subscription plan.
41
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, Solana only): Specify the blockchain rent amount to add to the total
59
+ * `nativeSolToConvert` (optional, Solana only): Specify the amount of native SOL to convert wSOL for the purchase
60
+
61
+ ## 2.1.9
62
+
63
+ - Added `nativeSolToConvert` for Solana transactions
42
64
 
43
65
  ## 2.1.7
44
66
 
@@ -131,6 +131,9 @@ export interface CoinflowIFrameProps {
131
131
  rent?: {
132
132
  lamports: string | number;
133
133
  };
134
+ nativeSolToConvert?: {
135
+ lamports: string | number;
136
+ };
134
137
  disableApplePay?: boolean;
135
138
  disableGooglePay?: boolean;
136
139
  planCode?: string;
@@ -156,6 +159,7 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
156
159
  chargebackProtectionData?: ChargebackProtectionData;
157
160
  disableApplePay?: boolean;
158
161
  disableGooglePay?: boolean;
162
+ settlementType?: SettlementType;
159
163
  }
160
164
  export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
161
165
  wallet: SolanaWallet;
@@ -169,6 +173,9 @@ export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps
169
173
  rent?: {
170
174
  lamports: string | number;
171
175
  };
176
+ nativeSolToConvert?: {
177
+ lamports: string | number;
178
+ };
172
179
  }
173
180
  export interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {
174
181
  wallet: NearWallet;
@@ -238,8 +245,9 @@ export interface ReturnedTokenIdRedeem extends NormalRedeem {
238
245
  type: 'returned';
239
246
  nftContract?: string;
240
247
  }
241
- export interface ReservoirRedeem extends Omit<KnownTokenIdRedeem, keyof NormalRedeem> {
248
+ export interface ReservoirRedeem {
242
249
  type: 'reservoir';
250
+ items: Omit<KnownTokenIdRedeem, keyof NormalRedeem> | Omit<KnownTokenIdRedeem, keyof NormalRedeem>[];
243
251
  }
244
252
  export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem;
245
253
  export {};
@@ -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, }: 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, }: 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;
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;
20
20
  if (!publicKey)
21
21
  return '';
22
22
  var url = new URL("/".concat(blockchain) + route, ReactNativeCoinflowUtils.getCoinflowBaseUrl(env));
@@ -49,6 +49,8 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
49
49
  url.searchParams.append('chargebackProtectionData', JSON.stringify(chargebackProtectionData));
50
50
  if (rent)
51
51
  url.searchParams.append('rent', rent.lamports.toString());
52
+ if (nativeSolToConvert)
53
+ url.searchParams.append('nativeSolToConvert', nativeSolToConvert.lamports.toString());
52
54
  if (lockDefaultToken)
53
55
  url.searchParams.append('lockDefaultToken', 'true');
54
56
  if (disableApplePay)
@@ -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,u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AC,YAAY,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QAE1E,IAAI,eAAe;YAAE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,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,AAhHD,IAgHC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinflowlabs/react-native",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
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.90.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@types/react": "^18.2.47",
39
+ "@types/react": "^18.2.56",
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.3"
45
45
  }
46
46
  }