@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
|
@@ -1,6 +1,7 @@
|
|
|
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
|
* Fee multiplier meaning "list price" (basis points). The default the diamond
|
|
6
7
|
* applies when a pair has never set one.
|
|
@@ -10,6 +11,8 @@ export declare const OPERATIONAL_FEE_LIST_PRICE_MULTIPLIER = 10000n;
|
|
|
10
11
|
* Parameters for {@link approveOperationalFee}.
|
|
11
12
|
*/
|
|
12
13
|
export type ApproveOperationalFeeParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
|
|
14
|
+
/** Optional authorization for a timelocked selector. */
|
|
15
|
+
timelock?: TimelockAuthorization;
|
|
13
16
|
/**
|
|
14
17
|
* The sub-account that pays operational fees. The call is routed through
|
|
15
18
|
* the AccountLayer `_call` proxy so the diamond sees this sub-account as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve-operational-fee.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/approve-operational-fee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"approve-operational-fee.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/approve-operational-fee.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,eAAO,MAAM,qCAAqC,SAAU,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,OAAO,CACnD,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC;;;;;;OAMG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC9B;;;;;;;;;;;;OAYG;IACH,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,CACJ,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,+BAA+B,GAC1C,OAAO,CAAC,+BAA+B,CAAC,CAsC1C"}
|
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
|
|
2
2
|
import { SymmError as t } from "../../../shared/errors/symm-error.js";
|
|
3
|
-
import {
|
|
3
|
+
import { executeProtectedCall as n } from "../../../timelock/execute-protected-call.js";
|
|
4
4
|
import { callAsSubAccount as r } from "../internal/call-as-sub-account.js";
|
|
5
|
-
import {
|
|
5
|
+
import { resolveDefaultOperationalFeeCharger as i } from "../internal/resolve-default-operational-fee-charger.js";
|
|
6
|
+
import { encodeFunctionData as a } from "viem";
|
|
6
7
|
//#region src/symmio-contracts/symmio/actions/approve-operational-fee.ts
|
|
7
|
-
var
|
|
8
|
-
async function o
|
|
9
|
-
let { chainId:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
var o = 10000n;
|
|
9
|
+
async function s(o, s) {
|
|
10
|
+
let { chainId: c, account: l, amounts: u } = s, d = s.chargers ?? [i(o, {
|
|
11
|
+
chainId: c,
|
|
12
|
+
action: "approveOperationalFee"
|
|
13
|
+
})], f = s.feeMultipliers ?? d.map(() => 10000n);
|
|
14
|
+
if (d.length !== u.length || d.length !== f.length) throw new t("validation", "OPERATIONAL_FEE_APPROVAL_MISMATCH", `approveOperationalFee: chargers (${d.length}), amounts (${u.length}) and feeMultipliers (${f.length}) must have the same length.`);
|
|
15
|
+
let p = a({
|
|
16
|
+
abi: e,
|
|
17
|
+
functionName: "approveOperationalFeeWithMultiplier",
|
|
18
|
+
args: [
|
|
19
|
+
[...d],
|
|
20
|
+
[...u],
|
|
21
|
+
[...f]
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
return s.timelock ? n(o, {
|
|
25
|
+
...s,
|
|
26
|
+
callData: p,
|
|
27
|
+
target: "core",
|
|
28
|
+
timelock: s.timelock
|
|
29
|
+
}) : r(o, {
|
|
30
|
+
account: l,
|
|
31
|
+
data: p,
|
|
32
|
+
chainId: c,
|
|
33
|
+
from: s.from,
|
|
34
|
+
simulateBeforeWrite: s.simulateBeforeWrite,
|
|
35
|
+
gasless: s.gasless
|
|
26
36
|
});
|
|
27
|
-
}
|
|
28
|
-
function s(e, r) {
|
|
29
|
-
try {
|
|
30
|
-
return n(e, { chainId: r }).gaslessLayerAddress;
|
|
31
|
-
} catch {
|
|
32
|
-
throw new t("validation", "GASLESS_CHARGER_REQUIRED", "approveOperationalFee: pass `chargers` explicitly — the chain has no gasless block to default them from.");
|
|
33
|
-
}
|
|
34
37
|
}
|
|
35
38
|
//#endregion
|
|
36
|
-
export {
|
|
39
|
+
export { o as OPERATIONAL_FEE_LIST_PRICE_MULTIPLIER, s as approveOperationalFee };
|
|
37
40
|
|
|
38
41
|
//# sourceMappingURL=approve-operational-fee.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve-operational-fee.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/approve-operational-fee.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport {
|
|
1
|
+
{"version":3,"file":"approve-operational-fee.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/approve-operational-fee.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 * Fee multiplier meaning \"list price\" (basis points). The default the diamond\n * applies when a pair has never set one.\n */\nexport const OPERATIONAL_FEE_LIST_PRICE_MULTIPLIER = 10_000n;\n\n/**\n * Parameters for {@link approveOperationalFee}.\n */\nexport type ApproveOperationalFeeParameters = 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, and a direct wallet call\n * would grant it from the wrong account. The connected wallet must be the\n * sub-account's `owner`.\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. Never the relayer's executor\n * address.\n */\n chargers?: readonly Address[];\n /**\n * Allowance per charger, parallel to `chargers`, in **18-decimal Core\n * units** — the scale of the Core balance the fee is drawn from, not the\n * collateral token's decimals. `parseUnits(\"5\", 18)` is a budget of 5\n * collateral tokens; `collateralToCore18` converts a token amount.\n *\n * Each value **replaces** the current allowance (ERC-20 `approve`\n * style, not an increment), and every charge decrements it. Choose a\n * bounded budget for the operations you intend to relay rather than\n * `maxUint256`. A raise applies immediately; a **reduction** can be\n * timelocked on-chain, in which case the old value keeps applying until\n * `reductionReadyAt`.\n */\n amounts: readonly bigint[];\n /**\n * Fee multiplier per charger in basis points; `10000n` = list price.\n * Defaults to {@link OPERATIONAL_FEE_LIST_PRICE_MULTIPLIER} for every\n * charger. The call always sets the multiplier, so omitting this resets\n * a previously set one to list price.\n */\n feeMultipliers?: readonly bigint[];\n }\n>;\n\n/** Return type of {@link approveOperationalFee}: the submitted transaction hash. */\nexport type ApproveOperationalFeeReturnType = Hash;\n\n/**\n * Approve operational-fee allowances (`approveOperationalFeeWithMultiplier`)\n * for the gasless fee charger, as the paying sub-account.\n *\n * The GaslessLayer proxy can only charge a payer up to this allowance, so grant\n * it **before** relying on gasless execution. When the relayer itself is down,\n * this wallet-paid path (via `AccountLayer._call`) is the only way to grant it.\n * The approval is also itself relayable: pass `gasless: true` once the\n * transparent gasless mode is active to have the relayer submit it.\n *\n * Amounts are **18-decimal Core units**. Approving only permits the charge — it\n * does not add collateral, and the fee is still drawn from the payer's Core\n * balance. Whatever its allowance, a payer short of balance fails with\n * `OperationalFee: Insufficient balance`. Read the allowance back with\n * `getOperationalFeeAllowance` after the transaction lands, before relying on it.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Paying sub-account, chargers/amounts/multipliers, 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 fee budget of 5 collateral tokens, in 18-decimal Core units.\n * const hash = await approveOperationalFee(config, {\n * account: subAccount,\n * amounts: [parseUnits(\"5\", 18)],\n * });\n * ```\n */\nexport async function approveOperationalFee(\n config: Config,\n parameters: ApproveOperationalFeeParameters,\n): Promise<ApproveOperationalFeeReturnType> {\n const { chainId, account, amounts } = parameters;\n\n const chargers = parameters.chargers ?? [\n resolveDefaultOperationalFeeCharger(config, { chainId, action: \"approveOperationalFee\" }),\n ];\n const feeMultipliers = parameters.feeMultipliers ?? chargers.map(() => OPERATIONAL_FEE_LIST_PRICE_MULTIPLIER);\n\n if (chargers.length !== amounts.length || chargers.length !== feeMultipliers.length) {\n throw new SymmError(\n \"validation\",\n \"OPERATIONAL_FEE_APPROVAL_MISMATCH\",\n `approveOperationalFee: chargers (${chargers.length}), amounts (${amounts.length}) and feeMultipliers (${feeMultipliers.length}) must have the same length.`,\n );\n }\n\n const data = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"approveOperationalFeeWithMultiplier\",\n args: [[...chargers], [...amounts], [...feeMultipliers]],\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":";;;;;;;AAaA,IAAa,IAAwC;AAsFrD,eAAsB,EACpB,GACA,GAC0C;CAC1C,IAAM,EAAE,YAAS,YAAS,eAAY,GAEhC,IAAW,EAAW,YAAY,CACtC,EAAoC,GAAQ;EAAE;EAAS,QAAQ;CAAwB,CAAC,CAC1F,GACM,IAAiB,EAAW,kBAAkB,EAAS,UAAA,MAA+C;CAE5G,IAAI,EAAS,WAAW,EAAQ,UAAU,EAAS,WAAW,EAAe,QAC3E,MAAM,IAAI,EACR,cACA,qCACA,oCAAoC,EAAS,OAAO,cAAc,EAAQ,OAAO,wBAAwB,EAAe,OAAO,6BACjI;CAGF,IAAM,IAAO,EAAmB;EAC9B,KAAK;EACL,cAAc;EACd,MAAM;GAAC,CAAC,GAAG,CAAQ;GAAG,CAAC,GAAG,CAAO;GAAG,CAAC,GAAG,CAAc;EAAC;CACzD,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"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Address, Hash, Hex } from 'viem';
|
|
2
2
|
import { Config } from '../../../core/config/index.js';
|
|
3
3
|
import { Compute, GaslessWriteParameter, WriteContractParameter } from '../../../shared/types/properties.js';
|
|
4
|
+
import { TimelockBatchAuthorization } from '../../../timelock/execute-protected-batch.js';
|
|
4
5
|
import { SingleUpnlSig } from '../../account-layer/types.js';
|
|
5
6
|
import { WithdrawReceiverPart } from '../types.js';
|
|
6
7
|
/**
|
|
7
8
|
* Parameters for {@link deallocateAndInitiateWithdraw}.
|
|
8
9
|
*/
|
|
9
10
|
export type DeallocateAndInitiateWithdrawParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
|
|
11
|
+
/** Optional per-call authorization for the atomic Core batch. */
|
|
12
|
+
timelock?: TimelockBatchAuthorization;
|
|
10
13
|
/**
|
|
11
14
|
* The subaccount to deallocate from and initiate the withdrawal for. Both
|
|
12
15
|
* inner calls are routed through the AccountLayer `_call` proxy so the core
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deallocate-and-initiate-withdraw.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.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;
|
|
1
|
+
{"version":3,"file":"deallocate-and-initiate-withdraw.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.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;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,uCAAuC,GAAG,OAAO,CAC3D,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,0BAA0B,CAAC;IACtC;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CACJ,CAAC;AAEF,4FAA4F;AAC5F,MAAM,MAAM,uCAAuC,GAAG,IAAI,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,uCAAuC,GAClD,OAAO,CAAC,uCAAuC,CAAC,CAqClD"}
|
|
@@ -1,35 +1,44 @@
|
|
|
1
1
|
import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { withGaslessAttemptStart as t } from "../../../gasless/dispatch/attempt-start.js";
|
|
3
|
+
import { callAsSubAccount as n } from "../internal/call-as-sub-account.js";
|
|
4
|
+
import { assertTimelockBatchUnused as r, executeProtectedCoreBatch as i } from "../../../timelock/execute-protected-batch.js";
|
|
5
|
+
import { getDeallocateUpnlSig as a } from "../../../muon/deallocate-upnl-sig/get-deallocate-upnl-sig.js";
|
|
6
|
+
import { encodeFunctionData as o } from "viem";
|
|
5
7
|
//#region src/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.ts
|
|
6
|
-
async function
|
|
7
|
-
let { chainId:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
async function s(s, c) {
|
|
9
|
+
let { chainId: l, account: u, amount: d, parts: f, speedUp: p = !1, providerData: m = "0x", from: h } = c;
|
|
10
|
+
c.timelock && r(c.timelock);
|
|
11
|
+
let g = t(c.gasless), _ = o({
|
|
12
|
+
abi: e,
|
|
13
|
+
functionName: "deallocate",
|
|
14
|
+
args: [d, c.upnlSig ?? await a(s, {
|
|
15
|
+
virtualAccount: u,
|
|
16
|
+
chainId: l
|
|
17
|
+
})]
|
|
18
|
+
}), v = o({
|
|
19
|
+
abi: e,
|
|
20
|
+
functionName: "initiateWithdraw",
|
|
21
|
+
args: [
|
|
22
|
+
f,
|
|
23
|
+
p,
|
|
24
|
+
m
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
return c.timelock ? i(s, {
|
|
28
|
+
...c,
|
|
29
|
+
gasless: g,
|
|
30
|
+
callDatas: [_, v],
|
|
31
|
+
timelock: c.timelock
|
|
32
|
+
}) : n(s, {
|
|
33
|
+
account: u,
|
|
34
|
+
data: [_, v],
|
|
35
|
+
chainId: l,
|
|
36
|
+
from: h,
|
|
37
|
+
simulateBeforeWrite: c.simulateBeforeWrite,
|
|
38
|
+
gasless: g
|
|
30
39
|
});
|
|
31
40
|
}
|
|
32
41
|
//#endregion
|
|
33
|
-
export {
|
|
42
|
+
export { s as deallocateAndInitiateWithdraw };
|
|
34
43
|
|
|
35
44
|
//# sourceMappingURL=deallocate-and-initiate-withdraw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deallocate-and-initiate-withdraw.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash, type Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { getDeallocateUpnlSig } from \"../../../muon/deallocate-upnl-sig/get-deallocate-upnl-sig\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport type { SingleUpnlSig } from \"../../account-layer/types\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\nimport type { WithdrawReceiverPart } from \"../types\";\n\n/**\n * Parameters for {@link deallocateAndInitiateWithdraw}.\n */\nexport type DeallocateAndInitiateWithdrawParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /**\n * The subaccount to deallocate from and initiate the withdrawal for. Both\n * inner calls are routed through the AccountLayer `_call` proxy so the core\n * attributes them to this subaccount; the connected wallet must be its\n * on-chain `owner`.\n */\n account: Address;\n /**\n * Amount to move from the allocated balance back into the available balance,\n * in **18 decimals** (not the collateral token's decimals). This is the\n * `deallocate` leg; the freed collateral is what the withdrawal then requests.\n */\n amount: bigint;\n /**\n * The receiver parts the withdrawal is split into. A plain same-chain\n * withdrawal is a single part with both provider fields set to the zero\n * address — see `createClassicWithdrawPart`.\n */\n parts: readonly WithdrawReceiverPart[];\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n /**\n * A fresh Muon uPnL (`uPnl_A`) attestation for `account`, required by the\n * `deallocate` leg to prove the subaccount stays solvent. It is timestamped\n * and short-lived, so **omit it** to have the action fetch a fresh one (via\n * {@link getDeallocateUpnlSig}) immediately before submitting; pass one only\n * to reuse a signature you already fetched.\n */\n upnlSig?: SingleUpnlSig;\n }\n>;\n\n/** Return type of {@link deallocateAndInitiateWithdraw}: the submitted transaction hash. */\nexport type DeallocateAndInitiateWithdrawReturnType = Hash;\n\n/**\n * Batch a subaccount's **deallocate** and **initiate-withdraw** into a single\n * atomic transaction — the cross-margin / Base withdraw path.\n *\n * Encodes the SYMMIO core `deallocate(amount, upnlSig)` and\n * `initiateWithdraw(parts, speedUp, data)` calls and routes **both** through one\n * `AccountLayer._call(account, [deallocateData, withdrawData])`. `_call` runs the\n * calldatas in order in a single transaction and reverts the whole transaction if\n * any inner call reverts, so the two legs are all-or-nothing: the caller never\n * ends up with a deallocation that failed to produce its withdraw request.\n *\n * **Order matters.** `deallocate` (allocated → available) is encoded first so the\n * freed collateral exists in the available balance before `initiateWithdraw`\n * requests it.\n *\n * @remarks\n * The `deallocate` leg is subject to the on-chain **deallocate debounce** and\n * requires a fresh Muon `upnlSig`; a stale attestation or too-soon a call reverts\n * the whole batch. Dry-runs the batched `_call` with the pre-flight simulation\n * first unless `simulateBeforeWrite` is `false` (per-call, falling back to the\n * config default). For separate control over the two legs, call {@link deallocate}\n * and {@link initiateWithdraw} individually.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, amount (18 decimals), receiver parts, optional\n * speed-up / provider data, optional Muon `upnlSig` (fetched automatically via\n * {@link getDeallocateUpnlSig} when omitted), 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 part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId: 42161n });\n * // upnlSig fetched automatically:\n * const hash = await deallocateAndInitiateWithdraw(config, {\n * account: \"0xsub…\",\n * amount: 1_000000000000000000n,\n * parts: [part],\n * });\n * ```\n */\nexport async function deallocateAndInitiateWithdraw(\n config: Config,\n parameters: DeallocateAndInitiateWithdrawParameters,\n): Promise<DeallocateAndInitiateWithdrawReturnType> {\n const { chainId, account, amount, parts, speedUp = false, providerData = \"0x\", from } = parameters;\n\n const upnlSig = parameters.upnlSig ?? (await getDeallocateUpnlSig(config, { virtualAccount: account, chainId }));\n\n const deallocateData = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"deallocate\",\n args: [amount, upnlSig],\n });\n\n const withdrawData = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"initiateWithdraw\",\n args: [parts, speedUp, providerData],\n });\n\n // Order matters: deallocate (allocated → available) MUST precede initiateWithdraw.\n return callAsSubAccount(config, {\n account,\n data: [deallocateData, withdrawData],\n chainId,\n from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless
|
|
1
|
+
{"version":3,"file":"deallocate-and-initiate-withdraw.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash, type Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { withGaslessAttemptStart } from \"../../../gasless/dispatch/attempt-start\";\nimport { getDeallocateUpnlSig } from \"../../../muon/deallocate-upnl-sig/get-deallocate-upnl-sig\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport {\n assertTimelockBatchUnused,\n executeProtectedCoreBatch,\n type TimelockBatchAuthorization,\n} from \"../../../timelock/execute-protected-batch\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport type { SingleUpnlSig } from \"../../account-layer/types\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\nimport type { WithdrawReceiverPart } from \"../types\";\n\n/**\n * Parameters for {@link deallocateAndInitiateWithdraw}.\n */\nexport type DeallocateAndInitiateWithdrawParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /** Optional per-call authorization for the atomic Core batch. */\n timelock?: TimelockBatchAuthorization;\n /**\n * The subaccount to deallocate from and initiate the withdrawal for. Both\n * inner calls are routed through the AccountLayer `_call` proxy so the core\n * attributes them to this subaccount; the connected wallet must be its\n * on-chain `owner`.\n */\n account: Address;\n /**\n * Amount to move from the allocated balance back into the available balance,\n * in **18 decimals** (not the collateral token's decimals). This is the\n * `deallocate` leg; the freed collateral is what the withdrawal then requests.\n */\n amount: bigint;\n /**\n * The receiver parts the withdrawal is split into. A plain same-chain\n * withdrawal is a single part with both provider fields set to the zero\n * address — see `createClassicWithdrawPart`.\n */\n parts: readonly WithdrawReceiverPart[];\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n /**\n * A fresh Muon uPnL (`uPnl_A`) attestation for `account`, required by the\n * `deallocate` leg to prove the subaccount stays solvent. It is timestamped\n * and short-lived, so **omit it** to have the action fetch a fresh one (via\n * {@link getDeallocateUpnlSig}) immediately before submitting; pass one only\n * to reuse a signature you already fetched.\n */\n upnlSig?: SingleUpnlSig;\n }\n>;\n\n/** Return type of {@link deallocateAndInitiateWithdraw}: the submitted transaction hash. */\nexport type DeallocateAndInitiateWithdrawReturnType = Hash;\n\n/**\n * Batch a subaccount's **deallocate** and **initiate-withdraw** into a single\n * atomic transaction — the cross-margin / Base withdraw path.\n *\n * Encodes the SYMMIO core `deallocate(amount, upnlSig)` and\n * `initiateWithdraw(parts, speedUp, data)` calls and routes **both** through one\n * `AccountLayer._call(account, [deallocateData, withdrawData])`. `_call` runs the\n * calldatas in order in a single transaction and reverts the whole transaction if\n * any inner call reverts, so the two legs are all-or-nothing: the caller never\n * ends up with a deallocation that failed to produce its withdraw request.\n *\n * **Order matters.** `deallocate` (allocated → available) is encoded first so the\n * freed collateral exists in the available balance before `initiateWithdraw`\n * requests it.\n *\n * @remarks\n * The `deallocate` leg is subject to the on-chain **deallocate debounce** and\n * requires a fresh Muon `upnlSig`; a stale attestation or too-soon a call reverts\n * the whole batch. Dry-runs the batched `_call` with the pre-flight simulation\n * first unless `simulateBeforeWrite` is `false` (per-call, falling back to the\n * config default). For separate control over the two legs, call {@link deallocate}\n * and {@link initiateWithdraw} individually.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, amount (18 decimals), receiver parts, optional\n * speed-up / provider data, optional Muon `upnlSig` (fetched automatically via\n * {@link getDeallocateUpnlSig} when omitted), 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 part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId: 42161n });\n * // upnlSig fetched automatically:\n * const hash = await deallocateAndInitiateWithdraw(config, {\n * account: \"0xsub…\",\n * amount: 1_000000000000000000n,\n * parts: [part],\n * });\n * ```\n */\nexport async function deallocateAndInitiateWithdraw(\n config: Config,\n parameters: DeallocateAndInitiateWithdrawParameters,\n): Promise<DeallocateAndInitiateWithdrawReturnType> {\n const { chainId, account, amount, parts, speedUp = false, providerData = \"0x\", from } = parameters;\n if (parameters.timelock) assertTimelockBatchUnused(parameters.timelock);\n /** The Muon fetch below counts against the gasless signature lifetime. */\n const gasless = withGaslessAttemptStart(parameters.gasless);\n\n const upnlSig = parameters.upnlSig ?? (await getDeallocateUpnlSig(config, { virtualAccount: account, chainId }));\n\n const deallocateData = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"deallocate\",\n args: [amount, upnlSig],\n });\n\n const withdrawData = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"initiateWithdraw\",\n args: [parts, speedUp, providerData],\n });\n\n if (parameters.timelock)\n return executeProtectedCoreBatch(config, {\n ...parameters,\n gasless,\n callDatas: [deallocateData, withdrawData],\n timelock: parameters.timelock,\n });\n\n // Order matters: deallocate (allocated → available) MUST precede initiateWithdraw.\n return callAsSubAccount(config, {\n account,\n data: [deallocateData, withdrawData],\n chainId,\n from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless,\n });\n}\n"],"mappings":";;;;;;;AA8GA,eAAsB,EACpB,GACA,GACkD;CAClD,IAAM,EAAE,YAAS,YAAS,WAAQ,UAAO,aAAU,IAAO,kBAAe,MAAM,YAAS;CACxF,AAAI,EAAW,YAAU,EAA0B,EAAW,QAAQ;CAEtE,IAAM,IAAU,EAAwB,EAAW,OAAO,GAIpD,IAAiB,EAAmB;EACxC,KAAK;EACL,cAAc;EACd,MAAM,CAAC,GALO,EAAW,WAAY,MAAM,EAAqB,GAAQ;GAAE,gBAAgB;GAAS;EAAQ,CAAC,CAKtF;CACxB,CAAC,GAEK,IAAe,EAAmB;EACtC,KAAK;EACL,cAAc;EACd,MAAM;GAAC;GAAO;GAAS;EAAY;CACrC,CAAC;CAWD,OATI,EAAW,WACN,EAA0B,GAAQ;EACvC,GAAG;EACH;EACA,WAAW,CAAC,GAAgB,CAAY;EACxC,UAAU,EAAW;CACvB,CAAC,IAGI,EAAiB,GAAQ;EAC9B;EACA,MAAM,CAAC,GAAgB,CAAY;EACnC;EACA;EACA,qBAAqB,EAAW;EAChC;CACF,CAAC;AACH"}
|
|
@@ -1,11 +1,14 @@
|
|
|
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
|
import { SingleUpnlSig } from '../../account-layer/types.js';
|
|
5
6
|
/**
|
|
6
7
|
* Parameters for {@link deallocate}.
|
|
7
8
|
*/
|
|
8
9
|
export type DeallocateParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
|
|
10
|
+
/** Optional authorization for a timelocked selector. */
|
|
11
|
+
timelock?: TimelockAuthorization;
|
|
9
12
|
/**
|
|
10
13
|
* The subaccount to deallocate from. The call is routed through the
|
|
11
14
|
* AccountLayer `_call` proxy; the connected wallet must be its on-chain `owner`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deallocate.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/deallocate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"deallocate.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/deallocate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,CACxC,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CACJ,CAAC;AAEF,yEAAyE;AACzE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAgChH"}
|
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { withGaslessAttemptStart as t } from "../../../gasless/dispatch/attempt-start.js";
|
|
3
|
+
import { assertTimelockAuthorizationUnused as n, executeProtectedCall as r } from "../../../timelock/execute-protected-call.js";
|
|
4
|
+
import { callAsSubAccount as i } from "../internal/call-as-sub-account.js";
|
|
5
|
+
import { getDeallocateUpnlSig as a } from "../../../muon/deallocate-upnl-sig/get-deallocate-upnl-sig.js";
|
|
6
|
+
import { encodeFunctionData as o } from "viem";
|
|
5
7
|
//#region src/symmio-contracts/symmio/actions/deallocate.ts
|
|
6
|
-
async function
|
|
7
|
-
let { chainId:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
async function s(s, c) {
|
|
9
|
+
let { chainId: l, account: u, amount: d } = c;
|
|
10
|
+
c.timelock && n(c.timelock);
|
|
11
|
+
let f = t(c.gasless), p = o({
|
|
12
|
+
abi: e,
|
|
13
|
+
functionName: "deallocate",
|
|
14
|
+
args: [d, c.upnlSig ?? await a(s, {
|
|
15
|
+
virtualAccount: c.account,
|
|
16
|
+
chainId: l
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
return c.timelock ? r(s, {
|
|
20
|
+
...c,
|
|
21
|
+
gasless: f,
|
|
22
|
+
callData: p,
|
|
23
|
+
target: "core",
|
|
24
|
+
timelock: c.timelock
|
|
25
|
+
}) : i(s, {
|
|
26
|
+
account: u,
|
|
27
|
+
data: p,
|
|
28
|
+
chainId: l,
|
|
29
|
+
from: c.from,
|
|
30
|
+
simulateBeforeWrite: c.simulateBeforeWrite,
|
|
31
|
+
gasless: f
|
|
22
32
|
});
|
|
23
33
|
}
|
|
24
34
|
//#endregion
|
|
25
|
-
export {
|
|
35
|
+
export { s as deallocate };
|
|
26
36
|
|
|
27
37
|
//# sourceMappingURL=deallocate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deallocate.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/deallocate.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { getDeallocateUpnlSig } from \"../../../muon/deallocate-upnl-sig/get-deallocate-upnl-sig\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport type { SingleUpnlSig } from \"../../account-layer/types\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\n\n/**\n * Parameters for {@link deallocate}.\n */\nexport type DeallocateParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /**\n * The subaccount to deallocate from. 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 allocated balance back into the available balance,\n * in **18 decimals** (not the collateral token's decimals).\n */\n amount: bigint;\n /**\n * A fresh Muon uPnL (`uPnl_A`) attestation for `account`. The contract\n * verifies it to prove the subaccount stays solvent after the deallocation.\n * It is timestamped and short-lived, so **omit it** to have the action fetch a\n * fresh one (via {@link getDeallocateUpnlSig}) immediately before submitting;\n * pass one only to reuse a signature you already fetched.\n */\n upnlSig?: SingleUpnlSig;\n }\n>;\n\n/** Return type of {@link deallocate}: the submitted transaction hash. */\nexport type DeallocateReturnType = Hash;\n\n/**\n * Move collateral from a subaccount's **allocated (tradeable) balance** back into\n * its **available balance** on the SYMMIO core.\n *\n * The reverse of {@link allocate}: the subaccount's allocated balance is debited\n * and its available balance credited, in 18-decimal units, after the contract\n * verifies the Muon uPnL signature keeps the subaccount solvent. The freed\n * collateral can then be withdrawn (subject to the separate withdraw cooldown).\n *\n * Encodes the SYMMIO core `deallocate(amount, upnlSig)` call and routes it through\n * `AccountLayer._call(account, …)` so the core attributes it to the subaccount.\n *\n * @remarks\n * Subject to the on-chain **deallocate debounce**: calling too soon after a prior\n * deallocate reverts (\"Too many deallocate in a short window\"). This is distinct\n * from the withdraw cooldown that later gates moving the freed collateral to the\n * wallet. The `upnlSig` must be freshly fetched — a stale attestation reverts.\n *\n * Dry-runs the call with {@link simulateDeallocate} 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 Muon `upnlSig`\n * (fetched automatically via {@link getDeallocateUpnlSig} when omitted), 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 * // upnlSig fetched automatically:\n * const hash = await deallocate(config, { account: \"0xsub…\", amount: 1_000000000000000000n });\n * // or reuse a pre-fetched signature:\n * const upnlSig = await getDeallocateUpnlSig(config, { virtualAccount: \"0xsub…\" });\n * await deallocate(config, { account: \"0xsub…\", amount: 1_000000000000000000n, upnlSig });\n * ```\n */\nexport async function deallocate(config: Config, parameters: DeallocateParameters): Promise<DeallocateReturnType> {\n const { chainId, account, amount } = parameters;\n\n const upnlSig =\n parameters.upnlSig ?? (await getDeallocateUpnlSig(config, { virtualAccount: parameters.account, chainId }));\n\n const data = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"deallocate\",\n args: [amount, upnlSig],\n });\n\n return callAsSubAccount(config, {\n account,\n data,\n chainId,\n from: parameters.from,\n simulateBeforeWrite: parameters.simulateBeforeWrite,\n gasless
|
|
1
|
+
{"version":3,"file":"deallocate.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/deallocate.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { withGaslessAttemptStart } from \"../../../gasless/dispatch/attempt-start\";\nimport { getDeallocateUpnlSig } from \"../../../muon/deallocate-upnl-sig/get-deallocate-upnl-sig\";\nimport type { Compute, GaslessWriteParameter, WriteContractParameter } from \"../../../shared/types/properties\";\nimport {\n assertTimelockAuthorizationUnused,\n executeProtectedCall,\n type TimelockAuthorization,\n} from \"../../../timelock/execute-protected-call\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport type { SingleUpnlSig } from \"../../account-layer/types\";\nimport { callAsSubAccount } from \"../internal/call-as-sub-account\";\n\n/**\n * Parameters for {@link deallocate}.\n */\nexport type DeallocateParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /** Optional authorization for a timelocked selector. */\n timelock?: TimelockAuthorization;\n /**\n * The subaccount to deallocate from. 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 allocated balance back into the available balance,\n * in **18 decimals** (not the collateral token's decimals).\n */\n amount: bigint;\n /**\n * A fresh Muon uPnL (`uPnl_A`) attestation for `account`. The contract\n * verifies it to prove the subaccount stays solvent after the deallocation.\n * It is timestamped and short-lived, so **omit it** to have the action fetch a\n * fresh one (via {@link getDeallocateUpnlSig}) immediately before submitting;\n * pass one only to reuse a signature you already fetched.\n */\n upnlSig?: SingleUpnlSig;\n }\n>;\n\n/** Return type of {@link deallocate}: the submitted transaction hash. */\nexport type DeallocateReturnType = Hash;\n\n/**\n * Move collateral from a subaccount's **allocated (tradeable) balance** back into\n * its **available balance** on the SYMMIO core.\n *\n * The reverse of {@link allocate}: the subaccount's allocated balance is debited\n * and its available balance credited, in 18-decimal units, after the contract\n * verifies the Muon uPnL signature keeps the subaccount solvent. The freed\n * collateral can then be withdrawn (subject to the separate withdraw cooldown).\n *\n * Encodes the SYMMIO core `deallocate(amount, upnlSig)` call and routes it through\n * `AccountLayer._call(account, …)` so the core attributes it to the subaccount.\n *\n * @remarks\n * Subject to the on-chain **deallocate debounce**: calling too soon after a prior\n * deallocate reverts (\"Too many deallocate in a short window\"). This is distinct\n * from the withdraw cooldown that later gates moving the freed collateral to the\n * wallet. The `upnlSig` must be freshly fetched — a stale attestation reverts.\n *\n * Dry-runs the call with {@link simulateDeallocate} 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 Muon `upnlSig`\n * (fetched automatically via {@link getDeallocateUpnlSig} when omitted), 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 * // upnlSig fetched automatically:\n * const hash = await deallocate(config, { account: \"0xsub…\", amount: 1_000000000000000000n });\n * // or reuse a pre-fetched signature:\n * const upnlSig = await getDeallocateUpnlSig(config, { virtualAccount: \"0xsub…\" });\n * await deallocate(config, { account: \"0xsub…\", amount: 1_000000000000000000n, upnlSig });\n * ```\n */\nexport async function deallocate(config: Config, parameters: DeallocateParameters): Promise<DeallocateReturnType> {\n const { chainId, account, amount } = parameters;\n if (parameters.timelock) assertTimelockAuthorizationUnused(parameters.timelock);\n /** The Muon fetch below counts against the gasless signature lifetime. */\n const gasless = withGaslessAttemptStart(parameters.gasless);\n\n const upnlSig =\n parameters.upnlSig ?? (await getDeallocateUpnlSig(config, { virtualAccount: parameters.account, chainId }));\n\n const data = encodeFunctionData({\n abi: symmioAbi,\n functionName: \"deallocate\",\n args: [amount, upnlSig],\n });\n\n if (parameters.timelock)\n return executeProtectedCall(config, {\n ...parameters,\n gasless,\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,\n });\n}\n"],"mappings":";;;;;;;AAmFA,eAAsB,EAAW,GAAgB,GAAiE;CAChH,IAAM,EAAE,YAAS,YAAS,cAAW;CACrC,AAAI,EAAW,YAAU,EAAkC,EAAW,QAAQ;CAE9E,IAAM,IAAU,EAAwB,EAAW,OAAO,GAKpD,IAAO,EAAmB;EAC9B,KAAK;EACL,cAAc;EACd,MAAM,CAAC,GALP,EAAW,WAAY,MAAM,EAAqB,GAAQ;GAAE,gBAAgB,EAAW;GAAS;EAAQ,CAAC,CAKnF;CACxB,CAAC;CAWD,OATI,EAAW,WACN,EAAqB,GAAQ;EAClC,GAAG;EACH;EACA,UAAU;EACV,QAAQ;EACR,UAAU,EAAW;CACvB,CAAC,IAEI,EAAiB,GAAQ;EAC9B;EACA;EACA;EACA,MAAM,EAAW;EACjB,qBAAqB,EAAW;EAChC;CACF,CAAC;AACH"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Address, Hash, Hex } 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
|
import { WithdrawReceiverPart } from '../types.js';
|
|
5
6
|
/**
|
|
6
7
|
* Parameters for {@link initiateWithdraw}.
|
|
7
8
|
*/
|
|
8
9
|
export type InitiateWithdrawParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
|
|
10
|
+
/** Optional authorization for a timelocked selector. */
|
|
11
|
+
timelock?: TimelockAuthorization;
|
|
9
12
|
/**
|
|
10
13
|
* The subaccount initiating the withdrawal. The call is routed through the
|
|
11
14
|
* AccountLayer `_call` proxy so the core sees this subaccount as the caller;
|
|
@@ -33,6 +36,8 @@ export type InitiateWithdrawParameters = Compute<WriteContractParameter & Gasles
|
|
|
33
36
|
}>;
|
|
34
37
|
/** Return type of {@link initiateWithdraw}: the submitted transaction hash. */
|
|
35
38
|
export type InitiateWithdrawReturnType = Hash;
|
|
39
|
+
/** Encode the canonical raw Core calldata bound by a timelock approval or schedule. */
|
|
40
|
+
export declare function encodeInitiateWithdrawCall(parameters: Pick<InitiateWithdrawParameters, "parts" | "speedUp" | "providerData">): Hex;
|
|
36
41
|
/**
|
|
37
42
|
* Open a withdraw request for a subaccount.
|
|
38
43
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initiate-withdraw.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/initiate-withdraw.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;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"initiate-withdraw.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/initiate-withdraw.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;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAAwB,KAAK,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAG5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAC9C,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CACJ,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAE9C,uFAAuF;AACvF,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,IAAI,CAAC,0BAA0B,EAAE,OAAO,GAAG,SAAS,GAAG,cAAc,CAAC,GACjF,GAAG,CAML;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,0BAA0B,GACrC,OAAO,CAAC,0BAA0B,CAAC,CAqBrC"}
|
|
@@ -1,27 +1,40 @@
|
|
|
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/initiate-withdraw.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
function i(t) {
|
|
7
|
+
return r({
|
|
8
|
+
abi: e,
|
|
9
|
+
functionName: "initiateWithdraw",
|
|
10
|
+
args: [
|
|
11
|
+
t.parts,
|
|
12
|
+
t.speedUp ?? !1,
|
|
13
|
+
t.providerData ?? "0x"
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async function a(e, r) {
|
|
18
|
+
let { chainId: a, account: o, parts: s, speedUp: c = !1, providerData: l = "0x" } = r, u = i({
|
|
19
|
+
parts: s,
|
|
20
|
+
speedUp: c,
|
|
21
|
+
providerData: l
|
|
22
|
+
});
|
|
23
|
+
return r.timelock ? t(e, {
|
|
24
|
+
...r,
|
|
25
|
+
callData: u,
|
|
26
|
+
target: "core",
|
|
27
|
+
timelock: r.timelock
|
|
28
|
+
}) : n(e, {
|
|
8
29
|
account: o,
|
|
9
|
-
data:
|
|
10
|
-
abi: e,
|
|
11
|
-
functionName: "initiateWithdraw",
|
|
12
|
-
args: [
|
|
13
|
-
s,
|
|
14
|
-
c,
|
|
15
|
-
l
|
|
16
|
-
]
|
|
17
|
-
}),
|
|
30
|
+
data: u,
|
|
18
31
|
chainId: a,
|
|
19
|
-
from:
|
|
20
|
-
simulateBeforeWrite:
|
|
21
|
-
gasless:
|
|
32
|
+
from: r.from,
|
|
33
|
+
simulateBeforeWrite: r.simulateBeforeWrite,
|
|
34
|
+
gasless: r.gasless
|
|
22
35
|
});
|
|
23
36
|
}
|
|
24
37
|
//#endregion
|
|
25
|
-
export {
|
|
38
|
+
export { i as encodeInitiateWithdrawCall, a as initiateWithdraw };
|
|
26
39
|
|
|
27
40
|
//# sourceMappingURL=initiate-withdraw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initiate-withdraw.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/initiate-withdraw.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash, type Hex } 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\";\nimport type { WithdrawReceiverPart } from \"../types\";\n\n/**\n * Parameters for {@link initiateWithdraw}.\n */\nexport type InitiateWithdrawParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /**\n * The subaccount initiating the withdrawal. The call is routed through the\n * AccountLayer `_call` proxy so the core sees this subaccount as the caller;\n * the connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * The receiver parts the withdrawal is split into. A plain same-chain\n * withdrawal is a single part with both provider fields set to the zero\n * address — see `createClassicWithdrawPart`.\n */\n parts: readonly WithdrawReceiverPart[];\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n }\n>;\n\n/** Return type of {@link initiateWithdraw}: the submitted transaction hash. */\nexport type InitiateWithdrawReturnType = Hash;\n\n/**\n * Open a withdraw request for a subaccount.\n *\n * Encodes the SYMMIO core `initiateWithdraw(parts, speedUp, data)` call and routes\n * it through `AccountLayer._call(account, …)` so the core attributes the request\n * to `account`. The request matures after the cooldown (tied to the subaccount's\n * last deallocation) and is then completed with {@link finalizeWithdrawRequest}.\n *\n * Dry-runs the call with {@link simulateInitiateWithdraw} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @remarks\n * The full input surface is exposed: provider fields on each part plus `speedUp`\n * and `providerData` enable express/virtual/cross-chain withdrawals where\n * providers are available. For a standard same-chain withdrawal, pass a single\n * classic part and leave `speedUp`/`providerData` at their defaults.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, receiver parts, optional speed-up / provider data, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt; the\n * created `requestId` is available from the receipt's events or via\n * `getLastWithdrawRequestId`.\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 part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId: 42161n });\n * const hash = await initiateWithdraw(config, { account: \"0xsub…\", parts: [part] });\n * ```\n */\nexport async function initiateWithdraw(\n config: Config,\n parameters: InitiateWithdrawParameters,\n): Promise<InitiateWithdrawReturnType> {\n const { chainId, account, parts, speedUp = false, providerData = \"0x\" } = parameters;\n\n const data =
|
|
1
|
+
{"version":3,"file":"initiate-withdraw.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/actions/initiate-withdraw.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hash, type Hex } 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\";\nimport type { WithdrawReceiverPart } from \"../types\";\n\n/**\n * Parameters for {@link initiateWithdraw}.\n */\nexport type InitiateWithdrawParameters = Compute<\n WriteContractParameter &\n GaslessWriteParameter & {\n /** Optional authorization for a timelocked selector. */\n timelock?: TimelockAuthorization;\n /**\n * The subaccount initiating the withdrawal. The call is routed through the\n * AccountLayer `_call` proxy so the core sees this subaccount as the caller;\n * the connected wallet must be its on-chain `owner`.\n */\n account: Address;\n /**\n * The receiver parts the withdrawal is split into. A plain same-chain\n * withdrawal is a single part with both provider fields set to the zero\n * address — see `createClassicWithdrawPart`.\n */\n parts: readonly WithdrawReceiverPart[];\n /**\n * Opt into the cooldown speed-up flow. Only effective for speed-up-eligible\n * users; ignored otherwise.\n * @default false\n */\n speedUp?: boolean;\n /**\n * Opaque provider data forwarded to express/virtual providers (e.g. a signed\n * option). Pass `0x` for a classic withdrawal.\n * @default \"0x\"\n */\n providerData?: Hex;\n }\n>;\n\n/** Return type of {@link initiateWithdraw}: the submitted transaction hash. */\nexport type InitiateWithdrawReturnType = Hash;\n\n/** Encode the canonical raw Core calldata bound by a timelock approval or schedule. */\nexport function encodeInitiateWithdrawCall(\n parameters: Pick<InitiateWithdrawParameters, \"parts\" | \"speedUp\" | \"providerData\">,\n): Hex {\n return encodeFunctionData({\n abi: symmioAbi,\n functionName: \"initiateWithdraw\",\n args: [parameters.parts, parameters.speedUp ?? false, parameters.providerData ?? \"0x\"],\n });\n}\n\n/**\n * Open a withdraw request for a subaccount.\n *\n * Encodes the SYMMIO core `initiateWithdraw(parts, speedUp, data)` call and routes\n * it through `AccountLayer._call(account, …)` so the core attributes the request\n * to `account`. The request matures after the cooldown (tied to the subaccount's\n * last deallocation) and is then completed with {@link finalizeWithdrawRequest}.\n *\n * Dry-runs the call with {@link simulateInitiateWithdraw} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @remarks\n * The full input surface is exposed: provider fields on each part plus `speedUp`\n * and `providerData` enable express/virtual/cross-chain withdrawals where\n * providers are available. For a standard same-chain withdrawal, pass a single\n * classic part and leave `speedUp`/`providerData` at their defaults.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount, receiver parts, optional speed-up / provider data, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt; the\n * created `requestId` is available from the receipt's events or via\n * `getLastWithdrawRequestId`.\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 part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId: 42161n });\n * const hash = await initiateWithdraw(config, { account: \"0xsub…\", parts: [part] });\n * ```\n */\nexport async function initiateWithdraw(\n config: Config,\n parameters: InitiateWithdrawParameters,\n): Promise<InitiateWithdrawReturnType> {\n const { chainId, account, parts, speedUp = false, providerData = \"0x\" } = parameters;\n\n const data = encodeInitiateWithdrawCall({ parts, speedUp, providerData });\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":";;;;;AA+CA,SAAgB,EACd,GACK;CACL,OAAO,EAAmB;EACxB,KAAK;EACL,cAAc;EACd,MAAM;GAAC,EAAW;GAAO,EAAW,WAAW;GAAO,EAAW,gBAAgB;EAAI;CACvF,CAAC;AACH;AAiCA,eAAsB,EACpB,GACA,GACqC;CACrC,IAAM,EAAE,YAAS,YAAS,UAAO,aAAU,IAAO,kBAAe,SAAS,GAEpE,IAAO,EAA2B;EAAE;EAAO;EAAS;CAAa,CAAC;CAUxE,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"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Address, Hash, Hex } from 'viem';
|
|
2
2
|
import { Config } from '../../../core/config/index.js';
|
|
3
3
|
import { Compute, GaslessWriteParameter, WriteContractParameter } from '../../../shared/types/properties.js';
|
|
4
|
+
import { TimelockBatchAuthorization } from '../../../timelock/execute-protected-batch.js';
|
|
5
|
+
import { TimelockAuthorization } from '../../../timelock/execute-protected-call.js';
|
|
4
6
|
import { SingleUpnlSig, SubAccountIsolationType } from '../../account-layer/types.js';
|
|
5
7
|
/**
|
|
6
8
|
* Parameters for {@link withdrawAuto}.
|
|
7
9
|
*/
|
|
8
10
|
export type WithdrawAutoParameters = Compute<WriteContractParameter & GaslessWriteParameter & {
|
|
11
|
+
/** Optional authorization for the selected withdrawal route. */
|
|
12
|
+
timelock?: TimelockAuthorization | TimelockBatchAuthorization;
|
|
9
13
|
/**
|
|
10
14
|
* The subaccount to withdraw from. The action routes the call through the
|
|
11
15
|
* AccountLayer `_call` proxy so the core attributes it to this subaccount; the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdraw-auto.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/withdraw-auto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"withdraw-auto.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/actions/withdraw-auto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE/G,OAAO,EAA6B,KAAK,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvH,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAIxF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,sBAAsB,GACpB,qBAAqB,GAAG;IACtB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,qBAAqB,GAAG,0BAA0B,CAAC;IAC9D;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CACJ,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,sBAAsB,GACjC,OAAO,CAAC,sBAAsB,CAAC,CAuCjC"}
|
|
@@ -1,33 +1,38 @@
|
|
|
1
1
|
import { getSubAccount as e } from "../../account-layer/actions/get-sub-account.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { withGaslessAttemptStart as t } from "../../../gasless/dispatch/attempt-start.js";
|
|
3
|
+
import { assertTimelockAuthorizationUnused as n } from "../../../timelock/execute-protected-call.js";
|
|
4
|
+
import { assertTimelockBatchUnused as r } from "../../../timelock/execute-protected-batch.js";
|
|
5
|
+
import { withdraw as i } from "./withdraw.js";
|
|
6
|
+
import { collateralToCore18 as a } from "../../../shared/utils/core-units.js";
|
|
7
|
+
import { createClassicWithdrawPart as o } from "../parts.js";
|
|
5
8
|
//#region src/symmio-contracts/symmio/actions/withdraw-auto.ts
|
|
6
|
-
async function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
async function s(s, c) {
|
|
10
|
+
c.timelock && ("calls" in c.timelock ? r(c.timelock) : n(c.timelock));
|
|
11
|
+
let l = c.chainId ?? s.defaultChainId, u = t(c.gasless), d = c.isolationType ?? (await e(s, {
|
|
12
|
+
account: c.account,
|
|
13
|
+
chainId: l
|
|
14
|
+
})).isolationType, { addresses: f } = s.getChainConfig(l), p = o({
|
|
11
15
|
id: 0n,
|
|
12
|
-
amount:
|
|
13
|
-
receiver:
|
|
14
|
-
chainId: BigInt(
|
|
15
|
-
}),
|
|
16
|
-
return
|
|
17
|
-
account:
|
|
18
|
-
isolationType:
|
|
19
|
-
parts: [
|
|
20
|
-
amount:
|
|
21
|
-
speedUp:
|
|
22
|
-
providerData:
|
|
23
|
-
upnlSig:
|
|
24
|
-
chainId:
|
|
25
|
-
from:
|
|
26
|
-
simulateBeforeWrite:
|
|
27
|
-
gasless:
|
|
16
|
+
amount: c.amount,
|
|
17
|
+
receiver: c.receiver,
|
|
18
|
+
chainId: BigInt(l)
|
|
19
|
+
}), m = a(c.amount, f.collateralDecimals);
|
|
20
|
+
return i(s, {
|
|
21
|
+
account: c.account,
|
|
22
|
+
isolationType: d,
|
|
23
|
+
parts: [p],
|
|
24
|
+
amount: m,
|
|
25
|
+
speedUp: c.speedUp,
|
|
26
|
+
providerData: c.providerData,
|
|
27
|
+
upnlSig: c.upnlSig,
|
|
28
|
+
chainId: l,
|
|
29
|
+
from: c.from,
|
|
30
|
+
simulateBeforeWrite: c.simulateBeforeWrite,
|
|
31
|
+
gasless: u,
|
|
32
|
+
...c.timelock ? { timelock: c.timelock } : {}
|
|
28
33
|
});
|
|
29
34
|
}
|
|
30
35
|
//#endregion
|
|
31
|
-
export {
|
|
36
|
+
export { s as withdrawAuto };
|
|
32
37
|
|
|
33
38
|
//# sourceMappingURL=withdraw-auto.js.map
|