@otim/utils 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.mts +1858 -7
- package/dist/api/index.d.mts.map +1 -0
- package/dist/api/index.d.ts +1857 -6
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1514 -1994
- package/dist/api/index.js.map +1 -7
- package/dist/api/index.mjs +1394 -1962
- package/dist/api/index.mjs.map +1 -7
- package/dist/api-urls-B-GTEiT3.d.mts +49 -0
- package/dist/api-urls-B-GTEiT3.d.mts.map +1 -0
- package/dist/api-urls-Cd20DG4i.js +171 -0
- package/dist/api-urls-Cd20DG4i.js.map +1 -0
- package/dist/api-urls-DJcIKBCy.mjs +135 -0
- package/dist/api-urls-DJcIKBCy.mjs.map +1 -0
- package/dist/api-urls-SKeIQMoZ.d.ts +49 -0
- package/dist/api-urls-SKeIQMoZ.d.ts.map +1 -0
- package/dist/chains/index.d.mts +13568 -16
- package/dist/chains/index.d.mts.map +1 -0
- package/dist/chains/index.d.ts +13567 -15
- package/dist/chains/index.d.ts.map +1 -1
- package/dist/chains/index.js +3615 -424
- package/dist/chains/index.js.map +1 -7
- package/dist/chains/index.mjs +3561 -440
- package/dist/chains/index.mjs.map +1 -7
- package/dist/chunk-kSYXY2_d.js +34 -0
- package/dist/client-factory-7xUSPC9I.mjs +42 -0
- package/dist/client-factory-7xUSPC9I.mjs.map +1 -0
- package/dist/client-factory-C3A4RPdj.d.ts +22 -0
- package/dist/client-factory-C3A4RPdj.d.ts.map +1 -0
- package/dist/client-factory-CTI_Nt35.js +49 -0
- package/dist/client-factory-CTI_Nt35.js.map +1 -0
- package/dist/client-factory-DOL0ZTWy.d.mts +22 -0
- package/dist/client-factory-DOL0ZTWy.d.mts.map +1 -0
- package/dist/constants.d.mts +14 -24
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.d.ts +13 -23
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +31 -46
- package/dist/constants.js.map +1 -7
- package/dist/constants.mjs +22 -26
- package/dist/constants.mjs.map +1 -7
- package/dist/date-CFzrYcjE.js +536 -0
- package/dist/date-CFzrYcjE.js.map +1 -0
- package/dist/date-gBac-Om9.mjs +313 -0
- package/dist/date-gBac-Om9.mjs.map +1 -0
- package/dist/defineProperty-DbMdhrDE.js +49 -0
- package/dist/defineProperty-DzhmunJg.mjs +43 -0
- package/dist/formatters/index.d.mts +1 -2
- package/dist/formatters/index.d.ts +1 -2
- package/dist/formatters/index.js +0 -19
- package/dist/formatters/index.mjs +1 -1
- package/dist/helpers/index.d.mts +562 -19
- package/dist/helpers/index.d.mts.map +1 -0
- package/dist/helpers/index.d.ts +561 -18
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +106 -1344
- package/dist/helpers/index.mjs +3 -1315
- package/dist/helpers-BNiSxjGq.mjs +895 -0
- package/dist/helpers-BNiSxjGq.mjs.map +1 -0
- package/dist/helpers-DoC7Xl12.js +1291 -0
- package/dist/helpers-DoC7Xl12.js.map +1 -0
- package/dist/index-Bv0kUz4w.d.ts +540 -0
- package/dist/index-Bv0kUz4w.d.ts.map +1 -0
- package/dist/index-DartTKk2.d.mts +540 -0
- package/dist/index-DartTKk2.d.mts.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -2
- package/dist/index.mjs +1 -1
- package/dist/instructions/index.d.mts +687 -6
- package/dist/instructions/index.d.mts.map +1 -0
- package/dist/instructions/index.d.ts +686 -5
- package/dist/instructions/index.d.ts.map +1 -1
- package/dist/instructions/index.js +1912 -1091
- package/dist/instructions/index.js.map +1 -7
- package/dist/instructions/index.mjs +1887 -1058
- package/dist/instructions/index.mjs.map +1 -7
- package/dist/payments/index.d.mts +322 -16
- package/dist/payments/index.d.mts.map +1 -0
- package/dist/payments/index.d.ts +321 -15
- package/dist/payments/index.d.ts.map +1 -1
- package/dist/payments/index.js +616 -1258
- package/dist/payments/index.js.map +1 -7
- package/dist/payments/index.mjs +594 -1236
- package/dist/payments/index.mjs.map +1 -7
- package/dist/schemas/index.d.mts +2 -10
- package/dist/schemas/index.d.ts +2 -10
- package/dist/schemas/index.js +350 -393
- package/dist/schemas/index.js.map +1 -7
- package/dist/schemas/index.mjs +283 -371
- package/dist/schemas/index.mjs.map +1 -7
- package/dist/server/index.d.mts +354 -3
- package/dist/server/index.d.mts.map +1 -0
- package/dist/server/index.d.ts +353 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +248 -435
- package/dist/server/index.js.map +1 -7
- package/dist/server/index.mjs +199 -404
- package/dist/server/index.mjs.map +1 -7
- package/dist/server/react.d.mts +16 -0
- package/dist/server/react.d.mts.map +1 -0
- package/dist/server/react.d.ts +16 -0
- package/dist/server/react.d.ts.map +1 -0
- package/dist/server/react.js +30 -0
- package/dist/server/react.js.map +1 -0
- package/dist/server/react.mjs +28 -0
- package/dist/server/react.mjs.map +1 -0
- package/dist/wallet/wagmi/index.d.mts +23 -2
- package/dist/wallet/wagmi/index.d.mts.map +1 -0
- package/dist/wallet/wagmi/index.d.ts +22 -1
- package/dist/wallet/wagmi/index.d.ts.map +1 -1
- package/dist/wallet/wagmi/index.js +86 -417
- package/dist/wallet/wagmi/index.js.map +1 -7
- package/dist/wallet/wagmi/index.mjs +82 -418
- package/dist/wallet/wagmi/index.mjs.map +1 -7
- package/package.json +39 -28
- package/dist/api/api.d.mts +0 -18
- package/dist/api/api.d.ts +0 -18
- package/dist/api/api.d.ts.map +0 -1
- package/dist/api/core/error.d.mts +0 -74
- package/dist/api/core/error.d.ts +0 -74
- package/dist/api/core/error.d.ts.map +0 -1
- package/dist/api/core/index.d.mts +0 -4
- package/dist/api/core/index.d.ts +0 -4
- package/dist/api/core/index.d.ts.map +0 -1
- package/dist/api/core/instance.d.mts +0 -13
- package/dist/api/core/instance.d.ts +0 -13
- package/dist/api/core/instance.d.ts.map +0 -1
- package/dist/api/core/service.d.mts +0 -51
- package/dist/api/core/service.d.ts +0 -51
- package/dist/api/core/service.d.ts.map +0 -1
- package/dist/api/schemas/account.d.mts +0 -44
- package/dist/api/schemas/account.d.ts +0 -44
- package/dist/api/schemas/account.d.ts.map +0 -1
- package/dist/api/schemas/activity.d.mts +0 -277
- package/dist/api/schemas/activity.d.ts +0 -277
- package/dist/api/schemas/activity.d.ts.map +0 -1
- package/dist/api/schemas/auth.d.mts +0 -127
- package/dist/api/schemas/auth.d.ts +0 -127
- package/dist/api/schemas/auth.d.ts.map +0 -1
- package/dist/api/schemas/chain.d.mts +0 -15
- package/dist/api/schemas/chain.d.ts +0 -15
- package/dist/api/schemas/chain.d.ts.map +0 -1
- package/dist/api/schemas/config.d.mts +0 -33
- package/dist/api/schemas/config.d.ts +0 -33
- package/dist/api/schemas/config.d.ts.map +0 -1
- package/dist/api/schemas/contacts.d.mts +0 -27
- package/dist/api/schemas/contacts.d.ts +0 -27
- package/dist/api/schemas/contacts.d.ts.map +0 -1
- package/dist/api/schemas/index.d.mts +0 -12
- package/dist/api/schemas/index.d.ts +0 -12
- package/dist/api/schemas/index.d.ts.map +0 -1
- package/dist/api/schemas/instruction.d.mts +0 -446
- package/dist/api/schemas/instruction.d.ts +0 -446
- package/dist/api/schemas/instruction.d.ts.map +0 -1
- package/dist/api/schemas/integration.d.mts +0 -166
- package/dist/api/schemas/integration.d.ts +0 -166
- package/dist/api/schemas/integration.d.ts.map +0 -1
- package/dist/api/schemas/operating-account.d.mts +0 -11
- package/dist/api/schemas/operating-account.d.ts +0 -11
- package/dist/api/schemas/operating-account.d.ts.map +0 -1
- package/dist/api/schemas/payments.d.mts +0 -234
- package/dist/api/schemas/payments.d.ts +0 -234
- package/dist/api/schemas/payments.d.ts.map +0 -1
- package/dist/api/schemas/transaction.d.mts +0 -37
- package/dist/api/schemas/transaction.d.ts +0 -37
- package/dist/api/schemas/transaction.d.ts.map +0 -1
- package/dist/api/services/account.d.mts +0 -8
- package/dist/api/services/account.d.ts +0 -8
- package/dist/api/services/account.d.ts.map +0 -1
- package/dist/api/services/activity.d.mts +0 -7
- package/dist/api/services/activity.d.ts +0 -7
- package/dist/api/services/activity.d.ts.map +0 -1
- package/dist/api/services/auth.d.mts +0 -12
- package/dist/api/services/auth.d.ts +0 -12
- package/dist/api/services/auth.d.ts.map +0 -1
- package/dist/api/services/base.d.mts +0 -10
- package/dist/api/services/base.d.ts +0 -10
- package/dist/api/services/base.d.ts.map +0 -1
- package/dist/api/services/config.d.mts +0 -10
- package/dist/api/services/config.d.ts +0 -10
- package/dist/api/services/config.d.ts.map +0 -1
- package/dist/api/services/contacts.d.mts +0 -8
- package/dist/api/services/contacts.d.ts +0 -8
- package/dist/api/services/contacts.d.ts.map +0 -1
- package/dist/api/services/developer.d.mts +0 -6
- package/dist/api/services/developer.d.ts +0 -6
- package/dist/api/services/developer.d.ts.map +0 -1
- package/dist/api/services/index.d.mts +0 -13
- package/dist/api/services/index.d.ts +0 -13
- package/dist/api/services/index.d.ts.map +0 -1
- package/dist/api/services/instruction.d.mts +0 -12
- package/dist/api/services/instruction.d.ts +0 -12
- package/dist/api/services/instruction.d.ts.map +0 -1
- package/dist/api/services/integration.d.mts +0 -8
- package/dist/api/services/integration.d.ts +0 -8
- package/dist/api/services/integration.d.ts.map +0 -1
- package/dist/api/services/operating-account.d.mts +0 -8
- package/dist/api/services/operating-account.d.ts +0 -8
- package/dist/api/services/operating-account.d.ts.map +0 -1
- package/dist/api/services/payments.d.mts +0 -14
- package/dist/api/services/payments.d.ts +0 -14
- package/dist/api/services/payments.d.ts.map +0 -1
- package/dist/api/services/transaction.d.mts +0 -8
- package/dist/api/services/transaction.d.ts +0 -8
- package/dist/api/services/transaction.d.ts.map +0 -1
- package/dist/api/services/uniswap-token-list-service.d.mts +0 -66
- package/dist/api/services/uniswap-token-list-service.d.ts +0 -66
- package/dist/api/services/uniswap-token-list-service.d.ts.map +0 -1
- package/dist/api/utils/index.d.mts +0 -2
- package/dist/api/utils/index.d.ts +0 -2
- package/dist/api/utils/index.d.ts.map +0 -1
- package/dist/api/utils/pagination.d.mts +0 -32
- package/dist/api/utils/pagination.d.ts +0 -32
- package/dist/api/utils/pagination.d.ts.map +0 -1
- package/dist/chains/config/all-chains.d.mts +0 -4243
- package/dist/chains/config/all-chains.d.ts +0 -4243
- package/dist/chains/config/all-chains.d.ts.map +0 -1
- package/dist/chains/config/custom-chains.d.mts +0 -49
- package/dist/chains/config/custom-chains.d.ts +0 -49
- package/dist/chains/config/custom-chains.d.ts.map +0 -1
- package/dist/chains/config/mainnet-chains.d.mts +0 -1063
- package/dist/chains/config/mainnet-chains.d.ts +0 -1063
- package/dist/chains/config/mainnet-chains.d.ts.map +0 -1
- package/dist/chains/config/supported-chains.d.mts +0 -2172
- package/dist/chains/config/supported-chains.d.ts +0 -2172
- package/dist/chains/config/supported-chains.d.ts.map +0 -1
- package/dist/chains/config/testnet-chains.d.mts +0 -1110
- package/dist/chains/config/testnet-chains.d.ts +0 -1110
- package/dist/chains/config/testnet-chains.d.ts.map +0 -1
- package/dist/chains/lambda/chain-mapping.d.mts +0 -55
- package/dist/chains/lambda/chain-mapping.d.ts +0 -55
- package/dist/chains/lambda/chain-mapping.d.ts.map +0 -1
- package/dist/chains/lambda/index.d.mts +0 -2
- package/dist/chains/lambda/index.d.ts +0 -2
- package/dist/chains/lambda/index.d.ts.map +0 -1
- package/dist/chains/tokens/chain-tokens.d.mts +0 -6
- package/dist/chains/tokens/chain-tokens.d.ts +0 -6
- package/dist/chains/tokens/chain-tokens.d.ts.map +0 -1
- package/dist/chains/tokens/token-addresses.d.mts +0 -8
- package/dist/chains/tokens/token-addresses.d.ts +0 -8
- package/dist/chains/tokens/token-addresses.d.ts.map +0 -1
- package/dist/chains/tokens/token-metadata.d.mts +0 -5
- package/dist/chains/tokens/token-metadata.d.ts +0 -5
- package/dist/chains/tokens/token-metadata.d.ts.map +0 -1
- package/dist/chains/types.d.mts +0 -23
- package/dist/chains/types.d.ts +0 -23
- package/dist/chains/types.d.ts.map +0 -1
- package/dist/chains/utils/filter-tokens.d.mts +0 -3
- package/dist/chains/utils/filter-tokens.d.ts +0 -3
- package/dist/chains/utils/filter-tokens.d.ts.map +0 -1
- package/dist/chains/utils/stablecoin.d.mts +0 -7
- package/dist/chains/utils/stablecoin.d.ts +0 -7
- package/dist/chains/utils/stablecoin.d.ts.map +0 -1
- package/dist/chains/utils/token-maps.d.mts +0 -10
- package/dist/chains/utils/token-maps.d.ts +0 -10
- package/dist/chains/utils/token-maps.d.ts.map +0 -1
- package/dist/env.d.mts +0 -17
- package/dist/env.d.ts +0 -17
- package/dist/env.d.ts.map +0 -1
- package/dist/formatters/index.d.ts.map +0 -1
- package/dist/formatters/index.js.map +0 -7
- package/dist/formatters/index.mjs.map +0 -7
- package/dist/helpers/address.d.mts +0 -7
- package/dist/helpers/address.d.ts +0 -7
- package/dist/helpers/address.d.ts.map +0 -1
- package/dist/helpers/blockchain.d.mts +0 -41
- package/dist/helpers/blockchain.d.ts +0 -41
- package/dist/helpers/blockchain.d.ts.map +0 -1
- package/dist/helpers/date.d.mts +0 -70
- package/dist/helpers/date.d.ts +0 -70
- package/dist/helpers/date.d.ts.map +0 -1
- package/dist/helpers/datetime.d.mts +0 -57
- package/dist/helpers/datetime.d.ts +0 -57
- package/dist/helpers/datetime.d.ts.map +0 -1
- package/dist/helpers/domain.d.mts +0 -2
- package/dist/helpers/domain.d.ts +0 -2
- package/dist/helpers/domain.d.ts.map +0 -1
- package/dist/helpers/index.js.map +0 -7
- package/dist/helpers/index.mjs.map +0 -7
- package/dist/helpers/intl.d.mts +0 -20
- package/dist/helpers/intl.d.ts +0 -20
- package/dist/helpers/intl.d.ts.map +0 -1
- package/dist/helpers/logger.d.mts +0 -26
- package/dist/helpers/logger.d.ts +0 -26
- package/dist/helpers/logger.d.ts.map +0 -1
- package/dist/helpers/mask-options.d.mts +0 -10
- package/dist/helpers/mask-options.d.ts +0 -10
- package/dist/helpers/mask-options.d.ts.map +0 -1
- package/dist/helpers/num-formatter.d.mts +0 -3
- package/dist/helpers/num-formatter.d.ts +0 -3
- package/dist/helpers/num-formatter.d.ts.map +0 -1
- package/dist/helpers/polling.d.mts +0 -39
- package/dist/helpers/polling.d.ts +0 -39
- package/dist/helpers/polling.d.ts.map +0 -1
- package/dist/helpers/random.d.mts +0 -10
- package/dist/helpers/random.d.ts +0 -10
- package/dist/helpers/random.d.ts.map +0 -1
- package/dist/helpers/sdk-loader.d.mts +0 -25
- package/dist/helpers/sdk-loader.d.ts +0 -25
- package/dist/helpers/sdk-loader.d.ts.map +0 -1
- package/dist/helpers/signatures.d.mts +0 -17
- package/dist/helpers/signatures.d.ts +0 -17
- package/dist/helpers/signatures.d.ts.map +0 -1
- package/dist/helpers/string.d.mts +0 -17
- package/dist/helpers/string.d.ts +0 -17
- package/dist/helpers/string.d.ts.map +0 -1
- package/dist/helpers/types.d.mts +0 -39
- package/dist/helpers/types.d.ts +0 -39
- package/dist/helpers/types.d.ts.map +0 -1
- package/dist/helpers/url.d.mts +0 -11
- package/dist/helpers/url.d.ts +0 -11
- package/dist/helpers/url.d.ts.map +0 -1
- package/dist/helpers/window.d.mts +0 -37
- package/dist/helpers/window.d.ts +0 -37
- package/dist/helpers/window.d.ts.map +0 -1
- package/dist/helpers/zod.d.mts +0 -51
- package/dist/helpers/zod.d.ts +0 -51
- package/dist/helpers/zod.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/index.mjs.map +0 -7
- package/dist/instructions/actions/index.d.mts +0 -5
- package/dist/instructions/actions/index.d.ts +0 -5
- package/dist/instructions/actions/index.d.ts.map +0 -1
- package/dist/instructions/actions/refuel/index.d.mts +0 -15
- package/dist/instructions/actions/refuel/index.d.ts +0 -15
- package/dist/instructions/actions/refuel/index.d.ts.map +0 -1
- package/dist/instructions/actions/swap/index.d.mts +0 -19
- package/dist/instructions/actions/swap/index.d.ts +0 -19
- package/dist/instructions/actions/swap/index.d.ts.map +0 -1
- package/dist/instructions/actions/sweep/index.d.mts +0 -16
- package/dist/instructions/actions/sweep/index.d.ts +0 -16
- package/dist/instructions/actions/sweep/index.d.ts.map +0 -1
- package/dist/instructions/actions/transfer/index.d.mts +0 -13
- package/dist/instructions/actions/transfer/index.d.ts +0 -13
- package/dist/instructions/actions/transfer/index.d.ts.map +0 -1
- package/dist/instructions/activate.d.mts +0 -84
- package/dist/instructions/activate.d.ts +0 -84
- package/dist/instructions/activate.d.ts.map +0 -1
- package/dist/instructions/build.d.mts +0 -146
- package/dist/instructions/build.d.ts +0 -146
- package/dist/instructions/build.d.ts.map +0 -1
- package/dist/instructions/constants.d.mts +0 -9
- package/dist/instructions/constants.d.ts +0 -9
- package/dist/instructions/constants.d.ts.map +0 -1
- package/dist/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.d.mts +0 -609
- package/dist/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.d.ts +0 -609
- package/dist/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.d.ts.map +0 -1
- package/dist/instructions/types.d.mts +0 -289
- package/dist/instructions/types.d.ts +0 -289
- package/dist/instructions/types.d.ts.map +0 -1
- package/dist/payments/action-names.d.mts +0 -16
- package/dist/payments/action-names.d.ts +0 -16
- package/dist/payments/action-names.d.ts.map +0 -1
- package/dist/payments/actions/index.d.mts +0 -5
- package/dist/payments/actions/index.d.ts +0 -5
- package/dist/payments/actions/index.d.ts.map +0 -1
- package/dist/payments/actions/sweep-cctp.d.mts +0 -15
- package/dist/payments/actions/sweep-cctp.d.ts +0 -15
- package/dist/payments/actions/sweep-cctp.d.ts.map +0 -1
- package/dist/payments/actions/sweep-erc20.d.mts +0 -12
- package/dist/payments/actions/sweep-erc20.d.ts +0 -12
- package/dist/payments/actions/sweep-erc20.d.ts.map +0 -1
- package/dist/payments/actions/sweep-uniswap-v3.d.mts +0 -17
- package/dist/payments/actions/sweep-uniswap-v3.d.ts +0 -17
- package/dist/payments/actions/sweep-uniswap-v3.d.ts.map +0 -1
- package/dist/payments/actions/sweep.d.mts +0 -12
- package/dist/payments/actions/sweep.d.ts +0 -12
- package/dist/payments/actions/sweep.d.ts.map +0 -1
- package/dist/payments/build.d.mts +0 -28
- package/dist/payments/build.d.ts +0 -28
- package/dist/payments/build.d.ts.map +0 -1
- package/dist/payments/chain-token-config-builder.d.mts +0 -10
- package/dist/payments/chain-token-config-builder.d.ts +0 -10
- package/dist/payments/chain-token-config-builder.d.ts.map +0 -1
- package/dist/payments/comprehensive-payment-request.d.mts +0 -26
- package/dist/payments/comprehensive-payment-request.d.ts +0 -26
- package/dist/payments/comprehensive-payment-request.d.ts.map +0 -1
- package/dist/payments/config/cctp.d.mts +0 -14
- package/dist/payments/config/cctp.d.ts +0 -14
- package/dist/payments/config/cctp.d.ts.map +0 -1
- package/dist/payments/config/index.d.mts +0 -3
- package/dist/payments/config/index.d.ts +0 -3
- package/dist/payments/config/index.d.ts.map +0 -1
- package/dist/payments/config/tokens.d.mts +0 -14
- package/dist/payments/config/tokens.d.ts +0 -14
- package/dist/payments/config/tokens.d.ts.map +0 -1
- package/dist/payments/instruction-registry.d.mts +0 -19
- package/dist/payments/instruction-registry.d.ts +0 -19
- package/dist/payments/instruction-registry.d.ts.map +0 -1
- package/dist/payments/payment-metadata-builder.d.mts +0 -56
- package/dist/payments/payment-metadata-builder.d.ts +0 -56
- package/dist/payments/payment-metadata-builder.d.ts.map +0 -1
- package/dist/payments/payment-metadata.d.mts +0 -15
- package/dist/payments/payment-metadata.d.ts +0 -15
- package/dist/payments/payment-metadata.d.ts.map +0 -1
- package/dist/payments/payment-request-token-resolver.d.mts +0 -25
- package/dist/payments/payment-request-token-resolver.d.ts +0 -25
- package/dist/payments/payment-request-token-resolver.d.ts.map +0 -1
- package/dist/payments/types.d.mts +0 -40
- package/dist/payments/types.d.ts +0 -40
- package/dist/payments/types.d.ts.map +0 -1
- package/dist/payments/validation.d.mts +0 -19
- package/dist/payments/validation.d.ts +0 -19
- package/dist/payments/validation.d.ts.map +0 -1
- package/dist/schemas/account.d.mts +0 -9
- package/dist/schemas/account.d.ts +0 -9
- package/dist/schemas/account.d.ts.map +0 -1
- package/dist/schemas/brand.d.mts +0 -7
- package/dist/schemas/brand.d.ts +0 -7
- package/dist/schemas/brand.d.ts.map +0 -1
- package/dist/schemas/contact.d.mts +0 -18
- package/dist/schemas/contact.d.ts +0 -18
- package/dist/schemas/contact.d.ts.map +0 -1
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/instruction.d.mts +0 -248
- package/dist/schemas/instruction.d.ts +0 -248
- package/dist/schemas/instruction.d.ts.map +0 -1
- package/dist/schemas/misc.d.mts +0 -36
- package/dist/schemas/misc.d.ts +0 -36
- package/dist/schemas/misc.d.ts.map +0 -1
- package/dist/schemas/payment.d.mts +0 -64
- package/dist/schemas/payment.d.ts +0 -64
- package/dist/schemas/payment.d.ts.map +0 -1
- package/dist/schemas/token.d.mts +0 -17
- package/dist/schemas/token.d.ts +0 -17
- package/dist/schemas/token.d.ts.map +0 -1
- package/dist/schemas/transaction.d.mts +0 -65
- package/dist/schemas/transaction.d.ts +0 -65
- package/dist/schemas/transaction.d.ts.map +0 -1
- package/dist/schemas/user.d.mts +0 -24
- package/dist/schemas/user.d.ts +0 -24
- package/dist/schemas/user.d.ts.map +0 -1
- package/dist/server/client.d.mts +0 -3
- package/dist/server/client.d.ts +0 -3
- package/dist/server/client.d.ts.map +0 -1
- package/dist/server/routes/account.d.mts +0 -4
- package/dist/server/routes/account.d.ts +0 -4
- package/dist/server/routes/account.d.ts.map +0 -1
- package/dist/server/routes/auth.d.mts +0 -28
- package/dist/server/routes/auth.d.ts +0 -28
- package/dist/server/routes/auth.d.ts.map +0 -1
- package/dist/server/routes/bridge.d.mts +0 -254
- package/dist/server/routes/bridge.d.ts +0 -254
- package/dist/server/routes/bridge.d.ts.map +0 -1
- package/dist/server/routes/config.d.mts +0 -3
- package/dist/server/routes/config.d.ts +0 -3
- package/dist/server/routes/config.d.ts.map +0 -1
- package/dist/server/routes/index.d.mts +0 -8
- package/dist/server/routes/index.d.ts +0 -8
- package/dist/server/routes/index.d.ts.map +0 -1
- package/dist/server/routes/instruction.d.mts +0 -4
- package/dist/server/routes/instruction.d.ts +0 -4
- package/dist/server/routes/instruction.d.ts.map +0 -1
- package/dist/server/routes/integration.d.mts +0 -4
- package/dist/server/routes/integration.d.ts +0 -4
- package/dist/server/routes/integration.d.ts.map +0 -1
- package/dist/server/routes/payments.d.mts +0 -5
- package/dist/server/routes/payments.d.ts +0 -5
- package/dist/server/routes/payments.d.ts.map +0 -1
- package/dist/server/routes/verify.d.mts +0 -3
- package/dist/server/routes/verify.d.ts +0 -3
- package/dist/server/routes/verify.d.ts.map +0 -1
- package/dist/wallet/wagmi/config.d.mts +0 -18
- package/dist/wallet/wagmi/config.d.ts +0 -18
- package/dist/wallet/wagmi/config.d.ts.map +0 -1
package/dist/api/index.js
CHANGED
|
@@ -1,2095 +1,1615 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1
|
+
const require_chunk = require('../chunk-kSYXY2_d.js');
|
|
2
|
+
const require_api_urls = require('../api-urls-Cd20DG4i.js');
|
|
3
|
+
const require_defineProperty = require('../defineProperty-DbMdhrDE.js');
|
|
4
|
+
let zod = require("zod");
|
|
5
|
+
let axios = require("axios");
|
|
6
|
+
axios = require_chunk.__toESM(axios);
|
|
7
|
+
let _otim_utils_schemas = require("@otim/utils/schemas");
|
|
8
|
+
let _otim_utils_helpers = require("@otim/utils/helpers");
|
|
31
9
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
actionArgumentsSchema: () => actionArgumentsSchema,
|
|
54
|
-
actionNameSchema: () => actionNameSchema,
|
|
55
|
-
activityDataSchema: () => activityDataSchema,
|
|
56
|
-
activityRecordSchema: () => activityRecordSchema,
|
|
57
|
-
addressWhitelistCheckRequestSchema: () => addressWhitelistCheckRequestSchema,
|
|
58
|
-
addressWhitelistCheckResponseSchema: () => addressWhitelistCheckResponseSchema,
|
|
59
|
-
apiErrorSchema: () => apiErrorSchema,
|
|
60
|
-
attestationSchema: () => attestationSchema,
|
|
61
|
-
authLoginRequestSchema: () => authLoginRequestSchema,
|
|
62
|
-
authLoginResponseSchema: () => authLoginResponseSchema,
|
|
63
|
-
buildEphemeralInstructionSchema: () => buildEphemeralInstructionSchema,
|
|
64
|
-
buildSettlementRequestSchema: () => buildSettlementRequestSchema,
|
|
65
|
-
buildSettlementResponseSchema: () => buildSettlementResponseSchema,
|
|
66
|
-
calculateHasMore: () => calculateHasMore,
|
|
67
|
-
chainIdSchema: () => chainIdSchema,
|
|
68
|
-
chainSuccessResponseSchema: () => chainSuccessResponseSchema,
|
|
69
|
-
contactSchema: () => contactSchema,
|
|
70
|
-
createAPIClient: () => createAPIClient,
|
|
71
|
-
createAbortController: () => createAbortController,
|
|
72
|
-
createInstance: () => createInstance,
|
|
73
|
-
delegationCreateRequestSchema: () => delegationCreateRequestSchema,
|
|
74
|
-
delegationCreateResponseSchema: () => delegationCreateResponseSchema,
|
|
75
|
-
delegationStatusRequestSchema: () => delegationStatusRequestSchema,
|
|
76
|
-
delegationStatusResponseSchema: () => delegationStatusResponseSchema,
|
|
77
|
-
delegationStatusSchema: () => delegationStatusSchema,
|
|
78
|
-
delegationStatusValues: () => delegationStatusValues,
|
|
79
|
-
errorResponseSchema: () => errorResponseSchema,
|
|
80
|
-
extractPaginationParams: () => extractPaginationParams,
|
|
81
|
-
feeResponseSchema: () => feeResponseSchema2,
|
|
82
|
-
getConfigChainsResponseSchema: () => getConfigChainsResponseSchema,
|
|
83
|
-
getConfigTokensRequestParametersSchema: () => getConfigTokensRequestParametersSchema,
|
|
84
|
-
getConfigTokensResponseSchema: () => getConfigTokensResponseSchema,
|
|
85
|
-
getContactsRequestSchema: () => getContactsRequestSchema,
|
|
86
|
-
getContactsResponseSchema: () => getContactsResponseSchema,
|
|
87
|
-
getCurrentUserResponseSchema: () => getCurrentUserResponseSchema,
|
|
88
|
-
getDefaultPagination: () => getDefaultPagination,
|
|
89
|
-
getDelegateAddressResponseSchema: () => getDelegateAddressResponseSchema,
|
|
90
|
-
getDelegateAddressSchema: () => getDelegateAddressSchema,
|
|
91
|
-
getErrorMessage: () => getErrorMessage,
|
|
92
|
-
getErrorMessageWithCode: () => getErrorMessageWithCode,
|
|
93
|
-
getInstructionActivityRequestSchema: () => getInstructionActivityRequestSchema,
|
|
94
|
-
getInstructionActivityResponseSchema: () => getInstructionActivityResponseSchema,
|
|
95
|
-
getIntegrationRequestSchema: () => getIntegrationRequestSchema,
|
|
96
|
-
getMaxPriorityFeePerGasEstimateResponseSchema: () => getMaxPriorityFeePerGasEstimateResponseSchema,
|
|
97
|
-
getMaxPriorityFeePerGasEstimateSchema: () => getMaxPriorityFeePerGasEstimateSchema,
|
|
98
|
-
getOperatingAccountSubOrgResponseSchema: () => getOperatingAccountSubOrgResponseSchema,
|
|
99
|
-
getPaymentRequestsRequestSchema: () => getPaymentRequestsRequestSchema,
|
|
100
|
-
getPaymentRequestsResponseSchema: () => getPaymentRequestsResponseSchema,
|
|
101
|
-
getUserFriendlyErrorMessage: () => getUserFriendlyErrorMessage,
|
|
102
|
-
instructionActivateRequestSchema: () => instructionActivateRequestSchema,
|
|
103
|
-
instructionActivateResponseSchema: () => instructionActivateResponseSchema,
|
|
104
|
-
instructionBuildRequestSchema: () => instructionBuildRequestSchema,
|
|
105
|
-
instructionBuildSchema: () => instructionBuildSchema,
|
|
106
|
-
instructionDeactivateRequestSchema: () => instructionDeactivateRequestSchema,
|
|
107
|
-
instructionDeactivateResponseSchema: () => instructionDeactivateResponseSchema,
|
|
108
|
-
instructionDetailsRequestSchema: () => instructionDetailsRequestSchema,
|
|
109
|
-
instructionDetailsResponseSchema: () => instructionDetailsResponseSchema,
|
|
110
|
-
instructionGetAllRequestSchema: () => instructionGetAllRequestSchema,
|
|
111
|
-
instructionGetAllResponseSchema: () => instructionGetAllResponseSchema,
|
|
112
|
-
instructionGetRulesRequestSchema: () => instructionGetRulesRequestSchema,
|
|
113
|
-
instructionGetRulesResponseSchema: () => instructionGetRulesResponseSchema,
|
|
114
|
-
integrationResponseSchema: () => integrationResponseSchema,
|
|
115
|
-
integrationTypeSchema: () => integrationTypeSchema,
|
|
116
|
-
integrationTypeValues: () => integrationTypeValues,
|
|
117
|
-
isInstanceInit: () => isInstanceInit,
|
|
118
|
-
isTechnicalError: () => isTechnicalError,
|
|
119
|
-
isUserAddressableError: () => isUserAddressableError,
|
|
120
|
-
isUserRejectionError: () => isUserRejectionError,
|
|
121
|
-
meResponseSchema: () => meResponseSchema,
|
|
122
|
-
newContactRequestSchema: () => newContactRequestSchema,
|
|
123
|
-
newInstructionRequestSchema: () => newInstructionRequestSchema,
|
|
124
|
-
newOperatingAccountSubOrgResponseSchema: () => newOperatingAccountSubOrgResponseSchema,
|
|
125
|
-
paymentRequestBuildRequestSchema: () => paymentRequestBuildRequestSchema,
|
|
126
|
-
paymentRequestBuildResponseSchema: () => paymentRequestBuildResponseSchema,
|
|
127
|
-
paymentRequestDetailsRequestSchema: () => paymentRequestDetailsRequestSchema,
|
|
128
|
-
paymentRequestDetailsResponseSchema: () => paymentRequestDetailsResponseSchema,
|
|
129
|
-
paymentRequestNewRequestSchema: () => paymentRequestNewRequestSchema,
|
|
130
|
-
paymentRequestSchema: () => paymentRequestSchema,
|
|
131
|
-
paymentRequestStatusSchema: () => paymentRequestStatusSchema,
|
|
132
|
-
paymentRequestsDirectionSchema: () => paymentRequestsDirectionSchema,
|
|
133
|
-
sessionTokenRequestSchema: () => sessionTokenRequestSchema,
|
|
134
|
-
sessionTokenResponseSchema: () => sessionTokenResponseSchema,
|
|
135
|
-
sessionVerifyResponseSchema: () => sessionVerifyResponseSchema,
|
|
136
|
-
setChainIdSchema: () => setChainIdSchema,
|
|
137
|
-
transactionGetListRequestSchema: () => transactionGetListRequestSchema,
|
|
138
|
-
transactionGetListResponseSchema: () => transactionGetListResponseSchema,
|
|
139
|
-
turnkeyLoginRequestSchema: () => turnkeyLoginRequestSchema,
|
|
140
|
-
turnkeyLoginResponseSchema: () => turnkeyLoginResponseSchema,
|
|
141
|
-
turnkeyVerificationRequestSchema: () => turnkeyVerificationRequestSchema,
|
|
142
|
-
turnkeyVerificationResponseSchema: () => turnkeyVerificationResponseSchema,
|
|
143
|
-
updateIntegrationRequestSchema: () => updateIntegrationRequestSchema,
|
|
144
|
-
whitelistCheckRequestSchema: () => whitelistCheckRequestSchema,
|
|
145
|
-
whitelistCheckResponseSchema: () => whitelistCheckResponseSchema
|
|
146
|
-
});
|
|
147
|
-
module.exports = __toCommonJS(api_exports);
|
|
148
|
-
|
|
149
|
-
// src/api/core/error.ts
|
|
150
|
-
var import_zod = require("zod");
|
|
151
|
-
var apiErrorSchema = import_zod.z.object({
|
|
152
|
-
code: import_zod.z.string().nullish(),
|
|
153
|
-
message: import_zod.z.string().nullish(),
|
|
154
|
-
errorCode: import_zod.z.string().nullish(),
|
|
155
|
-
errorMessage: import_zod.z.string().nullish(),
|
|
156
|
-
status: import_zod.z.number().nullish(),
|
|
157
|
-
context: import_zod.z.object({
|
|
158
|
-
field_errors: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).nullish()
|
|
159
|
-
}).nullish()
|
|
160
|
-
});
|
|
161
|
-
var errorResponseSchema = import_zod.z.object({
|
|
162
|
-
message: import_zod.z.string().nullish(),
|
|
163
|
-
errorMessage: import_zod.z.string().nullish(),
|
|
164
|
-
errorCode: import_zod.z.string().nullish(),
|
|
165
|
-
errors: import_zod.z.array(apiErrorSchema).nullish()
|
|
166
|
-
});
|
|
167
|
-
var defaultErrorCode = "unknown";
|
|
168
|
-
var defaultErrorMessage = "Unexpected error";
|
|
10
|
+
//#region src/api/core/error.ts
|
|
11
|
+
const apiErrorSchema = zod.z.object({
|
|
12
|
+
code: zod.z.string().nullish(),
|
|
13
|
+
message: zod.z.string().nullish(),
|
|
14
|
+
errorCode: zod.z.string().nullish(),
|
|
15
|
+
errorMessage: zod.z.string().nullish(),
|
|
16
|
+
status: zod.z.number().nullish(),
|
|
17
|
+
context: zod.z.object({ field_errors: zod.z.record(zod.z.string(), zod.z.string()).nullish() }).nullish()
|
|
18
|
+
});
|
|
19
|
+
const errorResponseSchema = zod.z.object({
|
|
20
|
+
message: zod.z.string().nullish(),
|
|
21
|
+
errorMessage: zod.z.string().nullish(),
|
|
22
|
+
errorCode: zod.z.string().nullish(),
|
|
23
|
+
errors: zod.z.array(apiErrorSchema).nullish()
|
|
24
|
+
});
|
|
25
|
+
const defaultErrorCode = "unknown";
|
|
26
|
+
const defaultErrorMessage = "Unexpected error";
|
|
27
|
+
/**
|
|
28
|
+
* Extract the most likely server-provided error payload from a thrown value.
|
|
29
|
+
* Supports common shapes from HTTP clients (Axios/fetch) and plain objects.
|
|
30
|
+
*/
|
|
169
31
|
function extractErrorData(maybeError) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if (!errorData && (maybeError?.errorMessage || maybeError?.message || maybeError?.errorCode)) {
|
|
175
|
-
errorData = maybeError;
|
|
176
|
-
}
|
|
177
|
-
return errorData;
|
|
32
|
+
let errorData = maybeError?.body;
|
|
33
|
+
if (!errorData && maybeError?.response?.data) errorData = maybeError.response.data;
|
|
34
|
+
if (!errorData && (maybeError?.errorMessage || maybeError?.message || maybeError?.errorCode)) errorData = maybeError;
|
|
35
|
+
return errorData;
|
|
178
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Normalize Error Shapes Into One User‑Facing Message.
|
|
39
|
+
* Why: Prefer server messages and avoid leaking technical details.
|
|
40
|
+
*
|
|
41
|
+
* @param maybeError An unknown error thrown by an HTTP client, SDK, or server.
|
|
42
|
+
* @param fallbackMessage Message used when the payload cannot be parsed or
|
|
43
|
+
* lacks a message.
|
|
44
|
+
*/
|
|
179
45
|
function getErrorMessage(maybeError, fallbackMessage) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
46
|
+
const errorMessage = fallbackMessage ?? defaultErrorMessage;
|
|
47
|
+
const errorData = extractErrorData(maybeError);
|
|
48
|
+
const result = errorResponseSchema.safeParse(errorData);
|
|
49
|
+
if (!result.success) return errorMessage;
|
|
50
|
+
const { message, errorMessage: apiErrorMessage, errors } = result.data;
|
|
51
|
+
/**
|
|
52
|
+
* Prioritize Error Message From Backend, Then Message, Then Errors Array.
|
|
53
|
+
* Surfaces the most specific, server‑intended feedback first for better UX.
|
|
54
|
+
*/
|
|
55
|
+
return apiErrorMessage ?? message ?? errors?.[0]?.errorMessage ?? errors?.[0]?.message ?? errorMessage;
|
|
188
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Provide A Unified Error Message And Code For UI/Control‑Flow.
|
|
59
|
+
* Why: Normalize shapes and fall back to an "unknown" code.
|
|
60
|
+
*
|
|
61
|
+
* @param maybeError An unknown error thrown by an HTTP client, SDK, or server.
|
|
62
|
+
* @param fallbackMessage Message used when the payload cannot be parsed or is
|
|
63
|
+
* empty.
|
|
64
|
+
*/
|
|
189
65
|
function getErrorMessageWithCode(maybeError, fallbackMessage) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
errorCode,
|
|
203
|
-
errors
|
|
204
|
-
} = result.data;
|
|
205
|
-
return {
|
|
206
|
-
message: apiErrorMessage ?? message ?? errors?.[0]?.errorMessage ?? errors?.[0]?.message ?? errorMessage,
|
|
207
|
-
code: errorCode ?? errors?.[0]?.errorCode ?? errors?.[0]?.code ?? defaultErrorCode
|
|
208
|
-
};
|
|
66
|
+
const errorMessage = fallbackMessage ?? defaultErrorMessage;
|
|
67
|
+
const errorData = extractErrorData(maybeError);
|
|
68
|
+
const result = errorResponseSchema.safeParse(errorData);
|
|
69
|
+
if (!result.success || !result.data.errors?.[0] && !result.data.errorMessage && !result.data.message) return {
|
|
70
|
+
message: errorMessage,
|
|
71
|
+
code: defaultErrorCode
|
|
72
|
+
};
|
|
73
|
+
const { message, errorMessage: apiErrorMessage, errorCode, errors } = result.data;
|
|
74
|
+
return {
|
|
75
|
+
message: apiErrorMessage ?? message ?? errors?.[0]?.errorMessage ?? errors?.[0]?.message ?? errorMessage,
|
|
76
|
+
code: errorCode ?? errors?.[0]?.errorCode ?? errors?.[0]?.code ?? defaultErrorCode
|
|
77
|
+
};
|
|
209
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Detect User Rejection (e.g., Canceled Wallet Signature).
|
|
81
|
+
* Why: Treat cancellations as benign and keep telemetry clean.
|
|
82
|
+
*
|
|
83
|
+
* @param error The error object to check.
|
|
84
|
+
* @returns true if the error is a user rejection, false otherwise.
|
|
85
|
+
*/
|
|
210
86
|
function isUserRejectionError(error) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
];
|
|
233
|
-
return rejectionPatterns.some((pattern) => errorMessage.includes(pattern));
|
|
87
|
+
if (!error) return false;
|
|
88
|
+
/**
|
|
89
|
+
* Safely Extract Error Message From Various Possible Error Formats.
|
|
90
|
+
* Providers may throw strings, plain objects, or non-Error values.
|
|
91
|
+
*/
|
|
92
|
+
let errorMessage = "";
|
|
93
|
+
if (typeof error === "string") errorMessage = error;
|
|
94
|
+
else if (typeof error === "object") errorMessage = error.message || error.errorMessage || error.details || "";
|
|
95
|
+
if (!errorMessage) errorMessage = String(error);
|
|
96
|
+
errorMessage = errorMessage.toLowerCase();
|
|
97
|
+
return [
|
|
98
|
+
"user rejected",
|
|
99
|
+
"user denied",
|
|
100
|
+
"user cancelled",
|
|
101
|
+
"cancelled by user",
|
|
102
|
+
"rejected by user",
|
|
103
|
+
"user abort",
|
|
104
|
+
"transaction rejected",
|
|
105
|
+
"signature rejected",
|
|
106
|
+
"request rejected"
|
|
107
|
+
].some((pattern) => errorMessage.includes(pattern));
|
|
234
108
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Determine If An Error Code Is User‑Addressable.
|
|
111
|
+
* Why: 1000–1999 are intended to be surfaced to users.
|
|
112
|
+
*
|
|
113
|
+
* @param errorCode The error code to check.
|
|
114
|
+
* @param errorMessage Optional error message.
|
|
115
|
+
*/
|
|
116
|
+
const isUserAddressableError = (errorCode, errorMessage) => {
|
|
117
|
+
return errorCode >= 1e3 && errorCode < 2e3 && Boolean(errorMessage);
|
|
239
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* Detect Whether An Error Looks Technical/Low‑Level.
|
|
121
|
+
* Why: Avoid leaking framework/runtime details to users; rely on logging.
|
|
122
|
+
*/
|
|
240
123
|
function isTechnicalError(error) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return technicalErrorPatterns.some(
|
|
271
|
-
(pattern) => errorMessage.includes(pattern)
|
|
272
|
-
);
|
|
124
|
+
if (!error) return false;
|
|
125
|
+
/**
|
|
126
|
+
* Safely Extract Error Message From Various Possible Error Formats.
|
|
127
|
+
* Upstream code can throw strings or custom objects instead of Error
|
|
128
|
+
* instances.
|
|
129
|
+
*/
|
|
130
|
+
let errorMessage = "";
|
|
131
|
+
if (typeof error === "string") errorMessage = error;
|
|
132
|
+
else if (typeof error === "object") errorMessage = error.message || error.errorMessage || error.details || "";
|
|
133
|
+
if (!errorMessage) errorMessage = String(error);
|
|
134
|
+
errorMessage = errorMessage.toLowerCase();
|
|
135
|
+
return [
|
|
136
|
+
"is not a function",
|
|
137
|
+
"cannot read prop",
|
|
138
|
+
"cannot read property",
|
|
139
|
+
"reading undefined",
|
|
140
|
+
"read undefined of",
|
|
141
|
+
"cannot access before initialization",
|
|
142
|
+
"is not defined",
|
|
143
|
+
"is undefined",
|
|
144
|
+
"is null",
|
|
145
|
+
"unexpected token",
|
|
146
|
+
"syntax error",
|
|
147
|
+
"reference error",
|
|
148
|
+
"type error",
|
|
149
|
+
"network error",
|
|
150
|
+
"failed to fetch",
|
|
151
|
+
"server components"
|
|
152
|
+
].some((pattern) => errorMessage.includes(pattern));
|
|
273
153
|
}
|
|
274
154
|
function getUserFriendlyErrorMessage(error, fallbackMessage) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
return getErrorMessage(error, fallbackMessage);
|
|
155
|
+
if (isTechnicalError(error)) return "Internal server error";
|
|
156
|
+
return getErrorMessage(error, fallbackMessage);
|
|
279
157
|
}
|
|
280
158
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return instance;
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/api/core/instance.ts
|
|
161
|
+
const API_INSTANCE_DEFAULT_TIMEOUT = 3e4;
|
|
162
|
+
const createInstance = (config) => {
|
|
163
|
+
return axios.default.create({
|
|
164
|
+
timeout: API_INSTANCE_DEFAULT_TIMEOUT,
|
|
165
|
+
...config
|
|
166
|
+
});
|
|
290
167
|
};
|
|
291
|
-
|
|
292
|
-
|
|
168
|
+
const createAbortController = () => {
|
|
169
|
+
return new AbortController();
|
|
293
170
|
};
|
|
294
|
-
|
|
295
|
-
|
|
171
|
+
const isInstanceInit = (init) => {
|
|
172
|
+
return !!init && typeof init === "object" && "instance" in init;
|
|
296
173
|
};
|
|
297
174
|
|
|
298
|
-
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/api/core/service.ts
|
|
299
177
|
var ServiceError = class extends Error {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
};
|
|
306
|
-
var HttpMethod = {
|
|
307
|
-
Get: "GET",
|
|
308
|
-
Post: "POST",
|
|
309
|
-
Put: "PUT",
|
|
310
|
-
Delete: "DELETE"
|
|
178
|
+
constructor(message, code) {
|
|
179
|
+
super(message);
|
|
180
|
+
this.code = code;
|
|
181
|
+
this.name = "ServiceError";
|
|
182
|
+
}
|
|
311
183
|
};
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
Pending: "Pending",
|
|
318
|
-
Delegated: "Delegated",
|
|
319
|
-
Expired: "Expired",
|
|
320
|
-
Errored: "Errored"
|
|
184
|
+
const HttpMethod = {
|
|
185
|
+
Get: "GET",
|
|
186
|
+
Post: "POST",
|
|
187
|
+
Put: "PUT",
|
|
188
|
+
Delete: "DELETE"
|
|
321
189
|
};
|
|
322
|
-
var delegationStatusValues = Object.values(DelegationStatus);
|
|
323
|
-
var delegationStatusSchema = import_zod2.z.enum(delegationStatusValues);
|
|
324
|
-
var delegationStatusRequestSchema = import_zod2.z.object({
|
|
325
|
-
address: import_zod2.z.string(),
|
|
326
|
-
chainId: import_zod2.z.number()
|
|
327
|
-
});
|
|
328
|
-
var delegationStatusResponseSchema = import_zod2.z.object({
|
|
329
|
-
delegationStatus: delegationStatusSchema
|
|
330
|
-
});
|
|
331
|
-
var delegationCreateRequestSchema = import_zod2.z.object({
|
|
332
|
-
signedAuthorization: import_zod2.z.string(),
|
|
333
|
-
signerAddress: import_zod2.z.string()
|
|
334
|
-
});
|
|
335
|
-
var delegationCreateResponseSchema = import_zod2.z.object({
|
|
336
|
-
success: import_zod2.z.boolean(),
|
|
337
|
-
transactionHash: import_zod2.z.string().optional(),
|
|
338
|
-
message: import_zod2.z.string().optional()
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
// src/api/schemas/activity.ts
|
|
342
|
-
var import_zod8 = require("zod");
|
|
343
190
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
var TIME_REGEX = /^(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] (AM|PM)$/;
|
|
353
|
-
var regexSchema = (regex, message) => import_zod3.z.string().regex(regex, message);
|
|
354
|
-
var nonEmptyStringSchema = import_zod3.z.string().min(1);
|
|
355
|
-
var numberSchema = import_zod3.z.union([
|
|
356
|
-
import_zod3.z.number().finite(),
|
|
357
|
-
import_zod3.z.string().regex(/^-?\d*\.?\d+(?:[eE][-+]?\d+)?$/).transform(Number)
|
|
358
|
-
]);
|
|
359
|
-
var decimalStringSchema = import_zod3.z.string().regex(/^-?\d*\.?\d+$/).refine((val) => !isNaN(parseFloat(val)), {
|
|
360
|
-
message: "Must be a valid decimal number"
|
|
361
|
-
});
|
|
362
|
-
var bigintSchema = import_zod3.z.union([
|
|
363
|
-
import_zod3.z.bigint(),
|
|
364
|
-
import_zod3.z.string().regex(/^-?\d+$/).transform(BigInt)
|
|
365
|
-
]);
|
|
366
|
-
var hexStringSchema = import_zod3.z.string().startsWith("0x").transform((val) => val);
|
|
367
|
-
var dateSchema = regexSchema(DATE_REGEX);
|
|
368
|
-
var dateISO8601Schema = regexSchema(DATE_ISO_8601_REGEX);
|
|
369
|
-
var dateStandardSchema = regexSchema(DATE_STANDARD_REGEX);
|
|
370
|
-
var timeSchema = regexSchema(TIME_REGEX);
|
|
371
|
-
var Sort = {
|
|
372
|
-
Asc: "asc",
|
|
373
|
-
Desc: "desc"
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/api/schemas/account.ts
|
|
193
|
+
const DelegationStatus = {
|
|
194
|
+
Undelegated: "Undelegated",
|
|
195
|
+
Pending: "Pending",
|
|
196
|
+
Delegated: "Delegated",
|
|
197
|
+
Expired: "Expired",
|
|
198
|
+
Errored: "Errored"
|
|
374
199
|
};
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
200
|
+
const delegationStatusValues = Object.values(DelegationStatus);
|
|
201
|
+
const delegationStatusSchema = zod.z.enum(delegationStatusValues);
|
|
202
|
+
const delegationStatusRequestSchema = zod.z.object({
|
|
203
|
+
address: zod.z.string(),
|
|
204
|
+
chainId: zod.z.number()
|
|
205
|
+
});
|
|
206
|
+
const delegationStatusResponseSchema = zod.z.object({ delegationStatus: delegationStatusSchema });
|
|
207
|
+
const delegationCreateRequestSchema = zod.z.object({
|
|
208
|
+
signedAuthorization: zod.z.string(),
|
|
209
|
+
signerAddress: zod.z.string()
|
|
210
|
+
});
|
|
211
|
+
const delegationCreateResponseSchema = zod.z.object({
|
|
212
|
+
success: zod.z.boolean(),
|
|
213
|
+
transactionHash: zod.z.string().optional(),
|
|
214
|
+
message: zod.z.string().optional()
|
|
385
215
|
});
|
|
386
216
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
SweepCCTP: "sweepCCTP",
|
|
411
|
-
SweepUniswapV3: "sweepUniswapV3",
|
|
412
|
-
SweepDepositAccount: "sweepDepositAccount",
|
|
413
|
-
SweepDepositAccountERC20: "sweepDepositAccountERC20",
|
|
414
|
-
DeactivateInstruction: "deactivateInstruction",
|
|
415
|
-
SweepSkipCCTPDepositAccount: "sweepSkipCCTPDepositAccount"
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/api/schemas/activity.ts
|
|
219
|
+
const actionNameSchema = zod.z.enum(_otim_utils_schemas.instructionActionValues);
|
|
220
|
+
/**
|
|
221
|
+
* Human-readable labels for automation action names.
|
|
222
|
+
*/
|
|
223
|
+
const ACTION_NAME_LABELS = {
|
|
224
|
+
[_otim_utils_schemas.InstructionAction.Refuel]: "Refuel",
|
|
225
|
+
[_otim_utils_schemas.InstructionAction.RefuelERC20]: "Refuel",
|
|
226
|
+
[_otim_utils_schemas.InstructionAction.Transfer]: "Transfer",
|
|
227
|
+
[_otim_utils_schemas.InstructionAction.TransferERC20]: "Transfer",
|
|
228
|
+
[_otim_utils_schemas.InstructionAction.TransferCCTP]: "Transfer",
|
|
229
|
+
[_otim_utils_schemas.InstructionAction.Sweep]: "Sweep",
|
|
230
|
+
[_otim_utils_schemas.InstructionAction.SweepERC20]: "Sweep",
|
|
231
|
+
[_otim_utils_schemas.InstructionAction.SweepCCTP]: "Sweep",
|
|
232
|
+
[_otim_utils_schemas.InstructionAction.SweepUniswapV3]: "Trade",
|
|
233
|
+
[_otim_utils_schemas.InstructionAction.UniswapV3ExactInput]: "Trade",
|
|
234
|
+
[_otim_utils_schemas.InstructionAction.DepositERC4626]: "Deposit",
|
|
235
|
+
[_otim_utils_schemas.InstructionAction.SweepDepositERC4626]: "Deposit",
|
|
236
|
+
[_otim_utils_schemas.InstructionAction.WithdrawERC4626]: "Withdraw",
|
|
237
|
+
[_otim_utils_schemas.InstructionAction.SweepWithdrawERC4626]: "Withdraw",
|
|
238
|
+
[_otim_utils_schemas.InstructionAction.DeactivateInstruction]: "Deactivate",
|
|
239
|
+
[_otim_utils_schemas.InstructionAction.CallOnce]: "Call Once"
|
|
416
240
|
};
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
241
|
+
const DEFAULT_ACTION_LABEL = "–";
|
|
242
|
+
/**
|
|
243
|
+
* Human-readable labels for payment rails.
|
|
244
|
+
*/
|
|
245
|
+
const PAYMENT_RAIL_LABELS = {
|
|
246
|
+
ach_push: "ACH",
|
|
247
|
+
pix: "PIX",
|
|
248
|
+
sepa: "SEPA",
|
|
249
|
+
spei: "SPEI",
|
|
250
|
+
wire: "Wire"
|
|
422
251
|
};
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
type: import_zod4.z.literal(InstructionScheduleStartType.DateTime),
|
|
434
|
-
startDate: dateStandardSchema,
|
|
435
|
-
startTime: import_zod4.z.string()
|
|
436
|
-
});
|
|
437
|
-
var instructionScheduleStartSchema = import_zod4.z.discriminatedUnion("type", [
|
|
438
|
-
nowStartSchema,
|
|
439
|
-
dateTimeStartSchema
|
|
440
|
-
]);
|
|
441
|
-
var InstructionScheduleRepeatType = {
|
|
442
|
-
UntilDeactivated: "until-deactivated",
|
|
443
|
-
MaxExecutions: "max-executions"
|
|
444
|
-
};
|
|
445
|
-
var instructionScheduleRepeatValues = Object.values(
|
|
446
|
-
InstructionScheduleRepeatType
|
|
447
|
-
);
|
|
448
|
-
var baseRepeatSchema = import_zod4.z.object({});
|
|
449
|
-
var untilDeactivatedRepeatSchema = baseRepeatSchema.extend({
|
|
450
|
-
type: import_zod4.z.literal(InstructionScheduleRepeatType.UntilDeactivated)
|
|
451
|
-
});
|
|
452
|
-
var maxExecutionsRepeatSchema = baseRepeatSchema.extend({
|
|
453
|
-
type: import_zod4.z.literal(InstructionScheduleRepeatType.MaxExecutions),
|
|
454
|
-
maxExecutions: numberSchema
|
|
455
|
-
});
|
|
456
|
-
var instructionScheduleRepeatSchema = import_zod4.z.discriminatedUnion("type", [
|
|
457
|
-
untilDeactivatedRepeatSchema,
|
|
458
|
-
maxExecutionsRepeatSchema
|
|
459
|
-
]);
|
|
460
|
-
var InstructionScheduleRetryType = {
|
|
461
|
-
UntilDeactivated: "until-deactivated",
|
|
462
|
-
TimeLimited: "time-limited"
|
|
463
|
-
};
|
|
464
|
-
var instructionScheduleRetryValues = Object.values(
|
|
465
|
-
InstructionScheduleRetryType
|
|
466
|
-
);
|
|
467
|
-
var baseRetrySchema = import_zod4.z.object({});
|
|
468
|
-
var untilDeactivatedRetrySchema = baseRetrySchema.extend({
|
|
469
|
-
type: import_zod4.z.literal(InstructionScheduleRetryType.UntilDeactivated)
|
|
470
|
-
});
|
|
471
|
-
var timeLimitedRetrySchema = baseRetrySchema.extend({
|
|
472
|
-
type: import_zod4.z.literal(InstructionScheduleRetryType.TimeLimited),
|
|
473
|
-
retryCount: numberSchema
|
|
474
|
-
});
|
|
475
|
-
var instructionScheduleRetrySchema = import_zod4.z.discriminatedUnion("type", [
|
|
476
|
-
untilDeactivatedRetrySchema,
|
|
477
|
-
timeLimitedRetrySchema
|
|
478
|
-
]);
|
|
479
|
-
var TimeUnit = {
|
|
480
|
-
None: "none",
|
|
481
|
-
Second: "second",
|
|
482
|
-
Minute: "minute",
|
|
483
|
-
Hour: "hour",
|
|
484
|
-
Day: "day",
|
|
485
|
-
Week: "week",
|
|
486
|
-
Month: "month"
|
|
487
|
-
};
|
|
488
|
-
var timeUnitValues = Object.values(TimeUnit);
|
|
489
|
-
var timeUnitSchema = import_zod4.z.enum(timeUnitValues);
|
|
490
|
-
var instructionExecutionStateSchema = import_zod4.z.object({
|
|
491
|
-
executionStatus: instructionStateSchema.optional(),
|
|
492
|
-
executionCounter: import_zod4.z.number().int().optional(),
|
|
493
|
-
lastExecuted: import_zod4.z.number().int().optional()
|
|
494
|
-
});
|
|
495
|
-
var instructionSchema = import_zod4.z.object({
|
|
496
|
-
instructionId: hexStringSchema,
|
|
497
|
-
createdAt: import_zod4.z.number().optional(),
|
|
498
|
-
startAt: import_zod4.z.string().nullish(),
|
|
499
|
-
interval: import_zod4.z.number().nullish(),
|
|
500
|
-
timeout: import_zod4.z.number().nullish(),
|
|
501
|
-
maxExecutions: import_zod4.z.number().nullish(),
|
|
502
|
-
executionState: instructionExecutionStateSchema.optional(),
|
|
503
|
-
actionName: import_zod4.z.string().optional(),
|
|
504
|
-
arguments: import_zod4.z.any(),
|
|
505
|
-
nickname: import_zod4.z.string().nullish(),
|
|
506
|
-
lastInstructedValue: import_zod4.z.string().optional(),
|
|
507
|
-
lastErrorCode: import_zod4.z.number().nullish(),
|
|
508
|
-
lastErrorMessage: import_zod4.z.string().nullish(),
|
|
509
|
-
totalInstructedValue: import_zod4.z.string().optional(),
|
|
510
|
-
instructedTokenAddress: hexStringSchema.nullish(),
|
|
511
|
-
chainId: import_zod4.z.number().nullish(),
|
|
512
|
-
chain: import_zod4.z.string().optional()
|
|
513
|
-
});
|
|
514
|
-
var instructionsSchema = import_zod4.z.array(instructionSchema);
|
|
515
|
-
var instructionSummarySchema = import_zod4.z.object({
|
|
516
|
-
instructionId: hexStringSchema,
|
|
517
|
-
chainId: import_zod4.z.number().int(),
|
|
518
|
-
executionCount: import_zod4.z.number().int(),
|
|
519
|
-
onTimeCount: import_zod4.z.number().int(),
|
|
520
|
-
lateCount: import_zod4.z.number().int(),
|
|
521
|
-
wasActivatedDuring: import_zod4.z.boolean(),
|
|
522
|
-
amount: import_zod4.z.number().default(0),
|
|
523
|
-
instructedValue: import_zod4.z.string().nullish().default("0"),
|
|
524
|
-
instructedTokenAddress: import_zod4.z.string().nullish().default(null)
|
|
525
|
-
});
|
|
526
|
-
var instructionSummariesSchema = import_zod4.z.array(instructionSummarySchema);
|
|
527
|
-
var instructionSummariesByDateSchema = import_zod4.z.record(
|
|
528
|
-
import_zod4.z.string(),
|
|
529
|
-
instructionSummariesSchema
|
|
530
|
-
);
|
|
531
|
-
var InstructionViewTimescale = {
|
|
532
|
-
Days: "days",
|
|
533
|
-
Hours: "hours",
|
|
534
|
-
Minutes: "minutes",
|
|
535
|
-
Seconds: "seconds"
|
|
536
|
-
};
|
|
537
|
-
var instructionViewTimescaleValues = Object.values(
|
|
538
|
-
InstructionViewTimescale
|
|
539
|
-
);
|
|
540
|
-
|
|
541
|
-
// src/schemas/payment.ts
|
|
542
|
-
var import_zod5 = require("zod");
|
|
543
|
-
var PaymentStatus = {
|
|
544
|
-
Due: "due",
|
|
545
|
-
NotDue: "not-due",
|
|
546
|
-
Paid: "paid"
|
|
252
|
+
/**
|
|
253
|
+
* Human-readable labels for virtual account event types.
|
|
254
|
+
*/
|
|
255
|
+
const VIRTUAL_ACCOUNT_EVENT_LABELS = {
|
|
256
|
+
funds_received: "Funds Received",
|
|
257
|
+
payment_submitted: "Payment Submitted",
|
|
258
|
+
payment_processed: "Payment Processed",
|
|
259
|
+
in_review: "In Review",
|
|
260
|
+
microdeposit: "Microdeposit",
|
|
261
|
+
funds_scheduled: "Funds Scheduled"
|
|
547
262
|
};
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
});
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
})
|
|
614
|
-
|
|
615
|
-
amount: import_zod6.z.object({
|
|
616
|
-
value: import_zod6.z.number(),
|
|
617
|
-
token: import_zod6.z.string()
|
|
618
|
-
})
|
|
619
|
-
});
|
|
620
|
-
var transactionsSchema = import_zod6.z.array(transactionSchema);
|
|
621
|
-
|
|
622
|
-
// src/schemas/user.ts
|
|
623
|
-
var import_zod7 = require("zod");
|
|
624
|
-
var entityIdSchema = import_zod7.z.string().uuid();
|
|
625
|
-
var addressSchema = import_zod7.z.string().regex(/^0x[a-fA-F0-9]{40}$/).transform((v) => v.toLowerCase());
|
|
626
|
-
var userPreferencesSchema = import_zod7.z.object({
|
|
627
|
-
chainId: import_zod7.z.number().optional(),
|
|
628
|
-
tokenSymbol: import_zod7.z.string().optional(),
|
|
629
|
-
localCurrency: import_zod7.z.string().optional()
|
|
630
|
-
});
|
|
631
|
-
var userSchema = import_zod7.z.object({
|
|
632
|
-
id: entityIdSchema,
|
|
633
|
-
address: addressSchema,
|
|
634
|
-
createdAt: import_zod7.z.string(),
|
|
635
|
-
updatedAt: import_zod7.z.string(),
|
|
636
|
-
preferences: userPreferencesSchema.optional(),
|
|
637
|
-
isDeveloper: import_zod7.z.boolean(),
|
|
638
|
-
developerPublicKey: import_zod7.z.string().nullable().optional()
|
|
639
|
-
});
|
|
640
|
-
|
|
641
|
-
// src/api/schemas/activity.ts
|
|
642
|
-
var actionNameSchema = import_zod8.z.enum([
|
|
643
|
-
"refuel",
|
|
644
|
-
"transfer",
|
|
645
|
-
"refuelERC20",
|
|
646
|
-
"transferERC20",
|
|
647
|
-
"uniswapV3ExactInput",
|
|
648
|
-
"deactivateInstruction",
|
|
649
|
-
"sweepCCTP",
|
|
650
|
-
"transferCCTP",
|
|
651
|
-
"sweep",
|
|
652
|
-
"sweepERC20",
|
|
653
|
-
"sweepUniswapV3",
|
|
654
|
-
"depositERC4626",
|
|
655
|
-
"sweepDepositERC4626",
|
|
656
|
-
"withdrawERC4626",
|
|
657
|
-
"sweepWithdrawERC4626",
|
|
658
|
-
"callOnce"
|
|
659
|
-
]);
|
|
660
|
-
var transferFieldsSchema = import_zod8.z.object({
|
|
661
|
-
token: hexStringSchema,
|
|
662
|
-
from: hexStringSchema,
|
|
663
|
-
to: hexStringSchema,
|
|
664
|
-
value: hexStringSchema
|
|
665
|
-
});
|
|
666
|
-
var swapFieldsSchema = import_zod8.z.object({
|
|
667
|
-
poolAddress: hexStringSchema,
|
|
668
|
-
fromToken: hexStringSchema,
|
|
669
|
-
toToken: hexStringSchema,
|
|
670
|
-
from: hexStringSchema,
|
|
671
|
-
to: hexStringSchema,
|
|
672
|
-
fromAmount: hexStringSchema,
|
|
673
|
-
toAmount: hexStringSchema
|
|
674
|
-
});
|
|
675
|
-
var cctpBurnFieldsSchema = import_zod8.z.object({
|
|
676
|
-
token: hexStringSchema,
|
|
677
|
-
from: hexStringSchema,
|
|
678
|
-
mintRecipient: hexStringSchema,
|
|
679
|
-
destinationDomain: hexStringSchema,
|
|
680
|
-
value: hexStringSchema
|
|
681
|
-
});
|
|
682
|
-
var erc4626DepositFieldsSchema = import_zod8.z.object({
|
|
683
|
-
vault: hexStringSchema,
|
|
684
|
-
token: hexStringSchema,
|
|
685
|
-
from: hexStringSchema,
|
|
686
|
-
owner: hexStringSchema,
|
|
687
|
-
value: hexStringSchema,
|
|
688
|
-
shares: hexStringSchema
|
|
689
|
-
});
|
|
690
|
-
var erc4626WithdrawFieldsSchema = import_zod8.z.object({
|
|
691
|
-
vault: hexStringSchema,
|
|
692
|
-
token: hexStringSchema,
|
|
693
|
-
from: hexStringSchema,
|
|
694
|
-
to: hexStringSchema,
|
|
695
|
-
value: hexStringSchema,
|
|
696
|
-
shares: hexStringSchema
|
|
697
|
-
});
|
|
698
|
-
var activityDataSchema = import_zod8.z.union([
|
|
699
|
-
import_zod8.z.object({ transfer: transferFieldsSchema }),
|
|
700
|
-
import_zod8.z.object({ swap: swapFieldsSchema }),
|
|
701
|
-
import_zod8.z.object({ cctpBurn: cctpBurnFieldsSchema }),
|
|
702
|
-
import_zod8.z.object({ erc4626Deposit: erc4626DepositFieldsSchema }),
|
|
703
|
-
import_zod8.z.object({ erc4626Withdraw: erc4626WithdrawFieldsSchema })
|
|
263
|
+
/**
|
|
264
|
+
* Formats a payment rail value to a human-readable label.
|
|
265
|
+
*/
|
|
266
|
+
function formatPaymentRail(paymentRail) {
|
|
267
|
+
if (!paymentRail) return DEFAULT_ACTION_LABEL;
|
|
268
|
+
const label = PAYMENT_RAIL_LABELS[paymentRail.toLowerCase()];
|
|
269
|
+
if (label) return label;
|
|
270
|
+
return paymentRail.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Formats an action name to a human-readable label.
|
|
274
|
+
*/
|
|
275
|
+
function formatActionName(actionName, source) {
|
|
276
|
+
if (!actionName) return DEFAULT_ACTION_LABEL;
|
|
277
|
+
if (actionName.startsWith("virtual_account_")) {
|
|
278
|
+
if (source?.payment_rail) return formatPaymentRail(source.payment_rail);
|
|
279
|
+
const eventType = actionName.replace("virtual_account_", "");
|
|
280
|
+
const label = VIRTUAL_ACCOUNT_EVENT_LABELS[eventType];
|
|
281
|
+
if (label) return label;
|
|
282
|
+
return eventType.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
283
|
+
}
|
|
284
|
+
return ACTION_NAME_LABELS[actionName] ?? DEFAULT_ACTION_LABEL;
|
|
285
|
+
}
|
|
286
|
+
const transferFieldsSchema = zod.z.object({
|
|
287
|
+
token: _otim_utils_schemas.hexStringSchema,
|
|
288
|
+
from: _otim_utils_schemas.hexStringSchema,
|
|
289
|
+
to: _otim_utils_schemas.hexStringSchema,
|
|
290
|
+
value: _otim_utils_schemas.hexStringSchema
|
|
291
|
+
});
|
|
292
|
+
const swapFieldsSchema = zod.z.object({
|
|
293
|
+
poolAddress: _otim_utils_schemas.hexStringSchema,
|
|
294
|
+
fromToken: _otim_utils_schemas.hexStringSchema,
|
|
295
|
+
toToken: _otim_utils_schemas.hexStringSchema,
|
|
296
|
+
from: _otim_utils_schemas.hexStringSchema,
|
|
297
|
+
to: _otim_utils_schemas.hexStringSchema,
|
|
298
|
+
fromAmount: _otim_utils_schemas.hexStringSchema,
|
|
299
|
+
toAmount: _otim_utils_schemas.hexStringSchema
|
|
300
|
+
});
|
|
301
|
+
const cctpBurnFieldsSchema = zod.z.object({
|
|
302
|
+
token: _otim_utils_schemas.hexStringSchema,
|
|
303
|
+
from: _otim_utils_schemas.hexStringSchema,
|
|
304
|
+
mintRecipient: _otim_utils_schemas.hexStringSchema,
|
|
305
|
+
destinationDomain: _otim_utils_schemas.hexStringSchema,
|
|
306
|
+
value: _otim_utils_schemas.hexStringSchema
|
|
307
|
+
});
|
|
308
|
+
const erc4626DepositFieldsSchema = zod.z.object({
|
|
309
|
+
vault: _otim_utils_schemas.hexStringSchema,
|
|
310
|
+
token: _otim_utils_schemas.hexStringSchema,
|
|
311
|
+
from: _otim_utils_schemas.hexStringSchema,
|
|
312
|
+
owner: _otim_utils_schemas.hexStringSchema,
|
|
313
|
+
value: _otim_utils_schemas.hexStringSchema,
|
|
314
|
+
shares: _otim_utils_schemas.hexStringSchema
|
|
315
|
+
});
|
|
316
|
+
const erc4626WithdrawFieldsSchema = zod.z.object({
|
|
317
|
+
vault: _otim_utils_schemas.hexStringSchema,
|
|
318
|
+
token: _otim_utils_schemas.hexStringSchema,
|
|
319
|
+
from: _otim_utils_schemas.hexStringSchema,
|
|
320
|
+
to: _otim_utils_schemas.hexStringSchema,
|
|
321
|
+
value: _otim_utils_schemas.hexStringSchema,
|
|
322
|
+
shares: _otim_utils_schemas.hexStringSchema
|
|
323
|
+
});
|
|
324
|
+
const activityDataSchema = zod.z.union([
|
|
325
|
+
zod.z.object({ transfer: transferFieldsSchema }),
|
|
326
|
+
zod.z.object({ swap: swapFieldsSchema }),
|
|
327
|
+
zod.z.object({ cctpBurn: cctpBurnFieldsSchema }),
|
|
328
|
+
zod.z.object({ erc4626Deposit: erc4626DepositFieldsSchema }),
|
|
329
|
+
zod.z.object({ erc4626Withdraw: erc4626WithdrawFieldsSchema })
|
|
704
330
|
]);
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
});
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
});
|
|
719
|
-
|
|
331
|
+
const activityRecordSchema = zod.z.object({
|
|
332
|
+
actionName: actionNameSchema,
|
|
333
|
+
blockTimestamp: _otim_utils_schemas.numberSchema,
|
|
334
|
+
transactionHash: _otim_utils_schemas.hexStringSchema,
|
|
335
|
+
activity: activityDataSchema,
|
|
336
|
+
instructionId: _otim_utils_schemas.hexStringSchema.nullable(),
|
|
337
|
+
executionCount: zod.z.number().nullable()
|
|
338
|
+
});
|
|
339
|
+
const getInstructionActivityRequestSchema = zod.z.object({
|
|
340
|
+
chainId: zod.z.number(),
|
|
341
|
+
actionNames: zod.z.array(actionNameSchema),
|
|
342
|
+
page: _otim_utils_schemas.numberSchema.optional(),
|
|
343
|
+
perPage: _otim_utils_schemas.numberSchema.optional()
|
|
344
|
+
});
|
|
345
|
+
const getInstructionActivityResponseSchema = zod.z.array(activityRecordSchema);
|
|
720
346
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
});
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
});
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
});
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
});
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
});
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
isAllowed: import_zod9.z.boolean(),
|
|
778
|
-
message: import_zod9.z.string().optional()
|
|
779
|
-
});
|
|
780
|
-
var getCurrentUserResponseSchema = import_zod9.z.object({
|
|
781
|
-
data: userSchema
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region src/api/schemas/auth.ts
|
|
349
|
+
const authLoginRequestSchema = zod.z.object({
|
|
350
|
+
siwe: zod.z.string(),
|
|
351
|
+
signature: _otim_utils_schemas.vrsSchema
|
|
352
|
+
});
|
|
353
|
+
const authLoginResponseSchema = zod.z.object({
|
|
354
|
+
authorization: zod.z.string(),
|
|
355
|
+
user: _otim_utils_schemas.userSchema
|
|
356
|
+
});
|
|
357
|
+
const turnkeyVerificationRequestSchema = zod.z.object({ email: zod.z.string().email() });
|
|
358
|
+
const turnkeyVerificationResponseSchema = zod.z.object({
|
|
359
|
+
isLogin: zod.z.boolean(),
|
|
360
|
+
codeAlreadyExists: zod.z.boolean().optional()
|
|
361
|
+
});
|
|
362
|
+
const attestationSchema = zod.z.object({
|
|
363
|
+
credentialId: zod.z.string(),
|
|
364
|
+
clientDataJson: zod.z.string(),
|
|
365
|
+
attestationObject: zod.z.string(),
|
|
366
|
+
transports: zod.z.array(zod.z.string()).optional()
|
|
367
|
+
});
|
|
368
|
+
const turnkeyLoginRequestSchema = zod.z.object({
|
|
369
|
+
email: zod.z.email(),
|
|
370
|
+
verificationCode: zod.z.coerce.number().int().min(1e5).max(999999),
|
|
371
|
+
passkeyChallenge: zod.z.string().optional(),
|
|
372
|
+
attestation: attestationSchema.optional()
|
|
373
|
+
});
|
|
374
|
+
const turnkeyLoginResponseSchema = zod.z.object({
|
|
375
|
+
email: zod.z.string(),
|
|
376
|
+
subOrgId: zod.z.string(),
|
|
377
|
+
walletAddress: zod.z.string(),
|
|
378
|
+
isLogin: zod.z.boolean().optional()
|
|
379
|
+
});
|
|
380
|
+
const meResponseSchema = _otim_utils_schemas.userSchema;
|
|
381
|
+
const sessionTokenRequestSchema = zod.z.object({
|
|
382
|
+
sessionToken: zod.z.string(),
|
|
383
|
+
userId: zod.z.string()
|
|
384
|
+
});
|
|
385
|
+
const sessionTokenResponseSchema = zod.z.object({ success: zod.z.boolean() });
|
|
386
|
+
const sessionVerifyResponseSchema = zod.z.object({
|
|
387
|
+
authenticated: zod.z.boolean(),
|
|
388
|
+
hasSessionToken: zod.z.boolean()
|
|
389
|
+
});
|
|
390
|
+
/**
|
|
391
|
+
* @todo
|
|
392
|
+
* - Remove later, this is a temporary schema for the whitelist check
|
|
393
|
+
*/
|
|
394
|
+
const whitelistCheckRequestSchema = zod.z.object({ email: zod.z.string().email() });
|
|
395
|
+
const whitelistCheckResponseSchema = zod.z.object({
|
|
396
|
+
isAllowed: zod.z.boolean(),
|
|
397
|
+
message: zod.z.string().optional()
|
|
398
|
+
});
|
|
399
|
+
const addressWhitelistCheckRequestSchema = zod.z.object({ address: zod.z.string() });
|
|
400
|
+
const addressWhitelistCheckResponseSchema = zod.z.object({
|
|
401
|
+
isAllowed: zod.z.boolean(),
|
|
402
|
+
message: zod.z.string().optional()
|
|
782
403
|
});
|
|
783
404
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
});
|
|
792
|
-
var chainSuccessResponseSchema = import_zod10.z.object({
|
|
793
|
-
success: import_zod10.z.boolean(),
|
|
794
|
-
chainId: import_zod10.z.number().optional()
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/api/schemas/chain.ts
|
|
407
|
+
const chainIdSchema = zod.z.object({ chainId: zod.z.number().nullable() });
|
|
408
|
+
const setChainIdSchema = zod.z.object({ chainId: zod.z.number().positive() });
|
|
409
|
+
const chainSuccessResponseSchema = zod.z.object({
|
|
410
|
+
success: zod.z.boolean(),
|
|
411
|
+
chainId: zod.z.number().optional()
|
|
795
412
|
});
|
|
796
413
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
});
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
});
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
address: hexStringSchema
|
|
813
|
-
})
|
|
814
|
-
)
|
|
815
|
-
});
|
|
816
|
-
var getConfigChainsResponseSchema = import_zod11.z.unknown();
|
|
817
|
-
var getMaxPriorityFeePerGasEstimateSchema = import_zod11.z.object({
|
|
818
|
-
chainId: import_zod11.z.number()
|
|
819
|
-
});
|
|
820
|
-
var getMaxPriorityFeePerGasEstimateResponseSchema = import_zod11.z.object({
|
|
821
|
-
slowMaxPriorityFeeEstimate: import_zod11.z.number(),
|
|
822
|
-
normalMaxPriorityFeeEstimate: import_zod11.z.number(),
|
|
823
|
-
fastMaxPriorityFeeEstimate: import_zod11.z.number()
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/api/schemas/config.ts
|
|
416
|
+
const getDelegateAddressSchema = zod.z.object({ chainId: zod.z.number() });
|
|
417
|
+
const getDelegateAddressResponseSchema = zod.z.object({ otimDelegateAddress: zod.z.string() });
|
|
418
|
+
const getConfigTokensRequestParametersSchema = zod.z.object({ chainId: zod.z.number() });
|
|
419
|
+
const getConfigTokensResponseSchema = zod.z.object({ tokens: zod.z.array(zod.z.object({
|
|
420
|
+
symbol: zod.z.any(),
|
|
421
|
+
address: _otim_utils_schemas.hexStringSchema
|
|
422
|
+
})) });
|
|
423
|
+
const getConfigChainsResponseSchema = zod.z.unknown();
|
|
424
|
+
const getMaxPriorityFeePerGasEstimateSchema = zod.z.object({ chainId: zod.z.number() });
|
|
425
|
+
const getMaxPriorityFeePerGasEstimateResponseSchema = zod.z.object({
|
|
426
|
+
slowMaxPriorityFeeEstimate: zod.z.number(),
|
|
427
|
+
normalMaxPriorityFeeEstimate: zod.z.number(),
|
|
428
|
+
fastMaxPriorityFeeEstimate: zod.z.number()
|
|
824
429
|
});
|
|
825
430
|
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
});
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
});
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
});
|
|
843
|
-
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region src/api/schemas/contacts.ts
|
|
433
|
+
const newContactRequestSchema = zod.z.object({
|
|
434
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
435
|
+
name: zod.z.string()
|
|
436
|
+
});
|
|
437
|
+
const getContactsRequestSchema = zod.z.object({
|
|
438
|
+
perPage: _otim_utils_schemas.numberSchema.optional(),
|
|
439
|
+
page: _otim_utils_schemas.numberSchema.optional()
|
|
440
|
+
});
|
|
441
|
+
const contactSchema = zod.z.object({
|
|
442
|
+
userId: zod.z.string(),
|
|
443
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
444
|
+
name: zod.z.string(),
|
|
445
|
+
createdAt: zod.z.string(),
|
|
446
|
+
updatedAt: zod.z.string()
|
|
447
|
+
});
|
|
448
|
+
const getContactsResponseSchema = zod.z.array(contactSchema);
|
|
844
449
|
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
});
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
});
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
});
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
});
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
});
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
});
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
});
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region src/api/schemas/instruction.ts
|
|
452
|
+
const feeSchema = zod.z.object({
|
|
453
|
+
executionFee: _otim_utils_schemas.hexStringSchema,
|
|
454
|
+
maxBaseFeePerGas: _otim_utils_schemas.hexStringSchema,
|
|
455
|
+
maxPriorityFeePerGas: _otim_utils_schemas.hexStringSchema,
|
|
456
|
+
token: _otim_utils_schemas.hexStringSchema
|
|
457
|
+
});
|
|
458
|
+
const scheduleSchema = zod.z.object({
|
|
459
|
+
startAt: _otim_utils_schemas.numberSchema,
|
|
460
|
+
startBy: _otim_utils_schemas.numberSchema,
|
|
461
|
+
interval: _otim_utils_schemas.numberSchema,
|
|
462
|
+
timeout: _otim_utils_schemas.numberSchema
|
|
463
|
+
});
|
|
464
|
+
const baseActionArgumentsSchema = zod.z.object({
|
|
465
|
+
target: _otim_utils_schemas.hexStringSchema,
|
|
466
|
+
fee: feeSchema,
|
|
467
|
+
token: _otim_utils_schemas.hexStringSchema
|
|
468
|
+
});
|
|
469
|
+
const refuelActionArgumentsSchema = baseActionArgumentsSchema.extend({
|
|
470
|
+
threshold: _otim_utils_schemas.numberSchema,
|
|
471
|
+
endBalance: _otim_utils_schemas.numberSchema,
|
|
472
|
+
gasLimit: _otim_utils_schemas.numberSchema
|
|
473
|
+
});
|
|
474
|
+
const refuelERC20ActionArgumentsSchema = baseActionArgumentsSchema.extend({
|
|
475
|
+
threshold: _otim_utils_schemas.numberSchema,
|
|
476
|
+
endBalance: _otim_utils_schemas.numberSchema,
|
|
477
|
+
gasLimit: _otim_utils_schemas.numberSchema
|
|
478
|
+
});
|
|
479
|
+
const transferActionArgumentsSchema = baseActionArgumentsSchema.extend({
|
|
480
|
+
value: _otim_utils_schemas.numberSchema,
|
|
481
|
+
gasLimit: _otim_utils_schemas.numberSchema,
|
|
482
|
+
schedule: scheduleSchema
|
|
483
|
+
});
|
|
484
|
+
const transferERC20ActionArgumentsSchema = baseActionArgumentsSchema.extend({
|
|
485
|
+
value: _otim_utils_schemas.numberSchema,
|
|
486
|
+
gasLimit: _otim_utils_schemas.numberSchema,
|
|
487
|
+
schedule: scheduleSchema
|
|
488
|
+
});
|
|
489
|
+
const uniswapV3ExactInputActionArgumentsSchema = zod.z.object({
|
|
490
|
+
tokenIn: _otim_utils_schemas.hexStringSchema,
|
|
491
|
+
tokenOut: _otim_utils_schemas.hexStringSchema,
|
|
492
|
+
amountIn: _otim_utils_schemas.numberSchema,
|
|
493
|
+
floorAmountOut: _otim_utils_schemas.numberSchema,
|
|
494
|
+
feeTier: zod.z.string(),
|
|
495
|
+
recipient: _otim_utils_schemas.hexStringSchema,
|
|
496
|
+
meanPriceLookBack: _otim_utils_schemas.numberSchema,
|
|
497
|
+
maxPriceDeviationBps: _otim_utils_schemas.numberSchema,
|
|
498
|
+
fee: feeSchema,
|
|
499
|
+
schedule: scheduleSchema
|
|
500
|
+
});
|
|
501
|
+
const deactivateInstructionActionArgumentsSchema = zod.z.object({
|
|
502
|
+
instructionId: _otim_utils_schemas.hexStringSchema,
|
|
503
|
+
fee: feeSchema
|
|
504
|
+
});
|
|
505
|
+
const depositERC4626ActionArgumentsSchema = zod.z.object({
|
|
506
|
+
vault: _otim_utils_schemas.hexStringSchema,
|
|
507
|
+
recipient: _otim_utils_schemas.hexStringSchema,
|
|
508
|
+
value: _otim_utils_schemas.numberSchema,
|
|
509
|
+
minDeposit: _otim_utils_schemas.numberSchema,
|
|
510
|
+
minTotalShares: _otim_utils_schemas.numberSchema,
|
|
511
|
+
schedule: scheduleSchema,
|
|
512
|
+
fee: feeSchema
|
|
513
|
+
});
|
|
514
|
+
const sweepDepositERC4626ActionArgumentsSchema = zod.z.object({
|
|
515
|
+
vault: _otim_utils_schemas.hexStringSchema,
|
|
516
|
+
recipient: _otim_utils_schemas.hexStringSchema,
|
|
517
|
+
threshold: _otim_utils_schemas.numberSchema,
|
|
518
|
+
endBalance: _otim_utils_schemas.numberSchema,
|
|
519
|
+
minDeposit: _otim_utils_schemas.numberSchema,
|
|
520
|
+
minTotalShares: _otim_utils_schemas.numberSchema,
|
|
521
|
+
fee: feeSchema
|
|
522
|
+
});
|
|
523
|
+
const withdrawERC4626ActionArgumentsSchema = zod.z.object({
|
|
524
|
+
vault: _otim_utils_schemas.hexStringSchema,
|
|
525
|
+
recipient: _otim_utils_schemas.hexStringSchema,
|
|
526
|
+
value: _otim_utils_schemas.numberSchema,
|
|
527
|
+
minWithdraw: _otim_utils_schemas.numberSchema,
|
|
528
|
+
schedule: scheduleSchema,
|
|
529
|
+
fee: feeSchema
|
|
530
|
+
});
|
|
531
|
+
const sweepWithdrawERC4626ActionArgumentsSchema = zod.z.object({
|
|
532
|
+
vault: _otim_utils_schemas.hexStringSchema,
|
|
533
|
+
recipient: _otim_utils_schemas.hexStringSchema,
|
|
534
|
+
threshold: _otim_utils_schemas.numberSchema,
|
|
535
|
+
endBalance: _otim_utils_schemas.numberSchema,
|
|
536
|
+
minWithdraw: _otim_utils_schemas.numberSchema,
|
|
537
|
+
fee: feeSchema
|
|
538
|
+
});
|
|
539
|
+
const actionArgumentsSchema = zod.z.union([
|
|
540
|
+
refuelActionArgumentsSchema,
|
|
541
|
+
refuelERC20ActionArgumentsSchema,
|
|
542
|
+
transferActionArgumentsSchema,
|
|
543
|
+
transferERC20ActionArgumentsSchema,
|
|
544
|
+
uniswapV3ExactInputActionArgumentsSchema,
|
|
545
|
+
deactivateInstructionActionArgumentsSchema,
|
|
546
|
+
depositERC4626ActionArgumentsSchema,
|
|
547
|
+
sweepDepositERC4626ActionArgumentsSchema,
|
|
548
|
+
withdrawERC4626ActionArgumentsSchema,
|
|
549
|
+
sweepWithdrawERC4626ActionArgumentsSchema
|
|
919
550
|
]);
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
});
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
});
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
});
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
});
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
});
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
});
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
551
|
+
const feeResponseSchema$1 = zod.z.object({
|
|
552
|
+
token: _otim_utils_schemas.hexStringSchema,
|
|
553
|
+
executionFee: _otim_utils_schemas.hexStringSchema,
|
|
554
|
+
maxBaseFeePerGas: _otim_utils_schemas.hexStringSchema,
|
|
555
|
+
maxPriorityFeePerGas: _otim_utils_schemas.hexStringSchema
|
|
556
|
+
});
|
|
557
|
+
const scheduleResponseSchema = zod.z.object({
|
|
558
|
+
startAt: _otim_utils_schemas.hexStringSchema,
|
|
559
|
+
startBy: _otim_utils_schemas.hexStringSchema,
|
|
560
|
+
interval: _otim_utils_schemas.hexStringSchema,
|
|
561
|
+
timeout: _otim_utils_schemas.hexStringSchema
|
|
562
|
+
});
|
|
563
|
+
const refuelActionResponseSchema = zod.z.object({
|
|
564
|
+
target: _otim_utils_schemas.hexStringSchema,
|
|
565
|
+
threshold: _otim_utils_schemas.hexStringSchema,
|
|
566
|
+
endBalance: _otim_utils_schemas.hexStringSchema,
|
|
567
|
+
gasLimit: _otim_utils_schemas.hexStringSchema,
|
|
568
|
+
fee: feeResponseSchema$1
|
|
569
|
+
});
|
|
570
|
+
const transferActionResponseSchema = zod.z.object({
|
|
571
|
+
target: _otim_utils_schemas.hexStringSchema,
|
|
572
|
+
value: _otim_utils_schemas.hexStringSchema,
|
|
573
|
+
gasLimit: _otim_utils_schemas.hexStringSchema,
|
|
574
|
+
schedule: scheduleResponseSchema,
|
|
575
|
+
fee: feeResponseSchema$1
|
|
576
|
+
});
|
|
577
|
+
const refuelERC20ActionResponseSchema = zod.z.object({
|
|
578
|
+
token: _otim_utils_schemas.hexStringSchema,
|
|
579
|
+
target: _otim_utils_schemas.hexStringSchema,
|
|
580
|
+
threshold: _otim_utils_schemas.hexStringSchema,
|
|
581
|
+
endBalance: _otim_utils_schemas.hexStringSchema,
|
|
582
|
+
fee: feeResponseSchema$1
|
|
583
|
+
});
|
|
584
|
+
const transferERC20ActionResponseSchema = zod.z.object({
|
|
585
|
+
token: _otim_utils_schemas.hexStringSchema,
|
|
586
|
+
target: _otim_utils_schemas.hexStringSchema,
|
|
587
|
+
value: _otim_utils_schemas.hexStringSchema,
|
|
588
|
+
schedule: scheduleResponseSchema,
|
|
589
|
+
fee: feeResponseSchema$1
|
|
590
|
+
});
|
|
591
|
+
const actionArgumentsResponseSchema = zod.z.union([
|
|
592
|
+
refuelActionResponseSchema,
|
|
593
|
+
transferActionResponseSchema,
|
|
594
|
+
refuelERC20ActionResponseSchema,
|
|
595
|
+
transferERC20ActionResponseSchema
|
|
965
596
|
]);
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
});
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
});
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
nickname: import_zod13.z.string().nullish(),
|
|
1031
|
-
lastErrorCode: import_zod13.z.number().int(),
|
|
1032
|
-
lastErrorMessage: import_zod13.z.string().nullish()
|
|
1033
|
-
});
|
|
1034
|
-
var instructionGetRulesRequestSchema = import_zod13.z.object({
|
|
1035
|
-
chainId: import_zod13.z.number(),
|
|
1036
|
-
page: import_zod13.z.number().optional(),
|
|
1037
|
-
perPage: import_zod13.z.number().optional()
|
|
1038
|
-
});
|
|
1039
|
-
var instructionGetRulesResponseSchema = import_zod13.z.array(
|
|
1040
|
-
instructionSchema
|
|
1041
|
-
);
|
|
597
|
+
const instructionBuildSchema = zod.z.object({
|
|
598
|
+
action: _otim_utils_schemas.hexStringSchema,
|
|
599
|
+
arguments: _otim_utils_schemas.hexStringSchema,
|
|
600
|
+
maxExecutions: _otim_utils_schemas.hexStringSchema,
|
|
601
|
+
salt: _otim_utils_schemas.hexStringSchema,
|
|
602
|
+
nickname: zod.z.string().nullish()
|
|
603
|
+
});
|
|
604
|
+
const instructionGetAllRequestSchema = zod.z.object({
|
|
605
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
606
|
+
chainId: zod.z.number(),
|
|
607
|
+
actionName: zod.z.string().optional(),
|
|
608
|
+
page: zod.z.number().optional(),
|
|
609
|
+
perPage: zod.z.number().optional()
|
|
610
|
+
});
|
|
611
|
+
const instructionGetAllResponseSchema = zod.z.array(_otim_utils_schemas.instructionSchema);
|
|
612
|
+
const instructionBuildRequestSchema = zod.z.object({
|
|
613
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
614
|
+
chainId: zod.z.number(),
|
|
615
|
+
salt: zod.z.number(),
|
|
616
|
+
maxExecutions: zod.z.number(),
|
|
617
|
+
actionArguments: zod.z.record(zod.z.string(), actionArgumentsSchema).refine((args) => {
|
|
618
|
+
const keys = Object.keys(args);
|
|
619
|
+
return keys.length === 1 && _otim_utils_schemas.instructionActionValues.includes(keys[0]);
|
|
620
|
+
}, { message: "actionArguments must contain exactly one valid instruction action" })
|
|
621
|
+
});
|
|
622
|
+
const instructionActivateRequestSchema = zod.z.object({
|
|
623
|
+
nickname: zod.z.string().optional(),
|
|
624
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
625
|
+
chainId: zod.z.number(),
|
|
626
|
+
salt: _otim_utils_schemas.hexStringSchema,
|
|
627
|
+
maxExecutions: _otim_utils_schemas.hexStringSchema,
|
|
628
|
+
action: _otim_utils_schemas.hexStringSchema,
|
|
629
|
+
arguments: _otim_utils_schemas.hexStringSchema,
|
|
630
|
+
activationSignature: _otim_utils_schemas.eip2098SignatureSchema
|
|
631
|
+
});
|
|
632
|
+
const instructionActivateResponseSchema = zod.z.object({ instructionId: _otim_utils_schemas.hexStringSchema });
|
|
633
|
+
const instructionDeactivateRequestSchema = zod.z.object({
|
|
634
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
635
|
+
chainId: zod.z.number(),
|
|
636
|
+
deactivation: zod.z.object({ instructionId: _otim_utils_schemas.hexStringSchema }),
|
|
637
|
+
deactivationSignature: _otim_utils_schemas.eip2098SignatureSchema
|
|
638
|
+
});
|
|
639
|
+
const instructionDeactivateResponseSchema = zod.z.unknown();
|
|
640
|
+
const instructionDetailsRequestSchema = zod.z.object({
|
|
641
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
642
|
+
instructionId: _otim_utils_schemas.hexStringSchema,
|
|
643
|
+
chainId: zod.z.number()
|
|
644
|
+
});
|
|
645
|
+
const instructionDetailsResponseSchema = zod.z.object({
|
|
646
|
+
action: _otim_utils_schemas.hexStringSchema,
|
|
647
|
+
actionArguments: zod.z.any(),
|
|
648
|
+
actionName: zod.z.string().nullish(),
|
|
649
|
+
salt: _otim_utils_schemas.hexStringSchema,
|
|
650
|
+
maxExecutions: _otim_utils_schemas.hexStringSchema,
|
|
651
|
+
nickname: zod.z.string().nullish(),
|
|
652
|
+
lastErrorCode: zod.z.number().int(),
|
|
653
|
+
lastErrorMessage: zod.z.string().nullish()
|
|
654
|
+
});
|
|
655
|
+
const instructionGetRulesRequestSchema = zod.z.object({
|
|
656
|
+
chainId: zod.z.number(),
|
|
657
|
+
page: zod.z.number().optional(),
|
|
658
|
+
perPage: zod.z.number().optional()
|
|
659
|
+
});
|
|
660
|
+
const instructionGetRulesResponseSchema = zod.z.array(_otim_utils_schemas.instructionSchema);
|
|
1042
661
|
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
662
|
+
//#endregion
|
|
663
|
+
//#region src/api/schemas/integration.ts
|
|
664
|
+
const IntegrationType = {
|
|
665
|
+
Bank: "Bank",
|
|
666
|
+
Clio: "Clio",
|
|
667
|
+
Stripe: "Stripe",
|
|
668
|
+
QuickBooks: "QuickBooks",
|
|
669
|
+
Bill: "Bill",
|
|
670
|
+
Zoho: "Zoho"
|
|
1052
671
|
};
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
672
|
+
const integrationTypeValues = [
|
|
673
|
+
IntegrationType.Bank,
|
|
674
|
+
IntegrationType.Clio,
|
|
675
|
+
IntegrationType.Stripe,
|
|
676
|
+
IntegrationType.QuickBooks,
|
|
677
|
+
IntegrationType.Bill,
|
|
678
|
+
IntegrationType.Zoho
|
|
1060
679
|
];
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
});
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
});
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
});
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
});
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
});
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
});
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
});
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
});
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
});
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
})
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
details: billcomDetailsSchema
|
|
1172
|
-
}),
|
|
1173
|
-
import_zod14.z.object({
|
|
1174
|
-
integrationType: import_zod14.z.literal(IntegrationType.Zoho),
|
|
1175
|
-
details: import_zod14.z.unknown()
|
|
1176
|
-
})
|
|
1177
|
-
]
|
|
1178
|
-
);
|
|
680
|
+
const quickBooksDetailsSchema = zod.z.object({
|
|
681
|
+
accessToken: zod.z.string().optional(),
|
|
682
|
+
refreshToken: zod.z.string().optional(),
|
|
683
|
+
realmId: zod.z.string().optional(),
|
|
684
|
+
tokenType: zod.z.string().optional(),
|
|
685
|
+
expiresIn: zod.z.number().optional(),
|
|
686
|
+
xRefreshTokenExpiresIn: zod.z.number().optional()
|
|
687
|
+
});
|
|
688
|
+
const stripeTokensSchema = zod.z.object({
|
|
689
|
+
accessToken: zod.z.string(),
|
|
690
|
+
refreshToken: zod.z.string().optional()
|
|
691
|
+
});
|
|
692
|
+
const stripeDetailsSchema = zod.z.object({
|
|
693
|
+
clientId: zod.z.string().optional(),
|
|
694
|
+
clientSecret: zod.z.string().optional(),
|
|
695
|
+
tokens: stripeTokensSchema.optional()
|
|
696
|
+
});
|
|
697
|
+
const billcomDetailsSchema = zod.z.object({
|
|
698
|
+
devKey: zod.z.string().optional(),
|
|
699
|
+
sessionId: zod.z.string().optional(),
|
|
700
|
+
orgId: zod.z.string().optional(),
|
|
701
|
+
rememberMeId: zod.z.string().optional()
|
|
702
|
+
});
|
|
703
|
+
const liquidationAddressSchema = zod.z.object({
|
|
704
|
+
liquidationAddressId: zod.z.string(),
|
|
705
|
+
address: zod.z.string(),
|
|
706
|
+
chain: zod.z.string(),
|
|
707
|
+
currency: zod.z.string(),
|
|
708
|
+
blockchainMemo: zod.z.string().optional()
|
|
709
|
+
});
|
|
710
|
+
const plaidAccountSchema = zod.z.object({
|
|
711
|
+
accountId: zod.z.string(),
|
|
712
|
+
name: zod.z.string().optional(),
|
|
713
|
+
mask: zod.z.string().optional(),
|
|
714
|
+
subtype: zod.z.string().optional(),
|
|
715
|
+
externalAccountId: zod.z.string().optional(),
|
|
716
|
+
liquidationAddress: liquidationAddressSchema.optional()
|
|
717
|
+
});
|
|
718
|
+
const plaidConnectionSchema = zod.z.object({
|
|
719
|
+
accessToken: zod.z.string(),
|
|
720
|
+
itemId: zod.z.string(),
|
|
721
|
+
institutionId: zod.z.string().optional(),
|
|
722
|
+
institutionName: zod.z.string().optional(),
|
|
723
|
+
accounts: zod.z.array(plaidAccountSchema)
|
|
724
|
+
});
|
|
725
|
+
const bridgeConnectionSchema = zod.z.object({
|
|
726
|
+
customerId: zod.z.string(),
|
|
727
|
+
kycLinkId: zod.z.string().optional(),
|
|
728
|
+
kycLink: zod.z.string().optional(),
|
|
729
|
+
tosLink: zod.z.string().optional(),
|
|
730
|
+
completedSteps: zod.z.array(zod.z.string()).optional()
|
|
731
|
+
});
|
|
732
|
+
const bankDetailsSchema = zod.z.object({
|
|
733
|
+
plaid: zod.z.array(plaidConnectionSchema).optional(),
|
|
734
|
+
bridge: zod.z.array(bridgeConnectionSchema).optional()
|
|
735
|
+
});
|
|
736
|
+
const integrationTypeSchema = zod.z.enum(integrationTypeValues);
|
|
737
|
+
const updateIntegrationRequestSchema = zod.z.discriminatedUnion("integrationType", [
|
|
738
|
+
zod.z.object({
|
|
739
|
+
integrationType: zod.z.literal(IntegrationType.QuickBooks),
|
|
740
|
+
details: quickBooksDetailsSchema
|
|
741
|
+
}),
|
|
742
|
+
zod.z.object({
|
|
743
|
+
integrationType: zod.z.literal(IntegrationType.Bank),
|
|
744
|
+
details: bankDetailsSchema
|
|
745
|
+
}),
|
|
746
|
+
zod.z.object({
|
|
747
|
+
integrationType: zod.z.literal(IntegrationType.Clio),
|
|
748
|
+
details: zod.z.unknown()
|
|
749
|
+
}),
|
|
750
|
+
zod.z.object({
|
|
751
|
+
integrationType: zod.z.literal(IntegrationType.Stripe),
|
|
752
|
+
details: stripeDetailsSchema
|
|
753
|
+
}),
|
|
754
|
+
zod.z.object({
|
|
755
|
+
integrationType: zod.z.literal(IntegrationType.Bill),
|
|
756
|
+
details: billcomDetailsSchema
|
|
757
|
+
}),
|
|
758
|
+
zod.z.object({
|
|
759
|
+
integrationType: zod.z.literal(IntegrationType.Zoho),
|
|
760
|
+
details: zod.z.unknown()
|
|
761
|
+
})
|
|
762
|
+
]);
|
|
763
|
+
const getIntegrationRequestSchema = zod.z.object({ integrationType: integrationTypeSchema });
|
|
764
|
+
const integrationResponseSchema = zod.z.discriminatedUnion("integrationType", [
|
|
765
|
+
zod.z.object({
|
|
766
|
+
integrationType: zod.z.literal(IntegrationType.QuickBooks),
|
|
767
|
+
details: quickBooksDetailsSchema
|
|
768
|
+
}),
|
|
769
|
+
zod.z.object({
|
|
770
|
+
integrationType: zod.z.literal(IntegrationType.Bank),
|
|
771
|
+
details: bankDetailsSchema
|
|
772
|
+
}),
|
|
773
|
+
zod.z.object({
|
|
774
|
+
integrationType: zod.z.literal(IntegrationType.Clio),
|
|
775
|
+
details: zod.z.unknown()
|
|
776
|
+
}),
|
|
777
|
+
zod.z.object({
|
|
778
|
+
integrationType: zod.z.literal(IntegrationType.Stripe),
|
|
779
|
+
details: stripeDetailsSchema
|
|
780
|
+
}),
|
|
781
|
+
zod.z.object({
|
|
782
|
+
integrationType: zod.z.literal(IntegrationType.Bill),
|
|
783
|
+
details: billcomDetailsSchema
|
|
784
|
+
}),
|
|
785
|
+
zod.z.object({
|
|
786
|
+
integrationType: zod.z.literal(IntegrationType.Zoho),
|
|
787
|
+
details: zod.z.unknown()
|
|
788
|
+
})
|
|
789
|
+
]);
|
|
1179
790
|
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
});
|
|
1186
|
-
var getOperatingAccountSubOrgResponseSchema = import_zod15.z.object({
|
|
1187
|
-
subOrganizationId: import_zod15.z.string()
|
|
791
|
+
//#endregion
|
|
792
|
+
//#region src/api/schemas/operating-account.ts
|
|
793
|
+
const newOperatingAccountSubOrgResponseSchema = zod.z.object({
|
|
794
|
+
subOrganizationId: zod.z.string(),
|
|
795
|
+
endUserId: zod.z.string()
|
|
1188
796
|
});
|
|
797
|
+
const getOperatingAccountSubOrgResponseSchema = zod.z.object({ subOrganizationId: zod.z.string() });
|
|
1189
798
|
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
799
|
+
//#endregion
|
|
800
|
+
//#region src/api/schemas/payments.ts
|
|
801
|
+
const paymentRequestsDirectionSchema = zod.z.enum(["from", "to"]);
|
|
802
|
+
const orchestrationTypeSchema = zod.z.enum(["AutoEarn", "PaymentRequest"]);
|
|
803
|
+
const getPaymentRequestsRequestSchema = zod.z.object({
|
|
804
|
+
direction: paymentRequestsDirectionSchema,
|
|
805
|
+
statuses: zod.z.array(zod.z.enum([
|
|
806
|
+
"pending",
|
|
807
|
+
"inProgress",
|
|
808
|
+
"paid",
|
|
809
|
+
"cancelled",
|
|
810
|
+
"draft"
|
|
811
|
+
])).optional(),
|
|
812
|
+
perPage: _otim_utils_schemas.numberSchema.optional(),
|
|
813
|
+
page: _otim_utils_schemas.numberSchema.optional(),
|
|
814
|
+
orchestrationType: orchestrationTypeSchema.optional()
|
|
815
|
+
});
|
|
816
|
+
const paymentRequestStatusSchema = zod.z.enum([
|
|
817
|
+
"pending",
|
|
818
|
+
"inProgress",
|
|
819
|
+
"paid",
|
|
820
|
+
"cancelled",
|
|
821
|
+
"draft"
|
|
1205
822
|
]);
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
});
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
});
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
});
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
});
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
823
|
+
const paymentRequestSchema = zod.z.object({
|
|
824
|
+
id: zod.z.string(),
|
|
825
|
+
fromUserId: zod.z.string(),
|
|
826
|
+
toUserId: zod.z.string().nullable(),
|
|
827
|
+
payerAddress: _otim_utils_schemas.hexStringSchema.nullable(),
|
|
828
|
+
ephemeralWalletAddress: _otim_utils_schemas.hexStringSchema,
|
|
829
|
+
instructions: zod.z.object({
|
|
830
|
+
ids: zod.z.array(zod.z.string()),
|
|
831
|
+
completionIds: zod.z.array(zod.z.string())
|
|
832
|
+
}),
|
|
833
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
834
|
+
status: paymentRequestStatusSchema,
|
|
835
|
+
createdAt: zod.z.string(),
|
|
836
|
+
updatedAt: zod.z.string()
|
|
837
|
+
});
|
|
838
|
+
const getPaymentRequestsResponseSchema = zod.z.array(paymentRequestSchema);
|
|
839
|
+
const buildEphemeralInstructionSchema = zod.z.object({
|
|
840
|
+
chainId: zod.z.number(),
|
|
841
|
+
salt: _otim_utils_schemas.numberSchema,
|
|
842
|
+
maxExecutions: _otim_utils_schemas.numberSchema,
|
|
843
|
+
actionArguments: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
844
|
+
setEphemeralTarget: zod.z.boolean().optional()
|
|
845
|
+
});
|
|
846
|
+
const paymentRequestBuildRequestSchema = zod.z.object({
|
|
847
|
+
payerAddress: _otim_utils_schemas.hexStringSchema.nullish(),
|
|
848
|
+
completionInstructions: zod.z.array(buildEphemeralInstructionSchema),
|
|
849
|
+
instructions: zod.z.array(buildEphemeralInstructionSchema),
|
|
850
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).optional().default({}),
|
|
851
|
+
maxRuns: zod.z.number().int().positive({ message: "maxRuns must be greater than 0" }).max(Number.MAX_SAFE_INTEGER, { message: "maxRuns must be less than MAX_SAFE_INTEGER" }).optional()
|
|
852
|
+
});
|
|
853
|
+
const feeResponseSchema = zod.z.object({
|
|
854
|
+
token: _otim_utils_schemas.hexStringSchema,
|
|
855
|
+
executionFee: _otim_utils_schemas.hexStringSchema,
|
|
856
|
+
maxBaseFeePerGas: _otim_utils_schemas.hexStringSchema,
|
|
857
|
+
maxPriorityFeePerGas: _otim_utils_schemas.hexStringSchema
|
|
858
|
+
});
|
|
859
|
+
const buildInstructionResponseSchema = zod.z.object({
|
|
860
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
861
|
+
chainId: zod.z.number(),
|
|
862
|
+
salt: _otim_utils_schemas.hexStringSchema,
|
|
863
|
+
maxExecutions: _otim_utils_schemas.hexStringSchema,
|
|
864
|
+
action: _otim_utils_schemas.hexStringSchema,
|
|
865
|
+
actionName: zod.z.string().optional(),
|
|
866
|
+
arguments: _otim_utils_schemas.hexStringSchema
|
|
867
|
+
});
|
|
868
|
+
const paymentRequestBuildResponseSchema = zod.z.object({
|
|
869
|
+
requestId: zod.z.string(),
|
|
870
|
+
subOrgId: zod.z.string(),
|
|
871
|
+
walletId: zod.z.string(),
|
|
872
|
+
ephemeralWalletAddress: _otim_utils_schemas.hexStringSchema,
|
|
873
|
+
completionInstructions: zod.z.array(buildInstructionResponseSchema),
|
|
874
|
+
instructions: zod.z.array(buildInstructionResponseSchema)
|
|
875
|
+
});
|
|
876
|
+
const newInstructionRequestSchema = zod.z.object({
|
|
877
|
+
nickname: zod.z.string().optional(),
|
|
878
|
+
actionName: zod.z.string().optional(),
|
|
879
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
880
|
+
chainId: zod.z.number(),
|
|
881
|
+
salt: _otim_utils_schemas.hexStringSchema,
|
|
882
|
+
maxExecutions: _otim_utils_schemas.hexStringSchema,
|
|
883
|
+
action: _otim_utils_schemas.hexStringSchema,
|
|
884
|
+
arguments: _otim_utils_schemas.hexStringSchema,
|
|
885
|
+
activationSignature: _otim_utils_schemas.eip2098SignatureSchema
|
|
886
|
+
});
|
|
887
|
+
const paymentRequestNewRequestSchema = zod.z.object({
|
|
888
|
+
requestId: zod.z.string(),
|
|
889
|
+
signedAuthorization: zod.z.string(),
|
|
890
|
+
completionInstructions: zod.z.array(newInstructionRequestSchema),
|
|
891
|
+
instructions: zod.z.array(newInstructionRequestSchema)
|
|
892
|
+
});
|
|
893
|
+
const paymentRequestDetailsRequestSchema = zod.z.object({ requestId: zod.z.string() });
|
|
894
|
+
const paymentRequestDetailsResponseSchema = zod.z.object({
|
|
895
|
+
requestId: zod.z.string(),
|
|
896
|
+
ephemeralWalletAddress: _otim_utils_schemas.hexStringSchema,
|
|
897
|
+
ephemeralWalletId: zod.z.string().optional(),
|
|
898
|
+
status: zod.z.enum([
|
|
899
|
+
"pending",
|
|
900
|
+
"inProgress",
|
|
901
|
+
"paid",
|
|
902
|
+
"cancelled",
|
|
903
|
+
"draft"
|
|
904
|
+
]),
|
|
905
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
906
|
+
numRuns: zod.z.number(),
|
|
907
|
+
maxRuns: zod.z.number().optional()
|
|
908
|
+
});
|
|
909
|
+
const buildSettlementRequestSchema = zod.z.object({
|
|
910
|
+
acceptedTokens: zod.z.record(zod.z.string(), zod.z.array(_otim_utils_schemas.hexStringSchema)),
|
|
911
|
+
settlementChain: zod.z.number(),
|
|
912
|
+
settlementToken: _otim_utils_schemas.hexStringSchema,
|
|
913
|
+
settlementAmount: _otim_utils_schemas.numberSchema,
|
|
914
|
+
recipientAddress: _otim_utils_schemas.hexStringSchema,
|
|
915
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
916
|
+
payerAddress: _otim_utils_schemas.hexStringSchema.nullish(),
|
|
917
|
+
dueDate: zod.z.string().datetime().nullish(),
|
|
918
|
+
maxRuns: zod.z.number().int().positive().nullish()
|
|
919
|
+
});
|
|
920
|
+
const buildSettlementResponseSchema = zod.z.object({
|
|
921
|
+
requestId: zod.z.string(),
|
|
922
|
+
subOrgId: zod.z.string(),
|
|
923
|
+
walletId: zod.z.string(),
|
|
924
|
+
ephemeralWalletAddress: _otim_utils_schemas.hexStringSchema,
|
|
925
|
+
completionInstructions: zod.z.array(buildInstructionResponseSchema),
|
|
926
|
+
instructions: zod.z.array(buildInstructionResponseSchema)
|
|
1306
927
|
});
|
|
1307
928
|
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
});
|
|
1320
|
-
|
|
929
|
+
//#endregion
|
|
930
|
+
//#region src/api/schemas/transaction.ts
|
|
931
|
+
const transactionGetListRequestSchema = zod.z.object({
|
|
932
|
+
address: _otim_utils_schemas.hexStringSchema,
|
|
933
|
+
chainId: zod.z.number(),
|
|
934
|
+
instructionIds: zod.z.array(zod.z.string()).optional(),
|
|
935
|
+
from: zod.z.string().optional(),
|
|
936
|
+
to: zod.z.string().optional(),
|
|
937
|
+
page: zod.z.number().optional(),
|
|
938
|
+
perPage: zod.z.number().optional(),
|
|
939
|
+
sort: zod.z.enum(_otim_utils_schemas.sortValues).optional()
|
|
940
|
+
});
|
|
941
|
+
const transactionGetListResponseSchema = zod.z.array(_otim_utils_schemas.transactionSchema);
|
|
1321
942
|
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
}
|
|
1338
|
-
warn(message, options) {
|
|
1339
|
-
this.log("warn", message, options);
|
|
1340
|
-
}
|
|
1341
|
-
error(message, options) {
|
|
1342
|
-
this.log("error", message, options);
|
|
1343
|
-
}
|
|
1344
|
-
/**
|
|
1345
|
-
* Log errors with context - useful for non-API errors
|
|
1346
|
-
* For API errors, use the existing getErrorMessage from @otim/utils/api
|
|
1347
|
-
*/
|
|
1348
|
-
logError(error, options = {}) {
|
|
1349
|
-
const { context, operation, metadata } = options;
|
|
1350
|
-
const prefix = this.buildPrefix(context, operation);
|
|
1351
|
-
let message = "Unknown error";
|
|
1352
|
-
if (error instanceof Error) {
|
|
1353
|
-
message = error.message;
|
|
1354
|
-
} else if (typeof error === "string") {
|
|
1355
|
-
message = error;
|
|
1356
|
-
} else if (error && typeof error === "object" && "message" in error) {
|
|
1357
|
-
message = String(error.message);
|
|
1358
|
-
}
|
|
1359
|
-
console.error(prefix ? `${prefix} ${message}` : message);
|
|
1360
|
-
if (metadata && Object.keys(metadata).length > 0) {
|
|
1361
|
-
console.error("Context:", metadata);
|
|
1362
|
-
}
|
|
1363
|
-
if (error instanceof Error && error.stack) {
|
|
1364
|
-
console.error("Stack:", error.stack);
|
|
1365
|
-
} else {
|
|
1366
|
-
console.error("Error details:", error);
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
buildPrefix(context, operation) {
|
|
1370
|
-
const parts = [];
|
|
1371
|
-
if (context) parts.push(`[${context}]`);
|
|
1372
|
-
if (operation) parts.push(`[${operation}]`);
|
|
1373
|
-
return parts.join(" ");
|
|
1374
|
-
}
|
|
1375
|
-
log(level, message, options) {
|
|
1376
|
-
const prefix = options?.context ? `[${options.context}]` : "";
|
|
1377
|
-
const fullMessage = `${prefix} ${message}`.trim();
|
|
1378
|
-
switch (level) {
|
|
1379
|
-
case "debug":
|
|
1380
|
-
case "info":
|
|
1381
|
-
console.log(fullMessage);
|
|
1382
|
-
break;
|
|
1383
|
-
case "warn":
|
|
1384
|
-
console.warn(fullMessage);
|
|
1385
|
-
break;
|
|
1386
|
-
case "error":
|
|
1387
|
-
console.error(fullMessage);
|
|
1388
|
-
break;
|
|
1389
|
-
}
|
|
1390
|
-
if (options?.data) {
|
|
1391
|
-
console.dir(options.data, { depth: null });
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
};
|
|
1395
|
-
var logger = new Logger();
|
|
1396
|
-
|
|
1397
|
-
// src/helpers/zod.ts
|
|
1398
|
-
var import_zod18 = require("zod");
|
|
1399
|
-
var parseSchema = (values, schema) => {
|
|
1400
|
-
const inputValues = schema.safeParse(values);
|
|
1401
|
-
if (!inputValues.success) {
|
|
1402
|
-
throw new Error(
|
|
1403
|
-
`parseSchema: invalid input values ${JSON.stringify(inputValues.error)}`
|
|
1404
|
-
);
|
|
1405
|
-
}
|
|
1406
|
-
return inputValues.data;
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region src/api/utils/backoff.ts
|
|
945
|
+
const DEFAULT_INITIAL_INTERVAL = 5e3;
|
|
946
|
+
const DEFAULT_MAX_INTERVAL = 3e4;
|
|
947
|
+
const DEFAULT_MULTIPLIER = 1.5;
|
|
948
|
+
/**
|
|
949
|
+
* Calculates an exponential backoff interval based on the failure count.
|
|
950
|
+
*
|
|
951
|
+
* @param failureCount - Number of consecutive failures
|
|
952
|
+
* @param options - Configuration options for the backoff calculation
|
|
953
|
+
* @returns The calculated interval in milliseconds, capped at maxInterval
|
|
954
|
+
*/
|
|
955
|
+
const calculateBackoffInterval = (failureCount, options = {}) => {
|
|
956
|
+
const { initialInterval = DEFAULT_INITIAL_INTERVAL, maxInterval = DEFAULT_MAX_INTERVAL, multiplier = DEFAULT_MULTIPLIER } = options;
|
|
957
|
+
return Math.min(initialInterval * Math.pow(multiplier, failureCount), maxInterval);
|
|
1407
958
|
};
|
|
1408
959
|
|
|
1409
|
-
|
|
960
|
+
//#endregion
|
|
961
|
+
//#region src/api/utils/pagination.ts
|
|
962
|
+
/**
|
|
963
|
+
* Determine if additional pages are likely available based on the number of
|
|
964
|
+
* items received and the requested page size.
|
|
965
|
+
*
|
|
966
|
+
* Returns true when the current page contains at least `requestedPageSize`
|
|
967
|
+
* items, implying there may be more data to fetch.
|
|
968
|
+
*
|
|
969
|
+
* @param items Array of items returned for the current page.
|
|
970
|
+
* @param requestedPageSize The `perPage` value requested for this fetch.
|
|
971
|
+
* @returns Whether another page may be available.
|
|
972
|
+
*/
|
|
1410
973
|
function calculateHasMore(items, requestedPageSize) {
|
|
1411
|
-
|
|
974
|
+
return items.length >= requestedPageSize;
|
|
1412
975
|
}
|
|
976
|
+
/**
|
|
977
|
+
* Extract pagination-related fields from a request object and return them
|
|
978
|
+
* separately from the remaining parameters.
|
|
979
|
+
*
|
|
980
|
+
* @param request Request object containing `page`, `perPage`, and other fields.
|
|
981
|
+
* @returns Object with `paginationParams` and `restParams` split for
|
|
982
|
+
* convenience.
|
|
983
|
+
*/
|
|
1413
984
|
function extractPaginationParams(request) {
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
985
|
+
const { page, perPage, ...restParams } = request;
|
|
986
|
+
return {
|
|
987
|
+
paginationParams: {
|
|
988
|
+
page,
|
|
989
|
+
perPage
|
|
990
|
+
},
|
|
991
|
+
restParams
|
|
992
|
+
};
|
|
1419
993
|
}
|
|
994
|
+
/**
|
|
995
|
+
* Provide a standard default for pagination parameters.
|
|
996
|
+
*
|
|
997
|
+
* @returns Default pagination with `page: 0` and `perPage: 100`.
|
|
998
|
+
*/
|
|
1420
999
|
function getDefaultPagination() {
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1000
|
+
return {
|
|
1001
|
+
page: 0,
|
|
1002
|
+
perPage: 100
|
|
1003
|
+
};
|
|
1425
1004
|
}
|
|
1426
1005
|
|
|
1427
|
-
|
|
1006
|
+
//#endregion
|
|
1007
|
+
//#region src/api/services/base.ts
|
|
1428
1008
|
var BaseService = class {
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
const requestData = { ...restParams, page, perPage };
|
|
1480
|
-
const response = await this.makeRequest({
|
|
1481
|
-
url,
|
|
1482
|
-
method,
|
|
1483
|
-
data: requestData,
|
|
1484
|
-
schema,
|
|
1485
|
-
validateResponse,
|
|
1486
|
-
...config
|
|
1487
|
-
});
|
|
1488
|
-
const hasMore = Array.isArray(response.data) ? calculateHasMore(response.data, perPage) : false;
|
|
1489
|
-
return {
|
|
1490
|
-
data: response.data,
|
|
1491
|
-
hasMore
|
|
1492
|
-
};
|
|
1493
|
-
}
|
|
1009
|
+
constructor(instance) {
|
|
1010
|
+
this.instance = instance;
|
|
1011
|
+
}
|
|
1012
|
+
async makeRequest({ url, method = HttpMethod.Get, data, schema, validateResponse, ...config }) {
|
|
1013
|
+
try {
|
|
1014
|
+
const res = await this.instance.request({
|
|
1015
|
+
url,
|
|
1016
|
+
method,
|
|
1017
|
+
data,
|
|
1018
|
+
...config
|
|
1019
|
+
});
|
|
1020
|
+
if (validateResponse && !validateResponse(res.data)) throw new ServiceError("Invalid response format", "INVALID_RESPONSE");
|
|
1021
|
+
return { data: schema ? (0, _otim_utils_helpers.parseSchema)(res.data, schema) : res.data };
|
|
1022
|
+
} catch (error) {
|
|
1023
|
+
if (error instanceof ServiceError) throw error;
|
|
1024
|
+
let errorMessage = "Unknown error";
|
|
1025
|
+
let errorCode;
|
|
1026
|
+
if (error && typeof error === "object" && "response" in error) {
|
|
1027
|
+
const responseData = error.response?.data;
|
|
1028
|
+
errorMessage = responseData?.errorMessage || responseData?.message || errorMessage;
|
|
1029
|
+
errorCode = responseData?.errorCode;
|
|
1030
|
+
} else if (error instanceof Error) errorMessage = error.message;
|
|
1031
|
+
throw new ServiceError(errorMessage, errorCode || "REQUEST_FAILED");
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
async makePaginatedRequest({ url, method = HttpMethod.Get, data, schema, validateResponse, ...config }) {
|
|
1035
|
+
const { paginationParams, restParams } = extractPaginationParams(data || {});
|
|
1036
|
+
const { page, perPage } = {
|
|
1037
|
+
...getDefaultPagination(),
|
|
1038
|
+
...paginationParams
|
|
1039
|
+
};
|
|
1040
|
+
const requestData = {
|
|
1041
|
+
...restParams,
|
|
1042
|
+
page,
|
|
1043
|
+
perPage
|
|
1044
|
+
};
|
|
1045
|
+
const response = await this.makeRequest({
|
|
1046
|
+
url,
|
|
1047
|
+
method,
|
|
1048
|
+
data: requestData,
|
|
1049
|
+
schema,
|
|
1050
|
+
validateResponse,
|
|
1051
|
+
...config
|
|
1052
|
+
});
|
|
1053
|
+
const hasMore = Array.isArray(response.data) ? calculateHasMore(response.data, perPage) : false;
|
|
1054
|
+
return {
|
|
1055
|
+
data: response.data,
|
|
1056
|
+
hasMore
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1494
1059
|
};
|
|
1495
1060
|
|
|
1496
|
-
|
|
1061
|
+
//#endregion
|
|
1062
|
+
//#region src/api/services/account.ts
|
|
1497
1063
|
var AccountService = class extends BaseService {
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1064
|
+
async getDelegationStatus(requestBody) {
|
|
1065
|
+
return await this.makeRequest({
|
|
1066
|
+
url: "/delegation/status",
|
|
1067
|
+
method: HttpMethod.Get,
|
|
1068
|
+
data: requestBody,
|
|
1069
|
+
schema: delegationStatusResponseSchema
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
async createDelegation(requestBody) {
|
|
1073
|
+
await this.makeRequest({
|
|
1074
|
+
url: "/delegation/new",
|
|
1075
|
+
method: HttpMethod.Post,
|
|
1076
|
+
data: requestBody
|
|
1077
|
+
});
|
|
1078
|
+
return { data: {
|
|
1079
|
+
success: true,
|
|
1080
|
+
message: "Delegation created"
|
|
1081
|
+
} };
|
|
1082
|
+
}
|
|
1517
1083
|
};
|
|
1518
1084
|
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
validRecords.push(result.data);
|
|
1530
|
-
}
|
|
1531
|
-
});
|
|
1532
|
-
return validRecords;
|
|
1085
|
+
//#endregion
|
|
1086
|
+
//#region src/api/services/activity.ts
|
|
1087
|
+
const safeParseActivityArray = (data) => {
|
|
1088
|
+
if (!Array.isArray(data)) return [];
|
|
1089
|
+
const validRecords = [];
|
|
1090
|
+
data.forEach((record) => {
|
|
1091
|
+
const result = activityRecordSchema.safeParse(record);
|
|
1092
|
+
if (result.success) validRecords.push(result.data);
|
|
1093
|
+
});
|
|
1094
|
+
return validRecords;
|
|
1533
1095
|
};
|
|
1534
|
-
|
|
1096
|
+
const safeActivityArraySchema = zod.z.unknown().transform(safeParseActivityArray);
|
|
1535
1097
|
var ActivityService = class extends BaseService {
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1098
|
+
async getInstructionActivity(requestBody) {
|
|
1099
|
+
return this.makePaginatedRequest({
|
|
1100
|
+
url: "/instructions/activity",
|
|
1101
|
+
method: HttpMethod.Get,
|
|
1102
|
+
data: requestBody,
|
|
1103
|
+
schema: safeActivityArraySchema
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1544
1106
|
};
|
|
1545
1107
|
|
|
1546
|
-
|
|
1108
|
+
//#endregion
|
|
1109
|
+
//#region src/api/services/auth.ts
|
|
1547
1110
|
var AuthService = class extends BaseService {
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
method: HttpMethod.Put,
|
|
1587
|
-
data: { preferences }
|
|
1588
|
-
});
|
|
1589
|
-
return res;
|
|
1590
|
-
}
|
|
1111
|
+
async login(requestBody) {
|
|
1112
|
+
return await this.makeRequest({
|
|
1113
|
+
url: "/auth/login",
|
|
1114
|
+
method: HttpMethod.Post,
|
|
1115
|
+
data: requestBody,
|
|
1116
|
+
schema: authLoginResponseSchema
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
async turnkeyVerification(requestBody) {
|
|
1120
|
+
return await this.makeRequest({
|
|
1121
|
+
url: "/turnkey/verification",
|
|
1122
|
+
method: HttpMethod.Post,
|
|
1123
|
+
data: requestBody,
|
|
1124
|
+
schema: turnkeyVerificationResponseSchema
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
async turnkeyLogin(requestBody) {
|
|
1128
|
+
return await this.makeRequest({
|
|
1129
|
+
url: "/turnkey/login",
|
|
1130
|
+
method: HttpMethod.Post,
|
|
1131
|
+
data: requestBody,
|
|
1132
|
+
schema: turnkeyLoginResponseSchema
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
async me() {
|
|
1136
|
+
return await this.makeRequest({
|
|
1137
|
+
url: "/auth/me",
|
|
1138
|
+
method: HttpMethod.Get,
|
|
1139
|
+
schema: _otim_utils_schemas.userSchema
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
async updatePreferences(preferences) {
|
|
1143
|
+
return await this.makeRequest({
|
|
1144
|
+
url: "/user/preferences",
|
|
1145
|
+
method: HttpMethod.Put,
|
|
1146
|
+
data: { preferences }
|
|
1147
|
+
});
|
|
1148
|
+
}
|
|
1591
1149
|
};
|
|
1592
1150
|
|
|
1593
|
-
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region src/api/services/config.ts
|
|
1594
1153
|
var ConfigService = class extends BaseService {
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
url: `/instruction/estimate/max_priority_fee_per_gas/${requestBody.chainId}`,
|
|
1624
|
-
method: HttpMethod.Get,
|
|
1625
|
-
schema: getMaxPriorityFeePerGasEstimateResponseSchema
|
|
1626
|
-
});
|
|
1627
|
-
return res;
|
|
1628
|
-
}
|
|
1154
|
+
async getDelegateAddress(requestBody) {
|
|
1155
|
+
return await this.makeRequest({
|
|
1156
|
+
url: `/config/delegate/address/${requestBody.chainId}`,
|
|
1157
|
+
method: HttpMethod.Get,
|
|
1158
|
+
schema: getDelegateAddressResponseSchema
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
async getConfigTokens({ chainId }) {
|
|
1162
|
+
return await this.makeRequest({
|
|
1163
|
+
url: `/config/tokens/${chainId}`,
|
|
1164
|
+
method: HttpMethod.Get,
|
|
1165
|
+
schema: getConfigTokensResponseSchema
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
async getConfigChains() {
|
|
1169
|
+
return await this.makeRequest({
|
|
1170
|
+
url: `/config/chains`,
|
|
1171
|
+
method: HttpMethod.Get,
|
|
1172
|
+
schema: getConfigChainsResponseSchema
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
async getMaxPriorityFeePerGasEstimate(requestBody) {
|
|
1176
|
+
return await this.makeRequest({
|
|
1177
|
+
url: `/instruction/estimate/max_priority_fee_per_gas/${requestBody.chainId}`,
|
|
1178
|
+
method: HttpMethod.Get,
|
|
1179
|
+
schema: getMaxPriorityFeePerGasEstimateResponseSchema
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1629
1182
|
};
|
|
1630
1183
|
|
|
1631
|
-
|
|
1184
|
+
//#endregion
|
|
1185
|
+
//#region src/api/services/contacts.ts
|
|
1632
1186
|
var ContactsService = class extends BaseService {
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1187
|
+
async create(request) {
|
|
1188
|
+
const validated = newContactRequestSchema.parse(request);
|
|
1189
|
+
return this.makeRequest({
|
|
1190
|
+
url: "/contacts",
|
|
1191
|
+
method: HttpMethod.Put,
|
|
1192
|
+
data: validated
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
async list(request) {
|
|
1196
|
+
const validated = getContactsRequestSchema.parse(request);
|
|
1197
|
+
return this.makePaginatedRequest({
|
|
1198
|
+
url: "/contacts",
|
|
1199
|
+
method: HttpMethod.Get,
|
|
1200
|
+
data: validated,
|
|
1201
|
+
schema: getContactsResponseSchema
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1650
1204
|
};
|
|
1651
1205
|
|
|
1652
|
-
|
|
1206
|
+
//#endregion
|
|
1207
|
+
//#region src/api/services/developer.ts
|
|
1653
1208
|
var DeveloperService = class extends BaseService {
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1209
|
+
async updatePublicKey(developerPublicKey) {
|
|
1210
|
+
return this.makeRequest({
|
|
1211
|
+
url: "/developer/public_key",
|
|
1212
|
+
method: HttpMethod.Put,
|
|
1213
|
+
data: { developerPublicKey }
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
async generateApiKey() {
|
|
1217
|
+
return this.makeRequest({
|
|
1218
|
+
url: "/developer/api_key",
|
|
1219
|
+
method: HttpMethod.Post
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1667
1222
|
};
|
|
1668
1223
|
|
|
1669
|
-
|
|
1224
|
+
//#endregion
|
|
1225
|
+
//#region src/api/services/instruction.ts
|
|
1670
1226
|
var InstructionService = class extends BaseService {
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
data: requestBody,
|
|
1720
|
-
schema: instructionGetRulesResponseSchema
|
|
1721
|
-
});
|
|
1722
|
-
}
|
|
1227
|
+
async all(requestBody) {
|
|
1228
|
+
return this.makePaginatedRequest({
|
|
1229
|
+
url: "/instructions/all",
|
|
1230
|
+
method: HttpMethod.Get,
|
|
1231
|
+
data: requestBody,
|
|
1232
|
+
schema: _otim_utils_schemas.instructionsSchema
|
|
1233
|
+
});
|
|
1234
|
+
}
|
|
1235
|
+
async build(requestBody) {
|
|
1236
|
+
return await this.makeRequest({
|
|
1237
|
+
url: "/instruction/build",
|
|
1238
|
+
method: HttpMethod.Post,
|
|
1239
|
+
data: requestBody,
|
|
1240
|
+
schema: instructionBuildSchema
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
async activate(requestBody) {
|
|
1244
|
+
return await this.makeRequest({
|
|
1245
|
+
url: "/instruction/new",
|
|
1246
|
+
method: HttpMethod.Post,
|
|
1247
|
+
data: requestBody,
|
|
1248
|
+
schema: instructionActivateResponseSchema
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
async deactivate(requestBody) {
|
|
1252
|
+
return await this.makeRequest({
|
|
1253
|
+
url: "/instruction/deactivate",
|
|
1254
|
+
method: HttpMethod.Post,
|
|
1255
|
+
data: requestBody,
|
|
1256
|
+
schema: instructionDeactivateResponseSchema
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
async details(requestBody) {
|
|
1260
|
+
return await this.makeRequest({
|
|
1261
|
+
url: "/instruction/details",
|
|
1262
|
+
method: HttpMethod.Get,
|
|
1263
|
+
data: requestBody,
|
|
1264
|
+
schema: instructionDetailsResponseSchema
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
async rules(requestBody) {
|
|
1268
|
+
return this.makePaginatedRequest({
|
|
1269
|
+
url: "/instructions/rules",
|
|
1270
|
+
method: HttpMethod.Get,
|
|
1271
|
+
data: requestBody,
|
|
1272
|
+
schema: instructionGetRulesResponseSchema
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1723
1275
|
};
|
|
1724
1276
|
|
|
1725
|
-
|
|
1277
|
+
//#endregion
|
|
1278
|
+
//#region src/api/services/transaction.ts
|
|
1726
1279
|
var TransactionService = class extends BaseService {
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1280
|
+
async list(requestBody) {
|
|
1281
|
+
return this.makePaginatedRequest({
|
|
1282
|
+
url: "/transactions",
|
|
1283
|
+
method: HttpMethod.Get,
|
|
1284
|
+
data: requestBody,
|
|
1285
|
+
schema: transactionGetListResponseSchema
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1735
1288
|
};
|
|
1736
1289
|
|
|
1737
|
-
|
|
1290
|
+
//#endregion
|
|
1291
|
+
//#region src/api/services/payments.ts
|
|
1738
1292
|
var PaymentsService = class extends BaseService {
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1293
|
+
async getOutgoingPaymentsList(request) {
|
|
1294
|
+
return this.makePaginatedRequest({
|
|
1295
|
+
url: "/api/payments/outgoing",
|
|
1296
|
+
method: HttpMethod.Get,
|
|
1297
|
+
data: request,
|
|
1298
|
+
schema: _otim_utils_schemas.PaymentsSchema
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
async getIncomingPaymentsList(request) {
|
|
1302
|
+
return this.makePaginatedRequest({
|
|
1303
|
+
url: "/api/payments/incoming",
|
|
1304
|
+
method: HttpMethod.Get,
|
|
1305
|
+
data: request,
|
|
1306
|
+
schema: _otim_utils_schemas.PaymentsSchema
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
async buildPaymentRequest(requestBody) {
|
|
1310
|
+
return this.makeRequest({
|
|
1311
|
+
url: "/orchestration/build",
|
|
1312
|
+
method: HttpMethod.Post,
|
|
1313
|
+
data: requestBody,
|
|
1314
|
+
schema: paymentRequestBuildResponseSchema
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
async newPaymentRequest(requestBody) {
|
|
1318
|
+
return this.makeRequest({
|
|
1319
|
+
url: "/orchestration/new",
|
|
1320
|
+
method: HttpMethod.Post,
|
|
1321
|
+
data: requestBody,
|
|
1322
|
+
validateResponse: () => true
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
async getPaymentRequestDetails(requestBody) {
|
|
1326
|
+
return this.makeRequest({
|
|
1327
|
+
url: "/orchestration/details",
|
|
1328
|
+
method: HttpMethod.Get,
|
|
1329
|
+
data: requestBody,
|
|
1330
|
+
schema: paymentRequestDetailsResponseSchema
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
async getPaymentRequests(request) {
|
|
1334
|
+
return this.makePaginatedRequest({
|
|
1335
|
+
url: "/orchestrations",
|
|
1336
|
+
method: HttpMethod.Get,
|
|
1337
|
+
data: request,
|
|
1338
|
+
schema: getPaymentRequestsResponseSchema
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
async buildSettlementOrchestration(requestBody) {
|
|
1342
|
+
return this.makeRequest({
|
|
1343
|
+
url: "/orchestration/build/settlement",
|
|
1344
|
+
method: HttpMethod.Post,
|
|
1345
|
+
data: requestBody,
|
|
1346
|
+
schema: buildSettlementResponseSchema
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1795
1349
|
};
|
|
1796
1350
|
|
|
1797
|
-
|
|
1798
|
-
|
|
1351
|
+
//#endregion
|
|
1352
|
+
//#region src/api/services/integration.ts
|
|
1799
1353
|
function createEmptyIntegrationResponse(integrationType) {
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1354
|
+
switch (integrationType) {
|
|
1355
|
+
case IntegrationType.QuickBooks: return {
|
|
1356
|
+
integrationType: IntegrationType.QuickBooks,
|
|
1357
|
+
details: {}
|
|
1358
|
+
};
|
|
1359
|
+
case IntegrationType.Bank: return {
|
|
1360
|
+
integrationType: IntegrationType.Bank,
|
|
1361
|
+
details: {}
|
|
1362
|
+
};
|
|
1363
|
+
case IntegrationType.Clio: return {
|
|
1364
|
+
integrationType: IntegrationType.Clio,
|
|
1365
|
+
details: {}
|
|
1366
|
+
};
|
|
1367
|
+
case IntegrationType.Stripe: return {
|
|
1368
|
+
integrationType: IntegrationType.Stripe,
|
|
1369
|
+
details: {}
|
|
1370
|
+
};
|
|
1371
|
+
case IntegrationType.Bill: return {
|
|
1372
|
+
integrationType: IntegrationType.Bill,
|
|
1373
|
+
details: {}
|
|
1374
|
+
};
|
|
1375
|
+
case IntegrationType.Zoho: return {
|
|
1376
|
+
integrationType: IntegrationType.Zoho,
|
|
1377
|
+
details: {}
|
|
1378
|
+
};
|
|
1379
|
+
default: return {
|
|
1380
|
+
integrationType: IntegrationType.Bank,
|
|
1381
|
+
details: {}
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1816
1384
|
}
|
|
1817
1385
|
var IntegrationService = class extends BaseService {
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
request.integrationType
|
|
1840
|
-
);
|
|
1841
|
-
return { data: defaultResponse };
|
|
1842
|
-
}
|
|
1843
|
-
throw error;
|
|
1844
|
-
}
|
|
1845
|
-
}
|
|
1386
|
+
async upsert(request) {
|
|
1387
|
+
return this.makeRequest({
|
|
1388
|
+
url: "/integration",
|
|
1389
|
+
method: HttpMethod.Put,
|
|
1390
|
+
data: request,
|
|
1391
|
+
schema: integrationResponseSchema
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
async get(request) {
|
|
1395
|
+
try {
|
|
1396
|
+
return await this.makeRequest({
|
|
1397
|
+
url: "/integration/get",
|
|
1398
|
+
method: HttpMethod.Post,
|
|
1399
|
+
data: request,
|
|
1400
|
+
schema: integrationResponseSchema
|
|
1401
|
+
});
|
|
1402
|
+
} catch (error) {
|
|
1403
|
+
if (axios.default.isAxiosError(error) && error.response?.status === 404) return { data: createEmptyIntegrationResponse(request.integrationType) };
|
|
1404
|
+
throw error;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1846
1407
|
};
|
|
1847
1408
|
|
|
1848
|
-
|
|
1409
|
+
//#endregion
|
|
1410
|
+
//#region src/api/services/operating-account.ts
|
|
1849
1411
|
var OperatingAccountService = class extends BaseService {
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
return res;
|
|
1865
|
-
}
|
|
1866
|
-
};
|
|
1867
|
-
|
|
1868
|
-
// src/api/services/uniswap-token-list-service.ts
|
|
1869
|
-
var UniswapTokenListService = class extends BaseService {
|
|
1870
|
-
constructor() {
|
|
1871
|
-
super(...arguments);
|
|
1872
|
-
__publicField(this, "UNISWAP_TOKEN_LIST_URL", "https://ipfs.io/ipns/tokens.uniswap.org");
|
|
1873
|
-
__publicField(this, "FALLBACK_URL", "https://tokens.uniswap.org/");
|
|
1874
|
-
__publicField(this, "CACHE_DURATION", 30 * 60 * 1e3);
|
|
1875
|
-
// 30 minutes
|
|
1876
|
-
__publicField(this, "SUPPORTED_CHAIN_IDS", [1, 10, 42161, 8453]);
|
|
1877
|
-
// mainnet, optimism, arbitrum, base
|
|
1878
|
-
__publicField(this, "tokenListCache", null);
|
|
1879
|
-
__publicField(this, "lastFetch", 0);
|
|
1880
|
-
}
|
|
1881
|
-
/**
|
|
1882
|
-
* Get tokens for a specific chain
|
|
1883
|
-
*/
|
|
1884
|
-
async getTokensForChain({
|
|
1885
|
-
chainId,
|
|
1886
|
-
limit = 50
|
|
1887
|
-
}) {
|
|
1888
|
-
try {
|
|
1889
|
-
const tokenList = await this.fetchTokenList();
|
|
1890
|
-
if (!this.SUPPORTED_CHAIN_IDS.includes(chainId)) {
|
|
1891
|
-
return {
|
|
1892
|
-
data: {
|
|
1893
|
-
tokens: [],
|
|
1894
|
-
source: "uniswap",
|
|
1895
|
-
timestamp: tokenList.timestamp
|
|
1896
|
-
}
|
|
1897
|
-
};
|
|
1898
|
-
}
|
|
1899
|
-
const chainTokens = tokenList.tokens.filter(
|
|
1900
|
-
(token) => token.chainId === chainId
|
|
1901
|
-
);
|
|
1902
|
-
const filteredTokens = chainTokens.filter((token) => {
|
|
1903
|
-
const suspiciousPatterns = [
|
|
1904
|
-
/test/i,
|
|
1905
|
-
/fake/i,
|
|
1906
|
-
/scam/i,
|
|
1907
|
-
/shit/i,
|
|
1908
|
-
/moon/i,
|
|
1909
|
-
/doge/i,
|
|
1910
|
-
/inu/i,
|
|
1911
|
-
/baby/i,
|
|
1912
|
-
/mini/i,
|
|
1913
|
-
/micro/i,
|
|
1914
|
-
/nano/i,
|
|
1915
|
-
/pico/i,
|
|
1916
|
-
/mega/i,
|
|
1917
|
-
/ultra/i,
|
|
1918
|
-
/super/i,
|
|
1919
|
-
/hyper/i,
|
|
1920
|
-
/meta/i,
|
|
1921
|
-
/safe/i,
|
|
1922
|
-
/new/i,
|
|
1923
|
-
/old/i,
|
|
1924
|
-
/v2/i,
|
|
1925
|
-
/v3/i,
|
|
1926
|
-
/v4/i,
|
|
1927
|
-
/v5/i,
|
|
1928
|
-
/2\.0/i,
|
|
1929
|
-
/3\.0/i,
|
|
1930
|
-
/4\.0/i,
|
|
1931
|
-
/5\.0/i
|
|
1932
|
-
];
|
|
1933
|
-
const name = token.name?.toLowerCase() || "";
|
|
1934
|
-
const symbol = token.symbol?.toLowerCase() || "";
|
|
1935
|
-
if (suspiciousPatterns.some(
|
|
1936
|
-
(pattern) => pattern.test(name) || pattern.test(symbol)
|
|
1937
|
-
)) {
|
|
1938
|
-
return false;
|
|
1939
|
-
}
|
|
1940
|
-
if (name.length < 2 || name.length > 50) return false;
|
|
1941
|
-
if (symbol.length < 2 || symbol.length > 20) return false;
|
|
1942
|
-
if (!token.name || !token.symbol || !token.address) return false;
|
|
1943
|
-
return true;
|
|
1944
|
-
});
|
|
1945
|
-
const limitedTokens = filteredTokens.slice(0, limit);
|
|
1946
|
-
return {
|
|
1947
|
-
data: {
|
|
1948
|
-
tokens: limitedTokens,
|
|
1949
|
-
source: "uniswap",
|
|
1950
|
-
timestamp: tokenList.timestamp
|
|
1951
|
-
}
|
|
1952
|
-
};
|
|
1953
|
-
} catch (error) {
|
|
1954
|
-
throw new Error(error instanceof Error ? error.message : "Unknown error");
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
/**
|
|
1958
|
-
* Get all supported chains from the token list
|
|
1959
|
-
*/
|
|
1960
|
-
async getSupportedChains() {
|
|
1961
|
-
try {
|
|
1962
|
-
const tokenList = await this.fetchTokenList();
|
|
1963
|
-
const chainIds = Array.from(
|
|
1964
|
-
new Set(tokenList.tokens.map((token) => token.chainId))
|
|
1965
|
-
).sort((a, b) => a - b);
|
|
1966
|
-
return {
|
|
1967
|
-
data: chainIds
|
|
1968
|
-
};
|
|
1969
|
-
} catch (error) {
|
|
1970
|
-
throw new Error(error instanceof Error ? error.message : "Unknown error");
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
/**
|
|
1974
|
-
* Search for a specific token by address or symbol
|
|
1975
|
-
*/
|
|
1976
|
-
async findToken(chainId, query) {
|
|
1977
|
-
try {
|
|
1978
|
-
const tokenList = await this.fetchTokenList();
|
|
1979
|
-
const token = tokenList.tokens.find(
|
|
1980
|
-
(t) => t.chainId === chainId && (t.address.toLowerCase() === query.toLowerCase() || t.symbol.toLowerCase() === query.toLowerCase() || t.name.toLowerCase().includes(query.toLowerCase()))
|
|
1981
|
-
);
|
|
1982
|
-
return {
|
|
1983
|
-
data: token || null
|
|
1984
|
-
};
|
|
1985
|
-
} catch (error) {
|
|
1986
|
-
throw new Error(error instanceof Error ? error.message : "Unknown error");
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
/**
|
|
1990
|
-
* Get bridge information for a token
|
|
1991
|
-
*/
|
|
1992
|
-
async getBridgeInfo(chainId, tokenAddress) {
|
|
1993
|
-
try {
|
|
1994
|
-
const tokenList = await this.fetchTokenList();
|
|
1995
|
-
const token = tokenList.tokens.find(
|
|
1996
|
-
(t) => t.chainId === chainId && t.address.toLowerCase() === tokenAddress.toLowerCase()
|
|
1997
|
-
);
|
|
1998
|
-
if (!token || !token.extensions?.bridgeInfo) {
|
|
1999
|
-
return {
|
|
2000
|
-
data: {}
|
|
2001
|
-
};
|
|
2002
|
-
}
|
|
2003
|
-
const bridgeInfo = {};
|
|
2004
|
-
for (const [targetChainId, info] of Object.entries(
|
|
2005
|
-
token.extensions.bridgeInfo
|
|
2006
|
-
)) {
|
|
2007
|
-
bridgeInfo[targetChainId] = info.tokenAddress;
|
|
2008
|
-
}
|
|
2009
|
-
return {
|
|
2010
|
-
data: bridgeInfo
|
|
2011
|
-
};
|
|
2012
|
-
} catch (error) {
|
|
2013
|
-
throw new Error(error instanceof Error ? error.message : "Unknown error");
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
/**
|
|
2017
|
-
* Fetch the Uniswap token list
|
|
2018
|
-
*/
|
|
2019
|
-
async fetchTokenList() {
|
|
2020
|
-
const now = Date.now();
|
|
2021
|
-
if (this.tokenListCache && now - this.lastFetch < this.CACHE_DURATION) {
|
|
2022
|
-
return this.tokenListCache;
|
|
2023
|
-
}
|
|
2024
|
-
try {
|
|
2025
|
-
const response = await fetch(this.UNISWAP_TOKEN_LIST_URL, {
|
|
2026
|
-
headers: {
|
|
2027
|
-
Accept: "application/json"
|
|
2028
|
-
}
|
|
2029
|
-
});
|
|
2030
|
-
if (!response.ok) {
|
|
2031
|
-
throw new Error(`IPFS fetch failed: ${response.status}`);
|
|
2032
|
-
}
|
|
2033
|
-
const data = await response.json();
|
|
2034
|
-
this.tokenListCache = data;
|
|
2035
|
-
this.lastFetch = now;
|
|
2036
|
-
return data;
|
|
2037
|
-
} catch (error) {
|
|
2038
|
-
logger.logError(error, {
|
|
2039
|
-
context: this.fetchTokenList.name
|
|
2040
|
-
});
|
|
2041
|
-
try {
|
|
2042
|
-
const response = await fetch(this.FALLBACK_URL, {
|
|
2043
|
-
headers: {
|
|
2044
|
-
Accept: "application/json"
|
|
2045
|
-
}
|
|
2046
|
-
});
|
|
2047
|
-
if (!response.ok) {
|
|
2048
|
-
throw new Error(`Fallback fetch failed: ${response.status}`);
|
|
2049
|
-
}
|
|
2050
|
-
const data = await response.json();
|
|
2051
|
-
this.tokenListCache = data;
|
|
2052
|
-
this.lastFetch = now;
|
|
2053
|
-
return data;
|
|
2054
|
-
} catch (fallbackError) {
|
|
2055
|
-
logger.logError(fallbackError, {
|
|
2056
|
-
context: this.fetchTokenList.name
|
|
2057
|
-
});
|
|
2058
|
-
throw new Error("Unable to fetch Uniswap token list");
|
|
2059
|
-
}
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
1412
|
+
async createSubOrganization() {
|
|
1413
|
+
return await this.makeRequest({
|
|
1414
|
+
url: "/operating_accounts/sub_organization/new",
|
|
1415
|
+
method: HttpMethod.Post,
|
|
1416
|
+
schema: newOperatingAccountSubOrgResponseSchema
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
async getSubOrganization() {
|
|
1420
|
+
return await this.makeRequest({
|
|
1421
|
+
url: "/operating_accounts/sub_organization",
|
|
1422
|
+
method: HttpMethod.Get,
|
|
1423
|
+
schema: getOperatingAccountSubOrgResponseSchema
|
|
1424
|
+
});
|
|
1425
|
+
}
|
|
2062
1426
|
};
|
|
2063
1427
|
|
|
2064
|
-
|
|
1428
|
+
//#endregion
|
|
1429
|
+
//#region src/api/api.ts
|
|
2065
1430
|
var APIClient = class {
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
1431
|
+
constructor(init) {
|
|
1432
|
+
require_defineProperty._defineProperty(this, "account", void 0);
|
|
1433
|
+
require_defineProperty._defineProperty(this, "activity", void 0);
|
|
1434
|
+
require_defineProperty._defineProperty(this, "auth", void 0);
|
|
1435
|
+
require_defineProperty._defineProperty(this, "operatingAccount", void 0);
|
|
1436
|
+
require_defineProperty._defineProperty(this, "config", void 0);
|
|
1437
|
+
require_defineProperty._defineProperty(this, "contacts", void 0);
|
|
1438
|
+
require_defineProperty._defineProperty(this, "developer", void 0);
|
|
1439
|
+
require_defineProperty._defineProperty(this, "instruction", void 0);
|
|
1440
|
+
require_defineProperty._defineProperty(this, "transaction", void 0);
|
|
1441
|
+
require_defineProperty._defineProperty(this, "payments", void 0);
|
|
1442
|
+
require_defineProperty._defineProperty(this, "integration", void 0);
|
|
1443
|
+
const instance = isInstanceInit(init) ? init.instance : createInstance({
|
|
1444
|
+
...init,
|
|
1445
|
+
baseURL: init?.environment ? require_api_urls.getOffchainApiUrl(init.environment) : init?.baseURL
|
|
1446
|
+
});
|
|
1447
|
+
this.account = new AccountService(instance);
|
|
1448
|
+
this.activity = new ActivityService(instance);
|
|
1449
|
+
this.auth = new AuthService(instance);
|
|
1450
|
+
this.config = new ConfigService(instance);
|
|
1451
|
+
this.contacts = new ContactsService(instance);
|
|
1452
|
+
this.developer = new DeveloperService(instance);
|
|
1453
|
+
this.instruction = new InstructionService(instance);
|
|
1454
|
+
this.integration = new IntegrationService(instance);
|
|
1455
|
+
this.transaction = new TransactionService(instance);
|
|
1456
|
+
this.operatingAccount = new OperatingAccountService(instance);
|
|
1457
|
+
this.payments = new PaymentsService(instance);
|
|
1458
|
+
}
|
|
1459
|
+
};
|
|
1460
|
+
const createAPIClient = (...params) => {
|
|
1461
|
+
return new APIClient(...params);
|
|
2091
1462
|
};
|
|
2092
|
-
|
|
2093
|
-
|
|
1463
|
+
|
|
1464
|
+
//#endregion
|
|
1465
|
+
//#region src/api/result.ts
|
|
1466
|
+
function success(data) {
|
|
1467
|
+
return {
|
|
1468
|
+
success: true,
|
|
1469
|
+
data
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
function failure(error, code) {
|
|
1473
|
+
return {
|
|
1474
|
+
success: false,
|
|
1475
|
+
error,
|
|
1476
|
+
code
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1479
|
+
function isSuccess(result) {
|
|
1480
|
+
return result.success === true;
|
|
1481
|
+
}
|
|
1482
|
+
function isFailure(result) {
|
|
1483
|
+
return result.success === false;
|
|
1484
|
+
}
|
|
1485
|
+
const ErrorCode = {
|
|
1486
|
+
NetworkError: "NETWORK_ERROR",
|
|
1487
|
+
Unauthorized: "UNAUTHORIZED",
|
|
1488
|
+
AuthenticationFailed: "AUTH_FAILED",
|
|
1489
|
+
MissingParameter: "MISSING_PARAMETER",
|
|
1490
|
+
Forbidden: "FORBIDDEN",
|
|
1491
|
+
SessionExpired: "SESSION_EXPIRED",
|
|
1492
|
+
InvalidInput: "INVALID_INPUT",
|
|
1493
|
+
UnknownError: "UNKNOWN_ERROR"
|
|
2094
1494
|
};
|
|
2095
|
-
|
|
1495
|
+
|
|
1496
|
+
//#endregion
|
|
1497
|
+
exports.APIClient = APIClient;
|
|
1498
|
+
exports.AccountService = AccountService;
|
|
1499
|
+
exports.ActivityService = ActivityService;
|
|
1500
|
+
exports.AuthService = AuthService;
|
|
1501
|
+
exports.ConfigService = ConfigService;
|
|
1502
|
+
exports.ContactsService = ContactsService;
|
|
1503
|
+
exports.DelegationStatus = DelegationStatus;
|
|
1504
|
+
exports.DeveloperService = DeveloperService;
|
|
1505
|
+
exports.ErrorCode = ErrorCode;
|
|
1506
|
+
exports.HttpMethod = HttpMethod;
|
|
1507
|
+
exports.InstructionService = InstructionService;
|
|
1508
|
+
exports.IntegrationService = IntegrationService;
|
|
1509
|
+
exports.IntegrationType = IntegrationType;
|
|
1510
|
+
exports.OperatingAccountService = OperatingAccountService;
|
|
1511
|
+
exports.PaymentsService = PaymentsService;
|
|
1512
|
+
exports.ServiceError = ServiceError;
|
|
1513
|
+
exports.TransactionService = TransactionService;
|
|
1514
|
+
exports.actionArgumentsResponseSchema = actionArgumentsResponseSchema;
|
|
1515
|
+
exports.actionArgumentsSchema = actionArgumentsSchema;
|
|
1516
|
+
exports.actionNameSchema = actionNameSchema;
|
|
1517
|
+
exports.activityDataSchema = activityDataSchema;
|
|
1518
|
+
exports.activityRecordSchema = activityRecordSchema;
|
|
1519
|
+
exports.addressWhitelistCheckRequestSchema = addressWhitelistCheckRequestSchema;
|
|
1520
|
+
exports.addressWhitelistCheckResponseSchema = addressWhitelistCheckResponseSchema;
|
|
1521
|
+
exports.apiErrorSchema = apiErrorSchema;
|
|
1522
|
+
exports.attestationSchema = attestationSchema;
|
|
1523
|
+
exports.authLoginRequestSchema = authLoginRequestSchema;
|
|
1524
|
+
exports.authLoginResponseSchema = authLoginResponseSchema;
|
|
1525
|
+
exports.buildEphemeralInstructionSchema = buildEphemeralInstructionSchema;
|
|
1526
|
+
exports.buildSettlementRequestSchema = buildSettlementRequestSchema;
|
|
1527
|
+
exports.buildSettlementResponseSchema = buildSettlementResponseSchema;
|
|
1528
|
+
exports.calculateBackoffInterval = calculateBackoffInterval;
|
|
1529
|
+
exports.calculateHasMore = calculateHasMore;
|
|
1530
|
+
exports.chainIdSchema = chainIdSchema;
|
|
1531
|
+
exports.chainSuccessResponseSchema = chainSuccessResponseSchema;
|
|
1532
|
+
exports.contactSchema = contactSchema;
|
|
1533
|
+
exports.createAPIClient = createAPIClient;
|
|
1534
|
+
exports.createAbortController = createAbortController;
|
|
1535
|
+
exports.createInstance = createInstance;
|
|
1536
|
+
exports.delegationCreateRequestSchema = delegationCreateRequestSchema;
|
|
1537
|
+
exports.delegationCreateResponseSchema = delegationCreateResponseSchema;
|
|
1538
|
+
exports.delegationStatusRequestSchema = delegationStatusRequestSchema;
|
|
1539
|
+
exports.delegationStatusResponseSchema = delegationStatusResponseSchema;
|
|
1540
|
+
exports.delegationStatusSchema = delegationStatusSchema;
|
|
1541
|
+
exports.delegationStatusValues = delegationStatusValues;
|
|
1542
|
+
exports.errorResponseSchema = errorResponseSchema;
|
|
1543
|
+
exports.extractPaginationParams = extractPaginationParams;
|
|
1544
|
+
exports.failure = failure;
|
|
1545
|
+
exports.feeResponseSchema = feeResponseSchema;
|
|
1546
|
+
exports.formatActionName = formatActionName;
|
|
1547
|
+
exports.formatPaymentRail = formatPaymentRail;
|
|
1548
|
+
exports.getConfigChainsResponseSchema = getConfigChainsResponseSchema;
|
|
1549
|
+
exports.getConfigTokensRequestParametersSchema = getConfigTokensRequestParametersSchema;
|
|
1550
|
+
exports.getConfigTokensResponseSchema = getConfigTokensResponseSchema;
|
|
1551
|
+
exports.getContactsRequestSchema = getContactsRequestSchema;
|
|
1552
|
+
exports.getContactsResponseSchema = getContactsResponseSchema;
|
|
1553
|
+
exports.getDefaultPagination = getDefaultPagination;
|
|
1554
|
+
exports.getDelegateAddressResponseSchema = getDelegateAddressResponseSchema;
|
|
1555
|
+
exports.getDelegateAddressSchema = getDelegateAddressSchema;
|
|
1556
|
+
exports.getErrorMessage = getErrorMessage;
|
|
1557
|
+
exports.getErrorMessageWithCode = getErrorMessageWithCode;
|
|
1558
|
+
exports.getInstructionActivityRequestSchema = getInstructionActivityRequestSchema;
|
|
1559
|
+
exports.getInstructionActivityResponseSchema = getInstructionActivityResponseSchema;
|
|
1560
|
+
exports.getIntegrationRequestSchema = getIntegrationRequestSchema;
|
|
1561
|
+
exports.getMaxPriorityFeePerGasEstimateResponseSchema = getMaxPriorityFeePerGasEstimateResponseSchema;
|
|
1562
|
+
exports.getMaxPriorityFeePerGasEstimateSchema = getMaxPriorityFeePerGasEstimateSchema;
|
|
1563
|
+
exports.getOperatingAccountSubOrgResponseSchema = getOperatingAccountSubOrgResponseSchema;
|
|
1564
|
+
exports.getPaymentRequestsRequestSchema = getPaymentRequestsRequestSchema;
|
|
1565
|
+
exports.getPaymentRequestsResponseSchema = getPaymentRequestsResponseSchema;
|
|
1566
|
+
exports.getUserFriendlyErrorMessage = getUserFriendlyErrorMessage;
|
|
1567
|
+
exports.instructionActivateRequestSchema = instructionActivateRequestSchema;
|
|
1568
|
+
exports.instructionActivateResponseSchema = instructionActivateResponseSchema;
|
|
1569
|
+
exports.instructionBuildRequestSchema = instructionBuildRequestSchema;
|
|
1570
|
+
exports.instructionBuildSchema = instructionBuildSchema;
|
|
1571
|
+
exports.instructionDeactivateRequestSchema = instructionDeactivateRequestSchema;
|
|
1572
|
+
exports.instructionDeactivateResponseSchema = instructionDeactivateResponseSchema;
|
|
1573
|
+
exports.instructionDetailsRequestSchema = instructionDetailsRequestSchema;
|
|
1574
|
+
exports.instructionDetailsResponseSchema = instructionDetailsResponseSchema;
|
|
1575
|
+
exports.instructionGetAllRequestSchema = instructionGetAllRequestSchema;
|
|
1576
|
+
exports.instructionGetAllResponseSchema = instructionGetAllResponseSchema;
|
|
1577
|
+
exports.instructionGetRulesRequestSchema = instructionGetRulesRequestSchema;
|
|
1578
|
+
exports.instructionGetRulesResponseSchema = instructionGetRulesResponseSchema;
|
|
1579
|
+
exports.integrationResponseSchema = integrationResponseSchema;
|
|
1580
|
+
exports.integrationTypeSchema = integrationTypeSchema;
|
|
1581
|
+
exports.integrationTypeValues = integrationTypeValues;
|
|
1582
|
+
exports.isFailure = isFailure;
|
|
1583
|
+
exports.isInstanceInit = isInstanceInit;
|
|
1584
|
+
exports.isSuccess = isSuccess;
|
|
1585
|
+
exports.isTechnicalError = isTechnicalError;
|
|
1586
|
+
exports.isUserAddressableError = isUserAddressableError;
|
|
1587
|
+
exports.isUserRejectionError = isUserRejectionError;
|
|
1588
|
+
exports.meResponseSchema = meResponseSchema;
|
|
1589
|
+
exports.newContactRequestSchema = newContactRequestSchema;
|
|
1590
|
+
exports.newInstructionRequestSchema = newInstructionRequestSchema;
|
|
1591
|
+
exports.newOperatingAccountSubOrgResponseSchema = newOperatingAccountSubOrgResponseSchema;
|
|
1592
|
+
exports.orchestrationTypeSchema = orchestrationTypeSchema;
|
|
1593
|
+
exports.paymentRequestBuildRequestSchema = paymentRequestBuildRequestSchema;
|
|
1594
|
+
exports.paymentRequestBuildResponseSchema = paymentRequestBuildResponseSchema;
|
|
1595
|
+
exports.paymentRequestDetailsRequestSchema = paymentRequestDetailsRequestSchema;
|
|
1596
|
+
exports.paymentRequestDetailsResponseSchema = paymentRequestDetailsResponseSchema;
|
|
1597
|
+
exports.paymentRequestNewRequestSchema = paymentRequestNewRequestSchema;
|
|
1598
|
+
exports.paymentRequestSchema = paymentRequestSchema;
|
|
1599
|
+
exports.paymentRequestStatusSchema = paymentRequestStatusSchema;
|
|
1600
|
+
exports.paymentRequestsDirectionSchema = paymentRequestsDirectionSchema;
|
|
1601
|
+
exports.sessionTokenRequestSchema = sessionTokenRequestSchema;
|
|
1602
|
+
exports.sessionTokenResponseSchema = sessionTokenResponseSchema;
|
|
1603
|
+
exports.sessionVerifyResponseSchema = sessionVerifyResponseSchema;
|
|
1604
|
+
exports.setChainIdSchema = setChainIdSchema;
|
|
1605
|
+
exports.success = success;
|
|
1606
|
+
exports.transactionGetListRequestSchema = transactionGetListRequestSchema;
|
|
1607
|
+
exports.transactionGetListResponseSchema = transactionGetListResponseSchema;
|
|
1608
|
+
exports.turnkeyLoginRequestSchema = turnkeyLoginRequestSchema;
|
|
1609
|
+
exports.turnkeyLoginResponseSchema = turnkeyLoginResponseSchema;
|
|
1610
|
+
exports.turnkeyVerificationRequestSchema = turnkeyVerificationRequestSchema;
|
|
1611
|
+
exports.turnkeyVerificationResponseSchema = turnkeyVerificationResponseSchema;
|
|
1612
|
+
exports.updateIntegrationRequestSchema = updateIntegrationRequestSchema;
|
|
1613
|
+
exports.whitelistCheckRequestSchema = whitelistCheckRequestSchema;
|
|
1614
|
+
exports.whitelistCheckResponseSchema = whitelistCheckResponseSchema;
|
|
1615
|
+
//# sourceMappingURL=index.js.map
|