@coinflowlabs/angular 0.1.2 → 0.1.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"coinflowlabs-angular.mjs","sources":["../../../projects/coinflowlabs/src/lib/common/CoinflowTypes.ts","../../../projects/coinflowlabs/src/lib/common/SolanaPeerDeps.ts","../../../projects/coinflowlabs/src/lib/common/CoinflowUtils.ts","../../../projects/coinflowlabs/src/lib/common/CoinflowLibMessageHandlers.ts","../../../projects/coinflowlabs/src/lib/coinflow-iframe.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase-history.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase-protection.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-withdraw.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-withdraw-history.component.ts","../../../projects/coinflowlabs/src/public-api.ts","../../../projects/coinflowlabs/src/coinflowlabs-angular.ts"],"sourcesContent":["import type {\n Connection,\n VersionedTransaction,\n PublicKey,\n Signer,\n Transaction,\n} from '@solana/web3.js';\n\nexport enum SettlementType {\n Credits = 'Credits',\n USDC = 'USDC',\n Bank = 'Bank',\n}\n\nexport enum MerchantStyle {\n Rounded = 'rounded',\n Sharp = 'sharp',\n Pill = 'pill',\n}\n\nexport type MerchantTheme = {\n primary?: string;\n background?: string;\n backgroundAccent?: string;\n backgroundAccent2?: string;\n textColor?: string;\n textColorAccent?: string;\n textColorAction?: string;\n font?: string;\n style?: MerchantStyle;\n};\n\nexport interface CustomerInfo {\n name?: string;\n verificationId?: string;\n displayName?: string;\n address?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n ip?: string;\n lat?: string;\n lng?: string;\n}\n\n/** Coinflow Types **/\nexport type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base';\nexport type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';\n\nexport interface CoinflowTypes {\n merchantId: string;\n env?: CoinflowEnvs;\n loaderBackground?: string;\n blockchain: CoinflowBlockchain;\n handleHeightChange?: (height: string) => void;\n theme?: MerchantTheme;\n}\n\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport type OnSuccessMethod = (\n args:\n | {\n paymentId: string;\n hash?: string | undefined;\n }\n | string\n) => void | Promise<void>;\n\n/** Wallets **/\nexport interface SolanaWallet {\n publicKey: PublicKey | null;\n signTransaction?: <T extends Transaction | VersionedTransaction>(\n transaction: T\n ) => Promise<T>;\n sendTransaction: <T extends Transaction | VersionedTransaction>(\n transaction: T\n ) => Promise<string>;\n signMessage?: (message: Uint8Array) => Promise<Uint8Array>;\n}\n\nexport interface NearWallet {\n accountId: string;\n signAndSendTransaction: (transaction: unknown) => Promise<{\n transaction: {hash: string};\n }>;\n}\n\ntype AccessList = Array<{address: string; storageKeys: Array<string>}>;\ntype AccessListish =\n | AccessList\n | Array<[string, Array<string>]>\n | Record<string, Array<string>>;\n\nexport type EthWallet = {\n address: string | null | undefined;\n sendTransaction: (transaction: {\n to: string;\n from?: string;\n nonce?: Bytes | bigint | string | number;\n\n gasLimit?: Bytes | bigint | string | number;\n gasPrice?: Bytes | bigint | string | number;\n\n data?: BytesLike;\n value?: Bytes | bigint | string | number;\n chainId?: number;\n\n type?: number;\n accessList?: AccessListish;\n\n maxPriorityFeePerGas?: Bytes | bigint | string | number;\n maxFeePerGas?: Bytes | bigint | string | number;\n\n customData?: Record<string, any>;\n ccipReadEnabled?: boolean;\n }) => Promise<{hash: string}>;\n signMessage: (message: string) => Promise<string>;\n};\n\n/** History **/\nexport interface CoinflowSolanaHistoryProps extends CoinflowTypes {\n wallet: SolanaWallet;\n connection: Connection;\n blockchain: 'solana';\n}\n\nexport interface CoinflowNearHistoryProps extends CoinflowTypes {\n wallet: NearWallet;\n blockchain: 'near';\n}\n\nexport interface CoinflowEvmHistoryProps extends CoinflowTypes {\n wallet: EthWallet;\n}\n\nexport interface CoinflowEthHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'eth';\n}\n\nexport interface CoinflowPolygonHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowBaseHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'base';\n}\n\nexport type CoinflowHistoryProps =\n | CoinflowSolanaHistoryProps\n | CoinflowNearHistoryProps\n | CoinflowPolygonHistoryProps\n | CoinflowEthHistoryProps\n | CoinflowBaseHistoryProps;\n\n/** Transactions **/\n\nexport type NearFtTransferCallAction = {\n methodName: 'ft_transfer_call';\n args: object;\n gas: string;\n deposit: string;\n};\n\ntype Bytes = ArrayLike<number>;\ntype BytesLike = Bytes | string;\n\n/** Purchase **/\n\nexport type ChargebackProtectionData = ChargebackProtectionItem[];\n\nexport interface ChargebackProtectionItem {\n /**\n * The name of the product\n */\n productName: string;\n /**\n * The product type. Possible values include: inGameProduct, gameOfSkill, dataStorage, computingResources, sportsTicket, eSportsTicket, musicTicket, conferenceTicket, virtualSportsTicket, virtualESportsTicket, virtualMusicTicket, virtualConferenceTicket, alcohol, DLC, subscription, fundACause, realEstate, computingContract, digitalArt, topUp\n */\n productType:\n | 'inGameProduct'\n | 'gameOfSkill'\n | 'dataStorage'\n | 'computingResources'\n | 'sportsTicket'\n | 'eSportsTicket'\n | 'musicTicket'\n | 'conferenceTicket'\n | 'virtualSportsTicket'\n | 'virtualESportsTicket'\n | 'virtualMusicTicket'\n | 'virtualConferenceTicket'\n | 'alcohol'\n | 'DLC'\n | 'subscription'\n | 'fundACause'\n | 'realEstate'\n | 'computingContract'\n | 'digitalArt'\n | 'topUp'\n | 'ownershipContract';\n /**\n * The item's list price\n */\n /**\n * The number of units sold\n */\n quantity: number;\n /**\n * Any additional data that the store can provide on the product, e.g. description, link to image, etc.\n */\n rawProductData?: {[key: string]: any};\n}\n\nexport interface CoinflowCommonPurchaseProps extends CoinflowTypes {\n amount?: number | string;\n onSuccess?: OnSuccessMethod;\n webhookInfo?: object;\n email?: string;\n chargebackProtectionData?: ChargebackProtectionData;\n planCode?: string;\n disableApplePay?: boolean;\n disableGooglePay?: boolean;\n customerInfo?: CustomerInfo;\n settlementType?: SettlementType;\n authOnly?: boolean;\n deviceId?: string;\n jwtToken?: string;\n}\n\nexport interface CoinflowSolanaPurchaseProps\n extends CoinflowCommonPurchaseProps {\n wallet: SolanaWallet;\n transaction?: Transaction | VersionedTransaction;\n partialSigners?: Signer[];\n debugTx?: boolean;\n connection: Connection;\n blockchain: 'solana';\n token?: PublicKey | string;\n supportsVersionedTransactions?: boolean;\n rent?: {lamports: string | number};\n nativeSolToConvert?: {lamports: string | number};\n}\n\nexport interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {\n wallet: NearWallet;\n blockchain: 'near';\n action?: NearFtTransferCallAction;\n nearDeposit?: string;\n}\n\nexport interface CoinflowEvmPurchaseProps extends CoinflowCommonPurchaseProps {\n transaction?: EvmTransactionData;\n token?: string;\n wallet: EthWallet;\n}\n\nexport interface CoinflowPolygonPurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowEthPurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'eth';\n}\n\nexport interface CoinflowBasePurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'base';\n}\n\nexport type CoinflowPurchaseProps =\n | CoinflowSolanaPurchaseProps\n | CoinflowNearPurchaseProps\n | CoinflowPolygonPurchaseProps\n | CoinflowEthPurchaseProps\n | CoinflowBasePurchaseProps;\n\n/** Withdraw **/\n\nexport interface CoinflowCommonWithdrawProps extends CoinflowTypes {\n onSuccess?: OnSuccessMethod;\n tokens?: string[];\n lockDefaultToken?: boolean;\n amount?: number;\n email?: string;\n bankAccountLinkRedirect?: string;\n additionalWallets?: {\n wallet: string;\n blockchain: 'solana' | 'eth' | 'near' | 'polygon';\n }[];\n supportsVersionedTransactions?: boolean;\n lockAmount?: boolean;\n transactionSigner?: string;\n}\n\nexport interface CoinflowSolanaWithdrawProps\n extends CoinflowCommonWithdrawProps {\n wallet: SolanaWallet;\n connection: Connection;\n blockchain: 'solana';\n}\n\nexport interface CoinflowNearWithdrawProps extends CoinflowCommonWithdrawProps {\n wallet: NearWallet;\n blockchain: 'near';\n}\n\nexport interface CoinflowEvmWithdrawProps extends CoinflowCommonWithdrawProps {\n wallet: EthWallet;\n usePermit?: boolean;\n}\n\nexport interface CoinflowEthWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'eth';\n usePermit?: boolean;\n}\n\nexport interface CoinflowPolygonWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowBaseWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'base';\n}\n\nexport type CoinflowWithdrawProps =\n | CoinflowSolanaWithdrawProps\n | CoinflowNearWithdrawProps\n | CoinflowEthWithdrawProps\n | CoinflowPolygonWithdrawProps\n | CoinflowBaseWithdrawProps;\n\nexport interface CommonEvmRedeem {\n waitForHash?: boolean;\n}\n\nexport interface NormalRedeem extends CommonEvmRedeem {\n transaction: {to: string; data: string};\n}\n\nexport interface KnownTokenIdRedeem extends NormalRedeem {\n nftContract: string;\n nftId: string;\n}\n\nexport interface SafeMintRedeem extends NormalRedeem {\n type: 'safeMint';\n nftContract?: string;\n}\n\nexport interface ReturnedTokenIdRedeem extends NormalRedeem {\n type: 'returned';\n nftContract?: string;\n}\n\ntype ReservoirNftIdItem = Omit<KnownTokenIdRedeem, keyof NormalRedeem>;\ninterface ReservoirOrderIdItem {\n orderId: string;\n}\ntype ReservoirItem = ReservoirNftIdItem | ReservoirOrderIdItem;\ntype ReservoirItems = ReservoirItem | ReservoirItem[];\n\nexport interface ReservoirRedeem extends CommonEvmRedeem {\n type: 'reservoir';\n items: ReservoirItems;\n}\n\nexport type EvmTransactionData =\n | SafeMintRedeem\n | ReturnedTokenIdRedeem\n | ReservoirRedeem\n | KnownTokenIdRedeem\n | NormalRedeem;\n\nexport interface CoinflowIFrameProps\n extends Omit<CoinflowTypes, 'merchantId'>,\n Pick<\n CoinflowCommonPurchaseProps,\n | 'chargebackProtectionData'\n | 'webhookInfo'\n | 'amount'\n | 'customerInfo'\n | 'settlementType'\n | 'email'\n | 'planCode'\n | 'deviceId'\n | 'jwtToken'\n >,\n Pick<\n CoinflowCommonWithdrawProps,\n | 'bankAccountLinkRedirect'\n | 'additionalWallets'\n | 'transactionSigner'\n | 'lockAmount'\n | 'lockDefaultToken'\n >,\n Pick<CoinflowEvmPurchaseProps, 'authOnly'>,\n Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {\n walletPubkey: string | null | undefined;\n route: string;\n routePrefix?: string;\n transaction?: string;\n tokens?: string[] | PublicKey[];\n supportsVersionedTransactions?: boolean;\n nearDeposit?: string;\n merchantCss?: string;\n color?: 'white' | 'black';\n disableApplePay?: boolean;\n disableGooglePay?: boolean;\n theme?: MerchantTheme;\n usePermit?: boolean;\n}\n","// This works in angular, but not react\n// let web3: typeof import('@solana/web3.js') | undefined;\n// let base58: typeof import('bs58') | undefined;\n//\n// try {\n// web3 = require('@solana/web3.js');\n// base58 = require('bs58');\n// } catch (e) {}\n//\n// export {web3, base58};\n\n// This works in react, but not angular\nimport * as SolanaWeb3Js from '@solana/web3.js';\nimport base58Imported from 'bs58';\n\nconst web3: typeof SolanaWeb3Js | undefined = SolanaWeb3Js;\nconst base58: typeof base58Imported | undefined = base58Imported;\nexport {web3, base58};\n","import {\n CoinflowBlockchain,\n CoinflowEnvs,\n CoinflowIFrameProps,\n CoinflowPurchaseProps,\n} from './CoinflowTypes';\nimport {web3, base58} from './SolanaPeerDeps';\nimport LZString from 'lz-string';\n\nexport class CoinflowUtils {\n env: CoinflowEnvs;\n url: string;\n\n constructor(env?: CoinflowEnvs) {\n this.env = env ?? 'prod';\n if (this.env === 'prod') this.url = 'https://api.coinflow.cash';\n else if (this.env === 'local') this.url = 'http://localhost:5000';\n else this.url = `https://api-${this.env}.coinflow.cash`;\n }\n\n async getNSurePartnerId(merchantId: string): Promise<string | undefined> {\n return fetch(this.url + `/merchant/view/${merchantId}`)\n .then(response => response.json())\n .then(\n (json: {\n nSurePartnerId: string | undefined;\n nSureSettings: {nSurePartnerId: string | undefined};\n }) => json.nSureSettings?.nSurePartnerId || json.nSurePartnerId\n )\n .catch(e => {\n console.error(e);\n return undefined;\n });\n }\n\n async getCreditBalance(\n publicKey: string,\n merchantId: string,\n blockchain: 'solana' | 'near'\n ): Promise<{cents: number}> {\n const response = await fetch(\n this.url + `/api/customer/balances/${merchantId}`,\n {\n method: 'GET',\n headers: {\n 'x-coinflow-auth-wallet': publicKey,\n 'x-coinflow-auth-blockchain': blockchain,\n },\n }\n );\n const {credits} = await response.json();\n return credits;\n }\n\n static getCoinflowBaseUrl(env?: CoinflowEnvs): string {\n if (!env || env === 'prod') return 'https://coinflow.cash';\n if (env === 'local') return 'http://localhost:3000';\n\n return `https://${env}.coinflow.cash`;\n }\n\n static getCoinflowApiUrl(env?: CoinflowEnvs): string {\n if (!env || env === 'prod') return 'https://api.coinflow.cash';\n if (env === 'local') return 'http://localhost:5000';\n\n return `https://api-${env}.coinflow.cash`;\n }\n\n static getCoinflowUrl({\n walletPubkey,\n route,\n routePrefix,\n env,\n amount,\n transaction,\n blockchain,\n supportsVersionedTransactions,\n webhookInfo,\n email,\n loaderBackground,\n handleHeightChange,\n bankAccountLinkRedirect,\n additionalWallets,\n nearDeposit,\n chargebackProtectionData,\n merchantCss,\n color,\n rent,\n lockDefaultToken,\n token,\n tokens,\n planCode,\n disableApplePay,\n disableGooglePay,\n customerInfo,\n settlementType,\n lockAmount,\n nativeSolToConvert,\n theme,\n usePermit,\n transactionSigner,\n authOnly,\n deviceId,\n jwtToken,\n }: CoinflowIFrameProps): string {\n const prefix = routePrefix\n ? `/${routePrefix}/${blockchain}`\n : `/${blockchain}`;\n const url = new URL(prefix + route, CoinflowUtils.getCoinflowBaseUrl(env));\n url.searchParams.append('pubkey', walletPubkey!);\n\n if (transaction) {\n url.searchParams.append('transaction', transaction);\n }\n if (amount) {\n url.searchParams.append('amount', amount.toString());\n }\n\n if (supportsVersionedTransactions) {\n url.searchParams.append('supportsVersionedTransactions', 'true');\n }\n\n if (webhookInfo) {\n url.searchParams.append(\n 'webhookInfo',\n LZString.compressToEncodedURIComponent(JSON.stringify(webhookInfo))\n );\n }\n\n if (theme) {\n url.searchParams.append(\n 'theme',\n LZString.compressToEncodedURIComponent(JSON.stringify(theme))\n );\n }\n\n if (customerInfo) {\n url.searchParams.append(\n 'customerInfo',\n LZString.compressToEncodedURIComponent(JSON.stringify(customerInfo))\n );\n }\n\n if (email) {\n url.searchParams.append('email', email);\n }\n\n if (token) {\n url.searchParams.append('token', token.toString());\n }\n\n if (tokens) {\n url.searchParams.append('tokens', tokens.toString());\n }\n\n if (loaderBackground) {\n url.searchParams.append('loaderBackground', loaderBackground);\n }\n\n if (handleHeightChange) {\n url.searchParams.append('useHeightChange', 'true');\n }\n\n if (bankAccountLinkRedirect) {\n url.searchParams.append(\n 'bankAccountLinkRedirect',\n bankAccountLinkRedirect\n );\n }\n\n if (additionalWallets)\n url.searchParams.append(\n 'additionalWallets',\n LZString.compressToEncodedURIComponent(\n JSON.stringify(additionalWallets)\n )\n );\n\n if (nearDeposit) url.searchParams.append('nearDeposit', nearDeposit);\n\n if (chargebackProtectionData)\n url.searchParams.append(\n 'chargebackProtectionData',\n LZString.compressToEncodedURIComponent(\n JSON.stringify(chargebackProtectionData)\n )\n );\n if (deviceId) {\n url.searchParams.append('deviceId', deviceId);\n } else {\n if (typeof window !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const deviceId = window?.nSureSDK?.getDeviceId();\n if (deviceId) url.searchParams.append('deviceId', deviceId);\n }\n }\n\n if (merchantCss) url.searchParams.append('merchantCss', merchantCss);\n if (color) url.searchParams.append('color', color);\n if (rent) url.searchParams.append('rent', rent.lamports.toString());\n if (nativeSolToConvert)\n url.searchParams.append(\n 'nativeSolToConvert',\n nativeSolToConvert.lamports.toString()\n );\n if (lockDefaultToken) url.searchParams.append('lockDefaultToken', 'true');\n if (planCode) url.searchParams.append('planCode', planCode);\n\n if (disableApplePay) url.searchParams.append('disableApplePay', 'true');\n if (disableGooglePay) url.searchParams.append('disableGooglePay', 'true');\n if (settlementType)\n url.searchParams.append('settlementType', settlementType);\n\n if (lockAmount) url.searchParams.append('lockAmount', 'true');\n\n if (usePermit === false) url.searchParams.append('usePermit', 'false');\n if (transactionSigner)\n url.searchParams.append('transactionSigner', transactionSigner);\n if (authOnly === true) url.searchParams.append('authOnly', 'true');\n if (jwtToken) url.searchParams.append('jwtToken', jwtToken);\n\n return url.toString();\n }\n\n static getTransaction(props: CoinflowPurchaseProps): string | undefined {\n return this.byBlockchain<() => string | undefined>(props.blockchain, {\n solana: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n if (!web3)\n throw new Error('@solana/web3.js dependency is required for Solana');\n if (!base58) throw new Error('bs58 dependency is required for Solana');\n if (transaction instanceof web3.Transaction)\n return base58.encode(\n transaction.serialize({\n requireAllSignatures: false,\n verifySignatures: false,\n })\n );\n\n if (transaction instanceof web3.VersionedTransaction)\n return base58.encode(transaction.serialize());\n\n return undefined;\n },\n polygon: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n eth: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n base: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n near: () => {\n if (!('action' in props)) return undefined;\n const {action} = props;\n return LZString.compressToEncodedURIComponent(JSON.stringify(action));\n },\n })();\n }\n\n static byBlockchain<T>(\n blockchain: CoinflowBlockchain,\n args: {solana: T; near: T; eth: T; polygon: T; base: T}\n ): T {\n switch (blockchain) {\n case 'solana':\n return args.solana;\n case 'near':\n return args.near;\n case 'polygon':\n return args.polygon;\n case 'eth':\n return args.eth;\n case 'base':\n return args.base;\n default:\n throw new Error('blockchain not supported!');\n }\n }\n}\n","import {\n CoinflowPurchaseProps,\n EthWallet,\n NearWallet,\n OnSuccessMethod,\n SolanaWallet,\n} from './CoinflowTypes';\nimport {CoinflowUtils} from './CoinflowUtils';\nimport type {Transaction, VersionedTransaction} from '@solana/web3.js';\nimport {web3, base58} from './SolanaPeerDeps';\n\nexport type WalletCall =\n | {method: IFrameMessageMethods; data: string}\n | SuccessWalletCall;\n\ntype SuccessWalletCall = {\n method: IFrameMessageMethods.Success;\n data: string;\n info: {paymentId: string; hash?: string};\n};\n\nexport interface IFrameMessageHandlers {\n handleSendTransaction: (transaction: string) => Promise<string>;\n handleSignMessage?: (message: string) => Promise<string>;\n handleSignTransaction?: (transaction: string) => Promise<string>;\n handleHeightChange?: (height: string) => void;\n onSuccess: OnSuccessMethod | undefined;\n}\n\nenum IFrameMessageMethods {\n SignMessage = 'signMessage',\n SignTransaction = 'signTransaction',\n SendTransaction = 'sendTransaction',\n HeightChange = 'heightChange',\n Success = 'success',\n}\n\nexport function getWalletPubkey({\n wallet,\n}: Pick<CoinflowPurchaseProps, 'wallet'>): string | null | undefined {\n if ('publicKey' in wallet) {\n return wallet.publicKey!.toString();\n }\n\n if ('address' in wallet) {\n return wallet.address;\n }\n\n if ('accountId' in wallet) {\n return wallet.accountId;\n }\n\n return null;\n}\n\nexport function handleIFrameMessage(\n rawMessage: string,\n handlers: IFrameMessageHandlers\n): Promise<string> | void {\n let walletCall: WalletCall;\n try {\n walletCall = JSON.parse(rawMessage);\n if (!('method' in walletCall) || !('data' in walletCall)) return;\n } catch (e) {\n console.error('handleIFrameMessage JSON parse', e);\n return;\n }\n\n const {data, method} = walletCall;\n switch (method) {\n case IFrameMessageMethods.SignMessage:\n if (!handlers.handleSignMessage) return;\n return handlers.handleSignMessage(data);\n case IFrameMessageMethods.SignTransaction:\n if (!handlers.handleSignTransaction) return;\n return handlers.handleSignTransaction(data);\n case IFrameMessageMethods.SendTransaction:\n return handlers.handleSendTransaction(data);\n case IFrameMessageMethods.HeightChange:\n if (!handlers.handleHeightChange) return;\n return handlers.handleHeightChange(data);\n case IFrameMessageMethods.Success:\n if (!handlers.onSuccess) return;\n handlers.onSuccess((walletCall as SuccessWalletCall).info);\n return;\n }\n\n console.warn(\n `Didn't expect to get here, handleIFrameMessage method:${method} is not one of ${Object.values(IFrameMessageMethods)}`\n );\n}\n\nexport function getHandlers(\n props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess'>\n): Omit<IFrameMessageHandlers, 'handleHeightChange'> {\n return CoinflowUtils.byBlockchain(props.blockchain, {\n solana: () => getSolanaWalletHandlers(props),\n near: () => getNearWalletHandlers(props),\n eth: () => getEvmWalletHandlers(props),\n polygon: () => getEvmWalletHandlers(props),\n base: () => getEvmWalletHandlers(props),\n })();\n}\n\nfunction getSolanaWalletHandlers({\n wallet,\n onSuccess,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'onSuccess'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n return {\n handleSendTransaction: async (transaction: string) => {\n const tx = getSolanaTransaction(transaction);\n return await (wallet as SolanaWallet).sendTransaction(tx);\n },\n handleSignMessage: async (message: string) => {\n const signMessage = (wallet as SolanaWallet).signMessage;\n if (!signMessage) {\n throw new Error('signMessage is not supported by this wallet');\n }\n\n const signedMessage = await signMessage(\n new TextEncoder().encode(message)\n );\n if (!base58) throw new Error('bs58 dependency is required');\n return base58.encode(signedMessage);\n },\n handleSignTransaction: async (transaction: string) => {\n const signTransaction = (wallet as SolanaWallet).signTransaction;\n if (!signTransaction) {\n throw new Error('signTransaction is not supported by this wallet');\n }\n const tx = getSolanaTransaction(transaction);\n const signedTransaction = await signTransaction(tx);\n if (!base58) throw new Error('bs58 dependency is required');\n return base58.encode(\n signedTransaction.serialize({\n requireAllSignatures: false,\n verifySignatures: false,\n })\n );\n },\n onSuccess,\n };\n}\n\nfunction getSolanaTransaction(\n data: string\n): Transaction | VersionedTransaction {\n if (!web3)\n throw new Error(\n '@solana/web3.js is not defined. Please install @solana/web3.js into your project'\n );\n\n if (!base58)\n throw new Error(\n 'bs58 is not defined. Please install bs58 into your project'\n );\n\n const parsedUInt8Array = base58.decode(data);\n const vtx = web3.VersionedTransaction.deserialize(parsedUInt8Array);\n if (vtx.version === 'legacy') return web3.Transaction.from(parsedUInt8Array);\n return vtx;\n}\n\nfunction getNearWalletHandlers({\n wallet,\n onSuccess,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'onSuccess'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n const nearWallet = wallet as NearWallet;\n return {\n handleSendTransaction: async (transaction: string) => {\n const action = JSON.parse(Buffer.from(transaction, 'base64').toString());\n const executionOutcome = await nearWallet.signAndSendTransaction(action);\n if (!executionOutcome) throw new Error('Transaction did not send');\n const {transaction: transactionResult} = executionOutcome;\n return transactionResult.hash;\n },\n onSuccess,\n };\n}\n\nfunction getEvmWalletHandlers({\n wallet,\n onSuccess,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'onSuccess'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n const evmWallet = wallet as EthWallet;\n return {\n handleSendTransaction: async (transaction: string) => {\n const tx = JSON.parse(Buffer.from(transaction, 'base64').toString());\n const {hash} = await evmWallet.sendTransaction(tx);\n return hash;\n },\n handleSignMessage: async (message: string) => {\n return evmWallet.signMessage(message);\n },\n onSuccess,\n };\n}\n","import {\n Component,\n ElementRef,\n HostListener,\n Input,\n ViewChild,\n} from '@angular/core';\nimport {\n CoinflowIFrameProps,\n CoinflowUtils,\n IFrameMessageHandlers,\n handleIFrameMessage,\n} from './common';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\n\n@Component({\n selector: 'lib-coinflow-iframe',\n standalone: true,\n imports: [],\n template: ` <iframe\n width=\"100%\"\n height=\"100%\"\n #iframe\n scrolling=\"{{ iframeProps?.handleHeightChange ? 'no' : 'yes' }}\"\n allow=\"payment;camera\"\n title=\"withdraw\"\n frameBorder=\"0\"\n [src]=\"dynamicUrl\"\n ></iframe>`,\n})\nexport class CoinflowIFrameComponent {\n @Input() iframeProps!: CoinflowIFrameProps;\n @Input() messageHandlers!: IFrameMessageHandlers;\n\n dynamicUrl?: SafeResourceUrl;\n @ViewChild('iframe') iframe?: ElementRef<HTMLIFrameElement>;\n\n constructor(private sanitizer: DomSanitizer) {}\n\n ngOnInit() {\n const coinflowUrl = CoinflowUtils.getCoinflowUrl(this.iframeProps);\n this.dynamicUrl =\n this.sanitizer.bypassSecurityTrustResourceUrl(coinflowUrl);\n }\n\n @HostListener('window:message', ['$event']) onPostMessage(event: any) {\n if (\n !event.origin.includes(\n CoinflowUtils.getCoinflowBaseUrl(this.iframeProps.env)\n )\n )\n return;\n\n const promise = handleIFrameMessage(event.data, this.messageHandlers);\n if (!promise) return;\n promise\n .then(this.sendMessage.bind(this))\n .catch(e => this.sendMessage('ERROR ' + e.message));\n }\n\n sendMessage(message: string) {\n if (!this.iframe || !this.iframe.nativeElement) return;\n this.iframe.nativeElement.contentWindow!.postMessage(message, '*');\n }\n}\n","import {Component, Input} from '@angular/core';\nimport {CoinflowIFrameComponent} from './coinflow-iframe.component';\nimport {\n CoinflowIFrameProps,\n CoinflowPurchaseProps,\n IFrameMessageHandlers,\n getHandlers,\n getWalletPubkey,\n CoinflowUtils,\n} from './common';\n\n@Component({\n selector: 'lib-coinflow-purchase',\n standalone: true,\n imports: [CoinflowIFrameComponent],\n template:\n ' <lib-coinflow-iframe ng-if=\"iframeProps && messageHandlers\" [iframeProps]=\"iframeProps!\" [messageHandlers]=\"messageHandlers!\"></lib-coinflow-iframe> ',\n})\nexport class CoinflowPurchaseComponent {\n @Input() purchaseProps!: CoinflowPurchaseProps;\n iframeProps?: CoinflowIFrameProps;\n messageHandlers?: IFrameMessageHandlers;\n\n ngOnInit() {\n const walletPubkey = getWalletPubkey(this.purchaseProps);\n this.messageHandlers = getHandlers(this.purchaseProps);\n this.messageHandlers.handleHeightChange =\n this.purchaseProps.handleHeightChange;\n\n this.iframeProps = {\n ...this.purchaseProps,\n walletPubkey,\n route: `/purchase/${this.purchaseProps?.merchantId}`,\n transaction: CoinflowUtils.getTransaction(this.purchaseProps),\n };\n }\n}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-purchase-history',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-purchase-history works!</p> ',\n})\nexport class CoinflowPurchaseHistoryComponent {}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-purchase-protection',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-purchase-protection works!</p> ',\n})\nexport class CoinflowPurchaseProtectionComponent {}\n","import {Component, Input} from '@angular/core';\nimport {\n CoinflowIFrameProps,\n CoinflowWithdrawProps,\n IFrameMessageHandlers,\n getHandlers,\n getWalletPubkey,\n} from './common';\nimport {CoinflowIFrameComponent} from './coinflow-iframe.component';\n\n@Component({\n selector: 'lib-coinflow-withdraw',\n standalone: true,\n imports: [CoinflowIFrameComponent],\n template:\n ' <lib-coinflow-iframe ng-if=\"iframeProps && messageHandlers\" [iframeProps]=\"iframeProps!\" [messageHandlers]=\"messageHandlers!\"></lib-coinflow-iframe> ',\n})\nexport class CoinflowWithdrawComponent {\n @Input() withdrawProps!: CoinflowWithdrawProps;\n iframeProps?: CoinflowIFrameProps;\n messageHandlers?: IFrameMessageHandlers;\n\n ngOnInit() {\n const walletPubkey = getWalletPubkey(this.withdrawProps);\n this.messageHandlers = getHandlers(this.withdrawProps);\n this.messageHandlers.handleHeightChange =\n this.withdrawProps.handleHeightChange;\n\n this.iframeProps = {\n ...this.withdrawProps,\n walletPubkey,\n route: `/withdraw/${this.withdrawProps?.merchantId}`,\n transaction: undefined,\n };\n }\n}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-withdraw-history',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-withdraw-history works!</p> ',\n})\nexport class CoinflowWithdrawHistoryComponent {}\n","/*\n * Public API Surface of coinflowlabs\n */\n\nexport * from './lib/coinflow-iframe.component';\nexport * from './lib/coinflow-purchase.component';\nexport * from './lib/coinflow-purchase-history.component';\nexport * from './lib/coinflow-purchase-protection.component';\nexport * from './lib/coinflow-withdraw.component';\nexport * from './lib/coinflow-withdraw-history.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAQA,IAAY,cAIX,CAAA;AAJD,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,GAIzB,EAAA,CAAA,CAAA,CAAA;AAED,IAAY,aAIX,CAAA;AAJD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,GAIxB,EAAA,CAAA,CAAA;;AClBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA,MAAM,IAAI,GAAoC,YAAY,CAAC;AAC3D,MAAM,MAAM,GAAsC,cAAc;;MCPnD,aAAa,CAAA;AAIxB,IAAA,WAAA,CAAY,GAAkB,EAAA;AAC5B,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,MAAM,CAAC;AACzB,QAAA,I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/common/CoinflowTypes.ts","../../../projects/coinflowlabs/src/lib/common/SolanaPeerDeps.ts","../../../projects/coinflowlabs/src/lib/common/CoinflowUtils.ts","../../../projects/coinflowlabs/src/lib/common/CoinflowLibMessageHandlers.ts","../../../projects/coinflowlabs/src/lib/common/card-form/TokenEx.ts","../../../projects/coinflowlabs/src/lib/common/card-form/tokenexHelpers.ts","../../../projects/coinflowlabs/src/lib/coinflow-iframe.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase-history.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase-protection.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-withdraw.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-withdraw-history.component.ts","../../../projects/coinflowlabs/src/public-api.ts","../../../projects/coinflowlabs/src/coinflowlabs-angular.ts"],"sourcesContent":["import type {\n Connection,\n VersionedTransaction,\n PublicKey,\n Signer,\n Transaction,\n} from '@solana/web3.js';\n\nexport enum SettlementType {\n Credits = 'Credits',\n USDC = 'USDC',\n Bank = 'Bank',\n}\n\nexport enum MerchantStyle {\n Rounded = 'rounded',\n Sharp = 'sharp',\n Pill = 'pill',\n}\n\nexport type MerchantTheme = {\n primary?: string;\n background?: string;\n backgroundAccent?: string;\n backgroundAccent2?: string;\n textColor?: string;\n textColorAccent?: string;\n textColorAction?: string;\n font?: string;\n style?: MerchantStyle;\n};\n\nexport interface CustomerInfo {\n name?: string;\n verificationId?: string;\n displayName?: string;\n address?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n ip?: string;\n lat?: string;\n lng?: string;\n}\n\n/** Coinflow Types **/\nexport type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base';\nexport type CoinflowEnvs =\n | 'prod'\n | 'staging'\n | 'staging-live'\n | 'sandbox'\n | 'local';\n\nexport interface CoinflowTypes {\n merchantId: string;\n env?: CoinflowEnvs;\n loaderBackground?: string;\n blockchain: CoinflowBlockchain;\n handleHeightChange?: (height: string) => void;\n theme?: MerchantTheme;\n}\n\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport type OnSuccessMethod = (\n args:\n | {\n paymentId: string;\n hash?: string | undefined;\n }\n | string\n) => void | Promise<void>;\n\n/** Wallets **/\nexport interface SolanaWallet {\n publicKey: PublicKey | null;\n signTransaction?: <T extends Transaction | VersionedTransaction>(\n transaction: T\n ) => Promise<T>;\n sendTransaction: <T extends Transaction | VersionedTransaction>(\n transaction: T\n ) => Promise<string>;\n signMessage?: (message: Uint8Array) => Promise<Uint8Array>;\n}\n\nexport interface NearWallet {\n accountId: string;\n signAndSendTransaction: (transaction: unknown) => Promise<{\n transaction: {hash: string};\n }>;\n}\n\ntype AccessList = Array<{address: string; storageKeys: Array<string>}>;\ntype AccessListish =\n | AccessList\n | Array<[string, Array<string>]>\n | Record<string, Array<string>>;\n\nexport type EthWallet = {\n address: string | null | undefined;\n sendTransaction: (transaction: {\n to: string;\n from?: string;\n nonce?: Bytes | bigint | string | number;\n\n gasLimit?: Bytes | bigint | string | number;\n gasPrice?: Bytes | bigint | string | number;\n\n data?: BytesLike;\n value?: Bytes | bigint | string | number;\n chainId?: number;\n\n type?: number;\n accessList?: AccessListish;\n\n maxPriorityFeePerGas?: Bytes | bigint | string | number;\n maxFeePerGas?: Bytes | bigint | string | number;\n\n customData?: Record<string, any>;\n ccipReadEnabled?: boolean;\n }) => Promise<{hash: string}>;\n signMessage: (message: string) => Promise<string>;\n};\n\n/** History **/\nexport interface CoinflowSolanaHistoryProps extends CoinflowTypes {\n wallet: SolanaWallet;\n connection: Connection;\n blockchain: 'solana';\n}\n\nexport interface CoinflowNearHistoryProps extends CoinflowTypes {\n wallet: NearWallet;\n blockchain: 'near';\n}\n\nexport interface CoinflowEvmHistoryProps extends CoinflowTypes {\n wallet: EthWallet;\n}\n\nexport interface CoinflowEthHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'eth';\n}\n\nexport interface CoinflowPolygonHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowBaseHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'base';\n}\n\nexport type CoinflowHistoryProps =\n | CoinflowSolanaHistoryProps\n | CoinflowNearHistoryProps\n | CoinflowPolygonHistoryProps\n | CoinflowEthHistoryProps\n | CoinflowBaseHistoryProps;\n\n/** Transactions **/\n\nexport type NearFtTransferCallAction = {\n methodName: 'ft_transfer_call';\n args: object;\n gas: string;\n deposit: string;\n};\n\ntype Bytes = ArrayLike<number>;\ntype BytesLike = Bytes | string;\n\ntype RawProductData = Record<string, string | number | boolean | object>;\n\n/** Purchase **/\n\nexport type ChargebackProtectionData = ChargebackProtectionItem[];\n\nexport interface ChargebackProtectionItem {\n /**\n * The name of the product\n */\n productName: string;\n /**\n * The product type. Possible values include: inGameProduct, gameOfSkill, dataStorage, computingResources, sportsTicket, eSportsTicket, musicTicket, conferenceTicket, virtualSportsTicket, virtualESportsTicket, virtualMusicTicket, virtualConferenceTicket, alcohol, DLC, subscription, fundACause, realEstate, computingContract, digitalArt, topUp\n */\n productType:\n | 'inGameProduct'\n | 'gameOfSkill'\n | 'dataStorage'\n | 'computingResources'\n | 'sportsTicket'\n | 'eSportsTicket'\n | 'musicTicket'\n | 'conferenceTicket'\n | 'virtualSportsTicket'\n | 'virtualESportsTicket'\n | 'virtualMusicTicket'\n | 'virtualConferenceTicket'\n | 'alcohol'\n | 'DLC'\n | 'subscription'\n | 'fundACause'\n | 'realEstate'\n | 'computingContract'\n | 'digitalArt'\n | 'topUp'\n | 'ownershipContract';\n /**\n * The item's list price\n */\n /**\n * The number of units sold\n */\n quantity: number;\n /**\n * Any additional data that the store can provide on the product, e.g. description, link to image, etc.\n */\n rawProductData?: RawProductData;\n}\n\nexport interface CoinflowCommonPurchaseProps extends CoinflowTypes {\n amount?: number | string;\n onSuccess?: OnSuccessMethod;\n webhookInfo?: object;\n email?: string;\n chargebackProtectionData?: ChargebackProtectionData;\n planCode?: string;\n disableApplePay?: boolean;\n disableGooglePay?: boolean;\n customerInfo?: CustomerInfo;\n settlementType?: SettlementType;\n authOnly?: boolean;\n deviceId?: string;\n jwtToken?: string;\n /**\n * If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.\n *\n * Example:\n * Primary origin that will be interacting with the Coinflow iFrame: foo.com\n * Subsequent origins that will render foo.com: bar.com\n * The origin array would then be: [https://foo.com,https://bar.com]\n */\n origins?: string[];\n}\n\nexport interface CoinflowSolanaPurchaseProps\n extends CoinflowCommonPurchaseProps {\n wallet: SolanaWallet;\n transaction?: Transaction | VersionedTransaction;\n partialSigners?: Signer[];\n debugTx?: boolean;\n connection: Connection;\n blockchain: 'solana';\n token?: PublicKey | string;\n rent?: {lamports: string | number};\n nativeSolToConvert?: {lamports: string | number};\n}\n\nexport interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {\n wallet: NearWallet;\n blockchain: 'near';\n action?: NearFtTransferCallAction;\n nearDeposit?: string;\n}\n\nexport interface CoinflowEvmPurchaseProps extends CoinflowCommonPurchaseProps {\n transaction?: EvmTransactionData;\n token?: string;\n wallet: EthWallet;\n}\n\nexport interface CoinflowPolygonPurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowEthPurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'eth';\n}\n\nexport interface CoinflowBasePurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'base';\n}\n\nexport type CoinflowPurchaseProps =\n | CoinflowSolanaPurchaseProps\n | CoinflowNearPurchaseProps\n | CoinflowPolygonPurchaseProps\n | CoinflowEthPurchaseProps\n | CoinflowBasePurchaseProps;\n\n/** Withdraw **/\n\nexport interface CoinflowCommonWithdrawProps extends CoinflowTypes {\n onSuccess?: OnSuccessMethod;\n tokens?: string[];\n lockDefaultToken?: boolean;\n amount?: number;\n email?: string;\n bankAccountLinkRedirect?: string;\n additionalWallets?: {\n wallet: string;\n blockchain: 'solana' | 'eth' | 'near' | 'polygon';\n }[];\n lockAmount?: boolean;\n transactionSigner?: string;\n /**\n * If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.\n *\n * Example:\n * Primary origin that will be interacting with the Coinflow iFrame: foo.com\n * Subsequent origins that will render foo.com: bar.com\n * The origin array would then be: [https://foo.com,https://bar.com]\n */\n origins?: string[];\n}\n\nexport interface CoinflowSolanaWithdrawProps\n extends CoinflowCommonWithdrawProps {\n wallet: SolanaWallet;\n connection: Connection;\n blockchain: 'solana';\n}\n\nexport interface CoinflowNearWithdrawProps extends CoinflowCommonWithdrawProps {\n wallet: NearWallet;\n blockchain: 'near';\n}\n\nexport interface CoinflowEvmWithdrawProps extends CoinflowCommonWithdrawProps {\n wallet: EthWallet;\n usePermit?: boolean;\n}\n\nexport interface CoinflowEthWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'eth';\n usePermit?: boolean;\n}\n\nexport interface CoinflowPolygonWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowBaseWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'base';\n}\n\nexport type CoinflowWithdrawProps =\n | CoinflowSolanaWithdrawProps\n | CoinflowNearWithdrawProps\n | CoinflowEthWithdrawProps\n | CoinflowPolygonWithdrawProps\n | CoinflowBaseWithdrawProps;\n\nexport interface CommonEvmRedeem {\n waitForHash?: boolean;\n}\n\nexport interface NormalRedeem extends CommonEvmRedeem {\n transaction: {to: string; data: string};\n}\n\nexport interface KnownTokenIdRedeem extends NormalRedeem {\n nftContract: string;\n nftId: string;\n}\n\nexport interface SafeMintRedeem extends NormalRedeem {\n type: 'safeMint';\n nftContract?: string;\n}\n\nexport interface ReturnedTokenIdRedeem extends NormalRedeem {\n type: 'returned';\n nftContract?: string;\n}\n\ntype ReservoirNftIdItem = Omit<KnownTokenIdRedeem, keyof NormalRedeem>;\ninterface ReservoirOrderIdItem {\n orderId: string;\n}\ntype ReservoirItem = ReservoirNftIdItem | ReservoirOrderIdItem;\ntype ReservoirItems = ReservoirItem | ReservoirItem[];\n\nexport interface ReservoirRedeem extends CommonEvmRedeem {\n type: 'reservoir';\n items: ReservoirItems;\n taker?: string;\n}\n\nexport interface TokenRedeem extends CommonEvmRedeem {\n type: 'token';\n destination: string;\n}\n\nexport type EvmTransactionData =\n | SafeMintRedeem\n | ReturnedTokenIdRedeem\n | ReservoirRedeem\n | KnownTokenIdRedeem\n | NormalRedeem\n | TokenRedeem;\n\nexport interface CoinflowIFrameProps\n extends Omit<CoinflowTypes, 'merchantId'>,\n Pick<\n CoinflowCommonPurchaseProps,\n | 'chargebackProtectionData'\n | 'webhookInfo'\n | 'amount'\n | 'customerInfo'\n | 'settlementType'\n | 'email'\n | 'planCode'\n | 'deviceId'\n | 'jwtToken'\n | 'origins'\n >,\n Pick<\n CoinflowCommonWithdrawProps,\n | 'bankAccountLinkRedirect'\n | 'additionalWallets'\n | 'transactionSigner'\n | 'lockAmount'\n | 'lockDefaultToken'\n | 'origins'\n >,\n Pick<CoinflowEvmPurchaseProps, 'authOnly'>,\n Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {\n walletPubkey: string | null | undefined;\n route: string;\n routePrefix?: string;\n transaction?: string;\n tokens?: string[] | PublicKey[];\n nearDeposit?: string;\n merchantCss?: string;\n color?: 'white' | 'black';\n disableApplePay?: boolean;\n disableGooglePay?: boolean;\n theme?: MerchantTheme;\n usePermit?: boolean;\n}\n\nexport enum CardType {\n VISA = 'VISA',\n MASTERCARD = 'MSTR',\n AMEX = 'AMEX',\n DISCOVER = 'DISC',\n}\n","// This works in angular, but not react\n// let web3: typeof import('@solana/web3.js') | undefined;\n// let base58: typeof import('bs58') | undefined;\n//\n// try {\n// web3 = require('@solana/web3.js');\n// base58 = require('bs58');\n// } catch (e) {}\n//\n// export {web3, base58};\n\n// This works in react, but not angular\nimport * as SolanaWeb3Js from '@solana/web3.js';\nimport base58Imported from 'bs58';\n\nconst web3: typeof SolanaWeb3Js | undefined = SolanaWeb3Js;\nconst base58: typeof base58Imported | undefined = base58Imported;\nexport {web3, base58};\n","import {\n CoinflowBlockchain,\n CoinflowEnvs,\n CoinflowIFrameProps,\n CoinflowPurchaseProps,\n SolanaWallet,\n} from './CoinflowTypes';\nimport {web3, base58} from './SolanaPeerDeps';\nimport LZString from 'lz-string';\nimport {Keypair, Transaction, VersionedTransaction} from '@solana/web3.js';\nimport {sign} from 'tweetnacl';\n\nexport class CoinflowUtils {\n env: CoinflowEnvs;\n url: string;\n\n constructor(env?: CoinflowEnvs) {\n this.env = env ?? 'prod';\n if (this.env === 'prod') this.url = 'https://api.coinflow.cash';\n else if (this.env === 'local') this.url = 'http://localhost:5000';\n else this.url = `https://api-${this.env}.coinflow.cash`;\n }\n\n async getNSurePartnerId(merchantId: string): Promise<string | undefined> {\n return fetch(this.url + `/merchant/view/${merchantId}`)\n .then(response => response.json())\n .then(\n (json: {\n nSurePartnerId: string | undefined;\n nSureSettings: {nSurePartnerId: string | undefined};\n }) => json.nSureSettings?.nSurePartnerId || json.nSurePartnerId\n )\n .catch(e => {\n console.error(e);\n return undefined;\n });\n }\n\n async getCreditBalance(\n publicKey: string,\n merchantId: string,\n blockchain: 'solana' | 'near'\n ): Promise<{cents: number}> {\n const response = await fetch(\n this.url + `/api/customer/balances/${merchantId}`,\n {\n method: 'GET',\n headers: {\n 'x-coinflow-auth-wallet': publicKey,\n 'x-coinflow-auth-blockchain': blockchain,\n },\n }\n );\n const {credits} = await response.json();\n return credits;\n }\n\n static getCoinflowBaseUrl(env?: CoinflowEnvs): string {\n if (!env || env === 'prod') return 'https://coinflow.cash';\n if (env === 'local') return 'http://localhost:3000';\n\n return `https://${env}.coinflow.cash`;\n }\n\n static getCoinflowApiUrl(env?: CoinflowEnvs): string {\n if (!env || env === 'prod') return 'https://api.coinflow.cash';\n if (env === 'local') return 'http://localhost:5000';\n\n return `https://api-${env}.coinflow.cash`;\n }\n\n static getCoinflowUrl({\n walletPubkey,\n route,\n routePrefix,\n env,\n amount,\n transaction,\n blockchain,\n webhookInfo,\n email,\n loaderBackground,\n handleHeightChange,\n bankAccountLinkRedirect,\n additionalWallets,\n nearDeposit,\n chargebackProtectionData,\n merchantCss,\n color,\n rent,\n lockDefaultToken,\n token,\n tokens,\n planCode,\n disableApplePay,\n disableGooglePay,\n customerInfo,\n settlementType,\n lockAmount,\n nativeSolToConvert,\n theme,\n usePermit,\n transactionSigner,\n authOnly,\n deviceId,\n jwtToken,\n origins,\n }: CoinflowIFrameProps): string {\n const prefix = routePrefix\n ? `/${routePrefix}/${blockchain}`\n : `/${blockchain}`;\n const url = new URL(prefix + route, CoinflowUtils.getCoinflowBaseUrl(env));\n url.searchParams.append('pubkey', walletPubkey!);\n\n if (transaction) {\n url.searchParams.append('transaction', transaction);\n }\n if (amount) {\n url.searchParams.append('amount', amount.toString());\n }\n\n if (webhookInfo) {\n url.searchParams.append(\n 'webhookInfo',\n LZString.compressToEncodedURIComponent(JSON.stringify(webhookInfo))\n );\n }\n\n if (theme) {\n url.searchParams.append(\n 'theme',\n LZString.compressToEncodedURIComponent(JSON.stringify(theme))\n );\n }\n\n if (customerInfo) {\n url.searchParams.append(\n 'customerInfo',\n LZString.compressToEncodedURIComponent(JSON.stringify(customerInfo))\n );\n }\n\n if (email) {\n url.searchParams.append('email', email);\n }\n\n if (token) {\n url.searchParams.append('token', token.toString());\n }\n\n if (tokens) {\n url.searchParams.append('tokens', tokens.toString());\n }\n\n if (loaderBackground) {\n url.searchParams.append('loaderBackground', loaderBackground);\n }\n\n if (handleHeightChange) {\n url.searchParams.append('useHeightChange', 'true');\n }\n\n if (bankAccountLinkRedirect) {\n url.searchParams.append(\n 'bankAccountLinkRedirect',\n bankAccountLinkRedirect\n );\n }\n\n if (additionalWallets)\n url.searchParams.append(\n 'additionalWallets',\n LZString.compressToEncodedURIComponent(\n JSON.stringify(additionalWallets)\n )\n );\n\n if (nearDeposit) url.searchParams.append('nearDeposit', nearDeposit);\n\n if (chargebackProtectionData)\n url.searchParams.append(\n 'chargebackProtectionData',\n LZString.compressToEncodedURIComponent(\n JSON.stringify(chargebackProtectionData)\n )\n );\n if (deviceId) {\n url.searchParams.append('deviceId', deviceId);\n } else {\n if (typeof window !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const deviceId = window?.nSureSDK?.getDeviceId();\n if (deviceId) url.searchParams.append('deviceId', deviceId);\n }\n }\n\n if (merchantCss) url.searchParams.append('merchantCss', merchantCss);\n if (color) url.searchParams.append('color', color);\n if (rent) url.searchParams.append('rent', rent.lamports.toString());\n if (nativeSolToConvert)\n url.searchParams.append(\n 'nativeSolToConvert',\n nativeSolToConvert.lamports.toString()\n );\n if (lockDefaultToken) url.searchParams.append('lockDefaultToken', 'true');\n if (planCode) url.searchParams.append('planCode', planCode);\n\n if (disableApplePay) url.searchParams.append('disableApplePay', 'true');\n if (disableGooglePay) url.searchParams.append('disableGooglePay', 'true');\n if (settlementType)\n url.searchParams.append('settlementType', settlementType);\n\n if (lockAmount) url.searchParams.append('lockAmount', 'true');\n\n if (usePermit === false) url.searchParams.append('usePermit', 'false');\n if (transactionSigner)\n url.searchParams.append('transactionSigner', transactionSigner);\n if (authOnly === true) url.searchParams.append('authOnly', 'true');\n if (jwtToken) url.searchParams.append('jwtToken', jwtToken);\n if (origins)\n url.searchParams.append(\n 'origins',\n LZString.compressToEncodedURIComponent(JSON.stringify(origins))\n );\n\n return url.toString();\n }\n\n static getTransaction(props: CoinflowPurchaseProps): string | undefined {\n return this.byBlockchain<() => string | undefined>(props.blockchain, {\n solana: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n if (!web3)\n throw new Error('@solana/web3.js dependency is required for Solana');\n if (!base58) throw new Error('bs58 dependency is required for Solana');\n if (!transaction) return undefined;\n return base58.encode(\n (transaction as VersionedTransaction | Transaction).serialize({\n requireAllSignatures: false,\n verifySignatures: false,\n })\n );\n },\n polygon: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n eth: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n base: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n near: () => {\n if (!('action' in props)) return undefined;\n const {action} = props;\n return LZString.compressToEncodedURIComponent(JSON.stringify(action));\n },\n })();\n }\n\n static byBlockchain<T>(\n blockchain: CoinflowBlockchain,\n args: {solana: T; near: T; eth: T; polygon: T; base: T}\n ): T {\n switch (blockchain) {\n case 'solana':\n return args.solana;\n case 'near':\n return args.near;\n case 'polygon':\n return args.polygon;\n case 'eth':\n return args.eth;\n case 'base':\n return args.base;\n default:\n throw new Error('blockchain not supported!');\n }\n }\n\n static async getWalletFromEmail({\n email,\n merchantId,\n env,\n }: {\n email: string;\n merchantId: string;\n env: CoinflowEnvs;\n }): Promise<SolanaWallet> {\n const buffer = new TextEncoder().encode(email);\n const crypto = window.crypto.subtle;\n const hash = await crypto.digest('SHA-256', buffer);\n const seed = new Uint8Array(hash);\n const keypair = Keypair.fromSeed(seed);\n return {\n publicKey: keypair.publicKey,\n signMessage: (message: Uint8Array) =>\n Promise.resolve(sign.detached(message, keypair.secretKey)),\n signTransaction: async <T extends Transaction | VersionedTransaction>(\n transaction: T\n ): Promise<T> => {\n if (transaction instanceof Transaction) {\n transaction.sign(keypair);\n return transaction;\n } else {\n transaction.sign([keypair]);\n return transaction;\n }\n },\n sendTransaction: async <T extends Transaction | VersionedTransaction>(\n transaction: T\n ): Promise<string> => {\n if (transaction instanceof Transaction) {\n transaction.sign(keypair);\n } else {\n transaction.sign([keypair]);\n }\n\n const coinflowBaseUrl = this.getCoinflowApiUrl(env);\n const options = {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n 'x-coinflow-auth-wallet': keypair.publicKey.toString(),\n 'x-coinflow-auth-blockchain': 'solana',\n },\n body: JSON.stringify({\n merchantId,\n signedTransaction: base58?.encode(transaction.serialize()),\n }),\n };\n\n const {signature} = await fetch(\n coinflowBaseUrl + '/api/utils/send-coinflow-tx',\n options\n ).then(res => res.json());\n return signature;\n },\n };\n }\n}\n","import {\n CoinflowPurchaseProps,\n EthWallet,\n NearWallet,\n OnSuccessMethod,\n SolanaWallet,\n} from './CoinflowTypes';\nimport {CoinflowUtils} from './CoinflowUtils';\nimport type {Transaction, VersionedTransaction} from '@solana/web3.js';\nimport {web3, base58} from './SolanaPeerDeps';\n\nexport type WalletCall =\n | {method: IFrameMessageMethods; data: string}\n | SuccessWalletCall;\n\ntype SuccessWalletCall = {\n method: IFrameMessageMethods.Success;\n data: string;\n info: {paymentId: string; hash?: string};\n};\n\nexport interface IFrameMessageHandlers {\n handleSendTransaction: (transaction: string) => Promise<string>;\n handleSignMessage?: (message: string) => Promise<string>;\n handleSignTransaction?: (transaction: string) => Promise<string>;\n handleHeightChange?: (height: string) => void;\n onSuccess: OnSuccessMethod | undefined;\n}\n\nenum IFrameMessageMethods {\n SignMessage = 'signMessage',\n SignTransaction = 'signTransaction',\n SendTransaction = 'sendTransaction',\n HeightChange = 'heightChange',\n Success = 'success',\n}\n\nexport function getWalletPubkey({\n wallet,\n}: Pick<CoinflowPurchaseProps, 'wallet'>): string | null | undefined {\n if ('publicKey' in wallet) {\n return wallet.publicKey!.toString();\n }\n\n if ('address' in wallet) {\n return wallet.address;\n }\n\n if ('accountId' in wallet) {\n return wallet.accountId;\n }\n\n return null;\n}\n\nexport function handleIFrameMessage(\n rawMessage: string,\n handlers: IFrameMessageHandlers\n): Promise<string> | void {\n let walletCall: WalletCall;\n try {\n walletCall = JSON.parse(rawMessage);\n if (!('method' in walletCall) || !('data' in walletCall)) return;\n } catch (e) {\n console.error('handleIFrameMessage JSON parse', e);\n return;\n }\n\n const {data, method} = walletCall;\n switch (method) {\n case IFrameMessageMethods.SignMessage:\n if (!handlers.handleSignMessage) return;\n return handlers.handleSignMessage(data);\n case IFrameMessageMethods.SignTransaction:\n if (!handlers.handleSignTransaction) return;\n return handlers.handleSignTransaction(data);\n case IFrameMessageMethods.SendTransaction:\n return handlers.handleSendTransaction(data);\n case IFrameMessageMethods.HeightChange:\n if (!handlers.handleHeightChange) return;\n return handlers.handleHeightChange(data);\n case IFrameMessageMethods.Success:\n if (!handlers.onSuccess) return;\n handlers.onSuccess((walletCall as SuccessWalletCall).info);\n return;\n }\n\n console.warn(\n `Didn't expect to get here, handleIFrameMessage method:${method} is not one of ${Object.values(IFrameMessageMethods)}`\n );\n}\n\nexport function getHandlers(\n props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess'>\n): Omit<IFrameMessageHandlers, 'handleHeightChange'> {\n return CoinflowUtils.byBlockchain(props.blockchain, {\n solana: () => getSolanaWalletHandlers(props),\n near: () => getNearWalletHandlers(props),\n eth: () => getEvmWalletHandlers(props),\n polygon: () => getEvmWalletHandlers(props),\n base: () => getEvmWalletHandlers(props),\n })();\n}\n\nfunction getSolanaWalletHandlers({\n wallet,\n onSuccess,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'onSuccess'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n return {\n handleSendTransaction: async (transaction: string) => {\n const tx = getSolanaTransaction(transaction);\n return await (wallet as SolanaWallet).sendTransaction(tx);\n },\n handleSignMessage: async (message: string) => {\n const signMessage = (wallet as SolanaWallet).signMessage;\n if (!signMessage) {\n throw new Error('signMessage is not supported by this wallet');\n }\n\n const signedMessage = await signMessage(\n new TextEncoder().encode(message)\n );\n if (!base58) throw new Error('bs58 dependency is required');\n return base58.encode(signedMessage);\n },\n handleSignTransaction: async (transaction: string) => {\n const signTransaction = (wallet as SolanaWallet).signTransaction;\n if (!signTransaction) {\n throw new Error('signTransaction is not supported by this wallet');\n }\n const tx = getSolanaTransaction(transaction);\n const signedTransaction = await signTransaction(tx);\n if (!base58) throw new Error('bs58 dependency is required');\n return base58.encode(\n signedTransaction.serialize({\n requireAllSignatures: false,\n verifySignatures: false,\n })\n );\n },\n onSuccess,\n };\n}\n\nfunction getSolanaTransaction(\n data: string\n): Transaction | VersionedTransaction {\n if (!web3)\n throw new Error(\n '@solana/web3.js is not defined. Please install @solana/web3.js into your project'\n );\n\n if (!base58)\n throw new Error(\n 'bs58 is not defined. Please install bs58 into your project'\n );\n\n const parsedUInt8Array = base58.decode(data);\n const vtx = web3.VersionedTransaction.deserialize(parsedUInt8Array);\n if (vtx.version === 'legacy') return web3.Transaction.from(parsedUInt8Array);\n return vtx;\n}\n\nfunction getNearWalletHandlers({\n wallet,\n onSuccess,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'onSuccess'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n const nearWallet = wallet as NearWallet;\n return {\n handleSendTransaction: async (transaction: string) => {\n const action = JSON.parse(Buffer.from(transaction, 'base64').toString());\n const executionOutcome = await nearWallet.signAndSendTransaction(action);\n if (!executionOutcome) throw new Error('Transaction did not send');\n const {transaction: transactionResult} = executionOutcome;\n return transactionResult.hash;\n },\n onSuccess,\n };\n}\n\nfunction getEvmWalletHandlers({\n wallet,\n onSuccess,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'onSuccess'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n const evmWallet = wallet as EthWallet;\n return {\n handleSendTransaction: async (transaction: string) => {\n const tx = JSON.parse(Buffer.from(transaction, 'base64').toString());\n const {hash} = await evmWallet.sendTransaction(tx);\n return hash;\n },\n handleSignMessage: async (message: string) => {\n return evmWallet.signMessage(message);\n },\n onSuccess,\n };\n}\n","// Type definitions for TokenEx iframe integration\n\nimport {CardType, CoinflowEnvs} from '../CoinflowTypes';\nimport {CSSProperties} from 'react';\n\nexport const TokenExCardNumberIframeId = 'tokenExCardNumber';\nexport const TokenExCvvContainerID = 'tokenExCardCvv';\nexport interface TokenExIframe extends ReturnType<typeof TokenEx.Iframe> {\n tokenize: () => Promise<TokenizationResponse>;\n}\n\nexport const CARD_TYPE_MAPPING: Record<CardType, string> = {\n [CardType.VISA]: 'visa',\n [CardType.MASTERCARD]: 'masterCard',\n [CardType.AMEX]: 'americanExpress',\n [CardType.DISCOVER]: 'discover',\n};\n\nexport interface TokenExIFrameConfiguration {\n origin: string;\n timestamp: string;\n tokenExID: string;\n tokenScheme: string;\n authenticationKey: string;\n pci: true;\n token?: string;\n}\n\nexport interface CardFormInputStyles {\n base: CSSProperties | string;\n placeholder?: CSSProperties | string;\n focus?: CSSProperties | string;\n error?: CSSProperties | string;\n}\n\nexport type CoinflowCardTokenResponse = {\n token: string;\n};\n\nexport interface CoinflowCardNumberInputProps {\n env: CoinflowEnvs;\n css: CardFormInputStyles & {cvv: CardFormInputStyles};\n debug?: boolean;\n origins?: string[];\n font?: string;\n}\n\nexport interface CoinflowCvvOnlyInputProps {\n token: string;\n cardType: CardType;\n env: CoinflowEnvs;\n css: CardFormInputStyles & {cvv: CardFormInputStyles};\n debug?: boolean;\n origins?: string[];\n font?: string;\n}\n\nexport interface TokenizationResponse {\n cardType: string;\n cvvIncluded: true;\n firstSix: string;\n lastFour: string;\n referenceNumber: string;\n token: string;\n tokenHMAC: string;\n}\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace TokenEx {\n interface FraudServicesConfig {\n useKount?: boolean;\n kount?: {\n merchantId?: string;\n mode?: string;\n anId?: string;\n };\n }\n\n interface Config {\n debug?: boolean;\n enablePrettyFormat?: boolean;\n maskInput?: boolean;\n enableValidateOnBlur?: boolean;\n enableAriaRequired?: boolean;\n pci?: boolean;\n cvvOnly?: boolean;\n allowUnknownCardTypes?: boolean;\n enableAutoComplete?: boolean;\n returnAutoCompleteValues?: boolean;\n returnKhash?: boolean;\n returnWhash?: boolean;\n enforceLuhnCompliance?: boolean;\n use3DS?: boolean;\n enableValidateOnKeyUp?: boolean;\n enableValidateOnCvvKeyUp?: boolean;\n expiresInSeconds?: number;\n useExtendedBIN?: boolean;\n inlineIframeJavaScript?: boolean;\n iframeVersion?: number;\n authenticationKey?: string;\n origin?: string;\n tokenExID?: string;\n timestamp?: string;\n tokenScheme?: string;\n token?: string;\n customDataLabel?: string;\n customCvvDataLabel?: string;\n title?: string;\n cvvTitle?: string;\n inputTitle?: string;\n cvvInputTitle?: string;\n cardMaxLengths?: {\n visa?: number;\n mastercard?: number;\n americanExpress?: number;\n discover?: number;\n jcb?: number;\n diners?: number;\n };\n fraudServices?: FraudServicesConfig;\n threeDSMethodNotificationUrl?: string;\n customDataTypes?: string | object;\n cvvContainerID?: string;\n cvvPlaceholder?: string;\n cardType?: string;\n forterSiteId?: string;\n forterUsername?: string;\n customRegEx?: string;\n placeholder?: string;\n inputType?: string;\n inputMode?: string;\n font?: string;\n cvv?: boolean;\n styles: {\n base: string;\n focus: string;\n error: string;\n placeholder: string;\n cvv: {base: string; focus: string; placeholder: string; error: string};\n };\n }\n\n interface IframeAPI {\n load(): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on: (event: string, callback: (data?: any) => void) => void;\n\n tokenize(): void;\n\n validate(): void;\n\n reset(): void;\n\n blur(): void;\n\n cvvBlur(): void;\n\n focus(): void;\n\n cvvFocus(): void;\n\n remove(): void;\n\n toggleMask(): void;\n\n toggleCvvMask(): void;\n\n setPAN(pan: string): void;\n\n binLookup(): void;\n\n validateConfig(): void;\n\n setFraudServicesRequestDetails(data: string): void;\n }\n\n function Iframe(containerID: string, configuration: Config): IframeAPI;\n }\n}\n","import {CSSProperties} from 'react';\nimport {\n TokenizationResponse,\n TokenExCvvContainerID,\n TokenExIframe,\n TokenExIFrameConfiguration,\n CARD_TYPE_MAPPING,\n TokenExCardNumberIframeId,\n} from './TokenEx';\nimport {CoinflowUtils} from '../CoinflowUtils';\nimport {CardType, CoinflowEnvs} from '../CoinflowTypes';\n\nexport interface DoInitializeTokenExIframeArgs {\n css: string;\n debug?: boolean;\n font?: string;\n origins: string[] | undefined;\n tokenExScriptLoaded: boolean;\n env: CoinflowEnvs;\n setCachedToken: (s: string | undefined) => void;\n setLoaded: (b: boolean) => void;\n}\n\nexport interface DoInitializeCvvOnlyTokenExIframeArgs\n extends DoInitializeTokenExIframeArgs {\n token: string;\n cardType: CardType;\n}\n\nexport async function getIframeConfig({\n token,\n origins,\n env,\n}: {\n token?: string;\n origins: string[] | undefined;\n env: CoinflowEnvs;\n}): Promise<TokenExIFrameConfiguration> {\n return new Promise((resolve, reject) => {\n fetch(new CoinflowUtils(env).url + '/api/checkout/authentication-key', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n origins: [...(origins ?? []), window.location.origin],\n token,\n }),\n })\n .then(async res => {\n resolve((await res.json()) as TokenExIFrameConfiguration);\n })\n .catch(e => reject(e));\n });\n}\n\nexport function setTokenExScriptTag({\n env,\n setTokenExScriptLoaded,\n}: {\n env: CoinflowEnvs;\n setTokenExScriptLoaded: (b: boolean) => void;\n}) {\n const scriptTagId = 'tokenex-script';\n if (document.head.querySelector(`#${scriptTagId}`)) return;\n\n const sdkScriptTag = document.createElement('script');\n sdkScriptTag.src =\n env === 'prod'\n ? 'https://htp.tokenex.com/iframe/iframe-v3.min.js'\n : 'https://test-htp.tokenex.com/iframe/iframe-v3.min.js';\n sdkScriptTag.id = scriptTagId;\n\n document.head.appendChild(sdkScriptTag);\n\n document.getElementById(scriptTagId)!.addEventListener('load', () => {\n console.log('Setting tokenExScriptLoaded to true!');\n setTokenExScriptLoaded(true);\n });\n}\n\nfunction loadIframe({\n iframe,\n setCachedToken,\n setLoaded,\n}: {\n setCachedToken: (s: string | undefined) => void;\n setLoaded: (b: boolean) => void;\n iframe: ReturnType<typeof TokenEx.Iframe>;\n}): TokenExIframe {\n const tokenize = async (): Promise<TokenizationResponse> => {\n iframe.tokenize();\n return await new Promise<TokenizationResponse>((resolve, reject) => {\n iframe.on('tokenize', (data: TokenizationResponse) => {\n setCachedToken(data.token);\n resolve(data);\n });\n iframe.on('validate', (data: {isValid: boolean; isCvvValid: boolean}) => {\n // noinspection PointlessBooleanExpressionJS\n const isInvalid = !data.isValid || data.isCvvValid === false;\n if (isInvalid) reject(data);\n });\n });\n };\n\n iframe.on('change', () => setCachedToken(undefined));\n iframe.on('cvvChange', () => setCachedToken(undefined));\n\n iframe.on('load', () => {\n setTimeout(() => setLoaded(true), 350);\n const el: HTMLIFrameElement | null = document.querySelector(\n '#tx_iframe_tokenExCardNumber'\n );\n if (el) {\n // noinspection JSDeprecatedSymbols\n el.scrolling = 'no';\n }\n });\n\n iframe.on('focus', () => {\n iframe.focus();\n });\n iframe.on('cvvFocus', () => {\n iframe.cvvFocus();\n });\n\n setLoaded(false);\n iframe.load();\n\n return {...iframe, tokenize};\n}\n\nexport async function doInitializeCvvOnlyTokenExIframe(\n args: DoInitializeCvvOnlyTokenExIframeArgs\n) {\n const {token, cardType} = args;\n return await doInitialize(TokenExCvvContainerID, args, {\n cvvOnly: true,\n cvv: true,\n cvvContainerID: TokenExCvvContainerID,\n placeholder: 'CVV',\n token,\n cardType: CARD_TYPE_MAPPING[cardType],\n });\n}\n\nexport async function doInitializeTokenExIframe(\n args: DoInitializeTokenExIframeArgs\n) {\n return await doInitialize(TokenExCardNumberIframeId, args, {\n cvv: true,\n cvvContainerID: TokenExCvvContainerID,\n cvvPlaceholder: 'CVV',\n });\n}\n\nexport async function doInitializeTokenExCardOnlyIframe(\n args: DoInitializeTokenExIframeArgs\n) {\n return await doInitialize(TokenExCardNumberIframeId, args, {cvv: false});\n}\n\nasync function doInitialize(\n id: string,\n {\n tokenExScriptLoaded,\n origins,\n env,\n css,\n debug,\n font,\n setCachedToken,\n setLoaded,\n }: DoInitializeTokenExIframeArgs,\n configOverrides: Partial<TokenEx.Config>\n) {\n if (!tokenExScriptLoaded && typeof TokenEx === 'undefined') {\n console.warn(\n 'Warning Unable to load TokenEx on first attempt waiting for load event from document.head.script#tokenex-script'\n );\n return;\n }\n const iframeConfig = await getIframeConfig({\n token: configOverrides.token,\n origins,\n env,\n });\n const {styles} = getStyles(css);\n const config = {\n ...iframeConfig,\n placeholder: '0000 0000 0000 0000',\n enablePrettyFormat: true,\n styles,\n font,\n debug: debug ?? false,\n ...configOverrides,\n };\n const iframe: ReturnType<typeof TokenEx.Iframe> = TokenEx.Iframe(id, config);\n\n return loadIframe({iframe, setCachedToken, setLoaded});\n}\n\nfunction getStyles(s: string) {\n const css = JSON.parse(s);\n const styles = {\n base: CSSPropertiesToComponent(css.base),\n focus: CSSPropertiesToComponent(css.focus),\n error: CSSPropertiesToComponent(css.error),\n placeholder: CSSPropertiesToComponent(css.placeholder),\n cvv: {\n base: CSSPropertiesToComponent(css.cvv?.base),\n focus: CSSPropertiesToComponent(css.cvv?.focus),\n error: CSSPropertiesToComponent(css.cvv?.error),\n placeholder: CSSPropertiesToComponent(css?.placeholder),\n },\n };\n\n return {styles};\n}\n\nfunction CSSPropertiesToComponent(\n dict: CSSProperties | string | undefined\n): string {\n if (!dict) return '';\n if (typeof dict === 'string') return dict;\n\n let str = '';\n for (const [key, value] of Object.entries(dict)) {\n let clo = '';\n key.split('').forEach(lt => {\n if (lt.toUpperCase() === lt) {\n clo += '-' + lt.toLowerCase();\n } else {\n clo += lt;\n }\n });\n str += clo + ':' + value + ';';\n }\n return str;\n}\n","import {\n Component,\n ElementRef,\n HostListener,\n Input,\n ViewChild,\n} from '@angular/core';\nimport {\n CoinflowIFrameProps,\n CoinflowUtils,\n IFrameMessageHandlers,\n handleIFrameMessage,\n} from './common';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\n\n@Component({\n selector: 'lib-coinflow-iframe',\n standalone: true,\n imports: [],\n template: ` <iframe\n width=\"100%\"\n height=\"100%\"\n #iframe\n scrolling=\"{{ iframeProps?.handleHeightChange ? 'no' : 'yes' }}\"\n allow=\"payment;camera\"\n title=\"withdraw\"\n frameBorder=\"0\"\n [src]=\"dynamicUrl\"\n ></iframe>`,\n})\nexport class CoinflowIFrameComponent {\n @Input() iframeProps!: CoinflowIFrameProps;\n @Input() messageHandlers!: IFrameMessageHandlers;\n\n dynamicUrl?: SafeResourceUrl;\n @ViewChild('iframe') iframe?: ElementRef<HTMLIFrameElement>;\n\n constructor(private sanitizer: DomSanitizer) {}\n\n ngOnInit() {\n const coinflowUrl = CoinflowUtils.getCoinflowUrl(this.iframeProps);\n this.dynamicUrl =\n this.sanitizer.bypassSecurityTrustResourceUrl(coinflowUrl);\n }\n\n @HostListener('window:message', ['$event']) onPostMessage(event: any) {\n if (\n !event.origin.includes(\n CoinflowUtils.getCoinflowBaseUrl(this.iframeProps.env)\n )\n )\n return;\n\n const promise = handleIFrameMessage(event.data, this.messageHandlers);\n if (!promise) return;\n promise\n .then(this.sendMessage.bind(this))\n .catch(e => this.sendMessage('ERROR ' + e.message));\n }\n\n sendMessage(message: string) {\n if (!this.iframe || !this.iframe.nativeElement) return;\n this.iframe.nativeElement.contentWindow!.postMessage(message, '*');\n }\n}\n","import {Component, Input} from '@angular/core';\nimport {CoinflowIFrameComponent} from './coinflow-iframe.component';\nimport {\n CoinflowIFrameProps,\n CoinflowPurchaseProps,\n IFrameMessageHandlers,\n getHandlers,\n getWalletPubkey,\n CoinflowUtils,\n} from './common';\n\n@Component({\n selector: 'lib-coinflow-purchase',\n standalone: true,\n imports: [CoinflowIFrameComponent],\n template:\n ' <lib-coinflow-iframe ng-if=\"iframeProps && messageHandlers\" [iframeProps]=\"iframeProps!\" [messageHandlers]=\"messageHandlers!\"></lib-coinflow-iframe> ',\n})\nexport class CoinflowPurchaseComponent {\n @Input() purchaseProps!: CoinflowPurchaseProps;\n iframeProps?: CoinflowIFrameProps;\n messageHandlers?: IFrameMessageHandlers;\n\n ngOnInit() {\n const walletPubkey = getWalletPubkey(this.purchaseProps);\n this.messageHandlers = getHandlers(this.purchaseProps);\n this.messageHandlers.handleHeightChange =\n this.purchaseProps.handleHeightChange;\n\n this.iframeProps = {\n ...this.purchaseProps,\n walletPubkey,\n route: `/purchase/${this.purchaseProps?.merchantId}`,\n transaction: CoinflowUtils.getTransaction(this.purchaseProps),\n };\n }\n}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-purchase-history',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-purchase-history works!</p> ',\n})\nexport class CoinflowPurchaseHistoryComponent {}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-purchase-protection',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-purchase-protection works!</p> ',\n})\nexport class CoinflowPurchaseProtectionComponent {}\n","import {Component, Input} from '@angular/core';\nimport {\n CoinflowIFrameProps,\n CoinflowWithdrawProps,\n IFrameMessageHandlers,\n getHandlers,\n getWalletPubkey,\n} from './common';\nimport {CoinflowIFrameComponent} from './coinflow-iframe.component';\n\n@Component({\n selector: 'lib-coinflow-withdraw',\n standalone: true,\n imports: [CoinflowIFrameComponent],\n template:\n ' <lib-coinflow-iframe ng-if=\"iframeProps && messageHandlers\" [iframeProps]=\"iframeProps!\" [messageHandlers]=\"messageHandlers!\"></lib-coinflow-iframe> ',\n})\nexport class CoinflowWithdrawComponent {\n @Input() withdrawProps!: CoinflowWithdrawProps;\n iframeProps?: CoinflowIFrameProps;\n messageHandlers?: IFrameMessageHandlers;\n\n ngOnInit() {\n const walletPubkey = getWalletPubkey(this.withdrawProps);\n this.messageHandlers = getHandlers(this.withdrawProps);\n this.messageHandlers.handleHeightChange =\n this.withdrawProps.handleHeightChange;\n\n this.iframeProps = {\n ...this.withdrawProps,\n walletPubkey,\n route: `/withdraw/${this.withdrawProps?.merchantId}`,\n transaction: undefined,\n };\n }\n}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-withdraw-history',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-withdraw-history works!</p> ',\n})\nexport class CoinflowWithdrawHistoryComponent {}\n","/*\n * Public API Surface of coinflowlabs\n */\n\nexport * from './lib/coinflow-iframe.component';\nexport * from './lib/coinflow-purchase.component';\nexport * from './lib/coinflow-purchase-history.component';\nexport * from './lib/coinflow-purchase-protection.component';\nexport * from './lib/coinflow-withdraw.component';\nexport * from './lib/coinflow-withdraw-history.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAQA,IAAY,cAIX,CAAA;AAJD,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,GAIzB,EAAA,CAAA,CAAA,CAAA;AAED,IAAY,aAIX,CAAA;AAJD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,GAIxB,EAAA,CAAA,CAAA,CAAA;AA0aD,IAAY,QAKX,CAAA;AALD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,YAAA,CAAA,GAAA,MAAmB,CAAA;AACnB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,UAAA,CAAA,GAAA,MAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,KAAR,QAAQ,GAKnB,EAAA,CAAA,CAAA;;ACjcD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA,MAAM,IA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AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,uBAAuB,CAAC;AAClC,oBAAA,QAAQ,EACN,yJAAyJ;AAC5J,iBAAA,CAAA;8BAEU,aAAa,EAAA,CAAA;sBAArB,KAAK;;;MCVK,gCAAgC,CAAA;+GAAhC,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAhC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gCAAgC,yFAFjC,2CAA2C,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;4FAE1C,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAN5C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,+BAA+B;AACzC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,QAAQ,EAAE,2CAA2C;AACtD,iBAAA,CAAA;;;ACPD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -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;
@@ -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,9 +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?: {
148
- [key: string]: any;
149
- };
148
+ rawProductData?: RawProductData;
150
149
  }
