@coinflowlabs/vue 0.1.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.
@@ -0,0 +1,164 @@
1
+ /// <reference types="@solana/web3.js" />
2
+ import { PropType } from "vue";
3
+ import { CoinflowPurchaseProps } from "../lib/common";
4
+ declare const _sfc_main: import("vue").DefineComponent<{
5
+ args: {
6
+ type: PropType<CoinflowPurchaseProps>;
7
+ required: true;
8
+ };
9
+ }, unknown, unknown, {
10
+ iframeProps(): {
11
+ walletPubkey: string | null | undefined;
12
+ route: string;
13
+ transaction: string | undefined;
14
+ wallet: import("../lib/common").SolanaWallet;
15
+ partialSigners?: import("@solana/web3.js").Signer[] | undefined;
16
+ debugTx?: boolean | undefined;
17
+ connection: import("@solana/web3.js").Connection;
18
+ blockchain: "solana";
19
+ token?: string | import("@solana/web3.js").PublicKey | undefined;
20
+ rent?: {
21
+ lamports: string | number;
22
+ } | undefined;
23
+ nativeSolToConvert?: {
24
+ lamports: string | number;
25
+ } | undefined;
26
+ amount?: string | number | undefined;
27
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
28
+ webhookInfo?: object | undefined;
29
+ email?: string | undefined;
30
+ chargebackProtectionData?: import("../lib/common").ChargebackProtectionData | undefined;
31
+ planCode?: string | undefined;
32
+ disableApplePay?: boolean | undefined;
33
+ disableGooglePay?: boolean | undefined;
34
+ customerInfo?: import("../lib/common").CustomerInfo | undefined;
35
+ settlementType?: import("../lib/common").SettlementType | undefined;
36
+ authOnly?: boolean | undefined;
37
+ deviceId?: string | undefined;
38
+ jwtToken?: string | undefined;
39
+ origins?: string[] | undefined;
40
+ merchantId: string;
41
+ env?: import("../lib/common").CoinflowEnvs | undefined;
42
+ loaderBackground?: string | undefined;
43
+ handleHeightChange?: ((height: string) => void) | undefined;
44
+ theme?: import("../lib/common").MerchantTheme | undefined;
45
+ } | {
46
+ walletPubkey: string | null | undefined;
47
+ route: string;
48
+ transaction: string | undefined;
49
+ wallet: import("../lib/common").NearWallet;
50
+ blockchain: "near";
51
+ action?: import("../lib/common").NearFtTransferCallAction | undefined;
52
+ nearDeposit?: string | undefined;
53
+ amount?: string | number | undefined;
54
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
55
+ webhookInfo?: object | undefined;
56
+ email?: string | undefined;
57
+ chargebackProtectionData?: import("../lib/common").ChargebackProtectionData | undefined;
58
+ planCode?: string | undefined;
59
+ disableApplePay?: boolean | undefined;
60
+ disableGooglePay?: boolean | undefined;
61
+ customerInfo?: import("../lib/common").CustomerInfo | undefined;
62
+ settlementType?: import("../lib/common").SettlementType | undefined;
63
+ authOnly?: boolean | undefined;
64
+ deviceId?: string | undefined;
65
+ jwtToken?: string | undefined;
66
+ origins?: string[] | undefined;
67
+ merchantId: string;
68
+ env?: import("../lib/common").CoinflowEnvs | undefined;
69
+ loaderBackground?: string | undefined;
70
+ handleHeightChange?: ((height: string) => void) | undefined;
71
+ theme?: import("../lib/common").MerchantTheme | undefined;
72
+ } | {
73
+ walletPubkey: string | null | undefined;
74
+ route: string;
75
+ transaction: string | undefined;
76
+ blockchain: "polygon";
77
+ token?: string | undefined;
78
+ wallet: import("../lib/common").EthWallet;
79
+ amount?: string | number | undefined;
80
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
81
+ webhookInfo?: object | undefined;
82
+ email?: string | undefined;
83
+ chargebackProtectionData?: import("../lib/common").ChargebackProtectionData | undefined;
84
+ planCode?: string | undefined;
85
+ disableApplePay?: boolean | undefined;
86
+ disableGooglePay?: boolean | undefined;
87
+ customerInfo?: import("../lib/common").CustomerInfo | undefined;
88
+ settlementType?: import("../lib/common").SettlementType | undefined;
89
+ authOnly?: boolean | undefined;
90
+ deviceId?: string | undefined;
91
+ jwtToken?: string | undefined;
92
+ origins?: string[] | undefined;
93
+ merchantId: string;
94
+ env?: import("../lib/common").CoinflowEnvs | undefined;
95
+ loaderBackground?: string | undefined;
96
+ handleHeightChange?: ((height: string) => void) | undefined;
97
+ theme?: import("../lib/common").MerchantTheme | undefined;
98
+ } | {
99
+ walletPubkey: string | null | undefined;
100
+ route: string;
101
+ transaction: string | undefined;
102
+ blockchain: "eth";
103
+ token?: string | undefined;
104
+ wallet: import("../lib/common").EthWallet;
105
+ amount?: string | number | undefined;
106
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
107
+ webhookInfo?: object | undefined;
108
+ email?: string | undefined;
109
+ chargebackProtectionData?: import("../lib/common").ChargebackProtectionData | undefined;
110
+ planCode?: string | undefined;
111
+ disableApplePay?: boolean | undefined;
112
+ disableGooglePay?: boolean | undefined;
113
+ customerInfo?: import("../lib/common").CustomerInfo | undefined;
114
+ settlementType?: import("../lib/common").SettlementType | undefined;
115
+ authOnly?: boolean | undefined;
116
+ deviceId?: string | undefined;
117
+ jwtToken?: string | undefined;
118
+ origins?: string[] | undefined;
119
+ merchantId: string;
120
+ env?: import("../lib/common").CoinflowEnvs | undefined;
121
+ loaderBackground?: string | undefined;
122
+ handleHeightChange?: ((height: string) => void) | undefined;
123
+ theme?: import("../lib/common").MerchantTheme | undefined;
124
+ } | {
125
+ walletPubkey: string | null | undefined;
126
+ route: string;
127
+ transaction: string | undefined;
128
+ blockchain: "base";
129
+ token?: string | undefined;
130
+ wallet: import("../lib/common").EthWallet;
131
+ amount?: string | number | undefined;
132
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
133
+ webhookInfo?: object | undefined;
134
+ email?: string | undefined;
135
+ chargebackProtectionData?: import("../lib/common").ChargebackProtectionData | undefined;
136
+ planCode?: string | undefined;
137
+ disableApplePay?: boolean | undefined;
138
+ disableGooglePay?: boolean | undefined;
139
+ customerInfo?: import("../lib/common").CustomerInfo | undefined;
140
+ settlementType?: import("../lib/common").SettlementType | undefined;
141
+ authOnly?: boolean | undefined;
142
+ deviceId?: string | undefined;
143
+ jwtToken?: string | undefined;
144
+ origins?: string[] | undefined;
145
+ merchantId: string;
146
+ env?: import("../lib/common").CoinflowEnvs | undefined;
147
+ loaderBackground?: string | undefined;
148
+ handleHeightChange?: ((height: string) => void) | undefined;
149
+ theme?: import("../lib/common").MerchantTheme | undefined;
150
+ };
151
+ messageHandlers(): {
152
+ handleHeightChange: ((height: string) => void) | undefined;
153
+ onSuccess: import("../lib/common").OnSuccessMethod | undefined;
154
+ handleSendTransaction: (transaction: string) => Promise<string>;
155
+ handleSignMessage?: ((message: string) => Promise<string>) | undefined;
156
+ handleSignTransaction?: ((transaction: string) => Promise<string>) | undefined;
157
+ };
158
+ }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
159
+ args: {
160
+ type: PropType<CoinflowPurchaseProps>;
161
+ required: true;
162
+ };
163
+ }>>, {}, {}>;
164
+ export default _sfc_main;
@@ -0,0 +1,148 @@
1
+ /// <reference types="@solana/web3.js" />
2
+ import { PropType } from "vue";
3
+ import { CoinflowWithdrawProps } from "../lib/common";
4
+ declare const _sfc_main: import("vue").DefineComponent<{
5
+ args: {
6
+ type: PropType<CoinflowWithdrawProps>;
7
+ required: true;
8
+ };
9
+ }, unknown, unknown, {
10
+ iframeProps(): {
11
+ walletPubkey: string | null | undefined;
12
+ route: string;
13
+ transaction: undefined;
14
+ wallet: import("../lib/common").SolanaWallet;
15
+ connection: import("@solana/web3.js").Connection;
16
+ blockchain: "solana";
17
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
18
+ tokens?: string[] | undefined;
19
+ lockDefaultToken?: boolean | undefined;
20
+ amount?: number | undefined;
21
+ email?: string | undefined;
22
+ bankAccountLinkRedirect?: string | undefined;
23
+ additionalWallets?: {
24
+ wallet: string;
25
+ blockchain: "solana" | "near" | "polygon" | "eth";
26
+ }[] | undefined;
27
+ lockAmount?: boolean | undefined;
28
+ transactionSigner?: string | undefined;
29
+ origins?: string[] | undefined;
30
+ merchantId: string;
31
+ env?: import("../lib/common").CoinflowEnvs | undefined;
32
+ loaderBackground?: string | undefined;
33
+ handleHeightChange?: ((height: string) => void) | undefined;
34
+ theme?: import("../lib/common").MerchantTheme | undefined;
35
+ } | {
36
+ walletPubkey: string | null | undefined;
37
+ route: string;
38
+ transaction: undefined;
39
+ wallet: import("../lib/common").NearWallet;
40
+ blockchain: "near";
41
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
42
+ tokens?: string[] | undefined;
43
+ lockDefaultToken?: boolean | undefined;
44
+ amount?: number | undefined;
45
+ email?: string | undefined;
46
+ bankAccountLinkRedirect?: string | undefined;
47
+ additionalWallets?: {
48
+ wallet: string;
49
+ blockchain: "solana" | "near" | "polygon" | "eth";
50
+ }[] | undefined;
51
+ lockAmount?: boolean | undefined;
52
+ transactionSigner?: string | undefined;
53
+ origins?: string[] | undefined;
54
+ merchantId: string;
55
+ env?: import("../lib/common").CoinflowEnvs | undefined;
56
+ loaderBackground?: string | undefined;
57
+ handleHeightChange?: ((height: string) => void) | undefined;
58
+ theme?: import("../lib/common").MerchantTheme | undefined;
59
+ } | {
60
+ walletPubkey: string | null | undefined;
61
+ route: string;
62
+ transaction: undefined;
63
+ blockchain: "eth";
64
+ usePermit?: boolean | undefined;
65
+ wallet: import("../lib/common").EthWallet;
66
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
67
+ tokens?: string[] | undefined;
68
+ lockDefaultToken?: boolean | undefined;
69
+ amount?: number | undefined;
70
+ email?: string | undefined;
71
+ bankAccountLinkRedirect?: string | undefined;
72
+ additionalWallets?: {
73
+ wallet: string;
74
+ blockchain: "solana" | "near" | "polygon" | "eth";
75
+ }[] | undefined;
76
+ lockAmount?: boolean | undefined;
77
+ transactionSigner?: string | undefined;
78
+ origins?: string[] | undefined;
79
+ merchantId: string;
80
+ env?: import("../lib/common").CoinflowEnvs | undefined;
81
+ loaderBackground?: string | undefined;
82
+ handleHeightChange?: ((height: string) => void) | undefined;
83
+ theme?: import("../lib/common").MerchantTheme | undefined;
84
+ } | {
85
+ walletPubkey: string | null | undefined;
86
+ route: string;
87
+ transaction: undefined;
88
+ blockchain: "polygon";
89
+ wallet: import("../lib/common").EthWallet;
90
+ usePermit?: boolean | undefined;
91
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
92
+ tokens?: string[] | undefined;
93
+ lockDefaultToken?: boolean | undefined;
94
+ amount?: number | undefined;
95
+ email?: string | undefined;
96
+ bankAccountLinkRedirect?: string | undefined;
97
+ additionalWallets?: {
98
+ wallet: string;
99
+ blockchain: "solana" | "near" | "polygon" | "eth";
100
+ }[] | undefined;
101
+ lockAmount?: boolean | undefined;
102
+ transactionSigner?: string | undefined;
103
+ origins?: string[] | undefined;
104
+ merchantId: string;
105
+ env?: import("../lib/common").CoinflowEnvs | undefined;
106
+ loaderBackground?: string | undefined;
107
+ handleHeightChange?: ((height: string) => void) | undefined;
108
+ theme?: import("../lib/common").MerchantTheme | undefined;
109
+ } | {
110
+ walletPubkey: string | null | undefined;
111
+ route: string;
112
+ transaction: undefined;
113
+ blockchain: "base";
114
+ wallet: import("../lib/common").EthWallet;
115
+ usePermit?: boolean | undefined;
116
+ onSuccess?: import("../lib/common").OnSuccessMethod | undefined;
117
+ tokens?: string[] | undefined;
118
+ lockDefaultToken?: boolean | undefined;
119
+ amount?: number | undefined;
120
+ email?: string | undefined;
121
+ bankAccountLinkRedirect?: string | undefined;
122
+ additionalWallets?: {
123
+ wallet: string;
124
+ blockchain: "solana" | "near" | "polygon" | "eth";
125
+ }[] | undefined;
126
+ lockAmount?: boolean | undefined;
127
+ transactionSigner?: string | undefined;
128
+ origins?: string[] | undefined;
129
+ merchantId: string;
130
+ env?: import("../lib/common").CoinflowEnvs | undefined;
131
+ loaderBackground?: string | undefined;
132
+ handleHeightChange?: ((height: string) => void) | undefined;
133
+ theme?: import("../lib/common").MerchantTheme | undefined;
134
+ };
135
+ messageHandlers(): {
136
+ handleHeightChange: ((height: string) => void) | undefined;
137
+ onSuccess: import("../lib/common").OnSuccessMethod | undefined;
138
+ handleSendTransaction: (transaction: string) => Promise<string>;
139
+ handleSignMessage?: ((message: string) => Promise<string>) | undefined;
140
+ handleSignTransaction?: ((transaction: string) => Promise<string>) | undefined;
141
+ };
142
+ }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
143
+ args: {
144
+ type: PropType<CoinflowWithdrawProps>;
145
+ required: true;
146
+ };
147
+ }>>, {}, {}>;
148
+ export default _sfc_main;
@@ -0,0 +1,47 @@
1
+ import { CoinflowCardNumberInputProps, CoinflowCardTokenResponse } from "../../lib/common";
2
+ import { PropType } from "vue";
3
+ declare const _sfc_main: import("vue").DefineComponent<{
4
+ args: {
5
+ type: PropType<CoinflowCardNumberInputProps>;
6
+ required: true;
7
+ };
8
+ }, {
9
+ initializeTokenExIframe: ({ css, fontFamily, debug, origins, }: Omit<{
10
+ css: string;
11
+ debug?: boolean | undefined;
12
+ fontFamily?: string | undefined;
13
+ origins: string[] | undefined;
14
+ tokenExScriptLoaded: boolean;
15
+ env: import("../../lib/common").CoinflowEnvs;
16
+ setCachedToken: (s: string | undefined) => void;
17
+ setLoaded: (b: boolean) => void;
18
+ }, "env" | "setCachedToken" | "setLoaded" | "tokenExScriptLoaded">) => Promise<import("../../lib/common").TokenExIframe | undefined>;
19
+ tokenExIframe: import("vue").Ref<{
20
+ tokenize: () => Promise<import("../../lib/common").TokenizationResponse>;
21
+ load: () => void;
22
+ on: (event: string, callback: (data?: any) => void) => void;
23
+ validate: () => void;
24
+ reset: () => void;
25
+ blur: () => void;
26
+ cvvBlur: () => void;
27
+ focus: () => void;
28
+ cvvFocus: () => void;
29
+ remove: () => void;
30
+ toggleMask: () => void;
31
+ toggleCvvMask: () => void;
32
+ setPAN: (pan: string) => void;
33
+ binLookup: () => void;
34
+ validateConfig: () => void;
35
+ setFraudServicesRequestDetails: (data: string) => void;
36
+ } | undefined>;
37
+ tokenExScriptLoaded: import("vue").Ref<boolean>;
38
+ getToken: () => Promise<CoinflowCardTokenResponse>;
39
+ css: () => string;
40
+ readonly TokenExCardNumberIframeId: string;
41
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
42
+ args: {
43
+ type: PropType<CoinflowCardNumberInputProps>;
44
+ required: true;
45
+ };
46
+ }>>, {}, {}>;
47
+ export default _sfc_main;
@@ -0,0 +1,4 @@
1
+ declare const _sfc_main: import("vue").DefineComponent<{}, {
2
+ readonly TokenExCvvContainerID: string;
3
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
4
+ export default _sfc_main;
@@ -0,0 +1,30 @@
1
+ import { doInitializeCvvOnlyTokenExIframe, doInitializeTokenExCardOnlyIframe, doInitializeTokenExIframe, setTokenExScriptTag, TokenExIframe } from "../../lib/common";
2
+ import { CoinflowEnvs } from "../../lib/common";
3
+ declare const useCardFormIframe: (env: CoinflowEnvs) => {
4
+ tokenExIframe: import("vue").Ref<{
5
+ tokenize: () => Promise<import("../../lib/common").TokenizationResponse>;
6
+ load: () => void;
7
+ on: (event: string, callback: (data?: any) => void) => void;
8
+ validate: () => void;
9
+ reset: () => void;
10
+ blur: () => void;
11
+ cvvBlur: () => void;
12
+ focus: () => void;
13
+ cvvFocus: () => void;
14
+ remove: () => void;
15
+ toggleMask: () => void;
16
+ toggleCvvMask: () => void;
17
+ setPAN: (pan: string) => void;
18
+ binLookup: () => void;
19
+ validateConfig: () => void;
20
+ setFraudServicesRequestDetails: (data: string) => void;
21
+ } | undefined>;
22
+ initializeTokenExIframe: ({ css, fontFamily, debug, origins, }: Omit<Parameters<typeof doInitializeTokenExIframe>[0], 'env' | 'tokenExScriptLoaded' | 'setCachedToken' | 'setLoaded'>) => Promise<TokenExIframe | undefined>;
23
+ initializeCvvOnlyTokenExIframe: ({ token, cardType, css, debug, fontFamily, origins, }: Omit<Parameters<typeof doInitializeCvvOnlyTokenExIframe>[0], 'env' | 'tokenExScriptLoaded' | 'setCachedToken' | 'setLoaded'>) => Promise<TokenExIframe | undefined>;
24
+ initializeTokenExCardOnlyIframe: ({ css, fontFamily, debug, origins, }: Omit<Parameters<typeof doInitializeTokenExCardOnlyIframe>[0], 'env' | 'tokenExScriptLoaded' | 'setCachedToken' | 'setLoaded'>) => Promise<TokenExIframe | undefined>;
25
+ loaded: import("vue").Ref<boolean>;
26
+ cachedToken: import("vue").Ref<string | undefined>;
27
+ setTokenExScriptTag: typeof setTokenExScriptTag;
28
+ tokenExScriptLoaded: import("vue").Ref<boolean>;
29
+ };
30
+ export default useCardFormIframe;
@@ -0,0 +1,7 @@
1
+ import CoinflowIframe from "./components/CoinflowIframe.vue";
2
+ import CoinflowWithdraw from "./components/CoinflowWithdraw.vue";
3
+ import CoinflowPurchase from "./components/CoinflowPurchase.vue";
4
+ import CoinflowCardNumberInput from "./components/card-form/CoinflowCardNumberInput.vue";
5
+ import CoinflowCvvInput from "./components/card-form/CoinflowCvvInput.vue";
6
+ export * from './lib/common';
7
+ export { CoinflowIframe, CoinflowWithdraw, CoinflowCvvInput, CoinflowCardNumberInput, CoinflowPurchase };
@@ -0,0 +1,31 @@
1
+ import { CoinflowPurchaseProps, OnSuccessMethod } from './CoinflowTypes';
2
+ export type WalletCall = {
3
+ method: IFrameMessageMethods;
4
+ data: string;
5
+ } | SuccessWalletCall;
6
+ type SuccessWalletCall = {
7
+ method: IFrameMessageMethods.Success;
8
+ data: string;
9
+ info: {
10
+ paymentId: string;
11
+ hash?: string;
12
+ };
13
+ };
14
+ export interface IFrameMessageHandlers {
15
+ handleSendTransaction: (transaction: string) => Promise<string>;
16
+ handleSignMessage?: (message: string) => Promise<string>;
17
+ handleSignTransaction?: (transaction: string) => Promise<string>;
18
+ handleHeightChange?: (height: string) => void;
19
+ onSuccess: OnSuccessMethod | undefined;
20
+ }
21
+ declare enum IFrameMessageMethods {
22
+ SignMessage = "signMessage",
23
+ SignTransaction = "signTransaction",
24
+ SendTransaction = "sendTransaction",
25
+ HeightChange = "heightChange",
26
+ Success = "success"
27
+ }
28
+ export declare function getWalletPubkey({ wallet, }: Pick<CoinflowPurchaseProps, 'wallet'>): string | null | undefined;
29
+ export declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers): Promise<string> | void;
30
+ export declare function getHandlers(props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess'>): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
31
+ export {};