@account-kit/wallet-client 0.1.0-alpha.1 → 0.1.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/capabilities/index.d.ts +5 -2
- package/dist/esm/capabilities/index.js +1 -1
- package/dist/esm/capabilities/index.js.map +1 -1
- package/dist/esm/capabilities/overrides.js +8 -8
- package/dist/esm/capabilities/overrides.js.map +1 -1
- package/dist/esm/capabilities/permissions/index.d.ts +10 -3
- package/dist/esm/capabilities/permissions/index.js +11 -2
- package/dist/esm/capabilities/permissions/index.js.map +1 -1
- package/dist/esm/capabilities/permissions/mav2.d.ts +3 -3
- package/dist/esm/capabilities/permissions/mav2.js +9 -1
- package/dist/esm/capabilities/permissions/mav2.js.map +1 -1
- package/dist/esm/client/actions/createAccount.d.ts +27 -2
- package/dist/esm/client/actions/createAccount.js +25 -0
- package/dist/esm/client/actions/createAccount.js.map +1 -1
- package/dist/esm/client/actions/getCallsStatus.d.ts +21 -2
- package/dist/esm/client/actions/getCallsStatus.js.map +1 -1
- package/dist/esm/client/actions/grantPermissions.d.ts +114 -2
- package/dist/esm/client/actions/grantPermissions.js +1 -0
- package/dist/esm/client/actions/grantPermissions.js.map +1 -1
- package/dist/esm/client/actions/listAccounts.d.ts +26 -2
- package/dist/esm/client/actions/listAccounts.js +24 -0
- package/dist/esm/client/actions/listAccounts.js.map +1 -1
- package/dist/esm/client/actions/prepareCalls.d.ts +28 -2
- package/dist/esm/client/actions/prepareCalls.js.map +1 -1
- package/dist/esm/client/actions/requestAccount.d.ts +21 -2
- package/dist/esm/client/actions/requestAccount.js +15 -4
- package/dist/esm/client/actions/requestAccount.js.map +1 -1
- package/dist/esm/client/actions/sendPreparedCalls.d.ts +39 -2
- package/dist/esm/client/actions/sendPreparedCalls.js +37 -0
- package/dist/esm/client/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/client/actions/signMessage.d.ts +22 -2
- package/dist/esm/client/actions/signMessage.js +4 -2
- package/dist/esm/client/actions/signMessage.js.map +1 -1
- package/dist/esm/client/actions/signSignatureRequest.d.ts +34 -0
- package/dist/esm/client/actions/signSignatureRequest.js +22 -1
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
- package/dist/esm/client/actions/signTypedData.d.ts +35 -2
- package/dist/esm/client/actions/signTypedData.js +3 -1
- package/dist/esm/client/actions/signTypedData.js.map +1 -1
- package/dist/esm/client/client.e2e-test.js +112 -30
- package/dist/esm/client/client.e2e-test.js.map +1 -1
- package/dist/esm/client/decorator.d.ts +7 -5
- package/dist/esm/client/decorator.js +1 -1
- package/dist/esm/client/decorator.js.map +1 -1
- package/dist/esm/client/index.d.ts +4 -4
- package/dist/esm/client/index.js +29 -3
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/exports/index.d.ts +1 -0
- package/dist/esm/exports/index.js +1 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/internal.d.ts +1 -1
- package/dist/esm/exports/internal.js.map +1 -1
- package/dist/esm/internal/decorator.d.ts +2 -0
- package/dist/esm/internal/decorator.js +10 -0
- package/dist/esm/internal/decorator.js.map +1 -0
- package/dist/esm/isomorphic/actions/createSession.js +25 -7
- package/dist/esm/isomorphic/actions/createSession.js.map +1 -1
- package/dist/esm/isomorphic/actions/prepareCalls.js +35 -12
- package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -1
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js +26 -6
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/isomorphic/client.d.ts +11 -5
- package/dist/esm/isomorphic/utils/7702.d.ts +11 -0
- package/dist/esm/isomorphic/utils/7702.js +26 -0
- package/dist/esm/isomorphic/utils/7702.js.map +1 -0
- package/dist/esm/isomorphic/utils/createAccount.d.ts +2 -1
- package/dist/esm/isomorphic/utils/createAccount.js +30 -5
- package/dist/esm/isomorphic/utils/createAccount.js.map +1 -1
- package/dist/esm/isomorphic/utils/createDummySigner.js +3 -3
- package/dist/esm/isomorphic/utils/createDummySigner.js.map +1 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +2 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js +17 -5
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js.map +1 -1
- package/dist/esm/local/client.d.ts +1 -1
- package/dist/esm/local/client.js +10 -2
- package/dist/esm/local/client.js.map +1 -1
- package/dist/esm/remote/client.d.ts +1 -1
- package/dist/esm/remote/client.js +12 -3
- package/dist/esm/remote/client.js.map +1 -1
- package/dist/esm/rpc/examples.d.ts +230 -0
- package/dist/esm/rpc/examples.js +314 -0
- package/dist/esm/rpc/examples.js.map +1 -0
- package/dist/esm/rpc/request.d.ts +48 -17
- package/dist/esm/rpc/request.js +53 -14
- package/dist/esm/rpc/request.js.map +1 -1
- package/dist/esm/rpc/schema.d.ts +43 -12
- package/dist/esm/schemas.d.ts +29 -7
- package/dist/esm/schemas.js +120 -38
- package/dist/esm/schemas.js.map +1 -1
- package/dist/esm/types.d.ts +15 -4
- package/dist/esm/types.js.map +1 -1
- package/dist/types/capabilities/index.d.ts +5 -2
- package/dist/types/capabilities/index.d.ts.map +1 -1
- package/dist/types/capabilities/overrides.d.ts.map +1 -1
- package/dist/types/capabilities/permissions/index.d.ts +10 -3
- package/dist/types/capabilities/permissions/index.d.ts.map +1 -1
- package/dist/types/capabilities/permissions/mav2.d.ts +3 -3
- package/dist/types/capabilities/permissions/mav2.d.ts.map +1 -1
- package/dist/types/client/actions/createAccount.d.ts +27 -2
- package/dist/types/client/actions/createAccount.d.ts.map +1 -1
- package/dist/types/client/actions/getCallsStatus.d.ts +21 -2
- package/dist/types/client/actions/getCallsStatus.d.ts.map +1 -1
- package/dist/types/client/actions/grantPermissions.d.ts +114 -2
- package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
- package/dist/types/client/actions/listAccounts.d.ts +26 -2
- package/dist/types/client/actions/listAccounts.d.ts.map +1 -1
- package/dist/types/client/actions/prepareCalls.d.ts +28 -2
- package/dist/types/client/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/client/actions/requestAccount.d.ts +21 -2
- package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
- package/dist/types/client/actions/sendPreparedCalls.d.ts +39 -2
- package/dist/types/client/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/client/actions/signMessage.d.ts +22 -2
- package/dist/types/client/actions/signMessage.d.ts.map +1 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts +34 -0
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
- package/dist/types/client/actions/signTypedData.d.ts +35 -2
- package/dist/types/client/actions/signTypedData.d.ts.map +1 -1
- package/dist/types/client/decorator.d.ts +7 -5
- package/dist/types/client/decorator.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +4 -4
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +1 -0
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/internal.d.ts +1 -1
- package/dist/types/exports/internal.d.ts.map +1 -1
- package/dist/types/internal/decorator.d.ts +3 -0
- package/dist/types/internal/decorator.d.ts.map +1 -0
- package/dist/types/isomorphic/actions/createSession.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/client.d.ts +11 -5
- package/dist/types/isomorphic/client.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/7702.d.ts +12 -0
- package/dist/types/isomorphic/utils/7702.d.ts.map +1 -0
- package/dist/types/isomorphic/utils/createAccount.d.ts +2 -1
- package/dist/types/isomorphic/utils/createAccount.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/createDummySigner.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +2 -1
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts.map +1 -1
- package/dist/types/local/client.d.ts +1 -1
- package/dist/types/local/client.d.ts.map +1 -1
- package/dist/types/remote/client.d.ts +1 -1
- package/dist/types/remote/client.d.ts.map +1 -1
- package/dist/types/rpc/examples.d.ts +231 -0
- package/dist/types/rpc/examples.d.ts.map +1 -0
- package/dist/types/rpc/request.d.ts +48 -17
- package/dist/types/rpc/request.d.ts.map +1 -1
- package/dist/types/rpc/schema.d.ts +43 -12
- package/dist/types/rpc/schema.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +29 -7
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/types.d.ts +15 -4
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +8 -6
- package/src/capabilities/index.ts +5 -8
- package/src/capabilities/overrides.ts +23 -8
- package/src/capabilities/permissions/index.ts +21 -5
- package/src/capabilities/permissions/mav2.ts +13 -3
- package/src/client/actions/createAccount.ts +27 -2
- package/src/client/actions/getCallsStatus.ts +21 -2
- package/src/client/actions/grantPermissions.ts +114 -2
- package/src/client/actions/listAccounts.ts +26 -2
- package/src/client/actions/prepareCalls.ts +28 -2
- package/src/client/actions/requestAccount.ts +41 -7
- package/src/client/actions/sendPreparedCalls.ts +39 -2
- package/src/client/actions/signMessage.ts +24 -4
- package/src/client/actions/signSignatureRequest.ts +61 -2
- package/src/client/actions/signTypedData.ts +39 -3
- package/src/client/client.e2e-test.ts +134 -32
- package/src/client/decorator.ts +10 -12
- package/src/client/index.ts +41 -10
- package/src/exports/index.ts +1 -0
- package/src/exports/internal.ts +1 -1
- package/src/internal/decorator.ts +12 -0
- package/src/isomorphic/actions/createSession.ts +28 -7
- package/src/isomorphic/actions/prepareCalls.ts +38 -11
- package/src/isomorphic/actions/sendPreparedCalls.ts +47 -20
- package/src/isomorphic/utils/7702.ts +58 -0
- package/src/isomorphic/utils/createAccount.ts +38 -6
- package/src/isomorphic/utils/createDummySigner.ts +3 -2
- package/src/isomorphic/utils/parsePermissionsContext.ts +23 -7
- package/src/local/client.ts +54 -45
- package/src/remote/client.ts +22 -7
- package/src/rpc/examples.ts +343 -0
- package/src/rpc/request.ts +75 -26
- package/src/schemas.ts +218 -87
- package/src/types.ts +18 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"examples.js","sourceRoot":"","sources":["../../../src/rpc/examples.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG;IACnB;QACE,IAAI,EAAE,6BAA6B;QACnC,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE;oBACL;wBACE,KAAK,EAAE;4BACL;gCACE,EAAE,EAAE,4CAA4C;gCAChD,IAAI,EAAE,IAAI;6BACX;yBACF;wBACD,IAAI,EAAE,4CAA4C;wBAClD,OAAO,EAAE,MAAM;wBACf,YAAY,EAAE;4BACZ,gBAAgB,EAAE;gCAChB,QAAQ,EAAE,sCAAsC;6BACjD;yBACF;qBACF;iBACF;aACF;SACF;QACD,MAAM,EAAE;YACN,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE;gBACL,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE;oBACJ,MAAM,EAAE,4CAA4C;oBACpD,KAAK,EAAE,qBAAqB;oBAC5B,QAAQ,EACN,4cAA4c;oBAC9c,SAAS,EAAE,4CAA4C;oBACvD,aAAa,EACX,8JAA8J;oBAChK,uBAAuB,EAAE,KAAK;oBAC9B,6BAA6B,EAAE,QAAQ;oBACvC,oBAAoB,EAAE,UAAU;oBAChC,YAAY,EAAE,YAAY;oBAC1B,YAAY,EAAE,QAAQ;oBACtB,oBAAoB,EAAE,QAAQ;oBAC9B,kBAAkB,EAAE,SAAS;iBAC9B;gBACD,OAAO,EAAE,SAAS;gBAClB,gBAAgB,EAAE;oBAChB,IAAI,EAAE,eAAe;oBACrB,IAAI,EAAE;wBACJ,GAAG,EAAE,oEAAoE;qBAC1E;iBACF;aACF;SACF;KACF;CACO,CAAC;AAEX,MAAM,iBAAiB,GAAG;IACxB;QACE,IAAI,EAAE,kCAAkC;QACx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E,OAAO,EAAE,4CAA4C;gCACrD,IAAI,EAAE,oQAAoQ;gCAC1Q,MAAM,EAAE;oCACN,oEAAoE;oCACpE,oEAAoE;oCACpE,oEAAoE;oCACpE,oEAAoE;iCACrE;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACO,CAAC;AAkBX,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,YAAY;IACZ,iBAAiB;IACjB,cAAc;IACd,aAAa;IACb,YAAY;IACZ,aAAa;IACb,cAAc;CACmB,CAAC","sourcesContent":["const PrepareCalls = [\n {\n name: \"wallet_prepareCalls example\",\n params: [\n {\n name: \"Request\",\n value: [\n {\n calls: [\n {\n to: \"0x1234567890123456789012345678901234567890\",\n data: \"0x\",\n },\n ],\n from: \"0xa363219d7C0b8673df17529D469Db9eFF0f35D2A\",\n chainId: \"0x01\",\n capabilities: {\n paymasterService: {\n policyId: \"11111111-2222-3333-4444-555555555555\",\n },\n },\n },\n ],\n },\n ],\n result: {\n name: \"Response\",\n value: {\n type: \"user-operation-v070\",\n data: {\n sender: \"0xa363219d7C0b8673df17529D469Db9eFF0f35D2A\",\n nonce: \"0x10000000000000000\",\n callData:\n \"0x34fcd5be0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000\",\n paymaster: \"0x3f222Df6aB18C1E10d0Ec136503c3B0dfd929048\",\n paymasterData:\n \"0x0000000000000000682d7e7c9fa6f71c28c31141a11ac9eb2bdbe898ddbd42a4f7085f8bb3380ba75dd9231a386e24fe5a84777217c907391e983b5b0f78a4a9d0fd1c8631dd22c10e106b461c\",\n paymasterPostOpGasLimit: \"0x0\",\n paymasterVerificationGasLimit: \"0x74d3\",\n maxPriorityFeePerGas: \"0x60e4b0\",\n maxFeePerGas: \"0x1bf52290\",\n callGasLimit: \"0x2bb8\",\n verificationGasLimit: \"0xc845\",\n preVerificationGas: \"0x14b74\",\n },\n chainId: \"0x66eee\",\n signatureRequest: {\n type: \"personal_sign\",\n data: {\n raw: \"0xc69e468aa6fafb5c7298c02841e76f976b433018266af39a5807bc29ea9ad392\",\n },\n },\n },\n },\n },\n] as const;\n\nconst SendPreparedCalls = [\n {\n name: \"wallet_sendPreparedCalls example\",\n params: [\n {\n name: \"Request\",\n value: [\n {\n type: \"user-operation-v070\",\n data: {\n sender: \"0xa363219d7C0b8673df17529D469Db9eFF0f35D2A\",\n nonce: \"0x10000000000000000\",\n callData:\n \"0x34fcd5be0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000\",\n paymaster: \"0x3f222Df6aB18C1E10d0Ec136503c3B0dfd929048\",\n paymasterData:\n \"0x0000000000000000682d7e7c9fa6f71c28c31141a11ac9eb2bdbe898ddbd42a4f7085f8bb3380ba75dd9231a386e24fe5a84777217c907391e983b5b0f78a4a9d0fd1c8631dd22c10e106b461c\",\n paymasterPostOpGasLimit: \"0x0\",\n paymasterVerificationGasLimit: \"0x74d3\",\n maxPriorityFeePerGas: \"0x60e4b0\",\n maxFeePerGas: \"0x1bf52290\",\n callGasLimit: \"0x2bb8\",\n verificationGasLimit: \"0xc845\",\n preVerificationGas: \"0x14b74\",\n },\n chainId: \"0x66eee\",\n signature: {\n type: \"ecdsa\",\n signature:\n \"0xb1a055089b1ba8387ed435f2bd0afe7ff69f22b928cdfdea1b5323c64d6af387164de3fa6febf031b544de46a84d6fb7f084b9798ddfaba820950c257139a7321b\",\n },\n },\n ],\n },\n ],\n result: {\n name: \"Response\",\n value: {\n preparedCallIds: [\n \"0x0000000000000000000000000000000000000000000000000000000000066eeec69e468aa6fafb5c7298c02841e76f976b433018266af39a5807bc29ea9ad392\",\n ],\n },\n },\n },\n] as const;\n\nconst RequestAccount = [\n {\n name: \"wallet_requestAccount example\",\n params: [\n {\n name: \"Request\",\n value: [\n {\n signerAddress: \"0xa363219d7C0b8673df17529D469Db9eFF0f35D2A\",\n },\n ],\n },\n ],\n result: {\n name: \"Response\",\n value: {\n accountAddress: \"0xa363219d7C0b8673df17529D469Db9eFF0f35D2A\",\n id: \"3061cc5f-1f96-48a9-ab45-41faad2dd23b\",\n },\n },\n },\n] as const;\n\nconst CreateAccount = [\n {\n name: \"wallet_createAccount example\",\n params: [\n {\n name: \"Request\",\n value: [\n {\n signerAddress: \"0xa363219d7C0b8673df17529D469Db9eFF0f35D2A\",\n creationOption: {\n salt: \"0x10\",\n },\n },\n ],\n },\n ],\n result: {\n name: \"Response\",\n value: {\n accountAddress: \"0xa363219d7C0b8673df17529D469Db9eFF0f35D2A\",\n id: \"3061cc5f-1f96-48a9-ab45-41faad2dd23b\",\n },\n },\n },\n] as const;\n\nconst ListAccounts = [\n {\n name: \"wallet_listAccounts example\",\n params: [\n {\n name: \"Request\",\n value: [\n {\n signerAddress: \"0x6275B53E98D07c729108A177207634eA22F5A748\",\n },\n ],\n },\n ],\n result: {\n name: \"Response\",\n value: {\n accounts: [\n {\n accountAddress: \"0xafdABa1E09e82F780721963eba39bA9e6d9FE4d2\",\n id: \"3d8b3315-4aa1-4c67-8c82-20221e8dbf16\",\n },\n ],\n meta: {\n totalCount: 1,\n after: null,\n },\n },\n },\n },\n] as const;\n\nconst CreateSession = [\n {\n name: \"wallet_createSession example\",\n params: [\n {\n name: \"Request\",\n value: [\n {\n account: \"0xafdABa1E09e82F780721963eba39bA9e6d9FE4d2\",\n chainId: \"0x01\",\n key: {\n publicKey: \"0x647bbf38CD0E116d1672405aE17a775572a84e03\",\n type: \"secp256k1\",\n },\n permissions: [\n {\n type: \"root\",\n },\n ],\n expiry: 1747969653,\n },\n ],\n },\n ],\n result: {\n name: \"Response\",\n value: {\n sessionId: \"0xcd8b2d07a6fa76f1e8a5eaa8f3a7883c\",\n signatureRequest: {\n type: \"eth_signTypedData_v4\",\n data: {\n domain: {\n chainId: 1,\n verifyingContract: \"0xafdABa1E09e82F780721963eba39bA9e6d9FE4d2\",\n },\n types: {\n DeferredAction: [\n {\n name: \"nonce\",\n type: \"uint256\",\n },\n {\n name: \"deadline\",\n type: \"uint48\",\n },\n {\n name: \"call\",\n type: \"bytes\",\n },\n ],\n },\n primaryType: \"DeferredAction\",\n message: {\n nonce: \"0x1030000000000000000\",\n deadline: 1747969653,\n call: \"0x1bbf564c00000000000099DE0BF6fA90dEB851E2A2df7d83000000010500000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000647bbf38cd0e116d1672405ae17a775572a84e0300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000007900000000000082B8e2012be914dFA4f62A0573eA0000000101000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000682fe675000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n },\n },\n },\n },\n },\n },\n] as const;\n\nconst GetCallsStatus = [\n {\n name: \"wallet_getCallsStatus example\",\n params: [\n {\n name: \"Request\",\n value: [\n \"0x0000000000000000000000000000000000000000000000000000000000066eee1057eff9529142aa3b74adcaacfce5b99a09d80c9f2e38e35ea1f27535e61477\",\n ],\n },\n ],\n result: {\n name: \"Response\",\n value: {\n id: \"0x0000000000000000000000000000000000000000000000000000000000066eee1057eff9529142aa3b74adcaacfce5b99a09d80c9f2e38e35ea1f27535e61477\",\n chainId: \"0x66eee\",\n atomic: true,\n status: 200,\n receipts: [\n {\n status: \"0x1\",\n blockHash:\n \"0x7c6f2f548c0ad4434dfb64f49a810bc795dadcd4cbec948bf8d4ae81a10fed5e\",\n blockNumber: \"0x8ba5f79\",\n gasUsed: \"0x33c65\",\n transactionHash:\n \"0x8ec28074a461102e4dbe43cb4aa9fed3e8c1274f1f1b0d5f6a0919ce7e20f517\",\n logs: [\n {\n address: \"0x00000000000017c61b5bee81050ec8efc9c6fecd\",\n data: \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n topics: [\n \"0xd32049610f0cd3babd266cf338d726cc8c34c8ff97356c0f33c13fa59962ac92\",\n \"0x000000000000000000000000f13223cca0ae9786dd91dffe1f4e834c71ccdc2d\",\n \"0x0000000000000000000000003f3503e682bf27330f9e5065043d47207e609e7d\",\n ],\n },\n {\n address: \"0x0000000071727de22e5e9d8baf0edac6f37da032\",\n data: \"0x00000000000000000000000000000000000017c61b5bee81050ec8efc9c6fecd0000000000000000000000002cc0c7981d846b9f2a16276556f6e8cb52bfb633\",\n topics: [\n \"0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d\",\n \"0x1057eff9529142aa3b74adcaacfce5b99a09d80c9f2e38e35ea1f27535e61477\",\n \"0x000000000000000000000000f13223cca0ae9786dd91dffe1f4e834c71ccdc2d\",\n ],\n },\n {\n address: \"0x0000000071727de22e5e9d8baf0edac6f37da032\",\n data: \"0x\",\n topics: [\n \"0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972\",\n ],\n },\n {\n address: \"0x0000000071727de22e5e9d8baf0edac6f37da032\",\n data: \"0x00000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000014ba6c2cd4f0000000000000000000000000000000000000000000000000000000000003451d\",\n topics: [\n \"0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f\",\n \"0x1057eff9529142aa3b74adcaacfce5b99a09d80c9f2e38e35ea1f27535e61477\",\n \"0x000000000000000000000000f13223cca0ae9786dd91dffe1f4e834c71ccdc2d\",\n \"0x0000000000000000000000002cc0c7981d846b9f2a16276556f6e8cb52bfb633\",\n ],\n },\n ],\n },\n ],\n },\n },\n },\n] as const;\n\ntype Example = readonly [\n {\n name: string;\n params: readonly [\n {\n name: \"Request\";\n value: readonly [unknown];\n },\n ];\n result: {\n name: \"Response\";\n value: unknown;\n };\n },\n];\n\nexport const Examples = {\n PrepareCalls,\n SendPreparedCalls,\n RequestAccount,\n CreateAccount,\n ListAccounts,\n CreateSession,\n GetCallsStatus,\n} satisfies Record<string, Example>;\n"]}
|
|
@@ -32,13 +32,24 @@ export declare const wallet_sendPreparedCalls: import("@sinclair/typebox").TObje
|
|
|
32
32
|
}>]>;
|
|
33
33
|
chainId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
34
34
|
signature: import("@sinclair/typebox").TObject<{
|
|
35
|
-
type: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").
|
|
35
|
+
type: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TLiteral<"ecdsa">, "ecdsa">;
|
|
36
36
|
signature: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
37
37
|
}>;
|
|
38
|
+
signedAuthorization: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
39
|
+
chainId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
40
|
+
nonce: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
41
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
42
|
+
r: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
43
|
+
s: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
44
|
+
yParity: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
45
|
+
}>>;
|
|
38
46
|
capabilities: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
39
|
-
permissions: import("@sinclair/typebox").TObject<{
|
|
47
|
+
permissions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
40
48
|
context: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
41
|
-
}
|
|
49
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
50
|
+
sessionId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
51
|
+
signature: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
52
|
+
}>]>>;
|
|
42
53
|
}>>;
|
|
43
54
|
}>]>;
|
|
44
55
|
}>;
|
|
@@ -58,9 +69,12 @@ export declare const wallet_prepareCalls: import("@sinclair/typebox").TObject<{
|
|
|
58
69
|
from: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
59
70
|
chainId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
60
71
|
capabilities: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
61
|
-
permissions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
72
|
+
permissions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
62
73
|
context: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
63
|
-
}
|
|
74
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
75
|
+
sessionId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
76
|
+
signature: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
77
|
+
}>]>>;
|
|
64
78
|
paymasterService: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
65
79
|
policyId: import("@sinclair/typebox").TString;
|
|
66
80
|
}>>;
|
|
@@ -120,7 +134,7 @@ export declare const wallet_prepareCalls: import("@sinclair/typebox").TObject<{
|
|
|
120
134
|
paymasterPostOpGasLimit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
121
135
|
}>]>;
|
|
122
136
|
chainId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
123
|
-
signatureRequest: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
137
|
+
signatureRequest: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
124
138
|
type: import("@sinclair/typebox").TLiteral<"personal_sign">;
|
|
125
139
|
data: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
126
140
|
raw: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
@@ -129,7 +143,7 @@ export declare const wallet_prepareCalls: import("@sinclair/typebox").TObject<{
|
|
|
129
143
|
type: import("@sinclair/typebox").TLiteral<"eth_signTypedData_v4">;
|
|
130
144
|
data: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TObject<{
|
|
131
145
|
domain: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
132
|
-
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
|
146
|
+
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
133
147
|
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
134
148
|
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
135
149
|
verifyingContract: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
@@ -143,8 +157,8 @@ export declare const wallet_prepareCalls: import("@sinclair/typebox").TObject<{
|
|
|
143
157
|
message: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
144
158
|
}>, {
|
|
145
159
|
domain?: {
|
|
146
|
-
salt?: `0x${string}` | undefined;
|
|
147
160
|
chainId?: number | undefined;
|
|
161
|
+
salt?: `0x${string}` | undefined;
|
|
148
162
|
name?: string | undefined;
|
|
149
163
|
verifyingContract?: `0x${string}` | undefined;
|
|
150
164
|
version?: string | undefined;
|
|
@@ -160,6 +174,12 @@ export declare const wallet_prepareCalls: import("@sinclair/typebox").TObject<{
|
|
|
160
174
|
[x: string]: unknown;
|
|
161
175
|
};
|
|
162
176
|
}>;
|
|
177
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
178
|
+
authorizationRequest: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
179
|
+
chainId: import("@sinclair/typebox").TInteger;
|
|
180
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
181
|
+
nonce: import("@sinclair/typebox").TInteger;
|
|
182
|
+
}>>;
|
|
163
183
|
}>]>;
|
|
164
184
|
}>;
|
|
165
185
|
}>;
|
|
@@ -169,10 +189,12 @@ export declare const wallet_requestAccount: import("@sinclair/typebox").TObject<
|
|
|
169
189
|
params: import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
170
190
|
signerAddress: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
171
191
|
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
172
|
-
creationHint: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
192
|
+
creationHint: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
173
193
|
accountType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<"sma-b">>;
|
|
174
194
|
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
175
|
-
}
|
|
195
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
196
|
+
accountType: import("@sinclair/typebox").TLiteral<"7702">;
|
|
197
|
+
}>]>>;
|
|
176
198
|
includeCounterfactualInfo: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
177
199
|
}>, import("@sinclair/typebox").TObject<{
|
|
178
200
|
accountAddress: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
@@ -187,6 +209,7 @@ export declare const wallet_requestAccount: import("@sinclair/typebox").TObject<
|
|
|
187
209
|
factoryAddress: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
188
210
|
factoryData: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
189
211
|
}>>;
|
|
212
|
+
delegation: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
190
213
|
}>;
|
|
191
214
|
}>;
|
|
192
215
|
export declare const wallet_createAccount: import("@sinclair/typebox").TObject<{
|
|
@@ -195,10 +218,12 @@ export declare const wallet_createAccount: import("@sinclair/typebox").TObject<{
|
|
|
195
218
|
params: import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TObject<{
|
|
196
219
|
signerAddress: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
197
220
|
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
198
|
-
creationOptions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
221
|
+
creationOptions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
199
222
|
accountType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<"sma-b">>;
|
|
200
223
|
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
201
|
-
}
|
|
224
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
225
|
+
accountType: import("@sinclair/typebox").TLiteral<"7702">;
|
|
226
|
+
}>]>>;
|
|
202
227
|
}>]>;
|
|
203
228
|
}>;
|
|
204
229
|
ReturnType: import("@sinclair/typebox").TObject<{
|
|
@@ -221,7 +246,7 @@ export declare const wallet_listAccounts: import("@sinclair/typebox").TObject<{
|
|
|
221
246
|
id: import("@sinclair/typebox").TString;
|
|
222
247
|
}>>;
|
|
223
248
|
meta: import("@sinclair/typebox").TObject<{
|
|
224
|
-
totalCount: import("@sinclair/typebox").
|
|
249
|
+
totalCount: import("@sinclair/typebox").TInteger;
|
|
225
250
|
after: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
226
251
|
}>;
|
|
227
252
|
}>;
|
|
@@ -231,7 +256,7 @@ export declare const wallet_createSession: import("@sinclair/typebox").TObject<{
|
|
|
231
256
|
method: import("@sinclair/typebox").TLiteral<"wallet_createSession">;
|
|
232
257
|
params: import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
233
258
|
chainId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
234
|
-
expiry: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
|
259
|
+
expiry: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
235
260
|
key: import("@sinclair/typebox").TObject<{
|
|
236
261
|
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"secp256k1">, import("@sinclair/typebox").TLiteral<"contract">]>;
|
|
237
262
|
publicKey: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
@@ -283,7 +308,7 @@ export declare const wallet_createSession: import("@sinclair/typebox").TObject<{
|
|
|
283
308
|
}>;
|
|
284
309
|
ReturnType: import("@sinclair/typebox").TObject<{
|
|
285
310
|
sessionId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
286
|
-
signatureRequest: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
311
|
+
signatureRequest: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
287
312
|
type: import("@sinclair/typebox").TLiteral<"personal_sign">;
|
|
288
313
|
data: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
289
314
|
raw: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
@@ -292,7 +317,7 @@ export declare const wallet_createSession: import("@sinclair/typebox").TObject<{
|
|
|
292
317
|
type: import("@sinclair/typebox").TLiteral<"eth_signTypedData_v4">;
|
|
293
318
|
data: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TObject<{
|
|
294
319
|
domain: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
295
|
-
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
|
320
|
+
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
296
321
|
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
297
322
|
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
298
323
|
verifyingContract: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
@@ -306,8 +331,8 @@ export declare const wallet_createSession: import("@sinclair/typebox").TObject<{
|
|
|
306
331
|
message: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
307
332
|
}>, {
|
|
308
333
|
domain?: {
|
|
309
|
-
salt?: `0x${string}` | undefined;
|
|
310
334
|
chainId?: number | undefined;
|
|
335
|
+
salt?: `0x${string}` | undefined;
|
|
311
336
|
name?: string | undefined;
|
|
312
337
|
verifyingContract?: `0x${string}` | undefined;
|
|
313
338
|
version?: string | undefined;
|
|
@@ -323,6 +348,12 @@ export declare const wallet_createSession: import("@sinclair/typebox").TObject<{
|
|
|
323
348
|
[x: string]: unknown;
|
|
324
349
|
};
|
|
325
350
|
}>;
|
|
351
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
352
|
+
authorizationRequest: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
353
|
+
chainId: import("@sinclair/typebox").TInteger;
|
|
354
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
355
|
+
nonce: import("@sinclair/typebox").TInteger;
|
|
356
|
+
}>>;
|
|
326
357
|
}>]>;
|
|
327
358
|
}>;
|
|
328
359
|
}>;
|
package/dist/esm/rpc/request.js
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
2
|
import { Capabilities } from "../capabilities/index.js";
|
|
3
|
-
import { PermissionsContext, PermissionsData, } from "../capabilities/permissions/index.js";
|
|
4
|
-
import { TypeAddress, TypeBase64UrlEncodedString, TypeCreationOptions, TypeHex, TypeSerializedInitcode, TypeSignatureRequest, TypeUserOperationRequest_v6, TypeUserOperationRequest_v7, TypeUuid, } from "../schemas.js";
|
|
3
|
+
import { PermissionsContext, PermissionsData, RemotePermission, } from "../capabilities/permissions/index.js";
|
|
4
|
+
import { TypeAddress, TypeBase64UrlEncodedString, TypeCreationOptions, TypeEip7702AuthExtendedFields, TypeHex, TypeSerializedInitcode, TypeSignatureRequest, TypeUserOperationRequest_v6, TypeUserOperationRequest_v7, TypeUuid, } from "../schemas.js";
|
|
5
|
+
import { Examples } from "./examples.js";
|
|
5
6
|
export const wallet_sendPreparedCalls = Type.Object({
|
|
6
7
|
Request: Type.Object({
|
|
7
8
|
method: Type.Literal("wallet_sendPreparedCalls"),
|
|
8
9
|
params: Type.Tuple([
|
|
9
10
|
Type.Object({
|
|
10
11
|
type: Type.Union([
|
|
11
|
-
Type.Literal("user-operation-v060"
|
|
12
|
-
|
|
12
|
+
Type.Literal("user-operation-v060", {
|
|
13
|
+
title: "User Operation (Entrypoint v0.6.0)",
|
|
14
|
+
}),
|
|
15
|
+
Type.Literal("user-operation-v070", {
|
|
16
|
+
title: "User Operation (Entrypoint v0.7.0)",
|
|
17
|
+
}),
|
|
13
18
|
]),
|
|
14
19
|
data: Type.Union([
|
|
15
|
-
Type.Omit(TypeUserOperationRequest_v6, ["signature"]
|
|
16
|
-
|
|
20
|
+
Type.Omit(TypeUserOperationRequest_v6, ["signature"], {
|
|
21
|
+
title: "Unsigned User Operation (Entrypoint v0.6.0)",
|
|
22
|
+
}),
|
|
23
|
+
Type.Omit(TypeUserOperationRequest_v7, ["signature"], {
|
|
24
|
+
title: "Unsigned User Operation (Entrypoint v0.7.0)",
|
|
25
|
+
}),
|
|
17
26
|
]),
|
|
18
27
|
chainId: TypeHex(),
|
|
19
28
|
signature: Type.Object({
|
|
20
|
-
type: Type.Transform(Type.
|
|
29
|
+
type: Type.Transform(Type.Literal("ecdsa"))
|
|
21
30
|
.Decode((value) => {
|
|
22
31
|
if (value.toLowerCase() !== "ecdsa") {
|
|
23
32
|
throw new Error("Invalid signature type, must be 'ecdsa'");
|
|
@@ -27,7 +36,10 @@ export const wallet_sendPreparedCalls = Type.Object({
|
|
|
27
36
|
.Encode((value) => value),
|
|
28
37
|
signature: TypeHex(),
|
|
29
38
|
}),
|
|
30
|
-
|
|
39
|
+
signedAuthorization: Type.Optional(TypeEip7702AuthExtendedFields),
|
|
40
|
+
capabilities: Type.Optional(Type.Object({
|
|
41
|
+
permissions: Type.Optional(Type.Union([PermissionsContext, RemotePermission])),
|
|
42
|
+
})),
|
|
31
43
|
}),
|
|
32
44
|
]),
|
|
33
45
|
}),
|
|
@@ -36,6 +48,7 @@ export const wallet_sendPreparedCalls = Type.Object({
|
|
|
36
48
|
}),
|
|
37
49
|
}, {
|
|
38
50
|
description: "This method is used after signing the signatureRequest returned from prepareCalls to submit a user operation",
|
|
51
|
+
examples: Examples.SendPreparedCalls,
|
|
39
52
|
});
|
|
40
53
|
export const wallet_prepareCalls = Type.Object({
|
|
41
54
|
Request: Type.Object({
|
|
@@ -55,18 +68,27 @@ export const wallet_prepareCalls = Type.Object({
|
|
|
55
68
|
}),
|
|
56
69
|
ReturnType: Type.Object({
|
|
57
70
|
type: Type.Union([
|
|
58
|
-
Type.Literal("user-operation-v060"
|
|
59
|
-
|
|
71
|
+
Type.Literal("user-operation-v060", {
|
|
72
|
+
title: "User Operation (Entrypoint v0.6.0)",
|
|
73
|
+
}),
|
|
74
|
+
Type.Literal("user-operation-v070", {
|
|
75
|
+
title: "User Operation (Entrypoint v0.7.0)",
|
|
76
|
+
}),
|
|
60
77
|
]),
|
|
61
78
|
data: Type.Union([
|
|
62
|
-
Type.Omit(TypeUserOperationRequest_v6, ["signature"]
|
|
63
|
-
|
|
79
|
+
Type.Omit(TypeUserOperationRequest_v6, ["signature"], {
|
|
80
|
+
title: "Unsigned User Operation (Entrypoint v0.6.0)",
|
|
81
|
+
}),
|
|
82
|
+
Type.Omit(TypeUserOperationRequest_v7, ["signature"], {
|
|
83
|
+
title: "Unsigned User Operation (Entrypoint v0.7.0)",
|
|
84
|
+
}),
|
|
64
85
|
]),
|
|
65
86
|
chainId: TypeHex(),
|
|
66
87
|
signatureRequest: TypeSignatureRequest,
|
|
67
88
|
}),
|
|
68
89
|
}, {
|
|
69
90
|
description: "This method is used to prepare a user operation for submission. It will return a built user operation and a signature request which needs to be signed by the user before submitting to wallet_sendPreparedCalls",
|
|
91
|
+
examples: Examples.PrepareCalls,
|
|
70
92
|
});
|
|
71
93
|
export const wallet_requestAccount = Type.Object({
|
|
72
94
|
Request: Type.Object({
|
|
@@ -78,10 +100,14 @@ export const wallet_requestAccount = Type.Object({
|
|
|
78
100
|
id: Type.Optional(TypeUuid),
|
|
79
101
|
creationHint: TypeCreationOptions,
|
|
80
102
|
includeCounterfactualInfo: Type.Optional(Type.Boolean({ default: false })),
|
|
103
|
+
}, {
|
|
104
|
+
title: "Using signer address",
|
|
81
105
|
}),
|
|
82
106
|
Type.Object({
|
|
83
107
|
accountAddress: TypeAddress,
|
|
84
108
|
includeCounterfactualInfo: Type.Optional(Type.Boolean({ default: false })),
|
|
109
|
+
}, {
|
|
110
|
+
title: "Using smart contract account address",
|
|
85
111
|
}),
|
|
86
112
|
]),
|
|
87
113
|
]),
|
|
@@ -90,9 +116,11 @@ export const wallet_requestAccount = Type.Object({
|
|
|
90
116
|
accountAddress: TypeAddress,
|
|
91
117
|
id: TypeUuid,
|
|
92
118
|
counterfactualInfo: Type.Optional(TypeSerializedInitcode),
|
|
119
|
+
delegation: Type.Optional(TypeAddress),
|
|
93
120
|
}),
|
|
94
121
|
}, {
|
|
95
122
|
description: `This method is used to get the smart account address and relevant info for a given signer. If an account does not already exist for a given signer, this method will create one before returning the counterfactual address.`,
|
|
123
|
+
examples: Examples.RequestAccount,
|
|
96
124
|
});
|
|
97
125
|
export const wallet_createAccount = Type.Object({
|
|
98
126
|
Request: Type.Object({
|
|
@@ -111,6 +139,7 @@ export const wallet_createAccount = Type.Object({
|
|
|
111
139
|
}),
|
|
112
140
|
}, {
|
|
113
141
|
description: `This method is used to create a smart account for a given signer. This method is primarly used to import existing accounts. For most cases, you should use wallet_requestAccount instead.`,
|
|
142
|
+
examples: Examples.CreateAccount,
|
|
114
143
|
});
|
|
115
144
|
export const wallet_listAccounts = Type.Object({
|
|
116
145
|
Request: Type.Object({
|
|
@@ -129,12 +158,13 @@ export const wallet_listAccounts = Type.Object({
|
|
|
129
158
|
id: TypeUuid,
|
|
130
159
|
})),
|
|
131
160
|
meta: Type.Object({
|
|
132
|
-
totalCount: Type.
|
|
161
|
+
totalCount: Type.Integer(),
|
|
133
162
|
after: Type.Union([TypeBase64UrlEncodedString, Type.Null()]),
|
|
134
163
|
}),
|
|
135
164
|
}),
|
|
136
165
|
}, {
|
|
137
166
|
description: "This method is used to list all smart accounts for a given signer.",
|
|
167
|
+
examples: Examples.ListAccounts,
|
|
138
168
|
});
|
|
139
169
|
export const wallet_createSession = Type.Object({
|
|
140
170
|
Request: Type.Object({
|
|
@@ -142,7 +172,9 @@ export const wallet_createSession = Type.Object({
|
|
|
142
172
|
params: Type.Tuple([
|
|
143
173
|
Type.Intersect([
|
|
144
174
|
PermissionsData,
|
|
145
|
-
Type.Object({
|
|
175
|
+
Type.Object({
|
|
176
|
+
account: TypeAddress,
|
|
177
|
+
}),
|
|
146
178
|
]),
|
|
147
179
|
]),
|
|
148
180
|
}),
|
|
@@ -152,6 +184,7 @@ export const wallet_createSession = Type.Object({
|
|
|
152
184
|
}),
|
|
153
185
|
}, {
|
|
154
186
|
description: "This method is used to create a session for a given address with specified permissions.",
|
|
187
|
+
examples: Examples.CreateSession,
|
|
155
188
|
});
|
|
156
189
|
export const wallet_getCallsStatus = Type.Object({
|
|
157
190
|
Request: Type.Object({
|
|
@@ -168,18 +201,23 @@ export const wallet_getCallsStatus = Type.Object({
|
|
|
168
201
|
atomic: Type.Boolean(),
|
|
169
202
|
status: Type.Union([
|
|
170
203
|
Type.Literal(100, {
|
|
204
|
+
title: "Pending",
|
|
171
205
|
description: "Batch has been received by the wallet but has not completed execution onchain",
|
|
172
206
|
}),
|
|
173
207
|
Type.Literal(200, {
|
|
208
|
+
title: "Confirmed",
|
|
174
209
|
description: "Batch has been included onchain without reverts, receipts array contains info of all calls",
|
|
175
210
|
}),
|
|
176
211
|
Type.Literal(400, {
|
|
212
|
+
title: "Offchain Failure",
|
|
177
213
|
description: "Batch has not been included onchain and wallet will not retry",
|
|
178
214
|
}),
|
|
179
215
|
Type.Literal(500, {
|
|
216
|
+
title: "Onchain Failure",
|
|
180
217
|
description: "Batch reverted *completely* and only changes related to gas charge may have been included onchain",
|
|
181
218
|
}),
|
|
182
219
|
Type.Literal(600, {
|
|
220
|
+
title: "Partial Onchain Failure",
|
|
183
221
|
description: "Batch reverted *partially* and some changes related to batch calls may have been included onchain",
|
|
184
222
|
}),
|
|
185
223
|
]),
|
|
@@ -200,5 +238,6 @@ export const wallet_getCallsStatus = Type.Object({
|
|
|
200
238
|
}),
|
|
201
239
|
}, {
|
|
202
240
|
description: "This method is used to get the status of calls IDs returned from wallet_sendPreparedCalls.",
|
|
241
|
+
examples: Examples.GetCallsStatus,
|
|
203
242
|
});
|
|
204
243
|
//# sourceMappingURL=request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/rpc/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,0BAA0B,EAC1B,mBAAmB,EACnB,OAAO,EACP,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CACjD;IACE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;QACnB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,0BAA0B,CAAC;QAChD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC;gBACV,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;oBACf,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC;oBACnC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC;iBACpC,CAAC;gBACF,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;oBACf,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,WAAW,CAAC,CAAC;oBACrD,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,WAAW,CAAC,CAAC;iBACtD,CAAC;gBACF,OAAO,EAAE,OAAO,EAAE;gBAClB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC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AAC;SACH,CAAC;KACH,CAAC;IACF,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;QACtB,EAAE,EAAE,OAAO,EAAE;QACb,OAAO,EAAE,OAAO,EAAE;QAClB,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;QACtB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;YACjB,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,+EAA+E;aAClF,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,4FAA4F;aAC/F,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,+DAA+D;aAClE,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,mGAAmG;aACtG,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,mGAAmG;aACtG,CAAC;SACH,CAAC;QACF,QAAQ,EAAE,IAAI,CAAC,QAAQ,CACrB,IAAI,CAAC,KAAK,CACR,IAAI,CAAC,MAAM,CAAC;YACV,IAAI,EAAE,IAAI,CAAC,KAAK,CACd,IAAI,CAAC,MAAM,CAAC;gBACV,OAAO,EAAE,WAAW;gBACpB,IAAI,EAAE,OAAO,EAAE;gBACf,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;aAC9B,CAAC,CACH;YACD,MAAM,EAAE,OAAO,CAAC;gBACd,WAAW,EAAE,kCAAkC;aAChD,CAAC;YACF,SAAS,EAAE,OAAO,EAAE;YACpB,WAAW,EAAE,OAAO,EAAE;YACtB,OAAO,EAAE,OAAO,EAAE;YAClB,eAAe,EAAE,OAAO,EAAE;SAC3B,CAAC,CACH,CACF;KACF,CAAC;CACH,EACD;IACE,WAAW,EACT,4FAA4F;CAC/F,CACF,CAAC","sourcesContent":["import { Type } from \"@sinclair/typebox\";\nimport { Capabilities } from \"../capabilities/index.js\";\nimport {\n PermissionsContext,\n PermissionsData,\n} from \"../capabilities/permissions/index.js\";\nimport {\n TypeAddress,\n TypeBase64UrlEncodedString,\n TypeCreationOptions,\n TypeHex,\n TypeSerializedInitcode,\n TypeSignatureRequest,\n TypeUserOperationRequest_v6,\n TypeUserOperationRequest_v7,\n TypeUuid,\n} from \"../schemas.js\";\n\nexport const wallet_sendPreparedCalls = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_sendPreparedCalls\"),\n params: Type.Tuple([\n Type.Object({\n type: Type.Union([\n Type.Literal(\"user-operation-v060\"),\n Type.Literal(\"user-operation-v070\"),\n ]),\n data: Type.Union([\n Type.Omit(TypeUserOperationRequest_v6, [\"signature\"]),\n Type.Omit(TypeUserOperationRequest_v7, [\"signature\"]),\n ]),\n chainId: TypeHex(),\n signature: Type.Object({\n type: Type.Transform(Type.String())\n .Decode((value) => {\n if (value.toLowerCase() !== \"ecdsa\") {\n throw new Error(\"Invalid signature type, must be 'ecdsa'\");\n }\n\n return \"ecdsa\" as const;\n })\n .Encode((value) => value),\n signature: TypeHex(),\n }),\n capabilities: Type.Optional(\n Type.Object({ permissions: PermissionsContext }),\n ),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n preparedCallIds: Type.Array(TypeHex()),\n }),\n },\n {\n description:\n \"This method is used after signing the signatureRequest returned from prepareCalls to submit a user operation\",\n },\n);\n\nexport const wallet_prepareCalls = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_prepareCalls\"),\n params: Type.Tuple([\n Type.Object({\n calls: Type.Array(\n Type.Object({\n to: TypeAddress,\n data: Type.Optional(TypeHex()),\n value: Type.Optional(TypeHex()),\n }),\n ),\n from: TypeAddress,\n chainId: TypeHex(),\n capabilities: Type.Optional(Capabilities),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n type: Type.Union([\n Type.Literal(\"user-operation-v060\"),\n Type.Literal(\"user-operation-v070\"),\n ]),\n data: Type.Union([\n Type.Omit(TypeUserOperationRequest_v6, [\"signature\"]),\n Type.Omit(TypeUserOperationRequest_v7, [\"signature\"]),\n ]),\n chainId: TypeHex(),\n signatureRequest: TypeSignatureRequest,\n }),\n },\n {\n description:\n \"This method is used to prepare a user operation for submission. It will return a built user operation and a signature request which needs to be signed by the user before submitting to wallet_sendPreparedCalls\",\n },\n);\n\nexport const wallet_requestAccount = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_requestAccount\"),\n params: Type.Tuple([\n Type.Union([\n Type.Object({\n signerAddress: TypeAddress,\n id: Type.Optional(TypeUuid),\n creationHint: TypeCreationOptions,\n includeCounterfactualInfo: Type.Optional(\n Type.Boolean({ default: false }),\n ),\n }),\n Type.Object({\n accountAddress: TypeAddress,\n includeCounterfactualInfo: Type.Optional(\n Type.Boolean({ default: false }),\n ),\n }),\n ]),\n ]),\n }),\n ReturnType: Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n counterfactualInfo: Type.Optional(TypeSerializedInitcode),\n }),\n },\n {\n description: `This method is used to get the smart account address and relevant info for a given signer. If an account does not already exist for a given signer, this method will create one before returning the counterfactual address.`,\n },\n);\n\nexport const wallet_createAccount = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_createAccount\"),\n params: Type.Tuple([\n Type.Object({\n signerAddress: TypeAddress,\n id: Type.Optional(TypeUuid),\n creationOptions: TypeCreationOptions,\n }),\n ]),\n }),\n ReturnType: Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n }),\n },\n {\n description: `This method is used to create a smart account for a given signer. This method is primarly used to import existing accounts. For most cases, you should use wallet_requestAccount instead.`,\n },\n);\n\nexport const wallet_listAccounts = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_listAccounts\"),\n params: Type.Tuple([\n Type.Object({\n signerAddress: TypeAddress,\n limit: Type.Optional(\n Type.Number({ minimum: 1, maximum: 100, default: 100 }),\n ),\n after: Type.Optional(TypeBase64UrlEncodedString),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n accounts: Type.Array(\n Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n }),\n ),\n meta: Type.Object({\n totalCount: Type.Number(),\n after: Type.Union([TypeBase64UrlEncodedString, Type.Null()]),\n }),\n }),\n },\n {\n description:\n \"This method is used to list all smart accounts for a given signer.\",\n },\n);\n\nexport const wallet_createSession = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_createSession\"),\n params: Type.Tuple([\n Type.Intersect([\n PermissionsData,\n Type.Object({ account: TypeAddress }),\n ]),\n ]),\n }),\n ReturnType: Type.Object({\n sessionId: TypeHex(),\n signatureRequest: TypeSignatureRequest,\n }),\n },\n {\n description:\n \"This method is used to create a session for a given address with specified permissions.\",\n },\n);\n\nexport const wallet_getCallsStatus = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_getCallsStatus\"),\n params: Type.Tuple([\n TypeHex({\n description: \"The call ID returned from wallet_sendPreparedCalls\",\n }),\n ]),\n }),\n ReturnType: Type.Object({\n id: TypeHex(),\n chainId: TypeHex(),\n atomic: Type.Boolean(),\n status: Type.Union([\n Type.Literal(100, {\n description:\n \"Batch has been received by the wallet but has not completed execution onchain\",\n }),\n Type.Literal(200, {\n description:\n \"Batch has been included onchain without reverts, receipts array contains info of all calls\",\n }),\n Type.Literal(400, {\n description:\n \"Batch has not been included onchain and wallet will not retry\",\n }),\n Type.Literal(500, {\n description:\n \"Batch reverted *completely* and only changes related to gas charge may have been included onchain\",\n }),\n Type.Literal(600, {\n description:\n \"Batch reverted *partially* and some changes related to batch calls may have been included onchain\",\n }),\n ]),\n receipts: Type.Optional(\n Type.Array(\n Type.Object({\n logs: Type.Array(\n Type.Object({\n address: TypeAddress,\n data: TypeHex(),\n topics: Type.Array(TypeHex()),\n }),\n ),\n status: TypeHex({\n description: \"0x1 for success, 0x0 for failure\",\n }),\n blockHash: TypeHex(),\n blockNumber: TypeHex(),\n gasUsed: TypeHex(),\n transactionHash: TypeHex(),\n }),\n ),\n ),\n }),\n },\n {\n description:\n \"This method is used to get the status of calls IDs returned from wallet_sendPreparedCalls.\",\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/rpc/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,0BAA0B,EAC1B,mBAAmB,EACnB,6BAA6B,EAC7B,OAAO,EACP,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CACjD;IACE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;QACnB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,0BAA0B,CAAC;QAChD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC;gBACV,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;oBACf,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE;wBAClC,KAAK,EAAE,oCAAoC;qBAC5C,CAAC;oBACF,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE;wBAClC,KAAK,EAAE,oCAAoC;qBAC5C,CAAC;iBACH,CAAC;gBACF,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;oBACf,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,WAAW,CAAC,EAAE;wBACpD,KAAK,EAAE,6CAA6C;qBACrD,CAAC;oBACF,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAA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GAAG,EAAE;gBAChB,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,4FAA4F;aAC/F,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACT,+DAA+D;aAClE,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EACT,mGAAmG;aACtG,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EACT,mGAAmG;aACtG,CAAC;SACH,CAAC;QACF,QAAQ,EAAE,IAAI,CAAC,QAAQ,CACrB,IAAI,CAAC,KAAK,CACR,IAAI,CAAC,MAAM,CAAC;YACV,IAAI,EAAE,IAAI,CAAC,KAAK,CACd,IAAI,CAAC,MAAM,CAAC;gBACV,OAAO,EAAE,WAAW;gBACpB,IAAI,EAAE,OAAO,EAAE;gBACf,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;aAC9B,CAAC,CACH;YACD,MAAM,EAAE,OAAO,CAAC;gBACd,WAAW,EAAE,kCAAkC;aAChD,CAAC;YACF,SAAS,EAAE,OAAO,EAAE;YACpB,WAAW,EAAE,OAAO,EAAE;YACtB,OAAO,EAAE,OAAO,EAAE;YAClB,eAAe,EAAE,OAAO,EAAE;SAC3B,CAAC,CACH,CACF;KACF,CAAC;CACH,EACD;IACE,WAAW,EACT,4FAA4F;IAC9F,QAAQ,EAAE,QAAQ,CAAC,cAAc;CAClC,CACF,CAAC","sourcesContent":["import { Type } from \"@sinclair/typebox\";\nimport { Capabilities } from \"../capabilities/index.js\";\nimport {\n PermissionsContext,\n PermissionsData,\n RemotePermission,\n} from \"../capabilities/permissions/index.js\";\nimport {\n TypeAddress,\n TypeBase64UrlEncodedString,\n TypeCreationOptions,\n TypeEip7702AuthExtendedFields,\n TypeHex,\n TypeSerializedInitcode,\n TypeSignatureRequest,\n TypeUserOperationRequest_v6,\n TypeUserOperationRequest_v7,\n TypeUuid,\n} from \"../schemas.js\";\nimport { Examples } from \"./examples.js\";\n\nexport const wallet_sendPreparedCalls = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_sendPreparedCalls\"),\n params: Type.Tuple([\n Type.Object({\n type: Type.Union([\n Type.Literal(\"user-operation-v060\", {\n title: \"User Operation (Entrypoint v0.6.0)\",\n }),\n Type.Literal(\"user-operation-v070\", {\n title: \"User Operation (Entrypoint v0.7.0)\",\n }),\n ]),\n data: Type.Union([\n Type.Omit(TypeUserOperationRequest_v6, [\"signature\"], {\n title: \"Unsigned User Operation (Entrypoint v0.6.0)\",\n }),\n Type.Omit(TypeUserOperationRequest_v7, [\"signature\"], {\n title: \"Unsigned User Operation (Entrypoint v0.7.0)\",\n }),\n ]),\n chainId: TypeHex(),\n signature: Type.Object({\n type: Type.Transform(Type.Literal(\"ecdsa\"))\n .Decode((value) => {\n if (value.toLowerCase() !== \"ecdsa\") {\n throw new Error(\"Invalid signature type, must be 'ecdsa'\");\n }\n\n return \"ecdsa\" as const;\n })\n .Encode((value) => value),\n signature: TypeHex(),\n }),\n signedAuthorization: Type.Optional(TypeEip7702AuthExtendedFields),\n capabilities: Type.Optional(\n Type.Object({\n permissions: Type.Optional(\n Type.Union([PermissionsContext, RemotePermission]),\n ),\n }),\n ),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n preparedCallIds: Type.Array(TypeHex()),\n }),\n },\n {\n description:\n \"This method is used after signing the signatureRequest returned from prepareCalls to submit a user operation\",\n examples: Examples.SendPreparedCalls,\n },\n);\n\nexport const wallet_prepareCalls = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_prepareCalls\"),\n params: Type.Tuple([\n Type.Object({\n calls: Type.Array(\n Type.Object({\n to: TypeAddress,\n data: Type.Optional(TypeHex()),\n value: Type.Optional(TypeHex()),\n }),\n ),\n from: TypeAddress,\n chainId: TypeHex(),\n capabilities: Type.Optional(Capabilities),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n type: Type.Union([\n Type.Literal(\"user-operation-v060\", {\n title: \"User Operation (Entrypoint v0.6.0)\",\n }),\n Type.Literal(\"user-operation-v070\", {\n title: \"User Operation (Entrypoint v0.7.0)\",\n }),\n ]),\n data: Type.Union([\n Type.Omit(TypeUserOperationRequest_v6, [\"signature\"], {\n title: \"Unsigned User Operation (Entrypoint v0.6.0)\",\n }),\n Type.Omit(TypeUserOperationRequest_v7, [\"signature\"], {\n title: \"Unsigned User Operation (Entrypoint v0.7.0)\",\n }),\n ]),\n chainId: TypeHex(),\n signatureRequest: TypeSignatureRequest,\n }),\n },\n {\n description:\n \"This method is used to prepare a user operation for submission. It will return a built user operation and a signature request which needs to be signed by the user before submitting to wallet_sendPreparedCalls\",\n examples: Examples.PrepareCalls,\n },\n);\n\nexport const wallet_requestAccount = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_requestAccount\"),\n params: Type.Tuple([\n Type.Union([\n Type.Object(\n {\n signerAddress: TypeAddress,\n id: Type.Optional(TypeUuid),\n creationHint: TypeCreationOptions,\n includeCounterfactualInfo: Type.Optional(\n Type.Boolean({ default: false }),\n ),\n },\n {\n title: \"Using signer address\",\n },\n ),\n Type.Object(\n {\n accountAddress: TypeAddress,\n includeCounterfactualInfo: Type.Optional(\n Type.Boolean({ default: false }),\n ),\n },\n {\n title: \"Using smart contract account address\",\n },\n ),\n ]),\n ]),\n }),\n ReturnType: Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n counterfactualInfo: Type.Optional(TypeSerializedInitcode),\n delegation: Type.Optional(TypeAddress),\n }),\n },\n {\n description: `This method is used to get the smart account address and relevant info for a given signer. If an account does not already exist for a given signer, this method will create one before returning the counterfactual address.`,\n examples: Examples.RequestAccount,\n },\n);\n\nexport const wallet_createAccount = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_createAccount\"),\n params: Type.Tuple([\n Type.Object({\n signerAddress: TypeAddress,\n id: Type.Optional(TypeUuid),\n creationOptions: TypeCreationOptions,\n }),\n ]),\n }),\n ReturnType: Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n }),\n },\n {\n description: `This method is used to create a smart account for a given signer. This method is primarly used to import existing accounts. For most cases, you should use wallet_requestAccount instead.`,\n examples: Examples.CreateAccount,\n },\n);\n\nexport const wallet_listAccounts = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_listAccounts\"),\n params: Type.Tuple([\n Type.Object({\n signerAddress: TypeAddress,\n limit: Type.Optional(\n Type.Number({ minimum: 1, maximum: 100, default: 100 }),\n ),\n after: Type.Optional(TypeBase64UrlEncodedString),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n accounts: Type.Array(\n Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n }),\n ),\n meta: Type.Object({\n totalCount: Type.Integer(),\n after: Type.Union([TypeBase64UrlEncodedString, Type.Null()]),\n }),\n }),\n },\n {\n description:\n \"This method is used to list all smart accounts for a given signer.\",\n examples: Examples.ListAccounts,\n },\n);\n\nexport const wallet_createSession = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_createSession\"),\n params: Type.Tuple([\n Type.Intersect([\n PermissionsData,\n Type.Object({\n account: TypeAddress,\n }),\n ]),\n ]),\n }),\n ReturnType: Type.Object({\n sessionId: TypeHex(),\n signatureRequest: TypeSignatureRequest,\n }),\n },\n {\n description:\n \"This method is used to create a session for a given address with specified permissions.\",\n examples: Examples.CreateSession,\n },\n);\n\nexport const wallet_getCallsStatus = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_getCallsStatus\"),\n params: Type.Tuple([\n TypeHex({\n description: \"The call ID returned from wallet_sendPreparedCalls\",\n }),\n ]),\n }),\n ReturnType: Type.Object({\n id: TypeHex(),\n chainId: TypeHex(),\n atomic: Type.Boolean(),\n status: Type.Union([\n Type.Literal(100, {\n title: \"Pending\",\n description:\n \"Batch has been received by the wallet but has not completed execution onchain\",\n }),\n Type.Literal(200, {\n title: \"Confirmed\",\n description:\n \"Batch has been included onchain without reverts, receipts array contains info of all calls\",\n }),\n Type.Literal(400, {\n title: \"Offchain Failure\",\n description:\n \"Batch has not been included onchain and wallet will not retry\",\n }),\n Type.Literal(500, {\n title: \"Onchain Failure\",\n description:\n \"Batch reverted *completely* and only changes related to gas charge may have been included onchain\",\n }),\n Type.Literal(600, {\n title: \"Partial Onchain Failure\",\n description:\n \"Batch reverted *partially* and some changes related to batch calls may have been included onchain\",\n }),\n ]),\n receipts: Type.Optional(\n Type.Array(\n Type.Object({\n logs: Type.Array(\n Type.Object({\n address: TypeAddress,\n data: TypeHex(),\n topics: Type.Array(TypeHex()),\n }),\n ),\n status: TypeHex({\n description: \"0x1 for success, 0x0 for failure\",\n }),\n blockHash: TypeHex(),\n blockNumber: TypeHex(),\n gasUsed: TypeHex(),\n transactionHash: TypeHex(),\n }),\n ),\n ),\n }),\n },\n {\n description:\n \"This method is used to get the status of calls IDs returned from wallet_sendPreparedCalls.\",\n examples: Examples.GetCallsStatus,\n },\n);\n"]}
|