151
150
  export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
152
151
  amount?: number | string;
@@ -162,6 +161,15 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
162
161
  authOnly?: boolean;
163
162
  deviceId?: string;
164
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[];
165
173
  }
166
174
  export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
167
175
  wallet: SolanaWallet;
@@ -171,7 +179,6 @@ export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps
171
179
  connection: Connection;
172
180
  blockchain: 'solana';
173
181
  token?: PublicKey | string;
174
- supportsVersionedTransactions?: boolean;
175
182
  rent?: {
176
183
  lamports: string | number;
177
184
  };
@@ -212,9 +219,17 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
212
219
  wallet: string;
213
220
  blockchain: 'solana' | 'eth' | 'near' | 'polygon';
214
221
  }[];
215
- supportsVersionedTransactions?: boolean;
216
222
  lockAmount?: boolean;
217
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[];
218
233
  }
219
234
  export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
220
235
  wallet: SolanaWallet;
@@ -270,15 +285,19 @@ type ReservoirItems = ReservoirItem | ReservoirItem[];
270
285
  export interface ReservoirRedeem extends CommonEvmRedeem {
271
286
  type: 'reservoir';
272
287
  items: ReservoirItems;
288
+ taker?: string;
289
+ }
290
+ export interface TokenRedeem extends CommonEvmRedeem {
291
+ type: 'token';
292
+ destination: string;
273
293
  }
