@coinflowlabs/vue 0.3.1 → 1.0.0
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 +20 -3
- package/dist/coinflow-vue.js +7087 -7827
- package/dist/coinflow-vue.umd.cjs +6 -6
- package/dist/components/CoinflowPurchase.vue.d.ts +35 -19
- package/dist/components/card-form/CoinflowCardNumberInput.vue.d.ts +3 -3
- package/dist/components/card-form/CoinflowCardNumberOnlyInput.vue.d.ts +3 -3
- package/dist/components/card-form/CoinflowCvvOnlyInput.vue.d.ts +3 -3
- package/dist/components/card-form/useCardformIframe.d.ts +4 -2
- package/dist/lib/common/CoinflowLibMessageHandlers.d.ts +2 -2
- package/dist/lib/common/CoinflowTypes.d.ts +14 -6
- package/dist/lib/common/CoinflowUtils.d.ts +2 -15
- package/dist/lib/common/Subtotal.d.ts +37 -0
- package/dist/lib/common/card-form/TokenEx.d.ts +19 -2
- package/dist/lib/common/card-form/tokenexHelpers.d.ts +14 -7
- package/dist/lib/common/index.d.ts +1 -0
- package/package.json +13 -17
- package/dist/testing/YouPay.vue.d.ts +0 -2
|
@@ -15,16 +15,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
15
15
|
debugTx?: boolean;
|
|
16
16
|
connection: import('@solana/web3.js').Connection;
|
|
17
17
|
blockchain: "solana";
|
|
18
|
-
token?: import('@solana/web3.js').PublicKey | string;
|
|
19
18
|
rent?: {
|
|
20
19
|
lamports: string | number;
|
|
21
20
|
};
|
|
22
21
|
nativeSolToConvert?: {
|
|
23
22
|
lamports: string | number;
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
subtotal?: import('../lib/common').Subtotal;
|
|
26
25
|
onSuccess?: import('../lib/common').OnSuccessMethod;
|
|
27
|
-
webhookInfo?:
|
|
26
|
+
webhookInfo?: {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
};
|
|
28
29
|
email?: string;
|
|
29
30
|
chargebackProtectionData?: import('../lib/common').ChargebackProtectionData;
|
|
30
31
|
planCode?: string;
|
|
@@ -38,6 +39,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
38
39
|
supportEmail?: string;
|
|
39
40
|
origins?: string[];
|
|
40
41
|
threeDsChallengePreference?: import('../lib/common').ThreeDsChallengePreference;
|
|
42
|
+
destinationAuthKey?: string;
|
|
41
43
|
merchantId: string;
|
|
42
44
|
env?: import('../lib/common').CoinflowEnvs;
|
|
43
45
|
loaderBackground?: string;
|
|
@@ -50,9 +52,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
50
52
|
sessionKey: string;
|
|
51
53
|
wallet?: undefined;
|
|
52
54
|
blockchain?: import('../lib/common').CoinflowBlockchain | undefined;
|
|
53
|
-
|
|
55
|
+
subtotal?: import('../lib/common').Subtotal;
|
|
54
56
|
onSuccess?: import('../lib/common').OnSuccessMethod;
|
|
55
|
-
webhookInfo?:
|
|
57
|
+
webhookInfo?: {
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
};
|
|
56
60
|
email?: string;
|
|
57
61
|
chargebackProtectionData?: import('../lib/common').ChargebackProtectionData;
|
|
58
62
|
planCode?: string;
|
|
@@ -66,6 +70,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
66
70
|
supportEmail?: string;
|
|
67
71
|
origins?: string[];
|
|
68
72
|
threeDsChallengePreference?: import('../lib/common').ThreeDsChallengePreference;
|
|
73
|
+
destinationAuthKey?: string;
|
|
69
74
|
merchantId: string;
|
|
70
75
|
env?: import('../lib/common').CoinflowEnvs;
|
|
71
76
|
loaderBackground?: string;
|
|
@@ -79,9 +84,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
79
84
|
blockchain: "near";
|
|
80
85
|
action?: import('../lib/common').NearFtTransferCallAction;
|
|
81
86
|
nearDeposit?: string;
|
|
82
|
-
|
|
87
|
+
subtotal?: import('../lib/common').Subtotal;
|
|
83
88
|
onSuccess?: import('../lib/common').OnSuccessMethod;
|
|
84
|
-
webhookInfo?:
|
|
89
|
+
webhookInfo?: {
|
|
90
|
+
[key: string]: any;
|
|
91
|
+
};
|
|
85
92
|
email?: string;
|
|
86
93
|
chargebackProtectionData?: import('../lib/common').ChargebackProtectionData;
|
|
87
94
|
planCode?: string;
|
|
@@ -95,6 +102,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
95
102
|
supportEmail?: string;
|
|
96
103
|
origins?: string[];
|
|
97
104
|
threeDsChallengePreference?: import('../lib/common').ThreeDsChallengePreference;
|
|
105
|
+
destinationAuthKey?: string;
|
|
98
106
|
merchantId: string;
|
|
99
107
|
env?: import('../lib/common').CoinflowEnvs;
|
|
100
108
|
loaderBackground?: string;
|
|
@@ -105,11 +113,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
105
113
|
route: string;
|
|
106
114
|
transaction: string | undefined;
|
|
107
115
|
blockchain: "polygon";
|
|
108
|
-
token?: string;
|
|
109
116
|
wallet: import('../lib/common').EthWallet;
|
|
110
|
-
|
|
117
|
+
subtotal?: import('../lib/common').Subtotal;
|
|
111
118
|
onSuccess?: import('../lib/common').OnSuccessMethod;
|
|
112
|
-
webhookInfo?:
|
|
119
|
+
webhookInfo?: {
|
|
120
|
+
[key: string]: any;
|
|
121
|
+
};
|
|
113
122
|
email?: string;
|
|
114
123
|
chargebackProtectionData?: import('../lib/common').ChargebackProtectionData;
|
|
115
124
|
planCode?: string;
|
|
@@ -123,6 +132,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
123
132
|
supportEmail?: string;
|
|
124
133
|
origins?: string[];
|
|
125
134
|
threeDsChallengePreference?: import('../lib/common').ThreeDsChallengePreference;
|
|
135
|
+
destinationAuthKey?: string;
|
|
126
136
|
merchantId: string;
|
|
127
137
|
env?: import('../lib/common').CoinflowEnvs;
|
|
128
138
|
loaderBackground?: string;
|
|
@@ -133,11 +143,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
133
143
|
route: string;
|
|
134
144
|
transaction: string | undefined;
|
|
135
145
|
blockchain: "eth";
|
|
136
|
-
token?: string;
|
|
137
146
|
wallet: import('../lib/common').EthWallet;
|
|
138
|
-
|
|
147
|
+
subtotal?: import('../lib/common').Subtotal;
|
|
139
148
|
onSuccess?: import('../lib/common').OnSuccessMethod;
|
|
140
|
-
webhookInfo?:
|
|
149
|
+
webhookInfo?: {
|
|
150
|
+
[key: string]: any;
|
|
151
|
+
};
|
|
141
152
|
email?: string;
|
|
142
153
|
chargebackProtectionData?: import('../lib/common').ChargebackProtectionData;
|
|
143
154
|
planCode?: string;
|
|
@@ -151,6 +162,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
151
162
|
supportEmail?: string;
|
|
152
163
|
origins?: string[];
|
|
153
164
|
threeDsChallengePreference?: import('../lib/common').ThreeDsChallengePreference;
|
|
165
|
+
destinationAuthKey?: string;
|
|
154
166
|
merchantId: string;
|
|
155
167
|
env?: import('../lib/common').CoinflowEnvs;
|
|
156
168
|
loaderBackground?: string;
|
|
@@ -161,11 +173,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
161
173
|
route: string;
|
|
162
174
|
transaction: string | undefined;
|
|
163
175
|
blockchain: "base";
|
|
164
|
-
token?: string;
|
|
165
176
|
wallet: import('../lib/common').EthWallet;
|
|
166
|
-
|
|
177
|
+
subtotal?: import('../lib/common').Subtotal;
|
|
167
178
|
onSuccess?: import('../lib/common').OnSuccessMethod;
|
|
168
|
-
webhookInfo?:
|
|
179
|
+
webhookInfo?: {
|
|
180
|
+
[key: string]: any;
|
|
181
|
+
};
|
|
169
182
|
email?: string;
|
|
170
183
|
chargebackProtectionData?: import('../lib/common').ChargebackProtectionData;
|
|
171
184
|
planCode?: string;
|
|
@@ -179,6 +192,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
179
192
|
supportEmail?: string;
|
|
180
193
|
origins?: string[];
|
|
181
194
|
threeDsChallengePreference?: import('../lib/common').ThreeDsChallengePreference;
|
|
195
|
+
destinationAuthKey?: string;
|
|
182
196
|
merchantId: string;
|
|
183
197
|
env?: import('../lib/common').CoinflowEnvs;
|
|
184
198
|
loaderBackground?: string;
|
|
@@ -189,11 +203,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
189
203
|
route: string;
|
|
190
204
|
transaction: string | undefined;
|
|
191
205
|
blockchain: "arbitrum";
|
|
192
|
-
token?: string;
|
|
193
206
|
wallet: import('../lib/common').EthWallet;
|
|
194
|
-
|
|
207
|
+
subtotal?: import('../lib/common').Subtotal;
|
|
195
208
|
onSuccess?: import('../lib/common').OnSuccessMethod;
|
|
196
|
-
webhookInfo?:
|
|
209
|
+
webhookInfo?: {
|
|
210
|
+
[key: string]: any;
|
|
211
|
+
};
|
|
197
212
|
email?: string;
|
|
198
213
|
chargebackProtectionData?: import('../lib/common').ChargebackProtectionData;
|
|
199
214
|
planCode?: string;
|
|
@@ -207,6 +222,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
207
222
|
supportEmail?: string;
|
|
208
223
|
origins?: string[];
|
|
209
224
|
threeDsChallengePreference?: import('../lib/common').ThreeDsChallengePreference;
|
|
225
|
+
destinationAuthKey?: string;
|
|
210
226
|
merchantId: string;
|
|
211
227
|
env?: import('../lib/common').CoinflowEnvs;
|
|
212
228
|
loaderBackground?: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { CoinflowCardNumberInputProps, CoinflowCardTokenResponse } from '../../lib/common';
|
|
1
|
+
import { CoinflowCardNumberInputProps, CoinflowCardTokenResponse, MerchantIdOrCheckoutJwt } from '../../lib/common';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
declare function getToken(): Promise<CoinflowCardTokenResponse>;
|
|
4
4
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
5
|
args: {
|
|
6
|
-
type: PropType<CoinflowCardNumberInputProps>;
|
|
6
|
+
type: PropType<CoinflowCardNumberInputProps & MerchantIdOrCheckoutJwt>;
|
|
7
7
|
required: true;
|
|
8
8
|
};
|
|
9
9
|
}>, {
|
|
10
10
|
getToken: typeof getToken;
|
|
11
11
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
12
12
|
args: {
|
|
13
|
-
type: PropType<CoinflowCardNumberInputProps>;
|
|
13
|
+
type: PropType<CoinflowCardNumberInputProps & MerchantIdOrCheckoutJwt>;
|
|
14
14
|
required: true;
|
|
15
15
|
};
|
|
16
16
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { CoinflowCardNumberInputProps, CoinflowCardTokenResponse } from '../../lib/common';
|
|
1
|
+
import { CoinflowCardNumberInputProps, CoinflowCardTokenResponse, MerchantIdOrCheckoutJwt } from '../../lib/common';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
declare function getToken(): Promise<CoinflowCardTokenResponse>;
|
|
4
4
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
5
|
args: {
|
|
6
|
-
type: PropType<CoinflowCardNumberInputProps>;
|
|
6
|
+
type: PropType<CoinflowCardNumberInputProps & MerchantIdOrCheckoutJwt>;
|
|
7
7
|
required: true;
|
|
8
8
|
};
|
|
9
9
|
}>, {
|
|
10
10
|
getToken: typeof getToken;
|
|
11
11
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
12
12
|
args: {
|
|
13
|
-
type: PropType<CoinflowCardNumberInputProps>;
|
|
13
|
+
type: PropType<CoinflowCardNumberInputProps & MerchantIdOrCheckoutJwt>;
|
|
14
14
|
required: true;
|
|
15
15
|
};
|
|
16
16
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import { CoinflowCardTokenResponse, CoinflowCvvOnlyInputProps } from '../../lib/common';
|
|
2
|
+
import { CoinflowCardTokenResponse, CoinflowCvvOnlyInputProps, MerchantIdOrCheckoutJwt } from '../../lib/common';
|
|
3
3
|
declare function getToken(): Promise<CoinflowCardTokenResponse>;
|
|
4
4
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
5
|
args: {
|
|
6
|
-
type: PropType<CoinflowCvvOnlyInputProps>;
|
|
6
|
+
type: PropType<CoinflowCvvOnlyInputProps & MerchantIdOrCheckoutJwt>;
|
|
7
7
|
required: true;
|
|
8
8
|
};
|
|
9
9
|
}>, {
|
|
10
10
|
getToken: typeof getToken;
|
|
11
11
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
12
12
|
args: {
|
|
13
|
-
type: PropType<CoinflowCvvOnlyInputProps>;
|
|
13
|
+
type: PropType<CoinflowCvvOnlyInputProps & MerchantIdOrCheckoutJwt>;
|
|
14
14
|
required: true;
|
|
15
15
|
};
|
|
16
16
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { doInitializeCvvOnlyTokenExIframe, doInitializeTokenExCardOnlyIframe, doInitializeTokenExIframe, setTokenExScriptTag, TokenExIframe, CoinflowEnvs } from '../../lib/common';
|
|
2
|
-
declare const useCardFormIframe: (
|
|
1
|
+
import { doInitializeCvvOnlyTokenExIframe, doInitializeTokenExCardOnlyIframe, doInitializeTokenExIframe, setTokenExScriptTag, TokenExIframe, CoinflowEnvs, MerchantIdOrCheckoutJwt } from '../../lib/common';
|
|
2
|
+
declare const useCardFormIframe: (props: {
|
|
3
|
+
env: CoinflowEnvs;
|
|
4
|
+
} & MerchantIdOrCheckoutJwt) => {
|
|
3
5
|
tokenExIframe: import('vue').Ref<{
|
|
4
6
|
tokenize: () => Promise<import('../../lib/common').TokenizationResponse>;
|
|
5
7
|
load: () => void;
|
|
@@ -26,7 +26,7 @@ declare enum IFrameMessageMethods {
|
|
|
26
26
|
Success = "success",
|
|
27
27
|
Loaded = "loaded"
|
|
28
28
|
}
|
|
29
|
-
export declare function getWalletPubkey(input: CoinflowPurchaseProps): string | null | undefined;
|
|
29
|
+
export declare function getWalletPubkey(input: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain'>): string | null | undefined;
|
|
30
30
|
export declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers): Promise<string> | void;
|
|
31
|
-
export declare function getHandlers(props: CoinflowPurchaseProps): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
|
|
31
|
+
export declare function getHandlers(props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess'>): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
|
|
32
32
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Connection, VersionedTransaction, PublicKey, Signer, Transaction } from '@solana/web3.js';
|
|
2
|
+
import { Subtotal } from './Subtotal';
|
|
2
3
|
export declare enum SettlementType {
|
|
3
4
|
Credits = "Credits",
|
|
4
5
|
USDC = "USDC",
|
|
@@ -131,7 +132,7 @@ export type NearFtTransferCallAction = {
|
|
|
131
132
|
};
|
|
132
133
|
type Bytes = ArrayLike<number>;
|
|
133
134
|
type BytesLike = Bytes | string;
|
|
134
|
-
type RawProductData =
|
|
135
|
+
type RawProductData = any;
|
|
135
136
|
/** Purchase **/
|
|
136
137
|
export type ChargebackProtectionData = ChargebackProtectionItem[];
|
|
137
138
|
export interface ChargebackProtectionItem {
|
|
@@ -161,9 +162,11 @@ export declare enum ThreeDsChallengePreference {
|
|
|
161
162
|
Challenge = "Challenge"
|
|
162
163
|
}
|
|
163
164
|
export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
164
|
-
|
|
165
|
+
subtotal?: Subtotal;
|
|
165
166
|
onSuccess?: OnSuccessMethod;
|
|
166
|
-
webhookInfo?:
|
|
167
|
+
webhookInfo?: {
|
|
168
|
+
[key: string]: any;
|
|
169
|
+
};
|
|
167
170
|
email?: string;
|
|
168
171
|
chargebackProtectionData?: ChargebackProtectionData;
|
|
169
172
|
planCode?: string;
|
|
@@ -172,6 +175,12 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
172
175
|
customerInfo?: CustomerInfo;
|
|
173
176
|
settlementType?: SettlementType;
|
|
174
177
|
authOnly?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* The DeviceID gotten from the Coinflow SDK:
|
|
180
|
+
* https://docs.coinflow.cash/docs/implement-chargeback-protection#how-to-add-chargeback-protection
|
|
181
|
+
*
|
|
182
|
+
* window?.nSureSDK?.getDeviceId()
|
|
183
|
+
*/
|
|
175
184
|
deviceId?: string;
|
|
176
185
|
jwtToken?: string;
|
|
177
186
|
/**
|
|
@@ -188,6 +197,7 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
188
197
|
*/
|
|
189
198
|
origins?: string[];
|
|
190
199
|
threeDsChallengePreference?: ThreeDsChallengePreference;
|
|
200
|
+
destinationAuthKey?: string;
|
|
191
201
|
}
|
|
192
202
|
export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
193
203
|
wallet: SolanaWallet;
|
|
@@ -196,7 +206,6 @@ export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps
|
|
|
196
206
|
debugTx?: boolean;
|
|
197
207
|
connection: Connection;
|
|
198
208
|
blockchain: 'solana';
|
|
199
|
-
token?: PublicKey | string;
|
|
200
209
|
rent?: {
|
|
201
210
|
lamports: string | number;
|
|
202
211
|
};
|
|
@@ -217,7 +226,6 @@ export interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
|
217
226
|
}
|
|
218
227
|
export interface CoinflowEvmPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
219
228
|
transaction?: EvmTransactionData;
|
|
220
|
-
token?: string;
|
|
221
229
|
wallet: EthWallet;
|
|
222
230
|
}
|
|
223
231
|
export interface CoinflowPolygonPurchaseProps extends CoinflowEvmPurchaseProps {
|
|
@@ -333,7 +341,7 @@ export interface TokenRedeem extends CommonEvmRedeem {
|
|
|
333
341
|
destination: string;
|
|
334
342
|
}
|
|
335
343
|
export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem;
|
|
336
|
-
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | '
|
|
344
|
+
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'subtotal' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey'> {
|
|
337
345
|
walletPubkey: string | null | undefined;
|
|
338
346
|
sessionKey?: string;
|
|
339
347
|
route: string;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, CoinflowPurchaseProps
|
|
1
|
+
import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, CoinflowPurchaseProps } from './CoinflowTypes';
|
|
2
2
|
export declare class CoinflowUtils {
|
|
3
3
|
env: CoinflowEnvs;
|
|
4
4
|
url: string;
|
|
5
5
|
constructor(env?: CoinflowEnvs);
|
|
6
6
|
getNSurePartnerId(merchantId: string): Promise<string | undefined>;
|
|
7
|
-
getCreditBalance(publicKey: string, merchantId: string, blockchain: 'solana' | 'near'): Promise<{
|
|
8
|
-
cents: number;
|
|
9
|
-
}>;
|
|
10
7
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
11
8
|
static getCoinflowApiUrl(env?: CoinflowEnvs): string;
|
|
12
|
-
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env,
|
|
9
|
+
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChange, bankAccountLinkRedirect, additionalWallets, nearDeposit, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, }: CoinflowIFrameProps): string;
|
|
13
10
|
static getTransaction(props: CoinflowPurchaseProps): string | undefined;
|
|
14
11
|
static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
|
|
15
12
|
solana: T;
|
|
@@ -20,14 +17,4 @@ export declare class CoinflowUtils {
|
|
|
20
17
|
arbitrum: T;
|
|
21
18
|
user: T;
|
|
22
19
|
}): T;
|
|
23
|
-
static getWalletFromUserId({ userId, merchantId, env, }: {
|
|
24
|
-
userId: string;
|
|
25
|
-
merchantId: string;
|
|
26
|
-
env: CoinflowEnvs;
|
|
27
|
-
}): Promise<SolanaWallet>;
|
|
28
|
-
static getWalletFromEmail({ email, merchantId, env, }: {
|
|
29
|
-
email: string;
|
|
30
|
-
merchantId: string;
|
|
31
|
-
env: CoinflowEnvs;
|
|
32
|
-
}): Promise<SolanaWallet>;
|
|
33
20
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare enum Currency {
|
|
2
|
+
USD = "USD",
|
|
3
|
+
EUR = "EUR",
|
|
4
|
+
GBP = "GBP",
|
|
5
|
+
BRL = "BRL"
|
|
6
|
+
}
|
|
7
|
+
export interface Cents {
|
|
8
|
+
/**
|
|
9
|
+
* @isInt Cents must be an integer
|
|
10
|
+
* @minimum 0 Minimum Cents is 0
|
|
11
|
+
*/
|
|
12
|
+
cents: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CurrencyCents extends Cents {
|
|
15
|
+
currency: Currency;
|
|
16
|
+
}
|
|
17
|
+
export interface TokenSubtotal {
|
|
18
|
+
/**
|
|
19
|
+
* The tokens address
|
|
20
|
+
*
|
|
21
|
+
* Solana - Token Mint Address
|
|
22
|
+
* Evm - Token Contract Address
|
|
23
|
+
*/
|
|
24
|
+
address: string;
|
|
25
|
+
/**
|
|
26
|
+
* Number of tokens
|
|
27
|
+
*/
|
|
28
|
+
amount: number | string;
|
|
29
|
+
/**
|
|
30
|
+
* Number of decimals for the token
|
|
31
|
+
*/
|
|
32
|
+
decimals?: number;
|
|
33
|
+
}
|
|
34
|
+
export type Subtotal = CurrencyCents | Cents | TokenSubtotal;
|
|
35
|
+
export interface NearDeposit {
|
|
36
|
+
yocto: string;
|
|
37
|
+
}
|
|
@@ -14,6 +14,8 @@ export interface TokenExIFrameConfiguration {
|
|
|
14
14
|
authenticationKey: string;
|
|
15
15
|
pci: true;
|
|
16
16
|
token?: string;
|
|
17
|
+
use3DS?: boolean;
|
|
18
|
+
threeDSMethodNotificationUrl?: string;
|
|
17
19
|
}
|
|
18
20
|
export interface CardFormInputStyles {
|
|
19
21
|
base: CSSProperties | string;
|
|
@@ -30,7 +32,7 @@ export interface CoinflowCardNumberInputProps {
|
|
|
30
32
|
cvv: CardFormInputStyles;
|
|
31
33
|
};
|
|
32
34
|
debug?: boolean;
|
|
33
|
-
origins
|
|
35
|
+
origins: string[];
|
|
34
36
|
font?: string;
|
|
35
37
|
}
|
|
36
38
|
export interface CoinflowCvvOnlyInputProps {
|
|
@@ -41,9 +43,22 @@ export interface CoinflowCvvOnlyInputProps {
|
|
|
41
43
|
cvv: CardFormInputStyles;
|
|
42
44
|
};
|
|
43
45
|
debug?: boolean;
|
|
44
|
-
origins
|
|
46
|
+
origins: string[];
|
|
45
47
|
font?: string;
|
|
46
48
|
}
|
|
49
|
+
export interface VersionDetail {
|
|
50
|
+
threeDSMethodURL: string;
|
|
51
|
+
acsStartProtocolVersion: string;
|
|
52
|
+
acsEndProtocolVersion: string;
|
|
53
|
+
threeDSServerStartVersion: string;
|
|
54
|
+
threeDSServerEndVersion?: string;
|
|
55
|
+
acsInfoInd: [string];
|
|
56
|
+
directoryServerID: string;
|
|
57
|
+
dsStartProtocolVersion: string;
|
|
58
|
+
dsEndProtocolVersion: string;
|
|
59
|
+
dsIdentifier: string;
|
|
60
|
+
threeDSServerTransID: string;
|
|
61
|
+
}
|
|
47
62
|
export interface TokenizationResponse {
|
|
48
63
|
cardType: string;
|
|
49
64
|
cvvIncluded: true;
|
|
@@ -52,6 +67,8 @@ export interface TokenizationResponse {
|
|
|
52
67
|
referenceNumber: string;
|
|
53
68
|
token: string;
|
|
54
69
|
tokenHMAC: string;
|
|
70
|
+
recommended3dsVersion?: Record<string, string>;
|
|
71
|
+
threeDSecureResponse?: VersionDetail[];
|
|
55
72
|
}
|
|
56
73
|
declare global {
|
|
57
74
|
namespace TokenEx {
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import { TokenExIframe, TokenExIFrameConfiguration } from './TokenEx';
|
|
2
2
|
import { CardType, CoinflowEnvs } from '../CoinflowTypes';
|
|
3
|
-
export
|
|
3
|
+
export type MerchantIdOrCheckoutJwt = {
|
|
4
|
+
merchantId: string;
|
|
5
|
+
} | {
|
|
6
|
+
checkoutJwt: string;
|
|
7
|
+
};
|
|
8
|
+
export interface CommonDoInitializeTokenExIframeArgs {
|
|
4
9
|
css: string;
|
|
5
10
|
debug?: boolean;
|
|
6
11
|
font?: string;
|
|
7
|
-
origins: string[]
|
|
12
|
+
origins: string[];
|
|
8
13
|
tokenExScriptLoaded: boolean;
|
|
9
14
|
env: CoinflowEnvs;
|
|
10
15
|
setCachedToken: (s: string | undefined) => void;
|
|
11
16
|
setLoaded: (b: boolean) => void;
|
|
12
17
|
}
|
|
13
|
-
export
|
|
18
|
+
export type DoInitializeTokenExIframeArgs = CommonDoInitializeTokenExIframeArgs & MerchantIdOrCheckoutJwt;
|
|
19
|
+
export type DoInitializeCvvOnlyTokenExIframeArgs = DoInitializeTokenExIframeArgs & {
|
|
14
20
|
token: string;
|
|
15
21
|
cardType: CardType;
|
|
16
|
-
}
|
|
17
|
-
export
|
|
22
|
+
};
|
|
23
|
+
export type GetIFrameConfigArgs = {
|
|
18
24
|
token?: string;
|
|
19
|
-
origins: string[]
|
|
25
|
+
origins: string[];
|
|
20
26
|
env: CoinflowEnvs;
|
|
21
|
-
}
|
|
27
|
+
} & MerchantIdOrCheckoutJwt;
|
|
28
|
+
export declare function getIframeConfig(args: GetIFrameConfigArgs): Promise<TokenExIFrameConfiguration>;
|
|
22
29
|
export declare function setTokenExScriptTag({ env, setTokenExScriptLoaded, }: {
|
|
23
30
|
env: CoinflowEnvs;
|
|
24
31
|
setTokenExScriptLoaded: (b: boolean) => void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/vue",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -20,33 +20,32 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"clean": "rimraf dist src/lib",
|
|
22
22
|
"vue:dev": "vite",
|
|
23
|
-
"build": "npm run clean && npm run codegen && vue-tsc && vite build",
|
|
23
|
+
"build": "npm run clean && npm run codegen && ls ./src/lib/common && vue-tsc && vite build",
|
|
24
24
|
"preview": "vite preview",
|
|
25
|
-
"codegen": "mkdir -p ./src/lib/common/ &&
|
|
25
|
+
"codegen": "mkdir -p ./src/lib/common/ && cp -r '../../packages/lib-common/src/.' './src/lib/common'"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"vue": "
|
|
28
|
+
"vue": "^3.4.30",
|
|
29
29
|
"@solana/web3.js": ">=1.54.0",
|
|
30
|
-
"bs58": "^4.0.1"
|
|
31
|
-
"tweetnacl": "^1.0.3"
|
|
30
|
+
"bs58": "^4.0.1"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
33
|
"@types/bs58": "^4.0.4",
|
|
35
34
|
"@rushstack/eslint-patch": "^1.10.4",
|
|
36
|
-
"@types/node": "^22.
|
|
37
|
-
"@vitejs/plugin-vue": "^5.1
|
|
35
|
+
"@types/node": "^22.10.2",
|
|
36
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
38
37
|
"@vue/eslint-config-prettier": "^10.1.0",
|
|
39
38
|
"@vue/eslint-config-typescript": "^13.0.0",
|
|
40
39
|
"copyfiles": "^2.4.1",
|
|
41
40
|
"eslint": "^8.57.1",
|
|
42
|
-
"eslint-plugin-vue": "^9.
|
|
43
|
-
"prettier": "^3.
|
|
41
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
42
|
+
"prettier": "^3.4.2",
|
|
44
43
|
"typescript": "^5.6.3",
|
|
45
|
-
"vite": "^
|
|
44
|
+
"vite": "^6.0.3",
|
|
46
45
|
"vite-plugin-dts": "^4.3.0",
|
|
47
|
-
"vitepress": "^1.
|
|
48
|
-
"vue": "^3.5.
|
|
49
|
-
"vue-tsc": "^2.1.
|
|
46
|
+
"vitepress": "^1.5.0",
|
|
47
|
+
"vue": "^3.5.13",
|
|
48
|
+
"vue-tsc": "^2.1.10"
|
|
50
49
|
},
|
|
51
50
|
"dependencies": {
|
|
52
51
|
"lz-string": "^1.5.0"
|
|
@@ -57,9 +56,6 @@
|
|
|
57
56
|
},
|
|
58
57
|
"bs58": {
|
|
59
58
|
"optional": true
|
|
60
|
-
},
|
|
61
|
-
"tweetnacl": {
|
|
62
|
-
"optional": true
|
|
63
59
|
}
|
|
64
60
|
}
|
|
65
61
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
export default _default;
|