@coinflowlabs/vue 0.1.0 → 0.2.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,221 @@
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
+ color: "white" | "black";
8
+ }>;
9
+ required: true;
10
+ };
11
+ route: {
12
+ type: StringConstructor;
13
+ required: true;
14
+ };
15
+ }, {
16
+ onSuccess: import("../../lib/common").OnSuccessMethod | undefined;
17
+ iframeProps: () => {
18
+ walletPubkey: string | null | undefined;
19
+ transaction: undefined;
20
+ routePrefix: string;
21
+ route: string;
22
+ wallet: import("../../lib/common").SolanaWallet;
23
+ partialSigners?: import("@solana/web3.js").Signer[] | undefined;
24
+ debugTx?: boolean | undefined;
25
+ connection: import("@solana/web3.js").Connection;
26
+ blockchain: "solana";
27
+ token?: string | import("@solana/web3.js").PublicKey | undefined;
28
+ rent?: {
29
+ lamports: string | number;
30
+ } | undefined;
31
+ nativeSolToConvert?: {
32
+ lamports: string | number;
33
+ } | undefined;
34
+ amount?: string | number | undefined;
35
+ onSuccess?: import("../../lib/common").OnSuccessMethod | undefined;
36
+ webhookInfo?: object | undefined;
37
+ email?: string | undefined;
38
+ chargebackProtectionData?: import("../../lib/common").ChargebackProtectionData | undefined;
39
+ planCode?: string | undefined;
40
+ disableApplePay?: boolean | undefined;
41
+ disableGooglePay?: boolean | undefined;
42
+ customerInfo?: import("../../lib/common").CustomerInfo | undefined;
43
+ settlementType?: import("../../lib/common").SettlementType | undefined;
44
+ authOnly?: boolean | undefined;
45
+ deviceId?: string | undefined;
46
+ jwtToken?: string | undefined;
47
+ origins?: string[] | undefined;
48
+ merchantId: string;
49
+ env?: import("../../lib/common").CoinflowEnvs | undefined;
50
+ loaderBackground?: string | undefined;
51
+ handleHeightChange?: ((height: string) => void) | undefined;
52
+ theme?: import("../../lib/common").MerchantTheme | undefined;
53
+ color: "white" | "black";
54
+ } | {
55
+ walletPubkey: string | null | undefined;
56
+ transaction: undefined;
57
+ routePrefix: string;
58
+ route: string;
59
+ wallet: import("../../lib/common").NearWallet;
60
+ blockchain: "near";
61
+ action?: import("../../lib/common").NearFtTransferCallAction | undefined;
62
+ nearDeposit?: string | undefined;
63
+ amount?: string | number | undefined;
64
+ onSuccess?: import("../../lib/common").OnSuccessMethod | undefined;
65
+ webhookInfo?: object | undefined;
66
+ email?: string | undefined;
67
+ chargebackProtectionData?: import("../../lib/common").ChargebackProtectionData | undefined;
68
+ planCode?: string | undefined;
69
+ disableApplePay?: boolean | undefined;
70
+ disableGooglePay?: boolean | undefined;
71
+ customerInfo?: import("../../lib/common").CustomerInfo | undefined;
72
+ settlementType?: import("../../lib/common").SettlementType | undefined;
73
+ authOnly?: boolean | undefined;
74
+ deviceId?: string | undefined;
75
+ jwtToken?: string | undefined;
76
+ origins?: string[] | undefined;
77
+ merchantId: string;
78
+ env?: import("../../lib/common").CoinflowEnvs | undefined;
79
+ loaderBackground?: string | undefined;
80
+ handleHeightChange?: ((height: string) => void) | undefined;
81
+ theme?: import("../../lib/common").MerchantTheme | undefined;
82
+ color: "white" | "black";
83
+ } | {
84
+ walletPubkey: string | null | undefined;
85
+ transaction: undefined;
86
+ routePrefix: string;
87
+ route: string;
88
+ blockchain: "polygon";
89
+ token?: string | undefined;
90
+ wallet: import("../../lib/common").EthWallet;
91
+ amount?: string | number | undefined;
92
+ onSuccess?: import("../../lib/common").OnSuccessMethod | undefined;
93
+ webhookInfo?: object | undefined;
94
+ email?: string | undefined;
95
+ chargebackProtectionData?: import("../../lib/common").ChargebackProtectionData | undefined;
96
+ planCode?: string | undefined;
97
+ disableApplePay?: boolean | undefined;
98
+ disableGooglePay?: boolean | undefined;
99
+ customerInfo?: import("../../lib/common").CustomerInfo | undefined;
100
+ settlementType?: import("../../lib/common").SettlementType | undefined;
101
+ authOnly?: boolean | undefined;
102
+ deviceId?: string | undefined;
103
+ jwtToken?: string | undefined;
104
+ origins?: string[] | undefined;
105
+ merchantId: string;
106
+ env?: import("../../lib/common").CoinflowEnvs | undefined;
107
+ loaderBackground?: string | undefined;
108
+ handleHeightChange?: ((height: string) => void) | undefined;
109
+ theme?: import("../../lib/common").MerchantTheme | undefined;
110
+ color: "white" | "black";
111
+ } | {
112
+ walletPubkey: string | null | undefined;
113
+ transaction: undefined;
114
+ routePrefix: string;
115
+ route: string;
116
+ blockchain: "eth";
117
+ token?: string | undefined;
118
+ wallet: import("../../lib/common").EthWallet;
119
+ amount?: string | number | undefined;
120
+ onSuccess?: import("../../lib/common").OnSuccessMethod | undefined;
121
+ webhookInfo?: object | undefined;
122
+ email?: string | undefined;
123
+ chargebackProtectionData?: import("../../lib/common").ChargebackProtectionData | undefined;
124
+ planCode?: string | undefined;
125
+ disableApplePay?: boolean | undefined;
126
+ disableGooglePay?: boolean | undefined;
127
+ customerInfo?: import("../../lib/common").CustomerInfo | undefined;
128
+ settlementType?: import("../../lib/common").SettlementType | undefined;
129
+ authOnly?: boolean | undefined;
130
+ deviceId?: string | undefined;
131
+ jwtToken?: string | undefined;
132
+ origins?: string[] | undefined;
133
+ merchantId: string;
134
+ env?: import("../../lib/common").CoinflowEnvs | undefined;
135
+ loaderBackground?: string | undefined;
136
+ handleHeightChange?: ((height: string) => void) | undefined;
137
+ theme?: import("../../lib/common").MerchantTheme | undefined;
138
+ color: "white" | "black";
139
+ } | {
140
+ walletPubkey: string | null | undefined;
141
+ transaction: undefined;
142
+ routePrefix: string;
143
+ route: string;
144
+ blockchain: "base";
145
+ token?: string | undefined;
146
+ wallet: import("../../lib/common").EthWallet;
147
+ amount?: string | number | undefined;
148
+ onSuccess?: import("../../lib/common").OnSuccessMethod | undefined;
149
+ webhookInfo?: object | undefined;
150
+ email?: string | undefined;
151
+ chargebackProtectionData?: import("../../lib/common").ChargebackProtectionData | undefined;
152
+ planCode?: string | undefined;
153
+ disableApplePay?: boolean | undefined;
154
+ disableGooglePay?: boolean | undefined;
155
+ customerInfo?: import("../../lib/common").CustomerInfo | undefined;
156
+ settlementType?: import("../../lib/common").SettlementType | undefined;
157
+ authOnly?: boolean | undefined;
158
+ deviceId?: string | undefined;
159
+ jwtToken?: string | undefined;
160
+ origins?: string[] | undefined;
161
+ merchantId: string;
162
+ env?: import("../../lib/common").CoinflowEnvs | undefined;
163
+ loaderBackground?: string | undefined;
164
+ handleHeightChange?: ((height: string) => void) | undefined;
165
+ theme?: import("../../lib/common").MerchantTheme | undefined;
166
+ color: "white" | "black";
167
+ };
168
+ messageHandlers: () => {
169
+ handleHeightChange: ((height: string) => void) | undefined;
170
+ onSuccess: import("../../lib/common").OnSuccessMethod | undefined;
171
+ handleSendTransaction: (transaction: string) => Promise<string>;
172
+ handleSignMessage?: ((message: string) => Promise<string>) | undefined;
173
+ handleSignTransaction?: ((transaction: string) => Promise<string>) | undefined;
174
+ };
175
+ handleMessage: ({ data }: {
176
+ data: string;
177
+ }) => void;
178
+ CoinflowIFrame: import("vue").DefineComponent<{
179
+ args: {
180
+ type: PropType<import("../../lib/common").CoinflowIFrameProps & import("../../lib/common").IFrameMessageHandlers>;
181
+ required: true;
182
+ };
183
+ }, unknown, unknown, {
184
+ url(): string;
185
+ }, {
186
+ sendMessage(message: string): void;
187
+ handleIframeMessages({ data, origin }: {
188
+ data: string;
189
+ origin: string;
190
+ }): void;
191
+ listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
192
+ sendAndReceiveMessage(message: string, isResponseValid: (response: string) => boolean): Promise<string>;
193
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
194
+ onMessage({ data, origin }: {
195
+ data: string;
196
+ origin: string;
197
+ }): true;
198
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
199
+ args: {
200
+ type: PropType<import("../../lib/common").CoinflowIFrameProps & import("../../lib/common").IFrameMessageHandlers>;
201
+ required: true;
202
+ };
203
+ }>> & {
204
+ onOnMessage?: ((args_0: {
205
+ data: string;
206
+ origin: string;
207
+ }) => any) | undefined;
208
+ }, {}, {}>;
209
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
210
+ args: {
211
+ type: PropType<CoinflowPurchaseProps & {
212
+ color: "white" | "black";
213
+ }>;
214
+ required: true;
215
+ };
216
+ route: {
217
+ type: StringConstructor;
218
+ required: true;
219
+ };
220
+ }>>, {}, {}>;
221
+ export default _sfc_main;
package/dist/index.d.ts CHANGED
@@ -3,5 +3,10 @@ import CoinflowWithdraw from "./components/CoinflowWithdraw.vue";
3
3
  import CoinflowPurchase from "./components/CoinflowPurchase.vue";
