@coinflowlabs/react-native 1.2.4 → 1.2.6
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
package/build/CoinflowTypes.d.ts
CHANGED
|
@@ -8,6 +8,30 @@ import { StyleProp, ViewStyle } from 'react-native';
|
|
|
8
8
|
/** Coinflow Types **/
|
|
9
9
|
export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon';
|
|
10
10
|
export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
|
|
11
|
+
export type ChargebackProtectionData = ChargebackProtectionItem[];
|
|
12
|
+
export interface ChargebackProtectionItem {
|
|
13
|
+
/**
|
|
14
|
+
* The name of the product
|
|
15
|
+
*/
|
|
16
|
+
productName: string;
|
|
17
|
+
/**
|
|
18
|
+
* The product type. Possible values include: inGameProduct, gameOfSkill, dataStorage, computingResources, sportsTicket, eSportsTicket, musicTicket, conferenceTicket, virtualSportsTicket, virtualESportsTicket, virtualMusicTicket, virtualConferenceTicket, alcohol, DLC, subscription, fundACause, realEstate, computingContract, digitalArt, topUp
|
|
19
|
+
*/
|
|
20
|
+
productType: 'inGameProduct' | 'gameOfSkill' | 'dataStorage' | 'computingResources' | 'sportsTicket' | 'eSportsTicket' | 'musicTicket' | 'conferenceTicket' | 'virtualSportsTicket' | 'virtualESportsTicket' | 'virtualMusicTicket' | 'virtualConferenceTicket' | 'alcohol' | 'DLC' | 'subscription' | 'fundACause' | 'realEstate' | 'computingContract' | 'digitalArt' | 'topUp';
|
|
21
|
+
/**
|
|
22
|
+
* The item's list price
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The number of units sold
|
|
26
|
+
*/
|
|
27
|
+
quantity: number;
|
|
28
|
+
/**
|
|
29
|
+
* Any additional data that the store can provide on the product, e.g. description, link to image, etc.
|
|
30
|
+
*/
|
|
31
|
+
rawProductData?: {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
11
35
|
export interface CoinflowTypes {
|
|
12
36
|
merchantId: string;
|
|
13
37
|
env?: CoinflowEnvs;
|
|
@@ -90,6 +114,8 @@ export interface CoinflowIFrameProps {
|
|
|
90
114
|
token?: string | PublicKey;
|
|
91
115
|
email?: string;
|
|
92
116
|
env?: CoinflowEnvs;
|
|
117
|
+
deviceId?: string;
|
|
118
|
+
chargebackProtectionData?: ChargebackProtectionData;
|
|
93
119
|
loaderBackground?: string;
|
|
94
120
|
supportsVersionedTransactions?: boolean;
|
|
95
121
|
additionalWallets?: {
|
|
@@ -128,6 +154,8 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
128
154
|
onSuccess?: OnSuccessMethod;
|
|
129
155
|
webhookInfo?: object;
|
|
130
156
|
email?: string;
|
|
157
|
+
deviceId?: string;
|
|
158
|
+
chargebackProtectionData?: ChargebackProtectionData;
|
|
131
159
|
}
|
|
132
160
|
export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
133
161
|
wallet: SolanaWallet;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CoinflowBlockchain, CoinflowEnvs } from './CoinflowTypes';
|
|
1
|
+
import { ChargebackProtectionData, CoinflowBlockchain, CoinflowEnvs } from './CoinflowTypes';
|
|
2
2
|
import { PublicKey } from '@solana/web3.js';
|
|
3
3
|
export declare class ReactNativeCoinflowUtils {
|
|
4
4
|
env: CoinflowEnvs;
|
|
5
5
|
url: string;
|
|
6
6
|
constructor(env?: CoinflowEnvs);
|
|
7
7
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
8
|
-
static getCoinflowUrl({ blockchain, route, env, amount, publicKey, transaction, bankAccountLinkRedirect, additionalWallets, token, }: {
|
|
8
|
+
static getCoinflowUrl({ blockchain, route, env, amount, publicKey, transaction, bankAccountLinkRedirect, additionalWallets, token, webhookInfo, deviceId, chargebackProtectionData, }: {
|
|
9
9
|
blockchain: CoinflowBlockchain;
|
|
10
10
|
token?: string | PublicKey;
|
|
11
11
|
route: string;
|
|
@@ -18,5 +18,8 @@ export declare class ReactNativeCoinflowUtils {
|
|
|
18
18
|
wallet: string;
|
|
19
19
|
blockchain: 'solana' | 'eth' | 'near' | 'polygon';
|
|
20
20
|
}[];
|
|
21
|
+
webhookInfo?: object;
|
|
22
|
+
deviceId?: string;
|
|
23
|
+
chargebackProtectionData?: ChargebackProtectionData;
|
|
21
24
|
}): string;
|
|
22
25
|
}
|
|
@@ -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;
|
|
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;
|
|
20
20
|
if (!publicKey)
|
|
21
21
|
return '';
|
|
22
22
|
var url = new URL("/".concat(blockchain) + route, ReactNativeCoinflowUtils.getCoinflowBaseUrl(env));
|
|
@@ -34,6 +34,12 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
|
|
|
34
34
|
url.searchParams.append('additionalWallets', JSON.stringify(additionalWallets));
|
|
35
35
|
if (token)
|
|
36
36
|
url.searchParams.append('token', token.toString());
|
|
37
|
+
if (webhookInfo)
|
|
38
|
+
url.searchParams.append('webhookInfo', Buffer.from(JSON.stringify(webhookInfo)).toString('base64'));
|
|
39
|
+
if (deviceId)
|
|
40
|
+
url.searchParams.append('deviceId', deviceId);
|
|
41
|
+
if (chargebackProtectionData)
|
|
42
|
+
url.searchParams.append('chargebackProtectionData', JSON.stringify(chargebackProtectionData));
|
|
37
43
|
return url.toString();
|
|
38
44
|
};
|
|
39
45
|
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":"AAOA;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,EA6BrB;YA5BC,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,8B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