@latticexyz/paymaster 2.2.15-entrykit-4c25d1ec5af1bd68a4c1f367c9fe4b6fbea82cb2 → 2.2.15-entrykit-3b489ecd8b6521b8bf17d29764011abc42a035c0

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/internal.js CHANGED
@@ -1,2 +1,2 @@
1
- import{http as y}from"viem";function m(){return({chain:r})=>{if(!r)throw new Error("No chain provided to issuer transport.");let e="quarryPassIssuer"in r.rpcUrls?r.rpcUrls.quarryPassIssuer.http[0]:void 0;if(!e)throw new Error(`No \`quarryPassIssuer\` RPC URL found for chain ${r.id}.`);return y(e)({chain:r,retryCount:0})}}import h from"debug";var c=h("mud:paymaster");async function Q({chain:r,userAddress:e}){let t=m()({chain:r});c("Issuing gas pass to",e),await t.request({method:"quarry_issuePass",params:["0x01",e]}),c("Claiming gas allowance for",e),await t.request({method:"quarry_claimAllowance",params:["0x01",e]})}import{defineStore as P}from"@latticexyz/store";import{parseAbi as R}from"viem";var z=R(["error SpenderSystem_AlreadyRegistered(address spender, address user)","error SpenderSystem_HasOwnBalance(address spender)","function registerSpender(address spender)"]),O=P({namespaces:{root:{namespace:"",tables:{Allowance:{schema:{user:"address",allowance:"uint256"},key:["user"]},Grantor:{schema:{grantor:"address",allowance:"uint256"},key:["grantor"]},PassHolder:{schema:{user:"address",passId:"bytes32",lastRenewed:"uint256",lastClaimed:"uint256"},key:["user","passId"]},PassConfig:{schema:{passId:"bytes32",claimAmount:"uint256",claimInterval:"uint256",validityPeriod:"uint256",grantor:"address"},key:["passId"]},Spender:{schema:{spender:"address",user:"address"},key:["spender"]},SystemConfig:{schema:{entryPoint:"address"},key:[]}}}}}),u=O.namespaces.root.tables;import{getRecord as g}from"@latticexyz/store/internal";async function X({client:r,paymasterAddress:e,userAddress:t}){return(await g(r,{address:e,table:u.Allowance,key:{user:t},blockTag:"pending"})).allowance}import{getChainContractAddress as C}from"viem";function er(r){return C({chain:r,contract:"quarryPaymaster"})}function sr(r){let t=r?.contracts?.quarryPaymaster?.address,s="quarryPassIssuer"in r.rpcUrls?r.rpcUrls.quarryPassIssuer.http[0]:void 0;return t!=null&&s}import{formatUserOperationRequest as U}from"viem/account-abstraction";async function p(r){return U({callGasLimit:20000000n,preVerificationGas:200000n,verificationGasLimit:2000000n,paymasterVerificationGasLimit:200000n,paymasterPostOpGasLimit:200000n})}function pr(r){return e=>{let{request:t,...s}=r(e);return{request:async({method:a,params:o},i)=>a==="eth_estimateUserOperationGas"?p(o):t({method:a,params:o},i),...s}}}import{createTransport as S,numberToHex as b}from"viem";import{entryPoint07Address as l}from"viem/account-abstraction";import{parseEther as q}from"viem";import{formatUserOperation as A,toPackedUserOperation as x,getUserOperationHash as w,entryPoint07Address as d,entryPoint07Abi as I}from"viem/account-abstraction";import{setBalance as T,writeContract as _}from"viem/actions";import{getAction as G}from"viem/utils";async function f({executor:r,rpcUserOp:e}){r.chain.id===31337&&await T(r.extend(()=>({mode:"anvil"})),{address:r.account.address,value:q("100")});let t=A(e),s=t.preVerificationGas+t.verificationGasLimit+(t.paymasterVerificationGasLimit??0n)+(t.paymasterPostOpGasLimit??0n)+t.callGasLimit,n=x(t),a=w({userOperation:t,chainId:r.chain.id,entryPointVersion:"0.7",entryPointAddress:d}),o=await G(r,_,"writeContract")({abi:I,address:d,functionName:"handleOps",args:[[n],r.account.address],chain:r.chain,account:r.account,gas:s});return{success:!0,userOpHash:a,receipt:{transactionHash:o}}}function Hr({executor:r}){return()=>{let e=new Map;return S({key:"userOpExecutor",type:"userOpExecutor",name:"User Operation Executor Transport",request:async({method:s,params:n})=>{if(s==="eth_chainId")return b(r.chain.id);if(s==="eth_supportedEntryPoints")return[l];if(s==="eth_sendUserOperation"){let[a,o]=n;if(o===l){let i=await f({executor:r,rpcUserOp:a});return e.set(i.userOpHash,i),i.userOpHash}}if(s==="eth_getUserOperationReceipt"){let[a]=n;return e.get(a)??null}if(s==="eth_estimateUserOperationGas")return await p(n);throw new Error("Not implemented")}})}}export{Q as claimGasPass,pr as gasEstimator,X as getAllowance,er as getPaymasterAddress,sr as hasPassIssuer,z as paymasterAbi,O as paymasterConfig,u as paymasterTables,m as quarryPassIssuer,Hr as userOpExecutor};
1
+ import{http as P}from"viem";function m(){return({chain:r})=>{if(!r)throw new Error("No chain provided to issuer transport.");let e="quarryPassIssuer"in r.rpcUrls?r.rpcUrls.quarryPassIssuer.http[0]:void 0;if(!e)throw new Error(`No \`quarryPassIssuer\` RPC URL found for chain ${r.id}.`);return P(e)({chain:r,retryCount:0})}}import R from"debug";var c=R("mud:paymaster");async function j({chain:r,userAddress:e}){let t=m()({chain:r});c("Issuing gas pass to",e),await t.request({method:"quarry_issuePass",params:["0x01",e]}),c("Claiming gas allowance for",e),await t.request({method:"quarry_claimAllowance",params:["0x01",e]})}import{defineStore as g}from"@latticexyz/store";import{parseAbi as O}from"viem";var W=O(["error SpenderSystem_AlreadyRegistered(address spender, address user)","error SpenderSystem_HasOwnBalance(address spender)","function registerSpender(address spender)"]),U=g({namespaces:{root:{namespace:"",tables:{Allowance:{schema:{user:"address",allowance:"uint256"},key:["user"]},Grantor:{schema:{grantor:"address",allowance:"uint256"},key:["grantor"]},PassHolder:{schema:{user:"address",passId:"bytes32",lastRenewed:"uint256",lastClaimed:"uint256"},key:["user","passId"]},PassConfig:{schema:{passId:"bytes32",claimAmount:"uint256",claimInterval:"uint256",validityPeriod:"uint256",grantor:"address"},key:["passId"]},Spender:{schema:{spender:"address",user:"address"},key:["spender"]},SystemConfig:{schema:{entryPoint:"address"},key:[]}}}}}),u=U.namespaces.root.tables;import{getRecord as C}from"@latticexyz/store/internal";async function rr({client:r,paymasterAddress:e,userAddress:t}){return(await C(r,{address:e,table:u.Allowance,key:{user:t},blockTag:"pending"})).allowance}import{getChainContractAddress as w}from"viem";function ar(r){return w({chain:r,contract:"quarryPaymaster"})}function or(r){let t=r?.contracts?.quarryPaymaster?.address,s="quarryPassIssuer"in r.rpcUrls?r.rpcUrls.quarryPassIssuer.http[0]:void 0;return t!=null&&s}import{formatUserOperationRequest as q}from"viem/account-abstraction";async function p(r){return q({callGasLimit:20000000n,preVerificationGas:200000n,verificationGasLimit:2000000n,paymasterVerificationGasLimit:200000n,paymasterPostOpGasLimit:200000n})}function ur(r){return e=>{let{request:t,...s}=r(e);return{request:async({method:a,params:i},n)=>a==="eth_estimateUserOperationGas"?p(i):t({method:a,params:i},n),...s}}}import{createTransport as E,numberToHex as H}from"viem";import{entryPoint07Address as h}from"viem/account-abstraction";import{parseEther as A,parseEventLogs as x}from"viem";import{formatUserOperation as I,toPackedUserOperation as T,getUserOperationHash as _,entryPoint07Address as d,entryPoint07Abi as l}from"viem/account-abstraction";import{setBalance as G,waitForTransactionReceipt as S,writeContract as b}from"viem/actions";import{getAction as f}from"viem/utils";async function y({executor:r,rpcUserOp:e}){r.chain.id===31337&&await G(r.extend(()=>({mode:"anvil"})),{address:r.account.address,value:A("100")});let t=I(e),s=t.preVerificationGas+t.verificationGasLimit+(t.paymasterVerificationGasLimit??0n)+(t.paymasterPostOpGasLimit??0n)+t.callGasLimit,o=T(t),a=_({userOperation:t,chainId:r.chain.id,entryPointVersion:"0.7",entryPointAddress:d}),i=await f(r,b,"writeContract")({abi:l,address:d,functionName:"handleOps",args:[[o],r.account.address],chain:r.chain,account:r.account,gas:s}),n=await f(r,S,"waitForTransactionReceipt")({hash:i});return{success:x({logs:n.logs,abi:l,eventName:"UserOperationEvent"})[0].args.success,userOpHash:a,receipt:n}}function vr({executor:r}){return()=>{let e=new Map;return E({key:"userOpExecutor",type:"userOpExecutor",name:"User Operation Executor Transport",request:async({method:s,params:o})=>{if(s==="eth_chainId")return H(r.chain.id);if(s==="eth_supportedEntryPoints")return[h];if(s==="eth_sendUserOperation"){let[a,i]=o;if(i===h){let n=await y({executor:r,rpcUserOp:a});return e.set(n.userOpHash,n),n.userOpHash}}if(s==="eth_getUserOperationReceipt"){let[a]=o;return e.get(a)??null}if(s==="eth_estimateUserOperationGas")return await p(o);throw new Error("Not implemented")}})}}export{j as claimGasPass,ur as gasEstimator,rr as getAllowance,ar as getPaymasterAddress,or as hasPassIssuer,W as paymasterAbi,U as paymasterConfig,u as paymasterTables,m as quarryPassIssuer,vr as userOpExecutor};
2
2
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/transports/quarryPassIssuer.ts","../src/debug.ts","../src/claimGasPass.ts","../src/paymaster.ts","../src/getAllowance.ts","../src/getPaymasterAddress.ts","../src/hasPassIssuer.ts","../src/transports/methods/estimateUserOperationGas.ts","../src/transports/gasEstimator.ts","../src/transports/userOpExecutor.ts","../src/transports/methods/sendUserOperation.ts"],"sourcesContent":["import { Address, EIP1193RequestFn, Hex, Transport, http } from \"viem\";\n\nexport type QuarryPassIssuerRpcSchema = [\n {\n Method: \"quarry_issuePass\";\n Parameters: [passId: Hex, receiver: Address];\n ReturnType: { message: string };\n },\n {\n Method: \"quarry_claimAllowance\";\n Parameters: [passId: Hex, receiver: Address];\n ReturnType: { message: string };\n },\n];\n\nexport function quarryPassIssuer(): Transport<\"http\", {}, EIP1193RequestFn<QuarryPassIssuerRpcSchema>> {\n return ({ chain }) => {\n if (!chain) throw new Error(\"No chain provided to issuer transport.\");\n\n const url = \"quarryPassIssuer\" in chain.rpcUrls ? chain.rpcUrls.quarryPassIssuer.http[0] : undefined;\n // TODO: add fallback for anvil to do what quarryPassIssuer does internally\n if (!url) throw new Error(`No \\`quarryPassIssuer\\` RPC URL found for chain ${chain.id}.`);\n\n return http(url)({ chain, retryCount: 0 });\n };\n}\n","import createDebug from \"debug\";\n\nexport const debug = createDebug(\"mud:paymaster\");\n","import { Address, Chain } from \"viem\";\nimport { quarryPassIssuer } from \"./transports/quarryPassIssuer\";\nimport { debug } from \"./debug\";\n\nexport async function claimGasPass({ chain, userAddress }: { chain: Chain; userAddress: Address }) {\n const transport = quarryPassIssuer()({ chain });\n\n // TODO: handle case where you already have a pass?\n debug(\"Issuing gas pass to\", userAddress);\n await transport.request({\n method: \"quarry_issuePass\",\n params: [\"0x01\", userAddress],\n });\n\n debug(\"Claiming gas allowance for\", userAddress);\n await transport.request({\n method: \"quarry_claimAllowance\",\n params: [\"0x01\", userAddress],\n });\n}\n","import { defineStore } from \"@latticexyz/store\";\nimport { parseAbi } from \"viem\";\n\n// TODO: move the whole paymaster in here so we can just re-export ABI + MUD config\n\nexport const paymasterAbi = parseAbi([\n \"error SpenderSystem_AlreadyRegistered(address spender, address user)\",\n \"error SpenderSystem_HasOwnBalance(address spender)\",\n \"function registerSpender(address spender)\",\n]);\n\nexport const paymasterConfig = defineStore({\n namespaces: {\n root: {\n namespace: \"\",\n tables: {\n Allowance: {\n schema: {\n user: \"address\",\n allowance: \"uint256\",\n },\n key: [\"user\"],\n },\n Grantor: {\n schema: {\n grantor: \"address\",\n allowance: \"uint256\",\n },\n key: [\"grantor\"],\n },\n PassHolder: {\n schema: {\n user: \"address\",\n passId: \"bytes32\",\n lastRenewed: \"uint256\",\n lastClaimed: \"uint256\",\n },\n key: [\"user\", \"passId\"],\n },\n PassConfig: {\n schema: {\n passId: \"bytes32\",\n claimAmount: \"uint256\",\n claimInterval: \"uint256\",\n validityPeriod: \"uint256\",\n grantor: \"address\",\n },\n key: [\"passId\"],\n },\n Spender: {\n schema: {\n spender: \"address\",\n user: \"address\",\n },\n key: [\"spender\"],\n },\n SystemConfig: {\n schema: {\n entryPoint: \"address\",\n },\n key: [],\n },\n },\n },\n },\n});\n\nexport const paymasterTables = paymasterConfig.namespaces.root.tables;\n","import { Address, Client } from \"viem\";\nimport { paymasterTables } from \"./paymaster\";\nimport { getRecord } from \"@latticexyz/store/internal\";\n\nexport type GetAllowanceParams = {\n client: Client;\n paymasterAddress: Address;\n userAddress: Address;\n};\n\nexport async function getAllowance({ client, paymasterAddress, userAddress }: GetAllowanceParams) {\n const record = await getRecord(client, {\n address: paymasterAddress,\n table: paymasterTables.Allowance,\n key: { user: userAddress },\n blockTag: \"pending\",\n });\n return record.allowance;\n}\n","import { Chain, getChainContractAddress } from \"viem\";\n\nexport function getPaymasterAddress(chain: Chain) {\n return getChainContractAddress({ chain, contract: \"quarryPaymaster\" });\n}\n","import { Chain, ChainContract } from \"viem\";\n\nexport function hasPassIssuer(chain: Chain) {\n const paymasterContract = chain?.contracts?.quarryPaymaster as ChainContract | undefined;\n const paymasterAddress = paymasterContract?.address;\n\n const passIssuerUrl = \"quarryPassIssuer\" in chain.rpcUrls ? chain.rpcUrls.quarryPassIssuer.http[0] : undefined;\n\n return paymasterAddress != null && passIssuerUrl;\n}\n","import { BundlerRpcSchema } from \"viem\";\nimport { formatUserOperationRequest } from \"viem/account-abstraction\";\nimport { getRpcMethod } from \"../common\";\n\n// TODO: revisit after demo (don't hardcode gas)\n\ntype rpcMethod = getRpcMethod<BundlerRpcSchema, \"eth_estimateUserOperationGas\">;\n\nexport async function estimateUserOperationGas(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _params: rpcMethod[\"Parameters\"],\n): Promise<rpcMethod[\"ReturnType\"]> {\n return formatUserOperationRequest({\n callGasLimit: 20_000_000n,\n preVerificationGas: 200_000n,\n verificationGasLimit: 2_000_000n,\n paymasterVerificationGasLimit: 200_000n,\n paymasterPostOpGasLimit: 200_000n,\n });\n}\n","import { BundlerRpcSchema, Transport } from \"viem\";\nimport { estimateUserOperationGas } from \"./methods/estimateUserOperationGas\";\nimport { TransportRequestFn, getRpcSchema } from \"./common\";\n\n// TODO: move to common package?\n\nexport function gasEstimator<const transport extends Transport>(getTransport: transport): transport {\n return ((opts) => {\n const { request: originalRequest, ...rest } = getTransport(opts);\n\n const request: TransportRequestFn<getRpcSchema<BundlerRpcSchema, \"eth_estimateUserOperationGas\">> = async (\n { method, params },\n options,\n ) => {\n if (method === \"eth_estimateUserOperationGas\") {\n return estimateUserOperationGas(params);\n }\n return originalRequest({ method, params }, options);\n };\n\n return { request, ...rest };\n }) as transport;\n}\n","import {\n Account,\n BundlerRpcSchema,\n Chain,\n Client,\n EIP1193RequestFn,\n Hash,\n RpcUserOperationReceipt,\n Transport,\n createTransport,\n numberToHex,\n} from \"viem\";\nimport { entryPoint07Address } from \"viem/account-abstraction\";\nimport { TransportRequestFn } from \"./common\";\nimport { estimateUserOperationGas } from \"./methods/estimateUserOperationGas\";\nimport { sendUserOperation } from \"./methods/sendUserOperation\";\n\n// TODO: move to common package?\n\nexport function userOpExecutor({ executor }: { executor: Client<Transport, Chain, Account> }): Transport {\n return () => {\n const receipts = new Map<Hash, RpcUserOperationReceipt<\"0.7\">>();\n\n // @ts-expect-error TODO\n const request: TransportRequestFn<BundlerRpcSchema> = async ({ method, params }) => {\n // TODO: move chain/ID into args and executors as accounts instead of clients?\n if (method === \"eth_chainId\") {\n return numberToHex(executor.chain.id);\n }\n\n if (method === \"eth_supportedEntryPoints\") {\n return [entryPoint07Address];\n }\n\n if (method === \"eth_sendUserOperation\") {\n const [rpcUserOp, entrypoint] = params;\n if (entrypoint === entryPoint07Address) {\n const result = await sendUserOperation({ executor, rpcUserOp });\n receipts.set(result.userOpHash, result as RpcUserOperationReceipt<\"0.7\">);\n return result.userOpHash;\n }\n }\n\n if (method === \"eth_getUserOperationReceipt\") {\n const [hash] = params;\n return receipts.get(hash) ?? null;\n }\n\n if (method === \"eth_estimateUserOperationGas\") {\n return await estimateUserOperationGas(params);\n }\n\n throw new Error(\"Not implemented\");\n };\n\n return createTransport({\n key: \"userOpExecutor\",\n type: \"userOpExecutor\",\n name: \"User Operation Executor Transport\",\n request: request as EIP1193RequestFn,\n });\n };\n}\n","import { Client, Transport, Chain, Account, RpcUserOperation, RpcUserOperationReceipt, parseEther } from \"viem\";\nimport {\n formatUserOperation,\n toPackedUserOperation,\n getUserOperationHash,\n entryPoint07Address,\n entryPoint07Abi,\n} from \"viem/account-abstraction\";\nimport { setBalance, writeContract } from \"viem/actions\";\nimport { getAction } from \"viem/utils\";\n\n// TODO: move to common package?\n\n// TODO: move this into a generic to support other versions?\nconst entryPointVersion = \"0.7\";\ntype entryPointVersion = typeof entryPointVersion;\n\nexport async function sendUserOperation({\n executor,\n rpcUserOp,\n}: {\n executor: Client<Transport, Chain, Account>;\n rpcUserOp: RpcUserOperation<entryPointVersion>;\n}): Promise<\n Pick<RpcUserOperationReceipt<entryPointVersion>, \"success\" | \"userOpHash\"> & {\n receipt: Pick<RpcUserOperationReceipt<entryPointVersion>[\"receipt\"], \"transactionHash\">;\n }\n> {\n if (executor.chain.id === 31337) {\n await setBalance(\n executor.extend(() => ({ mode: \"anvil\" })),\n {\n address: executor.account.address,\n value: parseEther(\"100\"),\n },\n );\n }\n\n const userOp = formatUserOperation(rpcUserOp);\n const gas =\n userOp.preVerificationGas +\n userOp.verificationGasLimit +\n (userOp.paymasterVerificationGasLimit ?? 0n) +\n (userOp.paymasterPostOpGasLimit ?? 0n) +\n userOp.callGasLimit;\n\n const packedUserOp = toPackedUserOperation(userOp);\n\n const userOpHash = getUserOperationHash({\n userOperation: userOp,\n chainId: executor.chain.id,\n entryPointVersion: \"0.7\",\n entryPointAddress: entryPoint07Address,\n });\n\n const transactionHash = await getAction(\n executor,\n writeContract,\n \"writeContract\",\n )({\n abi: entryPoint07Abi,\n address: entryPoint07Address,\n functionName: \"handleOps\",\n args: [[packedUserOp], executor.account.address],\n chain: executor.chain,\n account: executor.account,\n gas,\n });\n\n return {\n success: true,\n userOpHash,\n receipt: { transactionHash },\n };\n}\n"],"mappings":"AAAA,OAAoD,QAAAA,MAAY,OAezD,SAASC,GAAuF,CACrG,MAAO,CAAC,CAAE,MAAAC,CAAM,IAAM,CACpB,GAAI,CAACA,EAAO,MAAM,IAAI,MAAM,wCAAwC,EAEpE,IAAMC,EAAM,qBAAsBD,EAAM,QAAUA,EAAM,QAAQ,iBAAiB,KAAK,CAAC,EAAI,OAE3F,GAAI,CAACC,EAAK,MAAM,IAAI,MAAM,mDAAmDD,EAAM,KAAK,EAExF,OAAOF,EAAKG,CAAG,EAAE,CAAE,MAAAD,EAAO,WAAY,CAAE,CAAC,CAC3C,CACF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AO,WAAYA,CAAwC,EACjEA,EAAO,YAIlB,GAAIN,IAAW,8BAA+B,CAC5C,GAAM,CAACQ,CAAI,EAAIP,EACf,OAAOH,EAAS,IAAIU,CAAI,GAAK,KAG/B,GAAIR,IAAW,+BACb,OAAO,MAAMS,EAAyBR,CAAM,EAG9C,MAAM,IAAI,MAAM,iBAAiB,CACnC,CAOA,CAAC,CACH,CACF","names":["http","quarryPassIssuer","chain","url","createDebug","debug","claimGasPass","chain","userAddress","transport","quarryPassIssuer","debug","defineStore","parseAbi","paymasterAbi","paymasterConfig","paymasterTables","getRecord","getAllowance","client","paymasterAddress","userAddress","paymasterTables","getChainContractAddress","getPaymasterAddress","chain","hasPassIssuer","chain","paymasterAddress","passIssuerUrl","formatUserOperationRequest","estimateUserOperationGas","_params","gasEstimator","getTransport","opts","originalRequest","rest","method","params","options","estimateUserOperationGas","createTransport","numberToHex","entryPoint07Address","parseEther","formatUserOperation","toPackedUserOperation","getUserOperationHash","entryPoint07Address","entryPoint07Abi","setBalance","writeContract","getAction","sendUserOperation","executor","rpcUserOp","setBalance","parseEther","userOp","formatUserOperation","gas","packedUserOp","toPackedUserOperation","userOpHash","getUserOperationHash","entryPoint07Address","transactionHash","getAction","writeContract","entryPoint07Abi","userOpExecutor","executor","receipts","createTransport","method","params","numberToHex","entryPoint07Address","rpcUserOp","entrypoint","result","sendUserOperation","hash","estimateUserOperationGas"]}
1
+ {"version":3,"sources":["../src/transports/quarryPassIssuer.ts","../src/debug.ts","../src/claimGasPass.ts","../src/paymaster.ts","../src/getAllowance.ts","../src/getPaymasterAddress.ts","../src/hasPassIssuer.ts","../src/transports/methods/estimateUserOperationGas.ts","../src/transports/gasEstimator.ts","../src/transports/userOpExecutor.ts","../src/transports/methods/sendUserOperation.ts"],"sourcesContent":["import { Address, EIP1193RequestFn, Hex, Transport, http } from \"viem\";\n\nexport type QuarryPassIssuerRpcSchema = [\n {\n Method: \"quarry_issuePass\";\n Parameters: [passId: Hex, receiver: Address];\n ReturnType: { message: string };\n },\n {\n Method: \"quarry_claimAllowance\";\n Parameters: [passId: Hex, receiver: Address];\n ReturnType: { message: string };\n },\n];\n\nexport function quarryPassIssuer(): Transport<\"http\", {}, EIP1193RequestFn<QuarryPassIssuerRpcSchema>> {\n return ({ chain }) => {\n if (!chain) throw new Error(\"No chain provided to issuer transport.\");\n\n const url = \"quarryPassIssuer\" in chain.rpcUrls ? chain.rpcUrls.quarryPassIssuer.http[0] : undefined;\n // TODO: add fallback for anvil to do what quarryPassIssuer does internally\n if (!url) throw new Error(`No \\`quarryPassIssuer\\` RPC URL found for chain ${chain.id}.`);\n\n return http(url)({ chain, retryCount: 0 });\n };\n}\n","import createDebug from \"debug\";\n\nexport const debug = createDebug(\"mud:paymaster\");\n","import { Address, Chain } from \"viem\";\nimport { quarryPassIssuer } from \"./transports/quarryPassIssuer\";\nimport { debug } from \"./debug\";\n\nexport async function claimGasPass({ chain, userAddress }: { chain: Chain; userAddress: Address }) {\n const transport = quarryPassIssuer()({ chain });\n\n // TODO: handle case where you already have a pass?\n debug(\"Issuing gas pass to\", userAddress);\n await transport.request({\n method: \"quarry_issuePass\",\n params: [\"0x01\", userAddress],\n });\n\n debug(\"Claiming gas allowance for\", userAddress);\n await transport.request({\n method: \"quarry_claimAllowance\",\n params: [\"0x01\", userAddress],\n });\n}\n","import { defineStore } from \"@latticexyz/store\";\nimport { parseAbi } from \"viem\";\n\n// TODO: move the whole paymaster in here so we can just re-export ABI + MUD config\n\nexport const paymasterAbi = parseAbi([\n \"error SpenderSystem_AlreadyRegistered(address spender, address user)\",\n \"error SpenderSystem_HasOwnBalance(address spender)\",\n \"function registerSpender(address spender)\",\n]);\n\nexport const paymasterConfig = defineStore({\n namespaces: {\n root: {\n namespace: \"\",\n tables: {\n Allowance: {\n schema: {\n user: \"address\",\n allowance: \"uint256\",\n },\n key: [\"user\"],\n },\n Grantor: {\n schema: {\n grantor: \"address\",\n allowance: \"uint256\",\n },\n key: [\"grantor\"],\n },\n PassHolder: {\n schema: {\n user: \"address\",\n passId: \"bytes32\",\n lastRenewed: \"uint256\",\n lastClaimed: \"uint256\",\n },\n key: [\"user\", \"passId\"],\n },\n PassConfig: {\n schema: {\n passId: \"bytes32\",\n claimAmount: \"uint256\",\n claimInterval: \"uint256\",\n validityPeriod: \"uint256\",\n grantor: \"address\",\n },\n key: [\"passId\"],\n },\n Spender: {\n schema: {\n spender: \"address\",\n user: \"address\",\n },\n key: [\"spender\"],\n },\n SystemConfig: {\n schema: {\n entryPoint: \"address\",\n },\n key: [],\n },\n },\n },\n },\n});\n\nexport const paymasterTables = paymasterConfig.namespaces.root.tables;\n","import { Address, Client } from \"viem\";\nimport { paymasterTables } from \"./paymaster\";\nimport { getRecord } from \"@latticexyz/store/internal\";\n\nexport type GetAllowanceParams = {\n client: Client;\n paymasterAddress: Address;\n userAddress: Address;\n};\n\nexport async function getAllowance({ client, paymasterAddress, userAddress }: GetAllowanceParams) {\n const record = await getRecord(client, {\n address: paymasterAddress,\n table: paymasterTables.Allowance,\n key: { user: userAddress },\n blockTag: \"pending\",\n });\n return record.allowance;\n}\n","import { Chain, getChainContractAddress } from \"viem\";\n\nexport function getPaymasterAddress(chain: Chain) {\n return getChainContractAddress({ chain, contract: \"quarryPaymaster\" });\n}\n","import { Chain, ChainContract } from \"viem\";\n\nexport function hasPassIssuer(chain: Chain) {\n const paymasterContract = chain?.contracts?.quarryPaymaster as ChainContract | undefined;\n const paymasterAddress = paymasterContract?.address;\n\n const passIssuerUrl = \"quarryPassIssuer\" in chain.rpcUrls ? chain.rpcUrls.quarryPassIssuer.http[0] : undefined;\n\n return paymasterAddress != null && passIssuerUrl;\n}\n","import { BundlerRpcSchema } from \"viem\";\nimport { formatUserOperationRequest } from \"viem/account-abstraction\";\nimport { getRpcMethod } from \"../common\";\n\n// TODO: revisit after demo (don't hardcode gas)\n\ntype rpcMethod = getRpcMethod<BundlerRpcSchema, \"eth_estimateUserOperationGas\">;\n\nexport async function estimateUserOperationGas(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _params: rpcMethod[\"Parameters\"],\n): Promise<rpcMethod[\"ReturnType\"]> {\n return formatUserOperationRequest({\n callGasLimit: 20_000_000n,\n preVerificationGas: 200_000n,\n verificationGasLimit: 2_000_000n,\n paymasterVerificationGasLimit: 200_000n,\n paymasterPostOpGasLimit: 200_000n,\n });\n}\n","import { BundlerRpcSchema, Transport } from \"viem\";\nimport { estimateUserOperationGas } from \"./methods/estimateUserOperationGas\";\nimport { TransportRequestFn, getRpcSchema } from \"./common\";\n\n// TODO: move to common package?\n\nexport function gasEstimator<const transport extends Transport>(getTransport: transport): transport {\n return ((opts) => {\n const { request: originalRequest, ...rest } = getTransport(opts);\n\n const request: TransportRequestFn<getRpcSchema<BundlerRpcSchema, \"eth_estimateUserOperationGas\">> = async (\n { method, params },\n options,\n ) => {\n if (method === \"eth_estimateUserOperationGas\") {\n return estimateUserOperationGas(params);\n }\n return originalRequest({ method, params }, options);\n };\n\n return { request, ...rest };\n }) as transport;\n}\n","import {\n Account,\n BundlerRpcSchema,\n Chain,\n Client,\n EIP1193RequestFn,\n Hash,\n RpcUserOperationReceipt,\n Transport,\n createTransport,\n numberToHex,\n} from \"viem\";\nimport { entryPoint07Address } from \"viem/account-abstraction\";\nimport { TransportRequestFn } from \"./common\";\nimport { estimateUserOperationGas } from \"./methods/estimateUserOperationGas\";\nimport { sendUserOperation } from \"./methods/sendUserOperation\";\n\n// TODO: move to common package?\n\nexport function userOpExecutor({ executor }: { executor: Client<Transport, Chain, Account> }): Transport {\n return () => {\n const receipts = new Map<Hash, RpcUserOperationReceipt<\"0.7\">>();\n\n // @ts-expect-error TODO\n const request: TransportRequestFn<BundlerRpcSchema> = async ({ method, params }) => {\n // TODO: move chain/ID into args and executors as accounts instead of clients?\n if (method === \"eth_chainId\") {\n return numberToHex(executor.chain.id);\n }\n\n if (method === \"eth_supportedEntryPoints\") {\n return [entryPoint07Address];\n }\n\n if (method === \"eth_sendUserOperation\") {\n const [rpcUserOp, entrypoint] = params;\n if (entrypoint === entryPoint07Address) {\n const result = await sendUserOperation({ executor, rpcUserOp });\n receipts.set(result.userOpHash, result as RpcUserOperationReceipt<\"0.7\">);\n return result.userOpHash;\n }\n }\n\n if (method === \"eth_getUserOperationReceipt\") {\n const [hash] = params;\n return receipts.get(hash) ?? null;\n }\n\n if (method === \"eth_estimateUserOperationGas\") {\n return await estimateUserOperationGas(params);\n }\n\n throw new Error(\"Not implemented\");\n };\n\n return createTransport({\n key: \"userOpExecutor\",\n type: \"userOpExecutor\",\n name: \"User Operation Executor Transport\",\n request: request as EIP1193RequestFn,\n });\n };\n}\n","import {\n Client,\n Transport,\n Chain,\n Account,\n RpcUserOperation,\n RpcUserOperationReceipt,\n parseEther,\n parseEventLogs,\n} from \"viem\";\nimport {\n formatUserOperation,\n toPackedUserOperation,\n getUserOperationHash,\n entryPoint07Address,\n entryPoint07Abi,\n} from \"viem/account-abstraction\";\nimport { setBalance, waitForTransactionReceipt, writeContract } from \"viem/actions\";\nimport { getAction } from \"viem/utils\";\n\n// TODO: move to common package?\n\n// TODO: move this into a generic to support other versions?\nconst entryPointVersion = \"0.7\";\ntype entryPointVersion = typeof entryPointVersion;\n\nexport async function sendUserOperation({\n executor,\n rpcUserOp,\n}: {\n executor: Client<Transport, Chain, Account>;\n rpcUserOp: RpcUserOperation<entryPointVersion>;\n}): Promise<\n Pick<RpcUserOperationReceipt<entryPointVersion>, \"success\" | \"userOpHash\"> & {\n receipt: Pick<RpcUserOperationReceipt<entryPointVersion>[\"receipt\"], \"transactionHash\">;\n }\n> {\n if (executor.chain.id === 31337) {\n await setBalance(\n executor.extend(() => ({ mode: \"anvil\" })),\n {\n address: executor.account.address,\n value: parseEther(\"100\"),\n },\n );\n }\n\n const userOp = formatUserOperation(rpcUserOp);\n const gas =\n userOp.preVerificationGas +\n userOp.verificationGasLimit +\n (userOp.paymasterVerificationGasLimit ?? 0n) +\n (userOp.paymasterPostOpGasLimit ?? 0n) +\n userOp.callGasLimit;\n\n const packedUserOp = toPackedUserOperation(userOp);\n\n const userOpHash = getUserOperationHash({\n userOperation: userOp,\n chainId: executor.chain.id,\n entryPointVersion: \"0.7\",\n entryPointAddress: entryPoint07Address,\n });\n\n const transactionHash = await getAction(\n executor,\n writeContract,\n \"writeContract\",\n )({\n abi: entryPoint07Abi,\n address: entryPoint07Address,\n functionName: \"handleOps\",\n args: [[packedUserOp], executor.account.address],\n chain: executor.chain,\n account: executor.account,\n gas,\n });\n\n const receipt = await getAction(\n executor,\n waitForTransactionReceipt,\n \"waitForTransactionReceipt\",\n )({ hash: transactionHash });\n\n // TODO: replace with `getUserOperationReceipt`?\n const parsedLogs = parseEventLogs({\n logs: receipt.logs,\n abi: entryPoint07Abi,\n eventName: \"UserOperationEvent\" as const,\n });\n\n return {\n success: parsedLogs[0]!.args.success,\n userOpHash,\n receipt,\n };\n}\n"],"mappings":"AAAA,OAAoD,QAAAA,MAAY,OAezD,SAASC,GAAuF,CACrG,MAAO,CAAC,CAAE,MAAAC,CAAM,IAAM,CACpB,GAAI,CAACA,EAAO,MAAM,IAAI,MAAM,wCAAwC,EAEpE,IAAMC,EAAM,qBAAsBD,EAAM,QAAUA,EAAM,QAAQ,iBAAiB,KAAK,CAAC,EAAI,OAE3F,GAAI,CAACC,EAAK,MAAM,IAAI,MAAM,mDAAmDD,EAAM,KAAK,EAExF,OAAOF,EAAKG,CAAG,EAAE,CAAE,MAAAD,EAAO,WAAY,CAAE,CAAC,CAC3C,CACF,CCzBA,OAAOE,MAAiB,QAEjB,IAAMC,EAAQD,EAAY,eAAe,ECEhD,eAAsBE,EAAa,CAAE,MAAAC,EAAO,YAAAC,CAAY,EAA2C,CACjG,IAAMC,EAAYC,EAAiB,EAAE,CAAE,MAAAH,CAAM,CAAC,EAG9CI,EAAM,sBAAuBH,CAAW,EACxC,MAAMC,EAAU,QAAQ,CACtB,OAAQ,mBACR,OAAQ,CAAC,OAAQD,CAAW,CAC9B,CAAC,EAEDG,EAAM,6BAA8BH,C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IAAW,+BACb,OAAO,MAAMS,EAAyBR,CAAM,EAG9C,MAAM,IAAI,MAAM,iBAAiB,CACnC,CAOA,CAAC,CACH,CACF","names":["http","quarryPassIssuer","chain","url","createDebug","debug","claimGasPass","chain","userAddress","transport","quarryPassIssuer","debug","defineStore","parseAbi","paymasterAbi","paymasterConfig","paymasterTables","getRecord","getAllowance","client","paymasterAddress","userAddress","paymasterTables","getChainContractAddress","getPaymasterAddress","chain","hasPassIssuer","chain","paymasterAddress","passIssuerUrl","formatUserOperationRequest","estimateUserOperationGas","_params","gasEstimator","getTransport","opts","originalRequest","rest","method","params","options","estimateUserOperationGas","createTransport","numberToHex","entryPoint07Address","parseEther","parseEventLogs","formatUserOperation","toPackedUserOperation","getUserOperationHash","entryPoint07Address","entryPoint07Abi","setBalance","waitForTransactionReceipt","writeContract","getAction","sendUserOperation","executor","rpcUserOp","setBalance","parseEther","userOp","formatUserOperation","gas","packedUserOp","toPackedUserOperation","userOpHash","getUserOperationHash","entryPoint07Address","transactionHash","getAction","writeContract","entryPoint07Abi","receipt","waitForTransactionReceipt","parseEventLogs","userOpExecutor","executor","receipts","createTransport","method","params","numberToHex","entryPoint07Address","rpcUserOp","entrypoint","result","sendUserOperation","hash","estimateUserOperationGas"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latticexyz/paymaster",
3
- "version": "2.2.15-entrykit-4c25d1ec5af1bd68a4c1f367c9fe4b6fbea82cb2",
3
+ "version": "2.2.15-entrykit-3b489ecd8b6521b8bf17d29764011abc42a035c0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/latticexyz/mud.git",
@@ -23,8 +23,8 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "debug": "^4.3.4",
26
- "@latticexyz/common": "2.2.15-entrykit-4c25d1ec5af1bd68a4c1f367c9fe4b6fbea82cb2",
27
- "@latticexyz/store": "2.2.15-entrykit-4c25d1ec5af1bd68a4c1f367c9fe4b6fbea82cb2"
26
+ "@latticexyz/common": "2.2.15-entrykit-3b489ecd8b6521b8bf17d29764011abc42a035c0",
27
+ "@latticexyz/store": "2.2.15-entrykit-3b489ecd8b6521b8bf17d29764011abc42a035c0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/debug": "^4.1.7",