@coinflowlabs/angular 0.2.2 → 0.3.1

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.
@@ -34,13 +34,13 @@ export interface CustomerInfo {
34
34
  lng?: string;
35
35
  }
36
36
  /** Coinflow Types **/
37
- export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base' | 'arbitrum';
37
+ export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base' | 'arbitrum' | 'user';
38
38
  export type CoinflowEnvs = 'prod' | 'staging' | 'staging-live' | 'sandbox' | 'local';
39
39
  export interface CoinflowTypes {
40
40
  merchantId: string;
41
41
  env?: CoinflowEnvs;
42
42
  loaderBackground?: string;
43
- blockchain: CoinflowBlockchain;
43
+ blockchain?: CoinflowBlockchain | undefined;
44
44
  handleHeightChange?: (height: string) => void;
45
45
  theme?: MerchantTheme;
46
46
  }
@@ -97,12 +97,17 @@ export interface CoinflowSolanaHistoryProps extends CoinflowTypes {
97
97
  connection: Connection;
98
98
  blockchain: 'solana';
99
99
  }
100
+ export interface CoinflowSessionKeyHistoryProps extends CoinflowTypes {
101
+ sessionKey: string;
102
+ blockchain?: undefined;
103
+ }
100
104
  export interface CoinflowNearHistoryProps extends CoinflowTypes {
101
105
  wallet: NearWallet;
102
106
  blockchain: 'near';
103
107
  }
104
108
  export interface CoinflowEvmHistoryProps extends CoinflowTypes {
105
109
  wallet: EthWallet;
110
+ blockchain: 'eth' | 'polygon' | 'base' | 'arbitrum';
106
111
  }