274
- export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem;
275
- 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'> {
294
+ export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem;
295
+ 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'> {
276
296
  walletPubkey: string | null | undefined;
277
297
  route: string;
278
298
  routePrefix?: string;
279
299
  transaction?: string;
280
300
  tokens?: string[] | PublicKey[];
281
- supportsVersionedTransactions?: boolean;
282
301
  nearDeposit?: string;
283
302
  merchantCss?: string;
284
303
  color?: 'white' | 'black';
@@ -287,4 +306,10 @@ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>,
287
306
  theme?: MerchantTheme;
288
307
  usePermit?: boolean;
289
308
  }
309
+ export declare enum CardType {
310
+ VISA = "VISA",
311
+ MASTERCARD = "MSTR",
312
+ AMEX = "AMEX",
313
+ DISCOVER = "DISC"
314
+ }
290
315
  export {};
@@ -1,4 +1,4 @@
1
- import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, CoinflowPurchaseProps } from './CoinflowTypes';
1
+ import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, CoinflowPurchaseProps, SolanaWallet } from './CoinflowTypes';
2
2
  export declare class CoinflowUtils {
3
3
  env: CoinflowEnvs;
4
4
  url: 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, supportsVersionedTransactions, 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, }: CoinflowIFrameProps): 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, }: CoinflowIFrameProps): string;
