@coinflowlabs/angular 0.1.1 → 0.1.3
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 +3 -18
- package/esm2022/lib/coinflow-iframe.component.mjs +4 -4
- package/esm2022/lib/coinflow-purchase-history.component.mjs +4 -4
- package/esm2022/lib/coinflow-purchase-protection.component.mjs +4 -4
- package/esm2022/lib/coinflow-purchase.component.mjs +4 -4
- package/esm2022/lib/coinflow-withdraw-history.component.mjs +4 -4
- package/esm2022/lib/coinflow-withdraw.component.mjs +4 -4
- package/esm2022/lib/common/CoinflowLibMessageHandlers.mjs +20 -11
- package/esm2022/lib/common/CoinflowTypes.mjs +8 -1
- package/esm2022/lib/common/CoinflowUtils.mjs +10 -13
- package/fesm2022/coinflowlabs-angular.mjs +53 -40
- package/fesm2022/coinflowlabs-angular.mjs.map +1 -1
- package/lib/common/CoinflowLibMessageHandlers.d.ts +13 -3
- package/lib/common/CoinflowTypes.d.ts +33 -9
- package/lib/common/CoinflowUtils.d.ts +1 -1
- package/package.json +2 -2
|
@@ -35,7 +35,7 @@ export interface CustomerInfo {
|
|
|
35
35
|
}
|
|
36
36
|
/** Coinflow Types **/
|
|
37
37
|
export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base';
|
|
38
|
-
export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
|
|
38
|
+
export type CoinflowEnvs = 'prod' | 'staging' | 'staging-live' | 'sandbox' | 'local';
|
|
39
39
|
export interface CoinflowTypes {
|
|
40
40
|
merchantId: string;
|
|
41
41
|
env?: CoinflowEnvs;
|
|
@@ -45,7 +45,10 @@ export interface CoinflowTypes {
|
|
|
45
45
|
theme?: MerchantTheme;
|
|
46
46
|
}
|
|
47
47
|
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
48
|
-
export type OnSuccessMethod = (
|
|
48
|
+
export type OnSuccessMethod = (args: {
|
|
49
|
+
paymentId: string;
|
|
50
|
+
hash?: string | undefined;
|
|
51
|
+
} | string) => void | Promise<void>;
|
|
49
52
|
/** Wallets **/
|
|
50
53
|
export interface SolanaWallet {
|
|
51
54
|
publicKey: PublicKey | null;
|
|
@@ -120,6 +123,7 @@ export type NearFtTransferCallAction = {
|
|
|
120
123
|
};
|
|
121
124
|
type Bytes = ArrayLike<number>;
|
|
122
125
|
type BytesLike = Bytes | string;
|
|
126
|
+
type RawProductData = Record<string, string | number | boolean | object>;
|
|
123
127
|
/** Purchase **/
|
|
124
128
|
export type ChargebackProtectionData = ChargebackProtectionItem[];
|
|
125
129
|
export interface ChargebackProtectionItem {
|
|
@@ -141,9 +145,7 @@ export interface ChargebackProtectionItem {
|
|
|
141
145
|
/**
|
|
142
146
|
* Any additional data that the store can provide on the product, e.g. description, link to image, etc.
|
|
143
147
|
*/
|
|
144
|
-
rawProductData?:
|
|
145
|
-
[key: string]: any;
|
|
146
|
-
};
|
|
148
|
+
rawProductData?: RawProductData;
|
|
147
149
|
}
|
|
148
150
|
export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
149
151
|
amount?: number | string;
|
|
@@ -159,6 +161,15 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
159
161
|
authOnly?: boolean;
|
|
160
162
|
deviceId?: string;
|
|
161
163
|
jwtToken?: string;
|
|
164
|
+
/**
|
|
165
|
+
* If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.
|
|
166
|
+
*
|
|
167
|
+
* Example:
|
|
168
|
+
* Primary origin that will be interacting with the Coinflow iFrame: foo.com
|
|
169
|
+
* Subsequent origins that will render foo.com: bar.com
|
|
170
|
+
* The origin array would then be: [https://foo.com,https://bar.com]
|
|
171
|
+
*/
|
|
172
|
+
origins?: string[];
|
|
162
173
|
}
|
|
163
174
|
export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
164
175
|
wallet: SolanaWallet;
|
|
@@ -168,7 +179,6 @@ export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps
|
|
|
168
179
|
connection: Connection;
|
|
169
180
|
blockchain: 'solana';
|
|
170
181
|
token?: PublicKey | string;
|
|
171
|
-
supportsVersionedTransactions?: boolean;
|
|
172
182
|
rent?: {
|
|
173
183
|
lamports: string | number;
|
|
174
184
|
};
|
|
@@ -209,9 +219,17 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
|
209
219
|
wallet: string;
|
|
210
220
|
blockchain: 'solana' | 'eth' | 'near' | 'polygon';
|
|
211
221
|
}[];
|
|
212
|
-
supportsVersionedTransactions?: boolean;
|
|
213
222
|
lockAmount?: boolean;
|
|
214
223
|
transactionSigner?: string;
|
|
224
|
+
/**
|
|
225
|
+
* If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.
|
|
226
|
+
*
|
|
227
|
+
* Example:
|
|
228
|
+
* Primary origin that will be interacting with the Coinflow iFrame: foo.com
|
|
229
|
+
* Subsequent origins that will render foo.com: bar.com
|
|
230
|
+
* The origin array would then be: [https://foo.com,https://bar.com]
|
|
231
|
+
*/
|
|
232
|
+
origins?: string[];
|
|
215
233
|
}
|
|
216
234
|
export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
217
235
|
wallet: SolanaWallet;
|
|
@@ -267,15 +285,15 @@ type ReservoirItems = ReservoirItem | ReservoirItem[];
|
|
|
267
285
|
export interface ReservoirRedeem extends CommonEvmRedeem {
|
|
268
286
|
type: 'reservoir';
|
|
269
287
|
items: ReservoirItems;
|
|
288
|
+
taker?: string;
|
|
270
289
|
}
|
|
271
290
|
export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem;
|
|
272
|
-
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
|
|
291
|
+
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
|
|
273
292
|
walletPubkey: string | null | undefined;
|
|
274
293
|
route: string;
|
|
275
294
|
routePrefix?: string;
|
|
276
295
|
transaction?: string;
|
|
277
296
|
tokens?: string[] | PublicKey[];
|
|
278
|
-
supportsVersionedTransactions?: boolean;
|
|
279
297
|
nearDeposit?: string;
|
|
280
298
|
merchantCss?: string;
|
|
281
299
|
color?: 'white' | 'black';
|
|
@@ -284,4 +302,10 @@ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>,
|
|
|
284
302
|
theme?: MerchantTheme;
|
|
285
303
|
usePermit?: boolean;
|
|
286
304
|
}
|
|
305
|
+
export declare enum CardType {
|
|
306
|
+
VISA = "VISA",
|
|
307
|
+
MASTERCARD = "MSTR",
|
|
308
|
+
AMEX = "AMEX",
|
|
309
|
+
DISCOVER = "DISC"
|
|
310
|
+
}
|
|
287
311
|
export {};
|
|
@@ -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,
|
|
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, }: CoinflowIFrameProps): string;
|
|
13
13
|
static getTransaction(props: CoinflowPurchaseProps): string | undefined;
|
|
14
14
|
static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
|
|
15
15
|
solana: T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/angular",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^17.3.0",
|
|
6
6
|
"@angular/core": "^17.3.0",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"lz-string": "^1.5.0"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"tslib": "^2.6.
|
|
13
|
+
"tslib": "^2.6.3"
|
|
14
14
|
},
|
|
15
15
|
"peerDependenciesMeta": {
|
|
16
16
|
"@coinflowlabs/lib-common": {
|