4
4
  import CoinflowCardNumberInput from "./components/card-form/CoinflowCardNumberInput.vue";
5
5
  import CoinflowCvvInput from "./components/card-form/CoinflowCvvInput.vue";
6
+ import CoinflowCvvOnlyInput from "./components/card-form/CoinflowCvvInput.vue";
7
+ import CoinflowPurchaseProtection from './components/CoinflowPurchaseProtection.vue';
8
+ import CoinflowCardNumberOnlyInput from './components/card-form/CoinflowCardNumberOnlyInput.vue';
9
+ import CoinflowApplePayButton from "./components/mobile-wallet/CoinflowApplePayButton.vue";
10
+ import CoinflowGooglePayButton from "./components/mobile-wallet/CoinflowGooglePayButton.vue";
6
11
  export * from './lib/common';
7
- export { CoinflowIframe, CoinflowWithdraw, CoinflowCvvInput, CoinflowCardNumberInput, CoinflowPurchase };
12
+ export { CoinflowIframe, CoinflowWithdraw, CoinflowCvvInput, CoinflowCardNumberInput, CoinflowPurchase, CoinflowPurchaseProtection, CoinflowCvvOnlyInput, CoinflowCardNumberOnlyInput, CoinflowApplePayButton, CoinflowGooglePayButton };
@@ -123,6 +123,7 @@ export type NearFtTransferCallAction = {
123
123
  };
