(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6982],{1666:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/infernet/sdk/reference/payments/WalletFactory",function(){return t(6703)}])},6703:function(e,n,t){"use strict";t.r(n),t.d(n,{__toc:function(){return d}});var r=t(1527),i=t(9410),s=t(6131),a=t(9309);t(5825);var o=t(1904);let d=[{depth:2,value:"State Variables",id:"state-variables"},{depth:3,value:"REGISTRY",id:"registry"},{depth:3,value:"wallets",id:"wallets"},{depth:2,value:"Functions",id:"functions"},{depth:3,value:"constructor",id:"constructor"},{depth:3,value:"createWallet",id:"createwallet"},{depth:3,value:"isValidWallet",id:"isvalidwallet"}];function _createMdxContent(e){let n=Object.assign({h1:"h1",p:"p",a:"a",code:"code",h2:"h2",h3:"h3",em:"em",pre:"pre",span:"span",strong:"strong",table:"table",thead:"thead",tr:"tr",th:"th",tbody:"tbody",td:"td"},(0,o.a)(),e.components);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{children:"WalletFactory"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://github.com/ritual-net/infernet-sdk/blob/main/src/payments/WalletFactory.sol",children:"Git Source"})}),"\n",(0,r.jsxs)(n.p,{children:["Responsible for creating and tracking ",(0,r.jsx)(n.code,{children:"Wallet"}),"(s)"]}),"\n",(0,r.jsx)(n.h2,{id:"state-variables",children:"State Variables"}),"\n",(0,r.jsx)(n.h3,{id:"registry",children:"REGISTRY"}),"\n",(0,r.jsx)(n.p,{children:"Registry contract"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.em,{children:["Consumed as parameter during ",(0,r.jsx)(n.code,{children:"Wallet"}),"-creation"]})}),"\n",(0,r.jsx)(n.pre,{"data-language":"solidity","data-theme":"default",children:(0,r.jsx)(n.code,{"data-language":"solidity","data-theme":"default",children:(0,r.jsxs)(n.span,{className:"line",children:[(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:"Registry "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"private"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"immutable"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" REGISTRY;"})]})})}),"\n",(0,r.jsx)(n.h3,{id:"wallets",children:"wallets"}),"\n",(0,r.jsx)(n.p,{children:"address => is wallet created by factory?"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.em,{children:["View functionality exposed via ",(0,r.jsx)(n.code,{children:"isValidWallet()"})]})}),"\n",(0,r.jsx)(n.pre,{"data-language":"solidity","data-theme":"default",children:(0,r.jsx)(n.code,{"data-language":"solidity","data-theme":"default",children:(0,r.jsxs)(n.span,{className:"line",children:[(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"mapping"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-constant)"},children:"address"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-constant)"},children:"bool"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:") "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"private"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" wallets;"})]})})}),"\n",(0,r.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,r.jsx)(n.h3,{id:"constructor",children:"constructor"}),"\n",(0,r.jsx)(n.p,{children:"Initializes new WalletFactory"}),"\n",(0,r.jsx)(n.pre,{"data-language":"solidity","data-theme":"default",children:(0,r.jsx)(n.code,{"data-language":"solidity","data-theme":"default",children:(0,r.jsxs)(n.span,{className:"line",children:[(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"constructor"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"Registry"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" registry);"})]})})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Parameters"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"registry"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Registry"})}),(0,r.jsx)(n.td,{children:"registry contract"})]})})]}),"\n",(0,r.jsx)(n.h3,{id:"createwallet",children:"createWallet"}),"\n",(0,r.jsxs)(n.p,{children:["Creates new ",(0,r.jsx)(n.code,{children:"Wallet"})," initially owned by ",(0,r.jsx)(n.code,{children:"owner"})]}),"\n",(0,r.jsx)(n.pre,{"data-language":"solidity","data-theme":"default",children:(0,r.jsx)(n.code,{"data-language":"solidity","data-theme":"default",children:(0,r.jsxs)(n.span,{className:"line",children:[(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"function"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-function)"},children:"createWallet"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-constant)"},children:"address"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" initialOwner) "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"external"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"returns"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-constant)"},children:"address"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:");"})]})})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Parameters"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"initialOwner"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"address"})}),(0,r.jsx)(n.td,{children:"initial owner"})]})})]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Returns"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"<none>"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"address"})}),(0,r.jsxs)(n.td,{children:["newly-created ",(0,r.jsx)(n.code,{children:"Wallet"})," address"]})]})})]}),"\n",(0,r.jsx)(n.h3,{id:"isvalidwallet",children:"isValidWallet"}),"\n",(0,r.jsxs)(n.p,{children:["Checks if an address is a valid ",(0,r.jsx)(n.code,{children:"Wallet"})," created by this ",(0,r.jsx)(n.code,{children:"WalletFactory"})]}),"\n",(0,r.jsx)(n.pre,{"data-language":"solidity","data-theme":"default",children:(0,r.jsx)(n.code,{"data-language":"solidity","data-theme":"default",children:(0,r.jsxs)(n.span,{className:"line",children:[(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"function"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-function)"},children:"isValidWallet"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-constant)"},children:"address"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" wallet) "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"external"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"view"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-keyword)"},children:"returns"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-token-constant)"},children:"bool"}),(0,r.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:");"})]})})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Parameters"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"wallet"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"address"})}),(0,r.jsx)(n.td,{children:"address to check"})]})})]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Returns"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"<none>"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"bool"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"true"})," if ",(0,r.jsx)(n.code,{children:"wallet"})," is a valid ",(0,r.jsx)(n.code,{children:"Wallet"}),", else ",(0,r.jsx)(n.code,{children:"false"})]})]})})]})]})}function MDXContent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:n}=Object.assign({},(0,o.a)(),e.components);return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(_createMdxContent,{...e})}):_createMdxContent(e)}let l={MDXContent,pageOpts:{filePath:"pages/infernet/sdk/reference/payments/WalletFactory.md",route:"/infernet/sdk/reference/payments/WalletFactory",pageMap:[{kind:"Meta",data:{index:"Home",infernet:"Infernet"}},{kind:"MdxPage",name:"index",route:"/"},{kind:"Folder",name:"infernet",route:"/infernet",children:[{kind:"Meta",data:{about:"About",overview:"Overview",payments:"Payments",proofs:"Proofs",sdk:"SDK",node:"Node",router:"Router"}},{kind:"MdxPage",name:"about",route:"/infernet/about"},{kind:"Folder",name:"node",route:"/infernet/node",children:[{kind:"Meta",data:{introduction:"Introduction",quickstart:"Quickstart",intro_to_payments:"Intro to Payments",architecture:"Architecture",containers:"Containers",configuration:"Configuration",deployment:"Deployment",api:"REST API",client:{title:"REST Client",href:"https://infernet-client.docs.ritual.net",newWindow:!0}}},{kind:"MdxPage",name:"api",route:"/infernet/node/api"},{kind:"MdxPage",name:"architecture",route:"/infernet/node/architecture"},{kind:"Folder",name:"configuration",route:"/infernet/node/configuration",children:[{kind:"Meta",data:{v1_4_0:"v1.4.0",v1_3_0:"v1.3.0",v1_2_0:"v1.2.0",v1_1_0:"v1.1.0",v1_0_0:"v1.0.0"}},{kind:"MdxPage",name:"v1_0_0",route:"/infernet/node/configuration/v1_0_0"},{kind:"MdxPage",name:"v1_1_0",route:"/infernet/node/configuration/v1_1_0"},{kind:"MdxPage",name:"v1_2_0",route:"/infernet/node/configuration/v1_2_0"},{kind:"MdxPage",name:"v1_3_0",route:"/infernet/node/configuration/v1_3_0"},{kind:"MdxPage",name:"v1_4_0",route:"/infernet/node/configuration/v1_4_0"}]},{kind:"MdxPage",name:"configuration",route:"/infernet/node/configuration"},{kind:"MdxPage",name:"containers",route:"/infernet/node/containers"},{kind:"MdxPage",name:"deployment",route:"/infernet/node/deployment"},{kind:"MdxPage",name:"intro_to_payments",route:"/infernet/node/intro_to_payments"},{kind:"MdxPage",name:"introduction",route:"/infernet/node/introduction"},{kind:"MdxPage",name:"quickstart",route:"/infernet/node/quickstart"}]},{kind:"MdxPage",name:"overview",route:"/infernet/overview"},{kind:"MdxPage",name:"payments",route:"/infernet/payments"},{kind:"MdxPage",name:"proofs",route:"/infernet/proofs"},{kind:"Folder",name:"router",route:"/infernet/router",children:[{kind:"Meta",data:{introduction:"Introduction",api:"REST API",client:{title:"REST Client",href:"https://infernet-client.docs.ritual.net/usage/#router",newWindow:!0}}},{kind:"MdxPage",name:"api",route:"/infernet/router/api"},{kind:"MdxPage",name:"client",route:"/infernet/router/client"},{kind:"MdxPage",name:"introduction",route:"/infernet/router/introduction"}]},{kind:"Folder",name:"sdk",route:"/infernet/sdk",children:[{kind:"Meta",data:{introduction:"Introduction",architecture:"Architecture",consumers:"Consumers",patterns:"Patterns",testing:"Testing",reference:"Reference"}},{kind:"MdxPage",name:"architecture",route:"/infernet/sdk/architecture"},{kind:"Folder",name:"consumers",route:"/infernet/sdk/consumers",children:[{kind:"MdxPage",name:"Callback",route:"/infernet/sdk/consumers/Callback"},{kind:"MdxPage",name:"Subscription",route:"/infernet/sdk/consumers/Subscription"},{kind:"Meta",data:{Callback:"Callback",Subscription:"Subscription"}}]},{kind:"MdxPage",name:"introduction",route:"/infernet/sdk/introduction"},{kind:"Folder",name:"patterns",route:"/infernet/sdk/patterns",children:[{kind:"MdxPage",name:"allowlist",route:"/infernet/sdk/patterns/allowlist"},{kind:"MdxPage",name:"delegator",route:"/infernet/sdk/patterns/delegator"},{kind:"Meta",data:{allowlist:"Allowlist",delegator:"Delegator"}}]},{kind:"Folder",name:"reference",route:"/infernet/sdk/reference",children:[{kind:"MdxPage",name:"Coordinator",route:"/infernet/sdk/reference/Coordinator"},{kind:"MdxPage",name:"EIP712Coordinator",route:"/infernet/sdk/reference/EIP712Coordinator"},{kind:"MdxPage",name:"Inbox",route:"/infernet/sdk/reference/Inbox"},{kind:"MdxPage",name:"Registry",route:"/infernet/sdk/reference/Registry"},{kind:"Meta",data:{Registry:"Registry",Coordinator:"Coordinator",EIP712Coordinator:"EIP712Coordinator",Inbox:"Inbox",consumers:"Consumers",payments:"Payments",patterns:"Patterns",utilities:"Utilities"}},{kind:"Folder",name:"consumers",route:"/infernet/sdk/reference/consumers",children:[{kind:"MdxPage",name:"BaseConsumer",route:"/infernet/sdk/reference/consumers/BaseConsumer"},{kind:"MdxPage",name:"CallbackConsumer",route:"/infernet/sdk/reference/consumers/CallbackConsumer"},{kind:"MdxPage",name:"SubscriptionConsumer",route:"/infernet/sdk/reference/consumers/SubscriptionConsumer"},{kind:"Meta",data:{BaseConsumer:"BaseConsumer",CallbackConsumer:"CallbackConsumer",SubscriptionConsumer:"SubscriptionConsumer"}}]},{kind:"Folder",name:"patterns",route:"/infernet/sdk/reference/patterns",children:[{kind:"MdxPage",name:"Allowlist",route:"/infernet/sdk/reference/patterns/Allowlist"},{kind:"MdxPage",name:"Delegator",route:"/infernet/sdk/reference/patterns/Delegator"},{kind:"Meta",data:{Allowlist:"Allowlist",Delegator:"Delegator"}}]},{kind:"Folder",name:"payments",route:"/infernet/sdk/reference/payments",children:[{kind:"MdxPage",name:"Fee",route:"/infernet/sdk/reference/payments/Fee"},{kind:"MdxPage",name:"IVerifier",route:"/infernet/sdk/reference/payments/IVerifier"},{kind:"MdxPage",name:"Wallet",route:"/infernet/sdk/reference/payments/Wallet"},{kind:"MdxPage",name:"WalletFactory",route:"/infernet/sdk/reference/payments/WalletFactory"},{kind:"Meta",data:{Fee:"Fee",IVerifier:"IVerifier",Wallet:"Wallet",WalletFactory:"WalletFactory"}}]},{kind:"Folder",name:"utilities",route:"/infernet/sdk/reference/utilities",children:[{kind:"MdxPage",name:"Coordinated",route:"/infernet/sdk/reference/utilities/Coordinated"},{kind:"MdxPage",name:"Reader",route:"/infernet/sdk/reference/utilities/Reader"},{kind:"Meta",data:{Reader:"Reader",Coordinated:"Coordinated"}}]}]},{kind:"MdxPage",name:"testing",route:"/infernet/sdk/testing"}]}]}],flexsearch:{codeblocks:!0},title:"WalletFactory",headings:d},pageNextRoute:"/infernet/sdk/reference/payments/WalletFactory",nextraLayout:s.ZP,themeConfig:a.Z};n.default=(0,i.j)(l)},9309:function(e,n,t){"use strict";var r=t(1527),i=t(3183);let s="https://github.com/ritual-net";n.Z={logo:(0,r.jsx)("img",{src:"/vectors/logo.svg",alt:"Ritual"}),project:{link:s},docsRepositoryBase:"".concat(s,"/docs"),darkMode:!0,nextThemes:{defaultTheme:"dark"},primaryHue:161,primarySaturation:100,feedback:{content:null},editLink:{component:(0,r.jsx)(r.Fragment,{})},toc:{title:"Jump to..."},useNextSeoProps(){let{asPath:e}=(0,i.useRouter)(),n={titleTemplate:"Ritual",description:"Ritual is building a sovereign, execution layer for AI. Our first phase, Infernet, is the first product of its kind to enable developers to access models both on-chain via smart contracts and off-chain. Our next phase, the Ritual chain, will be an execution layer custom-built to support AI-native operations and enable a new class of applications at the intersection of crypto and AI.",openGraph:{images:[{url:"/meta.png"}],siteName:"Ritual Documentation"}};return"/"!==e?{...n,titleTemplate:"Ritual — %s"}:n},faviconGlyph:"❖"}}},function(e){e.O(0,[3381,9774,2888,179],function(){return e(e.s=1666)}),_N_E=e.O()}]);