diff --git a/apps/wallet-mobile/src/WalletInit/WalletInitNavigator.tsx b/apps/wallet-mobile/src/WalletInit/WalletInitNavigator.tsx index df1198e001..28a6ceb392 100644 --- a/apps/wallet-mobile/src/WalletInit/WalletInitNavigator.tsx +++ b/apps/wallet-mobile/src/WalletInit/WalletInitNavigator.tsx @@ -1,5 +1,6 @@ import {createStackNavigator} from '@react-navigation/stack' -import React from 'react' +import {useTheme} from '@yoroi/theme' +import * as React from 'react' import {defineMessages, useIntl} from 'react-intl' import {AboutRecoveryPhraseScreen} from '../features/AddWallet/useCases/CreateWallet/AboutRecoveryPhraseScreen' @@ -22,13 +23,14 @@ import {WalletFreshInitScreen} from './WalletFreshInit' const Stack = createStackNavigator() export const WalletInitNavigator = () => { const strings = useStrings() + const {theme} = useTheme() return ( diff --git a/packages/banxa/lib/commonjs/adapters/errors.js b/packages/banxa/lib/commonjs/adapters/errors.js deleted file mode 100644 index 3f4364c05f..0000000000 --- a/packages/banxa/lib/commonjs/adapters/errors.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.BanxaValidationError = exports.BanxaUnknownError = exports.BanxaErrorMessages = void 0; -const BanxaErrorMessages = { - ValidationError: 'ValidationError', - UnknownError: 'Unknown error' -}; -exports.BanxaErrorMessages = BanxaErrorMessages; -class BanxaValidationError extends Error { - constructor(message) { - super(message); - this.name = 'ValidationError'; - } -} -exports.BanxaValidationError = BanxaValidationError; -class BanxaUnknownError extends Error { - constructor(message) { - super(message); - this.name = 'UnknownError'; - } -} -exports.BanxaUnknownError = BanxaUnknownError; -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/adapters/errors.js.map b/packages/banxa/lib/commonjs/adapters/errors.js.map deleted file mode 100644 index 9d5df9862c..0000000000 --- a/packages/banxa/lib/commonjs/adapters/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["BanxaErrorMessages","ValidationError","UnknownError","exports","BanxaValidationError","Error","constructor","message","name","BanxaUnknownError"],"sourceRoot":"../../../src","sources":["adapters/errors.ts"],"mappings":";;;;;;AAAO,MAAMA,kBAAkB,GAAG;EAChCC,eAAe,EAAE,iBAAiB;EAClCC,YAAY,EAAE;AAChB,CAAC;AAAAC,OAAA,CAAAH,kBAAA,GAAAA,kBAAA;AAEM,MAAMI,oBAAoB,SAASC,KAAK,CAAC;EAC9CC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,iBAAiB;EAC/B;AACF;AAACL,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AAEM,MAAMK,iBAAiB,SAASJ,KAAK,CAAC;EAC3CC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,cAAc;EAC5B;AACF;AAACL,OAAA,CAAAM,iBAAA,GAAAA,iBAAA"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/adapters/zod-errors.js b/packages/banxa/lib/commonjs/adapters/zod-errors.js deleted file mode 100644 index eee5b8cfb8..0000000000 --- a/packages/banxa/lib/commonjs/adapters/zod-errors.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.handleZodErrors = handleZodErrors; -var _errors = require("./errors"); -var _zod = require("zod"); -/** - * Converts a ZodError or Error to a BanxaError. - * @param error - The error to convert. - * @throws An appropriate BanxaError based on zod error, or ignore it. - */ -function handleZodErrors(error) { - if (error instanceof _zod.ZodError) { - const errorDetails = error.issues.map(e => ({ - field: e.path.join('.'), - message: e.message - })); - const errorMessage = `Invalid data: ${errorDetails.map(e => `${e.field}: ${e.message}`).join(', ')}`; - throw new _errors.BanxaValidationError(errorMessage); - } - throw new _errors.BanxaUnknownError(JSON.stringify(error)); -} -//# sourceMappingURL=zod-errors.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/adapters/zod-errors.js.map b/packages/banxa/lib/commonjs/adapters/zod-errors.js.map deleted file mode 100644 index 65f6bf87ba..0000000000 --- a/packages/banxa/lib/commonjs/adapters/zod-errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_errors","require","_zod","handleZodErrors","error","ZodError","errorDetails","issues","map","e","field","path","join","message","errorMessage","BanxaValidationError","BanxaUnknownError","JSON","stringify"],"sourceRoot":"../../../src","sources":["adapters/zod-errors.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAACC,KAAqB,EAAE;EACrD,IAAIA,KAAK,YAAYC,aAAQ,EAAE;IAC7B,MAAMC,YAAY,GAAGF,KAAK,CAACG,MAAM,CAACC,GAAG,CAAEC,CAAC,KAAM;MAC5CC,KAAK,EAAED,CAAC,CAACE,IAAI,CAACC,IAAI,CAAC,GAAG,CAAC;MACvBC,OAAO,EAAEJ,CAAC,CAACI;IACb,CAAC,CAAC,CAAC;IACH,MAAMC,YAAY,GAAI,iBAAgBR,YAAY,CAC/CE,GAAG,CAAEC,CAAC,IAAM,GAAEA,CAAC,CAACC,KAAM,KAAID,CAAC,CAACI,OAAQ,EAAC,CAAC,CACtCD,IAAI,CAAC,IAAI,CAAE,EAAC;IACf,MAAM,IAAIG,4BAAoB,CAACD,YAAY,CAAC;EAC9C;EACA,MAAM,IAAIE,yBAAiB,CAACC,IAAI,CAACC,SAAS,CAACd,KAAK,CAAC,CAAC;AACpD"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/adapters/zod-errors.test.js b/packages/banxa/lib/commonjs/adapters/zod-errors.test.js deleted file mode 100644 index 5fe2565c06..0000000000 --- a/packages/banxa/lib/commonjs/adapters/zod-errors.test.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; - -var _zodErrors = require("./zod-errors"); -var _errors = require("./errors"); -var _zod = require("zod"); -describe('handleZodErrors', () => { - const testSchema = _zod.z.object({ - name: _zod.z.string(), - age: _zod.z.number() - }); - test('should convert a ZodError into a ValidationError', () => { - const invalidData = { - name: 123, - age: 'John Doe' - }; - try { - testSchema.parse(invalidData); - } catch (error) { - expect(error).toBeInstanceOf(_zod.z.ZodError); - - // Handle the error - let handledError; - try { - (0, _zodErrors.handleZodErrors)(error); - } catch (e) { - var _handledError; - handledError = e; - expect(handledError).toBeInstanceOf(_errors.BanxaValidationError); - expect((_handledError = handledError) === null || _handledError === void 0 ? void 0 : _handledError.message).toBe('Invalid data: name: Expected string, received number, age: Expected number, received string'); - } - } - }); - test('should re-throw an error that is not a ZodError', () => { - const someOtherError = new Error('Some other error'); - let handledError; - try { - (0, _zodErrors.handleZodErrors)(someOtherError); - } catch (e) { - handledError = e; - } - expect(handledError).toBeInstanceOf(_errors.BanxaUnknownError); - }); -}); -//# sourceMappingURL=zod-errors.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/adapters/zod-errors.test.js.map b/packages/banxa/lib/commonjs/adapters/zod-errors.test.js.map deleted file mode 100644 index 7af16d359d..0000000000 --- a/packages/banxa/lib/commonjs/adapters/zod-errors.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_zodErrors","require","_errors","_zod","describe","testSchema","z","object","name","string","age","number","test","invalidData","parse","error","expect","toBeInstanceOf","ZodError","handledError","handleZodErrors","e","_handledError","BanxaValidationError","message","toBe","someOtherError","Error","BanxaUnknownError"],"sourceRoot":"../../../src","sources":["adapters/zod-errors.test.ts"],"mappings":";;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AAEAG,QAAQ,CAAC,iBAAiB,EAAE,MAAM;EAChC,MAAMC,UAAU,GAAGC,MAAC,CAACC,MAAM,CAAC;IAC1BC,IAAI,EAAEF,MAAC,CAACG,MAAM,CAAC,CAAC;IAChBC,GAAG,EAAEJ,MAAC,CAACK,MAAM,CAAC;EAChB,CAAC,CAAC;EAEFC,IAAI,CAAC,kDAAkD,EAAE,MAAM;IAC7D,MAAMC,WAAW,GAAG;MAClBL,IAAI,EAAE,GAAG;MACTE,GAAG,EAAE;IACP,CAAC;IAED,IAAI;MACFL,UAAU,CAACS,KAAK,CAACD,WAAW,CAAC;IAC/B,CAAC,CAAC,OAAOE,KAAK,EAAE;MACdC,MAAM,CAACD,KAAK,CAAC,CAACE,cAAc,CAACX,MAAC,CAACY,QAAQ,CAAC;;MAExC;MACA,IAAIC,YAAY;MAChB,IAAI;QACF,IAAAC,0BAAe,EAACL,KAAK,CAAC;MACxB,CAAC,CAAC,OAAOM,CAAM,EAAE;QAAA,IAAAC,aAAA;QACfH,YAAY,GAAGE,CAAC;QAEhBL,MAAM,CAACG,YAAY,CAAC,CAACF,cAAc,CAACM,4BAAoB,CAAC;QACzDP,MAAM,EAAAM,aAAA,GAACH,YAAY,cAAAG,aAAA,uBAAZA,aAAA,CAAcE,OAAO,CAAC,CAACC,IAAI,CAChC,6FACF,CAAC;MACH;IACF;EACF,CAAC,CAAC;EAEFb,IAAI,CAAC,iDAAiD,EAAE,MAAM;IAC5D,MAAMc,cAAc,GAAG,IAAIC,KAAK,CAAC,kBAAkB,CAAC;IAEpD,IAAIR,YAAY;IAChB,IAAI;MACF,IAAAC,0BAAe,EAACM,cAAc,CAAC;IACjC,CAAC,CAAC,OAAOL,CAAC,EAAE;MACVF,YAAY,GAAGE,CAAC;IAClB;IAEAL,MAAM,CAACG,YAAY,CAAC,CAACF,cAAc,CAACW,yBAAiB,CAAC;EACxD,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/adapters/zod-schema.js b/packages/banxa/lib/commonjs/adapters/zod-schema.js deleted file mode 100644 index 6e69558f3d..0000000000 --- a/packages/banxa/lib/commonjs/adapters/zod-schema.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.BanxaUrlReferralQueryStringParamsSchema = void 0; -var _zod = require("zod"); -var _coinTypes = require("../helpers/coin-types"); -var _fiatTypes = require("../helpers/fiat-types"); -var _walletAddress = require("../helpers/wallet-address"); -var _blockchainCode = require("../helpers/blockchain-code"); -var _orderTypes = require("../helpers/order-types"); -var _theme = require("../helpers/theme"); -const BanxaUrlReferralQueryStringParamsSchema = _zod.z.object({ - orderType: _zod.z.string().refine(_orderTypes.banxaIsOrderType).optional(), - fiatType: _zod.z.string().refine(_fiatTypes.banxaIsFiatType), - fiatAmount: _zod.z.number().optional(), - coinType: _zod.z.string().refine(_coinTypes.banxaIsCoinType), - coinAmount: _zod.z.number().optional(), - blockchain: _zod.z.string().refine(_blockchainCode.banxaIsBlockchainCode).optional(), - walletAddress: _zod.z.string(), - walletAddressTag: _zod.z.string().optional(), - backgroundColor: _zod.z.string().optional(), - primaryColor: _zod.z.string().optional(), - secondaryColor: _zod.z.string().optional(), - textColor: _zod.z.string().optional(), - theme: _zod.z.string().refine(_theme.banxaIsTheme).optional(), - returnUrl: _zod.z.string().optional() -}).refine(data => { - return (data.coinType === 'ADA' || data.coinType === 'TADA') && (0, _walletAddress.banxaIsPossibleCardanoAddress)(data.walletAddress); -}); -exports.BanxaUrlReferralQueryStringParamsSchema = BanxaUrlReferralQueryStringParamsSchema; -//# sourceMappingURL=zod-schema.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/adapters/zod-schema.js.map b/packages/banxa/lib/commonjs/adapters/zod-schema.js.map deleted file mode 100644 index 6cd6ec3057..0000000000 --- a/packages/banxa/lib/commonjs/adapters/zod-schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_zod","require","_coinTypes","_fiatTypes","_walletAddress","_blockchainCode","_orderTypes","_theme","BanxaUrlReferralQueryStringParamsSchema","z","object","orderType","string","refine","banxaIsOrderType","optional","fiatType","banxaIsFiatType","fiatAmount","number","coinType","banxaIsCoinType","coinAmount","blockchain","banxaIsBlockchainCode","walletAddress","walletAddressTag","backgroundColor","primaryColor","secondaryColor","textColor","theme","banxaIsTheme","returnUrl","data","banxaIsPossibleCardanoAddress","exports"],"sourceRoot":"../../../src","sources":["adapters/zod-schema.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEO,MAAMO,uCAAuC,GAAGC,MAAC,CACrDC,MAAM,CAAC;EACNC,SAAS,EAAEF,MAAC,CAACG,MAAM,CAAC,CAAC,CAACC,MAAM,CAACC,4BAAgB,CAAC,CAACC,QAAQ,CAAC,CAAC;EACzDC,QAAQ,EAAEP,MAAC,CAACG,MAAM,CAAC,CAAC,CAACC,MAAM,CAACI,0BAAe,CAAC;EAC5CC,UAAU,EAAET,MAAC,CAACU,MAAM,CAAC,CAAC,CAACJ,QAAQ,CAAC,CAAC;EACjCK,QAAQ,EAAEX,MAAC,CAACG,MAAM,CAAC,CAAC,CAACC,MAAM,CAACQ,0BAAe,CAAC;EAC5CC,UAAU,EAAEb,MAAC,CAACU,MAAM,CAAC,CAAC,CAACJ,QAAQ,CAAC,CAAC;EACjCQ,UAAU,EAAEd,MAAC,CAACG,MAAM,CAAC,CAAC,CAACC,MAAM,CAACW,qCAAqB,CAAC,CAACT,QAAQ,CAAC,CAAC;EAC/DU,aAAa,EAAEhB,MAAC,CAACG,MAAM,CAAC,CAAC;EACzBc,gBAAgB,EAAEjB,MAAC,CAACG,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EACvCY,eAAe,EAAElB,MAAC,CAACG,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EACtCa,YAAY,EAAEnB,MAAC,CAACG,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EACnCc,cAAc,EAAEpB,MAAC,CAACG,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EACrCe,SAAS,EAAErB,MAAC,CAACG,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAChCgB,KAAK,EAAEtB,MAAC,CAACG,MAAM,CAAC,CAAC,CAACC,MAAM,CAACmB,mBAAY,CAAC,CAACjB,QAAQ,CAAC,CAAC;EACjDkB,SAAS,EAAExB,MAAC,CAACG,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC;AACjC,CAAC,CAAC,CACDF,MAAM,CAAEqB,IAAI,IAAK;EAChB,OACE,CAACA,IAAI,CAACd,QAAQ,KAAK,KAAK,IAAIc,IAAI,CAACd,QAAQ,KAAK,MAAM,KACpD,IAAAe,4CAA6B,EAACD,IAAI,CAACT,aAAa,CAAC;AAErD,CAAC,CAAC;AAAAW,OAAA,CAAA5B,uCAAA,GAAAA,uCAAA"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/blockchain-code.js b/packages/banxa/lib/commonjs/helpers/blockchain-code.js deleted file mode 100644 index 32d02999c5..0000000000 --- a/packages/banxa/lib/commonjs/helpers/blockchain-code.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.banxaIsBlockchainCode = banxaIsBlockchainCode; -const banxaSupportedBlockchainCodes = ['ADA']; -function banxaIsBlockchainCode(value) { - return banxaSupportedBlockchainCodes.includes(value); -} -//# sourceMappingURL=blockchain-code.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/blockchain-code.js.map b/packages/banxa/lib/commonjs/helpers/blockchain-code.js.map deleted file mode 100644 index df9ee1fb7d..0000000000 --- a/packages/banxa/lib/commonjs/helpers/blockchain-code.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaSupportedBlockchainCodes","banxaIsBlockchainCode","value","includes"],"sourceRoot":"../../../src","sources":["helpers/blockchain-code.ts"],"mappings":";;;;;;AAEA,MAAMA,6BAA8D,GAAG,CACrE,KAAK,CACG;AAEH,SAASC,qBAAqBA,CACnCC,KAAU,EACoB;EAC9B,OAAOF,6BAA6B,CAACG,QAAQ,CAACD,KAA4B,CAAC;AAC7E"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/blockchain-code.test.js b/packages/banxa/lib/commonjs/helpers/blockchain-code.test.js deleted file mode 100644 index 3851cc55d9..0000000000 --- a/packages/banxa/lib/commonjs/helpers/blockchain-code.test.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -var _blockchainCode = require("./blockchain-code"); -describe('banxaIsBlockchainCode', () => { - it('should return true for valid blockchain codes', () => { - const validCoinTypes = ['ADA']; - validCoinTypes.forEach(coinType => { - expect((0, _blockchainCode.banxaIsBlockchainCode)(coinType)).toBe(true); - }); - }); - it('should return false for invalid blockchain codes', () => { - const invalidCoinTypes = ['XRP', 'DOGE', '', undefined, null, 123]; - invalidCoinTypes.forEach(coinType => { - expect((0, _blockchainCode.banxaIsBlockchainCode)(coinType)).toBe(false); - }); - }); -}); -//# sourceMappingURL=blockchain-code.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/blockchain-code.test.js.map b/packages/banxa/lib/commonjs/helpers/blockchain-code.test.js.map deleted file mode 100644 index 92f2b0dbbb..0000000000 --- a/packages/banxa/lib/commonjs/helpers/blockchain-code.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_blockchainCode","require","describe","it","validCoinTypes","forEach","coinType","expect","banxaIsBlockchainCode","toBe","invalidCoinTypes","undefined"],"sourceRoot":"../../../src","sources":["helpers/blockchain-code.test.ts"],"mappings":";;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEAC,QAAQ,CAAC,uBAAuB,EAAE,MAAM;EACtCC,EAAE,CAAC,+CAA+C,EAAE,MAAM;IACxD,MAAMC,cAAqC,GAAG,CAAC,KAAK,CAAC;IAErDA,cAAc,CAACC,OAAO,CAAEC,QAAQ,IAAK;MACnCC,MAAM,CAAC,IAAAC,qCAAqB,EAACF,QAAQ,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC;IACpD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFN,EAAE,CAAC,kDAAkD,EAAE,MAAM;IAC3D,MAAMO,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAEC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC;IAElED,gBAAgB,CAACL,OAAO,CAAEC,QAAQ,IAAK;MACrCC,MAAM,CAAC,IAAAC,qCAAqB,EAACF,QAAQ,CAAC,CAAC,CAACG,IAAI,CAAC,KAAK,CAAC;IACrD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/coin-types.js b/packages/banxa/lib/commonjs/helpers/coin-types.js deleted file mode 100644 index f7f3c62fe3..0000000000 --- a/packages/banxa/lib/commonjs/helpers/coin-types.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.banxaIsCoinType = banxaIsCoinType; -const banxaSupportedCoinTypes = ['ADA']; -function banxaIsCoinType(value) { - return banxaSupportedCoinTypes.includes(value); -} -//# sourceMappingURL=coin-types.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/coin-types.js.map b/packages/banxa/lib/commonjs/helpers/coin-types.js.map deleted file mode 100644 index 0b0b027c5c..0000000000 --- a/packages/banxa/lib/commonjs/helpers/coin-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaSupportedCoinTypes","banxaIsCoinType","value","includes"],"sourceRoot":"../../../src","sources":["helpers/coin-types.ts"],"mappings":";;;;;;AAEA,MAAMA,uBAAkD,GAAG,CAAC,KAAK,CAAU;AAEpE,SAASC,eAAeA,CAACC,KAAU,EAA0B;EAClE,OAAOF,uBAAuB,CAACG,QAAQ,CAACD,KAAsB,CAAC;AACjE"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/coin-types.test.js b/packages/banxa/lib/commonjs/helpers/coin-types.test.js deleted file mode 100644 index c583b0cbbb..0000000000 --- a/packages/banxa/lib/commonjs/helpers/coin-types.test.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -var _coinTypes = require("./coin-types"); -describe('banxaIsCoinType', () => { - it('should return true for valid coin types', () => { - const validCoinTypes = ['ADA']; - validCoinTypes.forEach(coinType => { - expect((0, _coinTypes.banxaIsCoinType)(coinType)).toBe(true); - }); - }); - it('should return false for invalid coin types', () => { - const invalidCoinTypes = ['XRP', 'DOGE', '', undefined, null, 123]; - invalidCoinTypes.forEach(coinType => { - expect((0, _coinTypes.banxaIsCoinType)(coinType)).toBe(false); - }); - }); -}); -//# sourceMappingURL=coin-types.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/coin-types.test.js.map b/packages/banxa/lib/commonjs/helpers/coin-types.test.js.map deleted file mode 100644 index 71720e2423..0000000000 --- a/packages/banxa/lib/commonjs/helpers/coin-types.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_coinTypes","require","describe","it","validCoinTypes","forEach","coinType","expect","banxaIsCoinType","toBe","invalidCoinTypes","undefined"],"sourceRoot":"../../../src","sources":["helpers/coin-types.test.ts"],"mappings":";;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEAC,QAAQ,CAAC,iBAAiB,EAAE,MAAM;EAChCC,EAAE,CAAC,yCAAyC,EAAE,MAAM;IAClD,MAAMC,cAA+B,GAAG,CAAC,KAAK,CAAC;IAE/CA,cAAc,CAACC,OAAO,CAAEC,QAAQ,IAAK;MACnCC,MAAM,CAAC,IAAAC,0BAAe,EAACF,QAAQ,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC;IAC9C,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFN,EAAE,CAAC,4CAA4C,EAAE,MAAM;IACrD,MAAMO,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAEC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC;IAElED,gBAAgB,CAACL,OAAO,CAAEC,QAAQ,IAAK;MACrCC,MAAM,CAAC,IAAAC,0BAAe,EAACF,QAAQ,CAAC,CAAC,CAACG,IAAI,CAAC,KAAK,CAAC;IAC/C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/fiat-types.js b/packages/banxa/lib/commonjs/helpers/fiat-types.js deleted file mode 100644 index edeb1faccb..0000000000 --- a/packages/banxa/lib/commonjs/helpers/fiat-types.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.banxaIsFiatType = banxaIsFiatType; -const supportedFiatTypes = ['USD', 'EUR']; -function banxaIsFiatType(value) { - return supportedFiatTypes.includes(value); -} -//# sourceMappingURL=fiat-types.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/fiat-types.js.map b/packages/banxa/lib/commonjs/helpers/fiat-types.js.map deleted file mode 100644 index 77e34d7952..0000000000 --- a/packages/banxa/lib/commonjs/helpers/fiat-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["supportedFiatTypes","banxaIsFiatType","value","includes"],"sourceRoot":"../../../src","sources":["helpers/fiat-types.ts"],"mappings":";;;;;;AAEA,MAAMA,kBAA6C,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU;AAEtE,SAASC,eAAeA,CAACC,KAAU,EAA0B;EAClE,OAAOF,kBAAkB,CAACG,QAAQ,CAACD,KAAsB,CAAC;AAC5D"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/fiat-types.test.js b/packages/banxa/lib/commonjs/helpers/fiat-types.test.js deleted file mode 100644 index db32b2d8f8..0000000000 --- a/packages/banxa/lib/commonjs/helpers/fiat-types.test.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -var _fiatTypes = require("./fiat-types"); -describe('banxaIsFiatType', () => { - it('should return true for valid fiat types', () => { - const validFiatTypes = ['USD', 'EUR']; - validFiatTypes.forEach(fiatType => { - expect((0, _fiatTypes.banxaIsFiatType)(fiatType)).toBe(true); - }); - }); - it('should return false for invalid fiat types', () => { - const invalidFiatTypes = ['GBP', 'JPY', 'AUD', '', undefined, null, 123]; - invalidFiatTypes.forEach(fiatType => { - expect((0, _fiatTypes.banxaIsFiatType)(fiatType)).toBe(false); - }); - }); -}); -//# sourceMappingURL=fiat-types.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/fiat-types.test.js.map b/packages/banxa/lib/commonjs/helpers/fiat-types.test.js.map deleted file mode 100644 index 0acc6654e0..0000000000 --- a/packages/banxa/lib/commonjs/helpers/fiat-types.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_fiatTypes","require","describe","it","validFiatTypes","forEach","fiatType","expect","banxaIsFiatType","toBe","invalidFiatTypes","undefined"],"sourceRoot":"../../../src","sources":["helpers/fiat-types.test.ts"],"mappings":";;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEAC,QAAQ,CAAC,iBAAiB,EAAE,MAAM;EAChCC,EAAE,CAAC,yCAAyC,EAAE,MAAM;IAClD,MAAMC,cAA+B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC;IAEtDA,cAAc,CAACC,OAAO,CAAEC,QAAQ,IAAK;MACnCC,MAAM,CAAC,IAAAC,0BAAe,EAACF,QAAQ,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC;IAC9C,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFN,EAAE,CAAC,4CAA4C,EAAE,MAAM;IACrD,MAAMO,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAEC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC;IAExED,gBAAgB,CAACL,OAAO,CAAEC,QAAQ,IAAK;MACrCC,MAAM,CAAC,IAAAC,0BAAe,EAACF,QAAQ,CAAC,CAAC,CAACG,IAAI,CAAC,KAAK,CAAC;IAC/C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/order-types.js b/packages/banxa/lib/commonjs/helpers/order-types.js deleted file mode 100644 index 9ffae98d81..0000000000 --- a/packages/banxa/lib/commonjs/helpers/order-types.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.banxaIsOrderType = banxaIsOrderType; -const supportedOrderTypes = ['buy', 'sell']; -function banxaIsOrderType(value) { - return supportedOrderTypes.includes(value); -} -//# sourceMappingURL=order-types.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/order-types.js.map b/packages/banxa/lib/commonjs/helpers/order-types.js.map deleted file mode 100644 index 78ca7b1086..0000000000 --- a/packages/banxa/lib/commonjs/helpers/order-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["supportedOrderTypes","banxaIsOrderType","value","includes"],"sourceRoot":"../../../src","sources":["helpers/order-types.ts"],"mappings":";;;;;;AAEA,MAAMA,mBAA+C,GAAG,CAAC,KAAK,EAAE,MAAM,CAAU;AAEzE,SAASC,gBAAgBA,CAACC,KAAU,EAA2B;EACpE,OAAOF,mBAAmB,CAACG,QAAQ,CAACD,KAAuB,CAAC;AAC9D"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/order-types.test.js b/packages/banxa/lib/commonjs/helpers/order-types.test.js deleted file mode 100644 index f560234d4e..0000000000 --- a/packages/banxa/lib/commonjs/helpers/order-types.test.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -var _orderTypes = require("./order-types"); -describe('banxaIsOrderType', () => { - it('should return true for valid order types', () => { - const validOrderTypes = ['buy', 'sell']; - validOrderTypes.forEach(orderType => { - expect((0, _orderTypes.banxaIsOrderType)(orderType)).toBe(true); - }); - }); - it('should return false for invalid order types', () => { - const invalidOrderTypes = ['deposit', 'withdraw', 'exchange', '', undefined, null, 123]; - invalidOrderTypes.forEach(orderType => { - expect((0, _orderTypes.banxaIsOrderType)(orderType)).toBe(false); - }); - }); -}); -//# sourceMappingURL=order-types.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/order-types.test.js.map b/packages/banxa/lib/commonjs/helpers/order-types.test.js.map deleted file mode 100644 index f7087bc95c..0000000000 --- a/packages/banxa/lib/commonjs/helpers/order-types.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_orderTypes","require","describe","it","validOrderTypes","forEach","orderType","expect","banxaIsOrderType","toBe","invalidOrderTypes","undefined"],"sourceRoot":"../../../src","sources":["helpers/order-types.test.ts"],"mappings":";;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEAC,QAAQ,CAAC,kBAAkB,EAAE,MAAM;EACjCC,EAAE,CAAC,0CAA0C,EAAE,MAAM;IACnD,MAAMC,eAAiC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;IAEzDA,eAAe,CAACC,OAAO,CAAEC,SAAS,IAAK;MACrCC,MAAM,CAAC,IAAAC,4BAAgB,EAACF,SAAS,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC;IAChD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFN,EAAE,CAAC,6CAA6C,EAAE,MAAM;IACtD,MAAMO,iBAAiB,GAAG,CACxB,SAAS,EACT,UAAU,EACV,UAAU,EACV,EAAE,EACFC,SAAS,EACT,IAAI,EACJ,GAAG,CACJ;IAEDD,iBAAiB,CAACL,OAAO,CAAEC,SAAS,IAAK;MACvCC,MAAM,CAAC,IAAAC,4BAAgB,EAACF,SAAS,CAAC,CAAC,CAACG,IAAI,CAAC,KAAK,CAAC;IACjD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/theme.js b/packages/banxa/lib/commonjs/helpers/theme.js deleted file mode 100644 index 5c6206869d..0000000000 --- a/packages/banxa/lib/commonjs/helpers/theme.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.banxaIsTheme = banxaIsTheme; -const supportedTheme = ['dark', 'light']; -function banxaIsTheme(value) { - return supportedTheme.includes(value); -} -//# sourceMappingURL=theme.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/theme.js.map b/packages/banxa/lib/commonjs/helpers/theme.js.map deleted file mode 100644 index d437330c95..0000000000 --- a/packages/banxa/lib/commonjs/helpers/theme.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["supportedTheme","banxaIsTheme","value","includes"],"sourceRoot":"../../../src","sources":["helpers/theme.ts"],"mappings":";;;;;;AAEA,MAAMA,cAAsC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU;AAElE,SAASC,YAAYA,CAACC,KAAU,EAAuB;EAC5D,OAAOF,cAAc,CAACG,QAAQ,CAACD,KAAmB,CAAC;AACrD"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/theme.test.js b/packages/banxa/lib/commonjs/helpers/theme.test.js deleted file mode 100644 index ed2a60f7ec..0000000000 --- a/packages/banxa/lib/commonjs/helpers/theme.test.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -var _theme = require("./theme"); -describe('banxaIsTheme', () => { - it('should return true for valid theme', () => { - const validTheme = ['dark', 'light']; - validTheme.forEach(theme => { - expect((0, _theme.banxaIsTheme)(theme)).toBe(true); - }); - }); - it('should return false for invalid theme', () => { - const invalidTheme = ['darks', 'lights', 'white', 'black', '', undefined, null, 123]; - invalidTheme.forEach(theme => { - expect((0, _theme.banxaIsTheme)(theme)).toBe(false); - }); - }); -}); -//# sourceMappingURL=theme.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/theme.test.js.map b/packages/banxa/lib/commonjs/helpers/theme.test.js.map deleted file mode 100644 index ead799015c..0000000000 --- a/packages/banxa/lib/commonjs/helpers/theme.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_theme","require","describe","it","validTheme","forEach","theme","expect","banxaIsTheme","toBe","invalidTheme","undefined"],"sourceRoot":"../../../src","sources":["helpers/theme.test.ts"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEAC,QAAQ,CAAC,cAAc,EAAE,MAAM;EAC7BC,EAAE,CAAC,oCAAoC,EAAE,MAAM;IAC7C,MAAMC,UAAwB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAElDA,UAAU,CAACC,OAAO,CAAEC,KAAK,IAAK;MAC5BC,MAAM,CAAC,IAAAC,mBAAY,EAACF,KAAK,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFN,EAAE,CAAC,uCAAuC,EAAE,MAAM;IAChD,MAAMO,YAAY,GAAG,CACnB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,EACP,EAAE,EACFC,SAAS,EACT,IAAI,EACJ,GAAG,CACJ;IAEDD,YAAY,CAACL,OAAO,CAAEC,KAAK,IAAK;MAC9BC,MAAM,CAAC,IAAAC,mBAAY,EAACF,KAAK,CAAC,CAAC,CAACG,IAAI,CAAC,KAAK,CAAC;IACzC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/wallet-address.js b/packages/banxa/lib/commonjs/helpers/wallet-address.js deleted file mode 100644 index 427a21fab8..0000000000 --- a/packages/banxa/lib/commonjs/helpers/wallet-address.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.banxaIsPossibleCardanoAddress = banxaIsPossibleCardanoAddress; -/** - * Validates if is possible Cardano mainnet or testnet address. - * We leave the address validation to the Banxa API, this is a simple check to avoid basic mistakes. - * Banxa referal link doesn't work with testnet addreses or byron addresses. - * @param {string} address - The Cardano address to validate. - * @returns {boolean} - Returns true if the address looks like a Cardano address. - */ -function banxaIsPossibleCardanoAddress(address) { - const shelleyRegex = /^(addr1)[0-9a-z]+$/; - return shelleyRegex.test(address); -} -//# sourceMappingURL=wallet-address.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/wallet-address.js.map b/packages/banxa/lib/commonjs/helpers/wallet-address.js.map deleted file mode 100644 index 94cbb32b4e..0000000000 --- a/packages/banxa/lib/commonjs/helpers/wallet-address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaIsPossibleCardanoAddress","address","shelleyRegex","test"],"sourceRoot":"../../../src","sources":["helpers/wallet-address.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,6BAA6BA,CAACC,OAAe,EAAE;EAC7D,MAAMC,YAAY,GAAG,oBAAoB;EACzC,OAAOA,YAAY,CAACC,IAAI,CAACF,OAAO,CAAC;AACnC"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/wallet-address.test.js b/packages/banxa/lib/commonjs/helpers/wallet-address.test.js deleted file mode 100644 index 3b70f3b48c..0000000000 --- a/packages/banxa/lib/commonjs/helpers/wallet-address.test.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -var _walletAddress = require("./wallet-address"); -describe('banxaIsPossibleCardanoAddress', () => { - // Test valid Byron addresses - test('should return false for valid Byron mainnet addresses', () => { - expect((0, _walletAddress.banxaIsPossibleCardanoAddress)('Ae2tdPwUPEZ5VwwZpNmy1ruH7mfmGv4JDqY4RiUZsMUTVDcsSsSh2Gu5noo')).toBe(false); - expect((0, _walletAddress.banxaIsPossibleCardanoAddress)('Ae2tdPwUPEZMK3H6mAmaSB1E4dGvcwRTe1tTkoSCNmQWBNxF6twLDwZoxt8')).toBe(false); - }); - - // Test valid Shelley addresses - test('should return true for valid Shelley mainnet addresses', () => { - expect((0, _walletAddress.banxaIsPossibleCardanoAddress)('addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3a6tavy5ndt3mw0mf9hskzg9q9nrg9kxxlt9jvl4ymkhdq6rs0vt')).toBe(true); - expect((0, _walletAddress.banxaIsPossibleCardanoAddress)('addr1qxlzhn7wya6s2c3x6px63hklwt2ss9f8s0v5c90v6w8wtfl5mv6m2tckwqlyvlwmnx9ct68fqk7nngeja4kvz65prdrquaj4lfl')).toBe(true); - }); - - // Test valid Shelley testnet addresses - test('should return false for valid Shelley testnet addresses', () => { - expect((0, _walletAddress.banxaIsPossibleCardanoAddress)('addr_test1q9xwspw7mcmrhlzsp5v3xxvtzgqhp5tkmdt6zydu9evmvg28gr8v6svtefqgghsk93y4qqtv7kjeg5k06c8qxy4r89agqheknqv')).toBe(false); - expect((0, _walletAddress.banxaIsPossibleCardanoAddress)('addr_test1qqlzhn7wya6s2c3x6px63hklwt2ss9f8s0v5c90v6w8wtfl5mv6m2tckwqlyvlwmnx9ct68fqk7nngeja4kvz65prdrqudmm25h')).toBe(false); - }); - - // Test invalid addresses - test('should return false for invalid addresses', () => { - expect((0, _walletAddress.banxaIsPossibleCardanoAddress)('invalidaddress123')).toBe(false); - expect((0, _walletAddress.banxaIsPossibleCardanoAddress)('0x1234567890abcdef')).toBe(false); - expect((0, _walletAddress.banxaIsPossibleCardanoAddress)('bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq')).toBe(false); - }); -}); -//# sourceMappingURL=wallet-address.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/helpers/wallet-address.test.js.map b/packages/banxa/lib/commonjs/helpers/wallet-address.test.js.map deleted file mode 100644 index a56cb8daab..0000000000 --- a/packages/banxa/lib/commonjs/helpers/wallet-address.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_walletAddress","require","describe","test","expect","banxaIsPossibleCardanoAddress","toBe"],"sourceRoot":"../../../src","sources":["helpers/wallet-address.test.ts"],"mappings":";;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAEAC,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9C;EACAC,IAAI,CAAC,uDAAuD,EAAE,MAAM;IAClEC,MAAM,CACJ,IAAAC,4CAA6B,EAC3B,6DACF,CACF,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;IACbF,MAAM,CACJ,IAAAC,4CAA6B,EAC3B,6DACF,CACF,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;EACf,CAAC,CAAC;;EAEF;EACAH,IAAI,CAAC,wDAAwD,EAAE,MAAM;IACnEC,MAAM,CACJ,IAAAC,4CAA6B,EAC3B,yGACF,CACF,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;IACZF,MAAM,CACJ,IAAAC,4CAA6B,EAC3B,0GACF,CACF,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;EACd,CAAC,CAAC;;EAEF;EACAH,IAAI,CAAC,yDAAyD,EAAE,MAAM;IACpEC,MAAM,CACJ,IAAAC,4CAA6B,EAC3B,+GACF,CACF,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;IACbF,MAAM,CACJ,IAAAC,4CAA6B,EAC3B,+GACF,CACF,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;EACf,CAAC,CAAC;;EAEF;EACAH,IAAI,CAAC,2CAA2C,EAAE,MAAM;IACtDC,MAAM,CAAC,IAAAC,4CAA6B,EAAC,mBAAmB,CAAC,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;IACtEF,MAAM,CAAC,IAAAC,4CAA6B,EAAC,oBAAoB,CAAC,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;IACvEF,MAAM,CACJ,IAAAC,4CAA6B,EAC3B,4CACF,CACF,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;EACf,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/index.js b/packages/banxa/lib/commonjs/index.js deleted file mode 100644 index f6625c8f56..0000000000 --- a/packages/banxa/lib/commonjs/index.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Banxa = void 0; -Object.defineProperty(exports, "BanxaErrorMessages", { - enumerable: true, - get: function () { - return _errors.BanxaErrorMessages; - } -}); -Object.defineProperty(exports, "banxaDomainProduction", { - enumerable: true, - get: function () { - return _domains.banxaDomainProduction; - } -}); -Object.defineProperty(exports, "banxaDomainSandbox", { - enumerable: true, - get: function () { - return _domains.banxaDomainSandbox; - } -}); -Object.defineProperty(exports, "banxaModuleMaker", { - enumerable: true, - get: function () { - return _module.banxaModuleMaker; - } -}); -Object.defineProperty(exports, "banxaSupportUrl", { - enumerable: true, - get: function () { - return _domains.banxaSupportUrl; - } -}); -var _domains = require("./translators/domains"); -var _module = require("./translators/module"); -var _errors = require("./adapters/errors"); -let Banxa; -exports.Banxa = Banxa; -(function (_Banxa) {})(Banxa || (exports.Banxa = Banxa = {})); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/index.js.map b/packages/banxa/lib/commonjs/index.js.map deleted file mode 100644 index cc25e6a70c..0000000000 --- a/packages/banxa/lib/commonjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_domains","require","_module","_errors","Banxa","exports","_Banxa"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAoD,IAAAG,KAAA;AAAAC,OAAA,CAAAD,KAAA,GAAAA,KAAA;AAAA,WAAAE,MAAA,MAYnCF,KAAK,KAAAC,OAAA,CAAAD,KAAA,GAALA,KAAK"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/translators/domains.js b/packages/banxa/lib/commonjs/translators/domains.js deleted file mode 100644 index bab18c11e6..0000000000 --- a/packages/banxa/lib/commonjs/translators/domains.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.banxaSupportUrl = exports.banxaDomainSandbox = exports.banxaDomainProduction = void 0; -const banxaDomainProduction = 'banxa.com'; -exports.banxaDomainProduction = banxaDomainProduction; -const banxaDomainSandbox = 'banxa-sandbox.com'; -exports.banxaDomainSandbox = banxaDomainSandbox; -const banxaSupportUrl = 'https://support.banxa.com/'; -exports.banxaSupportUrl = banxaSupportUrl; -//# sourceMappingURL=domains.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/translators/domains.js.map b/packages/banxa/lib/commonjs/translators/domains.js.map deleted file mode 100644 index 5eebce174d..0000000000 --- a/packages/banxa/lib/commonjs/translators/domains.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaDomainProduction","exports","banxaDomainSandbox","banxaSupportUrl"],"sourceRoot":"../../../src","sources":["translators/domains.ts"],"mappings":";;;;;;AAAO,MAAMA,qBAAqB,GAAG,WAAW;AAAAC,OAAA,CAAAD,qBAAA,GAAAA,qBAAA;AACzC,MAAME,kBAAkB,GAAG,mBAAmB;AAAAD,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAC9C,MAAMC,eAAe,GAAG,4BAA4B;AAAAF,OAAA,CAAAE,eAAA,GAAAA,eAAA"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/translators/module.js b/packages/banxa/lib/commonjs/translators/module.js deleted file mode 100644 index e3bb2b4ad6..0000000000 --- a/packages/banxa/lib/commonjs/translators/module.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.banxaModuleMaker = void 0; -var _errors = require("../adapters/errors"); -var _domains = require("./domains"); -var _zodErrors = require("../adapters/zod-errors"); -var _zodSchema = require("../adapters/zod-schema"); -// ------- -// FACTORY -/** - * Creates an object that provides functionality to Banxa capabilities. - * - * @param {BanxaUrlReferralBuilderOptions} options - Configuration options for the referral link generation. - * @param {string} [options.partner] - The partner name, e.g., "checkout". - * @param {boolean} [options.isProduction=false] - Indicates if the function should generate production or sandbox URLs. - * - * @returns {BanxaModule} An object with methods to generate Banxa referral links. - */ -const banxaModuleMaker = function (_ref) { - let { - partner, - isProduction - } = _ref; - let { - zodErrorTranslator = _zodErrors.handleZodErrors - } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const domain = isProduction ? _domains.banxaDomainProduction : _domains.banxaDomainSandbox; - const baseUrl = `https://${partner}.${domain}`; - - /** - * Create a Banxa referral URL based on query parameters. - * @param queries - Query parameters for generating the Banxa referral URL. - * @returns A URL object representing the generated Banxa referral link. - * @throws {BanxaValidationError | BanxaUnknownError} Throws specific errors if validation fails or an unknown error occurs. - */ - const createReferralUrl = queries => { - try { - const validatedQueries = _zodSchema.BanxaUrlReferralQueryStringParamsSchema.parse(queries); - const url = new URL(baseUrl); - const params = new URLSearchParams(); - for (const [key, value] of Object.entries(validatedQueries)) { - params.append(key, value.toString()); - } - url.search = params.toString(); - return url; - } catch (error) { - zodErrorTranslator(error); - throw new _errors.BanxaUnknownError(JSON.stringify(error)); // TS doesn't know that zodErrorTranslator will throw - } - }; - - return { - createReferralUrl - }; -}; - -// ----- -// TYPES - -// https://docs.banxa.com/docs/referral-method -exports.banxaModuleMaker = banxaModuleMaker; -//# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/translators/module.js.map b/packages/banxa/lib/commonjs/translators/module.js.map deleted file mode 100644 index 7a5265a792..0000000000 --- a/packages/banxa/lib/commonjs/translators/module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_errors","require","_domains","_zodErrors","_zodSchema","banxaModuleMaker","_ref","partner","isProduction","zodErrorTranslator","handleZodErrors","arguments","length","undefined","domain","banxaDomainProduction","banxaDomainSandbox","baseUrl","createReferralUrl","queries","validatedQueries","BanxaUrlReferralQueryStringParamsSchema","parse","url","URL","params","URLSearchParams","key","value","Object","entries","append","toString","search","error","BanxaUnknownError","JSON","stringify","exports"],"sourceRoot":"../../../src","sources":["translators/module.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,gBAAgB,GAAG,SAAAA,CAAAC,IAAA,EAGd;EAAA,IAFhB;IAACC,OAAO;IAAEC;EAA4C,CAAC,GAAAF,IAAA;EAAA,IACvD;IAACG,kBAAkB,GAAGC;EAAe,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE3C,MAAMG,MAAM,GAAGN,YAAY,GAAGO,8BAAqB,GAAGC,2BAAkB;EACxE,MAAMC,OAAO,GAAI,WAAUV,OAAQ,IAAGO,MAAO,EAAC;;EAE9C;AACF;AACA;AACA;AACA;AACA;EACE,MAAMI,iBAAiB,GAAIC,OAA0C,IAAK;IACxE,IAAI;MACF,MAAMC,gBAAgB,GACpBC,kDAAuC,CAACC,KAAK,CAACH,OAAO,CAAC;MACxD,MAAMI,GAAG,GAAG,IAAIC,GAAG,CAACP,OAAO,CAAC;MAC5B,MAAMQ,MAAM,GAAG,IAAIC,eAAe,CAAC,CAAC;MACpC,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACV,gBAAgB,CAAC,EAAE;QAC3DK,MAAM,CAACM,MAAM,CAACJ,GAAG,EAAEC,KAAK,CAACI,QAAQ,CAAC,CAAC,CAAC;MACtC;MACAT,GAAG,CAACU,MAAM,GAAGR,MAAM,CAACO,QAAQ,CAAC,CAAC;MAC9B,OAAOT,GAAG;IACZ,CAAC,CAAC,OAAOW,KAAK,EAAE;MACdzB,kBAAkB,CAACyB,KAAK,CAAC;MACzB,MAAM,IAAIC,yBAAiB,CAACC,IAAI,CAACC,SAAS,CAACH,KAAK,CAAC,CAAC,EAAC;IACrD;EACF,CAAC;;EAED,OAAO;IACLhB;EACF,CAAC;AACH,CAAC;;AAED;AACA;;AAQA;AAAAoB,OAAA,CAAAjC,gBAAA,GAAAA,gBAAA"} \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/translators/module.test.js b/packages/banxa/lib/commonjs/translators/module.test.js deleted file mode 100644 index 8485c22f1e..0000000000 --- a/packages/banxa/lib/commonjs/translators/module.test.js +++ /dev/null @@ -1,113 +0,0 @@ -"use strict"; - -var _errors = require("../adapters/errors"); -var _module = require("./module"); -describe('banxaModuleMaker', () => { - test('should generate a correct referral link with all parameters', () => { - const banxa = (0, _module.banxaModuleMaker)({ - partner: 'checkout', - isProduction: true - }); - const fullUrl = 'https://checkout.banxa.com/?' + 'orderType=sell' + '&' + 'fiatType=USD' + '&' + 'fiatAmount=500' + '&' + 'coinType=ADA' + '&' + 'coinAmount=800' + '&' + 'blockchain=ADA' + '&' + 'walletAddress=addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' + '&' + 'walletAddressTag=tag'; - const url = banxa.createReferralUrl({ - orderType: 'sell', - fiatType: 'USD', - fiatAmount: 500, - coinType: 'ADA', - coinAmount: 800, - blockchain: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf', - walletAddressTag: 'tag' - }); - expect(url.toString()).toBe(fullUrl); - }); - test('should generate a correct referral link with mandatory parameters only', () => { - const banxa = (0, _module.banxaModuleMaker)({ - partner: 'checkout', - isProduction: true - }); - const fullUrl = 'https://checkout.banxa.com/?' + 'fiatType=USD' + '&' + 'coinType=ADA' + '&' + 'walletAddress=addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf'; - const url = banxa.createReferralUrl({ - fiatType: 'USD', - coinType: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' - }); - expect(url.toString()).toBe(fullUrl); - }); - test('should generate a correct sandbox referral link', () => { - const banxa = (0, _module.banxaModuleMaker)({ - partner: 'checkout', - isProduction: false - }); - const fullUrl = 'https://checkout.banxa-sandbox.com/?' + 'fiatType=USD' + '&' + 'coinType=ADA' + '&' + 'walletAddress=addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf'; - const url = banxa.createReferralUrl({ - fiatType: 'USD', - coinType: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' - }); - expect(url.toString()).toBe(fullUrl); - }); - test('should not include undefined optional parameters in the referral link', () => { - const banxa = (0, _module.banxaModuleMaker)({ - partner: 'checkout', - isProduction: true - }); - const url = banxa.createReferralUrl({ - fiatType: 'USD', - coinType: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' - }); - const urlString = url.toString(); - expect(urlString).not.toContain('sellMode'); - expect(urlString).not.toContain('fiatAmount'); - expect(urlString).not.toContain('coinAmount'); - expect(urlString).not.toContain('blockchain'); - expect(urlString).not.toContain('walletAddressTag'); - }); - test('should throw an BanxaValidationError when schema is invalid', () => { - const banxa = (0, _module.banxaModuleMaker)({ - partner: 'checkout', - isProduction: true - }); - const invalidQueries = { - fiatType: 'ABC', - // Invalid fiatType - coinType: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' - }; - expect(() => { - banxa.createReferralUrl(invalidQueries); - }).toThrow(_errors.BanxaValidationError); - }); - test('should throw an error when ADA walletAddress is not a possible Cardano address', () => { - const banxa = (0, _module.banxaModuleMaker)({ - partner: 'checkout', - isProduction: true - }); - const invalidQueries = { - fiatType: 'USD', - coinType: 'ADA', - walletAddress: 'invalid-cardano-address' - }; - expect(() => { - banxa.createReferralUrl(invalidQueries); - }).toThrow(_errors.BanxaValidationError); - }); - test('should throw BanxaUnknownError if is not a BanxaValidationError', () => { - const banxa = (0, _module.banxaModuleMaker)({ - partner: 'checkout', - isProduction: true - }, { - zodErrorTranslator: () => {} - }); - const invalidQueries = { - fiatType: 'XXX', - coinType: 'XXX', - walletAddress: 'XXX' - }; - expect(() => { - banxa.createReferralUrl(invalidQueries); - }).toThrow(_errors.BanxaUnknownError); - }); -}); -//# sourceMappingURL=module.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/commonjs/translators/module.test.js.map b/packages/banxa/lib/commonjs/translators/module.test.js.map deleted file mode 100644 index 302e26e181..0000000000 --- a/packages/banxa/lib/commonjs/translators/module.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_errors","require","_module","describe","test","banxa","banxaModuleMaker","partner","isProduction","fullUrl","url","createReferralUrl","orderType","fiatType","fiatAmount","coinType","coinAmount","blockchain","walletAddress","walletAddressTag","expect","toString","toBe","urlString","not","toContain","invalidQueries","toThrow","BanxaValidationError","zodErrorTranslator","BanxaUnknownError"],"sourceRoot":"../../../src","sources":["translators/module.test.ts"],"mappings":"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"} \ No newline at end of file diff --git a/packages/banxa/lib/module/adapters/errors.js b/packages/banxa/lib/module/adapters/errors.js deleted file mode 100644 index 36f94d9931..0000000000 --- a/packages/banxa/lib/module/adapters/errors.js +++ /dev/null @@ -1,17 +0,0 @@ -export const BanxaErrorMessages = { - ValidationError: 'ValidationError', - UnknownError: 'Unknown error' -}; -export class BanxaValidationError extends Error { - constructor(message) { - super(message); - this.name = 'ValidationError'; - } -} -export class BanxaUnknownError extends Error { - constructor(message) { - super(message); - this.name = 'UnknownError'; - } -} -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/adapters/errors.js.map b/packages/banxa/lib/module/adapters/errors.js.map deleted file mode 100644 index 984856eb81..0000000000 --- a/packages/banxa/lib/module/adapters/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["BanxaErrorMessages","ValidationError","UnknownError","BanxaValidationError","Error","constructor","message","name","BanxaUnknownError"],"sourceRoot":"../../../src","sources":["adapters/errors.ts"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG;EAChCC,eAAe,EAAE,iBAAiB;EAClCC,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,oBAAoB,SAASC,KAAK,CAAC;EAC9CC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,iBAAiB;EAC/B;AACF;AAEA,OAAO,MAAMC,iBAAiB,SAASJ,KAAK,CAAC;EAC3CC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,cAAc;EAC5B;AACF"} \ No newline at end of file diff --git a/packages/banxa/lib/module/adapters/zod-errors.js b/packages/banxa/lib/module/adapters/zod-errors.js deleted file mode 100644 index e0fd630397..0000000000 --- a/packages/banxa/lib/module/adapters/zod-errors.js +++ /dev/null @@ -1,20 +0,0 @@ -import { BanxaUnknownError, BanxaValidationError } from './errors'; -import { ZodError } from 'zod'; - -/** - * Converts a ZodError or Error to a BanxaError. - * @param error - The error to convert. - * @throws An appropriate BanxaError based on zod error, or ignore it. - */ -export function handleZodErrors(error) { - if (error instanceof ZodError) { - const errorDetails = error.issues.map(e => ({ - field: e.path.join('.'), - message: e.message - })); - const errorMessage = `Invalid data: ${errorDetails.map(e => `${e.field}: ${e.message}`).join(', ')}`; - throw new BanxaValidationError(errorMessage); - } - throw new BanxaUnknownError(JSON.stringify(error)); -} -//# sourceMappingURL=zod-errors.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/adapters/zod-errors.js.map b/packages/banxa/lib/module/adapters/zod-errors.js.map deleted file mode 100644 index 5a21dc1f14..0000000000 --- a/packages/banxa/lib/module/adapters/zod-errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["BanxaUnknownError","BanxaValidationError","ZodError","handleZodErrors","error","errorDetails","issues","map","e","field","path","join","message","errorMessage","JSON","stringify"],"sourceRoot":"../../../src","sources":["adapters/zod-errors.ts"],"mappings":"AAAA,SAAQA,iBAAiB,EAAEC,oBAAoB,QAAO,UAAU;AAChE,SAAQC,QAAQ,QAAO,KAAK;;AAE5B;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACC,KAAqB,EAAE;EACrD,IAAIA,KAAK,YAAYF,QAAQ,EAAE;IAC7B,MAAMG,YAAY,GAAGD,KAAK,CAACE,MAAM,CAACC,GAAG,CAAEC,CAAC,KAAM;MAC5CC,KAAK,EAAED,CAAC,CAACE,IAAI,CAACC,IAAI,CAAC,GAAG,CAAC;MACvBC,OAAO,EAAEJ,CAAC,CAACI;IACb,CAAC,CAAC,CAAC;IACH,MAAMC,YAAY,GAAI,iBAAgBR,YAAY,CAC/CE,GAAG,CAAEC,CAAC,IAAM,GAAEA,CAAC,CAACC,KAAM,KAAID,CAAC,CAACI,OAAQ,EAAC,CAAC,CACtCD,IAAI,CAAC,IAAI,CAAE,EAAC;IACf,MAAM,IAAIV,oBAAoB,CAACY,YAAY,CAAC;EAC9C;EACA,MAAM,IAAIb,iBAAiB,CAACc,IAAI,CAACC,SAAS,CAACX,KAAK,CAAC,CAAC;AACpD"} \ No newline at end of file diff --git a/packages/banxa/lib/module/adapters/zod-errors.test.js b/packages/banxa/lib/module/adapters/zod-errors.test.js deleted file mode 100644 index 1c60a29b17..0000000000 --- a/packages/banxa/lib/module/adapters/zod-errors.test.js +++ /dev/null @@ -1,42 +0,0 @@ -import { handleZodErrors } from './zod-errors'; -import { BanxaUnknownError, BanxaValidationError } from './errors'; -import { z } from 'zod'; -describe('handleZodErrors', () => { - const testSchema = z.object({ - name: z.string(), - age: z.number() - }); - test('should convert a ZodError into a ValidationError', () => { - const invalidData = { - name: 123, - age: 'John Doe' - }; - try { - testSchema.parse(invalidData); - } catch (error) { - expect(error).toBeInstanceOf(z.ZodError); - - // Handle the error - let handledError; - try { - handleZodErrors(error); - } catch (e) { - var _handledError; - handledError = e; - expect(handledError).toBeInstanceOf(BanxaValidationError); - expect((_handledError = handledError) === null || _handledError === void 0 ? void 0 : _handledError.message).toBe('Invalid data: name: Expected string, received number, age: Expected number, received string'); - } - } - }); - test('should re-throw an error that is not a ZodError', () => { - const someOtherError = new Error('Some other error'); - let handledError; - try { - handleZodErrors(someOtherError); - } catch (e) { - handledError = e; - } - expect(handledError).toBeInstanceOf(BanxaUnknownError); - }); -}); -//# sourceMappingURL=zod-errors.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/adapters/zod-errors.test.js.map b/packages/banxa/lib/module/adapters/zod-errors.test.js.map deleted file mode 100644 index a9d240359c..0000000000 --- a/packages/banxa/lib/module/adapters/zod-errors.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["handleZodErrors","BanxaUnknownError","BanxaValidationError","z","describe","testSchema","object","name","string","age","number","test","invalidData","parse","error","expect","toBeInstanceOf","ZodError","handledError","e","_handledError","message","toBe","someOtherError","Error"],"sourceRoot":"../../../src","sources":["adapters/zod-errors.test.ts"],"mappings":"AAAA,SAAQA,eAAe,QAAO,cAAc;AAC5C,SAAQC,iBAAiB,EAAEC,oBAAoB,QAAO,UAAU;AAChE,SAAQC,CAAC,QAAO,KAAK;AAErBC,QAAQ,CAAC,iBAAiB,EAAE,MAAM;EAChC,MAAMC,UAAU,GAAGF,CAAC,CAACG,MAAM,CAAC;IAC1BC,IAAI,EAAEJ,CAAC,CAACK,MAAM,CAAC,CAAC;IAChBC,GAAG,EAAEN,CAAC,CAACO,MAAM,CAAC;EAChB,CAAC,CAAC;EAEFC,IAAI,CAAC,kDAAkD,EAAE,MAAM;IAC7D,MAAMC,WAAW,GAAG;MAClBL,IAAI,EAAE,GAAG;MACTE,GAAG,EAAE;IACP,CAAC;IAED,IAAI;MACFJ,UAAU,CAACQ,KAAK,CAACD,WAAW,CAAC;IAC/B,CAAC,CAAC,OAAOE,KAAK,EAAE;MACdC,MAAM,CAACD,KAAK,CAAC,CAACE,cAAc,CAACb,CAAC,CAACc,QAAQ,CAAC;;MAExC;MACA,IAAIC,YAAY;MAChB,IAAI;QACFlB,eAAe,CAACc,KAAK,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAM,EAAE;QAAA,IAAAC,aAAA;QACfF,YAAY,GAAGC,CAAC;QAEhBJ,MAAM,CAACG,YAAY,CAAC,CAACF,cAAc,CAACd,oBAAoB,CAAC;QACzDa,MAAM,EAAAK,aAAA,GAACF,YAAY,cAAAE,aAAA,uBAAZA,aAAA,CAAcC,OAAO,CAAC,CAACC,IAAI,CAChC,6FACF,CAAC;MACH;IACF;EACF,CAAC,CAAC;EAEFX,IAAI,CAAC,iDAAiD,EAAE,MAAM;IAC5D,MAAMY,cAAc,GAAG,IAAIC,KAAK,CAAC,kBAAkB,CAAC;IAEpD,IAAIN,YAAY;IAChB,IAAI;MACFlB,eAAe,CAACuB,cAAc,CAAC;IACjC,CAAC,CAAC,OAAOJ,CAAC,EAAE;MACVD,YAAY,GAAGC,CAAC;IAClB;IAEAJ,MAAM,CAACG,YAAY,CAAC,CAACF,cAAc,CAACf,iBAAiB,CAAC;EACxD,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/module/adapters/zod-schema.js b/packages/banxa/lib/module/adapters/zod-schema.js deleted file mode 100644 index 7545897e80..0000000000 --- a/packages/banxa/lib/module/adapters/zod-schema.js +++ /dev/null @@ -1,26 +0,0 @@ -import { z } from 'zod'; -import { banxaIsCoinType } from '../helpers/coin-types'; -import { banxaIsFiatType } from '../helpers/fiat-types'; -import { banxaIsPossibleCardanoAddress } from '../helpers/wallet-address'; -import { banxaIsBlockchainCode } from '../helpers/blockchain-code'; -import { banxaIsOrderType } from '../helpers/order-types'; -import { banxaIsTheme } from '../helpers/theme'; -export const BanxaUrlReferralQueryStringParamsSchema = z.object({ - orderType: z.string().refine(banxaIsOrderType).optional(), - fiatType: z.string().refine(banxaIsFiatType), - fiatAmount: z.number().optional(), - coinType: z.string().refine(banxaIsCoinType), - coinAmount: z.number().optional(), - blockchain: z.string().refine(banxaIsBlockchainCode).optional(), - walletAddress: z.string(), - walletAddressTag: z.string().optional(), - backgroundColor: z.string().optional(), - primaryColor: z.string().optional(), - secondaryColor: z.string().optional(), - textColor: z.string().optional(), - theme: z.string().refine(banxaIsTheme).optional(), - returnUrl: z.string().optional() -}).refine(data => { - return (data.coinType === 'ADA' || data.coinType === 'TADA') && banxaIsPossibleCardanoAddress(data.walletAddress); -}); -//# sourceMappingURL=zod-schema.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/adapters/zod-schema.js.map b/packages/banxa/lib/module/adapters/zod-schema.js.map deleted file mode 100644 index 50a9fd696f..0000000000 --- a/packages/banxa/lib/module/adapters/zod-schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["z","banxaIsCoinType","banxaIsFiatType","banxaIsPossibleCardanoAddress","banxaIsBlockchainCode","banxaIsOrderType","banxaIsTheme","BanxaUrlReferralQueryStringParamsSchema","object","orderType","string","refine","optional","fiatType","fiatAmount","number","coinType","coinAmount","blockchain","walletAddress","walletAddressTag","backgroundColor","primaryColor","secondaryColor","textColor","theme","returnUrl","data"],"sourceRoot":"../../../src","sources":["adapters/zod-schema.ts"],"mappings":"AAAA,SAAQA,CAAC,QAAO,KAAK;AAErB,SAAQC,eAAe,QAAO,uBAAuB;AACrD,SAAQC,eAAe,QAAO,uBAAuB;AACrD,SAAQC,6BAA6B,QAAO,2BAA2B;AACvE,SAAQC,qBAAqB,QAAO,4BAA4B;AAChE,SAAQC,gBAAgB,QAAO,wBAAwB;AACvD,SAAQC,YAAY,QAAO,kBAAkB;AAE7C,OAAO,MAAMC,uCAAuC,GAAGP,CAAC,CACrDQ,MAAM,CAAC;EACNC,SAAS,EAAET,CAAC,CAACU,MAAM,CAAC,CAAC,CAACC,MAAM,CAACN,gBAAgB,CAAC,CAACO,QAAQ,CAAC,CAAC;EACzDC,QAAQ,EAAEb,CAAC,CAACU,MAAM,CAAC,CAAC,CAACC,MAAM,CAACT,eAAe,CAAC;EAC5CY,UAAU,EAAEd,CAAC,CAACe,MAAM,CAAC,CAAC,CAACH,QAAQ,CAAC,CAAC;EACjCI,QAAQ,EAAEhB,CAAC,CAACU,MAAM,CAAC,CAAC,CAACC,MAAM,CAACV,eAAe,CAAC;EAC5CgB,UAAU,EAAEjB,CAAC,CAACe,MAAM,CAAC,CAAC,CAACH,QAAQ,CAAC,CAAC;EACjCM,UAAU,EAAElB,CAAC,CAACU,MAAM,CAAC,CAAC,CAACC,MAAM,CAACP,qBAAqB,CAAC,CAACQ,QAAQ,CAAC,CAAC;EAC/DO,aAAa,EAAEnB,CAAC,CAACU,MAAM,CAAC,CAAC;EACzBU,gBAAgB,EAAEpB,CAAC,CAACU,MAAM,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EACvCS,eAAe,EAAErB,CAAC,CAACU,MAAM,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EACtCU,YAAY,EAAEtB,CAAC,CAACU,MAAM,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EACnCW,cAAc,EAAEvB,CAAC,CAACU,MAAM,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EACrCY,SAAS,EAAExB,CAAC,CAACU,MAAM,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EAChCa,KAAK,EAAEzB,CAAC,CAACU,MAAM,CAAC,CAAC,CAACC,MAAM,CAACL,YAAY,CAAC,CAACM,QAAQ,CAAC,CAAC;EACjDc,SAAS,EAAE1B,CAAC,CAACU,MAAM,CAAC,CAAC,CAACE,QAAQ,CAAC;AACjC,CAAC,CAAC,CACDD,MAAM,CAAEgB,IAAI,IAAK;EAChB,OACE,CAACA,IAAI,CAACX,QAAQ,KAAK,KAAK,IAAIW,IAAI,CAACX,QAAQ,KAAK,MAAM,KACpDb,6BAA6B,CAACwB,IAAI,CAACR,aAAa,CAAC;AAErD,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/blockchain-code.js b/packages/banxa/lib/module/helpers/blockchain-code.js deleted file mode 100644 index 0d281a6604..0000000000 --- a/packages/banxa/lib/module/helpers/blockchain-code.js +++ /dev/null @@ -1,5 +0,0 @@ -const banxaSupportedBlockchainCodes = ['ADA']; -export function banxaIsBlockchainCode(value) { - return banxaSupportedBlockchainCodes.includes(value); -} -//# sourceMappingURL=blockchain-code.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/blockchain-code.js.map b/packages/banxa/lib/module/helpers/blockchain-code.js.map deleted file mode 100644 index 7e8746611c..0000000000 --- a/packages/banxa/lib/module/helpers/blockchain-code.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaSupportedBlockchainCodes","banxaIsBlockchainCode","value","includes"],"sourceRoot":"../../../src","sources":["helpers/blockchain-code.ts"],"mappings":"AAEA,MAAMA,6BAA8D,GAAG,CACrE,KAAK,CACG;AAEV,OAAO,SAASC,qBAAqBA,CACnCC,KAAU,EACoB;EAC9B,OAAOF,6BAA6B,CAACG,QAAQ,CAACD,KAA4B,CAAC;AAC7E"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/blockchain-code.test.js b/packages/banxa/lib/module/helpers/blockchain-code.test.js deleted file mode 100644 index e3c53cbde6..0000000000 --- a/packages/banxa/lib/module/helpers/blockchain-code.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import { banxaIsBlockchainCode } from './blockchain-code'; -describe('banxaIsBlockchainCode', () => { - it('should return true for valid blockchain codes', () => { - const validCoinTypes = ['ADA']; - validCoinTypes.forEach(coinType => { - expect(banxaIsBlockchainCode(coinType)).toBe(true); - }); - }); - it('should return false for invalid blockchain codes', () => { - const invalidCoinTypes = ['XRP', 'DOGE', '', undefined, null, 123]; - invalidCoinTypes.forEach(coinType => { - expect(banxaIsBlockchainCode(coinType)).toBe(false); - }); - }); -}); -//# sourceMappingURL=blockchain-code.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/blockchain-code.test.js.map b/packages/banxa/lib/module/helpers/blockchain-code.test.js.map deleted file mode 100644 index c25d274fe7..0000000000 --- a/packages/banxa/lib/module/helpers/blockchain-code.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaIsBlockchainCode","describe","it","validCoinTypes","forEach","coinType","expect","toBe","invalidCoinTypes","undefined"],"sourceRoot":"../../../src","sources":["helpers/blockchain-code.test.ts"],"mappings":"AAAA,SAAQA,qBAAqB,QAA4B,mBAAmB;AAE5EC,QAAQ,CAAC,uBAAuB,EAAE,MAAM;EACtCC,EAAE,CAAC,+CAA+C,EAAE,MAAM;IACxD,MAAMC,cAAqC,GAAG,CAAC,KAAK,CAAC;IAErDA,cAAc,CAACC,OAAO,CAAEC,QAAQ,IAAK;MACnCC,MAAM,CAACN,qBAAqB,CAACK,QAAQ,CAAC,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;IACpD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFL,EAAE,CAAC,kDAAkD,EAAE,MAAM;IAC3D,MAAMM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAEC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC;IAElED,gBAAgB,CAACJ,OAAO,CAAEC,QAAQ,IAAK;MACrCC,MAAM,CAACN,qBAAqB,CAACK,QAAQ,CAAC,CAAC,CAACE,IAAI,CAAC,KAAK,CAAC;IACrD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/coin-types.js b/packages/banxa/lib/module/helpers/coin-types.js deleted file mode 100644 index 1d9de88708..0000000000 --- a/packages/banxa/lib/module/helpers/coin-types.js +++ /dev/null @@ -1,5 +0,0 @@ -const banxaSupportedCoinTypes = ['ADA']; -export function banxaIsCoinType(value) { - return banxaSupportedCoinTypes.includes(value); -} -//# sourceMappingURL=coin-types.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/coin-types.js.map b/packages/banxa/lib/module/helpers/coin-types.js.map deleted file mode 100644 index 5f6d0a46d5..0000000000 --- a/packages/banxa/lib/module/helpers/coin-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaSupportedCoinTypes","banxaIsCoinType","value","includes"],"sourceRoot":"../../../src","sources":["helpers/coin-types.ts"],"mappings":"AAEA,MAAMA,uBAAkD,GAAG,CAAC,KAAK,CAAU;AAE3E,OAAO,SAASC,eAAeA,CAACC,KAAU,EAA0B;EAClE,OAAOF,uBAAuB,CAACG,QAAQ,CAACD,KAAsB,CAAC;AACjE"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/coin-types.test.js b/packages/banxa/lib/module/helpers/coin-types.test.js deleted file mode 100644 index 8df6ac14e2..0000000000 --- a/packages/banxa/lib/module/helpers/coin-types.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import { banxaIsCoinType } from './coin-types'; -describe('banxaIsCoinType', () => { - it('should return true for valid coin types', () => { - const validCoinTypes = ['ADA']; - validCoinTypes.forEach(coinType => { - expect(banxaIsCoinType(coinType)).toBe(true); - }); - }); - it('should return false for invalid coin types', () => { - const invalidCoinTypes = ['XRP', 'DOGE', '', undefined, null, 123]; - invalidCoinTypes.forEach(coinType => { - expect(banxaIsCoinType(coinType)).toBe(false); - }); - }); -}); -//# sourceMappingURL=coin-types.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/coin-types.test.js.map b/packages/banxa/lib/module/helpers/coin-types.test.js.map deleted file mode 100644 index 12a56af902..0000000000 --- a/packages/banxa/lib/module/helpers/coin-types.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaIsCoinType","describe","it","validCoinTypes","forEach","coinType","expect","toBe","invalidCoinTypes","undefined"],"sourceRoot":"../../../src","sources":["helpers/coin-types.test.ts"],"mappings":"AAAA,SAAQA,eAAe,QAAsB,cAAc;AAE3DC,QAAQ,CAAC,iBAAiB,EAAE,MAAM;EAChCC,EAAE,CAAC,yCAAyC,EAAE,MAAM;IAClD,MAAMC,cAA+B,GAAG,CAAC,KAAK,CAAC;IAE/CA,cAAc,CAACC,OAAO,CAAEC,QAAQ,IAAK;MACnCC,MAAM,CAACN,eAAe,CAACK,QAAQ,CAAC,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;IAC9C,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFL,EAAE,CAAC,4CAA4C,EAAE,MAAM;IACrD,MAAMM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAEC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC;IAElED,gBAAgB,CAACJ,OAAO,CAAEC,QAAQ,IAAK;MACrCC,MAAM,CAACN,eAAe,CAACK,QAAQ,CAAC,CAAC,CAACE,IAAI,CAAC,KAAK,CAAC;IAC/C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/fiat-types.js b/packages/banxa/lib/module/helpers/fiat-types.js deleted file mode 100644 index a924b05928..0000000000 --- a/packages/banxa/lib/module/helpers/fiat-types.js +++ /dev/null @@ -1,5 +0,0 @@ -const supportedFiatTypes = ['USD', 'EUR']; -export function banxaIsFiatType(value) { - return supportedFiatTypes.includes(value); -} -//# sourceMappingURL=fiat-types.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/fiat-types.js.map b/packages/banxa/lib/module/helpers/fiat-types.js.map deleted file mode 100644 index c7bb644854..0000000000 --- a/packages/banxa/lib/module/helpers/fiat-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["supportedFiatTypes","banxaIsFiatType","value","includes"],"sourceRoot":"../../../src","sources":["helpers/fiat-types.ts"],"mappings":"AAEA,MAAMA,kBAA6C,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU;AAE7E,OAAO,SAASC,eAAeA,CAACC,KAAU,EAA0B;EAClE,OAAOF,kBAAkB,CAACG,QAAQ,CAACD,KAAsB,CAAC;AAC5D"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/fiat-types.test.js b/packages/banxa/lib/module/helpers/fiat-types.test.js deleted file mode 100644 index 15f7951128..0000000000 --- a/packages/banxa/lib/module/helpers/fiat-types.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import { banxaIsFiatType } from './fiat-types'; -describe('banxaIsFiatType', () => { - it('should return true for valid fiat types', () => { - const validFiatTypes = ['USD', 'EUR']; - validFiatTypes.forEach(fiatType => { - expect(banxaIsFiatType(fiatType)).toBe(true); - }); - }); - it('should return false for invalid fiat types', () => { - const invalidFiatTypes = ['GBP', 'JPY', 'AUD', '', undefined, null, 123]; - invalidFiatTypes.forEach(fiatType => { - expect(banxaIsFiatType(fiatType)).toBe(false); - }); - }); -}); -//# sourceMappingURL=fiat-types.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/fiat-types.test.js.map b/packages/banxa/lib/module/helpers/fiat-types.test.js.map deleted file mode 100644 index 64f2000709..0000000000 --- a/packages/banxa/lib/module/helpers/fiat-types.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaIsFiatType","describe","it","validFiatTypes","forEach","fiatType","expect","toBe","invalidFiatTypes","undefined"],"sourceRoot":"../../../src","sources":["helpers/fiat-types.test.ts"],"mappings":"AAAA,SAAQA,eAAe,QAAsB,cAAc;AAE3DC,QAAQ,CAAC,iBAAiB,EAAE,MAAM;EAChCC,EAAE,CAAC,yCAAyC,EAAE,MAAM;IAClD,MAAMC,cAA+B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC;IAEtDA,cAAc,CAACC,OAAO,CAAEC,QAAQ,IAAK;MACnCC,MAAM,CAACN,eAAe,CAACK,QAAQ,CAAC,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;IAC9C,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFL,EAAE,CAAC,4CAA4C,EAAE,MAAM;IACrD,MAAMM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAEC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC;IAExED,gBAAgB,CAACJ,OAAO,CAAEC,QAAQ,IAAK;MACrCC,MAAM,CAACN,eAAe,CAACK,QAAQ,CAAC,CAAC,CAACE,IAAI,CAAC,KAAK,CAAC;IAC/C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/order-types.js b/packages/banxa/lib/module/helpers/order-types.js deleted file mode 100644 index 5dee66b9a3..0000000000 --- a/packages/banxa/lib/module/helpers/order-types.js +++ /dev/null @@ -1,5 +0,0 @@ -const supportedOrderTypes = ['buy', 'sell']; -export function banxaIsOrderType(value) { - return supportedOrderTypes.includes(value); -} -//# sourceMappingURL=order-types.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/order-types.js.map b/packages/banxa/lib/module/helpers/order-types.js.map deleted file mode 100644 index fe0e391a5b..0000000000 --- a/packages/banxa/lib/module/helpers/order-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["supportedOrderTypes","banxaIsOrderType","value","includes"],"sourceRoot":"../../../src","sources":["helpers/order-types.ts"],"mappings":"AAEA,MAAMA,mBAA+C,GAAG,CAAC,KAAK,EAAE,MAAM,CAAU;AAEhF,OAAO,SAASC,gBAAgBA,CAACC,KAAU,EAA2B;EACpE,OAAOF,mBAAmB,CAACG,QAAQ,CAACD,KAAuB,CAAC;AAC9D"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/order-types.test.js b/packages/banxa/lib/module/helpers/order-types.test.js deleted file mode 100644 index 24e5241f21..0000000000 --- a/packages/banxa/lib/module/helpers/order-types.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import { banxaIsOrderType } from './order-types'; -describe('banxaIsOrderType', () => { - it('should return true for valid order types', () => { - const validOrderTypes = ['buy', 'sell']; - validOrderTypes.forEach(orderType => { - expect(banxaIsOrderType(orderType)).toBe(true); - }); - }); - it('should return false for invalid order types', () => { - const invalidOrderTypes = ['deposit', 'withdraw', 'exchange', '', undefined, null, 123]; - invalidOrderTypes.forEach(orderType => { - expect(banxaIsOrderType(orderType)).toBe(false); - }); - }); -}); -//# sourceMappingURL=order-types.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/order-types.test.js.map b/packages/banxa/lib/module/helpers/order-types.test.js.map deleted file mode 100644 index 3028ee709e..0000000000 --- a/packages/banxa/lib/module/helpers/order-types.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaIsOrderType","describe","it","validOrderTypes","forEach","orderType","expect","toBe","invalidOrderTypes","undefined"],"sourceRoot":"../../../src","sources":["helpers/order-types.test.ts"],"mappings":"AAAA,SAAwBA,gBAAgB,QAAO,eAAe;AAE9DC,QAAQ,CAAC,kBAAkB,EAAE,MAAM;EACjCC,EAAE,CAAC,0CAA0C,EAAE,MAAM;IACnD,MAAMC,eAAiC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;IAEzDA,eAAe,CAACC,OAAO,CAAEC,SAAS,IAAK;MACrCC,MAAM,CAACN,gBAAgB,CAACK,SAAS,CAAC,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;IAChD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFL,EAAE,CAAC,6CAA6C,EAAE,MAAM;IACtD,MAAMM,iBAAiB,GAAG,CACxB,SAAS,EACT,UAAU,EACV,UAAU,EACV,EAAE,EACFC,SAAS,EACT,IAAI,EACJ,GAAG,CACJ;IAEDD,iBAAiB,CAACJ,OAAO,CAAEC,SAAS,IAAK;MACvCC,MAAM,CAACN,gBAAgB,CAACK,SAAS,CAAC,CAAC,CAACE,IAAI,CAAC,KAAK,CAAC;IACjD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/theme.js b/packages/banxa/lib/module/helpers/theme.js deleted file mode 100644 index afe21eb4fc..0000000000 --- a/packages/banxa/lib/module/helpers/theme.js +++ /dev/null @@ -1,5 +0,0 @@ -const supportedTheme = ['dark', 'light']; -export function banxaIsTheme(value) { - return supportedTheme.includes(value); -} -//# sourceMappingURL=theme.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/theme.js.map b/packages/banxa/lib/module/helpers/theme.js.map deleted file mode 100644 index cc99f41cf2..0000000000 --- a/packages/banxa/lib/module/helpers/theme.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["supportedTheme","banxaIsTheme","value","includes"],"sourceRoot":"../../../src","sources":["helpers/theme.ts"],"mappings":"AAEA,MAAMA,cAAsC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU;AAEzE,OAAO,SAASC,YAAYA,CAACC,KAAU,EAAuB;EAC5D,OAAOF,cAAc,CAACG,QAAQ,CAACD,KAAmB,CAAC;AACrD"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/theme.test.js b/packages/banxa/lib/module/helpers/theme.test.js deleted file mode 100644 index 27341f9fc2..0000000000 --- a/packages/banxa/lib/module/helpers/theme.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import { banxaIsTheme } from './theme'; -describe('banxaIsTheme', () => { - it('should return true for valid theme', () => { - const validTheme = ['dark', 'light']; - validTheme.forEach(theme => { - expect(banxaIsTheme(theme)).toBe(true); - }); - }); - it('should return false for invalid theme', () => { - const invalidTheme = ['darks', 'lights', 'white', 'black', '', undefined, null, 123]; - invalidTheme.forEach(theme => { - expect(banxaIsTheme(theme)).toBe(false); - }); - }); -}); -//# sourceMappingURL=theme.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/theme.test.js.map b/packages/banxa/lib/module/helpers/theme.test.js.map deleted file mode 100644 index 5fe4063355..0000000000 --- a/packages/banxa/lib/module/helpers/theme.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaIsTheme","describe","it","validTheme","forEach","theme","expect","toBe","invalidTheme","undefined"],"sourceRoot":"../../../src","sources":["helpers/theme.test.ts"],"mappings":"AAAA,SAAoBA,YAAY,QAAO,SAAS;AAEhDC,QAAQ,CAAC,cAAc,EAAE,MAAM;EAC7BC,EAAE,CAAC,oCAAoC,EAAE,MAAM;IAC7C,MAAMC,UAAwB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAElDA,UAAU,CAACC,OAAO,CAAEC,KAAK,IAAK;MAC5BC,MAAM,CAACN,YAAY,CAACK,KAAK,CAAC,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFL,EAAE,CAAC,uCAAuC,EAAE,MAAM;IAChD,MAAMM,YAAY,GAAG,CACnB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,EACP,EAAE,EACFC,SAAS,EACT,IAAI,EACJ,GAAG,CACJ;IAEDD,YAAY,CAACJ,OAAO,CAAEC,KAAK,IAAK;MAC9BC,MAAM,CAACN,YAAY,CAACK,KAAK,CAAC,CAAC,CAACE,IAAI,CAAC,KAAK,CAAC;IACzC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/wallet-address.js b/packages/banxa/lib/module/helpers/wallet-address.js deleted file mode 100644 index f35b12f097..0000000000 --- a/packages/banxa/lib/module/helpers/wallet-address.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Validates if is possible Cardano mainnet or testnet address. - * We leave the address validation to the Banxa API, this is a simple check to avoid basic mistakes. - * Banxa referal link doesn't work with testnet addreses or byron addresses. - * @param {string} address - The Cardano address to validate. - * @returns {boolean} - Returns true if the address looks like a Cardano address. - */ -export function banxaIsPossibleCardanoAddress(address) { - const shelleyRegex = /^(addr1)[0-9a-z]+$/; - return shelleyRegex.test(address); -} -//# sourceMappingURL=wallet-address.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/wallet-address.js.map b/packages/banxa/lib/module/helpers/wallet-address.js.map deleted file mode 100644 index f5028a525f..0000000000 --- a/packages/banxa/lib/module/helpers/wallet-address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaIsPossibleCardanoAddress","address","shelleyRegex","test"],"sourceRoot":"../../../src","sources":["helpers/wallet-address.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,6BAA6BA,CAACC,OAAe,EAAE;EAC7D,MAAMC,YAAY,GAAG,oBAAoB;EACzC,OAAOA,YAAY,CAACC,IAAI,CAACF,OAAO,CAAC;AACnC"} \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/wallet-address.test.js b/packages/banxa/lib/module/helpers/wallet-address.test.js deleted file mode 100644 index 20d126815d..0000000000 --- a/packages/banxa/lib/module/helpers/wallet-address.test.js +++ /dev/null @@ -1,28 +0,0 @@ -import { banxaIsPossibleCardanoAddress } from './wallet-address'; -describe('banxaIsPossibleCardanoAddress', () => { - // Test valid Byron addresses - test('should return false for valid Byron mainnet addresses', () => { - expect(banxaIsPossibleCardanoAddress('Ae2tdPwUPEZ5VwwZpNmy1ruH7mfmGv4JDqY4RiUZsMUTVDcsSsSh2Gu5noo')).toBe(false); - expect(banxaIsPossibleCardanoAddress('Ae2tdPwUPEZMK3H6mAmaSB1E4dGvcwRTe1tTkoSCNmQWBNxF6twLDwZoxt8')).toBe(false); - }); - - // Test valid Shelley addresses - test('should return true for valid Shelley mainnet addresses', () => { - expect(banxaIsPossibleCardanoAddress('addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3a6tavy5ndt3mw0mf9hskzg9q9nrg9kxxlt9jvl4ymkhdq6rs0vt')).toBe(true); - expect(banxaIsPossibleCardanoAddress('addr1qxlzhn7wya6s2c3x6px63hklwt2ss9f8s0v5c90v6w8wtfl5mv6m2tckwqlyvlwmnx9ct68fqk7nngeja4kvz65prdrquaj4lfl')).toBe(true); - }); - - // Test valid Shelley testnet addresses - test('should return false for valid Shelley testnet addresses', () => { - expect(banxaIsPossibleCardanoAddress('addr_test1q9xwspw7mcmrhlzsp5v3xxvtzgqhp5tkmdt6zydu9evmvg28gr8v6svtefqgghsk93y4qqtv7kjeg5k06c8qxy4r89agqheknqv')).toBe(false); - expect(banxaIsPossibleCardanoAddress('addr_test1qqlzhn7wya6s2c3x6px63hklwt2ss9f8s0v5c90v6w8wtfl5mv6m2tckwqlyvlwmnx9ct68fqk7nngeja4kvz65prdrqudmm25h')).toBe(false); - }); - - // Test invalid addresses - test('should return false for invalid addresses', () => { - expect(banxaIsPossibleCardanoAddress('invalidaddress123')).toBe(false); - expect(banxaIsPossibleCardanoAddress('0x1234567890abcdef')).toBe(false); - expect(banxaIsPossibleCardanoAddress('bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq')).toBe(false); - }); -}); -//# sourceMappingURL=wallet-address.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/helpers/wallet-address.test.js.map b/packages/banxa/lib/module/helpers/wallet-address.test.js.map deleted file mode 100644 index 539172a7f6..0000000000 --- a/packages/banxa/lib/module/helpers/wallet-address.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaIsPossibleCardanoAddress","describe","test","expect","toBe"],"sourceRoot":"../../../src","sources":["helpers/wallet-address.test.ts"],"mappings":"AAAA,SAAQA,6BAA6B,QAAO,kBAAkB;AAE9DC,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9C;EACAC,IAAI,CAAC,uDAAuD,EAAE,MAAM;IAClEC,MAAM,CACJH,6BAA6B,CAC3B,6DACF,CACF,CAAC,CAACI,IAAI,CAAC,KAAK,CAAC;IACbD,MAAM,CACJH,6BAA6B,CAC3B,6DACF,CACF,CAAC,CAACI,IAAI,CAAC,KAAK,CAAC;EACf,CAAC,CAAC;;EAEF;EACAF,IAAI,CAAC,wDAAwD,EAAE,MAAM;IACnEC,MAAM,CACJH,6BAA6B,CAC3B,yGACF,CACF,CAAC,CAACI,IAAI,CAAC,IAAI,CAAC;IACZD,MAAM,CACJH,6BAA6B,CAC3B,0GACF,CACF,CAAC,CAACI,IAAI,CAAC,IAAI,CAAC;EACd,CAAC,CAAC;;EAEF;EACAF,IAAI,CAAC,yDAAyD,EAAE,MAAM;IACpEC,MAAM,CACJH,6BAA6B,CAC3B,+GACF,CACF,CAAC,CAACI,IAAI,CAAC,KAAK,CAAC;IACbD,MAAM,CACJH,6BAA6B,CAC3B,+GACF,CACF,CAAC,CAACI,IAAI,CAAC,KAAK,CAAC;EACf,CAAC,CAAC;;EAEF;EACAF,IAAI,CAAC,2CAA2C,EAAE,MAAM;IACtDC,MAAM,CAACH,6BAA6B,CAAC,mBAAmB,CAAC,CAAC,CAACI,IAAI,CAAC,KAAK,CAAC;IACtED,MAAM,CAACH,6BAA6B,CAAC,oBAAoB,CAAC,CAAC,CAACI,IAAI,CAAC,KAAK,CAAC;IACvED,MAAM,CACJH,6BAA6B,CAC3B,4CACF,CACF,CAAC,CAACI,IAAI,CAAC,KAAK,CAAC;EACf,CAAC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/banxa/lib/module/index.js b/packages/banxa/lib/module/index.js deleted file mode 100644 index 62c88775fc..0000000000 --- a/packages/banxa/lib/module/index.js +++ /dev/null @@ -1,6 +0,0 @@ -export { banxaDomainProduction, banxaDomainSandbox, banxaSupportUrl } from './translators/domains'; -export { banxaModuleMaker } from './translators/module'; -export { BanxaErrorMessages } from './adapters/errors'; -export let Banxa; -(function (_Banxa) {})(Banxa || (Banxa = {})); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/index.js.map b/packages/banxa/lib/module/index.js.map deleted file mode 100644 index 04124be166..0000000000 --- a/packages/banxa/lib/module/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaDomainProduction","banxaDomainSandbox","banxaSupportUrl","banxaModuleMaker","BanxaErrorMessages","Banxa","_Banxa"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SACEA,qBAAqB,EACrBC,kBAAkB,EAClBC,eAAe,QACV,uBAAuB;AAC9B,SAAQC,gBAAgB,QAAO,sBAAsB;AACrD,SAAQC,kBAAkB,QAAO,mBAAmB;AAYpD,WAAAC,KAAA;AAWC,WAAAC,MAAA,MAXgBD,KAAK,KAALA,KAAK"} \ No newline at end of file diff --git a/packages/banxa/lib/module/translators/domains.js b/packages/banxa/lib/module/translators/domains.js deleted file mode 100644 index 4a0c1806ad..0000000000 --- a/packages/banxa/lib/module/translators/domains.js +++ /dev/null @@ -1,4 +0,0 @@ -export const banxaDomainProduction = 'banxa.com'; -export const banxaDomainSandbox = 'banxa-sandbox.com'; -export const banxaSupportUrl = 'https://support.banxa.com/'; -//# sourceMappingURL=domains.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/translators/domains.js.map b/packages/banxa/lib/module/translators/domains.js.map deleted file mode 100644 index 647a0af993..0000000000 --- a/packages/banxa/lib/module/translators/domains.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["banxaDomainProduction","banxaDomainSandbox","banxaSupportUrl"],"sourceRoot":"../../../src","sources":["translators/domains.ts"],"mappings":"AAAA,OAAO,MAAMA,qBAAqB,GAAG,WAAW;AAChD,OAAO,MAAMC,kBAAkB,GAAG,mBAAmB;AACrD,OAAO,MAAMC,eAAe,GAAG,4BAA4B"} \ No newline at end of file diff --git a/packages/banxa/lib/module/translators/module.js b/packages/banxa/lib/module/translators/module.js deleted file mode 100644 index 45ffef6c27..0000000000 --- a/packages/banxa/lib/module/translators/module.js +++ /dev/null @@ -1,57 +0,0 @@ -import { BanxaUnknownError } from '../adapters/errors'; -import { banxaDomainProduction, banxaDomainSandbox } from './domains'; -import { handleZodErrors } from '../adapters/zod-errors'; -import { BanxaUrlReferralQueryStringParamsSchema } from '../adapters/zod-schema'; -// ------- -// FACTORY -/** - * Creates an object that provides functionality to Banxa capabilities. - * - * @param {BanxaUrlReferralBuilderOptions} options - Configuration options for the referral link generation. - * @param {string} [options.partner] - The partner name, e.g., "checkout". - * @param {boolean} [options.isProduction=false] - Indicates if the function should generate production or sandbox URLs. - * - * @returns {BanxaModule} An object with methods to generate Banxa referral links. - */ -export const banxaModuleMaker = function (_ref) { - let { - partner, - isProduction - } = _ref; - let { - zodErrorTranslator = handleZodErrors - } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const domain = isProduction ? banxaDomainProduction : banxaDomainSandbox; - const baseUrl = `https://${partner}.${domain}`; - - /** - * Create a Banxa referral URL based on query parameters. - * @param queries - Query parameters for generating the Banxa referral URL. - * @returns A URL object representing the generated Banxa referral link. - * @throws {BanxaValidationError | BanxaUnknownError} Throws specific errors if validation fails or an unknown error occurs. - */ - const createReferralUrl = queries => { - try { - const validatedQueries = BanxaUrlReferralQueryStringParamsSchema.parse(queries); - const url = new URL(baseUrl); - const params = new URLSearchParams(); - for (const [key, value] of Object.entries(validatedQueries)) { - params.append(key, value.toString()); - } - url.search = params.toString(); - return url; - } catch (error) { - zodErrorTranslator(error); - throw new BanxaUnknownError(JSON.stringify(error)); // TS doesn't know that zodErrorTranslator will throw - } - }; - - return { - createReferralUrl - }; -}; - -// ----- -// TYPES -// https://docs.banxa.com/docs/referral-method -//# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/translators/module.js.map b/packages/banxa/lib/module/translators/module.js.map deleted file mode 100644 index 069cea79e7..0000000000 --- a/packages/banxa/lib/module/translators/module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["BanxaUnknownError","banxaDomainProduction","banxaDomainSandbox","handleZodErrors","BanxaUrlReferralQueryStringParamsSchema","banxaModuleMaker","_ref","partner","isProduction","zodErrorTranslator","arguments","length","undefined","domain","baseUrl","createReferralUrl","queries","validatedQueries","parse","url","URL","params","URLSearchParams","key","value","Object","entries","append","toString","search","error","JSON","stringify"],"sourceRoot":"../../../src","sources":["translators/module.ts"],"mappings":"AAAA,SAAQA,iBAAiB,QAAO,oBAAoB;AAEpD,SAAQC,qBAAqB,EAAEC,kBAAkB,QAAO,WAAW;AAEnE,SAAQC,eAAe,QAAO,wBAAwB;AACtD,SAAQC,uCAAuC,QAAO,wBAAwB;AAG9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,SAAAA,CAAAC,IAAA,EAGd;EAAA,IAFhB;IAACC,OAAO;IAAEC;EAA4C,CAAC,GAAAF,IAAA;EAAA,IACvD;IAACG,kBAAkB,GAAGN;EAAe,CAAC,GAAAO,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE3C,MAAMG,MAAM,GAAGL,YAAY,GAAGP,qBAAqB,GAAGC,kBAAkB;EACxE,MAAMY,OAAO,GAAI,WAAUP,OAAQ,IAAGM,MAAO,EAAC;;EAE9C;AACF;AACA;AACA;AACA;AACA;EACE,MAAME,iBAAiB,GAAIC,OAA0C,IAAK;IACxE,IAAI;MACF,MAAMC,gBAAgB,GACpBb,uCAAuC,CAACc,KAAK,CAACF,OAAO,CAAC;MACxD,MAAMG,GAAG,GAAG,IAAIC,GAAG,CAACN,OAAO,CAAC;MAC5B,MAAMO,MAAM,GAAG,IAAIC,eAAe,CAAC,CAAC;MACpC,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACT,gBAAgB,CAAC,EAAE;QAC3DI,MAAM,CAACM,MAAM,CAACJ,GAAG,EAAEC,KAAK,CAACI,QAAQ,CAAC,CAAC,CAAC;MACtC;MACAT,GAAG,CAACU,MAAM,GAAGR,MAAM,CAACO,QAAQ,CAAC,CAAC;MAC9B,OAAOT,GAAG;IACZ,CAAC,CAAC,OAAOW,KAAK,EAAE;MACdrB,kBAAkB,CAACqB,KAAK,CAAC;MACzB,MAAM,IAAI9B,iBAAiB,CAAC+B,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC,CAAC,EAAC;IACrD;EACF,CAAC;;EAED,OAAO;IACLf;EACF,CAAC;AACH,CAAC;;AAED;AACA;AAQA"} \ No newline at end of file diff --git a/packages/banxa/lib/module/translators/module.test.js b/packages/banxa/lib/module/translators/module.test.js deleted file mode 100644 index a300af8f5a..0000000000 --- a/packages/banxa/lib/module/translators/module.test.js +++ /dev/null @@ -1,111 +0,0 @@ -import { BanxaUnknownError, BanxaValidationError } from '../adapters/errors'; -import { banxaModuleMaker } from './module'; -describe('banxaModuleMaker', () => { - test('should generate a correct referral link with all parameters', () => { - const banxa = banxaModuleMaker({ - partner: 'checkout', - isProduction: true - }); - const fullUrl = 'https://checkout.banxa.com/?' + 'orderType=sell' + '&' + 'fiatType=USD' + '&' + 'fiatAmount=500' + '&' + 'coinType=ADA' + '&' + 'coinAmount=800' + '&' + 'blockchain=ADA' + '&' + 'walletAddress=addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' + '&' + 'walletAddressTag=tag'; - const url = banxa.createReferralUrl({ - orderType: 'sell', - fiatType: 'USD', - fiatAmount: 500, - coinType: 'ADA', - coinAmount: 800, - blockchain: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf', - walletAddressTag: 'tag' - }); - expect(url.toString()).toBe(fullUrl); - }); - test('should generate a correct referral link with mandatory parameters only', () => { - const banxa = banxaModuleMaker({ - partner: 'checkout', - isProduction: true - }); - const fullUrl = 'https://checkout.banxa.com/?' + 'fiatType=USD' + '&' + 'coinType=ADA' + '&' + 'walletAddress=addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf'; - const url = banxa.createReferralUrl({ - fiatType: 'USD', - coinType: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' - }); - expect(url.toString()).toBe(fullUrl); - }); - test('should generate a correct sandbox referral link', () => { - const banxa = banxaModuleMaker({ - partner: 'checkout', - isProduction: false - }); - const fullUrl = 'https://checkout.banxa-sandbox.com/?' + 'fiatType=USD' + '&' + 'coinType=ADA' + '&' + 'walletAddress=addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf'; - const url = banxa.createReferralUrl({ - fiatType: 'USD', - coinType: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' - }); - expect(url.toString()).toBe(fullUrl); - }); - test('should not include undefined optional parameters in the referral link', () => { - const banxa = banxaModuleMaker({ - partner: 'checkout', - isProduction: true - }); - const url = banxa.createReferralUrl({ - fiatType: 'USD', - coinType: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' - }); - const urlString = url.toString(); - expect(urlString).not.toContain('sellMode'); - expect(urlString).not.toContain('fiatAmount'); - expect(urlString).not.toContain('coinAmount'); - expect(urlString).not.toContain('blockchain'); - expect(urlString).not.toContain('walletAddressTag'); - }); - test('should throw an BanxaValidationError when schema is invalid', () => { - const banxa = banxaModuleMaker({ - partner: 'checkout', - isProduction: true - }); - const invalidQueries = { - fiatType: 'ABC', - // Invalid fiatType - coinType: 'ADA', - walletAddress: 'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf' - }; - expect(() => { - banxa.createReferralUrl(invalidQueries); - }).toThrow(BanxaValidationError); - }); - test('should throw an error when ADA walletAddress is not a possible Cardano address', () => { - const banxa = banxaModuleMaker({ - partner: 'checkout', - isProduction: true - }); - const invalidQueries = { - fiatType: 'USD', - coinType: 'ADA', - walletAddress: 'invalid-cardano-address' - }; - expect(() => { - banxa.createReferralUrl(invalidQueries); - }).toThrow(BanxaValidationError); - }); - test('should throw BanxaUnknownError if is not a BanxaValidationError', () => { - const banxa = banxaModuleMaker({ - partner: 'checkout', - isProduction: true - }, { - zodErrorTranslator: () => {} - }); - const invalidQueries = { - fiatType: 'XXX', - coinType: 'XXX', - walletAddress: 'XXX' - }; - expect(() => { - banxa.createReferralUrl(invalidQueries); - }).toThrow(BanxaUnknownError); - }); -}); -//# sourceMappingURL=module.test.js.map \ No newline at end of file diff --git a/packages/banxa/lib/module/translators/module.test.js.map b/packages/banxa/lib/module/translators/module.test.js.map deleted file mode 100644 index fc1f8c084d..0000000000 --- a/packages/banxa/lib/module/translators/module.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["BanxaUnknownError","BanxaValidationError","banxaModuleMaker","describe","test","banxa","partner","isProduction","fullUrl","url","createReferralUrl","orderType","fiatType","fiatAmount","coinType","coinAmount","blockchain","walletAddress","walletAddressTag","expect","toString","toBe","urlString","not","toContain","invalidQueries","toThrow","zodErrorTranslator"],"sourceRoot":"../../../src","sources":["translators/module.test.ts"],"mappings":"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"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/adapters/errors.d.ts b/packages/banxa/lib/typescript/adapters/errors.d.ts deleted file mode 100644 index 7ff2d6ad17..0000000000 --- a/packages/banxa/lib/typescript/adapters/errors.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare const BanxaErrorMessages: { - ValidationError: string; - UnknownError: string; -}; -export declare class BanxaValidationError extends Error { - constructor(message: string); -} -export declare class BanxaUnknownError extends Error { - constructor(message: string); -} -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/adapters/errors.d.ts.map b/packages/banxa/lib/typescript/adapters/errors.d.ts.map deleted file mode 100644 index 51c66fbd90..0000000000 --- a/packages/banxa/lib/typescript/adapters/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/adapters/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;CAG9B,CAAA;AAED,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/adapters/zod-errors.d.ts b/packages/banxa/lib/typescript/adapters/zod-errors.d.ts deleted file mode 100644 index ffb090b71f..0000000000 --- a/packages/banxa/lib/typescript/adapters/zod-errors.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ZodError } from 'zod'; -/** - * Converts a ZodError or Error to a BanxaError. - * @param error - The error to convert. - * @throws An appropriate BanxaError based on zod error, or ignore it. - */ -export declare function handleZodErrors(error: ZodError | any): void; -//# sourceMappingURL=zod-errors.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/adapters/zod-errors.d.ts.map b/packages/banxa/lib/typescript/adapters/zod-errors.d.ts.map deleted file mode 100644 index d3eb39e589..0000000000 --- a/packages/banxa/lib/typescript/adapters/zod-errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-errors.d.ts","sourceRoot":"","sources":["../../../src/adapters/zod-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,KAAK,CAAA;AAE5B;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,GAAG,QAYpD"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/adapters/zod-schema.d.ts b/packages/banxa/lib/typescript/adapters/zod-schema.d.ts deleted file mode 100644 index ab8694e3ae..0000000000 --- a/packages/banxa/lib/typescript/adapters/zod-schema.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { z } from 'zod'; -export declare const BanxaUrlReferralQueryStringParamsSchema: z.ZodEffects>; - fiatType: z.ZodEffects; - fiatAmount: z.ZodOptional; - coinType: z.ZodEffects; - coinAmount: z.ZodOptional; - blockchain: z.ZodOptional>; - walletAddress: z.ZodString; - walletAddressTag: z.ZodOptional; - backgroundColor: z.ZodOptional; - primaryColor: z.ZodOptional; - secondaryColor: z.ZodOptional; - textColor: z.ZodOptional; - theme: z.ZodOptional>; - returnUrl: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - fiatType: "USD" | "EUR"; - coinType: "ADA"; - walletAddress: string; - orderType?: import("../helpers/order-types").BanxaOrderType | undefined; - fiatAmount?: number | undefined; - coinAmount?: number | undefined; - blockchain?: "ADA" | undefined; - walletAddressTag?: string | undefined; - backgroundColor?: string | undefined; - primaryColor?: string | undefined; - secondaryColor?: string | undefined; - textColor?: string | undefined; - theme?: import("../helpers/theme").BanxaTheme | undefined; - returnUrl?: string | undefined; -}, { - fiatType: string; - coinType: string; - walletAddress: string; - orderType?: string | undefined; - fiatAmount?: number | undefined; - coinAmount?: number | undefined; - blockchain?: string | undefined; - walletAddressTag?: string | undefined; - backgroundColor?: string | undefined; - primaryColor?: string | undefined; - secondaryColor?: string | undefined; - textColor?: string | undefined; - theme?: string | undefined; - returnUrl?: string | undefined; -}>, { - fiatType: "USD" | "EUR"; - coinType: "ADA"; - walletAddress: string; - orderType?: import("../helpers/order-types").BanxaOrderType | undefined; - fiatAmount?: number | undefined; - coinAmount?: number | undefined; - blockchain?: "ADA" | undefined; - walletAddressTag?: string | undefined; - backgroundColor?: string | undefined; - primaryColor?: string | undefined; - secondaryColor?: string | undefined; - textColor?: string | undefined; - theme?: import("../helpers/theme").BanxaTheme | undefined; - returnUrl?: string | undefined; -}, { - fiatType: string; - coinType: string; - walletAddress: string; - orderType?: string | undefined; - fiatAmount?: number | undefined; - coinAmount?: number | undefined; - blockchain?: string | undefined; - walletAddressTag?: string | undefined; - backgroundColor?: string | undefined; - primaryColor?: string | undefined; - secondaryColor?: string | undefined; - textColor?: string | undefined; - theme?: string | undefined; - returnUrl?: string | undefined; -}>; -//# sourceMappingURL=zod-schema.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/adapters/zod-schema.d.ts.map b/packages/banxa/lib/typescript/adapters/zod-schema.d.ts.map deleted file mode 100644 index 08b56a3c60..0000000000 --- a/packages/banxa/lib/typescript/adapters/zod-schema.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-schema.d.ts","sourceRoot":"","sources":["../../../src/adapters/zod-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AASrB,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBhD,CAAA"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/blockchain-code.d.ts b/packages/banxa/lib/typescript/helpers/blockchain-code.d.ts deleted file mode 100644 index 791c63813b..0000000000 --- a/packages/banxa/lib/typescript/helpers/blockchain-code.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type BanxaBlockchainCode = 'ADA'; -export declare function banxaIsBlockchainCode(value: any): value is BanxaBlockchainCode; -//# sourceMappingURL=blockchain-code.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/blockchain-code.d.ts.map b/packages/banxa/lib/typescript/helpers/blockchain-code.d.ts.map deleted file mode 100644 index e87e7fc7f4..0000000000 --- a/packages/banxa/lib/typescript/helpers/blockchain-code.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blockchain-code.d.ts","sourceRoot":"","sources":["../../../src/helpers/blockchain-code.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAA;AAMvC,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,GAAG,GACT,KAAK,IAAI,mBAAmB,CAE9B"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/coin-types.d.ts b/packages/banxa/lib/typescript/helpers/coin-types.d.ts deleted file mode 100644 index edc7888064..0000000000 --- a/packages/banxa/lib/typescript/helpers/coin-types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type BanxaCoinType = 'ADA'; -export declare function banxaIsCoinType(value: any): value is BanxaCoinType; -//# sourceMappingURL=coin-types.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/coin-types.d.ts.map b/packages/banxa/lib/typescript/helpers/coin-types.d.ts.map deleted file mode 100644 index bc06810641..0000000000 --- a/packages/banxa/lib/typescript/helpers/coin-types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"coin-types.d.ts","sourceRoot":"","sources":["../../../src/helpers/coin-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,KAAK,CAAA;AAIjC,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,aAAa,CAElE"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/fiat-types.d.ts b/packages/banxa/lib/typescript/helpers/fiat-types.d.ts deleted file mode 100644 index 049dbd99bf..0000000000 --- a/packages/banxa/lib/typescript/helpers/fiat-types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type BanxaFiatType = 'USD' | 'EUR'; -export declare function banxaIsFiatType(value: any): value is BanxaFiatType; -//# sourceMappingURL=fiat-types.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/fiat-types.d.ts.map b/packages/banxa/lib/typescript/helpers/fiat-types.d.ts.map deleted file mode 100644 index 8b2b5a80c2..0000000000 --- a/packages/banxa/lib/typescript/helpers/fiat-types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fiat-types.d.ts","sourceRoot":"","sources":["../../../src/helpers/fiat-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,CAAA;AAIzC,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,aAAa,CAElE"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/order-types.d.ts b/packages/banxa/lib/typescript/helpers/order-types.d.ts deleted file mode 100644 index 1a0e8263ab..0000000000 --- a/packages/banxa/lib/typescript/helpers/order-types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type BanxaOrderType = 'buy' | 'sell'; -export declare function banxaIsOrderType(value: any): value is BanxaOrderType; -//# sourceMappingURL=order-types.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/order-types.d.ts.map b/packages/banxa/lib/typescript/helpers/order-types.d.ts.map deleted file mode 100644 index 520a2c4191..0000000000 --- a/packages/banxa/lib/typescript/helpers/order-types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"order-types.d.ts","sourceRoot":"","sources":["../../../src/helpers/order-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,CAAA;AAI3C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,cAAc,CAEpE"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/theme.d.ts b/packages/banxa/lib/typescript/helpers/theme.d.ts deleted file mode 100644 index 91f5b0d22c..0000000000 --- a/packages/banxa/lib/typescript/helpers/theme.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type BanxaTheme = 'dark' | 'light'; -export declare function banxaIsTheme(value: any): value is BanxaTheme; -//# sourceMappingURL=theme.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/theme.d.ts.map b/packages/banxa/lib/typescript/helpers/theme.d.ts.map deleted file mode 100644 index cda3f3d1ee..0000000000 --- a/packages/banxa/lib/typescript/helpers/theme.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/helpers/theme.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAA;AAIzC,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,UAAU,CAE5D"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/wallet-address.d.ts b/packages/banxa/lib/typescript/helpers/wallet-address.d.ts deleted file mode 100644 index 33a0799074..0000000000 --- a/packages/banxa/lib/typescript/helpers/wallet-address.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Validates if is possible Cardano mainnet or testnet address. - * We leave the address validation to the Banxa API, this is a simple check to avoid basic mistakes. - * Banxa referal link doesn't work with testnet addreses or byron addresses. - * @param {string} address - The Cardano address to validate. - * @returns {boolean} - Returns true if the address looks like a Cardano address. - */ -export declare function banxaIsPossibleCardanoAddress(address: string): boolean; -//# sourceMappingURL=wallet-address.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/helpers/wallet-address.d.ts.map b/packages/banxa/lib/typescript/helpers/wallet-address.d.ts.map deleted file mode 100644 index 9b140071d2..0000000000 --- a/packages/banxa/lib/typescript/helpers/wallet-address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet-address.d.ts","sourceRoot":"","sources":["../../../src/helpers/wallet-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,WAG5D"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/index.d.ts b/packages/banxa/lib/typescript/index.d.ts deleted file mode 100644 index 27a130da6a..0000000000 --- a/packages/banxa/lib/typescript/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export { banxaDomainProduction, banxaDomainSandbox, banxaSupportUrl, } from './translators/domains'; -export { banxaModuleMaker } from './translators/module'; -export { BanxaErrorMessages } from './adapters/errors'; -import type { BanxaFiatType } from './helpers/fiat-types'; -import type { BanxaCoinType } from './helpers/coin-types'; -import type { BanxaModule, BanxaReferralUrlBuilderOptions, BanxaReferralUrlQueryStringParams } from './translators/module'; -import { BanxaUnknownError, BanxaValidationError } from './adapters/errors'; -export declare namespace Banxa { - type CoinType = BanxaCoinType; - type FiatType = BanxaFiatType; - type ReferralUrlBuilderOptions = BanxaReferralUrlBuilderOptions; - type ReferralUrlQueryStringParams = BanxaReferralUrlQueryStringParams; - type Module = BanxaModule; - interface UnknownError extends BanxaUnknownError { - } - interface ValidationError extends BanxaValidationError { - } -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/index.d.ts.map b/packages/banxa/lib/typescript/index.d.ts.map deleted file mode 100644 index e3799a62cf..0000000000 --- a/packages/banxa/lib/typescript/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAA;AAEvD,OAAO,KAAK,EACV,WAAW,EACX,8BAA8B,EAC9B,iCAAiC,EAClC,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,mBAAmB,CAAA;AAEzE,yBAAiB,KAAK,CAAC;IACrB,KAAY,QAAQ,GAAG,aAAa,CAAA;IACpC,KAAY,QAAQ,GAAG,aAAa,CAAA;IAEpC,KAAY,yBAAyB,GAAG,8BAA8B,CAAA;IACtE,KAAY,4BAA4B,GAAG,iCAAiC,CAAA;IAE5E,KAAY,MAAM,GAAG,WAAW,CAAA;IAEhC,UAAiB,YAAa,SAAQ,iBAAiB;KAAG;IAC1D,UAAiB,eAAgB,SAAQ,oBAAoB;KAAG;CACjE"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/translators/domains.d.ts b/packages/banxa/lib/typescript/translators/domains.d.ts deleted file mode 100644 index e15ae7baac..0000000000 --- a/packages/banxa/lib/typescript/translators/domains.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const banxaDomainProduction = "banxa.com"; -export declare const banxaDomainSandbox = "banxa-sandbox.com"; -export declare const banxaSupportUrl = "https://support.banxa.com/"; -//# sourceMappingURL=domains.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/translators/domains.d.ts.map b/packages/banxa/lib/typescript/translators/domains.d.ts.map deleted file mode 100644 index 254fb451f0..0000000000 --- a/packages/banxa/lib/typescript/translators/domains.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../../src/translators/domains.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,cAAc,CAAA;AAChD,eAAO,MAAM,kBAAkB,sBAAsB,CAAA;AACrD,eAAO,MAAM,eAAe,+BAA+B,CAAA"} \ No newline at end of file diff --git a/packages/banxa/lib/typescript/translators/module.d.ts b/packages/banxa/lib/typescript/translators/module.d.ts deleted file mode 100644 index de1c575531..0000000000 --- a/packages/banxa/lib/typescript/translators/module.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { BanxaCoinType } from '../helpers/coin-types'; -import { BanxaFiatType } from '../helpers/fiat-types'; -import { handleZodErrors } from '../adapters/zod-errors'; -import { BanxaBlockchainCode } from '../helpers/blockchain-code'; -/** - * Creates an object that provides functionality to Banxa capabilities. - * - * @param {BanxaUrlReferralBuilderOptions} options - Configuration options for the referral link generation. - * @param {string} [options.partner] - The partner name, e.g., "checkout". - * @param {boolean} [options.isProduction=false] - Indicates if the function should generate production or sandbox URLs. - * - * @returns {BanxaModule} An object with methods to generate Banxa referral links. - */ -export declare const banxaModuleMaker: ({ partner, isProduction }: BanxaReferralUrlBuilderOptions, { zodErrorTranslator }?: { - zodErrorTranslator?: typeof handleZodErrors | undefined; -}) => BanxaModule; -export type BanxaReferralUrlBuilderOptions = { - /** Partner name, e.g., emurgo. */ - partner: string; - /** Indicates that is running on production enviroment, otherwise will fallback to the sandbox */ - isProduction?: boolean; -}; -export type BanxaReferralUrlQueryStringParams = { - /** Can be used to indicate whether the customer wants to sell by passing through a value of sell. The customer will be shown the Sell Order Form when they are redirected to Banxa. If this parameter is not passed, then the order will default to buy */ - orderType?: 'sell' | 'buy'; - /** Fiat currency code that the customer wants to exchange e.g USD */ - fiatType: BanxaFiatType; - /** Fiat amount that the customer wants to exchange, takes precedence over coinAmount. */ - fiatAmount?: number; - /** Coin currency code that the customer wants to exchange, e.g., ETH. */ - coinType: BanxaCoinType; - /** Coin amount that the customer wants to exchange. */ - coinAmount?: number; - /** It defaults to the blockchain configured for the coinType selected, e.g., ADA -> Cardano. */ - blockchain?: BanxaBlockchainCode; - /** Customer’s wallet address. */ - walletAddress: string; - /** Customer's wallet tag or memo. This is required for transacting on certain blockchains such as BNB and XRP. */ - walletAddressTag?: string; - /** A solid background color. This will override Banxa's custom themes. Will take a hex value without the hash (#) e.g. ffffff */ - backgroundColor?: string; - /** The color used for active buttons. Will take a hex value without the hash (#) e.g. ffffff */ - primaryColor?: string; - /** The color used for button hover effects. Will take a hex value without the hash (#) e.g. ffffff */ - secondaryColor?: string; - /** The color used for all text in the checkout flow. Will take a hex value without the hash (#) e.g. ffffff */ - textColor?: string; - /** Used to apply the correct contrast based on the selected background color. We suggest that for dark backgrounds, you use a dark theme so that input fields are contrasted correctly. */ - theme?: 'light' | 'dark'; - /** This is the url that users will be redirected to when they have completed or cancel the order process. e.g. https://{returnUrl}.com) */ - returnUrl?: string; -}; -export type BanxaModule = { - /** - * Generates a Banxa referral link based on the provided query parameters. - * - * @param {BanxaReferralUrlQueryStringParams} queries - The query parameters for the referral link. - * @param {boolean} [queries.sellMode] - Indicates whether the customer wants to sell. If this parameter is not passed, then the order will default to buyMode. - * @param {string} [queries.fiatType] - Fiat currency code that the customer wants to exchange, e.g., "USD". - * @param {number} [queries.fiatAmount] - Fiat amount that the customer wants to exchange, takes precedence over coinAmount. - * @param {string} [queries.coinType] - Coin currency code that the customer wants to exchange, e.g., "ADA". - * @param {number} [queries.coinAmount] - Coin amount that the customer wants to exchange. - * @param {string} [queries.blockchain] - It defaults to the blockchain configured for the coinType selected, e.g., "ADA" -> "Cardano". - * @param {string} [queries.walletAddress] - Customer's wallet address. - * @param {string} [queries.walletAddressTag] - Customer's wallet tag or memo. This is required for transacting on certain blockchains such as BNB and XRP. - * @param {string} [queries.backgroundColor] - A solid background color. This will override Banxa's custom themes. Will take a hex value without the hash (#) e.g. ffffff. - * @param {string} [queries.primaryColor] - The color used for active buttons. Will take a hex value without the hash (#) e.g. ffffff. - * @param {string} [queries.secondaryColor] - The color used for button hover effects. Will take a hex value without the hash (#) e.g. ffffff. - * @param {string} [queries.textColor] - The color used for all text in the checkout flow. Will take a hex value without the hash (#) e.g. ffffff. - * @param {string} [queries.theme] - Used to apply the correct contrast based on the selected background color. We suggest that for dark backgrounds, you use a dark theme so that input fields are contrasted correctly. - * @param {string} [queries.returnUrl] - This is the url that users will be redirected to when they have completed or cancel the order process. e.g. https://{returnUrl}.com. - * - * @throws {BanxaValidationError | BanxaUnknownError} Throws an error if the provided data doesn't match with the schema or if something unexpected happens. - * - * @returns {URL} The generated Banxa referral link as URL object. - */ - readonly createReferralUrl: (queries: BanxaReferralUrlQueryStringParams) => URL; -}; -//# sourceMappingURL=module.d.ts.map \ No newline at end of file diff --git a/packages/banxa/lib/typescript/translators/module.d.ts.map b/packages/banxa/lib/typescript/translators/module.d.ts.map deleted file mode 100644 index 92aabc0a7a..0000000000 --- a/packages/banxa/lib/typescript/translators/module.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/translators/module.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAA;AAEtD,OAAO,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AAI9D;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,8BACF,8BAA8B;;MAEtD,WA8BF,CAAA;AAID,MAAM,MAAM,8BAA8B,GAAG;IAC3C,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,iGAAiG;IACjG,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAGD,MAAM,MAAM,iCAAiC,GAAG;IAC9C,2PAA2P;IAC3P,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAE1B,qEAAqE;IACrE,QAAQ,EAAE,aAAa,CAAA;IAEvB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,yEAAyE;IACzE,QAAQ,EAAE,aAAa,CAAA;IAEvB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,gGAAgG;IAChG,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAEhC,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAA;IAErB,kHAAkH;IAClH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,iIAAiI;IACjI,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB,gGAAgG;IAChG,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,sGAAsG;IACtG,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,gHAAgH;IAChH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,2LAA2L;IAC3L,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAExB,2IAA2I;IAC3I,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,iBAAiB,EAAE,CAC1B,OAAO,EAAE,iCAAiC,KACvC,GAAG,CAAA;CACT,CAAA"} \ No newline at end of file