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,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Porto Wallet Actions.
|
|
3
|
+
*
|
|
4
|
+
* Note: These Actions will eventually be upstreamed into `viem` once an
|
|
5
|
+
* API is solidified & stable.
|
|
6
|
+
*/
|
|
7
|
+
import * as Hex from 'ox/Hex';
|
|
8
|
+
import { encodeFunctionData, } from 'viem';
|
|
9
|
+
import { getAddresses, getCallsStatus, getCapabilities, getChainId, requestAddresses, sendCalls, showCallsStatus, signMessage, signTypedData, waitForCallsStatus, writeContract, } from 'viem/actions';
|
|
10
|
+
import * as z from 'zod/mini';
|
|
11
|
+
import * as RpcSchema from "../core/RpcSchema.js";
|
|
12
|
+
import * as Account from "./Account.js";
|
|
13
|
+
const supportedWalletActions = [
|
|
14
|
+
'getAddresses',
|
|
15
|
+
'getCallsStatus',
|
|
16
|
+
'getCapabilities',
|
|
17
|
+
'getChainId',
|
|
18
|
+
'requestAddresses',
|
|
19
|
+
'sendCalls',
|
|
20
|
+
'showCallsStatus',
|
|
21
|
+
'signMessage',
|
|
22
|
+
'signTypedData',
|
|
23
|
+
'showCallsStatus',
|
|
24
|
+
'waitForCallsStatus',
|
|
25
|
+
'writeContract',
|
|
26
|
+
];
|
|
27
|
+
export async function addFunds(client, parameters) {
|
|
28
|
+
const method = 'wallet_addFunds';
|
|
29
|
+
const response = await client.request({
|
|
30
|
+
method,
|
|
31
|
+
params: [z.encode(RpcSchema.wallet_addFunds.Parameters, parameters)],
|
|
32
|
+
});
|
|
33
|
+
return z.decode(RpcSchema.wallet_addFunds.Response, response);
|
|
34
|
+
}
|
|
35
|
+
export async function getAssets(client, ...parameters) {
|
|
36
|
+
const { account = client.account, ...rest } = parameters[0] ?? {};
|
|
37
|
+
const account_ = account ? Account.from(account) : undefined;
|
|
38
|
+
if (!account_)
|
|
39
|
+
throw new Error('account is required');
|
|
40
|
+
const method = 'wallet_getAssets';
|
|
41
|
+
const response = await client.request({
|
|
42
|
+
method,
|
|
43
|
+
params: [
|
|
44
|
+
z.encode(RpcSchema.wallet_getAssets.Parameters, {
|
|
45
|
+
...rest,
|
|
46
|
+
account: account_.address,
|
|
47
|
+
}),
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
const value = z.decode(RpcSchema.wallet_getAssets.Response, response);
|
|
51
|
+
const decoded = Object.entries(value).reduce((acc, [key, value]) => {
|
|
52
|
+
acc[Hex.toNumber(key)] = value;
|
|
53
|
+
return acc;
|
|
54
|
+
}, {});
|
|
55
|
+
return decoded;
|
|
56
|
+
}
|
|
57
|
+
export async function connect(client, parameters = {}) {
|
|
58
|
+
const { chainIds, ...capabilities } = parameters;
|
|
59
|
+
const method = 'wallet_connect';
|
|
60
|
+
const response = await client.request({
|
|
61
|
+
method,
|
|
62
|
+
params: [
|
|
63
|
+
z.encode(RpcSchema.wallet_connect.Parameters, {
|
|
64
|
+
capabilities,
|
|
65
|
+
chainIds,
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
68
|
+
});
|
|
69
|
+
return z.decode(RpcSchema.wallet_connect.Response, response);
|
|
70
|
+
}
|
|
71
|
+
export async function disconnect(client) {
|
|
72
|
+
const method = 'wallet_disconnect';
|
|
73
|
+
await client.request({
|
|
74
|
+
method,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export async function getAdmins(client, parameters = {}) {
|
|
78
|
+
const method = 'wallet_getAdmins';
|
|
79
|
+
const response = await client.request({
|
|
80
|
+
method,
|
|
81
|
+
params: [z.encode(RpcSchema.wallet_getAdmins.Parameters, parameters)],
|
|
82
|
+
});
|
|
83
|
+
return z.decode(RpcSchema.wallet_getAdmins.Response, response);
|
|
84
|
+
}
|
|
85
|
+
export async function getPermissions(client, parameters = {}) {
|
|
86
|
+
const method = 'wallet_getPermissions';
|
|
87
|
+
const response = await client.request({
|
|
88
|
+
method,
|
|
89
|
+
params: [z.encode(RpcSchema.wallet_getPermissions.Parameters, parameters)],
|
|
90
|
+
});
|
|
91
|
+
return z.decode(RpcSchema.wallet_getPermissions.Response, response);
|
|
92
|
+
}
|
|
93
|
+
export async function grantAdmin(client, parameters) {
|
|
94
|
+
const method = 'wallet_grantAdmin';
|
|
95
|
+
const response = await client.request({
|
|
96
|
+
method,
|
|
97
|
+
params: [z.encode(RpcSchema.wallet_grantAdmin.Parameters, parameters)],
|
|
98
|
+
});
|
|
99
|
+
return z.decode(RpcSchema.wallet_grantAdmin.Response, response);
|
|
100
|
+
}
|
|
101
|
+
export async function grantPermissions(client, parameters) {
|
|
102
|
+
const method = 'wallet_grantPermissions';
|
|
103
|
+
const response = await client.request({
|
|
104
|
+
method,
|
|
105
|
+
params: [
|
|
106
|
+
z.encode(RpcSchema.wallet_grantPermissions.Parameters, parameters),
|
|
107
|
+
],
|
|
108
|
+
});
|
|
109
|
+
return z.decode(RpcSchema.wallet_grantPermissions.Response, response);
|
|
110
|
+
}
|
|
111
|
+
export async function prepareCalls(client, parameters) {
|
|
112
|
+
const method = 'wallet_prepareCalls';
|
|
113
|
+
const response = await client.request({
|
|
114
|
+
method,
|
|
115
|
+
params: [
|
|
116
|
+
z.encode(RpcSchema.wallet_prepareCalls.Parameters, {
|
|
117
|
+
...parameters,
|
|
118
|
+
calls: (parameters.calls ?? []).map((c) => {
|
|
119
|
+
const call = c;
|
|
120
|
+
const data = (() => {
|
|
121
|
+
if (!call.abi)
|
|
122
|
+
return call.data;
|
|
123
|
+
return encodeFunctionData(call);
|
|
124
|
+
})();
|
|
125
|
+
return {
|
|
126
|
+
...call,
|
|
127
|
+
data,
|
|
128
|
+
};
|
|
129
|
+
}),
|
|
130
|
+
}),
|
|
131
|
+
],
|
|
132
|
+
});
|
|
133
|
+
return z.decode(RpcSchema.wallet_prepareCalls.Response, response);
|
|
134
|
+
}
|
|
135
|
+
export async function revokeAdmin(client, parameters) {
|
|
136
|
+
const method = 'wallet_revokeAdmin';
|
|
137
|
+
await client.request({
|
|
138
|
+
method,
|
|
139
|
+
params: [z.encode(RpcSchema.wallet_revokeAdmin.Parameters, parameters)],
|
|
140
|
+
});
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
export async function revokePermissions(client, parameters) {
|
|
144
|
+
const { address, id, ...capabilities } = parameters;
|
|
145
|
+
const method = 'wallet_revokePermissions';
|
|
146
|
+
await client.request({
|
|
147
|
+
method,
|
|
148
|
+
params: [
|
|
149
|
+
z.encode(RpcSchema.wallet_revokePermissions.Parameters, {
|
|
150
|
+
address,
|
|
151
|
+
capabilities,
|
|
152
|
+
id,
|
|
153
|
+
}),
|
|
154
|
+
],
|
|
155
|
+
});
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
export async function sendPreparedCalls(client, parameters) {
|
|
159
|
+
const method = 'wallet_sendPreparedCalls';
|
|
160
|
+
const response = await client.request({
|
|
161
|
+
method,
|
|
162
|
+
params: [
|
|
163
|
+
z.encode(RpcSchema.wallet_sendPreparedCalls.Parameters, parameters),
|
|
164
|
+
],
|
|
165
|
+
});
|
|
166
|
+
return z.decode(RpcSchema.wallet_sendPreparedCalls.Response, response);
|
|
167
|
+
}
|
|
168
|
+
export async function upgradeAccount(client, parameters) {
|
|
169
|
+
const { account, chainId, ...capabilities } = parameters;
|
|
170
|
+
const method = 'wallet_prepareUpgradeAccount';
|
|
171
|
+
const { context, digests } = await client.request({
|
|
172
|
+
method,
|
|
173
|
+
params: [
|
|
174
|
+
z.encode(RpcSchema.wallet_prepareUpgradeAccount.Parameters, {
|
|
175
|
+
address: account.address,
|
|
176
|
+
capabilities,
|
|
177
|
+
chainId,
|
|
178
|
+
}),
|
|
179
|
+
],
|
|
180
|
+
});
|
|
181
|
+
const signatures = {
|
|
182
|
+
auth: await account.sign({ hash: digests.auth }),
|
|
183
|
+
exec: await account.sign({ hash: digests.exec }),
|
|
184
|
+
};
|
|
185
|
+
const method_upgrade = 'wallet_upgradeAccount';
|
|
186
|
+
const response = await client.request({
|
|
187
|
+
method: method_upgrade,
|
|
188
|
+
params: [
|
|
189
|
+
z.encode(RpcSchema.wallet_upgradeAccount.Parameters, {
|
|
190
|
+
context,
|
|
191
|
+
signatures,
|
|
192
|
+
}),
|
|
193
|
+
],
|
|
194
|
+
});
|
|
195
|
+
return z.decode(RpcSchema.wallet_upgradeAccount.Response, response);
|
|
196
|
+
}
|
|
197
|
+
export function decorator(client) {
|
|
198
|
+
return {
|
|
199
|
+
connect: (parameters) => connect(client, parameters),
|
|
200
|
+
disconnect: () => disconnect(client),
|
|
201
|
+
getAddresses: () => getAddresses(client),
|
|
202
|
+
getCallsStatus: (parameters) => getCallsStatus(client, parameters),
|
|
203
|
+
getCapabilities: () => getCapabilities(client),
|
|
204
|
+
getChainId: () => getChainId(client),
|
|
205
|
+
getPermissions: (parameters) => getPermissions(client, parameters),
|
|
206
|
+
grantPermissions: (parameters) => grantPermissions(client, parameters),
|
|
207
|
+
prepareCalls: (parameters) => prepareCalls(client, parameters),
|
|
208
|
+
requestAddresses: () => requestAddresses(client),
|
|
209
|
+
revokePermissions: (parameters) => revokePermissions(client, parameters),
|
|
210
|
+
sendCalls: (parameters) => sendCalls(client, parameters),
|
|
211
|
+
sendPreparedCalls: (parameters) => sendPreparedCalls(client, parameters),
|
|
212
|
+
showCallsStatus: (parameters) => showCallsStatus(client, parameters),
|
|
213
|
+
signMessage: (parameters) => signMessage(client, parameters),
|
|
214
|
+
signTypedData: (parameters) => signTypedData(client, parameters),
|
|
215
|
+
upgradeAccount: (parameters) => upgradeAccount(client, parameters),
|
|
216
|
+
waitForCallsStatus: (parameters) => waitForCallsStatus(client, parameters),
|
|
217
|
+
writeContract: (parameters) => writeContract(client, parameters),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=WalletActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletActions.js","sourceRoot":"","sources":["../../src/viem/WalletActions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAKL,kBAAkB,GAMnB,MAAM,MAAM,CAAA;AACb,OAAO,EACL,YAAY,EACZ,cAAc,EACd,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,KAAK,SAAS,6BAA4B;AACjD,OAAO,KAAK,OAAO,qBAAoB;AAIvC,MAAM,sBAAsB,GAAG;IAC7B,cAAc;IACd,gBAAgB;IAChB,iBAAiB;IACjB,YAAY;IACZ,kBAAkB;IAClB,WAAW;IACX,iBAAiB;IACjB,aAAa;IACb,eAAe;IACf,iBAAiB;IACjB,oBAAoB;IACpB,eAAe;CACgC,CAAA;AAEjD,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,MAAc,EACd,UAA+B;IAE/B,MAA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GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC;QAChD,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,UAAU,CAAC;QACxE,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;QACxD,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,UAAU,CAAC;QACxE,eAAe,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC;QACpE,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC;QAC5D,aAAa,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC;QAChE,cAAc,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC;QAClE,kBAAkB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,UAAU,CAAC;QAC1E,aAAa,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC;KACjE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Address, type ClientConfig, type JsonRpcAccount, type Transport, type Client as viem_Client } from 'viem';
|
|
2
|
+
import type * as Chains from "../core/Chains.js";
|
|
3
|
+
import type { Internal } from "../core/internal/porto.js";
|
|
4
|
+
import type * as Provider from "../core/internal/provider.js";
|
|
5
|
+
import type * as Account from "./Account.js";
|
|
6
|
+
import type * as RpcSchema from "./RpcSchema.js";
|
|
7
|
+
export type WalletClient<transport extends Transport = Transport, chain extends Chains.Chain | undefined = Chains.Chain | undefined, account extends Account.Account | Address | undefined = Account.Account | Address | undefined> = viem_Client<transport, chain, account extends Address ? JsonRpcAccount<account> : account, RpcSchema.Wallet>;
|
|
8
|
+
/**
|
|
9
|
+
* Extracts a Viem Client from a Porto instance.
|
|
10
|
+
*
|
|
11
|
+
* @param porto - Porto instance.
|
|
12
|
+
* @returns Client.
|
|
13
|
+
*/
|
|
14
|
+
export declare function fromPorto<chains extends readonly [Chains.Chain, ...Chains.Chain[]], chain extends Chains.Chain | undefined = undefined, account extends Account.Account | Address | undefined = undefined>(porto: {
|
|
15
|
+
_internal: Internal<chains>;
|
|
16
|
+
provider: Provider.Provider;
|
|
17
|
+
}, config?: fromPorto.Config<chain, account>): WalletClient<Transport, chain, account>;
|
|
18
|
+
export declare namespace fromPorto {
|
|
19
|
+
type Config<chain extends Chains.Chain | undefined = Chains.Chain | undefined, account extends Account.Account | Address | undefined = Account.Account | Address | undefined> = Pick<ClientConfig<Transport, chain, account>, 'account' | 'cacheTime' | 'chain' | 'key' | 'name' | 'pollingInterval'>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createClient, custom, } from 'viem';
|
|
2
|
+
const clientCache = new Map();
|
|
3
|
+
/**
|
|
4
|
+
* Extracts a Viem Client from a Porto instance.
|
|
5
|
+
*
|
|
6
|
+
* @param porto - Porto instance.
|
|
7
|
+
* @returns Client.
|
|
8
|
+
*/
|
|
9
|
+
export function fromPorto(porto, config = {}) {
|
|
10
|
+
const { provider } = porto;
|
|
11
|
+
const { id } = porto._internal;
|
|
12
|
+
const key = ['provider', id].filter(Boolean).join(':');
|
|
13
|
+
if (clientCache.has(key))
|
|
14
|
+
return clientCache.get(key);
|
|
15
|
+
const client = createClient({
|
|
16
|
+
...config,
|
|
17
|
+
pollingInterval: 1_000,
|
|
18
|
+
transport: custom(provider),
|
|
19
|
+
});
|
|
20
|
+
clientCache.set(key, client);
|
|
21
|
+
return client;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=WalletClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletClient.js","sourceRoot":"","sources":["../../src/viem/WalletClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EACZ,MAAM,GAIP,MAAM,MAAM,CAAA;AAqBb,MAAM,WAAW,GAAG,IAAI,GAAG,EAAe,CAAA;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAKvB,KAGC,EACD,SAA2C,EAAE;IAE7C,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAC1B,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,SAAS,CAAA;IAE9B,MAAM,GAAG,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACtD,IAAI,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAE,CAAA;IACtD,MAAM,MAAM,GAAG,YAAY,CAAC;QAC1B,GAAG,MAAM;QACT,eAAe,EAAE,KAAK;QACtB,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC;KAC5B,CAAC,CAAA;IACF,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAC5B,OAAO,MAAe,CAAA;AACxB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * as Account from "./Account.js";
|
|
2
|
+
export * as AccountActions from "./AccountActions.js";
|
|
3
|
+
export type { CapabilitiesSchema } from "./CapabilitiesSchema.js";
|
|
4
|
+
export * as ContractActions from "./ContractActions.js";
|
|
5
|
+
export { decorator as contractActions } from "./ContractActions.js";
|
|
6
|
+
export * as Key from "./Key.js";
|
|
7
|
+
export * as RelayActions from "./RelayActions.js";
|
|
8
|
+
export { decorator as relayActions } from "./RelayActions.js";
|
|
9
|
+
export * as RelayClient from "./RelayClient.js";
|
|
10
|
+
export type * as RpcSchema from "./RpcSchema.js";
|
|
11
|
+
export * as WalletActions from "./WalletActions.js";
|
|
12
|
+
export { decorator as walletActions } from "./WalletActions.js";
|
|
13
|
+
export * as WalletClient from "./WalletClient.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * as Account from "./Account.js";
|
|
2
|
+
export * as AccountActions from "./AccountActions.js";
|
|
3
|
+
export * as ContractActions from "./ContractActions.js";
|
|
4
|
+
export { decorator as contractActions } from "./ContractActions.js";
|
|
5
|
+
export * as Key from "./Key.js";
|
|
6
|
+
export * as RelayActions from "./RelayActions.js";
|
|
7
|
+
export { decorator as relayActions } from "./RelayActions.js";
|
|
8
|
+
export * as RelayClient from "./RelayClient.js";
|
|
9
|
+
export * as WalletActions from "./WalletActions.js";
|
|
10
|
+
export { decorator as walletActions } from "./WalletActions.js";
|
|
11
|
+
export * as WalletClient from "./WalletClient.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/viem/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,qBAAoB;AACvC,OAAO,KAAK,cAAc,4BAA2B;AAErD,OAAO,KAAK,eAAe,6BAA4B;AACvD,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,6BAA4B;AACnE,OAAO,KAAK,GAAG,iBAAgB;AAC/B,OAAO,KAAK,YAAY,0BAAyB;AACjD,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,0BAAyB;AAC7D,OAAO,KAAK,WAAW,yBAAwB;AAE/C,OAAO,KAAK,aAAa,2BAA0B;AACnD,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,2BAA0B;AAC/D,OAAO,KAAK,YAAY,0BAAyB"}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions for Porto Relay.
|
|
3
|
+
*
|
|
4
|
+
* @see https://porto.sh/relay
|
|
5
|
+
*/
|
|
6
|
+
import * as AbiError from 'ox/AbiError';
|
|
7
|
+
import type * as Address from 'ox/Address';
|
|
8
|
+
import * as Errors from 'ox/Errors';
|
|
9
|
+
import * as Hex from 'ox/Hex';
|
|
10
|
+
import { BaseError, type Calls, type Chain, type Client, type Narrow, type Transport, type ValueOf } from 'viem';
|
|
11
|
+
import * as z from 'zod/mini';
|
|
12
|
+
import * as RpcSchema from "../../core/internal/relay/rpcSchema.js";
|
|
13
|
+
import * as u from "../../core/internal/schema/utils.js";
|
|
14
|
+
import type { IsUndefined, OneOf } from "../../core/internal/types.js";
|
|
15
|
+
import type { sendCalls } from "../RelayActions.js";
|
|
16
|
+
import type { GetChainParameter } from "./utils.js";
|
|
17
|
+
/**
|
|
18
|
+
* Gets the authorization for a given address.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* TODO
|
|
22
|
+
*
|
|
23
|
+
* @param client - The client to use.
|
|
24
|
+
* @param parameters - Parameters.
|
|
25
|
+
* @returns Result.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getAuthorization(client: Client, parameters: getAuthorization.Parameters): Promise<getAuthorization.ReturnType>;
|
|
28
|
+
export declare namespace getAuthorization {
|
|
29
|
+
type Parameters = RpcSchema.wallet_getAuthorization.Parameters;
|
|
30
|
+
type ReturnType = RpcSchema.wallet_getAuthorization.Response;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Gets the capabilities for a given chain ID.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* TODO
|
|
37
|
+
*
|
|
38
|
+
* @param client - The client to use.
|
|
39
|
+
* @param options - Options.
|
|
40
|
+
* @returns Result.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getCapabilities<const chainIds extends 'all' | readonly number[] | undefined = undefined, const raw extends boolean = false>(client: Client<Transport>, options?: getCapabilities.Options<chainIds, raw>): Promise<getCapabilities.ReturnType<chainIds, raw>>;
|
|
43
|
+
export declare namespace getCapabilities {
|
|
44
|
+
type Options<chainIds extends 'all' | readonly number[] | undefined = undefined, raw extends boolean = false> = {
|
|
45
|
+
/**
|
|
46
|
+
* Whether to return the raw, non-decoded response.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
raw?: raw | boolean | undefined;
|
|
50
|
+
} & OneOf<{
|
|
51
|
+
/**
|
|
52
|
+
* Chain IDs to get the capabilities for.
|
|
53
|
+
* `"all"` will return the capabilities for all supported chains.
|
|
54
|
+
*/
|
|
55
|
+
chainIds?: chainIds | 'all' | readonly number[] | undefined;
|
|
56
|
+
} | {
|
|
57
|
+
/**
|
|
58
|
+
* Chain ID to get the capabilities for.
|
|
59
|
+
*/
|
|
60
|
+
chainId?: number | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
type ReturnType<chainIds extends 'all' | readonly number[] | undefined = undefined, raw extends boolean = false, value = raw extends true ? z.input<typeof RpcSchema.wallet_getCapabilities.Response> : RpcSchema.wallet_getCapabilities.Response> = IsUndefined<chainIds> extends true ? ValueOf<value> : value;
|
|
63
|
+
type ErrorType = parseSchemaError.ErrorType | Errors.GlobalErrorType;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get assets owned by user in given chain IDs.
|
|
67
|
+
*/
|
|
68
|
+
export declare function getAssets(client: Client, parameters: getAssets.Parameters): Promise<getAssets.ReturnType>;
|
|
69
|
+
export declare namespace getAssets {
|
|
70
|
+
type Parameters = RpcSchema.wallet_getAssets.Parameters;
|
|
71
|
+
type ReturnType = RpcSchema.wallet_getAssets.Response;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Requests faucet funds to be sent to an address on the Relay.
|
|
75
|
+
*/
|
|
76
|
+
export declare function addFaucetFunds<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: addFaucetFunds.Parameters<chain>): Promise<RpcSchema.wallet_addFaucetFunds.Response>;
|
|
77
|
+
export declare namespace addFaucetFunds {
|
|
78
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined> = Omit<RpcSchema.wallet_addFaucetFunds.Parameters, 'chainId'> & GetChainParameter<chain>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Gets the status of a call bundle.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* TODO
|
|
85
|
+
*
|
|
86
|
+
* @param client - The client to use.
|
|
87
|
+
* @param parameters - Parameters.
|
|
88
|
+
* @returns Result.
|
|
89
|
+
*/
|
|
90
|
+
export declare function getCallsStatus(client: Client, parameters: getCallsStatus.Parameters): Promise<getCallsStatus.ReturnType>;
|
|
91
|
+
export declare namespace getCallsStatus {
|
|
92
|
+
type Parameters = {
|
|
93
|
+
id: Hex.Hex;
|
|
94
|
+
};
|
|
95
|
+
type ReturnType = RpcSchema.wallet_getCallsStatus.Response;
|
|
96
|
+
type ErrorType = parseSchemaError.ErrorType | Errors.GlobalErrorType;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Gets the keys for a given account.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* TODO
|
|
103
|
+
*
|
|
104
|
+
* @param client - The client to use.
|
|
105
|
+
* @param parameters - Parameters.
|
|
106
|
+
* @returns Result.
|
|
107
|
+
*/
|
|
108
|
+
export declare function getKeys(client: Client, parameters: getKeys.Parameters): Promise<getKeys.ReturnType>;
|
|
109
|
+
export declare namespace getKeys {
|
|
110
|
+
type Parameters = RpcSchema.wallet_getKeys.Parameters;
|
|
111
|
+
type ReturnType = RpcSchema.wallet_getKeys.Response;
|
|
112
|
+
type ErrorType = parseSchemaError.ErrorType | Errors.GlobalErrorType;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Gets the health of the RPC.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* TODO
|
|
119
|
+
*
|
|
120
|
+
* @param client - The client to use.
|
|
121
|
+
* @returns Result.
|
|
122
|
+
*/
|
|
123
|
+
export declare function health(client: Client): Promise<health.ReturnType>;
|
|
124
|
+
export declare namespace health {
|
|
125
|
+
type ReturnType = RpcSchema.health.Response;
|
|
126
|
+
type ErrorType = Errors.GlobalErrorType;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Prepares a call bundle.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* TODO
|
|
133
|
+
*
|
|
134
|
+
* @param client - The client to use.
|
|
135
|
+
* @param parameters - Parameters.
|
|
136
|
+
* @returns Result.
|
|
137
|
+
*/
|
|
138
|
+
export declare function prepareCalls<const calls extends readonly unknown[], chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: prepareCalls.Parameters<calls, chain>): Promise<prepareCalls.ReturnType>;
|
|
139
|
+
export declare namespace prepareCalls {
|
|
140
|
+
type Parameters<calls extends readonly unknown[] = readonly unknown[], chain extends Chain | undefined = Chain | undefined> = {
|
|
141
|
+
address?: Address.Address | undefined;
|
|
142
|
+
calls: Calls<Narrow<calls>>;
|
|
143
|
+
capabilities?: RpcSchema.wallet_prepareCalls.Capabilities | undefined;
|
|
144
|
+
key: RpcSchema.wallet_prepareCalls.Parameters['key'];
|
|
145
|
+
} & GetChainParameter<chain>;
|
|
146
|
+
type ReturnType = RpcSchema.wallet_prepareCalls.Response & {
|
|
147
|
+
_raw: z.input<typeof RpcSchema.wallet_prepareCalls.Response>;
|
|
148
|
+
};
|
|
149
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Prepares an account upgrade.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* TODO
|
|
156
|
+
*
|
|
157
|
+
* @param client - Client to use.
|
|
158
|
+
* @param parameters - Parameters.
|
|
159
|
+
* @returns Result.
|
|
160
|
+
*/
|
|
161
|
+
export declare function prepareUpgradeAccount<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: prepareUpgradeAccount.Parameters<chain>): Promise<prepareUpgradeAccount.ReturnType>;
|
|
162
|
+
export declare namespace prepareUpgradeAccount {
|
|
163
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined> = RpcSchema.wallet_prepareUpgradeAccount.Parameters['capabilities'] & Omit<RpcSchema.wallet_prepareUpgradeAccount.Parameters, 'capabilities' | 'chainId'> & GetChainParameter<chain>;
|
|
164
|
+
type ReturnType = RpcSchema.wallet_prepareUpgradeAccount.Response;
|
|
165
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Broadcasts a signed call bundle.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* TODO
|
|
172
|
+
*
|
|
173
|
+
* @param client - The client to use.
|
|
174
|
+
* @param parameters - Parameters.
|
|
175
|
+
* @returns Result.
|
|
176
|
+
*/
|
|
177
|
+
export declare function sendPreparedCalls(client: Client, parameters: sendPreparedCalls.Parameters): Promise<sendPreparedCalls.ReturnType>;
|
|
178
|
+
export declare namespace sendPreparedCalls {
|
|
179
|
+
type Parameters = RpcSchema.wallet_sendPreparedCalls.Parameters;
|
|
180
|
+
type ReturnType = RpcSchema.wallet_sendPreparedCalls.Response;
|
|
181
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* NOTE: SHOULD ONLY BE USED ON SERVER.
|
|
185
|
+
*
|
|
186
|
+
* Gets onramp contact info for address.
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* TODO
|
|
190
|
+
*
|
|
191
|
+
* @param client - Client to use.
|
|
192
|
+
* @param parameters - Parameters.
|
|
193
|
+
* @returns Result.
|
|
194
|
+
*/
|
|
195
|
+
export declare function getOnrampContactInfo(client: Client, parameters: getOnrampContactInfo.Parameters): Promise<getOnrampContactInfo.ReturnType>;
|
|
196
|
+
export declare namespace getOnrampContactInfo {
|
|
197
|
+
type Parameters = RpcSchema.account_getOnrampContactInfo.Parameters;
|
|
198
|
+
type ReturnType = RpcSchema.account_getOnrampContactInfo.Response;
|
|
199
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Gets onramp status for address
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* TODO
|
|
206
|
+
*
|
|
207
|
+
* @param client - Client to use.
|
|
208
|
+
* @param parameters - Parameters.
|
|
209
|
+
* @returns Result.
|
|
210
|
+
*/
|
|
211
|
+
export declare function onrampStatus(client: Client, parameters: onrampStatus.Parameters): Promise<onrampStatus.ReturnType>;
|
|
212
|
+
export declare namespace onrampStatus {
|
|
213
|
+
type Parameters = RpcSchema.account_onrampStatus.Parameters;
|
|
214
|
+
type ReturnType = RpcSchema.account_onrampStatus.Response;
|
|
215
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Resends phone verification for address
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* TODO
|
|
222
|
+
*
|
|
223
|
+
* @param client - Client to use.
|
|
224
|
+
* @param parameters - Parameters.
|
|
225
|
+
* @returns Result.
|
|
226
|
+
*/
|
|
227
|
+
export declare function resendVerifyPhone(client: Client, parameters: resendVerifyPhone.Parameters): Promise<resendVerifyPhone.ReturnType>;
|
|
228
|
+
export declare namespace resendVerifyPhone {
|
|
229
|
+
type Parameters = RpcSchema.account_resendVerifyPhone.Parameters;
|
|
230
|
+
type ReturnType = RpcSchema.account_resendVerifyPhone.Response;
|
|
231
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Sets email for address
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* TODO
|
|
238
|
+
*
|
|
239
|
+
* @param client - Client to use.
|
|
240
|
+
* @param parameters - Parameters.
|
|
241
|
+
* @returns Result.
|
|
242
|
+
*/
|
|
243
|
+
export declare function setEmail(client: Client, parameters: setEmail.Parameters): Promise<setEmail.ReturnType>;
|
|
244
|
+
export declare namespace setEmail {
|
|
245
|
+
type Parameters = RpcSchema.account_setEmail.Parameters;
|
|
246
|
+
type ReturnType = RpcSchema.account_setEmail.Response;
|
|
247
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Sets phone for address
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* TODO
|
|
254
|
+
*
|
|
255
|
+
* @param client - Client to use.
|
|
256
|
+
* @param parameters - Parameters.
|
|
257
|
+
* @returns Result.
|
|
258
|
+
*/
|
|
259
|
+
export declare function setPhone(client: Client, parameters: setPhone.Parameters): Promise<setPhone.ReturnType>;
|
|
260
|
+
export declare namespace setPhone {
|
|
261
|
+
type Parameters = RpcSchema.account_setPhone.Parameters;
|
|
262
|
+
type ReturnType = RpcSchema.account_setPhone.Response;
|
|
263
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Submits an account upgrade to the Relay.
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* TODO
|
|
270
|
+
*
|
|
271
|
+
* @param client - Client to use.
|
|
272
|
+
* @param parameters - Parameters.
|
|
273
|
+
* @returns Result.
|
|
274
|
+
*/
|
|
275
|
+
export declare function upgradeAccount(client: Client, parameters: upgradeAccount.Parameters): Promise<upgradeAccount.ReturnType>;
|
|
276
|
+
export declare namespace upgradeAccount {
|
|
277
|
+
type Parameters = RpcSchema.wallet_upgradeAccount.Parameters;
|
|
278
|
+
type ReturnType = RpcSchema.wallet_upgradeAccount.Response;
|
|
279
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Verifies email for address
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* TODO
|
|
286
|
+
*
|
|
287
|
+
* @param client - Client to use.
|
|
288
|
+
* @param parameters - Parameters.
|
|
289
|
+
* @returns Result.
|
|
290
|
+
*/
|
|
291
|
+
export declare function verifyEmail(client: Client, parameters: verifyEmail.Parameters): Promise<verifyEmail.ReturnType>;
|
|
292
|
+
export declare namespace verifyEmail {
|
|
293
|
+
type Parameters = RpcSchema.account_verifyEmail.Parameters;
|
|
294
|
+
type ReturnType = RpcSchema.account_verifyEmail.Response;
|
|
295
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Verifies email for address
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* TODO
|
|
302
|
+
*
|
|
303
|
+
* @param client - Client to use.
|
|
304
|
+
* @param parameters - Parameters.
|
|
305
|
+
* @returns Result.
|
|
306
|
+
*/
|
|
307
|
+
export declare function verifyPhone(client: Client, parameters: verifyPhone.Parameters): Promise<verifyPhone.ReturnType>;
|
|
308
|
+
export declare namespace verifyPhone {
|
|
309
|
+
type Parameters = RpcSchema.account_verifyPhone.Parameters;
|
|
310
|
+
type ReturnType = RpcSchema.account_verifyPhone.Response;
|
|
311
|
+
type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Verifies a prepare calls response.
|
|
315
|
+
*
|
|
316
|
+
* @param client - Client to use.
|
|
317
|
+
* @param parameters - Parameters.
|
|
318
|
+
* @returns Whether or not the response is valid.
|
|
319
|
+
*/
|
|
320
|
+
export declare function verifyPrepareCallsResponse(client: Client, parameters: verifyPrepareCallsResponse.Parameters): Promise<boolean>;
|
|
321
|
+
export declare namespace verifyPrepareCallsResponse {
|
|
322
|
+
type Parameters = {
|
|
323
|
+
response: z.input<typeof RpcSchema.wallet_prepareCalls.Response>;
|
|
324
|
+
signature: Hex.Hex;
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Verifies a signature.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* TODO
|
|
332
|
+
*
|
|
333
|
+
* @param client - The client to use.
|
|
334
|
+
* @param parameters - Parameters.
|
|
335
|
+
* @returns Result.
|
|
336
|
+
*/
|
|
337
|
+
export declare function verifySignature<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: verifySignature.Parameters<chain>): Promise<verifySignature.ReturnType>;
|
|
338
|
+
export declare namespace verifySignature {
|
|
339
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined> = Omit<RpcSchema.wallet_verifySignature.Parameters, 'chainId' | 'keyIdOrAddress'> & {
|
|
340
|
+
address: Address.Address;
|
|
341
|
+
} & GetChainParameter<chain>;
|
|
342
|
+
type ReturnType = RpcSchema.wallet_verifySignature.Response;
|
|
343
|
+
type ErrorType = parseSchemaError.ErrorType | Errors.GlobalErrorType;
|
|
344
|
+
}
|
|
345
|
+
export declare function parseExecutionError<const calls extends readonly unknown[]>(e: unknown, { calls }?: {
|
|
346
|
+
calls?: sendCalls.Parameters<calls>['calls'] | undefined;
|
|
347
|
+
}): void;
|
|
348
|
+
export declare function sortKeys<value>(value: value): value;
|
|
349
|
+
export declare namespace parseExecutionError {
|
|
350
|
+
type ErrorType = ExecutionError | Errors.GlobalErrorType;
|
|
351
|
+
}
|
|
352
|
+
/** Thrown when schema validation fails. */
|
|
353
|
+
export declare function parseSchemaError(e: unknown): void;
|
|
354
|
+
export declare namespace parseSchemaError {
|
|
355
|
+
type ErrorType = u.ValidationError | Errors.GlobalErrorType;
|
|
356
|
+
}
|
|
357
|
+
/** Thrown when the execution fails. */
|
|
358
|
+
export declare class ExecutionError extends Errors.BaseError<BaseError> {
|
|
359
|
+
readonly name = "Rpc.ExecutionError";
|
|
360
|
+
abiError?: AbiError.AbiError | undefined;
|
|
361
|
+
constructor(cause: BaseError & {
|
|
362
|
+
abiError?: AbiError.AbiError | undefined;
|
|
363
|
+
});
|
|
364
|
+
}
|