124
124
  type Bytes = ArrayLike<number>;
125
125
  type BytesLike = Bytes | string;
126
+ type RawProductData = Record<string, string | number | boolean | object>;
126
127
  /** Purchase **/
127
128
  export type ChargebackProtectionData = ChargebackProtectionItem[];
128
129
  export interface ChargebackProtectionItem {
@@ -144,7 +145,7 @@ export interface ChargebackProtectionItem {
144
145
  /**
145
146
  * Any additional data that the store can provide on the product, e.g. description, link to image, etc.
146
147
  */
147
- rawProductData?: Record<string, any>;
148
+ rawProductData?: RawProductData;
148
149
  }
149
150
  export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
150
151
  amount?: number | string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coinflowlabs/vue",
3
3
  "private": false,
4
- "version": "0.1.0",
4
+ "version": "0.2.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "types": "./dist/index.d.ts",
20
20
  "scripts": {
21
- "clean": "rimraf dist",
21
+ "clean": "rimraf dist src/lib",
22
22
  "vue:dev": "vite",
23
23
  "build": "npm run clean && npm run codegen && vue-tsc && vite build",
24
24
  "preview": "vite preview",
25
- "codegen": "mkdir -p ./src/lib/common/ && cp -r ../lib-common/src/ ./src/lib/common/"
25
+ "codegen": "mkdir -p ./src/lib/common/ && copyfiles -u 3 '../lib-common/src/**/*' './src/lib/common'"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "vue": "~3.4.30",
@@ -36,6 +36,7 @@
36
36
  "@vitejs/plugin-vue": "^4.0.0",
37
37
  "@vue/eslint-config-prettier": "^7.0.0",
38
38
  "@vue/eslint-config-typescript": "^11.0.2",
39
+ "copyfiles": "^2.4.1",
39
40
  "eslint": "^8.31.0",
40
41
  "eslint-plugin-vue": "^9.8.0",
41
42
  "prettier": "^2.8.1",