rise-wallet 0.1.4-beta.1 → 0.2.28
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/README.md +64 -34
- package/dist/cli/Dialog.d.ts +34 -0
- package/dist/cli/Dialog.js +60 -0
- package/dist/cli/Dialog.js.map +1 -0
- package/dist/cli/Messenger.d.ts +7 -0
- package/dist/cli/Messenger.js +123 -0
- package/dist/cli/Messenger.js.map +1 -0
- package/dist/cli/bin/commands-D7N5ucUu.js +50 -0
- package/dist/cli/bin/index.js +9 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +3 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/internal/http.d.ts +6 -0
- package/dist/cli/internal/http.js +17 -0
- package/dist/cli/internal/http.js.map +1 -0
- package/dist/cli/tsdown.config.d.ts +2 -0
- package/dist/cli/tsdown.config.js +28 -0
- package/dist/cli/tsdown.config.js.map +1 -0
- package/dist/core/Chains.d.ts +210 -0
- package/dist/core/Chains.js +20 -0
- package/dist/core/Chains.js.map +1 -0
- package/dist/core/Dialog.d.ts +307 -0
- package/dist/core/Dialog.js +809 -0
- package/dist/core/Dialog.js.map +1 -0
- package/dist/core/Messenger.d.ts +164 -0
- package/dist/core/Messenger.js +207 -0
- package/dist/core/Messenger.js.map +1 -0
- package/dist/core/Mode.d.ts +4 -0
- package/dist/core/Mode.js +5 -0
- package/dist/core/Mode.js.map +1 -0
- package/dist/core/Porto.d.ts +1608 -0
- package/dist/core/Porto.js +105 -0
- package/dist/core/Porto.js.map +1 -0
- package/dist/core/RpcSchema.d.ts +81 -0
- package/dist/core/RpcSchema.js +2 -0
- package/dist/core/RpcSchema.js.map +1 -0
- package/dist/core/Storage.d.ts +14 -0
- package/dist/core/Storage.js +109 -0
- package/dist/core/Storage.js.map +1 -0
- package/dist/core/Transport.d.ts +22 -0
- package/dist/core/Transport.js +37 -0
- package/dist/core/Transport.js.map +1 -0
- package/dist/core/internal/_generated/chains.d.ts +1 -0
- package/dist/core/internal/_generated/chains.js +3 -0
- package/dist/core/internal/_generated/chains.js.map +1 -0
- package/dist/core/internal/_generated/contracts/IthacaAccount.d.ts +1120 -0
- package/dist/core/internal/_generated/contracts/IthacaAccount.js +1453 -0
- package/dist/core/internal/_generated/contracts/IthacaAccount.js.map +1 -0
- package/dist/core/internal/call.d.ts +163 -0
- package/dist/core/internal/call.js +115 -0
- package/dist/core/internal/call.js.map +1 -0
- package/dist/core/internal/erc8010.d.ts +17 -0
- package/dist/core/internal/erc8010.js +29 -0
- package/dist/core/internal/erc8010.js.map +1 -0
- package/dist/core/internal/intersectionObserver.d.ts +1 -0
- package/dist/core/internal/intersectionObserver.js +5 -0
- package/dist/core/internal/intersectionObserver.js.map +1 -0
- package/dist/core/internal/logger.d.ts +21 -0
- package/dist/core/internal/logger.js +24 -0
- package/dist/core/internal/logger.js.map +1 -0
- package/dist/core/internal/mode.d.ts +344 -0
- package/dist/core/internal/mode.js +110 -0
- package/dist/core/internal/mode.js.map +1 -0
- package/dist/core/internal/modes/dialog.d.ts +799 -0
- package/dist/core/internal/modes/dialog.js +760 -0
- package/dist/core/internal/modes/dialog.js.map +1 -0
- package/dist/core/internal/modes/reactNative.d.ts +1401 -0
- package/dist/core/internal/modes/reactNative.js +19 -0
- package/dist/core/internal/modes/reactNative.js.map +1 -0
- package/dist/core/internal/modes/relay.d.ts +684 -0
- package/dist/core/internal/modes/relay.js +708 -0
- package/dist/core/internal/modes/relay.js.map +1 -0
- package/dist/core/internal/permissions.d.ts +59 -0
- package/dist/core/internal/permissions.js +30 -0
- package/dist/core/internal/permissions.js.map +1 -0
- package/dist/core/internal/permissionsRequest.d.ts +71 -0
- package/dist/core/internal/permissionsRequest.js +58 -0
- package/dist/core/internal/permissionsRequest.js.map +1 -0
- package/dist/core/internal/porto.d.ts +13 -0
- package/dist/core/internal/porto.js +2 -0
- package/dist/core/internal/porto.js.map +1 -0
- package/dist/core/internal/promise.d.ts +8 -0
- package/dist/core/internal/promise.js +11 -0
- package/dist/core/internal/promise.js.map +1 -0
- package/dist/core/internal/provider.d.ts +29 -0
- package/dist/core/internal/provider.js +941 -0
- package/dist/core/internal/provider.js.map +1 -0
- package/dist/core/internal/relay/rpcSchema.d.ts +75 -0
- package/dist/core/internal/relay/rpcSchema.js +7 -0
- package/dist/core/internal/relay/rpcSchema.js.map +1 -0
- package/dist/core/internal/relay/schema/capabilities.d.ts +164 -0
- package/dist/core/internal/relay/schema/capabilities.js +112 -0
- package/dist/core/internal/relay/schema/capabilities.js.map +1 -0
- package/dist/core/internal/relay/schema/intent.d.ts +167 -0
- package/dist/core/internal/relay/schema/intent.js +170 -0
- package/dist/core/internal/relay/schema/intent.js.map +1 -0
- package/dist/core/internal/relay/schema/key.d.ts +43 -0
- package/dist/core/internal/relay/schema/key.js +30 -0
- package/dist/core/internal/relay/schema/key.js.map +1 -0
- package/dist/core/internal/relay/schema/permission.d.ts +39 -0
- package/dist/core/internal/relay/schema/permission.js +29 -0
- package/dist/core/internal/relay/schema/permission.js.map +1 -0
- package/dist/core/internal/relay/schema/preCall.d.ts +62 -0
- package/dist/core/internal/relay/schema/preCall.js +36 -0
- package/dist/core/internal/relay/schema/preCall.js.map +1 -0
- package/dist/core/internal/relay/schema/quotes.d.ts +369 -0
- package/dist/core/internal/relay/schema/quotes.js +89 -0
- package/dist/core/internal/relay/schema/quotes.js.map +1 -0
- package/dist/core/internal/relay/schema/rpc.d.ts +1528 -0
- package/dist/core/internal/relay/schema/rpc.js +638 -0
- package/dist/core/internal/relay/schema/rpc.js.map +1 -0
- package/dist/core/internal/relay/schema/token.d.ts +13 -0
- package/dist/core/internal/relay/schema/token.js +13 -0
- package/dist/core/internal/relay/schema/token.js.map +1 -0
- package/dist/core/internal/requiredFunds.d.ts +18 -0
- package/dist/core/internal/requiredFunds.js +25 -0
- package/dist/core/internal/requiredFunds.js.map +1 -0
- package/dist/core/internal/schema/capabilities.d.ts +313 -0
- package/dist/core/internal/schema/capabilities.js +133 -0
- package/dist/core/internal/schema/capabilities.js.map +1 -0
- package/dist/core/internal/schema/key.d.ts +164 -0
- package/dist/core/internal/schema/key.js +75 -0
- package/dist/core/internal/schema/key.js.map +1 -0
- package/dist/core/internal/schema/permissions.d.ts +102 -0
- package/dist/core/internal/schema/permissions.js +28 -0
- package/dist/core/internal/schema/permissions.js.map +1 -0
- package/dist/core/internal/schema/request.d.ts +937 -0
- package/dist/core/internal/schema/request.js +57 -0
- package/dist/core/internal/schema/request.js.map +1 -0
- package/dist/core/internal/schema/rpc.d.ts +3314 -0
- package/dist/core/internal/schema/rpc.js +599 -0
- package/dist/core/internal/schema/rpc.js.map +1 -0
- package/dist/core/internal/schema/token.d.ts +1 -0
- package/dist/core/internal/schema/token.js +2 -0
- package/dist/core/internal/schema/token.js.map +1 -0
- package/dist/core/internal/schema/utils.d.ts +18 -0
- package/dist/core/internal/schema/utils.js +213 -0
- package/dist/core/internal/schema/utils.js.map +1 -0
- package/dist/core/internal/siwe.d.ts +32 -0
- package/dist/core/internal/siwe.js +92 -0
- package/dist/core/internal/siwe.js.map +1 -0
- package/dist/core/internal/store.d.ts +2 -0
- package/dist/core/internal/store.js +9 -0
- package/dist/core/internal/store.js.map +1 -0
- package/dist/core/internal/tokens.d.ts +57 -0
- package/dist/core/internal/tokens.js +69 -0
- package/dist/core/internal/tokens.js.map +1 -0
- package/dist/core/internal/types.d.ts +298 -0
- package/dist/core/internal/types.js +2 -0
- package/dist/core/internal/types.js.map +1 -0
- package/dist/core/internal/urlString.d.ts +1 -0
- package/dist/core/internal/urlString.js +8 -0
- package/dist/core/internal/urlString.js.map +1 -0
- package/dist/core/internal/userAgent.d.ts +10 -0
- package/dist/core/internal/userAgent.js +19 -0
- package/dist/core/internal/userAgent.js.map +1 -0
- package/dist/core/internal/utils.d.ts +24 -0
- package/dist/core/internal/utils.js +62 -0
- package/dist/core/internal/utils.js.map +1 -0
- package/dist/core/react-native/Porto.d.ts +1480 -0
- package/dist/core/react-native/Porto.js +17 -0
- package/dist/core/react-native/Porto.js.map +1 -0
- package/dist/core/react-native/configure.d.ts +9 -0
- package/dist/core/react-native/configure.js +24 -0
- package/dist/core/react-native/configure.js.map +1 -0
- package/dist/core/react-native/environment.d.ts +26 -0
- package/dist/core/react-native/environment.js +13 -0
- package/dist/core/react-native/environment.js.map +1 -0
- package/dist/core/react-native/index.d.ts +4 -0
- package/dist/core/react-native/index.js +5 -0
- package/dist/core/react-native/index.js.map +1 -0
- package/dist/core/react-native/utils.d.ts +1 -0
- package/dist/core/react-native/utils.js +12 -0
- package/dist/core/react-native/utils.js.map +1 -0
- package/dist/index.d.ts +16 -2
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -0
- package/dist/internal/index.d.ts +3 -0
- package/dist/internal/index.js +4 -0
- package/dist/internal/index.js.map +1 -0
- package/dist/react-native/crypto.d.ts +1 -0
- package/dist/react-native/crypto.js +12 -0
- package/dist/react-native/crypto.js.map +1 -0
- package/dist/react-native/index.d.ts +7 -0
- package/dist/react-native/index.js +12 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/register.d.ts +2 -0
- package/dist/react-native/register.js +15 -0
- package/dist/react-native/register.js.map +1 -0
- package/dist/register/index.d.ts +14 -0
- package/dist/register/index.js +2 -0
- package/dist/register/index.js.map +1 -0
- package/dist/remote/Actions.d.ts +33 -0
- package/dist/remote/Actions.js +76 -0
- package/dist/remote/Actions.js.map +1 -0
- package/dist/remote/Events.d.ts +46 -0
- package/dist/remote/Events.js +132 -0
- package/dist/remote/Events.js.map +1 -0
- package/dist/remote/Hooks.d.ts +3800 -0
- package/dist/remote/Hooks.js +106 -0
- package/dist/remote/Hooks.js.map +1 -0
- package/dist/remote/Porto.d.ts +857 -0
- package/dist/remote/Porto.js +66 -0
- package/dist/remote/Porto.js.map +1 -0
- package/dist/remote/index.d.ts +4 -0
- package/dist/remote/index.js +5 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/internal/methodPolicies.d.ts +96 -0
- package/dist/remote/internal/methodPolicies.js +102 -0
- package/dist/remote/internal/methodPolicies.js.map +1 -0
- package/dist/server/Route.d.ts +87 -0
- package/dist/server/Route.js +189 -0
- package/dist/server/Route.js.map +1 -0
- package/dist/server/Router.d.ts +23 -0
- package/dist/server/Router.js +29 -0
- package/dist/server/Router.js.map +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +3 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/internal/merchantSchema.d.ts +64 -0
- package/dist/server/internal/merchantSchema.js +7 -0
- package/dist/server/internal/merchantSchema.js.map +1 -0
- package/dist/server/internal/requestListener.d.ts +123 -0
- package/dist/server/internal/requestListener.js +172 -0
- package/dist/server/internal/requestListener.js.map +1 -0
- package/dist/theme/Theme.d.ts +121 -0
- package/dist/theme/Theme.js +18 -0
- package/dist/theme/Theme.js.map +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/trusted-hosts.d.ts +1 -0
- package/dist/trusted-hosts.js +41 -0
- package/dist/trusted-hosts.js.map +1 -0
- package/dist/viem/Account.d.ts +110 -0
- package/dist/viem/Account.js +132 -0
- package/dist/viem/Account.js.map +1 -0
- package/dist/viem/AccountActions.d.ts +10 -0
- package/dist/viem/AccountActions.js +14 -0
- package/dist/viem/AccountActions.js.map +1 -0
- package/dist/viem/CapabilitiesSchema.d.ts +14 -0
- package/dist/viem/CapabilitiesSchema.js +2 -0
- package/dist/viem/CapabilitiesSchema.js.map +1 -0
- package/dist/viem/ContractActions.d.ts +208 -0
- package/dist/viem/ContractActions.js +350 -0
- package/dist/viem/ContractActions.js.map +1 -0
- package/dist/viem/Key.d.ts +1155 -0
- package/dist/viem/Key.js +924 -0
- package/dist/viem/Key.js.map +1 -0
- package/dist/viem/RelayActions.d.ts +435 -0
- package/dist/viem/RelayActions.js +385 -0
- package/dist/viem/RelayActions.js.map +1 -0
- package/dist/viem/RelayClient.d.ts +26 -0
- package/dist/viem/RelayClient.js +44 -0
- package/dist/viem/RelayClient.js.map +1 -0
- package/dist/viem/RpcSchema.d.ts +22 -0
- package/dist/viem/RpcSchema.js +2 -0
- package/dist/viem/RpcSchema.js.map +1 -0
- package/dist/viem/WalletActions.d.ts +86 -0
- package/dist/viem/WalletActions.js +220 -0
- package/dist/viem/WalletActions.js.map +1 -0
- package/dist/viem/WalletClient.d.ts +20 -0
- package/dist/viem/WalletClient.js +23 -0
- package/dist/viem/WalletClient.js.map +1 -0
- package/dist/viem/index.d.ts +13 -0
- package/dist/viem/index.js +12 -0
- package/dist/viem/index.js.map +1 -0
- package/dist/viem/internal/relayActions.d.ts +364 -0
- package/dist/viem/internal/relayActions.js +783 -0
- package/dist/viem/internal/relayActions.js.map +1 -0
- package/dist/viem/internal/utils.d.ts +15 -0
- package/dist/viem/internal/utils.js +2 -0
- package/dist/viem/internal/utils.js.map +1 -0
- package/dist/wagmi/Actions.d.ts +1 -0
- package/dist/wagmi/Actions.js +2 -0
- package/dist/wagmi/Actions.js.map +1 -0
- package/dist/wagmi/Connector.d.ts +26 -0
- package/dist/wagmi/Connector.js +238 -0
- package/dist/wagmi/Connector.js.map +1 -0
- package/dist/wagmi/Hooks.d.ts +1 -0
- package/dist/wagmi/Hooks.js +2 -0
- package/dist/wagmi/Hooks.js.map +1 -0
- package/dist/wagmi/Query.d.ts +1 -0
- package/dist/wagmi/Query.js +2 -0
- package/dist/wagmi/Query.js.map +1 -0
- package/dist/wagmi/index.d.ts +4 -0
- package/dist/wagmi/index.js +5 -0
- package/dist/wagmi/index.js.map +1 -0
- package/dist/wagmi/internal/core.d.ts +83 -0
- package/dist/wagmi/internal/core.js +229 -0
- package/dist/wagmi/internal/core.js.map +1 -0
- package/dist/wagmi/internal/query.d.ts +32 -0
- package/dist/wagmi/internal/query.js +23 -0
- package/dist/wagmi/internal/query.js.map +1 -0
- package/dist/wagmi/internal/react.d.ts +90 -0
- package/dist/wagmi/internal/react.js +256 -0
- package/dist/wagmi/internal/react.js.map +1 -0
- package/dist/wagmi/internal/types.d.ts +10 -0
- package/dist/wagmi/internal/types.js +2 -0
- package/dist/wagmi/internal/types.js.map +1 -0
- package/dist/wagmi/internal/utils.d.ts +1 -0
- package/dist/wagmi/internal/utils.js +18 -0
- package/dist/wagmi/internal/utils.js.map +1 -0
- package/package.json +286 -34
- package/src/cli/Dialog.ts +75 -0
- package/src/cli/Messenger.ts +148 -0
- package/src/cli/bin/index.ts +37 -0
- package/src/cli/bin/tsconfig.json +8 -0
- package/src/cli/index.ts +2 -0
- package/src/cli/internal/commands.ts +212 -0
- package/src/cli/internal/context.ts +56 -0
- package/src/cli/internal/http.ts +28 -0
- package/src/cli/internal/utils.ts +28 -0
- package/src/cli/tsdown.config.ts +37 -0
- package/src/core/Chains.ts +25 -0
- package/src/core/Dialog.ts +1059 -0
- package/src/core/Messenger.ts +394 -0
- package/src/core/Mode.ts +4 -0
- package/src/core/Porto.ts +287 -0
- package/src/core/RpcSchema.ts +124 -0
- package/src/core/Storage.ts +122 -0
- package/src/core/Transport.ts +45 -0
- package/src/core/internal/_generated/chains.ts +2 -0
- package/src/core/internal/_generated/contracts/EIP7702Proxy.ts +25 -0
- package/src/core/internal/_generated/contracts/Escrow.ts +330 -0
- package/src/core/internal/_generated/contracts/ExperimentERC20.ts +569 -0
- package/src/core/internal/_generated/contracts/ExperimentERC721.ts +588 -0
- package/src/core/internal/_generated/contracts/GuardedExecutor.ts +623 -0
- package/src/core/internal/_generated/contracts/ICallChecker.ts +34 -0
- package/src/core/internal/_generated/contracts/ICommon.ts +4 -0
- package/src/core/internal/_generated/contracts/IEscrow.ts +114 -0
- package/src/core/internal/_generated/contracts/IFunder.ts +80 -0
- package/src/core/internal/_generated/contracts/IFunderV4.ts +45 -0
- package/src/core/internal/_generated/contracts/IIthacaAccount.ts +107 -0
- package/src/core/internal/_generated/contracts/IOAppCore.ts +142 -0
- package/src/core/internal/_generated/contracts/IOAppMsgInspector.ts +45 -0
- package/src/core/internal/_generated/contracts/IOAppReceiver.ts +161 -0
- package/src/core/internal/_generated/contracts/IOrchestrator.ts +95 -0
- package/src/core/internal/_generated/contracts/ISettler.ts +52 -0
- package/src/core/internal/_generated/contracts/ISigner.ts +34 -0
- package/src/core/internal/_generated/contracts/IthacaAccount.ts +1454 -0
- package/src/core/internal/_generated/contracts/IthacaAccountNew.ts +1454 -0
- package/src/core/internal/_generated/contracts/IthacaAccountOld.ts +1454 -0
- package/src/core/internal/_generated/contracts/LayerZeroSettler.ts +811 -0
- package/src/core/internal/_generated/contracts/LibNonce.ts +15 -0
- package/src/core/internal/_generated/contracts/LibTStack.ts +4 -0
- package/src/core/internal/_generated/contracts/MultiSigSigner.ts +203 -0
- package/src/core/internal/_generated/contracts/OApp.ts +412 -0
- package/src/core/internal/_generated/contracts/OAppCore.ts +229 -0
- package/src/core/internal/_generated/contracts/OAppReceiver.ts +396 -0
- package/src/core/internal/_generated/contracts/OAppSender.ts +245 -0
- package/src/core/internal/_generated/contracts/Orchestrator.ts +390 -0
- package/src/core/internal/_generated/contracts/SimpleFunder.ts +534 -0
- package/src/core/internal/_generated/contracts/SimpleSettler.ts +360 -0
- package/src/core/internal/_generated/contracts/Simulator.ts +170 -0
- package/src/core/internal/_generated/contracts/TokenTransferLib.ts +4 -0
- package/src/core/internal/_snapshots/provider.browser.test.ts.snap +119 -0
- package/src/core/internal/_snapshots/provider.test.ts.snap +1103 -0
- package/src/core/internal/call.test.ts +116 -0
- package/src/core/internal/call.ts +245 -0
- package/src/core/internal/erc8010.test.ts +74 -0
- package/src/core/internal/erc8010.ts +44 -0
- package/src/core/internal/intersectionObserver.ts +5 -0
- package/src/core/internal/logger.ts +42 -0
- package/src/core/internal/mode.ts +498 -0
- package/src/core/internal/modes/dialog.ts +1051 -0
- package/src/core/internal/modes/reactNative.ts +29 -0
- package/src/core/internal/modes/relay.ts +893 -0
- package/src/core/internal/permissions.ts +43 -0
- package/src/core/internal/permissionsRequest.ts +88 -0
- package/src/core/internal/porto.ts +16 -0
- package/src/core/internal/promise.ts +19 -0
- package/src/core/internal/provider.browser.test.ts +311 -0
- package/src/core/internal/provider.test.ts +3552 -0
- package/src/core/internal/provider.ts +1277 -0
- package/src/core/internal/relay/rpcSchema.ts +101 -0
- package/src/core/internal/relay/schema/capabilities.test.ts +663 -0
- package/src/core/internal/relay/schema/capabilities.ts +156 -0
- package/src/core/internal/relay/schema/intent.test.ts +433 -0
- package/src/core/internal/relay/schema/intent.ts +174 -0
- package/src/core/internal/relay/schema/key.test.ts +424 -0
- package/src/core/internal/relay/schema/key.ts +34 -0
- package/src/core/internal/relay/schema/permission.test.ts +499 -0
- package/src/core/internal/relay/schema/permission.ts +34 -0
- package/src/core/internal/relay/schema/preCall.ts +39 -0
- package/src/core/internal/relay/schema/quotes.test.ts +901 -0
- package/src/core/internal/relay/schema/quotes.ts +98 -0
- package/src/core/internal/relay/schema/rpc.ts +822 -0
- package/src/core/internal/relay/schema/token.ts +16 -0
- package/src/core/internal/requiredFunds.test.ts +141 -0
- package/src/core/internal/requiredFunds.ts +45 -0
- package/src/core/internal/schema/capabilities.test.ts +1334 -0
- package/src/core/internal/schema/capabilities.ts +162 -0
- package/src/core/internal/schema/key.test.ts +570 -0
- package/src/core/internal/schema/key.ts +98 -0
- package/src/core/internal/schema/permissions.test.ts +948 -0
- package/src/core/internal/schema/permissions.ts +31 -0
- package/src/core/internal/schema/request.bench.ts +35 -0
- package/src/core/internal/schema/request.ts +90 -0
- package/src/core/internal/schema/rpc.ts +821 -0
- package/src/core/internal/schema/token.ts +1 -0
- package/src/core/internal/schema/utils.test.ts +572 -0
- package/src/core/internal/schema/utils.ts +236 -0
- package/src/core/internal/siwe.test.ts +473 -0
- package/src/core/internal/siwe.ts +144 -0
- package/src/core/internal/store.ts +9 -0
- package/src/core/internal/tokens.test.ts +317 -0
- package/src/core/internal/tokens.ts +125 -0
- package/src/core/internal/types.ts +448 -0
- package/src/core/internal/urlString.ts +5 -0
- package/src/core/internal/userAgent.ts +35 -0
- package/src/core/internal/utils.test.ts +35 -0
- package/src/core/internal/utils.ts +67 -0
- package/src/core/react-native/Porto.ts +22 -0
- package/src/core/react-native/configure.ts +31 -0
- package/src/core/react-native/environment.ts +43 -0
- package/src/core/react-native/index.ts +4 -0
- package/src/core/react-native/utils.ts +18 -0
- package/src/index.ts +17 -0
- package/src/internal/index.ts +3 -0
- package/src/react-native/crypto.ts +19 -0
- package/src/react-native/index.ts +15 -0
- package/src/react-native/register.ts +24 -0
- package/src/register/index.ts +17 -0
- package/src/remote/Actions.ts +115 -0
- package/src/remote/Events.ts +193 -0
- package/src/remote/Hooks.ts +194 -0
- package/src/remote/Porto.ts +144 -0
- package/src/remote/index.ts +4 -0
- package/src/remote/internal/methodPolicies.ts +124 -0
- package/src/server/Route.test.ts +347 -0
- package/src/server/Route.ts +259 -0
- package/src/server/Router.test.ts +32 -0
- package/src/server/Router.ts +59 -0
- package/src/server/index.ts +2 -0
- package/src/server/internal/merchantSchema.ts +11 -0
- package/src/server/internal/requestListener.ts +284 -0
- package/src/theme/Theme.ts +163 -0
- package/src/theme/index.ts +2 -0
- package/src/trusted-hosts.ts +40 -0
- package/src/tsconfig.build.tsbuildinfo +1 -0
- package/src/tsconfig.json +15 -0
- package/src/viem/Account.test.ts +270 -0
- package/src/viem/Account.ts +278 -0
- package/src/viem/AccountActions.test.ts +3 -0
- package/src/viem/AccountActions.ts +30 -0
- package/src/viem/CapabilitiesSchema.ts +18 -0
- package/src/viem/ContractActions.test.ts +980 -0
- package/src/viem/ContractActions.ts +624 -0
- package/src/viem/Key.test.ts +1420 -0
- package/src/viem/Key.ts +1318 -0
- package/src/viem/RelayActions.test.ts +1730 -0
- package/src/viem/RelayActions.ts +1082 -0
- package/src/viem/RelayClient.test.ts +127 -0
- package/src/viem/RelayClient.ts +87 -0
- package/src/viem/RpcSchema.ts +27 -0
- package/src/viem/WalletActions.test.ts +646 -0
- package/src/viem/WalletActions.ts +476 -0
- package/src/viem/WalletClient.test.ts +36 -0
- package/src/viem/WalletClient.ts +74 -0
- package/src/viem/index.ts +13 -0
- package/src/viem/internal/relayActions.test.ts +1296 -0
- package/src/viem/internal/relayActions.ts +1222 -0
- package/src/viem/internal/utils.ts +27 -0
- package/src/wagmi/Actions.ts +13 -0
- package/src/wagmi/Connector.ts +304 -0
- package/src/wagmi/Hooks.ts +14 -0
- package/src/wagmi/Query.ts +5 -0
- package/src/wagmi/index.ts +4 -0
- package/src/wagmi/internal/core.test.ts +12 -0
- package/src/wagmi/internal/core.ts +468 -0
- package/src/wagmi/internal/query.ts +52 -0
- package/src/wagmi/internal/react.test.ts +12 -0
- package/src/wagmi/internal/react.ts +705 -0
- package/src/wagmi/internal/types.ts +21 -0
- package/src/wagmi/internal/utils.ts +25 -0
- package/dist/chain.cjs +0 -17
- package/dist/chain.d.cts +0 -41
- package/dist/chain.d.ts +0 -41
- package/dist/chain.js +0 -13
- package/dist/config.cjs +0 -19
- package/dist/config.d.cts +0 -3
- package/dist/config.d.ts +0 -3
- package/dist/config.js +0 -16
- package/dist/index.cjs +0 -18
- package/dist/index.d.cts +0 -2
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent.
|
|
3
|
+
*
|
|
4
|
+
* @see https://github.com/ithacaxyz/relay/blob/main/src/types/intent.rs
|
|
5
|
+
*/
|
|
6
|
+
import * as z from 'zod/mini';
|
|
7
|
+
import * as u from "../../schema/utils.js";
|
|
8
|
+
export const Intent = z.union([
|
|
9
|
+
z.object({
|
|
10
|
+
combinedGas: u.bigint(),
|
|
11
|
+
encodedFundTransfers: z.readonly(z.array(u.hex())),
|
|
12
|
+
encodedPreCalls: z.readonly(z.array(u.hex())),
|
|
13
|
+
eoa: u.address(),
|
|
14
|
+
executionData: u.hex(),
|
|
15
|
+
expiry: u.bigint(),
|
|
16
|
+
funder: u.address(),
|
|
17
|
+
funderSignature: u.hex(),
|
|
18
|
+
isMultichain: z.boolean(),
|
|
19
|
+
nonce: u.bigint(),
|
|
20
|
+
payer: u.address(),
|
|
21
|
+
paymentAmount: u.bigint(),
|
|
22
|
+
paymentMaxAmount: u.bigint(),
|
|
23
|
+
paymentRecipient: u.address(),
|
|
24
|
+
paymentSignature: u.hex(),
|
|
25
|
+
paymentToken: u.address(),
|
|
26
|
+
settler: u.address(),
|
|
27
|
+
settlerContext: u.hex(),
|
|
28
|
+
signature: u.hex(),
|
|
29
|
+
supportedAccountImplementation: u.address(),
|
|
30
|
+
}),
|
|
31
|
+
z.object({
|
|
32
|
+
/** The combined gas limit for payment, verification, and calling the EOA. */
|
|
33
|
+
combinedGas: u.bigint(),
|
|
34
|
+
/** Only relevant for multi chain intents. */
|
|
35
|
+
encodedFundTransfers: z.readonly(z.array(u.hex())),
|
|
36
|
+
/**
|
|
37
|
+
* Optional array of encoded Intents that will be verified and executed
|
|
38
|
+
* before the validation of the overall Intent.
|
|
39
|
+
*
|
|
40
|
+
* A PreCall will NOT have its gas limit or payment applied.
|
|
41
|
+
* The overall Intent's gas limit and payment will be applied, encompassing all its PreCalls.
|
|
42
|
+
* The execution of a PreCall will check and increment the nonce in the PreCall.
|
|
43
|
+
* If at any point, any PreCall cannot be verified to be correct, or fails in execution,
|
|
44
|
+
* the overall Intent will revert before validation, and execute will return a non-zero error.
|
|
45
|
+
* A PreCall can contain PreCalls, forming a tree structure.
|
|
46
|
+
* The `executionData` tree will be executed in post-order (i.e. left -> right -> current).
|
|
47
|
+
* The `encodedPreCalls` are included in the EIP712 signature, which enables execution order
|
|
48
|
+
* to be enforced on-the-fly even if the nonces are from different sequences.
|
|
49
|
+
*/
|
|
50
|
+
encodedPreCalls: z.readonly(z.array(u.hex())),
|
|
51
|
+
/** Users address. */
|
|
52
|
+
eoa: u.address(),
|
|
53
|
+
/**
|
|
54
|
+
* An encoded array of calls, using ERC7579 batch execution encoding.
|
|
55
|
+
*
|
|
56
|
+
* The format is `abi.encode(calls)`, where `calls` is an array of type `Call[]`.
|
|
57
|
+
* This allows for more efficient safe forwarding to the EOA.
|
|
58
|
+
*/
|
|
59
|
+
executionData: u.hex(),
|
|
60
|
+
/** The expiration time of the intent. */
|
|
61
|
+
expiry: u.bigint(),
|
|
62
|
+
/** The funder address. */
|
|
63
|
+
funder: u.address(),
|
|
64
|
+
/** The funder's signature. */
|
|
65
|
+
funderSignature: u.hex(),
|
|
66
|
+
/** Whether the intent is a multi-chain intent. */
|
|
67
|
+
isMultichain: z.boolean(),
|
|
68
|
+
/** Per delegated EOA.
|
|
69
|
+
*
|
|
70
|
+
* # Memory layout
|
|
71
|
+
*
|
|
72
|
+
* Each nonce has the following memory layout:
|
|
73
|
+
*
|
|
74
|
+
* ,----------------------------------------------------.
|
|
75
|
+
* bits | 0-191 (192 bits) | 192-255 (64 bits)|
|
|
76
|
+
* |---------------------------------|------------------|
|
|
77
|
+
* desc | sequence key | sequential nonce |
|
|
78
|
+
* `----------------.----------------|------------------'
|
|
79
|
+
* |
|
|
80
|
+
* v
|
|
81
|
+
* ,-------------------------------------.
|
|
82
|
+
* bits | 0-15 (16 bits) | 16-191 (176 bits) |
|
|
83
|
+
* |-------------------------------------|
|
|
84
|
+
* desc | multichain flag | remainder |
|
|
85
|
+
* `-------------------------------------'
|
|
86
|
+
*
|
|
87
|
+
* If the upper 16 bits of the sequence key is `0xc1d0`, then the EIP-712 has
|
|
88
|
+
* of the Intent will exlude the chain ID.
|
|
89
|
+
*
|
|
90
|
+
* # Ordering
|
|
91
|
+
*
|
|
92
|
+
* Ordering matters within a sequence key, but not between sequence keys.
|
|
93
|
+
*
|
|
94
|
+
* This means that users who do not care about the order of specific intents
|
|
95
|
+
* can sign their intents using a random sequence key. On the other hand, if
|
|
96
|
+
* they do care about ordering, they would use the same sequence key.
|
|
97
|
+
*/
|
|
98
|
+
nonce: u.bigint(),
|
|
99
|
+
/**
|
|
100
|
+
* The account paying the payment token.
|
|
101
|
+
* If this is `address(0)`, it defaults to the `eoa`.
|
|
102
|
+
*/
|
|
103
|
+
payer: u.address(),
|
|
104
|
+
/**
|
|
105
|
+
* The payment recipient for the ERC20 token.
|
|
106
|
+
*
|
|
107
|
+
* Excluded from signature. The filler can replace this with their own address.
|
|
108
|
+
*
|
|
109
|
+
* This enables multiple fillers, allowing for competitive filling, better uptime.
|
|
110
|
+
* If `address(0)`, the payment will be accrued by the entry point.
|
|
111
|
+
*/
|
|
112
|
+
paymentRecipient: u.address(),
|
|
113
|
+
/**
|
|
114
|
+
* Optional payment signature to be passed into the `compensate` function
|
|
115
|
+
* on the `payer`. This signature is NOT included in the EIP712 signature.
|
|
116
|
+
*/
|
|
117
|
+
paymentSignature: u.hex(),
|
|
118
|
+
/** The ERC20 or native token used to pay for gas. */
|
|
119
|
+
paymentToken: u.address(),
|
|
120
|
+
/**
|
|
121
|
+
* The actual pre payment amount, requested by the filler.
|
|
122
|
+
* MUST be less than or equal to `prePaymentMaxAmount`.
|
|
123
|
+
*/
|
|
124
|
+
prePaymentAmount: u.bigint(),
|
|
125
|
+
/**
|
|
126
|
+
* The amount of the token to pay, before the call batch is executed.
|
|
127
|
+
* This will be required to be less than `totalPaymentMaxAmount`.
|
|
128
|
+
*/
|
|
129
|
+
prePaymentMaxAmount: u.bigint(),
|
|
130
|
+
/**
|
|
131
|
+
* The address of the settler.
|
|
132
|
+
*/
|
|
133
|
+
settler: u.address(),
|
|
134
|
+
/**
|
|
135
|
+
* Context data passed to the settler for processing attestations.
|
|
136
|
+
*
|
|
137
|
+
* This data is ABI-encoded and contains information needed by the settler
|
|
138
|
+
* to process the multichain intent (e.g., list of chain IDs).
|
|
139
|
+
*/
|
|
140
|
+
settlerContext: u.hex(),
|
|
141
|
+
/**
|
|
142
|
+
* The actual total payment amount, requested by the filler.
|
|
143
|
+
* MUST be less than or equal to `totalPaymentMaxAmount`
|
|
144
|
+
*/
|
|
145
|
+
signature: u.hex(),
|
|
146
|
+
/**
|
|
147
|
+
* Optional. If non-zero, the EOA must use `supportedAccountImplementation`.
|
|
148
|
+
* Otherwise, if left as `address(0)`, any EOA implementation will be supported.
|
|
149
|
+
* This field is NOT included in the EIP712 signature.
|
|
150
|
+
*/
|
|
151
|
+
supportedAccountImplementation: u.address(),
|
|
152
|
+
/**
|
|
153
|
+
* The wrapped signature.
|
|
154
|
+
*
|
|
155
|
+
* The format is `abi.encodePacked(innerSignature, keyHash, prehash)` for most signatures,
|
|
156
|
+
* except if it is signed by the EOA root key, in which case `abi.encodePacked(r, s, v)` is valid as well.
|
|
157
|
+
*/
|
|
158
|
+
totalPaymentAmount: u.bigint(),
|
|
159
|
+
/**
|
|
160
|
+
* The maximum amount of the token to pay.
|
|
161
|
+
*/
|
|
162
|
+
totalPaymentMaxAmount: u.bigint(),
|
|
163
|
+
}),
|
|
164
|
+
]);
|
|
165
|
+
export const Partial = z.object({
|
|
166
|
+
eoa: u.address(),
|
|
167
|
+
executionData: u.hex(),
|
|
168
|
+
nonce: u.bigint(),
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent.js","sourceRoot":"","sources":["../../../../../src/core/internal/relay/schema/intent.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPC account key.
|
|
3
|
+
*
|
|
4
|
+
* @see https://github.com/ithacaxyz/relay/blob/main/src/types/key.rs
|
|
5
|
+
*/
|
|
6
|
+
import * as z from 'zod/mini';
|
|
7
|
+
export declare const Key: z.ZodMiniObject<{
|
|
8
|
+
/** The expiry of the key. */
|
|
9
|
+
expiry: z.ZodMiniCodec<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniNumber<number>>;
|
|
10
|
+
/** Whether the digest was prehashed. */
|
|
11
|
+
prehash: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
12
|
+
/** Public key. */
|
|
13
|
+
publicKey: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
14
|
+
/** Role. */
|
|
15
|
+
role: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"admin">, z.ZodMiniLiteral<"normal">]>;
|
|
16
|
+
/** Key type. */
|
|
17
|
+
type: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"p256">, z.ZodMiniLiteral<"secp256k1">, z.ZodMiniLiteral<"webauthnp256">]>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type Key = z.infer<typeof Key>;
|
|
20
|
+
export declare const WithPermissions: z.ZodMiniObject<{
|
|
21
|
+
/** Represents key permissions. */
|
|
22
|
+
permissions: z.ZodMiniReadonly<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
23
|
+
selector: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
24
|
+
to: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
25
|
+
type: z.ZodMiniLiteral<"call">;
|
|
26
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
27
|
+
limit: z.ZodMiniCodec<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniBigInt<bigint>>;
|
|
28
|
+
period: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"minute">, z.ZodMiniLiteral<"hour">, z.ZodMiniLiteral<"day">, z.ZodMiniLiteral<"week">, z.ZodMiniLiteral<"month">, z.ZodMiniLiteral<"year">]>;
|
|
29
|
+
token: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniNull]>>;
|
|
30
|
+
type: z.ZodMiniLiteral<"spend">;
|
|
31
|
+
}, z.core.$strip>]>>>;
|
|
32
|
+
/** The expiry of the key. */
|
|
33
|
+
expiry: z.ZodMiniCodec<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniNumber<number>>;
|
|
34
|
+
/** Whether the digest was prehashed. */
|
|
35
|
+
prehash: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
36
|
+
/** Public key. */
|
|
37
|
+
publicKey: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
38
|
+
/** Role. */
|
|
39
|
+
role: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"admin">, z.ZodMiniLiteral<"normal">]>;
|
|
40
|
+
/** Key type. */
|
|
41
|
+
type: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"p256">, z.ZodMiniLiteral<"secp256k1">, z.ZodMiniLiteral<"webauthnp256">]>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export type WithPermissions = z.infer<typeof WithPermissions>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPC account key.
|
|
3
|
+
*
|
|
4
|
+
* @see https://github.com/ithacaxyz/relay/blob/main/src/types/key.rs
|
|
5
|
+
*/
|
|
6
|
+
import * as z from 'zod/mini';
|
|
7
|
+
import * as u from "../../schema/utils.js";
|
|
8
|
+
import * as Permission from "./permission.js";
|
|
9
|
+
export const Key = z.object({
|
|
10
|
+
/** The expiry of the key. */
|
|
11
|
+
expiry: u.number(),
|
|
12
|
+
/** Whether the digest was prehashed. */
|
|
13
|
+
prehash: z.optional(z.boolean()),
|
|
14
|
+
/** Public key. */
|
|
15
|
+
publicKey: u.hex(),
|
|
16
|
+
/** Role. */
|
|
17
|
+
role: z.union([z.literal('admin'), z.literal('normal')]),
|
|
18
|
+
/** Key type. */
|
|
19
|
+
type: z.union([
|
|
20
|
+
z.literal('p256'),
|
|
21
|
+
z.literal('secp256k1'),
|
|
22
|
+
z.literal('webauthnp256'),
|
|
23
|
+
]),
|
|
24
|
+
});
|
|
25
|
+
export const WithPermissions = z.object({
|
|
26
|
+
...Key.shape,
|
|
27
|
+
/** Represents key permissions. */
|
|
28
|
+
permissions: z.readonly(z.array(Permission.Permission)),
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.js","sourceRoot":"","sources":["../../../../../src/core/internal/relay/schema/key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,KAAK,CAAC,8BAA6B;AAC1C,OAAO,KAAK,UAAU,wBAAuB;AAE7C,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,6BAA6B;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,wCAAwC;IACxC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAChC,kBAAkB;IAClB,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE;IAClB,YAAY;IACZ,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxD,gBAAgB;IAChB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;QACZ,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACjB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;QACtB,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;KAC1B,CAAC;CACH,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,GAAG,GAAG,CAAC,KAAK;IACZ,kCAAkC;IAClC,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;CACxD,CAAC,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
export declare const CallPermission: z.ZodMiniObject<{
|
|
3
|
+
/** The selector of the function this permission applies to. */
|
|
4
|
+
selector: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
5
|
+
/** The address of the contract this permission applies to. */
|
|
6
|
+
to: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
7
|
+
/** Permission type. */
|
|
8
|
+
type: z.ZodMiniLiteral<"call">;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type CallPermission = z.infer<typeof CallPermission>;
|
|
11
|
+
export declare const SpendPermission: z.ZodMiniObject<{
|
|
12
|
+
/** The maximum amount that can be spent in the given period. */
|
|
13
|
+
limit: z.ZodMiniCodec<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniBigInt<bigint>>;
|
|
14
|
+
/** The period of the limit. */
|
|
15
|
+
period: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"minute">, z.ZodMiniLiteral<"hour">, z.ZodMiniLiteral<"day">, z.ZodMiniLiteral<"week">, z.ZodMiniLiteral<"month">, z.ZodMiniLiteral<"year">]>;
|
|
16
|
+
/** The token this permission applies to. If `None`, defaults to native token (ETH). */
|
|
17
|
+
token: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniNull]>>;
|
|
18
|
+
/** Permission type. */
|
|
19
|
+
type: z.ZodMiniLiteral<"spend">;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type SpendPermission = z.infer<typeof SpendPermission>;
|
|
22
|
+
export declare const Permission: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
23
|
+
/** The selector of the function this permission applies to. */
|
|
24
|
+
selector: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
25
|
+
/** The address of the contract this permission applies to. */
|
|
26
|
+
to: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
27
|
+
/** Permission type. */
|
|
28
|
+
type: z.ZodMiniLiteral<"call">;
|
|
29
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
30
|
+
/** The maximum amount that can be spent in the given period. */
|
|
31
|
+
limit: z.ZodMiniCodec<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniBigInt<bigint>>;
|
|
32
|
+
/** The period of the limit. */
|
|
33
|
+
period: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"minute">, z.ZodMiniLiteral<"hour">, z.ZodMiniLiteral<"day">, z.ZodMiniLiteral<"week">, z.ZodMiniLiteral<"month">, z.ZodMiniLiteral<"year">]>;
|
|
34
|
+
/** The token this permission applies to. If `None`, defaults to native token (ETH). */
|
|
35
|
+
token: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniNull]>>;
|
|
36
|
+
/** Permission type. */
|
|
37
|
+
type: z.ZodMiniLiteral<"spend">;
|
|
38
|
+
}, z.core.$strip>]>;
|
|
39
|
+
export type Permission = z.infer<typeof Permission>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import * as u from "../../schema/utils.js";
|
|
3
|
+
export const CallPermission = z.object({
|
|
4
|
+
/** The selector of the function this permission applies to. */
|
|
5
|
+
selector: u.hex(),
|
|
6
|
+
/** The address of the contract this permission applies to. */
|
|
7
|
+
to: u.address(),
|
|
8
|
+
/** Permission type. */
|
|
9
|
+
type: z.literal('call'),
|
|
10
|
+
});
|
|
11
|
+
export const SpendPermission = z.object({
|
|
12
|
+
/** The maximum amount that can be spent in the given period. */
|
|
13
|
+
limit: u.bigint(),
|
|
14
|
+
/** The period of the limit. */
|
|
15
|
+
period: z.union([
|
|
16
|
+
z.literal('minute'),
|
|
17
|
+
z.literal('hour'),
|
|
18
|
+
z.literal('day'),
|
|
19
|
+
z.literal('week'),
|
|
20
|
+
z.literal('month'),
|
|
21
|
+
z.literal('year'),
|
|
22
|
+
]),
|
|
23
|
+
/** The token this permission applies to. If `None`, defaults to native token (ETH). */
|
|
24
|
+
token: z.optional(z.union([u.address(), z.null()])),
|
|
25
|
+
/** Permission type. */
|
|
26
|
+
type: z.literal('spend'),
|
|
27
|
+
});
|
|
28
|
+
export const Permission = z.union([CallPermission, SpendPermission]);
|
|
29
|
+
//# sourceMappingURL=permission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission.js","sourceRoot":"","sources":["../../../../../src/core/internal/relay/schema/permission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,KAAK,CAAC,8BAA6B;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,+DAA+D;IAC/D,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE;IACjB,8DAA8D;IAC9D,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE;IACf,uBAAuB;IACvB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;CACxB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,gEAAgE;IAChE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,+BAA+B;IAC/B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC;QACd,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACnB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACjB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QAChB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACjB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QAClB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;KAClB,CAAC;IACF,uFAAuF;IACvF,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACnD,uBAAuB;IACvB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;CACzB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
export declare const PreCall: z.ZodMiniObject<{
|
|
3
|
+
/**
|
|
4
|
+
* The user's address.
|
|
5
|
+
*
|
|
6
|
+
* This can be set to `address(0)`, which allows it to be
|
|
7
|
+
* coalesced to the parent Intent's EOA.
|
|
8
|
+
*/
|
|
9
|
+
eoa: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
10
|
+
/**
|
|
11
|
+
* An encoded array of calls, using ERC7579 batch execution encoding.
|
|
12
|
+
*
|
|
13
|
+
* `abi.encode(calls)`, where `calls` is of type `Call[]`.
|
|
14
|
+
* This allows for more efficient safe forwarding to the EOA.
|
|
15
|
+
*/
|
|
16
|
+
executionData: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
17
|
+
/**
|
|
18
|
+
* Per delegated EOA. Same logic as the `nonce` in Intent.
|
|
19
|
+
*
|
|
20
|
+
* A nonce of `type(uint256).max` skips the check, incrementing,
|
|
21
|
+
* and the emission of the {IntentExecuted} event.
|
|
22
|
+
*/
|
|
23
|
+
nonce: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
24
|
+
/**
|
|
25
|
+
* The wrapped signature.
|
|
26
|
+
*
|
|
27
|
+
* `abi.encodePacked(innerSignature, keyHash, prehash)`.
|
|
28
|
+
*/
|
|
29
|
+
signature: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type PreCall = z.infer<typeof PreCall>;
|
|
32
|
+
export declare const Context: z.ZodMiniObject<{
|
|
33
|
+
chainId: z.ZodMiniCodec<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniNumber<number>>;
|
|
34
|
+
/**
|
|
35
|
+
* The user's address.
|
|
36
|
+
*
|
|
37
|
+
* This can be set to `address(0)`, which allows it to be
|
|
38
|
+
* coalesced to the parent Intent's EOA.
|
|
39
|
+
*/
|
|
40
|
+
eoa: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
41
|
+
/**
|
|
42
|
+
* An encoded array of calls, using ERC7579 batch execution encoding.
|
|
43
|
+
*
|
|
44
|
+
* `abi.encode(calls)`, where `calls` is of type `Call[]`.
|
|
45
|
+
* This allows for more efficient safe forwarding to the EOA.
|
|
46
|
+
*/
|
|
47
|
+
executionData: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
48
|
+
/**
|
|
49
|
+
* Per delegated EOA. Same logic as the `nonce` in Intent.
|
|
50
|
+
*
|
|
51
|
+
* A nonce of `type(uint256).max` skips the check, incrementing,
|
|
52
|
+
* and the emission of the {IntentExecuted} event.
|
|
53
|
+
*/
|
|
54
|
+
nonce: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
55
|
+
/**
|
|
56
|
+
* The wrapped signature.
|
|
57
|
+
*
|
|
58
|
+
* `abi.encodePacked(innerSignature, keyHash, prehash)`.
|
|
59
|
+
*/
|
|
60
|
+
signature: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export type Context = z.infer<typeof Context>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import * as u from "../../schema/utils.js";
|
|
3
|
+
export const PreCall = z.object({
|
|
4
|
+
/**
|
|
5
|
+
* The user's address.
|
|
6
|
+
*
|
|
7
|
+
* This can be set to `address(0)`, which allows it to be
|
|
8
|
+
* coalesced to the parent Intent's EOA.
|
|
9
|
+
*/
|
|
10
|
+
eoa: u.address(),
|
|
11
|
+
/**
|
|
12
|
+
* An encoded array of calls, using ERC7579 batch execution encoding.
|
|
13
|
+
*
|
|
14
|
+
* `abi.encode(calls)`, where `calls` is of type `Call[]`.
|
|
15
|
+
* This allows for more efficient safe forwarding to the EOA.
|
|
16
|
+
*/
|
|
17
|
+
executionData: u.hex(),
|
|
18
|
+
/**
|
|
19
|
+
* Per delegated EOA. Same logic as the `nonce` in Intent.
|
|
20
|
+
*
|
|
21
|
+
* A nonce of `type(uint256).max` skips the check, incrementing,
|
|
22
|
+
* and the emission of the {IntentExecuted} event.
|
|
23
|
+
*/
|
|
24
|
+
nonce: u.hex(),
|
|
25
|
+
/**
|
|
26
|
+
* The wrapped signature.
|
|
27
|
+
*
|
|
28
|
+
* `abi.encodePacked(innerSignature, keyHash, prehash)`.
|
|
29
|
+
*/
|
|
30
|
+
signature: u.hex(),
|
|
31
|
+
});
|
|
32
|
+
export const Context = z.object({
|
|
33
|
+
...PreCall.shape,
|
|
34
|
+
chainId: u.number(),
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=preCall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preCall.js","sourceRoot":"","sources":["../../../../../src/core/internal/relay/schema/preCall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,KAAK,CAAC,8BAA6B;AAE1C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE;IAChB;;;;;OAKG;IACH,aAAa,EAAE,CAAC,CAAC,GAAG,EAAE;IACtB;;;;;OAKG;IACH,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE;IACd;;;;OAIG;IACH,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE;CACnB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,GAAG,OAAO,CAAC,KAAK;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAA"}
|