107
112
  export interface CoinflowEthHistoryProps extends CoinflowEvmHistoryProps {
108
113
  blockchain: 'eth';
@@ -116,7 +121,7 @@ export interface CoinflowBaseHistoryProps extends CoinflowEvmHistoryProps {
116
121
  export interface CoinflowArbitrumHistoryProps extends CoinflowEvmHistoryProps {
117
122
  blockchain: 'arbitrum';
118
123
  }
119
- export type CoinflowHistoryProps = CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowPolygonHistoryProps | CoinflowEthHistoryProps | CoinflowBaseHistoryProps | CoinflowArbitrumHistoryProps;
124
+ export type CoinflowHistoryProps = CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowPolygonHistoryProps | CoinflowEthHistoryProps | CoinflowBaseHistoryProps | CoinflowArbitrumHistoryProps | CoinflowSessionKeyHistoryProps;
120
125
  /** Transactions **/
121
126
  export type NearFtTransferCallAction = {
122
127
  methodName: 'ft_transfer_call';
@@ -169,6 +174,10 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
169
174
  authOnly?: boolean;
170
175
  deviceId?: string;
171
176
  jwtToken?: string;
177
+ /**
178
+ * Your company email address that the customer can contact.
179
+ */
180
+ supportEmail?: string;
172
181
  /**
173
182
  * If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.
174
183
  *
@@ -195,6 +204,11 @@ export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps
195
204
  lamports: string | number;
196
205
  };
197
206
  }
207
+ export interface CoinflowSessionKeyPurchaseProps extends CoinflowCommonPurchaseProps {
208
+ sessionKey: string;
209
+ wallet?: undefined;
210
+ blockchain?: CoinflowBlockchain | undefined;
211
+ }
198
212
  export interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {
199
213
  wallet: NearWallet;
200
214
  blockchain: 'near';
@@ -218,7 +232,7 @@ export interface CoinflowBasePurchaseProps extends CoinflowEvmPurchaseProps {
218
232
  export interface CoinflowArbitrumPurchaseProps extends CoinflowEvmPurchaseProps {
219
233
  blockchain: 'arbitrum';
220
234
  }
221
- export type CoinflowPurchaseProps = CoinflowSolanaPurchaseProps | CoinflowNearPurchaseProps | CoinflowPolygonPurchaseProps | CoinflowEthPurchaseProps | CoinflowBasePurchaseProps | CoinflowArbitrumPurchaseProps;
235
+ export type CoinflowPurchaseProps = CoinflowSolanaPurchaseProps | CoinflowSessionKeyPurchaseProps | CoinflowNearPurchaseProps | CoinflowPolygonPurchaseProps | CoinflowEthPurchaseProps | CoinflowBasePurchaseProps | CoinflowArbitrumPurchaseProps;
222
236
  /** Withdraw **/
223
237
  export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
224
238
  onSuccess?: OnSuccessMethod;
@@ -243,33 +257,45 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
243
257
  */
244
258
  origins?: string[];
245
259
  }
246
- export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
260
+ export type WalletTypes = SolanaWallet | NearWallet | EthWallet;
261
+ export interface SolanaWalletProps {
247
262
  wallet: SolanaWallet;
248
263
  connection: Connection;
249
264
  blockchain: 'solana';
250
265
  }
251
- export interface CoinflowNearWithdrawProps extends CoinflowCommonWithdrawProps {
266
+ export type CoinflowSolanaWithdrawProps = CoinflowCommonWithdrawProps & SolanaWalletProps;
267
+ export interface NearWalletProps {
252
268
  wallet: NearWallet;
253
269
  blockchain: 'near';
254
270
  }
255
- export interface CoinflowEvmWithdrawProps extends CoinflowCommonWithdrawProps {
271
+ export type CoinflowNearWithdrawProps = CoinflowCommonWithdrawProps & NearWalletProps;
272
+ interface EvmWalletProps {
256
273
  wallet: EthWallet;
257
274
  usePermit?: boolean;
258
275
  }
259
- export interface CoinflowEthWithdrawProps extends CoinflowEvmWithdrawProps {
276
+ type CoinflowEvmWithdrawProps = CoinflowCommonWithdrawProps & EvmWalletProps;
277
+ export interface EthWalletProps {
260
278
  blockchain: 'eth';
261
- usePermit?: boolean;
262
279
  }
263
- export interface CoinflowPolygonWithdrawProps extends CoinflowEvmWithdrawProps {
280
+ export type CoinflowEthWithdrawProps = CoinflowEvmWithdrawProps & EthWalletProps;
281
+ export interface PolygonWalletProps {
264
282
  blockchain: 'polygon';
265
283
  }
266
- export interface CoinflowBaseWithdrawProps extends CoinflowEvmWithdrawProps {
284
+ export type CoinflowPolygonWithdrawProps = CoinflowEvmWithdrawProps & PolygonWalletProps;
285
+ export interface BaseWalletProps {
267
286
  blockchain: 'base';
268
287
  }
269
- export interface CoinflowArbitrumWithdrawProps extends CoinflowEvmWithdrawProps {
288
+ export type CoinflowBaseWithdrawProps = CoinflowEvmWithdrawProps & BaseWalletProps;
289
+ export interface ArbitrumWalletProps {
270
290
  blockchain: 'arbitrum';
271
291
  }
272
- export type CoinflowWithdrawProps = CoinflowSolanaWithdrawProps | CoinflowNearWithdrawProps | CoinflowEthWithdrawProps | CoinflowPolygonWithdrawProps | CoinflowBaseWithdrawProps | CoinflowArbitrumWithdrawProps;
292
+ export type CoinflowArbitrumWithdrawProps = CoinflowEvmWithdrawProps & ArbitrumWalletProps;
293
+ export interface CoinflowSessionKeyWithdrawProps extends CoinflowCommonWithdrawProps {
294
+ sessionKey: string;
295
+ signer: SolanaWalletProps | NearWalletProps | EthWalletProps | PolygonWalletProps | BaseWalletProps | ArbitrumWalletProps;
296
+ blockchain?: undefined;
297
+ }
298
+ export type CoinflowWithdrawProps = CoinflowSolanaWithdrawProps | CoinflowNearWithdrawProps | CoinflowEthWithdrawProps | CoinflowPolygonWithdrawProps | CoinflowBaseWithdrawProps | CoinflowArbitrumWithdrawProps | CoinflowSessionKeyWithdrawProps;
273
299
  export interface CommonEvmRedeem {
274
300
  waitForHash?: boolean;
275
301
  }
@@ -307,8 +333,9 @@ export interface TokenRedeem extends CommonEvmRedeem {
307
333
  destination: string;
308
334
  }
309
335
  export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem;
310
- export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
336
+ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
311
337
  walletPubkey: string | null | undefined;
338
+ sessionKey?: string;
312
339
  route: string;
313
340
  routePrefix?: string;
314
341
  transaction?: string;
@@ -9,7 +9,7 @@ export declare class CoinflowUtils {
9
9
  }>;
10
10
  static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
11
11
  static getCoinflowApiUrl(env?: CoinflowEnvs): string;
12
- static getCoinflowUrl({ walletPubkey, route, routePrefix, env, amount, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChange, bankAccountLinkRedirect, additionalWallets, nearDeposit, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, token, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, }: CoinflowIFrameProps): string;
12
+ static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, amount, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChange, bankAccountLinkRedirect, additionalWallets, nearDeposit, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, token, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, }: CoinflowIFrameProps): string;
13
13
  static getTransaction(props: CoinflowPurchaseProps): string | undefined;
14
14
  static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
15
15
  solana: T;
@@ -18,6 +18,7 @@ export declare class CoinflowUtils {
18
18
  polygon: T;
19
19
  base: T;
20
20
  arbitrum: T;
21
+ user: T;
21
22
  }): T;
22
23
  static getWalletFromUserId({ userId, merchantId, env, }: {
23
24
  userId: string;
@@ -3,6 +3,7 @@ import * as i0 from "@angular/core";
3
3
  export declare class CoinflowApplePayButtonComponent {
4
4
  purchaseProps: CoinflowPurchaseProps & {
5
5
  color: 'white' | 'black';
6
+ onError?: (message: string) => void;
6
7
  };
7
8
  fill(): "#000" | "#FFF";
8
9
  static ɵfac: i0.ɵɵFactoryDeclaration<CoinflowApplePayButtonComponent, never>;
@@ -3,6 +3,7 @@ import * as i0 from "@angular/core";
3
3
  export declare class CoinflowGooglePayButtonComponent {
4
4
  purchaseProps: CoinflowPurchaseProps & {
5
5
  color: 'white' | 'black';
6
+ onError?: (message: string) => void;
6
7
  };
7
8
  static ɵfac: i0.ɵɵFactoryDeclaration<CoinflowGooglePayButtonComponent, never>;
8
9
  static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowGooglePayButtonComponent, "lib-coinflow-google-pay-button", never, { "purchaseProps": { "alias": "purchaseProps"; "required": false; }; }, {}, never, never, true, never>;
@@ -3,6 +3,7 @@ import * as i0 from "@angular/core";
3
3
  export declare class CoinflowMobileWalletButtonComponent {
4
4
  purchaseProps: CoinflowPurchaseProps & {
5
5
  color: 'white' | 'black';
6
+ onError?: (message: string) => void;
6
7
  };
7
8
  route: string;
8
9
  overlayDisplayOverride: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinflowlabs/angular",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.0",
6
6
  "@angular/core": "^17.3.0",
@@ -11,7 +11,7 @@
11
11
  "tweetnacl": "^1.0.3"
12
12
  },
13
13
  "dependencies": {
14
- "tslib": "^2.7.0"
14
+ "tslib": "^2.8.0"
15
15
  },
16
16
  "peerDependenciesMeta": {
17
17
  "@coinflowlabs/lib-common": {