@symmio/trading-core 4.2.1 → 4.4.0
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/core/chains/registry.d.ts.map +1 -1
- package/dist/core/chains/registry.js +4 -5
- package/dist/core/chains/registry.js.map +1 -1
- package/dist/core/chains/types.d.ts +36 -1
- package/dist/core/chains/types.d.ts.map +1 -1
- package/dist/core/chains/types.js.map +1 -1
- package/dist/core/config/merge-chain-config.js +6 -3
- package/dist/core/config/merge-chain-config.js.map +1 -1
- package/dist/gasless/batch/calls.d.ts +21 -7
- package/dist/gasless/batch/calls.d.ts.map +1 -1
- package/dist/gasless/batch/calls.js +17 -16
- package/dist/gasless/batch/calls.js.map +1 -1
- package/dist/gasless/batch/resolve-gasless-batch.d.ts +10 -1
- package/dist/gasless/batch/resolve-gasless-batch.d.ts.map +1 -1
- package/dist/gasless/batch/resolve-gasless-batch.js +17 -15
- package/dist/gasless/batch/resolve-gasless-batch.js.map +1 -1
- package/dist/gasless/classify-gasless-failure.d.ts +3 -1
- package/dist/gasless/classify-gasless-failure.d.ts.map +1 -1
- package/dist/gasless/classify-gasless-failure.js +10 -10
- package/dist/gasless/classify-gasless-failure.js.map +1 -1
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js +5 -5
- package/dist/gasless/constants.d.ts +21 -0
- package/dist/gasless/constants.d.ts.map +1 -1
- package/dist/gasless/constants.js +2 -2
- package/dist/gasless/constants.js.map +1 -1
- package/dist/gasless/delegation-preflight.js +10 -10
- package/dist/gasless/deployment-key.d.ts +39 -0
- package/dist/gasless/deployment-key.d.ts.map +1 -0
- package/dist/gasless/deployment-key.js +22 -0
- package/dist/gasless/deployment-key.js.map +1 -0
- package/dist/gasless/dispatch/attempt-start.d.ts +31 -0
- package/dist/gasless/dispatch/attempt-start.d.ts.map +1 -0
- package/dist/gasless/dispatch/attempt-start.js +14 -0
- package/dist/gasless/dispatch/attempt-start.js.map +1 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts +4 -43
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts.map +1 -1
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js +24 -182
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js.map +1 -1
- package/dist/gasless/dispatch/resolve-gasless-write.d.ts +40 -0
- package/dist/gasless/dispatch/resolve-gasless-write.d.ts.map +1 -0
- package/dist/gasless/dispatch/resolve-gasless-write.js +48 -0
- package/dist/gasless/dispatch/resolve-gasless-write.js.map +1 -0
- package/dist/gasless/dispatch/submit-gasless-write.d.ts +11 -0
- package/dist/gasless/dispatch/submit-gasless-write.d.ts.map +1 -0
- package/dist/gasless/dispatch/submit-gasless-write.js +180 -0
- package/dist/gasless/dispatch/submit-gasless-write.js.map +1 -0
- package/dist/gasless/dispatch/types.d.ts +42 -0
- package/dist/gasless/dispatch/types.d.ts.map +1 -0
- package/dist/gasless/effective-instant-selectors.d.ts +11 -0
- package/dist/gasless/effective-instant-selectors.d.ts.map +1 -0
- package/dist/gasless/effective-instant-selectors.js +25 -0
- package/dist/gasless/effective-instant-selectors.js.map +1 -0
- package/dist/gasless/fallback.d.ts +43 -0
- package/dist/gasless/fallback.d.ts.map +1 -1
- package/dist/gasless/fallback.js +27 -17
- package/dist/gasless/fallback.js.map +1 -1
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts +13 -5
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts.map +1 -1
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js +88 -81
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js.map +1 -1
- package/dist/gasless/get-session-key-selectors.d.ts +18 -4
- package/dist/gasless/get-session-key-selectors.d.ts.map +1 -1
- package/dist/gasless/get-session-key-selectors.js +20 -12
- package/dist/gasless/get-session-key-selectors.js.map +1 -1
- package/dist/gasless/http.d.ts +7 -7
- package/dist/gasless/http.d.ts.map +1 -1
- package/dist/gasless/http.js +70 -72
- package/dist/gasless/http.js.map +1 -1
- package/dist/gasless/idempotency-key.d.ts +33 -0
- package/dist/gasless/idempotency-key.d.ts.map +1 -0
- package/dist/gasless/idempotency-key.js +15 -0
- package/dist/gasless/idempotency-key.js.map +1 -0
- package/dist/gasless/index.d.ts +2 -0
- package/dist/gasless/index.d.ts.map +1 -1
- package/dist/gasless/nonce-lock.d.ts +55 -17
- package/dist/gasless/nonce-lock.d.ts.map +1 -1
- package/dist/gasless/nonce-lock.js +53 -26
- package/dist/gasless/nonce-lock.js.map +1 -1
- package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.d.ts +30 -0
- package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.js +67 -0
- package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts +30 -9
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts.map +1 -1
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js +99 -102
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js.map +1 -1
- package/dist/gasless/relay-gasless-batch/resolve-batch-signers.d.ts +18 -0
- package/dist/gasless/relay-gasless-batch/resolve-batch-signers.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/resolve-batch-signers.js +17 -0
- package/dist/gasless/relay-gasless-batch/resolve-batch-signers.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts +8 -5
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts.map +1 -1
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js +22 -16
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js.map +1 -1
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts +13 -7
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts.map +1 -1
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js +46 -36
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js.map +1 -1
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts +14 -15
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts.map +1 -1
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js +12 -11
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js.map +1 -1
- package/dist/gasless/relayable-writes.d.ts.map +1 -1
- package/dist/gasless/relayable-writes.js +28 -0
- package/dist/gasless/relayable-writes.js.map +1 -1
- package/dist/gasless/request-headers.d.ts +7 -0
- package/dist/gasless/request-headers.d.ts.map +1 -0
- package/dist/gasless/request-headers.js +34 -0
- package/dist/gasless/request-headers.js.map +1 -0
- package/dist/gasless/resolve-wallet-identities.js +4 -4
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts +11 -4
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts.map +1 -1
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js +2 -2
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js.map +1 -1
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts +10 -14
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts.map +1 -1
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js +3 -2
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js.map +1 -1
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts +15 -15
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts.map +1 -1
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js +13 -12
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js.map +1 -1
- package/dist/gasless/unconfirmed-submit.d.ts +12 -8
- package/dist/gasless/unconfirmed-submit.d.ts.map +1 -1
- package/dist/gasless/unconfirmed-submit.js +1 -1
- package/dist/gasless/unconfirmed-submit.js.map +1 -1
- package/dist/index.d.ts +26 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +673 -615
- package/dist/shared/errors/symm-error.js +3 -3
- package/dist/shared/types/properties.d.ts +45 -8
- package/dist/shared/types/properties.d.ts.map +1 -1
- package/dist/solvers/capabilities.d.ts.map +1 -1
- package/dist/solvers/capabilities.js +4 -2
- package/dist/solvers/capabilities.js.map +1 -1
- package/dist/solvers/estimated-price/get-estimated-price.d.ts +3 -1
- package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -1
- package/dist/solvers/estimated-price/get-estimated-price.js +6 -6
- package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -1
- package/dist/solvers/estimated-price/to-estimated-price.d.ts +2 -1
- package/dist/solvers/estimated-price/to-estimated-price.d.ts.map +1 -1
- package/dist/solvers/estimated-price/to-estimated-price.js +4 -1
- package/dist/solvers/estimated-price/to-estimated-price.js.map +1 -1
- package/dist/solvers/force-close/force-close-auto.d.ts.map +1 -1
- package/dist/solvers/force-close/force-close-auto.js +70 -69
- package/dist/solvers/force-close/force-close-auto.js.map +1 -1
- package/dist/solvers/get-error-message/get-error-message.js +4 -4
- package/dist/solvers/get-party-a-upnl/get-party-a-upnl.js +4 -4
- package/dist/solvers/get-solver-balance-info/get-solver-balance-info.js +4 -4
- package/dist/solvers/get-solver-info/get-solver-info.d.ts +5 -2
- package/dist/solvers/get-solver-info/get-solver-info.d.ts.map +1 -1
- package/dist/solvers/get-solver-info/get-solver-info.js +14 -12
- package/dist/solvers/get-solver-info/get-solver-info.js.map +1 -1
- package/dist/solvers/get-solver-info/parse-timelock-info.d.ts +5 -0
- package/dist/solvers/get-solver-info/parse-timelock-info.d.ts.map +1 -0
- package/dist/solvers/get-solver-info/parse-timelock-info.js +27 -0
- package/dist/solvers/get-solver-info/parse-timelock-info.js.map +1 -0
- package/dist/solvers/get-solver-open-interest/get-solver-open-interest.js +4 -4
- package/dist/solvers/get-solver-price-range/get-solver-price-range.js +4 -4
- package/dist/solvers/get-solver-readiness/get-solver-readiness.js +4 -4
- package/dist/solvers/instant-open/get-instant-opens/adapters/enigma-instant-opens.js +17 -17
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts +8 -7
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +43 -39
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.d.ts +16 -0
- package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.d.ts.map +1 -0
- package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.js +92 -0
- package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.js.map +1 -0
- package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js +1 -1
- package/dist/solvers/instant-open/instant-open/index.d.ts +2 -0
- package/dist/solvers/instant-open/instant-open/index.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/instant-open.d.ts +22 -6
- package/dist/solvers/instant-open/instant-open/instant-open.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/instant-open.js +35 -27
- package/dist/solvers/instant-open/instant-open/instant-open.js.map +1 -1
- package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.d.ts +12 -0
- package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.d.ts.map +1 -0
- package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.js +49 -0
- package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.js.map +1 -0
- package/dist/solvers/instant-open/instant-open/prepared/types.d.ts +20 -0
- package/dist/solvers/instant-open/instant-open/prepared/types.d.ts.map +1 -0
- package/dist/solvers/instant-open/instant-open/types.d.ts +5 -4
- package/dist/solvers/instant-open/instant-open/types.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/hedger-api.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/hedger-api.js +38 -26
- package/dist/solvers/instant-open/shared/hedger-api.js.map +1 -1
- package/dist/solvers/markets/adapters/enigma-markets.js +34 -34
- package/dist/solvers/notional-cap/get-notional-cap-page.js +4 -4
- package/dist/solvers/revenue/get-solver-revenue.js +10 -10
- package/dist/solvers/revenue-records/get-revenue-records.js +11 -11
- package/dist/solvers/symbols/get-symbols.js +13 -13
- package/dist/solvers/trade-volume/get-trade-volume.js +10 -10
- package/dist/solvers/types/generated/enigma-solver.d.ts +1 -0
- package/dist/solvers/types/generated/enigma-solver.d.ts.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts +46 -0
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js +53 -0
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.js +41 -27
- package/dist/symmio-contracts/account-layer/actions/add-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts +23 -9
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js +15 -36
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js +40 -26
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js +18 -37
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.d.ts +46 -0
- package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.js +20 -0
- package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.js.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.d.ts +31 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.js +15 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.d.ts +54 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.js +26 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js +50 -32
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.js +10 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.js.map +1 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.js +13 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.js +10 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.js.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/query.js +13 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js +9 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/query.js +13 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.js +16 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js +22 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/query.d.ts +22 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/query.js +21 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.js +22 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.d.ts +13 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.js +17 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.js +67 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.d.ts +21 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.js +21 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.d.ts +15 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.js +17 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.js.map +1 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/hook-metadata.d.ts +47 -0
- package/dist/symmio-contracts/account-layer/hook-metadata.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/hook-metadata.js +30 -0
- package/dist/symmio-contracts/account-layer/hook-metadata.js.map +1 -0
- package/dist/symmio-contracts/account-layer/index.d.ts +21 -0
- package/dist/symmio-contracts/account-layer/index.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.d.ts +14 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.js +17 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.js.map +1 -0
- package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-account-balance-info.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-account-balance-of.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.d.ts +43 -0
- package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.js +31 -0
- package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.js.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-affiliate-state.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-sub-account-virtual-nonce.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-sub-accounts-count-of-user.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts-addresses.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-addresses-of-sub-account.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.d.ts +39 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.js +29 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.d.ts +39 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.js +31 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/query/predict-next-virtual-account.js +6 -6
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.d.ts +19 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js +10 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.js +13 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.js +10 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.js.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/query.js +13 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.d.ts +13 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.js +18 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.js.map +1 -0
- package/dist/symmio-contracts/account-layer/timelock-selector.d.ts +4 -0
- package/dist/symmio-contracts/account-layer/timelock-selector.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/timelock-selector.js +9 -0
- package/dist/symmio-contracts/account-layer/timelock-selector.js.map +1 -0
- package/dist/symmio-contracts/account-layer/timelock-test.d.ts +7 -0
- package/dist/symmio-contracts/account-layer/timelock-test.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/timelock-types.d.ts +66 -0
- package/dist/symmio-contracts/account-layer/timelock-types.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/types.d.ts +32 -2
- package/dist/symmio-contracts/account-layer/types.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/types.js.map +1 -1
- package/dist/symmio-contracts/account-layer/write-timelock.d.ts +10 -0
- package/dist/symmio-contracts/account-layer/write-timelock.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/write-timelock.js +51 -0
- package/dist/symmio-contracts/account-layer/write-timelock.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +4 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +42 -38
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegations.d.ts +75 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegations.js +46 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.d.ts +32 -0
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.js +18 -0
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/grant-delegations-input.d.ts +33 -0
- package/dist/symmio-contracts/instant-layer/grant-delegations-input.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/grant-delegations-input.js +18 -0
- package/dist/symmio-contracts/instant-layer/grant-delegations-input.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts +4 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/query/grant-delegations.d.ts +22 -0
- package/dist/symmio-contracts/instant-layer/query/grant-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/grant-delegations.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/grant-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.d.ts +19 -0
- package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts +3 -0
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js +22 -16
- package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.d.ts +74 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.js +36 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts +3 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js +32 -29
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +3 -0
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +37 -28
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +3 -0
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js +30 -20
- package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +5 -0
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +31 -18
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts +4 -0
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js +30 -25
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +4 -0
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.js +12 -8
- package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.d.ts +48 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.js +33 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.js.map +1 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/query.d.ts +23 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/query.js +12 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.d.ts +22 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.js +14 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.d.ts +34 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.js +21 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.d.ts +34 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.js +35 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.d.ts +15 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.js +20 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.d.ts +22 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.js +30 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.d.ts +30 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.js +15 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.d.ts +38 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.js +24 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/index.d.ts +6 -0
- package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +35 -34
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
- package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.d.ts +18 -0
- package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.js +14 -0
- package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.js.map +1 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.d.ts +18 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.js +12 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-subgraph/executeSubgraphRequest.js +3 -3
- package/dist/timelock/approval.d.ts +142 -0
- package/dist/timelock/approval.d.ts.map +1 -0
- package/dist/timelock/approval.js +176 -0
- package/dist/timelock/approval.js.map +1 -0
- package/dist/timelock/attempt-outcome.d.ts +37 -0
- package/dist/timelock/attempt-outcome.d.ts.map +1 -0
- package/dist/timelock/attempt-outcome.js +70 -0
- package/dist/timelock/attempt-outcome.js.map +1 -0
- package/dist/timelock/confirm-write.d.ts +5 -0
- package/dist/timelock/confirm-write.d.ts.map +1 -0
- package/dist/timelock/confirm-write.js +18 -0
- package/dist/timelock/confirm-write.js.map +1 -0
- package/dist/timelock/early-withdraw/early-withdraw.d.ts +60 -0
- package/dist/timelock/early-withdraw/early-withdraw.d.ts.map +1 -0
- package/dist/timelock/early-withdraw/early-withdraw.js +94 -0
- package/dist/timelock/early-withdraw/early-withdraw.js.map +1 -0
- package/dist/timelock/early-withdraw/index.d.ts +2 -0
- package/dist/timelock/early-withdraw/index.d.ts.map +1 -0
- package/dist/timelock/errors.d.ts +23 -0
- package/dist/timelock/errors.d.ts.map +1 -0
- package/dist/timelock/errors.js +29 -0
- package/dist/timelock/errors.js.map +1 -0
- package/dist/timelock/execute-protected-batch.d.ts +31 -0
- package/dist/timelock/execute-protected-batch.d.ts.map +1 -0
- package/dist/timelock/execute-protected-batch.js +148 -0
- package/dist/timelock/execute-protected-batch.js.map +1 -0
- package/dist/timelock/execute-protected-call.d.ts +68 -0
- package/dist/timelock/execute-protected-call.d.ts.map +1 -0
- package/dist/timelock/execute-protected-call.js +146 -0
- package/dist/timelock/execute-protected-call.js.map +1 -0
- package/dist/timelock/execute-protected-function.d.ts +51 -0
- package/dist/timelock/execute-protected-function.d.ts.map +1 -0
- package/dist/timelock/execute-protected-function.js +37 -0
- package/dist/timelock/execute-protected-function.js.map +1 -0
- package/dist/timelock/get-timelock-policy/get-timelock-policy.d.ts +38 -0
- package/dist/timelock/get-timelock-policy/get-timelock-policy.d.ts.map +1 -0
- package/dist/timelock/get-timelock-policy/get-timelock-policy.js +49 -0
- package/dist/timelock/get-timelock-policy/get-timelock-policy.js.map +1 -0
- package/dist/timelock/get-timelock-policy/index.d.ts +3 -0
- package/dist/timelock/get-timelock-policy/index.d.ts.map +1 -0
- package/dist/timelock/get-timelock-policy/query.d.ts +13 -0
- package/dist/timelock/get-timelock-policy/query.d.ts.map +1 -0
- package/dist/timelock/get-timelock-policy/query.js +21 -0
- package/dist/timelock/get-timelock-policy/query.js.map +1 -0
- package/dist/timelock/index.d.ts +14 -0
- package/dist/timelock/index.d.ts.map +1 -0
- package/dist/timelock/normalize-timelock-revert.d.ts +3 -0
- package/dist/timelock/normalize-timelock-revert.d.ts.map +1 -0
- package/dist/timelock/normalize-timelock-revert.js +11 -0
- package/dist/timelock/normalize-timelock-revert.js.map +1 -0
- package/dist/timelock/policy-change.d.ts +72 -0
- package/dist/timelock/policy-change.d.ts.map +1 -0
- package/dist/timelock/policy-change.js +63 -0
- package/dist/timelock/policy-change.js.map +1 -0
- package/dist/timelock/policy.d.ts +19 -0
- package/dist/timelock/policy.d.ts.map +1 -0
- package/dist/timelock/policy.js +59 -0
- package/dist/timelock/policy.js.map +1 -0
- package/dist/timelock/protected-call-preflight.d.ts +10 -0
- package/dist/timelock/protected-call-preflight.d.ts.map +1 -0
- package/dist/timelock/protected-call-preflight.js +17 -0
- package/dist/timelock/protected-call-preflight.js.map +1 -0
- package/dist/timelock/root-account.d.ts +14 -0
- package/dist/timelock/root-account.d.ts.map +1 -0
- package/dist/timelock/root-account.js +9 -0
- package/dist/timelock/root-account.js.map +1 -0
- package/dist/timelock/scheduled-call-match.d.ts +4 -0
- package/dist/timelock/scheduled-call-match.d.ts.map +1 -0
- package/dist/timelock/scheduled-call-match.js +43 -0
- package/dist/timelock/scheduled-call-match.js.map +1 -0
- package/dist/timelock/setup-timelock-policy/index.d.ts +2 -0
- package/dist/timelock/setup-timelock-policy/index.d.ts.map +1 -0
- package/dist/timelock/setup-timelock-policy/setup-timelock-policy.d.ts +46 -0
- package/dist/timelock/setup-timelock-policy/setup-timelock-policy.d.ts.map +1 -0
- package/dist/timelock/setup-timelock-policy/setup-timelock-policy.js +58 -0
- package/dist/timelock/setup-timelock-policy/setup-timelock-policy.js.map +1 -0
- package/dist/timelock/support.d.ts +4 -0
- package/dist/timelock/support.d.ts.map +1 -0
- package/dist/timelock/support.js +9 -0
- package/dist/timelock/support.js.map +1 -0
- package/dist/transactions/execute-contract-write.d.ts +9 -0
- package/dist/transactions/execute-contract-write.d.ts.map +1 -0
- package/dist/transactions/execute-contract-write.js +35 -0
- package/dist/transactions/execute-contract-write.js.map +1 -0
- package/dist/transactions/execute-write.d.ts +32 -0
- package/dist/transactions/execute-write.d.ts.map +1 -0
- package/dist/transactions/execute-write.js +23 -0
- package/dist/transactions/execute-write.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Address, Hash, Hex } from 'viem';
|
|
2
|
+
import { Config } from '../../../core/config/index.js';
|
|
3
|
+
import { Compute, GaslessWriteParameter, WriteContractParameter } from '../../../shared/types/properties.js';
|
|
4
|
+
import { InstantLayerAccount } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* One delegate entry of {@link grantDelegations}: who may sign, for which
|
|
7
|
+
* selectors, until when. The granting account is shared by every entry.
|
|
8
|
+
*/
|
|
9
|
+
export interface GrantDelegationsEntry {
|
|
10
|
+
/** Signer that may call the selected functions on the account's behalf. */
|
|
11
|
+
delegatedSigner: Address;
|
|
12
|
+
/** Function selectors (`bytes4[]`) to grant this signer. */
|
|
13
|
+
selectors: readonly Hex[];
|
|
14
|
+
/** Expiry timestamp in seconds. */
|
|
15
|
+
expiryTimestamp: bigint;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parameters for {@link grantDelegations}.
|
|
19
|
+
*/
|
|
20
|
+
export type GrantDelegationsParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
|
|
21
|
+
/**
|
|
22
|
+
* PartyA account that grants every delegation. The wallet must own it.
|
|
23
|
+
* The contract applies all entries to this one account, so a PartyB
|
|
24
|
+
* account is rejected.
|
|
25
|
+
*/
|
|
26
|
+
account: InstantLayerAccount;
|
|
27
|
+
/** One entry per delegate. Must not be empty. */
|
|
28
|
+
delegations: readonly GrantDelegationsEntry[];
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Return type of {@link grantDelegations}: the submitted transaction hash. A
|
|
32
|
+
* relayed grant returns the relayer's broadcast hash, which behaves exactly
|
|
33
|
+
* like a wallet-submitted one.
|
|
34
|
+
*/
|
|
35
|
+
export type GrantDelegationsReturnType = Hash;
|
|
36
|
+
/**
|
|
37
|
+
* Grant InstantLayer delegations to several signers of one account in a single
|
|
38
|
+
* call — `InstantLayer.grantDelegations`.
|
|
39
|
+
*
|
|
40
|
+
* Relayed, the whole grant costs the owner one signature instead of one per
|
|
41
|
+
* delegate (for example a session key and a TP/SL executor at once); sent from
|
|
42
|
+
* the wallet, it costs one transaction. Every entry keeps its own selectors and
|
|
43
|
+
* expiry, and granting clears any pending revocation for the selectors it
|
|
44
|
+
* covers, exactly like {@link grantDelegation}.
|
|
45
|
+
*
|
|
46
|
+
* Resolves the bound wallet client and `InstantLayer` address from `config`.
|
|
47
|
+
* The connected wallet must own `account`. Dry-runs the call with
|
|
48
|
+
* {@link simulateGrantDelegations} first unless `simulateBeforeWrite` is
|
|
49
|
+
* `false`. Relays through the gasless service when the chain runs in gasless
|
|
50
|
+
* execution mode (or the call passes `gasless: true`), skipping the local
|
|
51
|
+
* dry-run because the relayer simulates its own bundle.
|
|
52
|
+
*
|
|
53
|
+
* Requires an InstantLayer that has `grantDelegations` (perps-core v0.8.6 since
|
|
54
|
+
* 2026-09-04). On an older deployment the call reverts with no matching
|
|
55
|
+
* function; gate the UI on your own knowledge of the deployment.
|
|
56
|
+
*
|
|
57
|
+
* @param config - The SDK config (must have a `getWalletClient` resolver).
|
|
58
|
+
* @param parameters - The granting account, its delegate entries, and optional chain / signer / gasless overrides.
|
|
59
|
+
* @returns The submitted transaction hash. The caller waits on the receipt.
|
|
60
|
+
* @throws {SymmError} `GRANT_DELEGATIONS_EMPTY` or `GRANT_DELEGATIONS_PARTYB_UNSUPPORTED` before any prompt; `config` errors when the chain is unsupported or no wallet is available.
|
|
61
|
+
* @throws Viem's write errors (`ContractFunctionExecutionError`, ...).
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const hash = await grantDelegations(config, {
|
|
65
|
+
* account: { addr: subAccount, isPartyB: false },
|
|
66
|
+
* delegations: [
|
|
67
|
+
* { delegatedSigner: sessionKey, selectors: sessionKeySelectors, expiryTimestamp },
|
|
68
|
+
* { delegatedSigner: tpslExecutor, selectors: tradingSelectors, expiryTimestamp },
|
|
69
|
+
* ],
|
|
70
|
+
* gasless: true,
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function grantDelegations(config: Config, parameters: GrantDelegationsParameters): Promise<GrantDelegationsReturnType>;
|
|
75
|
+
//# sourceMappingURL=grant-delegations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-delegations.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/instant-layer/actions/grant-delegations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAI/G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,2EAA2E;IAC3E,eAAe,EAAE,OAAO,CAAC;IACzB,4DAA4D;IAC5D,SAAS,EAAE,SAAS,GAAG,EAAE,CAAC;IAC1B,mCAAmC;IACnC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAC9C,sBAAsB,GACpB,qBAAqB,GAAG;IACtB;;;;OAIG;IACH,OAAO,EAAE,mBAAmB,CAAC;IAC7B,iDAAiD;IACjD,WAAW,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAC/C,CACJ,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,0BAA0B,GACrC,OAAO,CAAC,0BAA0B,CAAC,CA+CrC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { instantLayerAbi as e } from "../../abi/v0.8.6/instant-layer.js";
|
|
2
|
+
import { maybeRelayAsGasless as t } from "../../../gasless/dispatch/maybe-relay-as-gasless.js";
|
|
3
|
+
import { shouldSimulateBeforeWrite as n } from "../../../shared/utils/simulate-before-write.js";
|
|
4
|
+
import { assertGrantDelegationsInput as r, toDelegationInfos as i } from "../grant-delegations-input.js";
|
|
5
|
+
import { simulateGrantDelegations as a } from "./simulate-grant-delegations.js";
|
|
6
|
+
import { encodeFunctionData as o } from "viem";
|
|
7
|
+
//#region src/symmio-contracts/instant-layer/actions/grant-delegations.ts
|
|
8
|
+
async function s(s, c) {
|
|
9
|
+
r(c);
|
|
10
|
+
let { chainId: l, account: u, from: d } = c, { addresses: f } = s.getChainConfig(l), p = i(c), m = await t(s, {
|
|
11
|
+
chainId: l,
|
|
12
|
+
from: d,
|
|
13
|
+
gasless: c.gasless,
|
|
14
|
+
signerAccount: u.addr,
|
|
15
|
+
calls: [{
|
|
16
|
+
target: f.instantLayerAddress,
|
|
17
|
+
callData: o({
|
|
18
|
+
abi: e,
|
|
19
|
+
functionName: "grantDelegations",
|
|
20
|
+
args: [p]
|
|
21
|
+
})
|
|
22
|
+
}]
|
|
23
|
+
});
|
|
24
|
+
if (m !== null) return m;
|
|
25
|
+
let h = await s.getWalletClient({
|
|
26
|
+
chainId: l,
|
|
27
|
+
from: d
|
|
28
|
+
});
|
|
29
|
+
return n(s, c) && await a(s, {
|
|
30
|
+
chainId: l,
|
|
31
|
+
account: u,
|
|
32
|
+
delegations: c.delegations,
|
|
33
|
+
from: h.account.address
|
|
34
|
+
}), h.writeContract({
|
|
35
|
+
address: f.instantLayerAddress,
|
|
36
|
+
abi: e,
|
|
37
|
+
functionName: "grantDelegations",
|
|
38
|
+
args: [p],
|
|
39
|
+
account: h.account,
|
|
40
|
+
chain: h.chain
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { s as grantDelegations };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=grant-delegations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-delegations.js","names":[],"sources":["../../../../src/symmio-contracts/instant-layer/actions/grant-delegations.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash, type Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { maybeRelayAsGasless } from \"../../../gasless/dispatch/maybe-relay-as-gasless\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { instantLayerAbi } from \"../../abi/v0.8.6/instant-layer\";\nimport { assertGrantDelegationsInput, toDelegationInfos } from \"../grant-delegations-input\";\nimport type { InstantLayerAccount } from \"../types\";\nimport { simulateGrantDelegations } from \"./simulate-grant-delegations\";\n\n/**\n * One delegate entry of {@link grantDelegations}: who may sign, for which\n * selectors, until when. The granting account is shared by every entry.\n */\nexport interface GrantDelegationsEntry {\n /** Signer that may call the selected functions on the account's behalf. */\n delegatedSigner: Address;\n /** Function selectors (`bytes4[]`) to grant this signer. */\n selectors: readonly Hex[];\n /** Expiry timestamp in seconds. */\n expiryTimestamp: bigint;\n}\n\n/**\n * Parameters for {@link grantDelegations}.\n */\nexport type GrantDelegationsParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /**\n * PartyA account that grants every delegation. The wallet must own it.\n * The contract applies all entries to this one account, so a PartyB\n * account is rejected.\n */\n account: InstantLayerAccount;\n /** One entry per delegate. Must not be empty. */\n delegations: readonly GrantDelegationsEntry[];\n }\n>;\n\n/**\n * Return type of {@link grantDelegations}: the submitted transaction hash. A\n * relayed grant returns the relayer's broadcast hash, which behaves exactly\n * like a wallet-submitted one.\n */\nexport type GrantDelegationsReturnType = Hash;\n\n/**\n * Grant InstantLayer delegations to several signers of one account in a single\n * call — `InstantLayer.grantDelegations`.\n *\n * Relayed, the whole grant costs the owner one signature instead of one per\n * delegate (for example a session key and a TP/SL executor at once); sent from\n * the wallet, it costs one transaction. Every entry keeps its own selectors and\n * expiry, and granting clears any pending revocation for the selectors it\n * covers, exactly like {@link grantDelegation}.\n *\n * Resolves the bound wallet client and `InstantLayer` address from `config`.\n * The connected wallet must own `account`. Dry-runs the call with\n * {@link simulateGrantDelegations} first unless `simulateBeforeWrite` is\n * `false`. Relays through the gasless service when the chain runs in gasless\n * execution mode (or the call passes `gasless: true`), skipping the local\n * dry-run because the relayer simulates its own bundle.\n *\n * Requires an InstantLayer that has `grantDelegations` (perps-core v0.8.6 since\n * 2026-09-04). On an older deployment the call reverts with no matching\n * function; gate the UI on your own knowledge of the deployment.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - The granting account, its delegate entries, and optional chain / signer / gasless overrides.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} `GRANT_DELEGATIONS_EMPTY` or `GRANT_DELEGATIONS_PARTYB_UNSUPPORTED` before any prompt; `config` errors when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n * @example\n * ```ts\n * const hash = await grantDelegations(config, {\n * account: { addr: subAccount, isPartyB: false },\n * delegations: [\n * { delegatedSigner: sessionKey, selectors: sessionKeySelectors, expiryTimestamp },\n * { delegatedSigner: tpslExecutor, selectors: tradingSelectors, expiryTimestamp },\n * ],\n * gasless: true,\n * });\n * ```\n */\nexport async function grantDelegations(\n config: Config,\n parameters: GrantDelegationsParameters,\n): Promise<GrantDelegationsReturnType> {\n assertGrantDelegationsInput(parameters);\n\n const { chainId, account, from } = parameters;\n const { addresses } = config.getChainConfig(chainId);\n const infos = toDelegationInfos(parameters);\n\n /**\n * Transparent gasless seam: the same InstantLayer calldata is signed as an\n * InstantLayer operation and relayed, billed to the granting sub-account. A\n * grant is always owner-signed, so the calldata's account and the\n * operation's `signerAccount` are the same address. `null` means: proceed on\n * the wallet path below, unchanged.\n */\n const relayed = await maybeRelayAsGasless(config, {\n chainId,\n from,\n gasless: parameters.gasless,\n signerAccount: account.addr,\n calls: [\n {\n target: addresses.instantLayerAddress,\n callData: encodeFunctionData({ abi: instantLayerAbi, functionName: \"grantDelegations\", args: [infos] }),\n },\n ],\n });\n if (relayed !== null) return relayed;\n\n const walletClient = await config.getWalletClient({ chainId, from });\n\n if (shouldSimulateBeforeWrite(config, parameters)) {\n await simulateGrantDelegations(config, {\n chainId,\n account,\n delegations: parameters.delegations,\n from: walletClient.account.address,\n });\n }\n\n return walletClient.writeContract({\n address: addresses.instantLayerAddress,\n abi: instantLayerAbi,\n functionName: \"grantDelegations\",\n args: [infos],\n account: walletClient.account,\n chain: walletClient.chain,\n });\n}\n"],"mappings":";;;;;;;AAqFA,eAAsB,EACpB,GACA,GACqC;CACrC,EAA4B,CAAU;CAEtC,IAAM,EAAE,YAAS,YAAS,YAAS,GAC7B,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAQ,EAAkB,CAAU,GASpC,IAAU,MAAM,EAAoB,GAAQ;EAChD;EACA;EACA,SAAS,EAAW;EACpB,eAAe,EAAQ;EACvB,OAAO,CACL;GACE,QAAQ,EAAU;GAClB,UAAU,EAAmB;IAAE,KAAK;IAAiB,cAAc;IAAoB,MAAM,CAAC,CAAK;GAAE,CAAC;EACxG,CACF;CACF,CAAC;CACD,IAAI,MAAY,MAAM,OAAO;CAE7B,IAAM,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAWnE,OATI,EAA0B,GAAQ,CAAU,KAC9C,MAAM,EAAyB,GAAQ;EACrC;EACA;EACA,aAAa,EAAW;EACxB,MAAM,EAAa,QAAQ;CAC7B,CAAC,GAGI,EAAa,cAAc;EAChC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAK;EACZ,SAAS,EAAa;EACtB,OAAO,EAAa;CACtB,CAAC;AACH"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SimulateContractReturnType } from 'viem';
|
|
2
|
+
import { Config } from '../../../core/config/index.js';
|
|
3
|
+
import { Compute, FromParameter } from '../../../shared/types/properties.js';
|
|
4
|
+
import { instantLayerAbi } from '../../abi/v0.8.6/instant-layer.js';
|
|
5
|
+
import { GrantDelegationsParameters } from './grant-delegations.js';
|
|
6
|
+
/**
|
|
7
|
+
* Parameters for {@link simulateGrantDelegations}: the write's parameters plus
|
|
8
|
+
* an optional `from` (the address the dry-run runs as).
|
|
9
|
+
*/
|
|
10
|
+
export type SimulateGrantDelegationsParameters = Compute<GrantDelegationsParameters & FromParameter>;
|
|
11
|
+
/**
|
|
12
|
+
* Return type of {@link simulateGrantDelegations}: viem's `{ request, result }`.
|
|
13
|
+
*
|
|
14
|
+
* Written as an explicit alias over `SimulateContractReturnType<typeof instantLayerAbi, …>`
|
|
15
|
+
* so the emitted declaration references the ABI by name instead of inlining the whole
|
|
16
|
+
* ABI (which would bloat the published `.d.ts` and degrade consumers' type-checking).
|
|
17
|
+
*/
|
|
18
|
+
export type SimulateGrantDelegationsReturnType = SimulateContractReturnType<typeof instantLayerAbi, "grantDelegations">;
|
|
19
|
+
/**
|
|
20
|
+
* Dry-run {@link grantDelegations} without sending a transaction. Runs
|
|
21
|
+
* `simulateContract` against the InstantLayer via the public client; a would-be
|
|
22
|
+
* revert (for example the caller does not own the account) throws viem's call
|
|
23
|
+
* error.
|
|
24
|
+
*
|
|
25
|
+
* @param config - The SDK config.
|
|
26
|
+
* @param parameters - The granting account, its delegate entries, optional `from`, optional chain id.
|
|
27
|
+
* @returns viem's `{ request, result }`.
|
|
28
|
+
* @throws {SymmError} `GRANT_DELEGATIONS_EMPTY` or `GRANT_DELEGATIONS_PARTYB_UNSUPPORTED`; `UNSUPPORTED_CHAIN` when the chain is unknown.
|
|
29
|
+
* @throws Viem's call errors when the transaction would revert.
|
|
30
|
+
*/
|
|
31
|
+
export declare function simulateGrantDelegations(config: Config, parameters: SimulateGrantDelegationsParameters): Promise<SimulateGrantDelegationsReturnType>;
|
|
32
|
+
//# sourceMappingURL=simulate-grant-delegations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulate-grant-delegations.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/instant-layer/actions/simulate-grant-delegations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,kCAAkC,GAAG,OAAO,CAAC,0BAA0B,GAAG,aAAa,CAAC,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,MAAM,kCAAkC,GAAG,0BAA0B,CAAC,OAAO,eAAe,EAAE,kBAAkB,CAAC,CAAC;AAExH;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kCAAkC,GAC7C,OAAO,CAAC,kCAAkC,CAAC,CAa7C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { instantLayerAbi as e } from "../../abi/v0.8.6/instant-layer.js";
|
|
2
|
+
import { assertGrantDelegationsInput as t, toDelegationInfos as n } from "../grant-delegations-input.js";
|
|
3
|
+
//#region src/symmio-contracts/instant-layer/actions/simulate-grant-delegations.ts
|
|
4
|
+
async function r(r, i) {
|
|
5
|
+
t(i);
|
|
6
|
+
let { chainId: a, from: o } = i, { addresses: s } = r.getChainConfig(a);
|
|
7
|
+
return r.getClient({ chainId: a }).simulateContract({
|
|
8
|
+
address: s.instantLayerAddress,
|
|
9
|
+
abi: e,
|
|
10
|
+
functionName: "grantDelegations",
|
|
11
|
+
args: [n(i)],
|
|
12
|
+
account: o
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as simulateGrantDelegations };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=simulate-grant-delegations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulate-grant-delegations.js","names":[],"sources":["../../../../src/symmio-contracts/instant-layer/actions/simulate-grant-delegations.ts"],"sourcesContent":["import type { SimulateContractReturnType } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, FromParameter } from \"../../../shared/types/properties\";\nimport { instantLayerAbi } from \"../../abi/v0.8.6/instant-layer\";\nimport { assertGrantDelegationsInput, toDelegationInfos } from \"../grant-delegations-input\";\nimport type { GrantDelegationsParameters } from \"./grant-delegations\";\n\n/**\n * Parameters for {@link simulateGrantDelegations}: the write's parameters plus\n * an optional `from` (the address the dry-run runs as).\n */\nexport type SimulateGrantDelegationsParameters = Compute<GrantDelegationsParameters & FromParameter>;\n\n/**\n * Return type of {@link simulateGrantDelegations}: viem's `{ request, result }`.\n *\n * Written as an explicit alias over `SimulateContractReturnType<typeof instantLayerAbi, …>`\n * so the emitted declaration references the ABI by name instead of inlining the whole\n * ABI (which would bloat the published `.d.ts` and degrade consumers' type-checking).\n */\nexport type SimulateGrantDelegationsReturnType = SimulateContractReturnType<typeof instantLayerAbi, \"grantDelegations\">;\n\n/**\n * Dry-run {@link grantDelegations} without sending a transaction. Runs\n * `simulateContract` against the InstantLayer via the public client; a would-be\n * revert (for example the caller does not own the account) throws viem's call\n * error.\n *\n * @param config - The SDK config.\n * @param parameters - The granting account, its delegate entries, optional `from`, optional chain id.\n * @returns viem's `{ request, result }`.\n * @throws {SymmError} `GRANT_DELEGATIONS_EMPTY` or `GRANT_DELEGATIONS_PARTYB_UNSUPPORTED`; `UNSUPPORTED_CHAIN` when the chain is unknown.\n * @throws Viem's call errors when the transaction would revert.\n */\nexport async function simulateGrantDelegations(\n config: Config,\n parameters: SimulateGrantDelegationsParameters,\n): Promise<SimulateGrantDelegationsReturnType> {\n assertGrantDelegationsInput(parameters);\n\n const { chainId, from } = parameters;\n const { addresses } = config.getChainConfig(chainId);\n\n return config.getClient({ chainId }).simulateContract({\n address: addresses.instantLayerAddress,\n abi: instantLayerAbi,\n functionName: \"grantDelegations\",\n args: [toDelegationInfos(parameters)],\n account: from,\n });\n}\n"],"mappings":";;;AAkCA,eAAsB,EACpB,GACA,GAC6C;CAC7C,EAA4B,CAAU;CAEtC,IAAM,EAAE,YAAS,YAAS,GACpB,EAAE,iBAAc,EAAO,eAAe,CAAO;CAEnD,OAAO,EAAO,UAAU,EAAE,WAAQ,CAAC,EAAE,iBAAiB;EACpD,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,EAAkB,CAAU,CAAC;EACpC,SAAS;CACX,CAAC;AACH"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { GrantDelegationsEntry } from './actions/grant-delegations.js';
|
|
2
|
+
import { InstantLayerAccount } from './types.js';
|
|
3
|
+
/** The part of a multi-delegate grant the contract validates up front. */
|
|
4
|
+
interface GrantDelegationsInput {
|
|
5
|
+
account: InstantLayerAccount;
|
|
6
|
+
delegations: readonly GrantDelegationsEntry[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Throw before any wallet prompt for a grant the contract always reverts.
|
|
10
|
+
*
|
|
11
|
+
* @param input - The granting account and its delegate entries.
|
|
12
|
+
* @throws {SymmError} `GRANT_DELEGATIONS_EMPTY` for an empty list, `GRANT_DELEGATIONS_PARTYB_UNSUPPORTED` for a PartyB account.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function assertGrantDelegationsInput(input: GrantDelegationsInput): void;
|
|
17
|
+
/**
|
|
18
|
+
* Build the contract's `DelegationInfo[]`, every entry pinned to the one
|
|
19
|
+
* granting account.
|
|
20
|
+
*
|
|
21
|
+
* @param input - The granting account and its delegate entries.
|
|
22
|
+
* @returns The struct array `InstantLayer.grantDelegations` takes.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function toDelegationInfos(input: GrantDelegationsInput): {
|
|
27
|
+
account: InstantLayerAccount;
|
|
28
|
+
delegatedSigner: `0x${string}`;
|
|
29
|
+
selectors: readonly `0x${string}`[];
|
|
30
|
+
expiryTimestamp: bigint;
|
|
31
|
+
}[];
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=grant-delegations-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-delegations-input.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/instant-layer/grant-delegations-input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,0EAA0E;AAC1E,UAAU,qBAAqB;IAC7B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,WAAW,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAC/C;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,qBAAqB,QAavE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB;;;;;IAO7D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SymmError as e } from "../../shared/errors/symm-error.js";
|
|
2
|
+
//#region src/symmio-contracts/instant-layer/grant-delegations-input.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
if (t.delegations.length === 0) throw new e("validation", "GRANT_DELEGATIONS_EMPTY", "grantDelegations needs at least one delegation. The contract reverts InvalidDelegation on an empty list.");
|
|
5
|
+
if (t.account.isPartyB) throw new e("validation", "GRANT_DELEGATIONS_PARTYB_UNSUPPORTED", "grantDelegations only accepts a PartyA account; the contract reverts InvalidDelegation for PartyB. Use grantDelegation for a PartyB grant.");
|
|
6
|
+
}
|
|
7
|
+
function n(e) {
|
|
8
|
+
return e.delegations.map(({ delegatedSigner: t, selectors: n, expiryTimestamp: r }) => ({
|
|
9
|
+
account: e.account,
|
|
10
|
+
delegatedSigner: t,
|
|
11
|
+
selectors: n,
|
|
12
|
+
expiryTimestamp: r
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as assertGrantDelegationsInput, n as toDelegationInfos };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=grant-delegations-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-delegations-input.js","names":[],"sources":["../../../src/symmio-contracts/instant-layer/grant-delegations-input.ts"],"sourcesContent":["import { SymmError } from \"../../shared/errors/symm-error\";\nimport type { GrantDelegationsEntry } from \"./actions/grant-delegations\";\nimport type { InstantLayerAccount } from \"./types\";\n\n/** The part of a multi-delegate grant the contract validates up front. */\ninterface GrantDelegationsInput {\n account: InstantLayerAccount;\n delegations: readonly GrantDelegationsEntry[];\n}\n\n/**\n * Throw before any wallet prompt for a grant the contract always reverts.\n *\n * @param input - The granting account and its delegate entries.\n * @throws {SymmError} `GRANT_DELEGATIONS_EMPTY` for an empty list, `GRANT_DELEGATIONS_PARTYB_UNSUPPORTED` for a PartyB account.\n *\n * @internal\n */\nexport function assertGrantDelegationsInput(input: GrantDelegationsInput) {\n if (input.delegations.length === 0)\n throw new SymmError(\n \"validation\",\n \"GRANT_DELEGATIONS_EMPTY\",\n \"grantDelegations needs at least one delegation. The contract reverts InvalidDelegation on an empty list.\",\n );\n if (input.account.isPartyB)\n throw new SymmError(\n \"validation\",\n \"GRANT_DELEGATIONS_PARTYB_UNSUPPORTED\",\n \"grantDelegations only accepts a PartyA account; the contract reverts InvalidDelegation for PartyB. Use grantDelegation for a PartyB grant.\",\n );\n}\n\n/**\n * Build the contract's `DelegationInfo[]`, every entry pinned to the one\n * granting account.\n *\n * @param input - The granting account and its delegate entries.\n * @returns The struct array `InstantLayer.grantDelegations` takes.\n *\n * @internal\n */\nexport function toDelegationInfos(input: GrantDelegationsInput) {\n return input.delegations.map(({ delegatedSigner, selectors, expiryTimestamp }) => ({\n account: input.account,\n delegatedSigner,\n selectors,\n expiryTimestamp,\n }));\n}\n"],"mappings":";;AAkBA,SAAgB,EAA4B,GAA8B;CACxE,IAAI,EAAM,YAAY,WAAW,GAC/B,MAAM,IAAI,EACR,cACA,2BACA,0GACF;CACF,IAAI,EAAM,QAAQ,UAChB,MAAM,IAAI,EACR,cACA,wCACA,4IACF;AACJ;AAWA,SAAgB,EAAkB,GAA8B;CAC9D,OAAO,EAAM,YAAY,KAAK,EAAE,oBAAiB,cAAW,0BAAuB;EACjF,SAAS,EAAM;EACf;EACA;EACA;CACF,EAAE;AACJ"}
|
|
@@ -6,8 +6,10 @@ export * from './actions/get-is-delegation-active.js';
|
|
|
6
6
|
export * from './actions/get-pending-revocation-etas.js';
|
|
7
7
|
export * from './actions/get-revocation-cooldown.js';
|
|
8
8
|
export * from './actions/grant-delegation.js';
|
|
9
|
+
export * from './actions/grant-delegations.js';
|
|
9
10
|
export * from './actions/initiate-revoke-delegation.js';
|
|
10
11
|
export * from './actions/simulate-grant-delegation.js';
|
|
12
|
+
export * from './actions/simulate-grant-delegations.js';
|
|
11
13
|
export * from './query/finalize-revoke-delegation.js';
|
|
12
14
|
export * from './query/get-active-delegations.js';
|
|
13
15
|
export * from './query/get-delegation-expiry.js';
|
|
@@ -16,7 +18,9 @@ export * from './query/get-is-delegation-active.js';
|
|
|
16
18
|
export * from './query/get-pending-revocation-etas.js';
|
|
17
19
|
export * from './query/get-revocation-cooldown.js';
|
|
18
20
|
export * from './query/grant-delegation.js';
|
|
21
|
+
export * from './query/grant-delegations.js';
|
|
19
22
|
export * from './query/initiate-revoke-delegation.js';
|
|
20
23
|
export * from './query/simulate-grant-delegation.js';
|
|
24
|
+
export * from './query/simulate-grant-delegations.js';
|
|
21
25
|
export * from './types.js';
|
|
22
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/instant-layer/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/instant-layer/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Config } from '../../../core/config/index.js';
|
|
2
|
+
import { GrantDelegationsParameters } from '../actions/grant-delegations.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build TanStack Mutation options for {@link grantDelegations}.
|
|
5
|
+
*
|
|
6
|
+
* The returned `mutationFn` takes the action's parameters and forwards them to
|
|
7
|
+
* `grantDelegations(config, …)`. Framework layers compose invalidation and
|
|
8
|
+
* error normalization on top.
|
|
9
|
+
*
|
|
10
|
+
* @param config - The SDK config (must have a `getWalletClient` resolver).
|
|
11
|
+
* @returns Options to pass to `useMutation`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* useMutation(grantDelegationsMutationOptions(config));
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function grantDelegationsMutationOptions(config: Config): {
|
|
19
|
+
mutationKey: readonly ["grantDelegations"];
|
|
20
|
+
mutationFn: (variables: GrantDelegationsParameters) => Promise<`0x${string}`>;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=grant-delegations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-delegations.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/instant-layer/query/grant-delegations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAoB,KAAK,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAEjG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM;;4BAGlC,0BAA0B;EAErD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { grantDelegations as e } from "../actions/grant-delegations.js";
|
|
2
|
+
//#region src/symmio-contracts/instant-layer/query/grant-delegations.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
return {
|
|
5
|
+
mutationKey: ["grantDelegations"],
|
|
6
|
+
mutationFn: (n) => e(t, n)
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as grantDelegationsMutationOptions };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=grant-delegations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-delegations.js","names":[],"sources":["../../../../src/symmio-contracts/instant-layer/query/grant-delegations.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport { grantDelegations, type GrantDelegationsParameters } from \"../actions/grant-delegations\";\n\n/**\n * Build TanStack Mutation options for {@link grantDelegations}.\n *\n * The returned `mutationFn` takes the action's parameters and forwards them to\n * `grantDelegations(config, …)`. Framework layers compose invalidation and\n * error normalization on top.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * useMutation(grantDelegationsMutationOptions(config));\n * ```\n */\nexport function grantDelegationsMutationOptions(config: Config) {\n return {\n mutationKey: [\"grantDelegations\"] as const,\n mutationFn: (variables: GrantDelegationsParameters) => grantDelegations(config, variables),\n };\n}\n"],"mappings":";;AAkBA,SAAgB,EAAgC,GAAgB;CAC9D,OAAO;EACL,aAAa,CAAC,kBAAkB;EAChC,aAAa,MAA0C,EAAiB,GAAQ,CAAS;CAC3F;AACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Config } from '../../../core/config/index.js';
|
|
2
|
+
import { SimulateGrantDelegationsParameters } from '../actions/simulate-grant-delegations.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build TanStack Mutation options for {@link simulateGrantDelegations} — an
|
|
5
|
+
* on-demand dry-run (`simulateContract`) of grantDelegations.
|
|
6
|
+
*
|
|
7
|
+
* @param config - The SDK config.
|
|
8
|
+
* @returns Options to pass to `useMutation`.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* useMutation(simulateGrantDelegationsMutationOptions(config));
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function simulateGrantDelegationsMutationOptions(config: Config): {
|
|
16
|
+
mutationKey: readonly ["simulateGrantDelegations"];
|
|
17
|
+
mutationFn: (variables: SimulateGrantDelegationsParameters) => Promise<import('../index.js').SimulateGrantDelegationsReturnType>;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=simulate-grant-delegations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulate-grant-delegations.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/instant-layer/query/simulate-grant-delegations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,uCAAuC,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,wBAAgB,uCAAuC,CAAC,MAAM,EAAE,MAAM;;4BAG1C,kCAAkC;EAE7D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { simulateGrantDelegations as e } from "../actions/simulate-grant-delegations.js";
|
|
2
|
+
//#region src/symmio-contracts/instant-layer/query/simulate-grant-delegations.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
return {
|
|
5
|
+
mutationKey: ["simulateGrantDelegations"],
|
|
6
|
+
mutationFn: (n) => e(t, n)
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as simulateGrantDelegationsMutationOptions };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=simulate-grant-delegations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulate-grant-delegations.js","names":[],"sources":["../../../../src/symmio-contracts/instant-layer/query/simulate-grant-delegations.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport {\n simulateGrantDelegations,\n type SimulateGrantDelegationsParameters,\n} from \"../actions/simulate-grant-delegations\";\n\n/**\n * Build TanStack Mutation options for {@link simulateGrantDelegations} — an\n * on-demand dry-run (`simulateContract`) of grantDelegations.\n *\n * @param config - The SDK config.\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * useMutation(simulateGrantDelegationsMutationOptions(config));\n * ```\n */\nexport function simulateGrantDelegationsMutationOptions(config: Config) {\n return {\n mutationKey: [\"simulateGrantDelegations\"] as const,\n mutationFn: (variables: SimulateGrantDelegationsParameters) => simulateGrantDelegations(config, variables),\n };\n}\n"],"mappings":";;AAkBA,SAAgB,EAAwC,GAAgB;CACtE,OAAO;EACL,aAAa,CAAC,0BAA0B;EACxC,aAAa,MAAkD,EAAyB,GAAQ,CAAS;CAC3G;AACF"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Address, Hash } from 'viem';
|
|
2
2
|
import { Config } from '../../../core/config/index.js';
|
|
3
3
|
import { Compute, GaslessWriteParameter, WriteContractParameter } from '../../../shared/types/properties.js';
|
|
4
|
+
import { TimelockAuthorization } from '../../../timelock/execute-protected-call.js';
|
|
4
5
|
/**
|
|
5
6
|
* Parameters for {@link allocate}.
|
|
6
7
|
*/
|
|
7
8
|
export type AllocateParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
|
|
9
|
+
/** Optional authorization for a timelocked selector. */
|
|
10
|
+
timelock?: TimelockAuthorization;
|
|
8
11
|
/**
|
|
9
12
|
* The subaccount to allocate into. The call is routed through the
|
|
10
13
|
* AccountLayer `_call` proxy; the connected wallet must be its on-chain `owner`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allocate.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/allocate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"allocate.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/allocate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAAwB,KAAK,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAI5G;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACtC,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CACJ,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAyB1G"}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { executeProtectedCall as t } from "../../../timelock/execute-protected-call.js";
|
|
3
|
+
import { callAsSubAccount as n } from "../internal/call-as-sub-account.js";
|
|
4
|
+
import { encodeFunctionData as r } from "viem";
|
|
4
5
|
//#region src/symmio-contracts/symmio/actions/allocate.ts
|
|
5
|
-
async function
|
|
6
|
-
let { chainId:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
async function i(i, a) {
|
|
7
|
+
let { chainId: o, account: s, amount: c } = a, l = r({
|
|
8
|
+
abi: e,
|
|
9
|
+
functionName: "allocate",
|
|
10
|
+
args: [c]
|
|
11
|
+
});
|
|
12
|
+
return a.timelock ? t(i, {
|
|
13
|
+
...a,
|
|
14
|
+
callData: l,
|
|
15
|
+
target: "core",
|
|
16
|
+
timelock: a.timelock
|
|
17
|
+
}) : n(i, {
|
|
18
|
+
account: s,
|
|
19
|
+
data: l,
|
|
20
|
+
chainId: o,
|
|
21
|
+
from: a.from,
|
|
22
|
+
simulateBeforeWrite: a.simulateBeforeWrite,
|
|
23
|
+
gasless: a.gasless
|
|
18
24
|
});
|
|
19
25
|
}
|
|
20
26
|
//#endregion
|
|
21
|
-
export {
|
|
27
|
+
export { i as allocate };
|
|
22
28
|
|
|
23
29
|
//# sourceMappingURL=allocate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allocate.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/allocate.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\n\n/**\n * Parameters for {@link allocate}.\n */\nexport type AllocateParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /**\n * The subaccount to allocate into. The call is routed through the\n * AccountLayer `_call` proxy; the connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * Amount to move from the available balance into the allocated balance, in\n * **18 decimals** (not the collateral token's decimals). Capped by the\n * per-user balance limit.\n */\n amount: bigint;\n }\n>;\n\n/** Return type of {@link allocate}: the submitted transaction hash. */\nexport type AllocateReturnType = Hash;\n\n/**\n * Move collateral from a subaccount's **available balance** into its **allocated\n * (tradeable) balance** on the SYMMIO core.\n *\n * Allocated balance is what Party A actually trades against. The subaccount's\n * available balance is debited and its allocated balance credited, in 18-decimal\n * units, capped by the per-user balance limit. The subaccount must not be\n * suspended or currently in liquidation as Party A.\n *\n * Encodes the SYMMIO core `allocate(amount)` call and routes it through\n * `AccountLayer._call(account, …)` so the core attributes it to the subaccount.\n *\n * Dry-runs the call with {@link simulateAllocate} first unless `simulateBeforeWrite`\n * is `false` (per-call, falling back to the config default).\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, amount (18 decimals), optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await allocate(config, { account: \"0xsub…\", amount: 1_000000000000000000n });\n * ```\n */\nexport async function allocate(config: Config, parameters: AllocateParameters): Promise<AllocateReturnType> {\n const { chainId, account, amount } = parameters;\n\n const data = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"allocate\",\n args: [amount],\n });\n\n return callAsSubAccount(config, {\n account,\n data,\n chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"allocate.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/allocate.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { executeProtectedCall, type TimelockAuthorization } from \"../../../timelock/execute-protected-call\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\n\n/**\n * Parameters for {@link allocate}.\n */\nexport type AllocateParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /** Optional authorization for a timelocked selector. */\n timelock?: TimelockAuthorization;\n /**\n * The subaccount to allocate into. The call is routed through the\n * AccountLayer `_call` proxy; the connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * Amount to move from the available balance into the allocated balance, in\n * **18 decimals** (not the collateral token's decimals). Capped by the\n * per-user balance limit.\n */\n amount: bigint;\n }\n>;\n\n/** Return type of {@link allocate}: the submitted transaction hash. */\nexport type AllocateReturnType = Hash;\n\n/**\n * Move collateral from a subaccount's **available balance** into its **allocated\n * (tradeable) balance** on the SYMMIO core.\n *\n * Allocated balance is what Party A actually trades against. The subaccount's\n * available balance is debited and its allocated balance credited, in 18-decimal\n * units, capped by the per-user balance limit. The subaccount must not be\n * suspended or currently in liquidation as Party A.\n *\n * Encodes the SYMMIO core `allocate(amount)` call and routes it through\n * `AccountLayer._call(account, …)` so the core attributes it to the subaccount.\n *\n * Dry-runs the call with {@link simulateAllocate} first unless `simulateBeforeWrite`\n * is `false` (per-call, falling back to the config default).\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, amount (18 decimals), optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await allocate(config, { account: \"0xsub…\", amount: 1_000000000000000000n });\n * ```\n */\nexport async function allocate(config: Config, parameters: AllocateParameters): Promise<AllocateReturnType> {\n const { chainId, account, amount } = parameters;\n\n const data = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"allocate\",\n args: [amount],\n });\n\n if (parameters.timelock)\n return executeProtectedCall(config, {\n ...parameters,\n callData: data,\n target: \"core\",\n timelock: parameters.timelock,\n });\n\n return callAsSubAccount(config, {\n account,\n data,\n chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n });\n}\n"],"mappings":";;;;;AA0DA,eAAsB,EAAS,GAAgB,GAA6D;CAC1G,IAAM,EAAE,YAAS,YAAS,cAAW,GAE/B,IAAO,EAAmB;EAC9B,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAM;CACf,CAAC;CAUD,OARI,EAAW,WACN,EAAqB,GAAQ;EAClC,GAAG;EACH,UAAU;EACV,QAAQ;EACR,UAAU,EAAW;CACvB,CAAC,IAEI,EAAiB,GAAQ;EAC9B;EACA;EACA;EACA,MAAM,EAAW;EACjB,qBAAqB,EAAW;EAChC,SAAS,EAAW;CACtB,CAAC;AACH"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Address, Hash } from 'viem';
|
|
2
|
+
import { Config } from '../../../core/config/index.js';
|
|
3
|
+
import { Compute, GaslessWriteParameter, WriteContractParameter } from '../../../shared/types/properties.js';
|
|
4
|
+
import { TimelockAuthorization } from '../../../timelock/execute-protected-call.js';
|
|
5
|
+
/**
|
|
6
|
+
* Parameters for {@link approveOperationalFeeAllowance}: the same as
|
|
7
|
+
* {@link approveOperationalFee}'s, without `feeMultipliers`.
|
|
8
|
+
*/
|
|
9
|
+
export type ApproveOperationalFeeAllowanceParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
|
|
10
|
+
/** Optional authorization for a timelocked selector. */
|
|
11
|
+
timelock?: TimelockAuthorization;
|
|
12
|
+
/**
|
|
13
|
+
* The sub-account that pays operational fees. The call is routed through
|
|
14
|
+
* the AccountLayer `_call` proxy so the diamond sees this sub-account as
|
|
15
|
+
* `msg.sender` — the allowance is keyed by payer. The signer must be the
|
|
16
|
+
* sub-account's `owner`, or a session key delegated this function's
|
|
17
|
+
* selector when relayed.
|
|
18
|
+
*/
|
|
19
|
+
account: Address;
|
|
20
|
+
/**
|
|
21
|
+
* The fee chargers to approve. Defaults to the chain's
|
|
22
|
+
* `gasless.gaslessLayerAddress` — the GaslessLayer **proxy**, which is
|
|
23
|
+
* the charger for relayed operations.
|
|
24
|
+
*/
|
|
25
|
+
chargers?: readonly Address[];
|
|
26
|
+
/**
|
|
27
|
+
* Allowance per charger, parallel to `chargers`, in **18-decimal Core
|
|
28
|
+
* units**. Each value **replaces** the current allowance, and every
|
|
29
|
+
* charge decrements it. A raise applies immediately; a **reduction** can
|
|
30
|
+
* be timelocked on-chain.
|
|
31
|
+
*/
|
|
32
|
+
amounts: readonly bigint[];
|
|
33
|
+
}>;
|
|
34
|
+
/** Return type of {@link approveOperationalFeeAllowance}: the submitted transaction hash. */
|
|
35
|
+
export type ApproveOperationalFeeAllowanceReturnType = Hash;
|
|
36
|
+
/**
|
|
37
|
+
* Set operational-fee allowances for the gasless fee charger, as the paying
|
|
38
|
+
* sub-account, **without touching the fee multiplier** — the diamond's
|
|
39
|
+
* two-argument `approveOperationalFee(chargers, amounts)`.
|
|
40
|
+
*
|
|
41
|
+
* Prefer {@link approveOperationalFee} by default; it also sets the charger's
|
|
42
|
+
* fee multiplier (resetting it to list price when omitted). Reach for this one
|
|
43
|
+
* when a multiplier set elsewhere must survive the approval, or when the signer
|
|
44
|
+
* is a session key whose delegation holds only this function's selector —
|
|
45
|
+
* relayed writes are checked per selector, and the two functions have
|
|
46
|
+
* different ones.
|
|
47
|
+
*
|
|
48
|
+
* Amounts are **18-decimal Core units**, and each one replaces the current
|
|
49
|
+
* allowance. Routed through the AccountLayer `_call` proxy, and relayable:
|
|
50
|
+
* pass `gasless: true` (or run the chain in gasless execution mode) to have
|
|
51
|
+
* the relayer submit it.
|
|
52
|
+
*
|
|
53
|
+
* @param config - The SDK config (must have a `getWalletClient` resolver).
|
|
54
|
+
* @param parameters - Paying sub-account, chargers and amounts, write options.
|
|
55
|
+
* @returns The submitted transaction hash.
|
|
56
|
+
* @throws {SymmError} `GASLESS_CHARGER_REQUIRED` when no `chargers` are given and
|
|
57
|
+
* the chain has no gasless block to default from.
|
|
58
|
+
* @throws {SymmError} `OPERATIONAL_FEE_APPROVAL_MISMATCH` when the array lengths disagree.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* import { parseUnits } from "viem";
|
|
63
|
+
*
|
|
64
|
+
* // A bounded budget of 5 collateral tokens, signed by a session key that holds this selector.
|
|
65
|
+
* const hash = await approveOperationalFeeAllowance(config, {
|
|
66
|
+
* account: subAccount,
|
|
67
|
+
* amounts: [parseUnits("5", 18)],
|
|
68
|
+
* from: sessionKey,
|
|
69
|
+
* gasless: true,
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function approveOperationalFeeAllowance(config: Config, parameters: ApproveOperationalFeeAllowanceParameters): Promise<ApproveOperationalFeeAllowanceReturnType>;
|
|
74
|
+
//# sourceMappingURL=approve-operational-fee-allowance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approve-operational-fee-allowance.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/approve-operational-fee-allowance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAAwB,KAAK,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAK5G;;;GAGG;AACH,MAAM,MAAM,wCAAwC,GAAG,OAAO,CAC5D,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC;;;;;;OAMG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC9B;;;;;OAKG;IACH,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B,CACJ,CAAC;AAEF,6FAA6F;AAC7F,MAAM,MAAM,wCAAwC,GAAG,IAAI,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,wCAAwC,GACnD,OAAO,CAAC,wCAAwC,CAAC,CAqCnD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
|
|
2
|
+
import { SymmError as t } from "../../../shared/errors/symm-error.js";
|
|
3
|
+
import { executeProtectedCall as n } from "../../../timelock/execute-protected-call.js";
|
|
4
|
+
import { callAsSubAccount as r } from "../internal/call-as-sub-account.js";
|
|
5
|
+
import { resolveDefaultOperationalFeeCharger as i } from "../internal/resolve-default-operational-fee-charger.js";
|
|
6
|
+
import { encodeFunctionData as a } from "viem";
|
|
7
|
+
//#region src/symmio-contracts/symmio/actions/approve-operational-fee-allowance.ts
|
|
8
|
+
async function o(o, s) {
|
|
9
|
+
let { chainId: c, account: l, amounts: u } = s, d = s.chargers ?? [i(o, {
|
|
10
|
+
chainId: c,
|
|
11
|
+
action: "approveOperationalFeeAllowance"
|
|
12
|
+
})];
|
|
13
|
+
if (d.length !== u.length) throw new t("validation", "OPERATIONAL_FEE_APPROVAL_MISMATCH", `approveOperationalFeeAllowance: chargers (${d.length}) and amounts (${u.length}) must have the same length.`);
|
|
14
|
+
let f = a({
|
|
15
|
+
abi: e,
|
|
16
|
+
functionName: "approveOperationalFee",
|
|
17
|
+
args: [[...d], [...u]]
|
|
18
|
+
});
|
|
19
|
+
return s.timelock ? n(o, {
|
|
20
|
+
...s,
|
|
21
|
+
callData: f,
|
|
22
|
+
target: "core",
|
|
23
|
+
timelock: s.timelock
|
|
24
|
+
}) : r(o, {
|
|
25
|
+
account: l,
|
|
26
|
+
data: f,
|
|
27
|
+
chainId: c,
|
|
28
|
+
from: s.from,
|
|
29
|
+
simulateBeforeWrite: s.simulateBeforeWrite,
|
|
30
|
+
gasless: s.gasless
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { o as approveOperationalFeeAllowance };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=approve-operational-fee-allowance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approve-operational-fee-allowance.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/approve-operational-fee-allowance.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { executeProtectedCall, type TimelockAuthorization } from \"../../../timelock/execute-protected-call\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\nimport { resolveDefaultOperationalFeeCharger } from \"../internal/resolve-default-operational-fee-charger\";\n\n/**\n * Parameters for {@link approveOperationalFeeAllowance}: the same as\n * {@link approveOperationalFee}'s, without `feeMultipliers`.\n */\nexport type ApproveOperationalFeeAllowanceParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /** Optional authorization for a timelocked selector. */\n timelock?: TimelockAuthorization;\n /**\n * The sub-account that pays operational fees. The call is routed through\n * the AccountLayer `_call` proxy so the diamond sees this sub-account as\n * `msg.sender` — the allowance is keyed by payer. The signer must be the\n * sub-account's `owner`, or a session key delegated this function's\n * selector when relayed.\n */\n account: Address;\n /**\n * The fee chargers to approve. Defaults to the chain's\n * `gasless.gaslessLayerAddress` — the GaslessLayer **proxy**, which is\n * the charger for relayed operations.\n */\n chargers?: readonly Address[];\n /**\n * Allowance per charger, parallel to `chargers`, in **18-decimal Core\n * units**. Each value **replaces** the current allowance, and every\n * charge decrements it. A raise applies immediately; a **reduction** can\n * be timelocked on-chain.\n */\n amounts: readonly bigint[];\n }\n>;\n\n/** Return type of {@link approveOperationalFeeAllowance}: the submitted transaction hash. */\nexport type ApproveOperationalFeeAllowanceReturnType = Hash;\n\n/**\n * Set operational-fee allowances for the gasless fee charger, as the paying\n * sub-account, **without touching the fee multiplier** — the diamond's\n * two-argument `approveOperationalFee(chargers, amounts)`.\n *\n * Prefer {@link approveOperationalFee} by default; it also sets the charger's\n * fee multiplier (resetting it to list price when omitted). Reach for this one\n * when a multiplier set elsewhere must survive the approval, or when the signer\n * is a session key whose delegation holds only this function's selector —\n * relayed writes are checked per selector, and the two functions have\n * different ones.\n *\n * Amounts are **18-decimal Core units**, and each one replaces the current\n * allowance. Routed through the AccountLayer `_call` proxy, and relayable:\n * pass `gasless: true` (or run the chain in gasless execution mode) to have\n * the relayer submit it.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Paying sub-account, chargers and amounts, write options.\n * @returns The submitted transaction hash.\n * @throws {SymmError} `GASLESS_CHARGER_REQUIRED` when no `chargers` are given and\n * the chain has no gasless block to default from.\n * @throws {SymmError} `OPERATIONAL_FEE_APPROVAL_MISMATCH` when the array lengths disagree.\n *\n * @example\n * ```ts\n * import { parseUnits } from \"viem\";\n *\n * // A bounded budget of 5 collateral tokens, signed by a session key that holds this selector.\n * const hash = await approveOperationalFeeAllowance(config, {\n * account: subAccount,\n * amounts: [parseUnits(\"5\", 18)],\n * from: sessionKey,\n * gasless: true,\n * });\n * ```\n */\nexport async function approveOperationalFeeAllowance(\n config: Config,\n parameters: ApproveOperationalFeeAllowanceParameters,\n): Promise<ApproveOperationalFeeAllowanceReturnType> {\n const { chainId, account, amounts } = parameters;\n\n const chargers = parameters.chargers ?? [\n resolveDefaultOperationalFeeCharger(config, { chainId, action: \"approveOperationalFeeAllowance\" }),\n ];\n\n if (chargers.length !== amounts.length) {\n throw new SymmError(\n \"validation\",\n \"OPERATIONAL_FEE_APPROVAL_MISMATCH\",\n `approveOperationalFeeAllowance: chargers (${chargers.length}) and amounts (${amounts.length}) must have the same length.`,\n );\n }\n\n const data = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"approveOperationalFee\",\n args: [[...chargers], [...amounts]],\n });\n\n if (parameters.timelock)\n return executeProtectedCall(config, {\n ...parameters,\n callData: data,\n target: \"core\",\n timelock: parameters.timelock,\n });\n\n return callAsSubAccount(config, {\n account,\n data,\n chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless: parameters.gasless,\n });\n}\n"],"mappings":";;;;;;;AAkFA,eAAsB,EACpB,GACA,GACmD;CACnD,IAAM,EAAE,YAAS,YAAS,eAAY,GAEhC,IAAW,EAAW,YAAY,CACtC,EAAoC,GAAQ;EAAE;EAAS,QAAQ;CAAiC,CAAC,CACnG;CAEA,IAAI,EAAS,WAAW,EAAQ,QAC9B,MAAM,IAAI,EACR,cACA,qCACA,6CAA6C,EAAS,OAAO,iBAAiB,EAAQ,OAAO,6BAC/F;CAGF,IAAM,IAAO,EAAmB;EAC9B,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAC,GAAG,CAAQ,GAAG,CAAC,GAAG,CAAO,CAAC;CACpC,CAAC;CAUD,OARI,EAAW,WACN,EAAqB,GAAQ;EAClC,GAAG;EACH,UAAU;EACV,QAAQ;EACR,UAAU,EAAW;CACvB,CAAC,IAEI,EAAiB,GAAQ;EAC9B;EACA;EACA;EACA,MAAM,EAAW;EACjB,qBAAqB,EAAW;EAChC,SAAS,EAAW;CACtB,CAAC;AACH"}
|