13
13
  static getTransaction(props: CoinflowPurchaseProps): string | undefined;
14
14
  static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
15
15
  solana: T;
@@ -18,4 +18,9 @@ export declare class CoinflowUtils {
18
18
  polygon: T;
19
19
  base: T;
20
20
  }): T;
21
+ static getWalletFromEmail({ email, merchantId, env, }: {
22
+ email: string;
23
+ merchantId: string;
24
+ env: CoinflowEnvs;
25
+ }): Promise<SolanaWallet>;
21
26
  }
@@ -0,0 +1,154 @@
1
+ import { CardType, CoinflowEnvs } from '../CoinflowTypes';
2
+ import { CSSProperties } from 'react';
3
+ export declare const TokenExCardNumberIframeId = "tokenExCardNumber";
4
+ export declare const TokenExCvvContainerID = "tokenExCardCvv";
5
+ export interface TokenExIframe extends ReturnType<typeof TokenEx.Iframe> {
6
+ tokenize: () => Promise<TokenizationResponse>;
7
+ }
8
+ export declare const CARD_TYPE_MAPPING: Record<CardType, string>;
9
+ export interface TokenExIFrameConfiguration {
10
+ origin: string;
11
+ timestamp: string;
12
+ tokenExID: string;
13
+ tokenScheme: string;
14
+ authenticationKey: string;
15
+ pci: true;
16
+ token?: string;
17
+ }
18
+ export interface CardFormInputStyles {
19
+ base: CSSProperties | string;
20
+ placeholder?: CSSProperties | string;
21
+ focus?: CSSProperties | string;
22
+ error?: CSSProperties | string;
23
+ }
24
+ export type CoinflowCardTokenResponse = {
25
+ token: string;
26
+ };
27
+ export interface CoinflowCardNumberInputProps {
28
+ env: CoinflowEnvs;
29
+ css: CardFormInputStyles & {
30
+ cvv: CardFormInputStyles;
31
+ };
32
+ debug?: boolean;
33
+ origins?: string[];
34
+ font?: string;
35
+ }
36
+ export interface CoinflowCvvOnlyInputProps {
37
+ token: string;
38
+ cardType: CardType;
39
+ env: CoinflowEnvs;
40
+ css: CardFormInputStyles & {
41
+ cvv: CardFormInputStyles;
42
+ };
43
+ debug?: boolean;
44
+ origins?: string[];
45
+ font?: string;
46
+ }
47
+ export interface TokenizationResponse {
48
+ cardType: string;
49
+ cvvIncluded: true;
50
+ firstSix: string;
51
+ lastFour: string;
52
+ referenceNumber: string;
53
+ token: string;
54
+ tokenHMAC: string;
55
+ }
56
+ declare global {
57
+ namespace TokenEx {
58
+ interface FraudServicesConfig {
59
+ useKount?: boolean;
60
+ kount?: {
61
+ merchantId?: string;
62
+ mode?: string;
63
+ anId?: string;
64
+ };
65
+ }
66
+ interface Config {
67
+ debug?: boolean;
68
+ enablePrettyFormat?: boolean;
69
+ maskInput?: boolean;
70
+ enableValidateOnBlur?: boolean;
71
+ enableAriaRequired?: boolean;
72
+ pci?: boolean;
73
+ cvvOnly?: boolean;
74
+ allowUnknownCardTypes?: boolean;
75
+ enableAutoComplete?: boolean;
76
+ returnAutoCompleteValues?: boolean;
77
+ returnKhash?: boolean;
78
+ returnWhash?: boolean;
79
+ enforceLuhnCompliance?: boolean;
80
+ use3DS?: boolean;
81
+ enableValidateOnKeyUp?: boolean;
82
+ enableValidateOnCvvKeyUp?: boolean;
83
+ expiresInSeconds?: number;
84
+ useExtendedBIN?: boolean;
85
+ inlineIframeJavaScript?: boolean;
86
+ iframeVersion?: number;
87
+ authenticationKey?: string;
88
+ origin?: string;
89
+ tokenExID?: string;
90
+ timestamp?: string;
91
+ tokenScheme?: string;
92
+ token?: string;
93
+ customDataLabel?: string;
94
+ customCvvDataLabel?: string;
95
+ title?: string;
96
+ cvvTitle?: string;
97
+ inputTitle?: string;
98
+ cvvInputTitle?: string;
99
+ cardMaxLengths?: {
100
+ visa?: number;
101
+ mastercard?: number;
102
+ americanExpress?: number;
103
+ discover?: number;
104
+ jcb?: number;
105
+ diners?: number;
106
+ };
107
+ fraudServices?: FraudServicesConfig;
108
+ threeDSMethodNotificationUrl?: string;
109
+ customDataTypes?: string | object;
110
+ cvvContainerID?: string;
111
+ cvvPlaceholder?: string;
112
+ cardType?: string;
113
+ forterSiteId?: string;
114
+ forterUsername?: string;
115
+ customRegEx?: string;
116
+ placeholder?: string;
117
+ inputType?: string;
118
+ inputMode?: string;
119
+ font?: string;
120
+ cvv?: boolean;
121
+ styles: {
122
+ base: string;
123
+ focus: string;
124
+ error: string;
125
+ placeholder: string;
126
+ cvv: {
127
+ base: string;
128
+ focus: string;
129
+ placeholder: string;
130
+ error: string;
131
+ };
132
+ };
133
+ }
134
+ interface IframeAPI {
135
+ load(): void;
136
+ on: (event: string, callback: (data?: any) => void) => void;
137
+ tokenize(): void;
138
+ validate(): void;
139
+ reset(): void;
140
+ blur(): void;
141
+ cvvBlur(): void;
142
+ focus(): void;
143
+ cvvFocus(): void;
144
+ remove(): void;
145
+ toggleMask(): void;
146
+ toggleCvvMask(): void;
147
+ setPAN(pan: string): void;
148
+ binLookup(): void;
149
+ validateConfig(): void;
150
+ setFraudServicesRequestDetails(data: string): void;
151
+ }
152
+ function Iframe(containerID: string, configuration: Config): IframeAPI;
153
+ }
154
+ }
@@ -0,0 +1,28 @@
1
+ import { TokenExIframe, TokenExIFrameConfiguration } from './TokenEx';
2
+ import { CardType, CoinflowEnvs } from '../CoinflowTypes';
3
+ export interface DoInitializeTokenExIframeArgs {
4
+ css: string;
5
+ debug?: boolean;
6
+ font?: string;
7
+ origins: string[] | undefined;
8
+ tokenExScriptLoaded: boolean;
9
+ env: CoinflowEnvs;
10
+ setCachedToken: (s: string | undefined) => void;
11
+ setLoaded: (b: boolean) => void;
12
+ }
13
+ export interface DoInitializeCvvOnlyTokenExIframeArgs extends DoInitializeTokenExIframeArgs {
14
+ token: string;
15
+ cardType: CardType;
16
+ }
17
+ export declare function getIframeConfig({ token, origins, env, }: {
18
+ token?: string;
19
+ origins: string[] | undefined;
20
+ env: CoinflowEnvs;
21
+ }): Promise<TokenExIFrameConfiguration>;
22
+ export declare function setTokenExScriptTag({ env, setTokenExScriptLoaded, }: {
23
+ env: CoinflowEnvs;
24
+ setTokenExScriptLoaded: (b: boolean) => void;
25
+ }): void;
26
+ export declare function doInitializeCvvOnlyTokenExIframe(args: DoInitializeCvvOnlyTokenExIframeArgs): Promise<TokenExIframe | undefined>;
27
+ export declare function doInitializeTokenExIframe(args: DoInitializeTokenExIframeArgs): Promise<TokenExIframe | undefined>;
28
+ export declare function doInitializeTokenExCardOnlyIframe(args: DoInitializeTokenExIframeArgs): Promise<TokenExIframe | undefined>;
@@ -1,3 +1,5 @@
1
1
  export * from './CoinflowTypes';
2
2
  export * from './CoinflowUtils';
3
3
  export * from './CoinflowLibMessageHandlers';
4
+ export * from './card-form/TokenEx';
5
+ export * from './card-form/tokenexHelpers';