@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
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/instructions/index.ts", "../../src/schemas/instruction.ts", "../../src/schemas/misc.ts", "../../src/instructions/build.ts", "../../src/helpers/blockchain.ts", "../../src/helpers/date.ts", "../../src/helpers/datetime.ts", "../../src/instructions/constants.ts", "../../src/instructions/actions/refuel/index.ts", "../../src/instructions/actions/sweep/index.ts", "../../src/instructions/actions/swap/index.ts", "../../src/instructions/actions/transfer/index.ts", "../../src/instructions/activate.ts", "../../src/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.ts", "../../src/instructions/contracts/schemas/eip-712/actions/deactivate-instruction.json", "../../src/instructions/contracts/schemas/eip-712/actions/refuel-erc20.json", "../../src/instructions/contracts/schemas/eip-712/actions/refuel.json", "../../src/instructions/contracts/schemas/eip-712/actions/sweep-cctp.json", "../../src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-account-erc20.json", "../../src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-account.json", "../../src/instructions/contracts/schemas/eip-712/actions/sweep-erc20.json", "../../src/instructions/contracts/schemas/eip-712/actions/sweep-skip-cctp-deposit-account.json", "../../src/instructions/contracts/schemas/eip-712/actions/sweep-uniswap-v3.json", "../../src/instructions/contracts/schemas/eip-712/actions/sweep.json", "../../src/instructions/contracts/schemas/eip-712/actions/transfer-erc20.json", "../../src/instructions/contracts/schemas/eip-712/actions/transfer.json", "../../src/instructions/contracts/schemas/eip-712/actions/uniswap-v3-exact-input.json", "../../src/instructions/types.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"./actions\";\nexport * from \"./activate\";\nexport * from \"./build\";\nexport * from \"./constants\";\nexport * from \"./types\";\n", "import { z } from \"zod\";\n\nimport { dateStandardSchema, hexStringSchema, numberSchema } from \"./misc\";\n\nexport const instructionIdSchema = hexStringSchema;\nexport type InstructionId = z.infer<typeof instructionIdSchema>;\n\nexport const InstructionState = {\n PendingActivation: \"PendingActivation\",\n Active: \"Active\",\n PendingDeactivation: \"PendingDeactivation\",\n Deactivated: \"Deactivated\",\n Errored: \"Errored\",\n Completed: \"Completed\",\n UserNotDelegated: \"UserNotDelegated\",\n InFlight: \"InFlight\",\n NotifyUser: \"NotifyUser\",\n} as const;\nexport type InstructionState =\n (typeof InstructionState)[keyof typeof InstructionState];\nexport const instructionStateValues = Object.values(InstructionState) as [\n InstructionState,\n ...InstructionState[],\n];\nexport const instructionStateSchema = z.enum(instructionStateValues);\n\nexport const InstructionAction = {\n RefuelERC20: \"refuelERC20\",\n Refuel: \"refuel\",\n Transfer: \"transfer\",\n TransferERC20: \"transferERC20\",\n UniswapV3ExactInput: \"uniswapV3ExactInput\",\n Sweep: \"sweep\",\n SweepERC20: \"sweepERC20\",\n SweepCCTP: \"sweepCCTP\",\n SweepUniswapV3: \"sweepUniswapV3\",\n SweepDepositAccount: \"sweepDepositAccount\",\n SweepDepositAccountERC20: \"sweepDepositAccountERC20\",\n DeactivateInstruction: \"deactivateInstruction\",\n SweepSkipCCTPDepositAccount: \"sweepSkipCCTPDepositAccount\",\n} as const;\nexport type InstructionAction =\n (typeof InstructionAction)[keyof typeof InstructionAction];\nexport const instructionActionValues = Object.values(InstructionAction) as [\n InstructionAction,\n ...InstructionAction[],\n];\nexport const instructionActionSchema = z.enum(instructionActionValues);\n\nexport const InstructionScheduleStartType = {\n Now: \"now\",\n DateTime: \"datetime\",\n} as const;\nexport type InstructionScheduleStartType =\n (typeof InstructionScheduleStartType)[keyof typeof InstructionScheduleStartType];\nexport const instructionScheduleStartValues = Object.values(\n InstructionScheduleStartType,\n) as [InstructionScheduleStartType, ...InstructionScheduleStartType[]];\nconst baseStartSchema = z.object({\n type: z.enum(instructionScheduleStartValues),\n});\nconst nowStartSchema = baseStartSchema.extend({\n type: z.literal(InstructionScheduleStartType.Now),\n});\nconst dateTimeStartSchema = baseStartSchema.extend({\n type: z.literal(InstructionScheduleStartType.DateTime),\n startDate: dateStandardSchema,\n startTime: z.string(),\n});\nexport const instructionScheduleStartSchema = z.discriminatedUnion(\"type\", [\n nowStartSchema,\n dateTimeStartSchema,\n]);\nexport type InstructionScheduleStart = z.infer<\n typeof instructionScheduleStartSchema\n>;\n\nexport const InstructionScheduleRepeatType = {\n UntilDeactivated: \"until-deactivated\",\n MaxExecutions: \"max-executions\",\n} as const;\nexport type InstructionScheduleRepeatType =\n (typeof InstructionScheduleRepeatType)[keyof typeof InstructionScheduleRepeatType];\nexport const instructionScheduleRepeatValues = Object.values(\n InstructionScheduleRepeatType,\n) as [InstructionScheduleRepeatType, ...InstructionScheduleRepeatType[]];\nconst baseRepeatSchema = z.object({});\nconst untilDeactivatedRepeatSchema = baseRepeatSchema.extend({\n type: z.literal(InstructionScheduleRepeatType.UntilDeactivated),\n});\nconst maxExecutionsRepeatSchema = baseRepeatSchema.extend({\n type: z.literal(InstructionScheduleRepeatType.MaxExecutions),\n maxExecutions: numberSchema,\n});\nexport const instructionScheduleRepeatSchema = z.discriminatedUnion(\"type\", [\n untilDeactivatedRepeatSchema,\n maxExecutionsRepeatSchema,\n]);\nexport type InstructionScheduleRepeat = z.infer<\n typeof instructionScheduleRepeatSchema\n>;\n\nexport const InstructionScheduleRetryType = {\n UntilDeactivated: \"until-deactivated\",\n TimeLimited: \"time-limited\",\n} as const;\nexport type InstructionScheduleRetryType =\n (typeof InstructionScheduleRetryType)[keyof typeof InstructionScheduleRetryType];\nexport const instructionScheduleRetryValues = Object.values(\n InstructionScheduleRetryType,\n) as [InstructionScheduleRetryType, ...InstructionScheduleRetryType[]];\nconst baseRetrySchema = z.object({});\nconst untilDeactivatedRetrySchema = baseRetrySchema.extend({\n type: z.literal(InstructionScheduleRetryType.UntilDeactivated),\n});\nconst timeLimitedRetrySchema = baseRetrySchema.extend({\n type: z.literal(InstructionScheduleRetryType.TimeLimited),\n retryCount: numberSchema,\n});\nexport const instructionScheduleRetrySchema = z.discriminatedUnion(\"type\", [\n untilDeactivatedRetrySchema,\n timeLimitedRetrySchema,\n]);\nexport type InstructionScheduleRetry = z.infer<\n typeof instructionScheduleRetrySchema\n>;\n\nexport const TimeUnit = {\n None: \"none\",\n Second: \"second\",\n Minute: \"minute\",\n Hour: \"hour\",\n Day: \"day\",\n Week: \"week\",\n Month: \"month\",\n} as const;\nexport type TimeUnit = (typeof TimeUnit)[keyof typeof TimeUnit];\nexport const timeUnitValues = Object.values(TimeUnit) as [\n TimeUnit,\n ...TimeUnit[],\n];\nexport const timeUnitSchema = z.enum(timeUnitValues);\n\nexport const instructionExecutionStateSchema = z.object({\n executionStatus: instructionStateSchema.optional(),\n executionCounter: z.number().int().optional(),\n lastExecuted: z.number().int().optional(),\n});\n\nexport const instructionSchema = z.object({\n instructionId: hexStringSchema,\n createdAt: z.number().optional(),\n startAt: z.string().nullish(),\n interval: z.number().nullish(),\n timeout: z.number().nullish(),\n maxExecutions: z.number().nullish(),\n executionState: instructionExecutionStateSchema.optional(),\n actionName: z.string().optional(),\n arguments: z.any(),\n nickname: z.string().nullish(),\n lastInstructedValue: z.string().optional(),\n lastErrorCode: z.number().nullish(),\n lastErrorMessage: z.string().nullish(),\n totalInstructedValue: z.string().optional(),\n instructedTokenAddress: hexStringSchema.nullish(),\n chainId: z.number().nullish(),\n chain: z.string().optional(),\n});\nexport type Instruction = z.infer<typeof instructionSchema>;\n\nexport const instructionsSchema = z.array(instructionSchema);\nexport type Instructions = z.infer<typeof instructionsSchema>;\n\nexport const instructionSummarySchema = z.object({\n instructionId: hexStringSchema,\n chainId: z.number().int(),\n executionCount: z.number().int(),\n onTimeCount: z.number().int(),\n lateCount: z.number().int(),\n wasActivatedDuring: z.boolean(),\n amount: z.number().default(0),\n instructedValue: z.string().nullish().default(\"0\"),\n instructedTokenAddress: z.string().nullish().default(null),\n});\nexport type InstructionSummary = z.infer<typeof instructionSummarySchema>;\n\nexport const instructionSummariesSchema = z.array(instructionSummarySchema);\nexport type InstructionSummaries = z.infer<typeof instructionSummariesSchema>;\n\nexport const instructionSummariesByDateSchema = z.record(\n z.string(),\n instructionSummariesSchema,\n);\nexport type InstructionSummariesByDate = z.infer<\n typeof instructionSummariesByDateSchema\n>;\n\nexport const InstructionViewTimescale = {\n Days: \"days\",\n Hours: \"hours\",\n Minutes: \"minutes\",\n Seconds: \"seconds\",\n} as const;\nexport type InstructionViewTimescale =\n (typeof InstructionViewTimescale)[keyof typeof InstructionViewTimescale];\nexport const instructionViewTimescaleValues = Object.values(\n InstructionViewTimescale,\n) as [InstructionViewTimescale, ...InstructionViewTimescale[]];\n\nexport function assertInstructionAction(\n action: unknown,\n): asserts action is InstructionAction {\n if (!instructionActionValues.includes(action as InstructionAction)) {\n throw new Error(`Invalid instruction action: ${action}`);\n }\n}\n", "import { z } from \"zod\";\n\nexport const DATE_REGEX =\n /^(19|20)\\d{2}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/;\nexport const DATE_ISO_8601_REGEX =\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})?$/;\nexport const DATE_STANDARD_REGEX =\n /^(0[1-9]|1[0-2])\\/(0[1-9]|[12][0-9]|3[01])\\/(19|20)\\d{2}$/;\nexport const TIME_REGEX = /^(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] (AM|PM)$/;\n\nexport const regexSchema = (regex: RegExp, message?: string) =>\n z.string().regex(regex, message);\n\nexport const nonEmptyStringSchema = z.string().min(1);\n\nexport const numberSchema = z.union([\n z.number().finite(),\n z\n .string()\n .regex(/^-?\\d*\\.?\\d+(?:[eE][-+]?\\d+)?$/)\n .transform(Number),\n]);\n\nexport const decimalStringSchema = z\n .string()\n .regex(/^-?\\d*\\.?\\d+$/)\n .refine((val) => !isNaN(parseFloat(val)), {\n message: \"Must be a valid decimal number\",\n });\n\nexport const bigintSchema = z.union([\n z.bigint(),\n z\n .string()\n .regex(/^-?\\d+$/)\n .transform(BigInt),\n]);\n\nexport const hexStringSchema = z\n .string()\n .startsWith(\"0x\")\n .transform((val): `0x${string}` => val as `0x${string}`);\n\nexport const dateSchema = regexSchema(DATE_REGEX);\nexport const dateISO8601Schema = regexSchema(DATE_ISO_8601_REGEX);\nexport const dateStandardSchema = regexSchema(DATE_STANDARD_REGEX);\n\nexport const timeSchema = regexSchema(TIME_REGEX);\n\nexport const Sort = {\n Asc: \"asc\",\n Desc: \"desc\",\n} as const;\nexport type Sort = (typeof Sort)[keyof typeof Sort];\nexport const sortValues = Object.values(Sort) as [Sort, ...Sort[]];\n\nexport const vrsSchema = z.object({\n v: z.number(),\n r: z.string(),\n s: z.string(),\n});\n\nexport const eip2098SignatureSchema = z.object({\n yParity: z.number(),\n r: z.string(),\n s: z.string(),\n});\n\nexport type HexString = z.infer<typeof hexStringSchema>;\nexport type Address = z.infer<typeof hexStringSchema>;\nexport type VRS = z.infer<typeof vrsSchema>;\nexport type EIP2098Signature = z.infer<typeof eip2098SignatureSchema>;\n", "import type { InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address, InstructionAction } from \"@otim/utils/schemas\";\n\nimport { parseUnits, toHex } from \"viem\";\n\nimport {\n coerceSecondsFromTimeUnitValue,\n parseDateTime,\n} from \"@otim/utils/helpers\";\n\nimport { DEFAULT_INTERVAL_SECONDS } from \"./constants\";\n\n// Export base types for instruction build payloads\nexport type {\n BaseInstructionBuildPayload,\n GasLimitConfigurablePayload,\n ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n} from \"./types\";\n\n/**\n * Instruction build utilities\n *\n * Sections:\n * - Types & constants\n * - Schedule helpers\n * - Gas/Fee helpers\n * - Action-specific resolvers\n * - Build payload creator\n */\n\n// Types & constants\n/**\n * Parameters required to assemble a build payload for an instruction action.\n */\nexport interface CreateBuildPayloadParams {\n action: InstructionAction;\n address: Address;\n chainId: number;\n maxExecutions: number;\n salt?: number;\n actionArguments: InstructionBuildRequest[\"actionArguments\"][string];\n}\n\n/**\n * Build payload creator\n *\n * Creates the request body to build an instruction on the backend.\n */\nexport function createBuildPayload({\n action,\n address,\n chainId,\n maxExecutions,\n salt,\n actionArguments,\n}: CreateBuildPayloadParams): InstructionBuildRequest {\n return {\n address,\n chainId,\n maxExecutions,\n salt: salt ?? Math.floor(Math.random() * Number.MAX_SAFE_INTEGER),\n actionArguments: {\n [action]: actionArguments,\n },\n };\n}\n\n/**\n * Start specification for instruction scheduling.\n * Determines when the instruction should begin execution.\n */\nexport type ScheduleStart =\n | { type: \"datetime\"; startDate: string; startTime: string }\n | { type: \"now\" };\n\n/**\n * Repeat policy for instruction scheduling.\n * Controls how many times an instruction can execute.\n */\nexport type ScheduleRepeat =\n | { type: \"max-executions\"; maxExecutions: number }\n | { type: \"until-deactivated\" };\n\n/**\n * Advanced tuning options affecting schedule and fee behavior.\n * Provides fine-grained control over instruction execution parameters.\n */\nexport interface BuildAdvancedOptions {\n /** Maximum latency allowed for scheduled execution intervals */\n intervalLatencyLimit?: unknown;\n /** Lookback period for mean price calculation in swap operations */\n meanPriceLookBack?: unknown;\n /** Maximum allowed price deviation in basis points for swaps */\n maxPriceDeviationBps?: string | number;\n /** Maximum base fee per gas in Gwei for EIP-1559 transactions */\n maxBaseFeePerGas?: number | string;\n /** Maximum priority fee per gas in Gwei for EIP-1559 transactions */\n maxPriorityFeePerGas?: number | string;\n}\n\n/**\n * Resolves schedule start values.\n * - \"datetime\": schedules with explicit startAt timestamp (in seconds)\n * - \"now\" or omitted: starts immediately\n */\nexport const createScheduleStart = (values?: ScheduleStart) => {\n if (values && values.type === \"datetime\") {\n const date = parseDateTime(values.startDate, values.startTime);\n if (!date) throw new Error(\"Invalid start date or time\");\n return { startAt: Math.floor(date.getTime() / 1000), startBy: 0 };\n }\n return { startAt: 0, startBy: 0 };\n};\n\n/**\n * Converts a time unit value to seconds and returns the interval field.\n */\nexport const createScheduleInterval = (values?: unknown) => {\n if (!values) return { interval: DEFAULT_INTERVAL_SECONDS };\n const seconds = coerceSecondsFromTimeUnitValue(values);\n return { interval: seconds || DEFAULT_INTERVAL_SECONDS };\n};\n\n/**\n * Converts a time unit value to seconds and returns the timeout field.\n * Timeout represents the maximum latency allowed for scheduled execution (0 = no limit).\n */\nexport const createScheduleIntervalLatencyLimit = (values?: unknown) => {\n if (!values) return { timeout: 0 };\n const seconds = coerceSecondsFromTimeUnitValue(values);\n return { timeout: seconds };\n};\n\n/**\n * Resolves maxExecutions based on repeat policy.\n * Returns 0 for unlimited executions when type is \"until-deactivated\".\n */\nexport const createScheduleRepeat = (values: ScheduleRepeat) => {\n if (values.type === \"max-executions\") {\n return { maxExecutions: values.maxExecutions };\n }\n return { maxExecutions: 0 };\n};\n\n/**\n * Assembles the schedule object when any schedule-related option is provided.\n */\nexport const resolveSchedule = (\n repeat: ScheduleRepeat,\n start?: ScheduleStart,\n interval?: unknown,\n advanced?: BuildAdvancedOptions,\n) => {\n const { maxExecutions } = createScheduleRepeat(repeat);\n if (!start && !interval && !advanced?.intervalLatencyLimit) {\n return { maxExecutions } as\n | { maxExecutions: number }\n | { maxExecutions: number; schedule: unknown };\n }\n\n const { startAt, startBy } = createScheduleStart(start);\n const { interval: intervalSeconds } = createScheduleInterval(interval);\n const { timeout } = createScheduleIntervalLatencyLimit(\n advanced?.intervalLatencyLimit,\n );\n\n return {\n maxExecutions,\n schedule: { interval: intervalSeconds, startBy, startAt, timeout },\n };\n};\n\n/**\n * Converts a Gwei value into Wei as a hex string. Returns 0x0 on invalid input.\n */\nexport const convertGweiToWei = (gweiValue: number | string): `0x${string}` => {\n try {\n if (isNaN(Number(gweiValue)) || Number(gweiValue) < 0) {\n throw new Error(`Invalid Gwei value: ${gweiValue}`);\n }\n const gweiString = Number(gweiValue).toFixed(18);\n return toHex(parseUnits(gweiString, 9));\n } catch {\n return toHex(0n);\n }\n};\n\n/**\n * Fee input required to resolve base fee configuration.\n * Specifies the token and amount for instruction execution fees.\n */\nexport interface BuildFeeInput {\n /** Address of the token used to pay execution fees */\n token: Address;\n /** Amount of fee to pay (optional, defaults to 0) */\n executionFee?: number | string;\n}\n\n/**\n * Builds the fee object including EIP-1559 caps and optional pricing controls.\n */\nexport const resolveFee = (\n fee: BuildFeeInput,\n advanced?: BuildAdvancedOptions,\n) => {\n const baseFee = {\n fee: {\n executionFee: 0,\n token: fee.token,\n maxBaseFeePerGas: convertGweiToWei(advanced?.maxBaseFeePerGas ?? 0),\n maxPriorityFeePerGas: convertGweiToWei(\n advanced?.maxPriorityFeePerGas ?? 0,\n ),\n },\n } as Record<string, unknown>;\n\n const additionalFields: Record<string, unknown> = {};\n if (advanced?.meanPriceLookBack) {\n additionalFields.meanPriceLookBack = coerceSecondsFromTimeUnitValue(\n advanced.meanPriceLookBack,\n );\n }\n if (advanced?.maxPriceDeviationBps) {\n const bpsValue = parseInt(String(advanced.maxPriceDeviationBps), 10);\n if (!isNaN(bpsValue)) {\n additionalFields.maxPriceDeviationBps = bpsValue;\n }\n }\n\n return { ...baseFee, ...additionalFields } as Record<string, unknown>;\n};\n\n/**\n * Some actions allow an explicit gas limit. Returns { gasLimit: 0 } when\n * needed, otherwise an empty object to keep payload minimal.\n */\nexport const resolveGasLimitIfNeeded = (action: InstructionAction) => {\n const actionsWithGasLimit: InstructionAction[] = [\n \"refuel\",\n \"transfer\",\n ] as InstructionAction[];\n return actionsWithGasLimit.includes(action) ? { gasLimit: 0 } : {};\n};\n\n/**\n * Adds depositor field for sweep deposit actions when required.\n */\nexport const resolveDepositorForSweepDepositAccountIfNeeded = (\n action: InstructionAction,\n depositorAddress: Address,\n) => {\n const actions: InstructionAction[] = [\n \"sweepDepositAccount\",\n \"sweepDepositAccountERC20\",\n ];\n return actions.includes(action) ? { depositor: depositorAddress } : {};\n};\n\n/**\n * Adds recipient field for Uniswap V3 exact input action when required.\n */\nexport const resolveRecipientForUniswapV3ExactInputIfNeeded = (\n action: InstructionAction,\n recipientAddress: Address,\n) => {\n return action === \"uniswapV3ExactInput\"\n ? { recipient: recipientAddress }\n : {};\n};\n", "import type { EIP2098Signature, HexString, VRS } from \"@otim/utils/schemas\";\nimport type { Chain } from \"viem\";\n\nimport { isAddressEqual } from \"viem\";\n\nexport const truncateAddress = (address: string): string => {\n if (!address) return \"\";\n return `${address.slice(0, 6)}...${address.slice(-4)}`;\n};\n\n/**\n * Ethereum address regex pattern\n * Matches addresses like 0x1234...abcd (40 hex characters after 0x prefix)\n */\nexport const ETHEREUM_ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/;\n\n/**\n * Validates if a string is a valid Ethereum address format\n * @param address - The address string to validate\n * @returns true if the address matches the Ethereum address format\n */\nexport const isValidEthereumAddress = (address: string): boolean => {\n return ETHEREUM_ADDRESS_REGEX.test(address);\n};\n\n/**\n * Parses a signature string into its v, r, s components.\n * @param signature - The signature string to parse (must be 0x-prefixed, 132 chars total)\n * @returns VRS object containing v, r, and s values\n */\nexport const parseSignatureToVRS = (signature: string): VRS => {\n if (typeof signature !== \"string\") {\n throw new Error(\"Signature must be a string\");\n }\n\n if (!signature.startsWith(\"0x\")) {\n throw new Error('Signature must start with \"0x\"');\n }\n\n if (signature.length !== 132) {\n throw new Error(\n 'Signature must be 65 bytes (130 hex chars) plus \"0x\" = 132 total length',\n );\n }\n\n const r = signature.slice(2, 66);\n const s = signature.slice(66, 130);\n const vHex = signature.slice(130, 132);\n const v = parseInt(vHex, 16);\n return { v, r: `0x${r}`, s: `0x${s}` };\n};\n\n/**\n * Checks if a v value is valid according to EIP-155.\n */\nexport const isValidV = (v: number): boolean => {\n return v === 0 || v === 1 || v === 27 || v === 28 || v >= 35;\n};\n\n/**\n * Normalizes v value for EIP-155 compliance.\n */\nexport const normalizeV = (v: number) => {\n if (!isValidV(v)) return 0;\n\n const cmp = v <= 1 ? 1 : 0;\n const result = v % 2 === cmp;\n\n return Number(result) % 2;\n};\n\n/**\n * Creates an EIP-2098 compact signature from VRS components.\n * @param vrs - The VRS signature components\n * @returns EIP2098Signature object with yParity, r, and s\n */\nexport const createEIP2098Signature = (vrs: VRS): EIP2098Signature => {\n const v = vrs.v;\n const r = vrs.r;\n const s = vrs.s;\n\n return { yParity: normalizeV(v), r, s };\n};\n\nexport const getChainRpcUrl = (\n chainId: number,\n chains: readonly [Chain, ...Chain[]],\n) => {\n const chain = chains.find((chain) => chain.id === chainId);\n return chain?.rpcUrls.default;\n};\n\nexport const DEFAULT_ADDRESS = \"0x0000000000000000000000000000000000000000\";\n\nexport const isNullAddress = (address: HexString) => {\n return isAddressEqual(address, DEFAULT_ADDRESS);\n};\n", "import z from \"zod\";\n\nimport { logger } from \"./logger\";\n\ntype Locale = \"en\" | \"es\";\n\ntype FormatDateFunc<T> = (date: Date) => T;\n\nexport const iso8601DateSchema = z\n .string()\n .regex(\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z$/,\n \"Must be a valid ISO 8601 date format (e.g., 2024-12-31T23:59:59.000Z)\",\n );\n\nexport const TimeUnit = {\n Day: \"day\",\n Month: \"month\",\n Year: \"year\",\n} as const;\n\nexport type TimeUnit = (typeof TimeUnit)[keyof typeof TimeUnit];\n\nconst units = {\n [TimeUnit.Day]: {\n one: \"day\",\n other: \"days\",\n },\n [TimeUnit.Month]: {\n one: \"month\",\n other: \"months\",\n },\n [TimeUnit.Year]: {\n one: \"year\",\n other: \"years\",\n },\n} as const;\n\nconst formatDateAsUSStandard = (\n date: Date,\n opts?: Intl.DateTimeFormatOptions,\n) =>\n date.toLocaleString(\"en-US\", {\n month: \"2-digit\",\n day: \"2-digit\",\n year: \"numeric\",\n ...opts,\n });\n\nexport const formatDateAsISO = (date: Date) => date.toISOString();\n\nconst formatFullDate = (date: Date): string => {\n const options: Intl.DateTimeFormatOptions = {\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n timeZone: \"UTC\",\n };\n return new Intl.DateTimeFormat(\"en-US\", options).format(date);\n};\n\nconst formatTime = (date: Date): string => {\n return date.toLocaleTimeString(\"en-US\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n timeZone: \"UTC\",\n timeZoneName: \"short\",\n });\n};\n\nconst formatDateTime = (date: Date): string => {\n const dateOptions: Intl.DateTimeFormatOptions = {\n month: \"short\",\n day: \"numeric\",\n year: \"numeric\",\n timeZone: \"UTC\",\n };\n const timeOptions: Intl.DateTimeFormatOptions = {\n hour: \"2-digit\",\n minute: \"2-digit\",\n timeZone: \"UTC\",\n };\n\n const formattedDate = new Intl.DateTimeFormat(\"en-US\", dateOptions).format(\n date,\n );\n const formattedTime = new Intl.DateTimeFormat(\"en-US\", timeOptions).format(\n date,\n );\n\n return `${formattedDate} at ${formattedTime}`;\n};\n\n/**\n * Formats a date in long format (e.g., \"June 19, 2025\")\n * @param date - Date object to format\n * @returns Formatted date string\n */\nconst formatLongDate = (date: Date): string => {\n const options: Intl.DateTimeFormatOptions = {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n timeZone: \"UTC\",\n };\n return new Intl.DateTimeFormat(\"en-US\", options).format(date);\n};\n\n/**\n * Formats a date with time in long format (e.g., \"June 19, 2025 at 07:00 AM\")\n * @param date - Date object to format\n * @returns Formatted date and time string\n */\nconst formatLongDateTime = (date: Date): string => {\n const dateOptions: Intl.DateTimeFormatOptions = {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n timeZone: \"UTC\",\n };\n const timeOptions: Intl.DateTimeFormatOptions = {\n hour: \"2-digit\",\n minute: \"2-digit\",\n hour12: true,\n timeZone: \"UTC\",\n };\n\n const formattedDate = new Intl.DateTimeFormat(\"en-US\", dateOptions).format(\n date,\n );\n const formattedTime = new Intl.DateTimeFormat(\"en-US\", timeOptions)\n .format(date)\n .toLowerCase();\n\n return `${formattedDate} at ${formattedTime}`;\n};\n\nconst formatToShortDate = (dateString: string | Date) => {\n const date =\n typeof dateString === \"string\" ? new Date(dateString) : dateString;\n\n if (isNaN(date.getTime())) {\n return \"Jan 1\";\n }\n\n return date.toLocaleDateString(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n timeZone: \"UTC\",\n });\n};\n\nconst formatToShortDateWithYear = (dateString: string | Date) => {\n const date =\n typeof dateString === \"string\" ? new Date(dateString) : dateString;\n\n if (isNaN(date.getTime())) {\n return \"Unknown\";\n }\n\n return date.toLocaleDateString(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n year: \"numeric\",\n timeZone: \"UTC\",\n });\n};\n\nexport const formatToJustDate = (dateString: string) => {\n const date = new Date(dateString);\n\n if (isNaN(date.getTime())) {\n return \"1\";\n }\n\n return date.getUTCDate().toString();\n};\n\nexport const formatDateToYYYYMMDD = (date: Date) => {\n return new Intl.DateTimeFormat(\"en-CA\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n }).format(date);\n};\n\nconst isDateInvalid = (date: Date) => {\n return date.toString() === \"Invalid Date\";\n};\n\n/**\n * Validates if a date is valid (opposite of isDateInvalid)\n * Checks both the Date object validity and the timestamp\n */\nconst isValidDate = (date: Date): boolean => {\n return !isDateInvalid(date) && !isNaN(date.getTime());\n};\n\nconst isDateEpoc = (date: Date) => {\n return date.getTime() <= 0;\n};\n\nconst isDateInRange = (arg: unknown): boolean => {\n if (typeof arg !== \"string\") {\n return false;\n }\n\n const date = new Date(arg);\n const startDate = new Date(\"1800-01-01T00:00:00.000Z\");\n const endDate = new Date(\"2999-12-31T23:59:59.999Z\");\n\n return date >= startDate && date <= endDate;\n};\n\nconst isDateInPast = (input: string | number | Date): boolean => {\n let date: Date;\n if (input instanceof Date) {\n date = input;\n } else if (typeof input === \"number\") {\n const ms = input < 1e12 ? input * 1000 : input;\n date = new Date(ms);\n } else {\n date = new Date(input);\n }\n\n if (isNaN(date.getTime())) {\n return false;\n }\n\n return date.getTime() < Date.now();\n};\n\nconst isSameDate = (dateA: Date, dateB: Date) => {\n return (\n dateA.getFullYear() === dateB.getFullYear() &&\n dateA.getMonth() === dateB.getMonth() &&\n dateA.getDate() === dateB.getDate()\n );\n};\n\nconst getPluralizedUnit = (\n unit: keyof typeof units,\n count: number,\n locale: Locale = \"en\",\n) => {\n const pluralRules = new Intl.PluralRules(locale, {\n type: \"cardinal\",\n });\n const pluralCategory = pluralRules.select(count);\n\n if (pluralCategory === \"one\" || pluralCategory === \"other\") {\n return `${count} ${units[unit][pluralCategory]}`;\n }\n\n return `${count} ${units[unit].other}`;\n};\n\nconst getRelativeDateDescription = (\n targetDate: Date,\n locale: Locale = \"en\",\n) => {\n const currentDate = new Date();\n\n const oneDay = 1000 * 60 * 60 * 24;\n const oneMonth = oneDay * 30;\n const oneYear = oneDay * 365;\n\n const diffInMilliseconds = targetDate.getTime() - currentDate.getTime();\n const diffInDays = Math.round(diffInMilliseconds / oneDay);\n const diffInMonths = Math.round(diffInMilliseconds / oneMonth);\n const diffInYears = Math.round(diffInMilliseconds / oneYear);\n\n if (Math.abs(diffInYears) >= 1) {\n return getPluralizedUnit(\"year\", Math.abs(diffInYears), locale);\n }\n\n if (Math.abs(diffInMonths) >= 1) {\n return getPluralizedUnit(\"month\", Math.abs(diffInMonths), locale);\n }\n\n return getPluralizedUnit(\"day\", Math.abs(diffInDays), locale);\n};\n\n/**\n * Safely formats a date with validation and fallback support\n * @param date - String or Date to format\n * @param formatter - Function that formats the Date object\n * @param fallback - Value to return if date is invalid\n * @returns Formatted string or fallback value\n */\nconst safeFormatDate = <T = string>(\n date: string | Date,\n formatter: FormatDateFunc<T>,\n fallback: T,\n): T => {\n const dateObj = typeof date === \"string\" ? new Date(date) : date;\n\n if (!isValidDate(dateObj)) {\n return fallback;\n }\n\n try {\n return formatter(dateObj);\n } catch (error) {\n logger.logError(error, {\n context: safeFormatDate.name,\n });\n return fallback;\n }\n};\n\nconst parseDateTime = (dateInput: string, timeInput?: string) => {\n const dateRegex = /^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/;\n const timeRegex = /^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?\\s*(AM|PM|am|pm)?$/;\n\n const dateMatch = dateRegex.exec(dateInput);\n if (!dateMatch) {\n return undefined;\n }\n\n const month = parseInt(dateMatch[1]!, 10) - 1;\n const day = parseInt(dateMatch[2]!, 10);\n const year = parseInt(dateMatch[3]!, 10);\n\n let hours = 0;\n let minutes = 0;\n let seconds = 0;\n\n if (timeInput) {\n timeInput = timeInput.replace(/\\u00A0/g, \" \").trim();\n\n const timeMatch = timeRegex.exec(timeInput);\n if (!timeMatch) {\n return undefined;\n }\n\n hours = parseInt(timeMatch[1]!, 10);\n minutes = parseInt(timeMatch[2]!, 10);\n seconds = timeMatch[3] ? parseInt(timeMatch[3], 10) : 0;\n const meridiem = timeMatch[4] ? timeMatch[4].toUpperCase() : null;\n\n if (meridiem === \"PM\" && hours < 12) {\n hours += 12;\n } else if (meridiem === \"AM\" && hours === 12) {\n hours = 0;\n }\n }\n\n const date = new Date(Date.UTC(year, month, day, hours, minutes, seconds));\n if (isNaN(date.getTime())) {\n return undefined;\n }\n\n return date;\n};\n\nconst validateIso8601Date = (dueDate: string): void => {\n const result = iso8601DateSchema.safeParse(dueDate);\n if (!result.success) {\n const errorMessage =\n result.error.issues[0]?.message || \"Invalid ISO 8601 format\";\n throw new Error(`Invalid due date format: ${errorMessage}`);\n }\n};\n\nexport {\n formatDateAsUSStandard,\n formatToShortDate,\n formatToShortDateWithYear,\n formatFullDate,\n formatTime,\n formatDateTime,\n formatLongDate,\n formatLongDateTime,\n getPluralizedUnit,\n getRelativeDateDescription,\n isDateInvalid,\n isValidDate,\n validateIso8601Date,\n isDateEpoc,\n isDateInRange,\n isDateInPast,\n isSameDate,\n safeFormatDate,\n parseDateTime,\n};\nexport type { FormatDateFunc };\n", "import type { Nullable, Optional } from \"./types\";\n\nimport { z } from \"zod\";\n\nimport { timeUnitSchema } from \"@otim/utils/schemas\";\n\n/**\n * schema for TimeUnitInputValue\n */\nexport const timeUnitInputValueSchema = z.object({\n unit: timeUnitSchema,\n value: z.number().finite(),\n seconds: z.number().finite(),\n});\nexport type TimeUnitInputValue = z.infer<typeof timeUnitInputValueSchema>;\n\n/**\n * type guard to check if a value is a valid TimeUnitInputValue object.\n */\nconst isTimeUnitInputValue = (value: unknown): value is TimeUnitInputValue => {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n const obj = value as Record<string, unknown>;\n return (\n \"unit\" in obj &&\n \"value\" in obj &&\n \"seconds\" in obj &&\n typeof obj.unit === \"string\" &&\n typeof obj.value === \"number\" &&\n typeof obj.seconds === \"number\"\n );\n};\n\n/**\n * safely parses a JSON string to TimeUnitInputValue.\n * returns undefined if parsing fails or result is invalid.\n */\nconst parseJsonToTimeUnitValue = (\n jsonString: string,\n): Optional<TimeUnitInputValue> => {\n try {\n const parsed = JSON.parse(jsonString);\n return isTimeUnitInputValue(parsed) ? parsed : undefined;\n } catch {\n return undefined;\n }\n};\n\n/**\n * converts various value formats to TimeUnitInputValue.\n * handles both direct objects and JSON strings from form system.\n *\n * @param value \u2013 value from form field (can be object, string, or other)\n * @returns parsed TimeUnitInputValue or undefined if invalid\n */\nexport const parseTimeUnitValue = (\n value: unknown,\n): Optional<TimeUnitInputValue> => {\n // handle null/undefined\n if (!value) return undefined;\n\n // handle direct object (from initial values or state)\n if (isTimeUnitInputValue(value)) {\n return value;\n }\n\n // handle JSON string (from form serialization)\n if (typeof value === \"string\") {\n return parseJsonToTimeUnitValue(value);\n }\n\n return undefined;\n};\n\n/**\n * serializes TimeUnitInputValue to JSON string for form compatibility.\n *\n * @param value \u2013 TimeUnitInputValue to serialize\n * @returns JSON string representation\n */\nexport const serializeTimeUnitValue = (value: TimeUnitInputValue): string => {\n return JSON.stringify(value);\n};\n\n/**\n * validates if a value can be converted to a valid TimeUnitInputValue.\n *\n * @param value \u2013 value to validate\n * @returns true if value is valid, false otherwise\n */\nexport const isValidTimeUnitValue = (value: unknown): boolean => {\n return parseTimeUnitValue(value) !== undefined;\n};\n\n/**\n * gets the total seconds from a TimeUnitInputValue or its serialized form.\n *\n * @param value \u2013 TimeUnitInputValue or JSON string\n * @returns number of seconds or 0 if invalid\n */\nexport const getSecondsFromTimeUnitValue = (value: unknown): number => {\n const parsed = parseTimeUnitValue(value);\n return parsed?.seconds ?? 0;\n};\n\nexport const coerceSecondsFromTimeUnitValue = (value: unknown): number => {\n if (!value) return 0;\n if (typeof value === \"object\") {\n const obj = value as Record<string, unknown>;\n const seconds = obj?.seconds;\n if (typeof seconds === \"number\" && Number.isFinite(seconds)) return seconds;\n }\n if (typeof value === \"string\") {\n try {\n const parsed = JSON.parse(value) as { seconds?: unknown };\n const seconds = parsed?.seconds;\n if (typeof seconds === \"number\" && Number.isFinite(seconds))\n return seconds;\n } catch {}\n }\n return 0;\n};\n\n/**\n * Parses a date and time string into a Date object (strict version).\n * @param date \u2013 date string\n * @param time \u2013 time string\n * @returns Date object or null if invalid\n */\nexport function parseDateTimeStrict(\n date: string,\n time: string,\n): Nullable<Date> {\n try {\n const parts = date?.split(\"/\") ?? [];\n const month = Number(parts[0]);\n const day = Number(parts[1]);\n const year = Number(parts[2]);\n\n const timeParts = time?.split(\" \") ?? [];\n const timePart = timeParts[0] ?? \"00:00:00\";\n const ampm = timeParts[1] ?? \"AM\";\n const [hoursStr, minutesStr, secondsStr] = timePart.split(\":\");\n let hours = Number(hoursStr ?? 0);\n const minutes = Number(minutesStr ?? 0);\n const seconds = Number(secondsStr ?? 0);\n if (ampm === \"PM\" && hours < 12) hours += 12;\n if (ampm === \"AM\" && hours === 12) hours = 0;\n const dt = new Date(\n year || 0,\n (month || 1) - 1,\n day || 1,\n hours,\n minutes,\n seconds,\n );\n return isNaN(dt.getTime()) ? null : dt;\n } catch {\n return null;\n }\n}\n", "/**\n * Default interval used when none is provided (in seconds).\n */\nexport const DEFAULT_INTERVAL_SECONDS = 12;\n\n/**\n * Default API timeout for instruction operations (in milliseconds).\n */\nexport const INSTRUCTION_DEFAULT_TIMEOUT = 30000;\n", "import type {\n GasLimitConfigurablePayload,\n ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n} from \"../../types\";\nimport type { ActionArguments, InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport { createBuildPayload } from \"../../build\";\n\n/**\n * Payload for building a refuel instruction.\n * Automatically refuels a target address when balance drops below threshold.\n * Supports both native currency and ERC20 token refueling.\n */\nexport interface RefuelBuildPayload\n extends ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n GasLimitConfigurablePayload {\n // Target address to monitor and refuel\n target: Address;\n // Balance threshold (as hex string) that triggers refueling\n threshold: string;\n // Target balance (as hex string) to refuel to\n endBalance: string;\n}\n\nexport function createRefuelBuildPayload(\n payload: RefuelBuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = payload.token\n ? InstructionAction.RefuelERC20\n : InstructionAction.Refuel;\n\n const actionArguments: Record<string, unknown> = {\n target: payload.target,\n threshold: payload.threshold,\n endBalance: payload.endBalance,\n fee: payload.fee,\n schedule: payload.schedule,\n };\n\n if (payload.token) {\n actionArguments.token = payload.token;\n }\n\n if (payload.gasLimit !== undefined) {\n actionArguments.gasLimit = payload.gasLimit;\n }\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n", "import type {\n BaseInstructionBuildPayload,\n TokenInstructionPayload,\n} from \"../../types\";\nimport type { ActionArguments, InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport { createBuildPayload } from \"../../build\";\n\n/**\n * Payload for building a sweep deposit account instruction.\n * Automatically sweeps funds from a deposit account when balance exceeds threshold.\n * Supports both native currency and ERC20 token sweeping.\n * Note: This action does NOT support scheduling or gas limit configuration.\n */\nexport interface SweepDepositAccountBuildPayload\n extends BaseInstructionBuildPayload,\n TokenInstructionPayload {\n // Recipient address to receive the swept funds\n recipient: Address;\n // Balance threshold (as hex string) that triggers sweeping\n threshold: string;\n // Depositor address (the account being monitored)\n depositor: Address;\n}\n\nexport function createSweepDepositAccountBuildPayload(\n payload: SweepDepositAccountBuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = payload.token\n ? InstructionAction.SweepDepositAccountERC20\n : InstructionAction.SweepDepositAccount;\n\n const actionArguments: Record<string, unknown> = {\n depositor: payload.depositor,\n recipient: payload.recipient,\n threshold: payload.threshold,\n fee: payload.fee,\n };\n\n if (payload.token) {\n actionArguments.token = payload.token;\n }\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n", "import type { ScheduledInstructionBuildPayload } from \"../../types\";\nimport type { ActionArguments, InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport { createBuildPayload } from \"../../build\";\n\n/**\n * Payload for building a Uniswap V3 exact input swap instruction.\n * Swaps a specific input amount for a minimum output amount using Uniswap V3.\n */\nexport interface UniswapV3ExactInputBuildPayload\n extends ScheduledInstructionBuildPayload {\n // Input token address\n tokenIn: Address;\n // Output token address\n tokenOut: Address;\n // Fee tier for the Uniswap V3 pool (e.g., \"500\" for 0.05%, \"3000\" for 0.3%)\n feeTier: string;\n // Amount of input token to swap (as hex string)\n amountIn: string;\n // Minimum amount of output token to receive (as hex string)\n floorAmountOut: string;\n // Recipient address for the output tokens\n recipient: Address;\n // Lookback period (seconds) for mean price calculation\n meanPriceLookBack?: number;\n // Maximum price deviation in basis points (BPS)\n maxPriceDeviationBps?: number;\n}\n\nexport function createUniswapV3ExactInputBuildPayload(\n payload: UniswapV3ExactInputBuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = InstructionAction.UniswapV3ExactInput;\n\n const actionArguments: Record<string, unknown> = {\n recipient: payload.recipient,\n tokenIn: payload.tokenIn,\n tokenOut: payload.tokenOut,\n feeTier: payload.feeTier,\n amountIn: payload.amountIn,\n floorAmountOut: payload.floorAmountOut,\n meanPriceLookBack: payload.meanPriceLookBack ?? 500,\n maxPriceDeviationBps: payload.maxPriceDeviationBps ?? 500,\n schedule: payload.schedule,\n fee: payload.fee,\n };\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n", "import type {\n GasLimitConfigurablePayload,\n ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n} from \"../../types\";\nimport type { ActionArguments, InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport { createBuildPayload } from \"../../build\";\n\n/**\n * Payload for building a transfer instruction.\n * Supports both native currency and ERC20 token transfers.\n */\nexport interface TransferBuildPayload\n extends ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n GasLimitConfigurablePayload {\n // Target address to receive the transfer\n target: Address;\n // Amount to transfer (as hex string)\n value: string;\n}\n\nexport function createTransferBuildPayload(\n payload: TransferBuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = payload.token\n ? InstructionAction.TransferERC20\n : InstructionAction.Transfer;\n\n const actionArguments: Record<string, unknown> = {\n target: payload.target,\n value: payload.value,\n fee: payload.fee,\n schedule: payload.schedule,\n };\n\n if (payload.token) {\n actionArguments.token = payload.token;\n }\n\n if (payload.gasLimit !== undefined) {\n actionArguments.gasLimit = payload.gasLimit;\n }\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n", "import type { InstructionActivateRequest } from \"@otim/utils/api\";\nimport type {\n Address,\n HexString,\n InstructionAction,\n} from \"@otim/utils/schemas\";\nimport type { TypedDataDomain } from \"viem\";\n\nimport { decodeAbiParameters, keccak256, pad, toHex } from \"viem\";\n\nimport {\n createEIP2098Signature,\n parseSignatureToVRS,\n} from \"@otim/utils/helpers\";\n\nimport { buildInstructionActionArgumentsAbiMap } from \"./contracts/artifacts/abi/build-instruction-action-arguments-abi\";\nimport { eip712TypesMap } from \"./types\";\n\n/**\n * EIP-712 typed data for instruction activation signatures.\n */\nexport interface InstructionEIP712TypedData {\n domain: TypedDataDomain;\n primaryType: \"Instruction\";\n types: Record<string, Array<{ name: string; type: string }>>;\n message: {\n [key: string]: unknown; // Action-specific decoded arguments\n salt: bigint;\n maxExecutions: bigint;\n action: HexString;\n };\n}\n\n/**\n * Payload for activating an instruction with all required parameters.\n */\nexport interface InstructionActivatePayload {\n nickname?: string;\n address: Address;\n chainId: number;\n salt: HexString;\n maxExecutions: HexString;\n action: HexString;\n actionName: InstructionAction;\n arguments: HexString;\n signature: string;\n}\n\n/**\n * Configuration for creating instruction signatures.\n */\nexport interface InstructionSignatureConfig {\n delegateAddress: Address;\n chainId: number;\n}\n\n/**\n * Creates the EIP-712 domain for instruction signatures.\n * Defines the domain separator used in typed data signing.\n *\n * @param config - Configuration containing delegate address and chain ID\n * @returns TypedDataDomain object for EIP-712 signing\n */\nexport function createInstructionDomain(\n config: InstructionSignatureConfig,\n): TypedDataDomain {\n return {\n chainId: config.chainId,\n name: \"OtimDelegate\",\n salt: keccak256(toHex(\"ON_TIME_INSTRUCTED_MONEY\")),\n verifyingContract: config.delegateAddress,\n version: \"1\",\n };\n}\n\n/**\n * Decodes hex-encoded instruction parameters for EIP-712 signatures.\n * Uses action-specific ABI definitions to properly decode arguments.\n *\n * @param salt - Hex-encoded salt value for instruction uniqueness\n * @param maxExecutions - Hex-encoded maximum execution count\n * @param argumentsHex - Hex-encoded action-specific arguments\n * @param actionName - Name of the instruction action\n * @returns Decoded parameters as TypeScript primitives\n * @throws Error if action has no EIP-712 types or ABI definition\n */\nexport function decodeInstructionParameters(\n salt: HexString,\n maxExecutions: HexString,\n argumentsHex: HexString,\n actionName: InstructionAction,\n): {\n decodedSalt: bigint;\n decodedMaxExecutions: bigint;\n decodedArguments: Record<string, unknown>;\n} {\n const eip712Types = eip712TypesMap[actionName];\n const argumentsAbi =\n buildInstructionActionArgumentsAbiMap[\n actionName as unknown as keyof typeof buildInstructionActionArgumentsAbiMap\n ];\n\n if (!eip712Types) {\n throw new Error(`No EIP-712 types found for action: ${actionName}`);\n }\n\n if (!argumentsAbi) {\n throw new Error(`No arguments ABI found for action: ${actionName}`);\n }\n\n const [decodedSalt] = decodeAbiParameters(\n [eip712Types.types.Instruction[0]!],\n pad(salt),\n );\n\n const [decodedMaxExecutions] = decodeAbiParameters(\n [eip712Types.types.Instruction[1]!],\n pad(maxExecutions),\n );\n\n const decodedArgsArray = decodeAbiParameters(argumentsAbi, argumentsHex);\n\n const decodedArguments: Record<string, unknown> = {};\n argumentsAbi.forEach((param: { name: string }, index: number) => {\n decodedArguments[param.name] = decodedArgsArray[index];\n });\n\n return {\n decodedSalt: decodedSalt as bigint,\n decodedMaxExecutions: decodedMaxExecutions as bigint,\n decodedArguments,\n };\n}\n\n/**\n * Creates EIP-712 typed data for instruction activation.\n * Automatically handles ABI decoding based on action type.\n *\n * @param payload - Instruction activation payload (without signature)\n * @param config - Signature configuration for domain creation\n * @returns Complete EIP-712 typed data structure ready for signing\n * @throws Error if action has no EIP-712 type definitions\n */\nexport function createInstructionTypedData(\n payload: Omit<InstructionActivatePayload, \"signature\" | \"nickname\">,\n config: InstructionSignatureConfig,\n): InstructionEIP712TypedData {\n const { decodedSalt, decodedMaxExecutions, decodedArguments } =\n decodeInstructionParameters(\n payload.salt,\n payload.maxExecutions,\n payload.arguments,\n payload.actionName,\n );\n\n const eip712Types = eip712TypesMap[payload.actionName];\n\n if (!eip712Types) {\n throw new Error(`No EIP-712 types found for action: ${payload.actionName}`);\n }\n\n const domain = createInstructionDomain(config);\n\n return {\n domain,\n primaryType: \"Instruction\",\n types: eip712Types.types,\n message: {\n [payload.actionName]: decodedArguments,\n salt: decodedSalt,\n maxExecutions: decodedMaxExecutions,\n action: payload.action,\n },\n };\n}\n\n/**\n * Creates an activation payload with EIP-2098 signature format.\n * Converts a standard signature to the compact EIP-2098 format used by the protocol.\n *\n * @param payload - The instruction activation payload including signature\n * @returns Formatted activation request ready for API submission\n */\nexport function createActivationPayload(\n payload: InstructionActivatePayload,\n): InstructionActivateRequest {\n const vrs = parseSignatureToVRS(payload.signature);\n const primitiveSignature = createEIP2098Signature(vrs);\n\n return {\n nickname: payload.nickname,\n address: payload.address,\n chainId: payload.chainId,\n salt: payload.salt,\n maxExecutions: payload.maxExecutions,\n action: payload.action,\n arguments: payload.arguments,\n activationSignature: primitiveSignature,\n };\n}\n", "// abi parameter definitions for otim build instruction action arguments\n// @see https://abitype.dev for more information about abi typing\n\nimport type { AbiParameter } from \"abitype\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nconst targetField = {\n name: \"target\",\n type: \"address\",\n} as const satisfies AbiParameter;\n\nconst scheduleField = {\n name: \"schedule\",\n type: \"tuple\",\n components: [\n { name: \"startAt\", type: \"uint256\" },\n { name: \"startBy\", type: \"uint256\" },\n { name: \"interval\", type: \"uint256\" },\n { name: \"timeout\", type: \"uint256\" },\n ],\n} as const satisfies AbiParameter;\n\nconst tokenField = {\n name: \"token\",\n type: \"address\",\n} as const satisfies AbiParameter;\n\nconst feeField = {\n name: \"fee\",\n type: \"tuple\",\n components: [\n { name: \"token\", type: \"address\" },\n { name: \"maxBaseFeePerGas\", type: \"uint256\" },\n { name: \"maxPriorityFeePerGas\", type: \"uint256\" },\n { name: \"executionFee\", type: \"uint256\" },\n ],\n} as const satisfies AbiParameter;\n\n// instruction abi parameter definitions\n// each export represents the abi parameters for a specific instruction action\n\nexport const refuelArgumentsAbi = [\n targetField,\n { name: \"threshold\", type: \"uint256\" },\n { name: \"endBalance\", type: \"uint256\" },\n { name: \"gasLimit\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const refuelERC20ArgumentsAbi = [\n tokenField,\n targetField,\n { name: \"threshold\", type: \"uint256\" },\n { name: \"endBalance\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const transferArgumentsAbi = [\n targetField,\n { name: \"value\", type: \"uint256\" },\n { name: \"gasLimit\", type: \"uint256\" },\n scheduleField,\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const transferERC20ArgumentsAbi = [\n tokenField,\n targetField,\n { name: \"value\", type: \"uint256\" },\n scheduleField,\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const uniswapV3ExactInputArgumentsAbi = [\n { name: \"recipient\", type: \"address\" },\n { name: \"tokenIn\", type: \"address\" },\n { name: \"tokenOut\", type: \"address\" },\n { name: \"feeTier\", type: \"uint24\" },\n { name: \"amountIn\", type: \"uint256\" },\n { name: \"floorAmountOut\", type: \"uint256\" },\n { name: \"meanPriceLookBack\", type: \"uint32\" },\n { name: \"maxPriceDeviationBPS\", type: \"uint32\" },\n scheduleField,\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const sweepDepositAccountArgumentsAbi = [\n { name: \"depositor\", type: \"address\" },\n { name: \"recipient\", type: \"address\" },\n { name: \"threshold\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const sweepDepositAccountERC20ArgumentsAbi = [\n tokenField,\n { name: \"depositor\", type: \"address\" },\n { name: \"recipient\", type: \"address\" },\n { name: \"threshold\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const sweepSkipCCTPDepositAccountArgumentsAbi = [\n { name: \"depositor\", type: \"address\" },\n { name: \"destinationDomain\", type: \"uint32\" },\n { name: \"destinationMintRecipient\", type: \"bytes32\" },\n { name: \"threshold\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const deactivateInstructionArgumentsAbi = [\n { name: \"instructionId\", type: \"bytes32\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\n// Map of instruction action to its ABI parameters\nexport const buildInstructionActionArgumentsAbiMap = {\n [InstructionAction.Refuel]: refuelArgumentsAbi,\n [InstructionAction.RefuelERC20]: refuelERC20ArgumentsAbi,\n [InstructionAction.Transfer]: transferArgumentsAbi,\n [InstructionAction.TransferERC20]: transferERC20ArgumentsAbi,\n [InstructionAction.UniswapV3ExactInput]: uniswapV3ExactInputArgumentsAbi,\n [InstructionAction.SweepDepositAccount]: sweepDepositAccountArgumentsAbi,\n [InstructionAction.SweepDepositAccountERC20]:\n sweepDepositAccountERC20ArgumentsAbi,\n [InstructionAction.SweepSkipCCTPDepositAccount]:\n sweepSkipCCTPDepositAccountArgumentsAbi,\n [InstructionAction.DeactivateInstruction]: deactivateInstructionArgumentsAbi,\n} as const;\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"deactivateInstruction\", \"type\": \"DeactivateInstruction\" }\n ],\n \"DeactivateInstruction\": [\n { \"name\": \"instructionId\", \"type\": \"bytes32\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"refuelERC20\", \"type\": \"RefuelERC20\" }\n ],\n \"RefuelERC20\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"target\", \"type\": \"address\" },\n { \"name\": \"threshold\", \"type\": \"uint256\" },\n { \"name\": \"endBalance\", \"type\": \"uint256\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"refuel\", \"type\": \"Refuel\" }\n ],\n \"Refuel\": [\n { \"name\": \"target\", \"type\": \"address\" },\n { \"name\": \"threshold\", \"type\": \"uint256\" },\n { \"name\": \"endBalance\", \"type\": \"uint256\" },\n { \"name\": \"gasLimit\", \"type\": \"uint256\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"sweepCCTP\", \"type\": \"SweepCCTP\" }\n ],\n \"SweepCCTP\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"destinationDomain\", \"type\": \"uint32\" },\n { \"name\": \"destinationMintRecipient\", \"type\": \"bytes32\" },\n { \"name\": \"threshold\", \"type\": \"uint256\" },\n { \"name\": \"endBalance\", \"type\": \"uint256\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"sweepDepositAccountERC20\", \"type\": \"SweepDepositAccountERC20\" }\n ],\n \"SweepDepositAccountERC20\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"depositor\", \"type\": \"address\" },\n { \"name\": \"recipient\", \"type\": \"address\" },\n { \"name\": \"threshold\", \"type\": \"uint256\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"sweepDepositAccount\", \"type\": \"SweepDepositAccount\" }\n ],\n \"SweepDepositAccount\": [\n { \"name\": \"depositor\", \"type\": \"address\" },\n { \"name\": \"recipient\", \"type\": \"address\" },\n { \"name\": \"threshold\", \"type\": \"uint256\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"sweepERC20\", \"type\": \"SweepERC20\" }\n ],\n \"SweepERC20\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"target\", \"type\": \"address\" },\n { \"name\": \"threshold\", \"type\": \"uint256\" },\n { \"name\": \"endBalance\", \"type\": \"uint256\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n {\n \"name\": \"sweepSkipCCTPDepositAccount\",\n \"type\": \"SweepSkipCCTPDepositAccount\"\n }\n ],\n \"SweepSkipCCTPDepositAccount\": [\n { \"name\": \"depositor\", \"type\": \"address\" },\n { \"name\": \"destinationDomain\", \"type\": \"uint32\" },\n { \"name\": \"destinationMintRecipient\", \"type\": \"bytes32\" },\n { \"name\": \"threshold\", \"type\": \"uint256\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"sweepUniswapV3\", \"type\": \"SweepUniswapV3\" }\n ],\n \"SweepUniswapV3\": [\n { \"name\": \"recipient\", \"type\": \"address\" },\n { \"name\": \"tokenIn\", \"type\": \"address\" },\n { \"name\": \"tokenOut\", \"type\": \"address\" },\n { \"name\": \"feeTier\", \"type\": \"uint24\" },\n { \"name\": \"threshold\", \"type\": \"uint256\" },\n { \"name\": \"endBalance\", \"type\": \"uint256\" },\n { \"name\": \"floorAmountOut\", \"type\": \"uint256\" },\n { \"name\": \"meanPriceLookBack\", \"type\": \"uint32\" },\n { \"name\": \"maxPriceDeviationBPS\", \"type\": \"uint32\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"sweep\", \"type\": \"Sweep\" }\n ],\n \"Sweep\": [\n { \"name\": \"target\", \"type\": \"address\" },\n { \"name\": \"threshold\", \"type\": \"uint256\" },\n { \"name\": \"endBalance\", \"type\": \"uint256\" },\n { \"name\": \"gasLimit\", \"type\": \"uint256\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"transferERC20\", \"type\": \"TransferERC20\" }\n ],\n \"TransferERC20\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"target\", \"type\": \"address\" },\n { \"name\": \"value\", \"type\": \"uint256\" },\n { \"name\": \"schedule\", \"type\": \"Schedule\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Schedule\": [\n { \"name\": \"startAt\", \"type\": \"uint256\" },\n { \"name\": \"startBy\", \"type\": \"uint256\" },\n { \"name\": \"interval\", \"type\": \"uint256\" },\n { \"name\": \"timeout\", \"type\": \"uint256\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"transfer\", \"type\": \"Transfer\" }\n ],\n \"Transfer\": [\n { \"name\": \"target\", \"type\": \"address\" },\n { \"name\": \"value\", \"type\": \"uint256\" },\n { \"name\": \"gasLimit\", \"type\": \"uint256\" },\n { \"name\": \"schedule\", \"type\": \"Schedule\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Schedule\": [\n { \"name\": \"startAt\", \"type\": \"uint256\" },\n { \"name\": \"startBy\", \"type\": \"uint256\" },\n { \"name\": \"interval\", \"type\": \"uint256\" },\n { \"name\": \"timeout\", \"type\": \"uint256\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "{\n \"types\": {\n \"Instruction\": [\n { \"name\": \"salt\", \"type\": \"uint256\" },\n { \"name\": \"maxExecutions\", \"type\": \"uint256\" },\n { \"name\": \"action\", \"type\": \"address\" },\n { \"name\": \"uniswapV3ExactInput\", \"type\": \"UniswapV3ExactInput\" }\n ],\n \"UniswapV3ExactInput\": [\n { \"name\": \"recipient\", \"type\": \"address\" },\n { \"name\": \"tokenIn\", \"type\": \"address\" },\n { \"name\": \"tokenOut\", \"type\": \"address\" },\n { \"name\": \"feeTier\", \"type\": \"uint24\" },\n { \"name\": \"amountIn\", \"type\": \"uint256\" },\n { \"name\": \"floorAmountOut\", \"type\": \"uint256\" },\n { \"name\": \"meanPriceLookBack\", \"type\": \"uint32\" },\n { \"name\": \"maxPriceDeviationBPS\", \"type\": \"uint32\" },\n { \"name\": \"schedule\", \"type\": \"Schedule\" },\n { \"name\": \"fee\", \"type\": \"Fee\" }\n ],\n \"Schedule\": [\n { \"name\": \"startAt\", \"type\": \"uint256\" },\n { \"name\": \"startBy\", \"type\": \"uint256\" },\n { \"name\": \"interval\", \"type\": \"uint256\" },\n { \"name\": \"timeout\", \"type\": \"uint256\" }\n ],\n \"Fee\": [\n { \"name\": \"token\", \"type\": \"address\" },\n { \"name\": \"maxBaseFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"maxPriorityFeePerGas\", \"type\": \"uint256\" },\n { \"name\": \"executionFee\", \"type\": \"uint256\" }\n ]\n }\n}\n", "import type { Address } from \"@otim/utils/schemas\";\n\nimport deactivateInstructionTypes from \"./contracts/schemas/eip-712/actions/deactivate-instruction.json\";\nimport refuelERC20Types from \"./contracts/schemas/eip-712/actions/refuel-erc20.json\";\nimport refuelTypes from \"./contracts/schemas/eip-712/actions/refuel.json\";\nimport sweepCCTPTypes from \"./contracts/schemas/eip-712/actions/sweep-cctp.json\";\nimport sweepDepositAccountERC20Types from \"./contracts/schemas/eip-712/actions/sweep-deposit-account-erc20.json\";\nimport sweepDepositAccountTypes from \"./contracts/schemas/eip-712/actions/sweep-deposit-account.json\";\nimport sweepERC20Types from \"./contracts/schemas/eip-712/actions/sweep-erc20.json\";\nimport sweepSkipCCTPDepositAccountTypes from \"./contracts/schemas/eip-712/actions/sweep-skip-cctp-deposit-account.json\";\nimport sweepUniswapV3Types from \"./contracts/schemas/eip-712/actions/sweep-uniswap-v3.json\";\nimport sweepTypes from \"./contracts/schemas/eip-712/actions/sweep.json\";\nimport transferERC20Types from \"./contracts/schemas/eip-712/actions/transfer-erc20.json\";\nimport transferTypes from \"./contracts/schemas/eip-712/actions/transfer.json\";\nimport uniswapV3ExactInputTypes from \"./contracts/schemas/eip-712/actions/uniswap-v3-exact-input.json\";\n\n/**\n * EIP-712 types structure for instruction signatures.\n */\nexport interface EIP712Types {\n types: {\n [key: string]: Array<{ name: string; type: string }>;\n Instruction: Array<{ name: string; type: string }>;\n };\n}\n\n/**\n * Map of instruction actions to their EIP-712 type definitions.\n * Used for creating typed data structures for instruction signatures.\n *\n * @example\n * ```ts\n * const types = eip712TypesMap['transfer'];\n * ```\n */\nexport const eip712TypesMap = {\n refuel: refuelTypes,\n refuelERC20: refuelERC20Types,\n transfer: transferTypes,\n transferERC20: transferERC20Types,\n uniswapV3ExactInput: uniswapV3ExactInputTypes,\n sweep: sweepTypes,\n sweepERC20: sweepERC20Types,\n sweepCCTP: sweepCCTPTypes,\n sweepUniswapV3: sweepUniswapV3Types,\n sweepDepositAccount: sweepDepositAccountTypes,\n sweepDepositAccountERC20: sweepDepositAccountERC20Types,\n sweepSkipCCTPDepositAccount: sweepSkipCCTPDepositAccountTypes,\n deactivateInstruction: deactivateInstructionTypes,\n} as const satisfies Partial<Record<string, EIP712Types>>;\n\n/**\n * Base instruction build payload containing fields common to all instructions.\n */\nexport interface BaseInstructionBuildPayload {\n // Account address that will execute the instruction\n address: Address;\n // Chain ID where the instruction will be executed\n chainId: number;\n // Maximum number of times the instruction can be executed (0 = unlimited)\n maxExecutions: number;\n // Optional salt for uniqueness\n salt?: number;\n // Fee configuration for instruction execution\n fee: {\n executionFee: string;\n maxBaseFeePerGas: string;\n maxPriorityFeePerGas: string;\n token: Address;\n };\n}\n\n/**\n * Extended base payload for instructions that support scheduling.\n * Includes all base fields plus schedule configuration.\n */\nexport interface ScheduledInstructionBuildPayload\n extends BaseInstructionBuildPayload {\n // Schedule configuration for when and how often the instruction runs\n schedule: {\n // Unix timestamp (seconds) when instruction should start (0 = immediate)\n startAt: number;\n // Unix timestamp (seconds) by which instruction must start (0 = no deadline)\n startBy: number;\n // Interval (seconds) between executions\n interval: number;\n // Maximum latency (seconds) allowed for scheduled execution (0 = no limit)\n timeout: number;\n };\n}\n\n/**\n * Extended payload for instructions that support an optional token parameter.\n * This is typically used for ERC20 variants of actions.\n */\nexport interface TokenInstructionPayload {\n // Optional token address (if not provided, uses native currency)\n token?: Address;\n}\n\n/**\n * Extended payload for instructions that support gas limit configuration.\n * Used by actions like transfer and refuel.\n */\nexport interface GasLimitConfigurablePayload {\n // Optional gas limit for the action (0 or undefined = auto)\n gasLimit?: number;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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mB,kCAAoB,cAAc,YAAY;AAEvE,QAAM,mBAA4C,CAAC;AACnD,eAAa,QAAQ,CAAC,OAAyB,UAAkB;AAC/D,qBAAiB,MAAM,IAAI,IAAI,iBAAiB,KAAK;AAAA,EACvD,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAWO,SAAS,2BACd,SACA,QAC4B;AAC5B,QAAM,EAAE,aAAa,sBAAsB,iBAAiB,IAC1D;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAEF,QAAM,cAAc,eAAe,QAAQ,UAAU;AAErD,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI,MAAM,sCAAsC,QAAQ,UAAU,EAAE;AAAA,EAC5E;AAEA,QAAM,SAAS,wBAAwB,MAAM;AAE7C,SAAO;AAAA,IACL;AAAA,IACA,aAAa;AAAA,IACb,OAAO,YAAY;AAAA,IACnB,SAAS;AAAA,MACP,CAAC,QAAQ,UAAU,GAAG;AAAA,MACtB,MAAM;AAAA,MACN,eAAe;AAAA,MACf,QAAQ,QAAQ;AAAA,IAClB;AAAA,EACF;AACF;AASO,SAAS,wBACd,SAC4B;AAC5B,QAAM,MAAM,oBAAoB,QAAQ,SAAS;AACjD,QAAM,qBAAqB,uBAAuB,GAAG;AAErD,SAAO;AAAA,IACL,UAAU,QAAQ;AAAA,IAClB,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,IACjB,MAAM,QAAQ;AAAA,IACd,eAAe,QAAQ;AAAA,IACvB,QAAQ,QAAQ;AAAA,IAChB,WAAW,QAAQ;AAAA,IACnB,qBAAqB;AAAA,EACvB;AACF;",
|
|
6
|
-
"names": ["import_zod", "import_viem", "import_zod", "z", "TimeUnit", "import_zod", "import_viem"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.js","names":["toCamelCase","InstructionAction","InstructionAction","InstructionAction","InstructionAction","InstructionAction","InstructionAction","InstructionAction","refuelTypes","refuelERC20Types","transferTypes","transferERC20Types","uniswapV3ExactInputTypes","sweepTypes","sweepERC20Types","sweepCCTPTypes","sweepUniswapV3Types","sweepSkipCCTPDepositAccountTypes","deactivateInstructionTypes","depositERC4626Types","sweepDepositERC4626Types","withdrawERC4626Types","sweepWithdrawERC4626Types","sweepDepositAccountTypes","sweepDepositAccountERC20Types"],"sources":["../../src/instructions/constants.ts","../../src/instructions/build.ts","../../src/instructions/actions/refuel/index.ts","../../src/instructions/actions/swap/index.ts","../../src/instructions/actions/transfer/index.ts","../../src/instructions/actions/vault/index.ts","../../src/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.ts","../../src/instructions/contracts/schemas/eip-712/actions/deactivate-instruction.json","../../src/instructions/contracts/schemas/eip-712/actions/deposit-erc4626.json","../../src/instructions/contracts/schemas/eip-712/actions/refuel-erc20.json","../../src/instructions/contracts/schemas/eip-712/actions/refuel.json","../../src/instructions/contracts/schemas/eip-712/actions/sweep-cctp.json","../../src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-account-erc20.json","../../src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-account.json","../../src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-erc4626.json","../../src/instructions/contracts/schemas/eip-712/actions/sweep-erc20.json","../../src/instructions/contracts/schemas/eip-712/actions/sweep-skip-cctp-deposit-account.json","../../src/instructions/contracts/schemas/eip-712/actions/sweep-uniswap-v3.json","../../src/instructions/contracts/schemas/eip-712/actions/sweep-withdraw-erc4626.json","../../src/instructions/contracts/schemas/eip-712/actions/sweep.json","../../src/instructions/contracts/schemas/eip-712/actions/transfer-erc20.json","../../src/instructions/contracts/schemas/eip-712/actions/transfer.json","../../src/instructions/contracts/schemas/eip-712/actions/uniswap-v3-exact-input.json","../../src/instructions/contracts/schemas/eip-712/actions/withdraw-erc4626.json","../../src/instructions/types.ts","../../src/instructions/activate.ts"],"sourcesContent":["/**\n * Default interval used when none is provided (in seconds).\n */\nexport const DEFAULT_INTERVAL_SECONDS = 12;\n\n/**\n * Default API timeout for instruction operations (in milliseconds).\n */\nexport const INSTRUCTION_DEFAULT_TIMEOUT = 30000;\n","import type { InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport { parseUnits, toHex } from \"viem\";\n\nimport {\n coerceSecondsFromTimeUnitValue,\n parseDateTime,\n} from \"@otim/utils/helpers\";\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport { DEFAULT_INTERVAL_SECONDS } from \"./constants\";\n\n/**\n * Converts a PascalCase string to camelCase.\n * Example: \"TransferERC20\" -> \"transferERC20\"\n */\nfunction toCamelCase(str: string): string {\n return str.charAt(0).toLowerCase() + str.slice(1);\n}\n\n// Export base types for instruction build payloads\nexport type {\n BaseInstructionBuildPayload,\n GasLimitConfigurablePayload,\n ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n} from \"./types\";\n\n/**\n * Instruction build utilities\n *\n * Sections:\n * - Types & constants\n * - Schedule helpers\n * - Gas/Fee helpers\n * - Action-specific resolvers\n * - Build payload creator\n */\n\n// Types & constants\n/**\n * Parameters required to assemble a build payload for an instruction action.\n */\nexport interface CreateBuildPayloadParams {\n action: InstructionAction;\n address: Address;\n chainId: number;\n maxExecutions: number;\n salt?: number;\n actionArguments: InstructionBuildRequest[\"actionArguments\"][string];\n}\n\n/**\n * Build payload creator\n *\n * Creates the request body to build an instruction on the backend.\n */\nexport function createBuildPayload({\n action,\n address,\n chainId,\n maxExecutions,\n salt,\n actionArguments,\n}: CreateBuildPayloadParams): InstructionBuildRequest {\n return {\n address,\n chainId,\n maxExecutions,\n salt: salt ?? Math.floor(Math.random() * Number.MAX_SAFE_INTEGER),\n actionArguments: {\n [toCamelCase(action)]: actionArguments,\n },\n };\n}\n\n/**\n * Start specification for instruction scheduling.\n * Determines when the instruction should begin execution.\n */\nexport type ScheduleStart =\n | { type: \"datetime\"; startDate: string; startTime: string }\n | { type: \"now\" };\n\n/**\n * Repeat policy for instruction scheduling.\n * Controls how many times an instruction can execute.\n */\nexport type ScheduleRepeat =\n | { type: \"max-executions\"; maxExecutions: number }\n | { type: \"until-deactivated\" };\n\n/**\n * Advanced tuning options affecting schedule and fee behavior.\n * Provides fine-grained control over instruction execution parameters.\n */\nexport interface BuildAdvancedOptions {\n /* Maximum latency allowed for scheduled execution intervals */\n intervalLatencyLimit?: unknown;\n /* Lookback period for mean price calculation in swap operations */\n meanPriceLookBack?: unknown;\n /* Maximum allowed price deviation in basis points for swaps */\n maxPriceDeviationBps?: string | number;\n /* Maximum base fee per gas in Gwei for EIP-1559 transactions */\n maxBaseFeePerGas?: number | string;\n /* Maximum priority fee per gas in Gwei for EIP-1559 transactions */\n maxPriorityFeePerGas?: number | string;\n}\n\n/**\n * Resolves schedule start values.\n * - \"datetime\": schedules with explicit startAt timestamp (in seconds)\n * - \"now\" or omitted: starts immediately\n */\nexport const createScheduleStart = (values?: ScheduleStart) => {\n if (values && values.type === \"datetime\") {\n const date = parseDateTime(values.startDate, values.startTime);\n if (!date) throw new Error(\"Invalid start date or time\");\n return { startAt: Math.floor(date.getTime() / 1000), startBy: 0 };\n }\n return { startAt: 0, startBy: 0 };\n};\n\n/* Converts a time unit value to seconds and returns the interval field. */\nexport const createScheduleInterval = (values?: unknown) => {\n if (!values) return { interval: DEFAULT_INTERVAL_SECONDS };\n const seconds = coerceSecondsFromTimeUnitValue(values);\n return { interval: seconds || DEFAULT_INTERVAL_SECONDS };\n};\n\n/**\n * Converts a time unit value to seconds and returns the timeout field.\n * Timeout represents the maximum latency allowed for scheduled execution (0 = no limit).\n */\nexport const createScheduleIntervalLatencyLimit = (values?: unknown) => {\n if (!values) return { timeout: 0 };\n const seconds = coerceSecondsFromTimeUnitValue(values);\n return { timeout: seconds };\n};\n\n/**\n * Resolves maxExecutions based on repeat policy.\n * Returns 0 for unlimited executions when type is \"until-deactivated\".\n */\nexport const createScheduleRepeat = (values: ScheduleRepeat) => {\n if (values.type === \"max-executions\") {\n return { maxExecutions: values.maxExecutions };\n }\n return { maxExecutions: 0 };\n};\n\n/**\n * Assembles the schedule object when any schedule-related option is provided.\n */\nexport const resolveSchedule = (\n repeat: ScheduleRepeat,\n start?: ScheduleStart,\n interval?: unknown,\n advanced?: BuildAdvancedOptions,\n) => {\n const { maxExecutions } = createScheduleRepeat(repeat);\n if (!start && !interval && !advanced?.intervalLatencyLimit) {\n return { maxExecutions } as\n | { maxExecutions: number }\n | { maxExecutions: number; schedule: unknown };\n }\n\n const { startAt, startBy } = createScheduleStart(start);\n const { interval: intervalSeconds } = createScheduleInterval(interval);\n const { timeout } = createScheduleIntervalLatencyLimit(\n advanced?.intervalLatencyLimit,\n );\n\n return {\n maxExecutions,\n schedule: { interval: intervalSeconds, startBy, startAt, timeout },\n };\n};\n\n/**\n * Converts a Gwei value into Wei as a hex string. Returns 0x0 on invalid input.\n */\nexport const convertGweiToWei = (gweiValue: number | string): `0x${string}` => {\n try {\n if (isNaN(Number(gweiValue)) || Number(gweiValue) < 0) {\n throw new Error(`Invalid Gwei value: ${gweiValue}`);\n }\n const gweiString = Number(gweiValue).toFixed(18);\n return toHex(parseUnits(gweiString, 9));\n } catch {\n return toHex(0n);\n }\n};\n\n/**\n * Fee input required to resolve base fee configuration.\n * Specifies the token and amount for instruction execution fees.\n */\nexport interface BuildFeeInput {\n /* Address of the token used to pay execution fees */\n token: Address;\n /* Amount of fee to pay (optional, defaults to 0) */\n executionFee?: number | string;\n}\n\n/**\n * Builds the fee object including EIP-1559 caps and optional pricing controls.\n */\nexport const resolveFee = (\n fee: BuildFeeInput,\n advanced?: BuildAdvancedOptions,\n) => {\n const baseFee = {\n fee: {\n executionFee: 0,\n token: fee.token,\n maxBaseFeePerGas: convertGweiToWei(advanced?.maxBaseFeePerGas ?? 0),\n maxPriorityFeePerGas: convertGweiToWei(\n advanced?.maxPriorityFeePerGas ?? 0,\n ),\n },\n } as Record<string, unknown>;\n\n const additionalFields: Record<string, unknown> = {};\n if (advanced?.meanPriceLookBack) {\n additionalFields.meanPriceLookBack = coerceSecondsFromTimeUnitValue(\n advanced.meanPriceLookBack,\n );\n }\n if (advanced?.maxPriceDeviationBps) {\n const bpsValue = parseInt(String(advanced.maxPriceDeviationBps), 10);\n if (!isNaN(bpsValue)) {\n additionalFields.maxPriceDeviationBps = bpsValue;\n }\n }\n\n return { ...baseFee, ...additionalFields } as Record<string, unknown>;\n};\n\n/**\n * Some actions allow an explicit gas limit. Returns { gasLimit: 0 } when\n * needed, otherwise an empty object to keep payload minimal.\n */\nexport const resolveGasLimitIfNeeded = (action: InstructionAction) => {\n const actionsWithGasLimit: InstructionAction[] = [\n InstructionAction.Refuel,\n InstructionAction.Transfer,\n ];\n return actionsWithGasLimit.includes(action) ? { gasLimit: 0 } : {};\n};\n\n/**\n * Adds recipient field for Uniswap V3 exact input action when required.\n */\nexport const resolveRecipientForUniswapV3ExactInputIfNeeded = (\n action: InstructionAction,\n recipientAddress: Address,\n) => {\n return action === InstructionAction.UniswapV3ExactInput\n ? { recipient: recipientAddress }\n : {};\n};\n","import type {\n GasLimitConfigurablePayload,\n ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n} from \"../../types\";\nimport type { ActionArguments, InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport { createBuildPayload } from \"../../build\";\n\n/**\n * Payload for building a refuel instruction.\n * Automatically refuels a target address when balance drops below threshold.\n * Supports both native currency and ERC20 token refueling.\n */\nexport interface RefuelBuildPayload\n extends\n ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n GasLimitConfigurablePayload {\n // Target address to monitor and refuel\n target: Address;\n // Balance threshold (as hex string) that triggers refueling\n threshold: string;\n // Target balance (as hex string) to refuel to\n endBalance: string;\n}\n\nexport function createRefuelBuildPayload(\n payload: RefuelBuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = payload.token\n ? InstructionAction.RefuelERC20\n : InstructionAction.Refuel;\n\n const actionArguments: Record<string, unknown> = {\n target: payload.target,\n threshold: payload.threshold,\n endBalance: payload.endBalance,\n fee: payload.fee,\n schedule: payload.schedule,\n };\n\n if (payload.token) {\n actionArguments.token = payload.token;\n }\n\n if (payload.gasLimit !== undefined) {\n actionArguments.gasLimit = payload.gasLimit;\n }\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n","import type { ScheduledInstructionBuildPayload } from \"../../types\";\nimport type { ActionArguments, InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport { createBuildPayload } from \"../../build\";\n\n/**\n * Payload for building a Uniswap V3 exact input swap instruction.\n * Swaps a specific input amount for a minimum output amount using Uniswap V3.\n */\nexport interface UniswapV3ExactInputBuildPayload extends ScheduledInstructionBuildPayload {\n // Input token address\n tokenIn: Address;\n // Output token address\n tokenOut: Address;\n // Fee tier for the Uniswap V3 pool (e.g., \"500\" for 0.05%, \"3000\" for 0.3%)\n feeTier: string;\n // Amount of input token to swap (as hex string)\n amountIn: string;\n // Minimum amount of output token to receive (as hex string)\n floorAmountOut: string;\n // Recipient address for the output tokens\n recipient: Address;\n // Lookback period (seconds) for mean price calculation\n meanPriceLookBack?: number;\n // Maximum price deviation in basis points (BPS)\n maxPriceDeviationBps?: number;\n}\n\nexport function createUniswapV3ExactInputBuildPayload(\n payload: UniswapV3ExactInputBuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = InstructionAction.UniswapV3ExactInput;\n\n const actionArguments: Record<string, unknown> = {\n recipient: payload.recipient,\n tokenIn: payload.tokenIn,\n tokenOut: payload.tokenOut,\n feeTier: payload.feeTier,\n amountIn: payload.amountIn,\n floorAmountOut: payload.floorAmountOut,\n meanPriceLookBack: payload.meanPriceLookBack ?? 500,\n maxPriceDeviationBps: payload.maxPriceDeviationBps ?? 500,\n schedule: payload.schedule,\n fee: payload.fee,\n };\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n","import type {\n GasLimitConfigurablePayload,\n ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n} from \"../../types\";\nimport type { ActionArguments, InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport { createBuildPayload } from \"../../build\";\n\n/**\n * Payload for building a transfer instruction.\n * Supports both native currency and ERC20 token transfers.\n */\nexport interface TransferBuildPayload\n extends\n ScheduledInstructionBuildPayload,\n TokenInstructionPayload,\n GasLimitConfigurablePayload {\n // Target address to receive the transfer\n target: Address;\n // Amount to transfer (as hex string)\n value: string;\n}\n\nexport function createTransferBuildPayload(\n payload: TransferBuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = payload.token\n ? InstructionAction.TransferERC20\n : InstructionAction.Transfer;\n\n const actionArguments: Record<string, unknown> = {\n target: payload.target,\n value: payload.value,\n fee: payload.fee,\n schedule: payload.schedule,\n };\n\n if (payload.token) {\n actionArguments.token = payload.token;\n }\n\n if (payload.gasLimit !== undefined) {\n actionArguments.gasLimit = payload.gasLimit;\n }\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n","import type {\n BaseInstructionBuildPayload,\n ScheduledInstructionBuildPayload,\n} from \"../../types\";\nimport type { ActionArguments, InstructionBuildRequest } from \"@otim/utils/api\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport { createBuildPayload } from \"../../build\";\n\n/**\n * Payload for building a deposit ERC4626 instruction.\n * Deposits assets into an ERC4626 vault on a schedule.\n */\nexport interface DepositERC4626BuildPayload\n extends ScheduledInstructionBuildPayload {\n // Vault address to deposit into\n vault: Address;\n // Recipient address for the vault shares\n recipient: Address;\n // Amount to deposit (as hex string)\n value: string;\n // Minimum deposit amount (as hex string)\n minDeposit: string;\n // Minimum total shares (as hex string)\n minTotalShares: string;\n}\n\nexport function createDepositERC4626BuildPayload(\n payload: DepositERC4626BuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = InstructionAction.DepositERC4626;\n\n const actionArguments: Record<string, unknown> = {\n vault: payload.vault,\n recipient: payload.recipient,\n value: payload.value,\n minDeposit: payload.minDeposit,\n minTotalShares: payload.minTotalShares,\n schedule: payload.schedule,\n fee: payload.fee,\n };\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n\n/**\n * Payload for building a sweep deposit ERC4626 instruction.\n * Automatically sweeps and deposits funds into an ERC4626 vault when balance exceeds threshold.\n * Note: This action does NOT support scheduling.\n */\nexport interface SweepDepositERC4626BuildPayload\n extends BaseInstructionBuildPayload {\n // Vault address to deposit into\n vault: Address;\n // Recipient address for the vault shares\n recipient: Address;\n // Balance threshold (as hex string) that triggers sweeping\n threshold: string;\n // Target balance (as hex string) to sweep to\n endBalance: string;\n // Minimum deposit amount (as hex string)\n minDeposit: string;\n // Minimum total shares (as hex string)\n minTotalShares: string;\n}\n\nexport function createSweepDepositERC4626BuildPayload(\n payload: SweepDepositERC4626BuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = InstructionAction.SweepDepositERC4626;\n\n const actionArguments: Record<string, unknown> = {\n vault: payload.vault,\n recipient: payload.recipient,\n threshold: payload.threshold,\n endBalance: payload.endBalance,\n minDeposit: payload.minDeposit,\n minTotalShares: payload.minTotalShares,\n fee: payload.fee,\n };\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n\n/**\n * Payload for building a withdraw ERC4626 instruction.\n * Withdraws assets from an ERC4626 vault on a schedule.\n */\nexport interface WithdrawERC4626BuildPayload\n extends ScheduledInstructionBuildPayload {\n // Vault address to withdraw from\n vault: Address;\n // Recipient address for the withdrawn assets\n recipient: Address;\n // Amount to withdraw (as hex string)\n value: string;\n // Minimum withdraw amount (as hex string)\n minWithdraw: string;\n}\n\nexport function createWithdrawERC4626BuildPayload(\n payload: WithdrawERC4626BuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = InstructionAction.WithdrawERC4626;\n\n const actionArguments: Record<string, unknown> = {\n vault: payload.vault,\n recipient: payload.recipient,\n value: payload.value,\n minWithdraw: payload.minWithdraw,\n schedule: payload.schedule,\n fee: payload.fee,\n };\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n\n/**\n * Payload for building a sweep withdraw ERC4626 instruction.\n * Automatically sweeps and withdraws funds from an ERC4626 vault when share balance exceeds threshold.\n * Note: This action does NOT support scheduling.\n */\nexport interface SweepWithdrawERC4626BuildPayload\n extends BaseInstructionBuildPayload {\n // Vault address to withdraw from\n vault: Address;\n // Recipient address for the withdrawn assets\n recipient: Address;\n // Share threshold (as hex string) that triggers sweeping\n threshold: string;\n // Target balance (as hex string) to sweep to\n endBalance: string;\n // Minimum withdraw amount (as hex string)\n minWithdraw: string;\n}\n\nexport function createSweepWithdrawERC4626BuildPayload(\n payload: SweepWithdrawERC4626BuildPayload,\n): InstructionBuildRequest {\n const { address, chainId, maxExecutions, salt } = payload;\n\n const action = InstructionAction.SweepWithdrawERC4626;\n\n const actionArguments: Record<string, unknown> = {\n vault: payload.vault,\n recipient: payload.recipient,\n threshold: payload.threshold,\n endBalance: payload.endBalance,\n minWithdraw: payload.minWithdraw,\n fee: payload.fee,\n };\n\n return createBuildPayload({\n action,\n actionArguments: actionArguments as ActionArguments,\n address,\n chainId,\n maxExecutions,\n salt,\n });\n}\n\n","// abi parameter definitions for otim build instruction action arguments\n// @see https://abitype.dev for more information about abi typing\n\nimport type { AbiParameter } from \"abitype\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nconst targetField = {\n name: \"target\",\n type: \"address\",\n} as const satisfies AbiParameter;\n\nconst scheduleField = {\n name: \"schedule\",\n type: \"tuple\",\n components: [\n { name: \"startAt\", type: \"uint256\" },\n { name: \"startBy\", type: \"uint256\" },\n { name: \"interval\", type: \"uint256\" },\n { name: \"timeout\", type: \"uint256\" },\n ],\n} as const satisfies AbiParameter;\n\nconst tokenField = {\n name: \"token\",\n type: \"address\",\n} as const satisfies AbiParameter;\n\nconst feeField = {\n name: \"fee\",\n type: \"tuple\",\n components: [\n { name: \"token\", type: \"address\" },\n { name: \"maxBaseFeePerGas\", type: \"uint256\" },\n { name: \"maxPriorityFeePerGas\", type: \"uint256\" },\n { name: \"executionFee\", type: \"uint256\" },\n ],\n} as const satisfies AbiParameter;\n\n// instruction abi parameter definitions\n// each export represents the abi parameters for a specific instruction action\n\nexport const refuelArgumentsAbi = [\n targetField,\n { name: \"threshold\", type: \"uint256\" },\n { name: \"endBalance\", type: \"uint256\" },\n { name: \"gasLimit\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const refuelERC20ArgumentsAbi = [\n tokenField,\n targetField,\n { name: \"threshold\", type: \"uint256\" },\n { name: \"endBalance\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const transferArgumentsAbi = [\n targetField,\n { name: \"value\", type: \"uint256\" },\n { name: \"gasLimit\", type: \"uint256\" },\n scheduleField,\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const transferERC20ArgumentsAbi = [\n tokenField,\n targetField,\n { name: \"value\", type: \"uint256\" },\n scheduleField,\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const uniswapV3ExactInputArgumentsAbi = [\n { name: \"recipient\", type: \"address\" },\n { name: \"tokenIn\", type: \"address\" },\n { name: \"tokenOut\", type: \"address\" },\n { name: \"feeTier\", type: \"uint24\" },\n { name: \"amountIn\", type: \"uint256\" },\n { name: \"floorAmountOut\", type: \"uint256\" },\n { name: \"meanPriceLookBack\", type: \"uint32\" },\n { name: \"maxPriceDeviationBPS\", type: \"uint32\" },\n scheduleField,\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const sweepSkipCCTPDepositAccountArgumentsAbi = [\n { name: \"depositor\", type: \"address\" },\n { name: \"destinationDomain\", type: \"uint32\" },\n { name: \"destinationMintRecipient\", type: \"bytes32\" },\n { name: \"threshold\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const deactivateInstructionArgumentsAbi = [\n { name: \"instructionId\", type: \"bytes32\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const depositERC4626ArgumentsAbi = [\n { name: \"vault\", type: \"address\" },\n { name: \"recipient\", type: \"address\" },\n { name: \"value\", type: \"uint256\" },\n { name: \"minDeposit\", type: \"uint256\" },\n { name: \"minTotalShares\", type: \"uint256\" },\n scheduleField,\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const sweepDepositERC4626ArgumentsAbi = [\n { name: \"vault\", type: \"address\" },\n { name: \"recipient\", type: \"address\" },\n { name: \"threshold\", type: \"uint256\" },\n { name: \"endBalance\", type: \"uint256\" },\n { name: \"minDeposit\", type: \"uint256\" },\n { name: \"minTotalShares\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const withdrawERC4626ArgumentsAbi = [\n { name: \"vault\", type: \"address\" },\n { name: \"recipient\", type: \"address\" },\n { name: \"value\", type: \"uint256\" },\n { name: \"minWithdraw\", type: \"uint256\" },\n scheduleField,\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const sweepWithdrawERC4626ArgumentsAbi = [\n { name: \"vault\", type: \"address\" },\n { name: \"recipient\", type: \"address\" },\n { name: \"threshold\", type: \"uint256\" },\n { name: \"endBalance\", type: \"uint256\" },\n { name: \"minWithdraw\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const sweepDepositAccountArgumentsAbi = [\n { name: \"depositor\", type: \"address\" },\n { name: \"recipient\", type: \"address\" },\n { name: \"threshold\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\nexport const sweepDepositAccountERC20ArgumentsAbi = [\n tokenField,\n { name: \"depositor\", type: \"address\" },\n { name: \"recipient\", type: \"address\" },\n { name: \"threshold\", type: \"uint256\" },\n feeField,\n] as const satisfies readonly AbiParameter[];\n\n/* Map of instruction action to its ABI parameters */\n// Map of instruction action to its ABI parameters\nexport const buildInstructionActionArgumentsAbiMap = {\n [InstructionAction.Refuel]: refuelArgumentsAbi,\n [InstructionAction.RefuelERC20]: refuelERC20ArgumentsAbi,\n [InstructionAction.Transfer]: transferArgumentsAbi,\n [InstructionAction.TransferERC20]: transferERC20ArgumentsAbi,\n [InstructionAction.UniswapV3ExactInput]: uniswapV3ExactInputArgumentsAbi,\n [InstructionAction.SweepSkipCCTPDepositAccount]:\n sweepSkipCCTPDepositAccountArgumentsAbi,\n [InstructionAction.DeactivateInstruction]: deactivateInstructionArgumentsAbi,\n [InstructionAction.DepositERC4626]: depositERC4626ArgumentsAbi,\n [InstructionAction.SweepDepositERC4626]: sweepDepositERC4626ArgumentsAbi,\n [InstructionAction.WithdrawERC4626]: withdrawERC4626ArgumentsAbi,\n [InstructionAction.SweepWithdrawERC4626]: sweepWithdrawERC4626ArgumentsAbi,\n [InstructionAction.SweepDepositAccount]: sweepDepositAccountArgumentsAbi,\n [InstructionAction.SweepDepositAccountERC20]:\n sweepDepositAccountERC20ArgumentsAbi,\n} as const;\n","","","","","","","","","","","","","","","","","","import type { Address } from \"@otim/utils/schemas\";\n\nimport { InstructionAction } from \"@otim/utils/schemas\";\n\nimport deactivateInstructionTypes from \"./contracts/schemas/eip-712/actions/deactivate-instruction.json\";\nimport depositERC4626Types from \"./contracts/schemas/eip-712/actions/deposit-erc4626.json\";\nimport refuelERC20Types from \"./contracts/schemas/eip-712/actions/refuel-erc20.json\";\nimport refuelTypes from \"./contracts/schemas/eip-712/actions/refuel.json\";\nimport sweepCCTPTypes from \"./contracts/schemas/eip-712/actions/sweep-cctp.json\";\nimport sweepDepositAccountERC20Types from \"./contracts/schemas/eip-712/actions/sweep-deposit-account-erc20.json\";\nimport sweepDepositAccountTypes from \"./contracts/schemas/eip-712/actions/sweep-deposit-account.json\";\nimport sweepDepositERC4626Types from \"./contracts/schemas/eip-712/actions/sweep-deposit-erc4626.json\";\nimport sweepERC20Types from \"./contracts/schemas/eip-712/actions/sweep-erc20.json\";\nimport sweepSkipCCTPDepositAccountTypes from \"./contracts/schemas/eip-712/actions/sweep-skip-cctp-deposit-account.json\";\nimport sweepUniswapV3Types from \"./contracts/schemas/eip-712/actions/sweep-uniswap-v3.json\";\nimport sweepWithdrawERC4626Types from \"./contracts/schemas/eip-712/actions/sweep-withdraw-erc4626.json\";\nimport sweepTypes from \"./contracts/schemas/eip-712/actions/sweep.json\";\nimport transferERC20Types from \"./contracts/schemas/eip-712/actions/transfer-erc20.json\";\nimport transferTypes from \"./contracts/schemas/eip-712/actions/transfer.json\";\nimport uniswapV3ExactInputTypes from \"./contracts/schemas/eip-712/actions/uniswap-v3-exact-input.json\";\nimport withdrawERC4626Types from \"./contracts/schemas/eip-712/actions/withdraw-erc4626.json\";\n\n/* EIP-712 types structure for instruction signatures. */\nexport interface EIP712Types {\n types: {\n [key: string]: Array<{ name: string; type: string }>;\n Instruction: Array<{ name: string; type: string }>;\n };\n}\n\n/**\n * Map of instruction actions to their EIP-712 type definitions.\n * Used for creating typed data structures for instruction signatures.\n */\nexport const eip712TypesMap = {\n [InstructionAction.Refuel]: refuelTypes,\n [InstructionAction.RefuelERC20]: refuelERC20Types,\n [InstructionAction.Transfer]: transferTypes,\n [InstructionAction.TransferERC20]: transferERC20Types,\n [InstructionAction.UniswapV3ExactInput]: uniswapV3ExactInputTypes,\n [InstructionAction.Sweep]: sweepTypes,\n [InstructionAction.SweepERC20]: sweepERC20Types,\n [InstructionAction.SweepCCTP]: sweepCCTPTypes,\n [InstructionAction.SweepUniswapV3]: sweepUniswapV3Types,\n [InstructionAction.SweepSkipCCTPDepositAccount]: sweepSkipCCTPDepositAccountTypes,\n [InstructionAction.DeactivateInstruction]: deactivateInstructionTypes,\n [InstructionAction.DepositERC4626]: depositERC4626Types,\n [InstructionAction.SweepDepositERC4626]: sweepDepositERC4626Types,\n [InstructionAction.WithdrawERC4626]: withdrawERC4626Types,\n [InstructionAction.SweepWithdrawERC4626]: sweepWithdrawERC4626Types,\n [InstructionAction.SweepDepositAccount]: sweepDepositAccountTypes,\n [InstructionAction.SweepDepositAccountERC20]: sweepDepositAccountERC20Types,\n} as const satisfies Partial<Record<string, EIP712Types>>;\n\n/**\n * Base instruction build payload containing fields common to all instructions.\n */\nexport interface BaseInstructionBuildPayload {\n // Account address that will execute the instruction\n address: Address;\n // Chain ID where the instruction will be executed\n chainId: number;\n // Maximum number of times the instruction can be executed (0 = unlimited)\n maxExecutions: number;\n // Optional salt for uniqueness\n salt?: number;\n // Fee configuration for instruction execution\n fee: {\n executionFee: string;\n maxBaseFeePerGas: string;\n maxPriorityFeePerGas: string;\n token: Address;\n };\n}\n\n/**\n * Extended base payload for instructions that support scheduling.\n * Includes all base fields plus schedule configuration.\n */\nexport interface ScheduledInstructionBuildPayload extends BaseInstructionBuildPayload {\n // Schedule configuration for when and how often the instruction runs\n schedule: {\n // Unix timestamp (seconds) when instruction should start (0 = immediate)\n startAt: number;\n // Unix timestamp (seconds) by which instruction must start (0 = no deadline)\n startBy: number;\n // Interval (seconds) between executions\n interval: number;\n // Maximum latency (seconds) allowed for scheduled execution (0 = no limit)\n timeout: number;\n };\n}\n\n/**\n * Extended payload for instructions that support an optional token parameter.\n * This is typically used for ERC20 variants of actions.\n */\nexport interface TokenInstructionPayload {\n // Optional token address (if not provided, uses native currency)\n token?: Address;\n}\n\n/**\n * Extended payload for instructions that support gas limit configuration.\n * Used by actions like transfer and refuel.\n */\nexport interface GasLimitConfigurablePayload {\n // Optional gas limit for the action (0 or undefined = auto)\n gasLimit?: number;\n}\n","import type { InstructionActivateRequest } from \"@otim/utils/api\";\nimport type { Address, HexString } from \"@otim/utils/schemas\";\nimport type { TypedDataDomain } from \"viem\";\n\nimport { decodeAbiParameters, keccak256, pad, toHex } from \"viem\";\n\nimport {\n createEIP2098Signature,\n parseSignatureToVRS,\n} from \"@otim/utils/helpers\";\n\nimport { buildInstructionActionArgumentsAbiMap } from \"./contracts/artifacts/abi/build-instruction-action-arguments-abi\";\nimport { eip712TypesMap } from \"./types\";\n\n/**\n * Converts a PascalCase string to camelCase.\n * Example: \"TransferERC20\" -> \"transferERC20\"\n */\nexport function toCamelCase(str: string): string {\n return str.charAt(0).toLowerCase() + str.slice(1);\n}\n\n/**\n * Converts a camelCase string to PascalCase.\n * Example: \"transferERC20\" -> \"TransferERC20\"\n */\nfunction toPascalCase(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n/**\n * PascalCase instruction actions that have EIP-712 type definitions.\n */\ntype EIP712SupportedAction = keyof typeof eip712TypesMap;\n\n/**\n * CamelCase version of InstructionAction for EIP-712 typed data.\n * Only includes actions that have EIP-712 type definitions.\n */\nexport type InstructionActionCamelCase =\n | \"refuel\"\n | \"refuelERC20\"\n | \"transfer\"\n | \"transferERC20\"\n | \"uniswapV3ExactInput\"\n | \"sweep\"\n | \"sweepERC20\"\n | \"sweepCCTP\"\n | \"sweepUniswapV3\"\n | \"deactivateInstruction\"\n | \"sweepSkipCCTPDepositAccount\"\n | \"depositERC4626\"\n | \"sweepDepositERC4626\"\n | \"withdrawERC4626\"\n | \"sweepWithdrawERC4626\"\n | \"sweepDepositAccount\"\n | \"sweepDepositAccountERC20\";\n\n/**\n * EIP-712 typed data for instruction activation signatures.\n */\nexport interface InstructionEIP712TypedData {\n domain: TypedDataDomain;\n primaryType: \"Instruction\";\n types: Record<string, Array<{ name: string; type: string }>>;\n message: {\n [key: string]: unknown; // Action-specific decoded arguments\n salt: bigint;\n maxExecutions: bigint;\n action: HexString;\n };\n}\n\n/**\n * Payload for activating an instruction with all required parameters.\n */\nexport interface InstructionActivatePayload {\n nickname?: string;\n address: Address;\n chainId: number;\n salt: HexString;\n maxExecutions: HexString;\n action: HexString;\n actionName: InstructionActionCamelCase;\n arguments: HexString;\n signature: string;\n}\n\n/**\n * Configuration for creating instruction signatures.\n */\nexport interface InstructionSignatureConfig {\n delegateAddress: Address;\n chainId: number;\n}\n\n/**\n * Creates the EIP-712 domain for instruction signatures.\n * Defines the domain separator used in typed data signing.\n *\n * @param config - Configuration containing delegate address and chain ID\n * @returns TypedDataDomain object for EIP-712 signing\n */\nexport function createInstructionDomain(\n config: InstructionSignatureConfig,\n): TypedDataDomain {\n return {\n chainId: config.chainId,\n name: \"OtimDelegate\",\n salt: keccak256(toHex(\"ON_TIME_INSTRUCTED_MONEY\")),\n verifyingContract: config.delegateAddress,\n version: \"1\",\n };\n}\n\n/**\n * Decodes hex-encoded instruction parameters for EIP-712 signatures.\n * Uses action-specific ABI definitions to properly decode arguments.\n *\n * @param salt - Hex-encoded salt value for instruction uniqueness\n * @param maxExecutions - Hex-encoded maximum execution count\n * @param argumentsHex - Hex-encoded action-specific arguments\n * @param actionName - Name of the instruction action (camelCase)\n * @returns Decoded parameters as TypeScript primitives\n * @throws Error if action has no EIP-712 types or ABI definition\n */\nexport function decodeInstructionParameters(\n salt: HexString,\n maxExecutions: HexString,\n argumentsHex: HexString,\n actionName: InstructionActionCamelCase,\n): {\n decodedSalt: bigint;\n decodedMaxExecutions: bigint;\n decodedArguments: Record<string, unknown>;\n} {\n const pascalCaseActionName = toPascalCase(actionName) as EIP712SupportedAction;\n const eip712Types = eip712TypesMap[pascalCaseActionName];\n const argumentsAbi =\n buildInstructionActionArgumentsAbiMap[\n pascalCaseActionName as keyof typeof buildInstructionActionArgumentsAbiMap\n ];\n\n if (!eip712Types) {\n throw new Error(`No EIP-712 types found for action: ${actionName}`);\n }\n\n if (!argumentsAbi) {\n throw new Error(`No arguments ABI found for action: ${actionName}`);\n }\n\n const [decodedSalt] = decodeAbiParameters(\n [eip712Types.types.Instruction[0]!],\n pad(salt),\n );\n\n const [decodedMaxExecutions] = decodeAbiParameters(\n [eip712Types.types.Instruction[1]!],\n pad(maxExecutions),\n );\n\n const decodedArgsArray = decodeAbiParameters(argumentsAbi, argumentsHex);\n\n const decodedArguments: Record<string, unknown> = {};\n argumentsAbi.forEach((param: { name: string }, index: number) => {\n decodedArguments[param.name] = decodedArgsArray[index];\n });\n\n return {\n decodedSalt: decodedSalt as bigint,\n decodedMaxExecutions: decodedMaxExecutions as bigint,\n decodedArguments,\n };\n}\n\n/**\n * Creates EIP-712 typed data for instruction activation.\n * Automatically handles ABI decoding based on action type.\n *\n * @param payload - Instruction activation payload (without signature)\n * @param config - Signature configuration for domain creation\n * @returns Complete EIP-712 typed data structure ready for signing\n * @throws Error if action has no EIP-712 type definitions\n */\nexport function createInstructionTypedData(\n payload: Omit<InstructionActivatePayload, \"signature\" | \"nickname\">,\n config: InstructionSignatureConfig,\n): InstructionEIP712TypedData {\n const { decodedSalt, decodedMaxExecutions, decodedArguments } =\n decodeInstructionParameters(\n payload.salt,\n payload.maxExecutions,\n payload.arguments,\n payload.actionName,\n );\n\n const pascalCaseActionName = toPascalCase(payload.actionName) as EIP712SupportedAction;\n const eip712Types = eip712TypesMap[pascalCaseActionName];\n\n if (!eip712Types) {\n throw new Error(`No EIP-712 types found for action: ${payload.actionName}`);\n }\n\n const domain = createInstructionDomain(config);\n\n return {\n domain,\n primaryType: \"Instruction\",\n types: eip712Types.types,\n message: {\n [payload.actionName]: decodedArguments,\n salt: decodedSalt,\n maxExecutions: decodedMaxExecutions,\n action: payload.action,\n },\n };\n}\n\n/**\n * Creates an activation payload with EIP-2098 signature format.\n * Converts a standard signature to the compact EIP-2098 format used by the protocol.\n *\n * @param payload - The instruction activation payload including signature\n * @returns Formatted activation request ready for API submission\n */\nexport function createActivationPayload(\n payload: InstructionActivatePayload,\n): InstructionActivateRequest {\n const vrs = parseSignatureToVRS(payload.signature);\n const primitiveSignature = createEIP2098Signature(vrs);\n\n return {\n nickname: payload.nickname,\n address: payload.address,\n chainId: payload.chainId,\n salt: payload.salt,\n maxExecutions: payload.maxExecutions,\n action: payload.action,\n arguments: payload.arguments,\n activationSignature: primitiveSignature,\n };\n}\n"],"mappings":";;;;;;;;;AAGA,MAAa,2BAA2B;;;;AAKxC,MAAa,8BAA8B;;;;;;;;ACS3C,SAASA,cAAY,KAAqB;AACxC,QAAO,IAAI,OAAO,EAAE,CAAC,aAAa,GAAG,IAAI,MAAM,EAAE;;;;;;;AAwCnD,SAAgB,mBAAmB,EACjC,QACA,SACA,SACA,eACA,MACA,mBACoD;AACpD,QAAO;EACL;EACA;EACA;EACA,MAAM,QAAQ,KAAK,MAAM,KAAK,QAAQ,GAAG,OAAO,iBAAiB;EACjE,iBAAiB,GACdA,cAAY,OAAO,GAAG,iBACxB;EACF;;;;;;;AAyCH,MAAa,uBAAuB,WAA2B;AAC7D,KAAI,UAAU,OAAO,SAAS,YAAY;EACxC,MAAM,8CAAqB,OAAO,WAAW,OAAO,UAAU;AAC9D,MAAI,CAAC,KAAM,OAAM,IAAI,MAAM,6BAA6B;AACxD,SAAO;GAAE,SAAS,KAAK,MAAM,KAAK,SAAS,GAAG,IAAK;GAAE,SAAS;GAAG;;AAEnE,QAAO;EAAE,SAAS;EAAG,SAAS;EAAG;;AAInC,MAAa,0BAA0B,WAAqB;AAC1D,KAAI,CAAC,OAAQ,QAAO,EAAE,UAAU,0BAA0B;AAE1D,QAAO,EAAE,kEADsC,OAAO,IACxB,0BAA0B;;;;;;AAO1D,MAAa,sCAAsC,WAAqB;AACtE,KAAI,CAAC,OAAQ,QAAO,EAAE,SAAS,GAAG;AAElC,QAAO,EAAE,iEADsC,OAAO,EAC3B;;;;;;AAO7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