diff --git a/dojo-book/docs/dist/.vocs/icons/arrow-diagonal.svg b/dojo-book/docs/dist/.vocs/icons/arrow-diagonal.svg new file mode 100644 index 00000000..09d0d0ad --- /dev/null +++ b/dojo-book/docs/dist/.vocs/icons/arrow-diagonal.svg @@ -0,0 +1,3 @@ + + + diff --git a/dojo-book/docs/dist/.vocs/icons/chevron-down.svg b/dojo-book/docs/dist/.vocs/icons/chevron-down.svg new file mode 100644 index 00000000..3fb4a526 --- /dev/null +++ b/dojo-book/docs/dist/.vocs/icons/chevron-down.svg @@ -0,0 +1,13 @@ + + Chevron Down + + \ No newline at end of file diff --git a/dojo-book/docs/dist/.vocs/icons/chevron-up.svg b/dojo-book/docs/dist/.vocs/icons/chevron-up.svg new file mode 100644 index 00000000..cc18dae4 --- /dev/null +++ b/dojo-book/docs/dist/.vocs/icons/chevron-up.svg @@ -0,0 +1,13 @@ + + Chevron Up + + \ No newline at end of file diff --git a/dojo-book/docs/dist/.vocs/icons/link.svg b/dojo-book/docs/dist/.vocs/icons/link.svg new file mode 100644 index 00000000..4e64236b --- /dev/null +++ b/dojo-book/docs/dist/.vocs/icons/link.svg @@ -0,0 +1,3 @@ + + + diff --git a/dojo-book/docs/dist/.vocs/search-index-6abb3f38.json b/dojo-book/docs/dist/.vocs/search-index-6abb3f38.json new file mode 100644 index 00000000..cedc2adb --- /dev/null +++ b/dojo-book/docs/dist/.vocs/search-index-6abb3f38.json @@ -0,0 +1 @@ +{"documentCount":235,"nextId":235,"documentIds":{"0":"docs/pages/example.mdx#example","1":"docs/pages/getting-started.md#dojo-the-provable-game-engine","2":"docs/pages/getting-started.md#organizational-structure","3":"docs/pages/getting-started.md#how-do-i-get-involved","4":"docs/pages/deployment/locally.md#local-deployment-with-katana","5":"docs/pages/deployment/locally.md#easy-katana-deployments","6":"docs/pages/deployment/locally.md#step-by-step-guide-to-deploy-on-katana","7":"docs/pages/deployment/remote.md#deployment-to-remote-network","8":"docs/pages/deployment/remote.md#deploy-to-public-starknet","9":"docs/pages/deployment/remote.md#deploy-to-remote-katana","10":"docs/pages/deployment/remote.md#deploy-to-remote-madara","11":"docs/pages/cairo/authorization.md#authorization","12":"docs/pages/cairo/authorization.md#auth-architecture","13":"docs/pages/cairo/authorization.md#providing-authorization","14":"docs/pages/cairo/commands.md#commands","15":"docs/pages/cairo/commands.md#using-commands","16":"docs/pages/cairo/commands.md#the-get-command","17":"docs/pages/cairo/commands.md#the-set-command","18":"docs/pages/cairo/commands.md#the-emit-command","19":"docs/pages/cairo/commands.md#the-delete-command","20":"docs/pages/cairo/config.md#config","21":"docs/pages/cairo/entities.md#entities","22":"docs/pages/cairo/enum.md#enum","23":"docs/pages/cairo/events.md#events","24":"docs/pages/cairo/events.md#model-events","25":"docs/pages/cairo/events.md#world-events","26":"docs/pages/cairo/events.md#custom-events","27":"docs/pages/cairo/hello-dojo.md#hello-dojo","28":"docs/pages/cairo/hello-dojo.md#dojo-as-an-ecs-in-15-minutes","29":"docs/pages/cairo/hello-dojo.md#anatomy-of-a-dojo-project","30":"docs/pages/cairo/hello-dojo.md#breaking-it-down","31":"docs/pages/cairo/hello-dojo.md#system-is-a-function-in-a-contract","32":"docs/pages/cairo/hello-dojo.md#run-it-locally","33":"docs/pages/cairo/hello-dojo.md#indexing","34":"docs/pages/cairo/hello-dojo.md#next-steps","35":"docs/pages/cairo/metadata.md#metadata","36":"docs/pages/cairo/metadata.md#world-metadata","37":"docs/pages/cairo/metadata.md#contract-metadata","38":"docs/pages/cairo/migration.md#migration","39":"docs/pages/cairo/models.md#models","40":"docs/pages/cairo/models.md#models-are-structs","41":"docs/pages/cairo/models.md#the-key-attribute","42":"docs/pages/cairo/models.md#implementing-traits","43":"docs/pages/cairo/models.md#custom-setting-models","44":"docs/pages/cairo/models.md#types","45":"docs/pages/cairo/models.md#custom-types--enums","46":"docs/pages/cairo/models.md#in-practice-with-modularity-in-mind","47":"docs/pages/cairo/origami.md#what-is-origami","48":"docs/pages/cairo/overview.md#a-new-approach-to-onchain-game-development","49":"docs/pages/cairo/overview.md#delving-into-the-architecture","50":"docs/pages/cairo/overview.md#breakdown","51":"docs/pages/cairo/overview.md#position-struct---the-dojo-model","52":"docs/pages/cairo/overview.md#spawn-function---a-dojo-system","53":"docs/pages/cairo/systems.md#systems","54":"docs/pages/cairo/systems.md#what-are-systems","55":"docs/pages/cairo/systems.md#system-permissions","56":"docs/pages/cairo/systems.md#system-structure","57":"docs/pages/cairo/systems.md#breaking-it-down","58":"docs/pages/cairo/systems.md#system-is-a-function-in-a-contract","59":"docs/pages/cairo/systems.md#spawn-function","60":"docs/pages/cairo/systems.md#the-dojocontract-decorator","61":"docs/pages/cairo/testing.md#testing","62":"docs/pages/cairo/testing.md#writing-unit-tests","63":"docs/pages/cairo/testing.md#writing-integration-tests","64":"docs/pages/cairo/testing.md#useful-dojo-test-functions","65":"docs/pages/cairo/world.md#the-world-contract","66":"docs/pages/cairo/world.md#events","67":"docs/pages/cairo/world.md#full-world-api","68":"docs/pages/cairo/world.md#uuid","69":"docs/pages/client/dojojs.md#dojojs","70":"docs/pages/client/dojojs.md#dojoenginecore","71":"docs/pages/client/dojojs.md#dojoenginecreate-burner","72":"docs/pages/client/dojojs.md#dojoengineutils","73":"docs/pages/client/dojojs.md#dojoenginereact","74":"docs/pages/client/dojojs.md#dojoenginetorii-client","75":"docs/pages/client/dojojs.md#dojoenginetorii-wasm","76":"docs/pages/client/overview.md#overview","77":"docs/pages/client/torii.md#torii-client","78":"docs/pages/client/torii.md#usage-in-rust-projects","79":"docs/pages/getting-started/contributing.md#contributing-to-the-core","80":"docs/pages/getting-started/contributing.md#how-to-contribute","81":"docs/pages/getting-started/from-source.md#building-from-source","82":"docs/pages/getting-started/from-source.md#prerequisites","83":"docs/pages/getting-started/from-source.md#building","84":"docs/pages/getting-started/quick-start.md#quick-start","85":"docs/pages/getting-started/quick-start.md#install-dojoup","86":"docs/pages/getting-started/quick-start.md#next-steps","87":"docs/pages/getting-started/setup.md#development-setup","88":"docs/pages/getting-started/setup.md#prerequisites","89":"docs/pages/getting-started/setup.md#guide","90":"docs/pages/getting-started/setup.md#clone","91":"docs/pages/getting-started/setup.md#linux--mac","92":"docs/pages/getting-started/setup.md#1-install-rust-and-dependencies","93":"docs/pages/getting-started/setup.md#2-install-scarb-package-manager","94":"docs/pages/getting-started/setup.md#3-add-the-cairo-10-vscode-extension","95":"docs/pages/getting-started/setup.md#windows","96":"docs/pages/getting-started/setup.md#container","97":"docs/pages/community/get-started.md#get-started","98":"docs/pages/community/get-started.md#ecosystem--studios-powered-by-dojo","99":"docs/pages/community/get-started.md#realms-world","100":"docs/pages/community/get-started.md#briq-world","101":"docs/pages/community/get-started.md#cartridge","102":"docs/pages/community/get-started.md#zkorp","103":"docs/pages/community/get-started.md#templates--libraries","104":"docs/pages/community/get-started.md#awesome-projects","105":"docs/pages/misc/contributors.md#contributing-to-dojo-book","106":"docs/pages/misc/contributors.md#the-purpose-of-the-book","107":"docs/pages/misc/contributors.md#code-of-conduct","108":"docs/pages/misc/contributors.md#ways-to-contribute","109":"docs/pages/misc/contributors.md#issues","110":"docs/pages/misc/contributors.md#pull-requests","111":"docs/pages/misc/contributors.md#writing-style","112":"docs/pages/misc/contributors.md#chapters-start-with-a-second-level-heading","113":"docs/pages/theory/autonomous-worlds.md#autonomous-worlds","114":"docs/pages/theory/autonomous-worlds.md#homework","115":"docs/pages/theory/cairo.md#provable-games","116":"docs/pages/theory/cairo.md#cairo","117":"docs/pages/theory/cairo.md#essential-reading","118":"docs/pages/theory/cairo.md#starknet-as-an-l2","119":"docs/pages/theory/cairo.md#starknet-as-an-appchain","120":"docs/pages/theory/faqs.md#faqs","121":"docs/pages/theory/faqs.md#who-owns-dojo","122":"docs/pages/theory/faqs.md#why-dojo","123":"docs/pages/theory/faqs.md#what-is-the-dojo-roadmap","124":"docs/pages/theory/faqs.md#what-is-an-onchain-game","125":"docs/pages/theory/faqs.md#what-is-an-autonomous-world","126":"docs/pages/theory/faqs.md#what-is-cairo","127":"docs/pages/theory/faqs.md#what-is-a-provable-game","128":"docs/pages/theory/faqs.md#can-dojo-implement-client-side-proofs","129":"docs/pages/theory/faqs.md#can-i-deploy-dojo-on-starknet","130":"docs/pages/theory/what-is-dojo.md#what-is-dojo","131":"docs/pages/theory/what-is-dojo.md#stop-building-infrastructure-start-building-games","132":"docs/pages/theory/what-is-dojo.md#entity-component-system-ecs","133":"docs/pages/theory/what-is-dojo.md#what-dojo-doesnt-give-you","134":"docs/pages/toolchain/dojoup.md#dojoup","135":"docs/pages/toolchain/dojoup.md#installing","136":"docs/pages/toolchain/dojoup.md#usage","137":"docs/pages/toolchain/dojoup.md#note---branch---repo-and---version-flags-are-ignored-during-local-installations","138":"docs/pages/toolchain/dojoup.md#precompiled-binaries","139":"docs/pages/cairo/migration/0.3.0.md#migration-guide-to-030","140":"docs/pages/cairo/migration/0.3.0.md#components-to-models","141":"docs/pages/cairo/migration/0.3.0.md#changes-in-model-implementation","142":"docs/pages/cairo/migration/0.3.0.md#schema-introduction","143":"docs/pages/cairo/migration/0.3.0.md#systems-update","144":"docs/pages/cairo/migration/0.3.0.md#interface-creation","145":"docs/pages/cairo/migration/0.3.0.md#interface-implementation","146":"docs/pages/cairo/migration/0.3.0.md#dojocontract-decorator","147":"docs/pages/cairo/migration/0.3.0.md#events","148":"docs/pages/cairo/migration/0.3.0.md#testing-changes","149":"docs/pages/cairo/migration/0.3.0.md#setup","150":"docs/pages/cairo/migration/0.3.0.md#function-testing","151":"docs/pages/cairo/migration/0.4.0.md#migration-guide-to-040","152":"docs/pages/client/sdk/c.md#dojo-c","153":"docs/pages/client/sdk/dojojs.md#dojojs","154":"docs/pages/toolchain/katana/development.md#development","155":"docs/pages/toolchain/slot/overview.md#slot","156":"docs/pages/toolchain/slot/overview.md#installation","157":"docs/pages/toolchain/slot/overview.md#deploy-using-slot","158":"docs/pages/toolchain/slot/reference.md#slot-reference","159":"docs/pages/toolchain/slot/reference.md#name","160":"docs/pages/toolchain/slot/reference.md#usage","161":"docs/pages/toolchain/slot/reference.md#commands","162":"docs/pages/toolchain/torii/graphql.md#torii---graphql","163":"docs/pages/toolchain/torii/graphql.md#name","164":"docs/pages/toolchain/torii/graphql.md#graphql-playground","165":"docs/pages/toolchain/torii/graphql.md#usage","166":"docs/pages/toolchain/torii/graphql.md#pre-requisites","167":"docs/pages/toolchain/torii/graphql.md#schema-and-query-defintions","168":"docs/pages/toolchain/torii/graphql.md#query-operation","169":"docs/pages/toolchain/torii/graphql.md#transactions","170":"docs/pages/toolchain/torii/graphql.md#pagination","171":"docs/pages/toolchain/torii/graphql.md#cursor","172":"docs/pages/toolchain/torii/graphql.md#offsetlimit","173":"docs/pages/toolchain/torii/graphql.md#subscription-operations","174":"docs/pages/toolchain/torii/graphql.md#susbcription-to-events","175":"docs/pages/toolchain/torii/grpc.md#grpc","176":"docs/pages/toolchain/torii/overview.md#torii","177":"docs/pages/toolchain/torii/overview.md#torii-server","178":"docs/pages/toolchain/torii/overview.md#torii-client","179":"docs/pages/toolchain/torii/overview.md#usage","180":"docs/pages/toolchain/torii/overview.md#installation","181":"docs/pages/toolchain/torii/overview.md#installing-from-source","182":"docs/pages/toolchain/torii/reference.md#torii-reference","183":"docs/pages/toolchain/torii/reference.md#name","184":"docs/pages/toolchain/torii/reference.md#usage","185":"docs/pages/toolchain/torii/reference.md#description","186":"docs/pages/toolchain/torii/reference.md#database-url","187":"docs/pages/toolchain/torii/reference.md#options","188":"docs/pages/toolchain/torii/reference.md#general-options","189":"docs/pages/toolchain/sozo/development.md#development","190":"docs/pages/toolchain/sozo/overview.md#sozo","191":"docs/pages/toolchain/sozo/overview.md#features","192":"docs/pages/toolchain/sozo/overview.md#installation","193":"docs/pages/toolchain/sozo/overview.md#installing-from-source","194":"docs/pages/toolchain/sozo/reference.md#sozo-reference","195":"docs/pages/toolchain/sozo/reference.md#common-options","196":"docs/pages/toolchain/sozo/reference.md#project-commands","197":"docs/pages/toolchain/sozo/reference.md#world-commands","198":"docs/pages/tutorial/deploy-using-slot/main.md#deploy-your-game-using-slot","199":"docs/pages/tutorial/deploy-using-slot/main.md#torii","200":"docs/pages/tutorial/onchain-chess/0-setup.md#0-setup","201":"docs/pages/tutorial/onchain-chess/0-setup.md#initializing-the-project","202":"docs/pages/tutorial/onchain-chess/0-setup.md#cleaning-up-the-boilerplate","203":"docs/pages/tutorial/onchain-chess/0-setup.md#basic-models","204":"docs/pages/tutorial/onchain-chess/0-setup.md#basic-systems","205":"docs/pages/tutorial/onchain-chess/0-setup.md#compile-your-project","206":"docs/pages/tutorial/onchain-chess/0-setup.md#implement-traits-for-models","207":"docs/pages/tutorial/onchain-chess/0-setup.md#requirements","208":"docs/pages/tutorial/onchain-chess/2-move.md#2-move-function","209":"docs/pages/tutorial/onchain-chess/2-move.md#test-flow","210":"docs/pages/tutorial/onchain-chess/2-move.md#unit-tests","211":"docs/pages/tutorial/onchain-chess/2-move.md#diving-into-the-code","212":"docs/pages/tutorial/onchain-chess/2-move.md#setup_world","213":"docs/pages/tutorial/onchain-chess/2-move.md#test_spawn","214":"docs/pages/tutorial/onchain-chess/2-move.md#test_move","215":"docs/pages/tutorial/onchain-chess/2-move.md#need-help","216":"docs/pages/tutorial/onchain-chess/3-test.md#3-test-contract","217":"docs/pages/tutorial/onchain-chess/3-test.md#full-code","218":"docs/pages/tutorial/onchain-chess/3-test.md#congratulations","219":"docs/pages/tutorial/onchain-chess/README.md#building-a-chess-game","220":"docs/pages/tutorial/onchain-chess/README.md#what-are-we-building","221":"docs/pages/tutorial/onchain-chess/README.md#what-after-this-guide","222":"docs/pages/toolchain/slot/deployments-commands/deployments.md#slot-deployments","223":"docs/pages/toolchain/slot/deployments-commands/deployments.md#commands","224":"docs/pages/toolchain/sozo/common-options/offline.md#offline","225":"docs/pages/toolchain/sozo/common-options/offline.md#use-sozo-offline","226":"docs/pages/toolchain/sozo/common-options/offline.md#usage","227":"docs/pages/toolchain/sozo/common-options/profile.md#use-sozo-profiles","228":"docs/pages/toolchain/sozo/common-options/profile.md#usage","229":"docs/pages/toolchain/sozo/world-commands/auth.md#sozo-auth","230":"docs/pages/toolchain/sozo/world-commands/events.md#sozo-events","231":"docs/pages/toolchain/sozo/world-commands/register.md#sozo-register","232":"docs/pages/toolchain/sozo/project-commands/build.md#sozo-build","233":"docs/pages/toolchain/sozo/project-commands/init.md#sozo-init","234":"docs/pages/toolchain/sozo/project-commands/test.md#sozo-test"},"fieldIds":{"title":0,"titles":1,"text":2},"fieldLength":{"0":[1,1,6],"1":[5,1,89],"2":[2,6,34],"3":[6,6,10],"4":[4,1,37],"5":[3,5,43],"6":[7,5,49],"7":[4,1,87],"8":[4,5,19],"9":[3,5,25],"10":[4,5,8],"11":[1,1,64],"12":[2,2,29],"13":[2,2,43],"14":[1,1,81],"15":[2,2,17],"16":[3,2,85],"17":[3,2,42],"18":[3,2,33],"19":[3,2,15],"20":[1,1,84],"21":[1,1,86],"22":[1,1,88],"23":[1,1,54],"24":[2,2,63],"25":[2,2,49],"26":[2,2,83],"27":[2,1,24],"28":[7,2,106],"29":[5,9,244],"30":[3,8,1],"31":[6,11,116],"32":[4,8,162],"33":[1,8,274],"34":[2,8,35],"35":[1,1,42],"36":[2,2,96],"37":[2,2,29],"38":[1,1,6],"39":[1,1,39],"40":[3,2,66],"41":[3,4,93],"42":[2,4,58],"43":[3,4,86],"44":[1,4,22],"45":[4,4,75],"46":[6,2,142],"47":[4,1,28],"48":[7,1,39],"49":[4,8,115],"50":[1,8,12],"51":[5,9,42],"52":[5,9,38],"53":[1,1,57],"54":[4,2,45],"55":[2,2,23],"56":[2,2,103],"57":[3,1,1],"58":[6,6,21],"59":[2,6,30],"60":[4,4,123],"61":[1,1,45],"62":[3,2,66],"63":[3,2,105],"64":[4,5,21],"65":[3,1,75],"66":[1,4,23],"67":[3,4,85],"68":[2,4,28],"69":[2,1,21],"70":[3,3,38],"71":[4,3,19],"72":[3,3,13],"73":[3,3,10],"74":[4,3,13],"75":[4,3,11],"76":[1,1,31],"77":[2,1,29],"78":[4,3,2],"79":[4,1,17],"80":[3,4,33],"81":[3,1,18],"82":[1,4,39],"83":[1,4,49],"84":[2,1,23],"85":[2,3,57],"86":[2,3,10],"87":[2,1,32],"88":[1,3,4],"89":[1,2,1],"90":[1,3,8],"91":[3,3,1],"92":[5,6,42],"93":[5,6,23],"94":[8,6,11],"95":[1,3,3],"96":[1,3,3],"97":[2,1,23],"98":[6,1,1],"99":[2,7,3],"100":[2,7,3],"101":[1,7,3],"102":[1,7,2],"103":[3,1,33],"104":[2,1,113],"105":[4,1,39],"106":[5,5,59],"107":[3,5,9],"108":[3,5,1],"109":[1,7,57],"110":[2,7,40],"111":[2,5,13],"112":[7,7,7],"113":[2,1,205],"114":[1,3,33],"115":[2,1,84],"116":[1,2,109],"117":[2,4,6],"118":[4,3,95],"119":[4,3,62],"120":[1,1,1],"121":[4,2,22],"122":[3,2,27],"123":[6,2,28],"124":[6,2,32],"125":[6,2,33],"126":[4,2,34],"127":[6,2,86],"128":[7,2,33],"129":[7,2,27],"130":[4,1,81],"131":[5,4,18],"132":[5,8,81],"133":[7,8,29],"134":[1,1,11],"135":[1,1,9],"136":[1,1,69],"137":[12,3,22],"138":[2,2,44],"139":[5,1,20],"140":[3,6,46],"141":[4,6,20],"142":[2,6,95],"143":[2,6,52],"144":[2,8,60],"145":[2,8,60],"146":[4,8,29],"147":[1,6,39],"148":[2,6,1],"149":[1,8,46],"150":[2,8,33],"151":[5,1,2],"152":[2,1,3],"153":[2,1,1],"154":[1,1,1],"155":[1,1,23],"156":[1,1,25],"157":[3,1,24],"158":[2,1,1],"159":[1,3,13],"160":[1,3,4],"161":[1,3,18],"162":[2,1,1],"163":[1,3,73],"164":[2,4,33],"165":[1,3,1],"166":[2,4,38],"167":[4,3,69],"168":[2,3,84],"169":[1,5,113],"170":[1,5,48],"171":[1,6,64],"172":[2,6,33],"173":[2,3,135],"174":[3,5,102],"175":[1,1,38],"176":[1,1,43],"177":[2,2,15],"178":[2,2,19],"179":[1,2,35],"180":[1,1,14],"181":[3,2,33],"182":[2,1,1],"183":[1,3,12],"184":[1,3,3],"185":[1,3,55],"186":[2,4,66],"187":[1,3,1],"188":[2,4,75],"189":[1,1,1],"190":[1,1,62],"191":[1,1,24],"192":[1,1,13],"193":[3,2,38],"194":[2,1,1],"195":[2,3,3],"196":[2,3,5],"197":[2,3,7],"198":[5,1,175],"199":[1,5,50],"200":[2,1,17],"201":[3,2,24],"202":[4,2,87],"203":[2,2,109],"204":[2,2,46],"205":[3,2,26],"206":[4,2,22],"207":[1,6,108],"208":[3,1,105],"209":[2,3,45],"210":[2,3,102],"211":[4,3,1],"212":[2,7,47],"213":[2,7,95],"214":[2,7,62],"215":[3,3,16],"216":[3,1,74],"217":[2,3,92],"218":[2,3,83],"219":[4,1,80],"220":[5,4,80],"221":[5,4,29],"222":[2,1,9],"223":[1,3,31],"224":[1,1,1],"225":[3,1,10],"226":[1,3,7],"227":[3,1,21],"228":[1,4,46],"229":[2,1,42],"230":[2,1,8],"231":[2,1,34],"232":[2,1,15],"233":[2,1,20],"234":[2,1,19]},"averageFieldLength":[2.680851063829788,3.1659574468085108,43.50638297872339],"storedFields":{"0":{"href":"/example#example","html":"\n

This is an example page.

","isPage":true,"text":"\nThis is an example page.","title":"Example","titles":[]},"1":{"href":"/getting-started#dojo-the-provable-game-engine","html":"\n

Dojo is a provable game engine built using Cairo. It establishes a standard for game development via smart contracts, blending best practices with streamlined development and deployment tools. With Dojo by your side, you can evolve from initial concept to a fully realized game in days, not weeks.

\n

This book is dedicated to familiarizing you with the Dojo engine and the potential of Provable games. A special section on the Theory elucidates this emergent concept of autonomous worlds and Provable games.

\n\n
\n

Dojo is an open-source onchain gaming project currently in its early development phase, and warmly welcomes contributors. For additional resources, join the community on Discord and check out the contribution guide.

\n
\n
\n","isPage":true,"text":"\nDojo is a provable game engine built using Cairo. It establishes a standard for game development via smart contracts, blending best practices with streamlined development and deployment tools. With Dojo by your side, you can evolve from initial concept to a fully realized game in days, not weeks.\nThis book is dedicated to familiarizing you with the Dojo engine and the potential of Provable games. A special section on the Theory elucidates this emergent concept of autonomous worlds and Provable games.\n\nQuickstart\nWhat is Dojo? \nExplore the Architecture\n\n\nDojo is an open-source onchain gaming project currently in its early development phase, and warmly welcomes contributors. For additional resources, join the community on Discord and check out the contribution guide.\n\n\n","title":"Dojo The Provable Game Engine","titles":[]},"2":{"href":"/getting-started#organizational-structure","html":"\n

Dojo is an open-source initiative, licensed under Apache 2.0, dedicated to promoting and advancing the concept of Autonomous Worlds (AWs). It is spearheaded by Cartridge, Realms & BibliothecaDAO, briq and many more contributors.

\n","isPage":false,"text":"\nDojo is an open-source initiative, licensed under Apache 2.0, dedicated to promoting and advancing the concept of Autonomous Worlds (AWs). It is spearheaded by Cartridge, Realms & BibliothecaDAO, briq and many more contributors.\n","title":"Organizational Structure","titles":["Dojo The Provable Game Engine",null]},"3":{"href":"/getting-started#how-do-i-get-involved","html":"\n

Check out our Github, our Twitter, Discord and contribution guide

","isPage":false,"text":"\nCheck out our Github, our Twitter, Discord and contribution guide","title":"How do I get involved?","titles":["Dojo The Provable Game Engine",null]},"4":{"href":"/deployment/locally#local-deployment-with-katana","html":"\n

Experience the power of rapid development with Dojo, featuring the ultra-fast local development sequencer, Katana. Katana acts as an on-device Starknet, enabling thorough testing of your dojo world in a controlled environment before migrating them to the remote testnet.

\n","isPage":true,"text":"\nExperience the power of rapid development with Dojo, featuring the ultra-fast local development sequencer, Katana. Katana acts as an on-device Starknet, enabling thorough testing of your dojo world in a controlled environment before migrating them to the remote testnet.\n","title":"Local Deployment with Katana","titles":[null]},"5":{"href":"/deployment/locally#easy-katana-deployments","html":"\n

Deploying to Katana is straightforward and efficient.

\n
\n

Pre-requisite: Ensure you've completed the Quick Start guide and have your project set up.

\n
\n

To initiate Katana from your project directory, execute:

\n
katana --disable-fee
\n

This command launches a local instance of Katana, setting the stage for your deployment.

\n","isPage":false,"text":"\nDeploying to Katana is straightforward and efficient.\n\nPre-requisite: Ensure you've completed the Quick Start guide and have your project set up.\n\nTo initiate Katana from your project directory, execute:\nkatana --disable-fee\nThis command launches a local instance of Katana, setting the stage for your deployment.\n","title":"Easy Katana Deployments","titles":[null,"Local Deployment with Katana"]},"6":{"href":"/deployment/locally#step-by-step-guide-to-deploy-on-katana","html":"\n

Deploying your project to Katana involves a few simple steps.\\

\n
    \n
  1. \nCompile Your Contracts:\n

    If you haven't compiled your contracts yet, run:

    \n
    sozo build
    \n

    Compiling ensures that your contracts are ready for deployment.

    \n
  2. \n
  3. \nMigrate your Project:\n

    To migrate, run:

    \n
    sozo migrate
    \n
  4. \n
\n

Success! You have now migrated your world. You will be able to interact with the world using sozo.

","isPage":false,"text":"\nDeploying your project to Katana involves a few simple steps.\\\n\n\nCompile Your Contracts:\nIf you haven't compiled your contracts yet, run:\nsozo build\nCompiling ensures that your contracts are ready for deployment.\n\n\nMigrate your Project:\nTo migrate, run:\nsozo migrate\n\n\nSuccess! You have now migrated your world. You will be able to interact with the world using sozo.","title":"Step-by-Step Guide to Deploy on Katana","titles":[null,"Local Deployment with Katana"]},"7":{"href":"/deployment/remote#deployment-to-remote-network","html":"\n
\n

IMPORTANT: Dojo is unaudited. Use at your own risk.

\n
\n

Dojo makes it easy to deploy to remote networks, you just need to have a valid account and network endpoint.

\n

Scarb.toml

\n
[package]\nname = "ohayoo"\nversion = "0.1.0"\ncairo-version = "0.3.15"\n \n[cairo]\nsierra-replace-ids = true\n \n[dependencies]\ndojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.15" }\n \n# KATANA on slot\n# rpc_url = "https://api.cartridge.gg/x/example/katana"\n# account_address = "0x2d5260ba1d62ed0ea7c598f1460d27528b27afdf3bb43524a1ba3617e8279b2"\n# private_key = "0x6768b97b44cfbfa9f776a3c00ebe33c228058bf8716bb0515a1363049da2a11"\n# world = "0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f"\n \n# ENDPOINT\nrpc_url = "https://api.cartridge.gg/x/shinai/madara"\naccount_address = "0x2"\nprivate_key = "0xc1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d"\nworld_address = "0x5b328933afdbbfd44901fd69a2764a254edbb6e992ae87cf958c70493f2d201"\n \n# GOERLI\n# rpc_url = "https://starknet-goerli.g.alchemy.com/v2/<API KEY>"\n# account_address = "0x2d5260ba1d62ed0ea7c598f1460d27528b27afdf3bb43524a1ba3617e8279b2"\n# private_key = "0x6768b97b44cfbfa9f776a3c00ebe33c228058bf8716bb0515a1363049da2a11"\n# world = "0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f"
\n","isPage":true,"text":"\n\nIMPORTANT: Dojo is unaudited. Use at your own risk.\n\nDojo makes it easy to deploy to remote networks, you just need to have a valid account and network endpoint.\nScarb.toml\n[package]\nname = "ohayoo"\nversion = "0.1.0"\ncairo-version = "0.3.15"\n \n[cairo]\nsierra-replace-ids = true\n \n[dependencies]\ndojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.15" }\n \n# KATANA on slot\n# rpc_url = "https://api.cartridge.gg/x/example/katana"\n# account_address = "0x2d5260ba1d62ed0ea7c598f1460d27528b27afdf3bb43524a1ba3617e8279b2"\n# private_key = "0x6768b97b44cfbfa9f776a3c00ebe33c228058bf8716bb0515a1363049da2a11"\n# world = "0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f"\n \n# ENDPOINT\nrpc_url = "https://api.cartridge.gg/x/shinai/madara"\naccount_address = "0x2"\nprivate_key = "0xc1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d"\nworld_address = "0x5b328933afdbbfd44901fd69a2764a254edbb6e992ae87cf958c70493f2d201"\n \n# GOERLI\n# rpc_url = "https://starknet-goerli.g.alchemy.com/v2/<API KEY>"\n# account_address = "0x2d5260ba1d62ed0ea7c598f1460d27528b27afdf3bb43524a1ba3617e8279b2"\n# private_key = "0x6768b97b44cfbfa9f776a3c00ebe33c228058bf8716bb0515a1363049da2a11"\n# world = "0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f"\n","title":"Deployment to Remote Network","titles":[null]},"8":{"href":"/deployment/remote#deploy-to-public-starknet","html":"\n

If you credentials are correct in the Scarb.toml then a simple migrate will deploy the world to Starknet.

\n","isPage":false,"text":"\nIf you credentials are correct in the Scarb.toml then a simple migrate will deploy the world to Starknet.\n","title":"Deploy to public Starknet","titles":[null,"Deployment to Remote Network"]},"9":{"href":"/deployment/remote#deploy-to-remote-katana","html":"\n

Katanas are able to be hosted and run as remote testnets, however this is not recommended for production use.

\n

Deploy to remote katana with slot here

\n","isPage":false,"text":"\nKatanas are able to be hosted and run as remote testnets, however this is not recommended for production use.\nDeploy to remote katana with slot here\n","title":"Deploy to Remote","titles":[null,"Deployment to Remote Network"]},"10":{"href":"/deployment/remote#deploy-to-remote-madara","html":"\n

Madara is a blazingly fast Starknet sequencer.

","isPage":false,"text":"\nMadara is a blazingly fast Starknet sequencer.","title":"Deploy to Remote Madara","titles":[null,"Deployment to Remote Network"]},"11":{"href":"/cairo/authorization#authorization","html":"\n
\n

Authorization is crucial to a world, just like how authorization is crucial to any smart contract.

\n
\n

As discussed in the World chapter, Autonomous Worlds (AWs) function as sovereign chains nested within a public blockchain. These Worlds are also open to the public. This structure allows anyone to enhance a World by deploying models or systems. However, this openness also introduces security considerations. Similar to Ethereum, interacting with a model's state within a System requires the appropriate authorization from the model owner.

\n","isPage":true,"text":"\n\nAuthorization is crucial to a world, just like how authorization is crucial to any smart contract.\n\nAs discussed in the World chapter, Autonomous Worlds (AWs) function as sovereign chains nested within a public blockchain. These Worlds are also open to the public. This structure allows anyone to enhance a World by deploying models or systems. However, this openness also introduces security considerations. Similar to Ethereum, interacting with a model's state within a System requires the appropriate authorization from the model owner.\n","title":"Authorization","titles":[null]},"12":{"href":"/cairo/authorization#auth-architecture","html":"\n

Every time a set! is called in a System, the world checks if the System has authorization to update the model state. Only when the System possesses the necessary authorization, the set! is executed. The following diagram illustrates the authorization architecture.

\n

\"Authorization

\n","isPage":false,"text":"\nEvery time a set! is called in a System, the world checks if the System has authorization to update the model state. Only when the System possesses the necessary authorization, the set! is executed. The following diagram illustrates the authorization architecture.\n\n","title":"Auth Architecture","titles":[null,"Authorization"]},"13":{"href":"/cairo/authorization#providing-authorization","html":"\n
\n

The deployer of the model is its initial owner. A model owner is able to grant the owner and writer roles. Only owners can grant a System the writer role which allows it to update the model.

\n
\n

sozo offers a convenient tool to authorize systems.

\n
sozo auth writer Moves spawn
\n

This command will generate a writer authorization for the spawn system to update the Moves model.

","isPage":false,"text":"\n\nThe deployer of the model is its initial owner. A model owner is able to grant the owner and writer roles. Only owners can grant a System the writer role which allows it to update the model.\n\nsozo offers a convenient tool to authorize systems.\nsozo auth writer Moves spawn\nThis command will generate a writer authorization for the spawn system to update the Moves model.","title":"Providing Authorization","titles":[null,"Authorization"]},"14":{"href":"/cairo/commands#commands","html":"\nTL;DR\n\n

Understanding commands is key to understanding Dojo. You will leverage them heavily within the systems you design.

\n

Commands in Dojo are generalized functions that are expanded at compile time to facilitate system execution. They provide a convenient way for systems to interact with the world state by abstracting common operations, such as retrieving or updating models, and generating unique IDs. By leveraging these commands, developers can streamline their system implementations and improve code readability.

\n","isPage":true,"text":"\nTL;DR\n\nCommands are shorthand ways to write function calls\nCommands abstract complex queries into shorthands\nCommands are similar to rust macros\n\nUnderstanding commands is key to understanding Dojo. You will leverage them heavily within the systems you design.\nCommands in Dojo are generalized functions that are expanded at compile time to facilitate system execution. They provide a convenient way for systems to interact with the world state by abstracting common operations, such as retrieving or updating models, and generating unique IDs. By leveraging these commands, developers can streamline their system implementations and improve code readability.\n","title":"Commands","titles":[null]},"15":{"href":"/cairo/commands#using-commands","html":"\n

Commands are used within systems to interact with the world state. They are called using the following syntax:

\n","isPage":false,"text":"\nCommands are used within systems to interact with the world state. They are called using the following syntax:\n","title":"Using commands","titles":[null,"Commands"]},"16":{"href":"/cairo/commands#the-get-command","html":"\n

The get! command is used to retrieve models from the world state:

\n
// world = calling world\n// caller = key of the entity that called the system\n// (Position, Moves) = tuple of models to retrieve\nlet (position, moves) = get!(world, caller, (Position, Moves));
\n

Here we are retrieving the Position and Moves models from the world state. We are also using the caller to retrieve the models for the current entity.

\n

You can then use position and moves as you would as any other Cairo struct.

\n

In the case that your model defines several keys as the resource example, you must provide a value for each key.

\n
let player = get_caller_address();\nlet location = 0x1234;\n \nlet resource = get!(world, (player, location), (Resource));
\n

If you use the get! command on a model that has never been set before, all the fields that are not #[key] are equal to 0 in the returned model, which is the default value in the storage.

\n","isPage":false,"text":"\nThe get! command is used to retrieve models from the world state:\n// world = calling world\n// caller = key of the entity that called the system\n// (Position, Moves) = tuple of models to retrieve\nlet (position, moves) = get!(world, caller, (Position, Moves));\nHere we are retrieving the Position and Moves models from the world state. We are also using the caller to retrieve the models for the current entity.\nYou can then use position and moves as you would as any other Cairo struct.\nIn the case that your model defines several keys as the resource example, you must provide a value for each key.\nlet player = get_caller_address();\nlet location = 0x1234;\n \nlet resource = get!(world, (player, location), (Resource));\nIf you use the get! command on a model that has never been set before, all the fields that are not #[key] are equal to 0 in the returned model, which is the default value in the storage.\n","title":"The get! command","titles":[null,"Commands"]},"17":{"href":"/cairo/commands#the-set-command","html":"\n

The set! command is used to update models state.

\n
set !(world, (\n    Moves {\n        player: caller, remaining: 10\n    },\n    Position {\n        player: caller, x: position.x + 10, y: position.y + 10\n    },\n));\n \n// If the structs are already defined it can also be written as:\nset!(world, (moves, position));
\n

Here we are updating the Moves and Position models in the world state using the caller as the entity id.

\n","isPage":false,"text":"\nThe set! command is used to update models state.\nset !(world, (\n Moves {\n player: caller, remaining: 10\n },\n Position {\n player: caller, x: position.x + 10, y: position.y + 10\n },\n));\n \n// If the structs are already defined it can also be written as:\nset!(world, (moves, position));\nHere we are updating the Moves and Position models in the world state using the caller as the entity id.\n","title":"The set! command","titles":[null,"Commands"]},"18":{"href":"/cairo/commands#the-emit-command","html":"\n

The emit! command is used to emit custom events. These events are indexed by Torii.

\n
emit!(world, Moved { address: caller, direction });
\n

This will emit these values which could be captured by a client or you could query these via Torii.

\n","isPage":false,"text":"\nThe emit! command is used to emit custom events. These events are indexed by Torii.\nemit!(world, Moved { address: caller, direction });\nThis will emit these values which could be captured by a client or you could query these via Torii.\n","title":"The emit! command","titles":[null,"Commands"]},"19":{"href":"/cairo/commands#the-delete-command","html":"\n

The delete! command deletes a model from the db.

\n
delete!(world, Moved { address: caller, direction });
","isPage":false,"text":"\nThe delete! command deletes a model from the db.\ndelete!(world, Moved { address: caller, direction });","title":"The delete! command","titles":[null,"Commands"]},"20":{"href":"/cairo/config#config","html":"\n

Dojo worlds are defined in their Scarb.toml files. This is just a regular Scarb file which is an excellent Cairo package manager and project manager.

\n

Full example of a Scarb.toml file:

\n
[package]\ncairo-version = "2.4.0"\nname = "dojo_examples"\nversion = "0.4.0"\n \n[cairo]\nsierra-replace-ids = true\n \n[dependencies]\n# IMPORTANT: Dojo should be pinned to a specific version or else your world might not compile.\ndojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.1" }\n \n[[target.dojo]]\n \n[tool.dojo]\ninitializer_class_hash = "0xbeef"\n \n[tool.dojo.env]\nrpc_url = "http://localhost:5050/"\n# Default account for katana with seed = 0\naccount_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\nprivate_key = "0x1800000000300000180000000000030000000000003006001800006600"
","isPage":true,"text":"\nDojo worlds are defined in their Scarb.toml files. This is just a regular Scarb file which is an excellent Cairo package manager and project manager.\nFull example of a Scarb.toml file:\n[package]\ncairo-version = "2.4.0"\nname = "dojo_examples"\nversion = "0.4.0"\n \n[cairo]\nsierra-replace-ids = true\n \n[dependencies]\n# IMPORTANT: Dojo should be pinned to a specific version or else your world might not compile.\ndojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.1" }\n \n[[target.dojo]]\n \n[tool.dojo]\ninitializer_class_hash = "0xbeef"\n \n[tool.dojo.env]\nrpc_url = "http://localhost:5050/"\n# Default account for katana with seed = 0\naccount_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\nprivate_key = "0x1800000000300000180000000000030000000000003006001800006600"","title":"Config","titles":[]},"21":{"href":"/cairo/entities#entities","html":"\n
\n

Entities are the primary key value within the world, to which models can be attached.

\n
\n

Different ECS systems handle entities in various ways. In Dojo, entities are treated as a primary key value within the world, to which models can be attached. To illustrate this concept, consider a simple example of a character in a game that has a Moves and a Position model.

\n

When defining the models for this entity, it is important to note that we do not reference the entity directly. Instead, we simply provide two structs that the entity will contain.

\n
#[derive(Models, Drop, Serde)]\nstruct Moves {\n    #[key]\n    player: ContractAddress,\n    remaining: u8,\n}\n \n#[derive(Models, Drop, Serde)]\nstruct Health {\n    #[key]\n    player: ContractAddress,\n    x: u32,\n    y: u32\n}
\n
\n

ECS Theory: Plenty has been written on ECS systems, to go deeper read ECS-FAQ

\n
","isPage":true,"text":"\n\nEntities are the primary key value within the world, to which models can be attached.\n\nDifferent ECS systems handle entities in various ways. In Dojo, entities are treated as a primary key value within the world, to which models can be attached. To illustrate this concept, consider a simple example of a character in a game that has a Moves and a Position model.\nWhen defining the models for this entity, it is important to note that we do not reference the entity directly. Instead, we simply provide two structs that the entity will contain.\n#[derive(Models, Drop, Serde)]\nstruct Moves {\n #[key]\n player: ContractAddress,\n remaining: u8,\n}\n \n#[derive(Models, Drop, Serde)]\nstruct Health {\n #[key]\n player: ContractAddress,\n x: u32,\n y: u32\n}\n\nECS Theory: Plenty has been written on ECS systems, to go deeper read ECS-FAQ\n","title":"Entities","titles":[null]},"22":{"href":"/cairo/enum#enum","html":"\n

Enums are very useful in game design, as they simplify the creation of clean, complex logic.

\n

You can define an enum as follows:

\n
 \n// This enum simply defines the states of a game.\n#[derive(Serde, Copy, Drop, Introspect, PartialEq, Print)]\nenum GameStatus {\n    NotStarted: (),\n    Lobby: (),\n    InProgress: (),\n    Finished: (),\n}\n \n// We define an into trait\nimpl GameStatusFelt252 of Into<GameStatus, felt252> {\n    fn into(self: GameStatus) -> felt252 {\n        match self {\n            GameStatus::NotStarted => 0,\n            GameStatus::Lobby => 1,\n            GameStatus::InProgress => 2,\n            GameStatus::Finished => 3,\n        }\n    }\n}
\n

Then within a trait you can create something like this:

\n
#[derive(Model, Copy, Drop, Serde)]\nstruct Game {\n    #[key]\n    game_id: u32,\n    status: GameStatus,\n}\n \n#[generate_trait]\nimpl GameImpl of GameTrait {\n    fn assert_in_progress(self: Game) {\n        assert(self.status == GameStatus::InProgress, "Game not started");\n    }\n    fn assert_lobby(self: Game) {\n        assert(self.status == GameStatus::Lobby, "Game not in lobby");\n    }\n    fn assert_not_started(self: Game) {\n        assert(self.status == GameStatus::NotStarted, "Game already started");\n    }\n}
\n
\n

Read more about Cairo enums here

\n
","isPage":true,"text":"\nEnums are very useful in game design, as they simplify the creation of clean, complex logic.\nYou can define an enum as follows:\n \n// This enum simply defines the states of a game.\n#[derive(Serde, Copy, Drop, Introspect, PartialEq, Print)]\nenum GameStatus {\n NotStarted: (),\n Lobby: (),\n InProgress: (),\n Finished: (),\n}\n \n// We define an into trait\nimpl GameStatusFelt252 of Into<GameStatus, felt252> {\n fn into(self: GameStatus) -> felt252 {\n match self {\n GameStatus::NotStarted => 0,\n GameStatus::Lobby => 1,\n GameStatus::InProgress => 2,\n GameStatus::Finished => 3,\n }\n }\n}\nThen within a trait you can create something like this:\n#[derive(Model, Copy, Drop, Serde)]\nstruct Game {\n #[key]\n game_id: u32,\n status: GameStatus,\n}\n \n#[generate_trait]\nimpl GameImpl of GameTrait {\n fn assert_in_progress(self: Game) {\n assert(self.status == GameStatus::InProgress, "Game not started");\n }\n fn assert_lobby(self: Game) {\n assert(self.status == GameStatus::Lobby, "Game not in lobby");\n }\n fn assert_not_started(self: Game) {\n assert(self.status == GameStatus::NotStarted, "Game already started");\n }\n}\n\nRead more about Cairo enums here\n","title":"Enum","titles":[null]},"23":{"href":"/cairo/events#events","html":"\n

Events play a pivotal role in decoding the dynamics of a Dojo world. Every time there's an update to a Model, the World contract emits these events. What's even more exciting is that you can craft your own custom events to fit specific needs! Moreover, thanks to Torii, all these events are seamlessly indexed, ensuring easy and efficient querying.

\n","isPage":true,"text":"\nEvents play a pivotal role in decoding the dynamics of a Dojo world. Every time there's an update to a Model, the World contract emits these events. What's even more exciting is that you can craft your own custom events to fit specific needs! Moreover, thanks to Torii, all these events are seamlessly indexed, ensuring easy and efficient querying.\n","title":"Events","titles":[null]},"24":{"href":"/cairo/events#model-events","html":"\n

Consider this example of a Moves model:

\n
struct Moves {\n    #[key]\n    player: Address,\n    remaining: u32,\n}
\n

When this model is updated, the World contract will emit an event with the following structure:

\n
#[derive(Drop, starknet::Event)]\nstruct StoreSetRecord {\n    table: felt252, // Moves\n    keys: Span<felt252>, // [player]\n    offset: u8, // offset for the value in the table\n    value: Span<felt252>, // [remaining]\n}
\n

This will then be captured by Torii and indexed for querying. This will allow you to then reconstruct the state of your world.

\n

Similarly, when a model is deleted, the World contract will emit an event with the following structure:

\n
#[derive(Drop, starknet::Event)]\nstruct StoreDelRecord {\n    table: felt252,\n    keys: Span<felt252>,\n}
\n","isPage":false,"text":"\nConsider this example of a Moves model:\nstruct Moves {\n #[key]\n player: Address,\n remaining: u32,\n}\nWhen this model is updated, the World contract will emit an event with the following structure:\n#[derive(Drop, starknet::Event)]\nstruct StoreSetRecord {\n table: felt252, // Moves\n keys: Span<felt252>, // [player]\n offset: u8, // offset for the value in the table\n value: Span<felt252>, // [remaining]\n}\nThis will then be captured by Torii and indexed for querying. This will allow you to then reconstruct the state of your world.\nSimilarly, when a model is deleted, the World contract will emit an event with the following structure:\n#[derive(Drop, starknet::Event)]\nstruct StoreDelRecord {\n table: felt252,\n keys: Span<felt252>,\n}\n","title":"Model Events","titles":[null,"Events"]},"25":{"href":"/cairo/events#world-events","html":"\n

The World contract also emits events when it's initialized and when new models and contracts are registered. These events are emitted with the following structures:

\n
#[derive(Drop, starknet::Event)]\nstruct WorldSpawned {\n    address: ContractAddress,\n    caller: ContractAddress\n}
\n
#[derive(Drop, starknet::Event)]\nstruct ModelRegistered {\n    name: felt252,\n    class_hash: ClassHash,\n    prev_class_hash: ClassHash\n}
\n
#[derive(Drop, starknet::Event)]\nstruct ContractDeployed {\n    salt: felt252,\n    class_hash: ClassHash,\n    address: ContractAddress,\n}\n \n#[derive(Drop, starknet::Event)]\nstruct ContractUpgraded {\n    class_hash: ClassHash,\n    address: ContractAddress,\n}
\n

These events are also captured by Torii and indexed for querying.

\n","isPage":false,"text":"\nThe World contract also emits events when it's initialized and when new models and contracts are registered. These events are emitted with the following structures:\n#[derive(Drop, starknet::Event)]\nstruct WorldSpawned {\n address: ContractAddress,\n caller: ContractAddress\n}\n#[derive(Drop, starknet::Event)]\nstruct ModelRegistered {\n name: felt252,\n class_hash: ClassHash,\n prev_class_hash: ClassHash\n}\n#[derive(Drop, starknet::Event)]\nstruct ContractDeployed {\n salt: felt252,\n class_hash: ClassHash,\n address: ContractAddress,\n}\n \n#[derive(Drop, starknet::Event)]\nstruct ContractUpgraded {\n class_hash: ClassHash,\n address: ContractAddress,\n}\nThese events are also captured by Torii and indexed for querying.\n","title":"World Events","titles":[null,"Events"]},"26":{"href":"/cairo/events#custom-events","html":"\n

Within your game, emitting custom events can be highly beneficial. Fortunately, there's a handy emit! command that lets you release events directly from your world. These events are indexed by Torii.

\n

Use it like so:

\n
emit!(world, Moved { address, direction });
\n

Include this in your contract and it will emit an event with the following structure:

\n
#[derive(Drop, starknet::Event)]\nstruct Moved {\n    address: felt252,\n    direction: felt252,\n}
\n

Now a full example using a custom event:

\n
fn move(ctx: Context, direction: Direction) {\n    let (mut position, mut moves) = get !(world, caller, (Position, Moves));\n    moves.remaining -= 1;\n \n    let next = next_position(position, direction);\n    set !(world, (moves, next));\n    emit !(world, Moved { address: caller, direction });\n}
\n
\n

Note: Read about the get! and set! macros in Commands.

\n
","isPage":false,"text":"\nWithin your game, emitting custom events can be highly beneficial. Fortunately, there's a handy emit! command that lets you release events directly from your world. These events are indexed by Torii.\nUse it like so:\nemit!(world, Moved { address, direction });\nInclude this in your contract and it will emit an event with the following structure:\n#[derive(Drop, starknet::Event)]\nstruct Moved {\n address: felt252,\n direction: felt252,\n}\nNow a full example using a custom event:\nfn move(ctx: Context, direction: Direction) {\n let (mut position, mut moves) = get !(world, caller, (Position, Moves));\n moves.remaining -= 1;\n \n let next = next_position(position, direction);\n set !(world, (moves, next));\n emit !(world, Moved { address: caller, direction });\n}\n\nNote: Read about the get! and set! macros in Commands.\n","title":"Custom Events","titles":[null,"Events"]},"27":{"href":"/cairo/hello-dojo#hello-dojo","html":"\n
\n

This section assumes that you have already installed the Dojo toolchain and are familiar with Cairo. If not, please refer to the Getting Started section.

\n
\n","isPage":true,"text":"\n\nThis section assumes that you have already installed the Dojo toolchain and are familiar with Cairo. If not, please refer to the Getting Started section.\n\n","title":"Hello Dojo","titles":[]},"28":{"href":"/cairo/hello-dojo#dojo-as-an-ecs-in-15-minutes","html":"\n

Although Dojo isn't exclusively an Entity Component System (ECS) framework, we recommend adopting this robust design pattern. In this context, systems shape the environment's logic, while components (models) mirror the state of the world. By taking this route, you'll benefit from a structured and modular framework that promises both flexibility and scalability in a continuously evolving world. If this seems a bit intricate at first, hang tight; we'll delve into the details shortly.

\n

To start, let's set up a project to run locally on your machine. From an empty directory, execute:

\n
sozo init
\n

Congratulations! You now have a local Dojo project. This command creates a dojo-starter project in your current directory. It's the ideal starting point for a new project and equips you with everything you need to begin.

\n","isPage":false,"text":"\nAlthough Dojo isn't exclusively an Entity Component System (ECS) framework, we recommend adopting this robust design pattern. In this context, systems shape the environment's logic, while components (models) mirror the state of the world. By taking this route, you'll benefit from a structured and modular framework that promises both flexibility and scalability in a continuously evolving world. If this seems a bit intricate at first, hang tight; we'll delve into the details shortly.\nTo start, let's set up a project to run locally on your machine. From an empty directory, execute:\nsozo init\nCongratulations! You now have a local Dojo project. This command creates a dojo-starter project in your current directory. It's the ideal starting point for a new project and equips you with everything you need to begin.\n","title":"Dojo as an ECS in 15 Minutes","titles":["Hello Dojo"]},"29":{"href":"/cairo/hello-dojo#anatomy-of-a-dojo-project","html":"\n

Inspect the contents of the dojo-starter project, and you'll notice the following structure (excluding the non-Cairo files):

\n
src\n  - lib.cairo\n    - systems.cairo\n      - actions.cairo\n    - models.cairo\n      - position.cairo\n      - moves.cairo\n    - tests.cairo\n      - test_world.cairo\nScarb.toml
\n

Dojo projects bear a strong resemblance to typical Cairo projects. The primary difference is the inclusion of a special attribute tag used to define your data models. In this context, we'll refer to these models as components.

\n

As we're crafting an ECS, we'll adhere to the specific terminology associated with Entity Component Systems.

\n

Open the src/models/moves.cairo file to continue.

\n
#[derive(Model, Drop, Serde)]\nstruct Moves {\n    #[key]\n    player: ContractAddress,\n    remaining: u8,\n    last_direction: Direction\n}\n...rest of code
\n

Notice the #[derive(Model, Drop, Serde)] attributes. For a model to be recognized, we must include Model. This signals to the Dojo compiler that this struct should be treated as a model.

\n

Our Moves model houses a player field. At the same time, we have the #[key] attribute, it informs Dojo that this model is indexed by the player field. If this is unfamiliar to you, we'll clarify its importance later in the chapter. Essentially, it implies that you can query this model using the player field. Our Moves model also contains the remaining and last_direction fields

\n

Open the src/models/position.cairo file to continue.

\n
#[derive(Model, Copy, Drop, Serde)]\nstruct Position {\n    #[key]\n    player: ContractAddress,\n    vec: Vec2,\n}\n \n#[derive(Copy, Drop, Serde, Introspect)]\nstruct Vec2 {\n    x: u32,\n    y: u32\n}\n...rest of code
\n

In a similar vein, we have a Position model that have a Vec2 data structure. Vec holds x and y values. Once again, this model is indexed by the player field.

\n

Now, let's examine the src/systems/actions.cairo file:

\n
// define the interface\n#[starknet::interface]\ntrait IActions<TContractState> {\n    fn spawn(self: @TContractState);\n    fn move(self: @TContractState, direction: dojo_starter::models::moves::Direction);\n}\n \n// dojo decorator\n#[dojo::contract]\nmod actions {\n    use super::IActions;\n \n    use starknet::{ContractAddress, get_caller_address};\n    use dojo_starter::models::{position::{Position, Vec2}, moves::{Moves, Direction}};\n \n    // declaring custom event struct\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        Moved: Moved,\n    }\n \n    // declaring custom event struct\n    #[derive(Drop, starknet::Event)]\n    struct Moved {\n        player: ContractAddress,\n        direction: Direction\n    }\n \n    // define functions in your contracts like this:\n    fn next_position(mut position: Position, direction: Direction) -> Position {\n        match direction {\n            Direction::None => { return position; },\n            Direction::Left => { position.vec.x -= 1; },\n            Direction::Right => { position.vec.x += 1; },\n            Direction::Up => { position.vec.y -= 1; },\n            Direction::Down => { position.vec.y += 1; },\n        };\n        position\n    }\n \n \n    // impl: implement functions specified in trait\n    #[abi(embed_v0)]\n    impl ActionsImpl of IActions<ContractState> {\n        // ContractState is defined by system decorator expansion\n        fn spawn(self: @ContractState) {\n            // Access the world dispatcher for reading.\n            let world = self.world_dispatcher.read();\n \n            // Get the address of the current caller, possibly the player's address.\n            let player = get_caller_address();\n \n            // Retrieve the player's current position from the world.\n            let position = get!(world, player, (Position));\n \n            // Retrieve the player's move data, e.g., how many moves they have left.\n            let moves = get!(world, player, (Moves));\n \n            // Update the world state with the new data.\n            // 1. Set players moves to 10\n            // 2. Move the player's position 100 units in both the x and y direction.\n            set!(\n                world,\n                (\n                    Moves { player, remaining: 100, last_direction: Direction::None },\n                    Position { player, vec: Vec2 { x: 10, y: 10 } },\n                )\n            );\n        }\n \n        // Implementation of the move function for the ContractState struct.\n        fn move(self: @ContractState, direction: Direction) {\n            // Access the world dispatcher for reading.\n            let world = self.world_dispatcher.read();\n \n            // Get the address of the current caller, possibly the player's address.\n            let player = get_caller_address();\n \n            // Retrieve the player's current position and moves data from the world.\n            let (mut position, mut moves) = get!(world, player, (Position, Moves));\n \n            // Deduct one from the player's remaining moves.\n            moves.remaining -= 1;\n \n            // Update the last direction the player moved in.\n            moves.last_direction = direction;\n \n            // Calculate the player's next position based on the provided direction.\n            let next = next_position(position, direction);\n \n            // Update the world state with the new moves data and position.\n            set!(world, (moves, next));\n \n            // Emit an event to the world to notify about the player's move.\n            emit!(world, Moved { player, direction });\n        }\n    }\n}
\n","isPage":false,"text":"\nInspect the contents of the dojo-starter project, and you'll notice the following structure (excluding the non-Cairo files):\nsrc\n - lib.cairo\n - systems.cairo\n - actions.cairo\n - models.cairo\n - position.cairo\n - moves.cairo\n - tests.cairo\n - test_world.cairo\nScarb.toml\nDojo projects bear a strong resemblance to typical Cairo projects. The primary difference is the inclusion of a special attribute tag used to define your data models. In this context, we'll refer to these models as components.\nAs we're crafting an ECS, we'll adhere to the specific terminology associated with Entity Component Systems.\nOpen the src/models/moves.cairo file to continue.\n#[derive(Model, Drop, Serde)]\nstruct Moves {\n #[key]\n player: ContractAddress,\n remaining: u8,\n last_direction: Direction\n}\n...rest of code\nNotice the #[derive(Model, Drop, Serde)] attributes. For a model to be recognized, we must include Model. This signals to the Dojo compiler that this struct should be treated as a model.\nOur Moves model houses a player field. At the same time, we have the #[key] attribute, it informs Dojo that this model is indexed by the player field. If this is unfamiliar to you, we'll clarify its importance later in the chapter. Essentially, it implies that you can query this model using the player field. Our Moves model also contains the remaining and last_direction fields\nOpen the src/models/position.cairo file to continue.\n#[derive(Model, Copy, Drop, Serde)]\nstruct Position {\n #[key]\n player: ContractAddress,\n vec: Vec2,\n}\n \n#[derive(Copy, Drop, Serde, Introspect)]\nstruct Vec2 {\n x: u32,\n y: u32\n}\n...rest of code\nIn a similar vein, we have a Position model that have a Vec2 data structure. Vec holds x and y values. Once again, this model is indexed by the player field.\nNow, let's examine the src/systems/actions.cairo file:\n// define the interface\n#[starknet::interface]\ntrait IActions<TContractState> {\n fn spawn(self: @TContractState);\n fn move(self: @TContractState, direction: dojo_starter::models::moves::Direction);\n}\n \n// dojo decorator\n#[dojo::contract]\nmod actions {\n use super::IActions;\n \n use starknet::{ContractAddress, get_caller_address};\n use dojo_starter::models::{position::{Position, Vec2}, moves::{Moves, Direction}};\n \n // declaring custom event struct\n #[event]\n #[derive(Drop, starknet::Event)]\n enum Event {\n Moved: Moved,\n }\n \n // declaring custom event struct\n #[derive(Drop, starknet::Event)]\n struct Moved {\n player: ContractAddress,\n direction: Direction\n }\n \n // define functions in your contracts like this:\n fn next_position(mut position: Position, direction: Direction) -> Position {\n match direction {\n Direction::None => { return position; },\n Direction::Left => { position.vec.x -= 1; },\n Direction::Right => { position.vec.x += 1; },\n Direction::Up => { position.vec.y -= 1; },\n Direction::Down => { position.vec.y += 1; },\n };\n position\n }\n \n \n // impl: implement functions specified in trait\n #[abi(embed_v0)]\n impl ActionsImpl of IActions<ContractState> {\n // ContractState is defined by system decorator expansion\n fn spawn(self: @ContractState) {\n // Access the world dispatcher for reading.\n let world = self.world_dispatcher.read();\n \n // Get the address of the current caller, possibly the player's address.\n let player = get_caller_address();\n \n // Retrieve the player's current position from the world.\n let position = get!(world, player, (Position));\n \n // Retrieve the player's move data, e.g., how many moves they have left.\n let moves = get!(world, player, (Moves));\n \n // Update the world state with the new data.\n // 1. Set players moves to 10\n // 2. Move the player's position 100 units in both the x and y direction.\n set!(\n world,\n (\n Moves { player, remaining: 100, last_direction: Direction::None },\n Position { player, vec: Vec2 { x: 10, y: 10 } },\n )\n );\n }\n \n // Implementation of the move function for the ContractState struct.\n fn move(self: @ContractState, direction: Direction) {\n // Access the world dispatcher for reading.\n let world = self.world_dispatcher.read();\n \n // Get the address of the current caller, possibly the player's address.\n let player = get_caller_address();\n \n // Retrieve the player's current position and moves data from the world.\n let (mut position, mut moves) = get!(world, player, (Position, Moves));\n \n // Deduct one from the player's remaining moves.\n moves.remaining -= 1;\n \n // Update the last direction the player moved in.\n moves.last_direction = direction;\n \n // Calculate the player's next position based on the provided direction.\n let next = next_position(position, direction);\n \n // Update the world state with the new moves data and position.\n set!(world, (moves, next));\n \n // Emit an event to the world to notify about the player's move.\n emit!(world, Moved { player, direction });\n }\n }\n}\n","title":"Anatomy of a Dojo Project","titles":["Hello Dojo","Dojo as an ECS in 15 Minutes",null]},"30":{"href":"/cairo/hello-dojo#breaking-it-down","html":"\n","isPage":false,"text":"\n","title":"Breaking it down","titles":["Hello Dojo","Dojo as an ECS in 15 Minutes"]},"31":{"href":"/cairo/hello-dojo#system-is-a-function-in-a-contract","html":"\n

As you can see a System is like a regular function of a dojo(starknet) contract. It imports the Models we defined earlier and exposes two functions spawn and move. These functions are called when a player spawns into the world and when they move respectively.

\n
// Retrieve the player's current position from the world.\nlet position = get!(world, player, (Position));\n \n// Retrieve the player's move data, e.g., how many moves they have left.\nlet moves = get!(world, player, (Moves));
\n

Here we use get! command to retrieve the Position and Moves model for the player entity, which is the address of the caller.

\n

Now the next line:

\n
// Update the world state with the new data.\n// 1. Increase the player's remaining moves by 10.\n// 2. Move the player's position 10 units in both the x and y direction.\nset!(\n    world,\n    (\n        Moves {\n            player, remaining: moves.remaining + 10, last_direction: Direction::None\n        },\n        Position {\n            player, vec: Vec2 { x: position.vec.x + 10, y: position.vec.y + 10}\n        },\n    )\n);
\n

Here we use the set! command to set the Moves and Position models for the player entity.

\n

We covered a lot here in a short time. Let's recap:

\n\n","isPage":false,"text":"\nAs you can see a System is like a regular function of a dojo(starknet) contract. It imports the Models we defined earlier and exposes two functions spawn and move. These functions are called when a player spawns into the world and when they move respectively.\n// Retrieve the player's current position from the world.\nlet position = get!(world, player, (Position));\n \n// Retrieve the player's move data, e.g., how many moves they have left.\nlet moves = get!(world, player, (Moves));\nHere we use get! command to retrieve the Position and Moves model for the player entity, which is the address of the caller.\nNow the next line:\n// Update the world state with the new data.\n// 1. Increase the player's remaining moves by 10.\n// 2. Move the player's position 10 units in both the x and y direction.\nset!(\n world,\n (\n Moves {\n player, remaining: moves.remaining + 10, last_direction: Direction::None\n },\n Position {\n player, vec: Vec2 { x: position.vec.x + 10, y: position.vec.y + 10}\n },\n )\n);\nHere we use the set! command to set the Moves and Position models for the player entity.\nWe covered a lot here in a short time. Let's recap:\n\nExplained the anatomy of a Dojo project\nExplained the importance of the #[derive(Model)]attribute\nExplained the spawn and move functions\nExplained the Moves and Position struct\nTouched on the get! and set! commands\n\n","title":"System is a function in a contract","titles":["Hello Dojo","Dojo as an ECS in 15 Minutes","Breaking it down"]},"32":{"href":"/cairo/hello-dojo#run-it-locally","html":"\n

Now that we've covered some theory, let's build the Dojo project! In your primary terminal:

\n
sozo build
\n

That compiled the models and system into an artifact that can be deployed! Simple as that!

\n

Now, let's deploy it to Katana! First, we need to get Katana running. Open a second terminal and execute:

\n
katana --disable-fee
\n

Success! Katana should now be running locally on your machine. Now, let's deploy! In your primary terminal, execute:

\n
sozo migrate
\n

This will deploy the artifact to Katana. You should see terminal output similar to this:

\n
 \nMigration account: 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973\n \nWorld name: dojo_examples\n \n[1] 🌎 Building World state....\n  > No remote World found\n[2] 🧰 Evaluating Worlds diff....\n  > Total diffs found: 5\n[3] 📦 Preparing for migration....\n  > Total items to be migrated (5): New 5 Update 0\n \n# Executor\n  > Contract address: 0x59f31686991d7cac25a7d4844225b9647c89e3e1e2d03460dbc61e3fbfafc59\n# Base Contract\n  > Class Hash: 0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f\n# World\n  > Contract address: 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138\n# Models (2)\nMoves\n  > Class hash: 0x509a65bd8cc5516176a694a3b3c809011f1f0680959c567b3189e60ddab7ce1\nPosition\n  > Class hash: 0x52a1da1853c194683ca5d6d154452d0654d23f2eacd4267c555ff2338e144d6\n  > Registered at: 0x82d996aab290f086314745685c6f05bd69730d46589339763202de5264b1b6\n# Contracts (1)\nactions\n  > Contract address: 0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd\n \n🎉 Successfully migrated World at address 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138\n \n Updating manifest.json...\n \n Done.\n 
\n

Your 🌎 is now deployed at 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138!

\n

This establishes the world address for your project.

\n

Let's discuss the Scarb.toml file in the project. This file contains environment variables that make running CLI commands in your project a breeze (read more about it here). Make sure your file specifies the version of Dojo you have installed! In this case version 0.4.4.

\n
[dependencies]\ndojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.4" }
\n","isPage":false,"text":"\nNow that we've covered some theory, let's build the Dojo project! In your primary terminal:\nsozo build\nThat compiled the models and system into an artifact that can be deployed! Simple as that!\nNow, let's deploy it to Katana! First, we need to get Katana running. Open a second terminal and execute:\nkatana --disable-fee\nSuccess! Katana should now be running locally on your machine. Now, let's deploy! In your primary terminal, execute:\nsozo migrate\nThis will deploy the artifact to Katana. You should see terminal output similar to this:\n \nMigration account: 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973\n \nWorld name: dojo_examples\n \n[1] 🌎 Building World state....\n > No remote World found\n[2] 🧰 Evaluating Worlds diff....\n > Total diffs found: 5\n[3] 📦 Preparing for migration....\n > Total items to be migrated (5): New 5 Update 0\n \n# Executor\n > Contract address: 0x59f31686991d7cac25a7d4844225b9647c89e3e1e2d03460dbc61e3fbfafc59\n# Base Contract\n > Class Hash: 0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f\n# World\n > Contract address: 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138\n# Models (2)\nMoves\n > Class hash: 0x509a65bd8cc5516176a694a3b3c809011f1f0680959c567b3189e60ddab7ce1\nPosition\n > Class hash: 0x52a1da1853c194683ca5d6d154452d0654d23f2eacd4267c555ff2338e144d6\n > Registered at: 0x82d996aab290f086314745685c6f05bd69730d46589339763202de5264b1b6\n# Contracts (1)\nactions\n > Contract address: 0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd\n \n🎉 Successfully migrated World at address 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138\n \n✨ Updating manifest.json...\n \n✨ Done.\n \nYour 🌎 is now deployed at 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138!\nThis establishes the world address for your project.\nLet's discuss the Scarb.toml file in the project. This file contains environment variables that make running CLI commands in your project a breeze (read more about it here). Make sure your file specifies the version of Dojo you have installed! In this case version 0.4.4.\n[dependencies]\ndojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.4" }\n","title":"Run it locally!","titles":["Hello Dojo","Dojo as an ECS in 15 Minutes"]},"33":{"href":"/cairo/hello-dojo#indexing","html":"\n

With your local world address established, let's delve into indexing. You can index the entire world. To accomplish this we have to copy your world address from the output of sozo migrate. Now Open a new terminal and input this simple command that includes your own world address:

\n
torii --world 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138
\n

Running the command mentioned above starts a Torii server on your local machine. This server uses SQLite as its database and is accessible at http://0.0.0.0:8080/graphql. Torii will automatically organize your data into tables, making it easy for you to perform queries using GraphQL. When you run the command, you'll see terminal output that looks something like this:

\n
2023-10-18T06:49:48.184233Z  INFO torii::server: 🚀 Torii listening at http://0.0.0.0:8080\n2023-10-18T06:49:48.184244Z  INFO torii::server: Graphql playground: http://0.0.0.0:8080/graphql\n \n2023-10-18T06:49:48.185648Z  INFO torii_core::engine: processed block: 0\n2023-10-18T06:49:48.186129Z  INFO torii_core::engine: processed block: 1\n2023-10-18T06:49:48.186720Z  INFO torii_core::engine: processed block: 2\n2023-10-18T06:49:48.187202Z  INFO torii_core::engine: processed block: 3\n2023-10-18T06:49:48.187674Z  INFO torii_core::engine: processed block: 4\n2023-10-18T06:49:48.188215Z  INFO torii_core::engine: processed block: 5\n2023-10-18T06:49:48.188611Z  INFO torii_core::engine: processed block: 6\n2023-10-18T06:49:48.188985Z  INFO torii_core::engine: processed block: 7\n2023-10-18T06:49:48.199592Z  INFO torii_core::processors::register_model: Registered model: Moves\n2023-10-18T06:49:48.210032Z  INFO torii_core::processors::register_model: Registered model: Position\n2023-10-18T06:49:48.210571Z  INFO torii_core::engine: processed block: 8\n2023-10-18T06:49:48.211678Z  INFO torii_core::engine: processed block: 9\n2023-10-18T06:49:48.212335Z  INFO torii_core::engine: processed block: 10\n 
\n

You can observe that our Moves and Position models have been successfully registered.\nNext, let's use the GraphiQL IDE to retrieve data from the Moves model. In your web browser, navigate to http://0.0.0.0:8080/graphql, and enter the following query:

\n
query {\n  model(id: "Moves") {\n    id\n    name\n    classHash\n    transactionHash\n    createdAt\n  }\n}
\n

After you run the query, you will receive an output like this:

\n
{\n  "data": {\n    "model": {\n      "id": "Moves",\n      "name": "Moves",\n      "classHash": "0x64495ca6dc1dc328972697b30468cea364bcb7452bbb6e4aaad3e4b3f190147",\n      "transactionHash": "",\n      "createdAt": "2023-12-15 18:07:22"\n    }\n  }\n}
\n

Awesome, now let's work with subscriptions to get real-time updates. Let's clean up your workspace on the GraphiQL IDE and input the following subscription:

\n
subscription {\n  entityUpdated {\n    id\n    keys\n    eventId\n    createdAt\n    updatedAt\n  }\n}
\n

Once you execute the subscription, you will receive notifications whenever new entities are updated or created. For now, don't make any changes to it and proceed to create a new entity.

\n

To accomplish this, we have to go back to our primary terminal and check the contracts section.

\n
# Contracts (1)\nactions\n  > Contract address: 0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd
\n

We have to use actions contract address to start to create entities. In your main local terminal, run the following command:

\n
sozo execute 0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd spawn
\n

By running this command, you've activated the spawn system, resulting in the creation of a new entity. This action establishes a local world that you can interact with.

\n

Now, go back to your GraphiQL IDE, and you will notice that you have received the subscription's results, which should look something like this:

\n
{\n  "data": {\n    "entityUpdated": {\n      "id": "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",\n      "keys": [\n        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\n      ],\n      "eventId": "0x000000000000000000000000000000000000000000000000000000000000000e:0x0000:0x0000",\n      "createdAt": "2023-12-15 18:07:22",\n      "updatedAt": "2023-12-15 18:10:56"\n    }\n  }\n}\n--------------------------------------------------------------------------------------------------------\n{\n  "data": {\n    "entityUpdated": {\n      "id": "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",\n      "keys": [\n        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\n      ],\n      "eventId": "0x000000000000000000000000000000000000000000000000000000000000000e:0x0000:0x0001",\n      "createdAt": "2023-12-15 18:07:22",\n      "updatedAt": "2023-12-15 18:10:56"\n    }\n  }\n}
\n

In the GraphiQL IDE, by clicking the DOCS-button on the right, you can open the API documentation. This documentation is auto-generated based on our schema definition and displays all API operations and data types of our schema.. In order to know more about query and subscription, you can jump to GraphQL section.\nWe've covered quite a bit! Here's a recap:

\n\n","isPage":false,"text":"\nWith your local world address established, let's delve into indexing. You can index the entire world. To accomplish this we have to copy your world address from the output of sozo migrate. Now Open a new terminal and input this simple command that includes your own world address:\ntorii --world 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138\nRunning the command mentioned above starts a Torii server on your local machine. This server uses SQLite as its database and is accessible at http://0.0.0.0:8080/graphql. Torii will automatically organize your data into tables, making it easy for you to perform queries using GraphQL. When you run the command, you'll see terminal output that looks something like this:\n2023-10-18T06:49:48.184233Z INFO torii::server: 🚀 Torii listening at http://0.0.0.0:8080\n2023-10-18T06:49:48.184244Z INFO torii::server: Graphql playground: http://0.0.0.0:8080/graphql\n \n2023-10-18T06:49:48.185648Z INFO torii_core::engine: processed block: 0\n2023-10-18T06:49:48.186129Z INFO torii_core::engine: processed block: 1\n2023-10-18T06:49:48.186720Z INFO torii_core::engine: processed block: 2\n2023-10-18T06:49:48.187202Z INFO torii_core::engine: processed block: 3\n2023-10-18T06:49:48.187674Z INFO torii_core::engine: processed block: 4\n2023-10-18T06:49:48.188215Z INFO torii_core::engine: processed block: 5\n2023-10-18T06:49:48.188611Z INFO torii_core::engine: processed block: 6\n2023-10-18T06:49:48.188985Z INFO torii_core::engine: processed block: 7\n2023-10-18T06:49:48.199592Z INFO torii_core::processors::register_model: Registered model: Moves\n2023-10-18T06:49:48.210032Z INFO torii_core::processors::register_model: Registered model: Position\n2023-10-18T06:49:48.210571Z INFO torii_core::engine: processed block: 8\n2023-10-18T06:49:48.211678Z INFO torii_core::engine: processed block: 9\n2023-10-18T06:49:48.212335Z INFO torii_core::engine: processed block: 10\n \nYou can observe that our Moves and Position models have been successfully registered.\nNext, let's use the GraphiQL IDE to retrieve data from the Moves model. In your web browser, navigate to http://0.0.0.0:8080/graphql, and enter the following query:\nquery {\n model(id: "Moves") {\n id\n name\n classHash\n transactionHash\n createdAt\n }\n}\nAfter you run the query, you will receive an output like this:\n{\n "data": {\n "model": {\n "id": "Moves",\n "name": "Moves",\n "classHash": "0x64495ca6dc1dc328972697b30468cea364bcb7452bbb6e4aaad3e4b3f190147",\n "transactionHash": "",\n "createdAt": "2023-12-15 18:07:22"\n }\n }\n}\nAwesome, now let's work with subscriptions to get real-time updates. Let's clean up your workspace on the GraphiQL IDE and input the following subscription:\nsubscription {\n entityUpdated {\n id\n keys\n eventId\n createdAt\n updatedAt\n }\n}\nOnce you execute the subscription, you will receive notifications whenever new entities are updated or created. For now, don't make any changes to it and proceed to create a new entity.\nTo accomplish this, we have to go back to our primary terminal and check the contracts section.\n# Contracts (1)\nactions\n > Contract address: 0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd\nWe have to use actions contract address to start to create entities. In your main local terminal, run the following command:\nsozo execute 0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd spawn\nBy running this command, you've activated the spawn system, resulting in the creation of a new entity. This action establishes a local world that you can interact with.\nNow, go back to your GraphiQL IDE, and you will notice that you have received the subscription's results, which should look something like this:\n{\n "data": {\n "entityUpdated": {\n "id": "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",\n "keys": [\n "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\n ],\n "eventId": "0x000000000000000000000000000000000000000000000000000000000000000e:0x0000:0x0000",\n "createdAt": "2023-12-15 18:07:22",\n "updatedAt": "2023-12-15 18:10:56"\n }\n }\n}\n--------------------------------------------------------------------------------------------------------\n{\n "data": {\n "entityUpdated": {\n "id": "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",\n "keys": [\n "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\n ],\n "eventId": "0x000000000000000000000000000000000000000000000000000000000000000e:0x0000:0x0001",\n "createdAt": "2023-12-15 18:07:22",\n "updatedAt": "2023-12-15 18:10:56"\n }\n }\n}\nIn the GraphiQL IDE, by clicking the DOCS-button on the right, you can open the API documentation. This documentation is auto-generated based on our schema definition and displays all API operations and data types of our schema.. In order to know more about query and subscription, you can jump to GraphQL section.\nWe've covered quite a bit! Here's a recap:\n\nBuilt a Dojo world\nDeployed the project to Katana\nIndexed the world with Torii\nRan the spawn system locally\nInteracted with GraphQL\n\n","title":"Indexing","titles":["Hello Dojo","Dojo as an ECS in 15 Minutes"]},"34":{"href":"/cairo/hello-dojo#next-steps","html":"\n

This overview provides a rapid end-to-end glimpse into Dojo. However, the potential of these worlds is vast! Designed to manage hundreds of systems and components, Dojo is equipped for expansive creativity. So, what will you craft next?

","isPage":false,"text":"\nThis overview provides a rapid end-to-end glimpse into Dojo. However, the potential of these worlds is vast! Designed to manage hundreds of systems and components, Dojo is equipped for expansive creativity. So, what will you craft next?","title":"Next Steps","titles":["Hello Dojo","Dojo as an ECS in 15 Minutes"]},"35":{"href":"/cairo/metadata#metadata","html":"\n

Dojo supports associating offchain metadata with the world contract and other deployed contracts. This can provide additional context about the world, such as it's name, description, social links and other media. Enabling external services to easily index and distribute worlds and experiences built on them.

\n","isPage":true,"text":"\nDojo supports associating offchain metadata with the world contract and other deployed contracts. This can provide additional context about the world, such as it's name, description, social links and other media. Enabling external services to easily index and distribute worlds and experiences built on them.\n","title":"Metadata","titles":[null]},"36":{"href":"/cairo/metadata#world-metadata","html":"\n

During migration, sozo will automatically manage the worlds metadata for you, uploading it to ipfs and setting it in the world contract. It does so by parsing the metadata defined in the projects Scarb.toml.

\n

To set a worlds metadata, create the following section in your Scarb.toml:

\n
[tool.dojo.world]\nname = "example"\ndescription = "example world"\nicon_uri = "file://assets/icon.png"\ncover_uri = "file://assets/cover.png"\nwebsite = "https://dojoengine.org"\nsocials.x = "https://twitter.com/dojostarknet"
\n

The toolchain supports the name, description, icon_uri, cover_uri, website and socials attributes by default. _uri attributes can point to a asset in the repo using the file:// schema or to remote resouces using either ipfs:// or https://. Arbitrary social links can be set by setting a key value on the socials attribute. For example, we could add a socials.github = "...".

\n

During migration, sozo will upload any local assets to ipfs, replace the corresponding uris, upload the metadata json to ipfs, and set the metadata_uri for the world (resource 0).

\n","isPage":false,"text":"\nDuring migration, sozo will automatically manage the worlds metadata for you, uploading it to ipfs and setting it in the world contract. It does so by parsing the metadata defined in the projects Scarb.toml.\nTo set a worlds metadata, create the following section in your Scarb.toml:\n[tool.dojo.world]\nname = "example"\ndescription = "example world"\nicon_uri = "file://assets/icon.png"\ncover_uri = "file://assets/cover.png"\nwebsite = "https://dojoengine.org"\nsocials.x = "https://twitter.com/dojostarknet"\nThe toolchain supports the name, description, icon_uri, cover_uri, website and socials attributes by default. _uri attributes can point to a asset in the repo using the file:// schema or to remote resouces using either ipfs:// or https://. Arbitrary social links can be set by setting a key value on the socials attribute. For example, we could add a socials.github = "...".\nDuring migration, sozo will upload any local assets to ipfs, replace the corresponding uris, upload the metadata json to ipfs, and set the metadata_uri for the world (resource 0).\n","title":"World Metadata","titles":[null,"Metadata"]},"37":{"href":"/cairo/metadata#contract-metadata","html":"\n

It is possible for contract owners to set a metadata_uri for any contract. However, this specification has not yet been defined and it is not supported by the toolchain at this time.

","isPage":false,"text":"\nIt is possible for contract owners to set a metadata_uri for any contract. However, this specification has not yet been defined and it is not supported by the toolchain at this time.","title":"Contract Metadata","titles":[null,"Metadata"]},"38":{"href":"/cairo/migration#migration","html":"\n

0.2.0 -> 0.3.0

\n

0.3.0 -> 0.4.0

","isPage":true,"text":"\n0.2.0 -> 0.3.0\n0.3.0 -> 0.4.0","title":"Migration","titles":[null]},"39":{"href":"/cairo/models#models","html":"\n
\n

Models = Data

\n
\nTL;DR\n\n","isPage":true,"text":"\n\nModels = Data\n\nTL;DR\n\nModels store structured data in your world.\nModels are Cairo structs with additional features.\nModels can implement traits.\nUse the #[derive(Model)] decorator to define them.\nCustom enums and types are supported.\nDefine the primary key using the #[key] attribute.\n\n","title":"Models","titles":[null]},"40":{"href":"/cairo/models#models-are-structs","html":"\n

Models are structs annotated with the #[derive(Model)] attribute. Consider these models as a key-value store, where the #[key] attribute is utilized to define the primary key. While models can contain any number of fields, adhering to best practices in Entity-Component-System (ECS) design involves maintaining small, isolated models.

\n

This approach fosters modularity and composability, enabling you to reuse models across various entity types.

\n
#[derive(Model, Copy, Drop, Serde)]\nstruct Moves {\n    #[key]\n    player: ContractAddress,\n    remaining: u8,\n}
\n","isPage":false,"text":"\nModels are structs annotated with the #[derive(Model)] attribute. Consider these models as a key-value store, where the #[key] attribute is utilized to define the primary key. While models can contain any number of fields, adhering to best practices in Entity-Component-System (ECS) design involves maintaining small, isolated models.\nThis approach fosters modularity and composability, enabling you to reuse models across various entity types.\n#[derive(Model, Copy, Drop, Serde)]\nstruct Moves {\n #[key]\n player: ContractAddress,\n remaining: u8,\n}\n","title":"Models are Structs","titles":[null,"Models"]},"41":{"href":"/cairo/models#the-key-attribute","html":"\n

The #[key] attribute indicates to Dojo that this model is indexed by the player field. A field that is identified as a #[key] is not stored. It is used by the dojo database system to uniquely identify the storage location that contains your model.

\n

You need to define at least one key for each model, as this is how you query the model. However, you can create composite keys by defining multiple fields as keys. If you define multiple keys, they must all be provided to query the model.

\n
#[derive(Model, Copy, Drop, Serde)]\nstruct Resource {\n    #[key]\n    player: ContractAddress,\n    #[key]\n    location: ContractAddress,\n    balance: u8,\n}
\n

In this case you then would set the model with both the player and location fields:

\n
set!(\n    world,\n    (\n        Resource {\n            player: caller,\n            location: 12,\n            balance: 10\n        },\n    )\n);
\n

To retrieve a model with a composite key using the get! command, you must provide a value for each key as follow:

\n
let player = get_caller_address();\nlet location = 0x1234;\n \nlet resource = get!(world, (player, location), (Resource));
\n","isPage":false,"text":"\nThe #[key] attribute indicates to Dojo that this model is indexed by the player field. A field that is identified as a #[key] is not stored. It is used by the dojo database system to uniquely identify the storage location that contains your model.\nYou need to define at least one key for each model, as this is how you query the model. However, you can create composite keys by defining multiple fields as keys. If you define multiple keys, they must all be provided to query the model.\n#[derive(Model, Copy, Drop, Serde)]\nstruct Resource {\n #[key]\n player: ContractAddress,\n #[key]\n location: ContractAddress,\n balance: u8,\n}\nIn this case you then would set the model with both the player and location fields:\nset!(\n world,\n (\n Resource {\n player: caller,\n location: 12,\n balance: 10\n },\n )\n);\nTo retrieve a model with a composite key using the get! command, you must provide a value for each key as follow:\nlet player = get_caller_address();\nlet location = 0x1234;\n \nlet resource = get!(world, (player, location), (Resource));\n","title":"The #[key] attribute","titles":[null,"Models","Models are Structs"]},"42":{"href":"/cairo/models#implementing-traits","html":"\n

Models can implement traits. This is useful for defining common functionality across models. For example, you may want to define a Position model that implements a PositionTrait trait. This trait could define functions such as is_zero and is_equal which could be used when accessing the model.

\n
trait PositionTrait {\n    fn is_zero(self: Position) -> bool;\n    fn is_equal(self: Position, b: Position) -> bool;\n}\n \nimpl PositionImpl of PositionTrait {\n    fn is_zero(self: Position) -> bool {\n        if self.x - self.y == 0 {\n            return true;\n        }\n        false\n    }\n \n    fn is_equal(self: Position, b: Position) -> bool {\n        self.x == b.x && self.y == b.y\n    }\n}
\n","isPage":false,"text":"\nModels can implement traits. This is useful for defining common functionality across models. For example, you may want to define a Position model that implements a PositionTrait trait. This trait could define functions such as is_zero and is_equal which could be used when accessing the model.\ntrait PositionTrait {\n fn is_zero(self: Position) -> bool;\n fn is_equal(self: Position, b: Position) -> bool;\n}\n \nimpl PositionImpl of PositionTrait {\n fn is_zero(self: Position) -> bool {\n if self.x - self.y == 0 {\n return true;\n }\n false\n }\n \n fn is_equal(self: Position, b: Position) -> bool {\n self.x == b.x && self.y == b.y\n }\n}\n","title":"Implementing Traits","titles":[null,"Models","Models are Structs"]},"43":{"href":"/cairo/models#custom-setting-models","html":"\n

Suppose we need a place to keep a global value with the flexibility to modify it in the future. Take, for instance, a global combat_cool_down parameter that defines the duration required for an entity to be primed for another attack. To achieve this, we can craft a model dedicated to storing this value, while also allowing for its modification via a decentralized governance model.

\n

To establish these models, you'd follow the usual creation method. However, when initializing them, employ a constant identifier, such as GAME_SETTINGS_ID.

\n
const GAME_SETTINGS_ID: u32 = 9999999999999;\n \n#[derive(model, Copy, Drop, Serde)]\nstruct GameSettings {\n    #[key]\n    game_settings_id: u32,\n    combat_cool_down: u32,\n}
\n","isPage":false,"text":"\nSuppose we need a place to keep a global value with the flexibility to modify it in the future. Take, for instance, a global combat_cool_down parameter that defines the duration required for an entity to be primed for another attack. To achieve this, we can craft a model dedicated to storing this value, while also allowing for its modification via a decentralized governance model.\nTo establish these models, you'd follow the usual creation method. However, when initializing them, employ a constant identifier, such as GAME_SETTINGS_ID.\nconst GAME_SETTINGS_ID: u32 = 9999999999999;\n \n#[derive(model, Copy, Drop, Serde)]\nstruct GameSettings {\n #[key]\n game_settings_id: u32,\n combat_cool_down: u32,\n}\n","title":"Custom Setting models","titles":[null,"Models","Models are Structs"]},"44":{"href":"/cairo/models#types","html":"\n

Support model types:

\n\n

It is currently not possible to use Arrays.

\n","isPage":false,"text":"\nSupport model types:\n\nu8\nu16\nu32\nu64\nu128\nu256\nContractAddress\nEnums\nCustom Types\n\nIt is currently not possible to use Arrays.\n","title":"Types","titles":[null,"Models","Models are Structs"]},"45":{"href":"/cairo/models#custom-types--enums","html":"\n

For models containing complex types, it's crucial to implement the SchemaIntrospection trait.

\n

Consider the model below:

\n
struct Card {\n    #[key]\n    token_id: u256,\n    /// The card's designated role.\n    role: Roles,\n}
\n

For complex types, like Roles in the above example, you need to implement SchemaIntrospection. Here's how:

\n
impl RolesSchemaIntrospectionImpl for SchemaIntrospection<Roles> {\n    #[inline(always)]\n    fn size() -> usize {\n        1 // Represents the byte size of the enum.\n    }\n \n    #[inline(always)]\n    fn layout(ref layout: Array<u8>) {\n        layout.append(8); // Specifies the layout byte size;\n    }\n \n    #[inline(always)]\n    fn ty() -> Ty {\n        Ty::Enum(\n            Enum {\n                name: 'Roles',\n                attrs: array![].span(),\n                children: array![\n                    ('Goalkeeper', serialize_member_type(@Ty::Tuple(array![].span()))),\n                    ('Defender', serialize_member_type(@Ty::Tuple(array![].span()))),\n                    ('Midfielder', serialize_member_type(@Ty::Tuple(array![].span()))),\n                    ('Attacker', serialize_member_type(@Ty::Tuple(array![].span()))),\n                ]\n                .span()\n            }\n        )\n    }\n}
\n","isPage":false,"text":"\nFor models containing complex types, it's crucial to implement the SchemaIntrospection trait.\nConsider the model below:\nstruct Card {\n #[key]\n token_id: u256,\n /// The card's designated role.\n role: Roles,\n}\nFor complex types, like Roles in the above example, you need to implement SchemaIntrospection. Here's how:\nimpl RolesSchemaIntrospectionImpl for SchemaIntrospection<Roles> {\n #[inline(always)]\n fn size() -> usize {\n 1 // Represents the byte size of the enum.\n }\n \n #[inline(always)]\n fn layout(ref layout: Array<u8>) {\n layout.append(8); // Specifies the layout byte size;\n }\n \n #[inline(always)]\n fn ty() -> Ty {\n Ty::Enum(\n Enum {\n name: 'Roles',\n attrs: array![].span(),\n children: array![\n ('Goalkeeper', serialize_member_type(@Ty::Tuple(array![].span()))),\n ('Defender', serialize_member_type(@Ty::Tuple(array![].span()))),\n ('Midfielder', serialize_member_type(@Ty::Tuple(array![].span()))),\n ('Attacker', serialize_member_type(@Ty::Tuple(array![].span()))),\n ]\n .span()\n }\n )\n }\n}\n","title":"Custom Types + Enums","titles":[null,"Models","Models are Structs"]},"46":{"href":"/cairo/models#in-practice-with-modularity-in-mind","html":"\n

Consider a tangible analogy: Humans and Goblins. While they possess intrinsic differences, they share common traits, such as having a position and health. However, humans possess an additional model. Furthermore, we introduce a Counter model, a distinct feature that tallies the numbers of humans and goblins.

\n
#[derive(Model, Copy, Drop, Serde)]\nstruct Potions {\n    #[key]\n    entity_id: u32,\n    quantity: u8,\n}\n \n#[derive(Model, Copy, Drop, Serde)]\nstruct Health {\n    #[key]\n    entity_id: u32,\n    health: u8,\n}\n \n#[derive(Model, Copy, Drop, Serde)]\nstruct Position {\n    #[key]\n    entity_id: u32,\n    x: u32,\n    y: u32\n}\n \n// Special counter model\n#[derive(Model, Copy, Drop, Serde)]\nstruct Counter {\n    #[key]\n    counter: u32,\n    goblin_count: u32,\n    human_count: u32,\n}
\n

So the Human will have a Potions, Health and Position model, and the Goblin will have a Health and Position model. By doing we save having to create Health and Position models for each entity type.

\n

So then a contract would look like this:

\n
#[dojo::contract]\nmod spawnHuman {\n    use array::ArrayTrait;\n    use box::BoxTrait;\n    use traits::Into;\n    use dojo::world::Context;\n \n    use dojo_examples::models::Position;\n    use dojo_examples::models::Health;\n    use dojo_examples::models::Potions;\n    use dojo_examples::models::Counter;\n \n    // we can set the counter value as a const, then query it easily! This pattern is useful for settings.\n    const COUNTER_ID: u32 = 9999999999999;\n \n    // impl: implement functions specified in trait\n    #[abi(embed_v0)]\n    impl GoblinActionsImpl of IGoblinActions<ContractState> {\n        fn goblin_actions(self: @ContractState, entity_id: u32) {\n            let world = self.world_dispatcher.read();\n \n            let counter = get!(world, COUNTER_ID, (Counter));\n \n            let human_count = counter.human_count + 1;\n            let goblin_count = counter.goblin_count + 1;\n \n            // spawn a human\n            set!(\n                world,\n                (\n                    Health {\n                        entity_id: human_count, health: 100\n                        },\n                    Position {\n                        entity_id: human_count, x: position.x + 10, y: position.y + 10,\n                        },\n                    Potions {\n                        entity_id: human_count, quantity: 10\n \n                    },\n                )\n            );\n \n            // spawn a goblin\n            set!(\n                world,\n                (\n                    Health {\n                        entity_id: goblin_count, health: 100\n                        },\n                    Position {\n                        entity_id: goblin_count, x: position.x + 10, y: position.y + 10,\n                        },\n                )\n            );\n \n            // increment the counter\n            set!(\n                world,\n                (\n                    Counter {\n                        counter: COUNTER_ID, human_count: human_count, goblin_count: goblin_count\n                    },\n                )\n            );\n        }\n    }\n}
\n
\n

A complete example can be found in the Dojo Starter

\n
","isPage":false,"text":"\nConsider a tangible analogy: Humans and Goblins. While they possess intrinsic differences, they share common traits, such as having a position and health. However, humans possess an additional model. Furthermore, we introduce a Counter model, a distinct feature that tallies the numbers of humans and goblins.\n#[derive(Model, Copy, Drop, Serde)]\nstruct Potions {\n #[key]\n entity_id: u32,\n quantity: u8,\n}\n \n#[derive(Model, Copy, Drop, Serde)]\nstruct Health {\n #[key]\n entity_id: u32,\n health: u8,\n}\n \n#[derive(Model, Copy, Drop, Serde)]\nstruct Position {\n #[key]\n entity_id: u32,\n x: u32,\n y: u32\n}\n \n// Special counter model\n#[derive(Model, Copy, Drop, Serde)]\nstruct Counter {\n #[key]\n counter: u32,\n goblin_count: u32,\n human_count: u32,\n}\nSo the Human will have a Potions, Health and Position model, and the Goblin will have a Health and Position model. By doing we save having to create Health and Position models for each entity type.\nSo then a contract would look like this:\n#[dojo::contract]\nmod spawnHuman {\n use array::ArrayTrait;\n use box::BoxTrait;\n use traits::Into;\n use dojo::world::Context;\n \n use dojo_examples::models::Position;\n use dojo_examples::models::Health;\n use dojo_examples::models::Potions;\n use dojo_examples::models::Counter;\n \n // we can set the counter value as a const, then query it easily! This pattern is useful for settings.\n const COUNTER_ID: u32 = 9999999999999;\n \n // impl: implement functions specified in trait\n #[abi(embed_v0)]\n impl GoblinActionsImpl of IGoblinActions<ContractState> {\n fn goblin_actions(self: @ContractState, entity_id: u32) {\n let world = self.world_dispatcher.read();\n \n let counter = get!(world, COUNTER_ID, (Counter));\n \n let human_count = counter.human_count + 1;\n let goblin_count = counter.goblin_count + 1;\n \n // spawn a human\n set!(\n world,\n (\n Health {\n entity_id: human_count, health: 100\n },\n Position {\n entity_id: human_count, x: position.x + 10, y: position.y + 10,\n },\n Potions {\n entity_id: human_count, quantity: 10\n \n },\n )\n );\n \n // spawn a goblin\n set!(\n world,\n (\n Health {\n entity_id: goblin_count, health: 100\n },\n Position {\n entity_id: goblin_count, x: position.x + 10, y: position.y + 10,\n },\n )\n );\n \n // increment the counter\n set!(\n world,\n (\n Counter {\n counter: COUNTER_ID, human_count: human_count, goblin_count: goblin_count\n },\n )\n );\n }\n }\n}\n\nA complete example can be found in the Dojo Starter\n","title":"In practice with modularity in mind","titles":[null,"Models"]},"47":{"href":"/cairo/origami#what-is-origami","html":"\n

Origami is the native dojo collection of primitives that can be imported into your game.

\n

It contains:

\n\n

Find the Origami repo

","isPage":true,"text":"\nOrigami is the native dojo collection of primitives that can be imported into your game.\nIt contains:\n\nalgebra\ndefi\nhex map\nrandom\nsecurity\nerc tokens\n\nFind the Origami repo","title":"What is Origami?","titles":[null]},"48":{"href":"/cairo/overview#a-new-approach-to-onchain-game-development","html":"\n

Dojo provides an advanced abstraction layer over Cairo, mirroring React's relationship with JavaScript. Its specialized architecture simplifies game design and development.

\n

By leveraging Dojo, developers can use succinct commands that transform into comprehensive queries at compile time.

\n","isPage":true,"text":"\nDojo provides an advanced abstraction layer over Cairo, mirroring React's relationship with JavaScript. Its specialized architecture simplifies game design and development.\nBy leveraging Dojo, developers can use succinct commands that transform into comprehensive queries at compile time.\n","title":"A New Approach to Onchain Game Development","titles":[null]},"49":{"href":"/cairo/overview#delving-into-the-architecture","html":"\n

Dojo efficiently encapsulates boilerplate contracts within the compiler, letting developers concentrate on the distinct aspects of their game or app.

\n

Consider this as the most basic Dojo world setup:

\n
- src\n  - main.cairo\n  - lib.cairo\n- Scarb.toml
\n

While seemingly simple, behind the scenes Dojo compiler generates foundational contracts, setting the stage for you to focus purely on data and logic.

\n

Lets take a look at the main.cairo:

\n
use starknet::ContractAddress;\n \n// dojo data models\n#[derive(Model, Copy, Drop, Serde)]\nstruct Position {\n    #[key] // primary key\n    player: ContractAddress,\n    vec: Vec2,\n}\n \n// regular cairo struct\n#[derive(Copy, Drop, Serde, Introspect)]\nstruct Vec2 {\n    x: u32,\n    y: u32\n}\n \n// interface\n#[starknet::interface]\ntrait IPlayerActions<TContractState> {\n    fn spawn(self: @TContractState);\n}\n \n// contract\n#[dojo::contract]\nmod player_actions {\n    use starknet::{ContractAddress, get_caller_address};\n    use super::{Position, Vec2};\n    use super::IPlayerActions;\n \n    #[abi(embed_v0)]\n    impl PlayerActionsImpl of IPlayerActions<ContractState> {\n        //\n        // This is how we interact with the world contract.\n        //\n        fn spawn(self: @ContractState) {\n            // Access the world dispatcher for reading.\n            let world = self.world_dispatcher.read();\n \n            // get player address\n            let player = get_caller_address();\n \n            // dojo command - get player position\n            let position = get!(world, player, (Position));\n \n            // dojo command - set player position\n            set!(world, (Position { player, vec: Vec2 { x: 10, y: 10 } }));\n        }\n    }\n}
\n","isPage":false,"text":"\nDojo efficiently encapsulates boilerplate contracts within the compiler, letting developers concentrate on the distinct aspects of their game or app.\nConsider this as the most basic Dojo world setup:\n- src\n - main.cairo\n - lib.cairo\n- Scarb.toml\nWhile seemingly simple, behind the scenes Dojo compiler generates foundational contracts, setting the stage for you to focus purely on data and logic.\nLets take a look at the main.cairo:\nuse starknet::ContractAddress;\n \n// dojo data models\n#[derive(Model, Copy, Drop, Serde)]\nstruct Position {\n #[key] // primary key\n player: ContractAddress,\n vec: Vec2,\n}\n \n// regular cairo struct\n#[derive(Copy, Drop, Serde, Introspect)]\nstruct Vec2 {\n x: u32,\n y: u32\n}\n \n// interface\n#[starknet::interface]\ntrait IPlayerActions<TContractState> {\n fn spawn(self: @TContractState);\n}\n \n// contract\n#[dojo::contract]\nmod player_actions {\n use starknet::{ContractAddress, get_caller_address};\n use super::{Position, Vec2};\n use super::IPlayerActions;\n \n #[abi(embed_v0)]\n impl PlayerActionsImpl of IPlayerActions<ContractState> {\n //\n // This is how we interact with the world contract.\n //\n fn spawn(self: @ContractState) {\n // Access the world dispatcher for reading.\n let world = self.world_dispatcher.read();\n \n // get player address\n let player = get_caller_address();\n \n // dojo command - get player position\n let position = get!(world, player, (Position));\n \n // dojo command - set player position\n set!(world, (Position { player, vec: Vec2 { x: 10, y: 10 } }));\n }\n }\n}\n","title":"Delving into the Architecture","titles":[null,"A New Approach to Onchain Game Development",null]},"50":{"href":"/cairo/overview#breakdown","html":"\n

Dojo contract is just a regular Cairo contract, with some dojo specifics.

\n","isPage":false,"text":"\nDojo contract is just a regular Cairo contract, with some dojo specifics.\n","title":"Breakdown","titles":[null,"A New Approach to Onchain Game Development"]},"51":{"href":"/cairo/overview#position-struct---the-dojo-model","html":"\n

In a Dojo world, state is defined using models. These are structs marked with the #[derive(Model)] attribute, functioning similarly to a key-pair store. The primary key for a model is indicated using the #[key] attribute; for instance, the player field serves as the primary key in this context.

\n

Read more about models here.

\n","isPage":false,"text":"\nIn a Dojo world, state is defined using models. These are structs marked with the #[derive(Model)] attribute, functioning similarly to a key-pair store. The primary key for a model is indicated using the #[key] attribute; for instance, the player field serves as the primary key in this context.\nRead more about models here.\n","title":"Position struct - the dojo model","titles":[null,"A New Approach to Onchain Game Development","Breakdown"]},"52":{"href":"/cairo/overview#spawn-function---a-dojo-system","html":"\n

In the spawn function, we just call self.world_dispatcher. This provides a gateway to the world contract. This facilitates the effortless utilization of the get! and set! commands, allowing seamless interaction with the world contract.

\n

Commands, a significant innovation in Dojo, are further explored here.

","isPage":false,"text":"\nIn the spawn function, we just call self.world_dispatcher. This provides a gateway to the world contract. This facilitates the effortless utilization of the get! and set! commands, allowing seamless interaction with the world contract.\nCommands, a significant innovation in Dojo, are further explored here.","title":"spawn function - a dojo system","titles":[null,"A New Approach to Onchain Game Development","Breakdown"]},"53":{"href":"/cairo/systems#systems","html":"\n
\n

IMPORTANT: Before defining your systems, prioritize permissions. Plan carefully to ensure proper access and security.

\n
\nTL;DR\n\n","isPage":true,"text":"\n\nIMPORTANT: Before defining your systems, prioritize permissions. Plan carefully to ensure proper access and security.\n\nTL;DR\n\nSystems function as contract methods.\nContracts containing Systems gain permissions to write to models.\nSystems pass a world address as their first parameter unless utilizing the #[dojo::contract] decorator.\nSystems engage the world contract to alter models' state.\nThe world contract is invoked through systems.\nSystems ought to be concise and specific.\nIn most scenarios, systems are stateless.\n\n","title":"Systems","titles":[null]},"54":{"href":"/cairo/systems#what-are-systems","html":"\n

Within dojo we define systems as functions within a Dojo Contract that act on the world.

\n

Systems play a pivotal role in your world's logic, directly mutating its component states. It's important to understand that to enact these mutations, a system needs explicit permission from the models owner.

\n","isPage":false,"text":"\nWithin dojo we define systems as functions within a Dojo Contract that act on the world.\nSystems play a pivotal role in your world's logic, directly mutating its component states. It's important to understand that to enact these mutations, a system needs explicit permission from the models owner.\n","title":"What are Systems?","titles":[null,"Systems"]},"55":{"href":"/cairo/systems#system-permissions","html":"\n

Since the whole contract is given write access to the model, it is important to be careful when defining systems. A simple way to think about it is:

\n

\"System

\n","isPage":false,"text":"\nSince the whole contract is given write access to the model, it is important to be careful when defining systems. A simple way to think about it is:\n\n","title":"System Permissions","titles":[null,"Systems"]},"56":{"href":"/cairo/systems#system-structure","html":"\n

Every system function starts with a world address as its initial parameter. This design permits these functions to alter the world's state. Notably, this structure also makes systems adaptable and reusable across multiple worlds!

\n

Let's look at the simplest possible system which mutates the state of the Moves component.

\n
\n

NOTE: This is not using the #[dojo::contract] attribute meaning it was to accept the world as a parameter.

\n
\n
#[starknet::contract]\nmod player_actions {\n    use starknet::{ContractAddress, get_caller_address};\n    use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};\n    use dojo_examples::components::{Position, Moves, Direction, Vec2};\n    use dojo_examples::utils::next_position;\n    use super::IPlayerActions;\n \n    // no storage\n    #[storage]\n    struct Storage {}\n \n    // implementation of the PlayerActions interface\n    #[abi(embed_v0)]\n    impl PlayerActionsImpl of IPlayerActions<ContractState> {\n        fn spawn(self: @ContractState, world: IWorldDispatcher) {\n            let player = get_caller_address();\n            let position = get!(world, player, (Position));\n            set!(\n                world,\n                (\n                    Moves {\n                        player,\n                        remaining: 10,\n                        last_direction: Direction::None(())\n                    }\n                )\n            );\n        }\n    }\n}
\n","isPage":false,"text":"\nEvery system function starts with a world address as its initial parameter. This design permits these functions to alter the world's state. Notably, this structure also makes systems adaptable and reusable across multiple worlds!\nLet's look at the simplest possible system which mutates the state of the Moves component.\n\nNOTE: This is not using the #[dojo::contract] attribute meaning it was to accept the world as a parameter.\n\n#[starknet::contract]\nmod player_actions {\n use starknet::{ContractAddress, get_caller_address};\n use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};\n use dojo_examples::components::{Position, Moves, Direction, Vec2};\n use dojo_examples::utils::next_position;\n use super::IPlayerActions;\n \n // no storage\n #[storage]\n struct Storage {}\n \n // implementation of the PlayerActions interface\n #[abi(embed_v0)]\n impl PlayerActionsImpl of IPlayerActions<ContractState> {\n fn spawn(self: @ContractState, world: IWorldDispatcher) {\n let player = get_caller_address();\n let position = get!(world, player, (Position));\n set!(\n world,\n (\n Moves {\n player,\n remaining: 10,\n last_direction: Direction::None(())\n }\n )\n );\n }\n }\n}\n","title":"System Structure","titles":[null,"Systems"]},"57":{"href":"/cairo/systems#breaking-it-down","html":"\n","isPage":false,"text":"\n","title":"Breaking it down","titles":[null]},"58":{"href":"/cairo/systems#system-is-a-function-in-a-contract","html":"\n

As you can see a System is like a regular function of a Starknet contract. This contract can include storage, and it can implement interfaces.

\n","isPage":false,"text":"\nAs you can see a System is like a regular function of a Starknet contract. This contract can include storage, and it can implement interfaces.\n","title":"System is a function in a contract","titles":[null,"Breaking it down","System Structure"]},"59":{"href":"/cairo/systems#spawn-function","html":"\n

The spawn function is currently the only system that exists in this contract. It is called when a player spawns into the world. It is responsible for setting up the player's initial state.

\n","isPage":false,"text":"\nThe spawn function is currently the only system that exists in this contract. It is called when a player spawns into the world. It is responsible for setting up the player's initial state.\n","title":"Spawn function","titles":[null,"Breaking it down","System Structure"]},"60":{"href":"/cairo/systems#the-dojocontract-decorator","html":"\n

All Starknet contracts are defined using the #[starknet::contract] decorator, ensuring accurate compilation. In this context, Dojo introduces the #[dojo::contract] decorator, which aims to minimize boilerplate in contract writing.

\n

The #[dojo::contract] decorator allows developers to omit including world: IWorldDispatcher as a parameter. Behind the scenes, it injects the world into the contract and eliminates some imports, thereby streamlining the development process.

\n
#[dojo::contract]\nmod player_actions {\n    use starknet::{ContractAddress, get_caller_address};\n    use dojo_examples::models::{Position, Moves, Direction, Vec2};\n    use dojo_examples::utils::next_position;\n    use super::IPlayerActions;\n \n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        Moved: Moved,\n    }\n \n    #[derive(Drop, starknet::Event)]\n    struct Moved {\n        player: ContractAddress,\n        direction: Direction\n    }\n \n    // impl: implement functions specified in trait\n    #[abi(embed_v0)]\n    impl PlayerActionsImpl of IPlayerActions<ContractState> {\n        // ContractState is defined by system decorator expansion\n        fn spawn(self: @ContractState) {\n            // world dispatcher\n            let world = self.world_dispatcher.read();\n \n            // player\n            let player = get_caller_address();\n \n            // get the position\n            let position = get!(world, player, (Position));\n \n            // set the position\n            set!(\n                world,\n                (\n                    Moves { player, remaining: 10, last_direction: Direction::None(()) },\n                    Position { player, vec: Vec2 { x: 10, y: 10 } },\n                )\n            );\n        }\n \n        fn move(self: @ContractState, direction: Direction) {\n            // world dispatcher\n            let world = self.world_dispatcher.read();\n \n            // player\n            let player = get_caller_address();\n \n            // get the position and moves\n            let (mut position, mut moves) = get!(world, player, (Position, Moves));\n \n            // adjust\n            moves.remaining -= 1;\n            moves.last_direction = direction;\n \n            // get next direction\n            let next = next_position(position, direction);\n \n            // set models\n            set!(world, (moves, next));\n \n            // emit custom event\n            emit!(world, Moved { player, direction });\n        }\n    }\n}
\n
\n

To interact with Systems read more in the sozo docs.

\n
","isPage":false,"text":"\nAll Starknet contracts are defined using the #[starknet::contract] decorator, ensuring accurate compilation. In this context, Dojo introduces the #[dojo::contract] decorator, which aims to minimize boilerplate in contract writing.\nThe #[dojo::contract] decorator allows developers to omit including world: IWorldDispatcher as a parameter. Behind the scenes, it injects the world into the contract and eliminates some imports, thereby streamlining the development process.\n#[dojo::contract]\nmod player_actions {\n use starknet::{ContractAddress, get_caller_address};\n use dojo_examples::models::{Position, Moves, Direction, Vec2};\n use dojo_examples::utils::next_position;\n use super::IPlayerActions;\n \n #[event]\n #[derive(Drop, starknet::Event)]\n enum Event {\n Moved: Moved,\n }\n \n #[derive(Drop, starknet::Event)]\n struct Moved {\n player: ContractAddress,\n direction: Direction\n }\n \n // impl: implement functions specified in trait\n #[abi(embed_v0)]\n impl PlayerActionsImpl of IPlayerActions<ContractState> {\n // ContractState is defined by system decorator expansion\n fn spawn(self: @ContractState) {\n // world dispatcher\n let world = self.world_dispatcher.read();\n \n // player\n let player = get_caller_address();\n \n // get the position\n let position = get!(world, player, (Position));\n \n // set the position\n set!(\n world,\n (\n Moves { player, remaining: 10, last_direction: Direction::None(()) },\n Position { player, vec: Vec2 { x: 10, y: 10 } },\n )\n );\n }\n \n fn move(self: @ContractState, direction: Direction) {\n // world dispatcher\n let world = self.world_dispatcher.read();\n \n // player\n let player = get_caller_address();\n \n // get the position and moves\n let (mut position, mut moves) = get!(world, player, (Position, Moves));\n \n // adjust\n moves.remaining -= 1;\n moves.last_direction = direction;\n \n // get next direction\n let next = next_position(position, direction);\n \n // set models\n set!(world, (moves, next));\n \n // emit custom event\n emit!(world, Moved { player, direction });\n }\n }\n}\n\nTo interact with Systems read more in the sozo docs.\n","title":"The #[dojo::contract] Decorator","titles":[null,"Breaking it down"]},"61":{"href":"/cairo/testing#testing","html":"\n

Testing is a crucial part of any software development process. Dojo provides a testing framework that allows you to write tests for your smart contracts. Since Dojo uses a custom compiler, you need to use sozo to test your contracts.

\n

From your project directory, simply:

\n
sozo test
\n

This will search for all tests within your project and run them.

\n","isPage":true,"text":"\nTesting is a crucial part of any software development process. Dojo provides a testing framework that allows you to write tests for your smart contracts. Since Dojo uses a custom compiler, you need to use sozo to test your contracts.\nFrom your project directory, simply:\nsozo test\nThis will search for all tests within your project and run them.\n","title":"Testing","titles":[null]},"62":{"href":"/cairo/testing#writing-unit-tests","html":"\n

It is best practise to include unit tests in the same file as the Model/System you are writing.

\n

Lets show a model test example from the dojo-starter:

\n

models.cairo

\n
 \n...//rest of code\n \n#[cfg(test)]\nmod tests {\n    use super::{Position, Vec2, Vec2Trait};\n \n    #[test]\n    #[available_gas(100000)]\n    fn test_vec_is_zero() {\n        assert(Vec2Trait::is_zero(Vec2 { x: 0, y: 0 }), 'not zero');\n    }\n \n    #[test]\n    #[available_gas(100000)]\n    fn test_vec_is_equal() {\n        let position = Vec2 { x: 420, y: 0 };\n        assert(position.is_equal(Vec2 { x: 420, y: 0 }), 'not equal');\n    }\n}
\n

In this test we are testing the is_zero and is_equal functions of the Position model. It is good practise to test all functions of your models.

\n","isPage":false,"text":"\nIt is best practise to include unit tests in the same file as the Model/System you are writing.\nLets show a model test example from the dojo-starter:\nmodels.cairo\n \n...//rest of code\n \n#[cfg(test)]\nmod tests {\n use super::{Position, Vec2, Vec2Trait};\n \n #[test]\n #[available_gas(100000)]\n fn test_vec_is_zero() {\n assert(Vec2Trait::is_zero(Vec2 { x: 0, y: 0 }), 'not zero');\n }\n \n #[test]\n #[available_gas(100000)]\n fn test_vec_is_equal() {\n let position = Vec2 { x: 420, y: 0 };\n assert(position.is_equal(Vec2 { x: 420, y: 0 }), 'not equal');\n }\n}\nIn this test we are testing the is_zero and is_equal functions of the Position model. It is good practise to test all functions of your models.\n","title":"Writing Unit Tests","titles":[null,"Testing"]},"63":{"href":"/cairo/testing#writing-integration-tests","html":"\n

Integration tests are e2e tests that test the entire system. You can write integration tests for your world by creating a tests directory in your project root. Then create a file for each integration test you want to write.

\n

This is the example from the dojo-starter:

\n

move.cairo

\n
#[cfg(test)]\nmod tests {\n    use dojo::world::{IWorldDispatcherTrait, IWorldDispatcher};\n    use dojo::test_utils::{spawn_test_world, deploy_contract};\n    use dojo_examples::models::{position, moves};\n    use dojo_examples::models::{Position, Moves, Direction};\n \n    use super::{actions, IActionsDispatcher, IActionsDispatcherTrait};\n \n    // helper setup function\n    // reusable function for tests\n    fn setup_world() -> IActionsDispatcher {\n        // components\n        let mut models = array![position::TEST_CLASS_HASH, moves::TEST_CLASS_HASH];\n \n         // deploy world with models\n        let world = spawn_test_world(models);\n \n        // deploy systems contract\n        let contract_address = world\n            .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());\n        let actions_system = IActionsDispatcher { contract_address };\n \n        actions_system\n    }\n \n \n    #[test]\n    #[available_gas(30000000)]\n    fn test_move() {\n        // caller\n        let caller = starknet::contract_address_const::<0x0>();\n \n        let actions_system = setup_world();\n \n         // System calls\n        actions_system.spawn();\n        actions_system.move(Direction::Right(()));\n \n        // check moves\n        let moves = get!(world, caller, (Moves));\n        assert(moves.remaining == 99, 'moves is wrong');\n \n        // get new_position\n        let new_position = get!(world, caller, Position);\n \n        // check new position x\n        assert(new_position.vec.x == 11, 'position x is wrong');\n \n        // check new position y\n        assert(new_position.vec.y == 10, 'position y is wrong');\n    }\n}
\n","isPage":false,"text":"\nIntegration tests are e2e tests that test the entire system. You can write integration tests for your world by creating a tests directory in your project root. Then create a file for each integration test you want to write.\nThis is the example from the dojo-starter:\nmove.cairo\n#[cfg(test)]\nmod tests {\n use dojo::world::{IWorldDispatcherTrait, IWorldDispatcher};\n use dojo::test_utils::{spawn_test_world, deploy_contract};\n use dojo_examples::models::{position, moves};\n use dojo_examples::models::{Position, Moves, Direction};\n \n use super::{actions, IActionsDispatcher, IActionsDispatcherTrait};\n \n // helper setup function\n // reusable function for tests\n fn setup_world() -> IActionsDispatcher {\n // components\n let mut models = array![position::TEST_CLASS_HASH, moves::TEST_CLASS_HASH];\n \n // deploy world with models\n let world = spawn_test_world(models);\n \n // deploy systems contract\n let contract_address = world\n .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());\n let actions_system = IActionsDispatcher { contract_address };\n \n actions_system\n }\n \n \n #[test]\n #[available_gas(30000000)]\n fn test_move() {\n // caller\n let caller = starknet::contract_address_const::<0x0>();\n \n let actions_system = setup_world();\n \n // System calls\n actions_system.spawn();\n actions_system.move(Direction::Right(()));\n \n // check moves\n let moves = get!(world, caller, (Moves));\n assert(moves.remaining == 99, 'moves is wrong');\n \n // get new_position\n let new_position = get!(world, caller, Position);\n \n // check new position x\n assert(new_position.vec.x == 11, 'position x is wrong');\n \n // check new position y\n assert(new_position.vec.y == 10, 'position y is wrong');\n }\n}\n","title":"Writing Integration Tests","titles":[null,"Testing"]},"64":{"href":"/cairo/testing#useful-dojo-test-functions","html":"\n

spawn_test_world(models) - This function will create a test world with the models and systems you pass in. It will also deploy the world and register the models and systems.

","isPage":false,"text":"\nspawn_test_world(models) - This function will create a test world with the models and systems you pass in. It will also deploy the world and register the models and systems.","title":"Useful Dojo Test Functions","titles":[null,"Testing","Writing Integration Tests"]},"65":{"href":"/cairo/world#the-world-contract","html":"\n

The world contract functions as a central store for the world models and systems. Every contract that interacts with the world, must use the world contract address as the first parameter. This is how the world contract is able to manage the state of the world.

\n

Although we suggest strongly to structure your world around an ECS pattern you are not required to do so. You can simply use the dojo-models as a keypair store along with the supporting infrastructure.

\n
\n

NOTE: Dojo core abstracts the world contract away, you do not write it and it is not meant to be altered when building a world. However, it's important to understand how it works and how it interacts with the rest of the system.

\n
\n","isPage":true,"text":"\nThe world contract functions as a central store for the world models and systems. Every contract that interacts with the world, must use the world contract address as the first parameter. This is how the world contract is able to manage the state of the world.\nAlthough we suggest strongly to structure your world around an ECS pattern you are not required to do so. You can simply use the dojo-models as a keypair store along with the supporting infrastructure.\n\nNOTE: Dojo core abstracts the world contract away, you do not write it and it is not meant to be altered when building a world. However, it's important to understand how it works and how it interacts with the rest of the system.\n\n","title":"The World Contract","titles":[null]},"66":{"href":"/cairo/world#events","html":"\n

The world contract emits all model events via the StoreSetRecord event. This enables block explorers to reconstruct everything in the world by listening to one contract.

\n","isPage":false,"text":"\nThe world contract emits all model events via the StoreSetRecord event. This enables block explorers to reconstruct everything in the world by listening to one contract.\n","title":"Events","titles":[null,"The World Contract"]},"67":{"href":"/cairo/world#full-world-api","html":"\n

The world exposes an interface which can be interacted with by any client. It is worth noting here that as a developer you don't deploy this world, it is deployed when you migrate the world.

\n
// World interface\n#[starknet::interface]\ntrait IWorld<T> {\n    fn metadata_uri(self: @T, resource: felt252) -> Span<felt252>;\n    fn set_metadata_uri(ref self: T, resource: felt252, uri: Span<felt252>);\n    fn model(self: @T, name: felt252) -> ClassHash;\n    fn register_model(ref self: T, class_hash: ClassHash);\n    fn deploy_contract(ref self: T, salt: felt252, class_hash: ClassHash) -> ContractAddress;\n    fn upgrade_contract(ref self: T, address: ContractAddress, class_hash: ClassHash) -> ClassHash;\n    fn uuid(ref self: T) -> usize;\n    fn emit(self: @T, keys: Array<felt252>, values: Span<felt252>);\n    fn entity(\n        self: @T, model: felt252, keys: Span<felt252>, offset: u8, length: usize, layout: Span<u8>\n    ) -> Span<felt252>;\n    fn set_entity(\n        ref self: T,\n        model: felt252,\n        keys: Span<felt252>,\n        offset: u8,\n        values: Span<felt252>,\n        layout: Span<u8>\n    );\n    fn entities(\n        self: @T,\n        model: felt252,\n        index: Option<felt252>,\n        values: Span<felt252>,\n        values_length: usize,\n        values_layout: Span<u8>\n    ) -> (Span<felt252>, Span<Span<felt252>>);\n    fn entity_ids(self: @T, model: felt252) -> Span<felt252>;\n    fn set_executor(ref self: T, contract_address: ContractAddress);\n    fn executor(self: @T) -> ContractAddress;\n    fn base(self: @T) -> ClassHash;\n    fn delete_entity(ref self: T, model: felt252, keys: Span<felt252>, layout: Span<u8>);\n    fn is_owner(self: @T, address: ContractAddress, resource: felt252) -> bool;\n    fn grant_owner(ref self: T, address: ContractAddress, resource: felt252);\n    fn revoke_owner(ref self: T, address: ContractAddress, resource: felt252);\n    fn is_writer(self: @T, model: felt252, system: ContractAddress) -> bool;\n    fn grant_writer(ref self: T, model: felt252, system: ContractAddress);\n    fn revoke_writer(ref self: T, model: felt252, system: ContractAddress);\n}
\n","isPage":false,"text":"\nThe world exposes an interface which can be interacted with by any client. It is worth noting here that as a developer you don't deploy this world, it is deployed when you migrate the world.\n// World interface\n#[starknet::interface]\ntrait IWorld<T> {\n fn metadata_uri(self: @T, resource: felt252) -> Span<felt252>;\n fn set_metadata_uri(ref self: T, resource: felt252, uri: Span<felt252>);\n fn model(self: @T, name: felt252) -> ClassHash;\n fn register_model(ref self: T, class_hash: ClassHash);\n fn deploy_contract(ref self: T, salt: felt252, class_hash: ClassHash) -> ContractAddress;\n fn upgrade_contract(ref self: T, address: ContractAddress, class_hash: ClassHash) -> ClassHash;\n fn uuid(ref self: T) -> usize;\n fn emit(self: @T, keys: Array<felt252>, values: Span<felt252>);\n fn entity(\n self: @T, model: felt252, keys: Span<felt252>, offset: u8, length: usize, layout: Span<u8>\n ) -> Span<felt252>;\n fn set_entity(\n ref self: T,\n model: felt252,\n keys: Span<felt252>,\n offset: u8,\n values: Span<felt252>,\n layout: Span<u8>\n );\n fn entities(\n self: @T,\n model: felt252,\n index: Option<felt252>,\n values: Span<felt252>,\n values_length: usize,\n values_layout: Span<u8>\n ) -> (Span<felt252>, Span<Span<felt252>>);\n fn entity_ids(self: @T, model: felt252) -> Span<felt252>;\n fn set_executor(ref self: T, contract_address: ContractAddress);\n fn executor(self: @T) -> ContractAddress;\n fn base(self: @T) -> ClassHash;\n fn delete_entity(ref self: T, model: felt252, keys: Span<felt252>, layout: Span<u8>);\n fn is_owner(self: @T, address: ContractAddress, resource: felt252) -> bool;\n fn grant_owner(ref self: T, address: ContractAddress, resource: felt252);\n fn revoke_owner(ref self: T, address: ContractAddress, resource: felt252);\n fn is_writer(self: @T, model: felt252, system: ContractAddress) -> bool;\n fn grant_writer(ref self: T, model: felt252, system: ContractAddress);\n fn revoke_writer(ref self: T, model: felt252, system: ContractAddress);\n}\n","title":"Full World API","titles":[null,"The World Contract"]},"68":{"href":"/cairo/world#uuid","html":"\n

It is often useful to generate unique IDs for entities. The uuid() fn can be used to generate a unique ID.

\n

Use it like this:

\n
let game_id = world.uuid();
","isPage":false,"text":"\nIt is often useful to generate unique IDs for entities. The uuid() fn can be used to generate a unique ID.\nUse it like this:\nlet game_id = world.uuid();","title":"uuid()","titles":[null,"The World Contract"]},"69":{"href":"/client/dojojs#dojojs","html":"\n
\n

Javascript is a great way to get started with Dojo. It's easy to use, and you can get started in minutes.

\n
\n","isPage":true,"text":"\n\nJavascript is a great way to get started with Dojo. It's easy to use, and you can get started in minutes.\n\n","title":"Dojo.js","titles":[]},"70":{"href":"/client/dojojs#dojoenginecore","html":"\n

This is the lowest level library, and is used by all other downstream libraries. It contains the core functionality of Dojo and exposes the contract interfaces. Use it if you want to build your own library on top of Dojo.

\n

Repository

\n
bun add @dojoengine/core
\n","isPage":false,"text":"\nThis is the lowest level library, and is used by all other downstream libraries. It contains the core functionality of Dojo and exposes the contract interfaces. Use it if you want to build your own library on top of Dojo.\nRepository\nbun add @dojoengine/core\n","title":"@dojoengine/core","titles":["Dojo.js",null]},"71":{"href":"/client/dojojs#dojoenginecreate-burner","html":"\n

Create burner is a simple way to incorporate burner wallets into your Dojo app.

\n

Repository

\n
bun add @dojoengine/create-burner
\n","isPage":false,"text":"\nCreate burner is a simple way to incorporate burner wallets into your Dojo app.\nRepository\nbun add @dojoengine/create-burner\n","title":"@dojoengine/create-burner","titles":["Dojo.js",null]},"72":{"href":"/client/dojojs#dojoengineutils","html":"\n

These are utils for helping with interfacing dojo.

\n

Repository

\n
bun add @dojoengine/utils
\n","isPage":false,"text":"\nThese are utils for helping with interfacing dojo.\nRepository\nbun add @dojoengine/utils\n","title":"@dojoengine/utils","titles":["Dojo.js",null]},"73":{"href":"/client/dojojs#dojoenginereact","html":"\n

React hooks for dojo.

\n

Repository

\n
bun add @dojoengine/react
\n","isPage":false,"text":"\nReact hooks for dojo.\nRepository\nbun add @dojoengine/react\n","title":"@dojoengine/react","titles":["Dojo.js",null]},"74":{"href":"/client/dojojs#dojoenginetorii-client","html":"\n

The wasm client to access torii via grpc.

\n

Repository

\n
bun add @dojoengine/torii-client
\n","isPage":false,"text":"\nThe wasm client to access torii via grpc.\nRepository\nbun add @dojoengine/torii-client\n","title":"@dojoengine/torii-client","titles":["Dojo.js",null]},"75":{"href":"/client/dojojs#dojoenginetorii-wasm","html":"\n

Torii client for wasm bindings.

\n

Repository

\n
bun add @dojoengine/torii-wasm
","isPage":false,"text":"\nTorii client for wasm bindings.\nRepository\nbun add @dojoengine/torii-wasm","title":"@dojoengine/torii-wasm","titles":["Dojo.js",null]},"76":{"href":"/client/overview#overview","html":"\n

Dojo is BYO client, meaning that you can use any client you want to connect to the Dojo network.

\n\n
\n

Dojo is always looking to expand these clients, if you would like to contribute reach out into the Discord

\n
","isPage":true,"text":"\nDojo is BYO client, meaning that you can use any client you want to connect to the Dojo network.\n\nnpm\ntorii\n\n\nDojo is always looking to expand these clients, if you would like to contribute reach out into the Discord\n","title":"Overview","titles":[]},"77":{"href":"/client/torii#torii-client","html":"\n

Torii client is a rust client for interacting with Dojo worlds. It can be compiled to wasm to be used in JS clients, or can used directly in Rust clients or other lower level languages with bindings.

\n","isPage":true,"text":"\nTorii client is a rust client for interacting with Dojo worlds. It can be compiled to wasm to be used in JS clients, or can used directly in Rust clients or other lower level languages with bindings.\n","title":"Torii Client","titles":[null]},"78":{"href":"/client/torii#usage-in-rust-projects","html":"\n@kairy\n","isPage":false,"text":"\n@kairy\n","title":"Usage in Rust projects","titles":[null,"Torii Client"]},"79":{"href":"/getting-started/contributing#contributing-to-the-core","html":"\n

Dojo is an open-source project, currently in its early development phase, and warmly welcomes contributors.

\n","isPage":true,"text":"\nDojo is an open-source project, currently in its early development phase, and warmly welcomes contributors.\n","title":"Contributing to the Core","titles":[]},"80":{"href":"/getting-started/contributing#how-to-contribute","html":"\n

Head to the Github for open issues, if you see an issue that is unassigned, please request in the comments to be assigned to it. If you have an idea for a new feature, please create an issue with the enhancement tag.

","isPage":false,"text":"\nHead to the Github for open issues, if you see an issue that is unassigned, please request in the comments to be assigned to it. If you have an idea for a new feature, please create an issue with the enhancement tag.","title":"How to Contribute","titles":["Contributing to the Core"]},"81":{"href":"/getting-started/from-source#building-from-source","html":"\n
\n

If you are just wanting to play with the toolchain, we strongly suggest following the Quick Start guide.

\n
\n","isPage":true,"text":"\n\nIf you are just wanting to play with the toolchain, we strongly suggest following the Quick Start guide.\n\n","title":"Building from source","titles":[null]},"82":{"href":"/getting-started/from-source#prerequisites","html":"\n

You will need the Rust compiler and Cargo, the Rust package manager.\nThe easiest way to install both is with rustup.rs.

\n

On Windows, you will also need a recent version of Visual Studio,\ninstalled with the "Desktop Development With C++" Workloads option.

\n","isPage":false,"text":"\nYou will need the Rust compiler and Cargo, the Rust package manager.\nThe easiest way to install both is with rustup.rs.\nOn Windows, you will also need a recent version of Visual Studio,\ninstalled with the "Desktop Development With C++" Workloads option.\n","title":"Prerequisites","titles":[null,"Building from source",null]},"83":{"href":"/getting-started/from-source#building","html":"\n

You can either use the different Dojoup flags:

\n
dojoup --branch master\ndojoup --path path/to/dojo
\n

Or, by using a single Cargo command:

\n
cargo install --git https://github.com/dojoengine/dojo --force sozo katana torii
\n

Or, by manually building from a local copy of the Dojo repository:

\n
# clone the repository\ngit clone https://github.com/dojoengine/dojo.git\ncd dojo\n# install Sozo\ncargo install --path ./crates/sozo --force\n# install Katana\ncargo install --path ./crates/katana --force\n# install Torii\ncargo run -—bin torii
","isPage":false,"text":"\nYou can either use the different Dojoup flags:\ndojoup --branch master\ndojoup --path path/to/dojo\nOr, by using a single Cargo command:\ncargo install --git https://github.com/dojoengine/dojo --force sozo katana torii\nOr, by manually building from a local copy of the Dojo repository:\n# clone the repository\ngit clone https://github.com/dojoengine/dojo.git\ncd dojo\n# install Sozo\ncargo install --path ./crates/sozo --force\n# install Katana\ncargo install --path ./crates/katana --force\n# install Torii\ncargo run -—bin torii","title":"Building","titles":[null,"Building from source",null]},"84":{"href":"/getting-started/quick-start#quick-start","html":"\n
\n

It is worth reading theory to familiarize yourself with the concept of Autonomous Worlds (AWs) and the Cairo ecosystem before diving into the code.

\n
\n","isPage":true,"text":"\n\nIt is worth reading theory to familiarize yourself with the concept of Autonomous Worlds (AWs) and the Cairo ecosystem before diving into the code.\n\n","title":"Quick Start","titles":[null]},"85":{"href":"/getting-started/quick-start#install-dojoup","html":"\n

Dojo is built around a set of development tools - Katana, Torii and Sozo. Install them all easily with Dojoup. You can find detailed information about Dojoup here.

\n
curl -L https://install.dojoengine.org | bash
\n

This will install Dojoup, then simply follow the instructions on-screen,\nwhich will make the dojoup command available in your CLI.

\n
dojoup
\n

For full dojoup reference and debugging see Dojoup.

\n","isPage":false,"text":"\nDojo is built around a set of development tools - Katana, Torii and Sozo. Install them all easily with Dojoup. You can find detailed information about Dojoup here.\ncurl -L https://install.dojoengine.org | bash\nThis will install Dojoup, then simply follow the instructions on-screen,\nwhich will make the dojoup command available in your CLI.\ndojoup\nFor full dojoup reference and debugging see Dojoup.\n","title":"Install Dojoup","titles":[null,"Quick Start"]},"86":{"href":"/getting-started/quick-start#next-steps","html":"\n
\n

Head to Hello Dojo to get create your first Dojo world.

\n
","isPage":false,"text":"\n\nHead to Hello Dojo to get create your first Dojo world.\n","title":"Next steps","titles":[null,"Quick Start"]},"87":{"href":"/getting-started/setup#development-setup","html":"\n
\n

This is a guide to setting up a development environment for Dojo. It is not suggested to follow this guide if you are just wanting to play with the toolchain. We strongly suggest following the Quick Start guide.

\n
\n","isPage":true,"text":"\n\nThis is a guide to setting up a development environment for Dojo. It is not suggested to follow this guide if you are just wanting to play with the toolchain. We strongly suggest following the Quick Start guide.\n\n","title":"Development Setup","titles":[]},"88":{"href":"/getting-started/setup#prerequisites","html":"\n\n","isPage":false,"text":"\n\nRust\nCairo\nprotoc\n\n","title":"Prerequisites","titles":["Development Setup",null]},"89":{"href":"/getting-started/setup#guide","html":"\n","isPage":false,"text":"\n","title":"Guide","titles":["Development Setup"]},"90":{"href":"/getting-started/setup#clone","html":"\n
git clone https://github.com/dojoengine/dojo.git
\n","isPage":false,"text":"\ngit clone https://github.com/dojoengine/dojo.git\n","title":"Clone","titles":["Development Setup","Guide"]},"91":{"href":"/getting-started/setup#linux--mac","html":"\n","isPage":false,"text":"\n","title":"Linux & Mac","titles":["Development Setup","Guide"]},"92":{"href":"/getting-started/setup#1-install-rust-and-dependencies","html":"\n

Start by installing Rust and running the test suite to confirm your setup:

\n
rustup override set stable && rustup update && cargo test
\n
\n

Note: Depending on your Linux distribution, you may need to install additional dependencies. Make sure to install any suggested or missing dependencies that arise during the setup process.

\n
\n","isPage":false,"text":"\nStart by installing Rust and running the test suite to confirm your setup:\nrustup override set stable && rustup update && cargo test\n\nNote: Depending on your Linux distribution, you may need to install additional dependencies. Make sure to install any suggested or missing dependencies that arise during the setup process.\n\n","title":"1. Install Rust and Dependencies","titles":["Development Setup","Guide","Linux & Mac"]},"93":{"href":"/getting-started/setup#2-install-scarb-package-manager","html":"\n

Next, install the Scarb package manager by running:

\n
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh
\n","isPage":false,"text":"\nNext, install the Scarb package manager by running:\ncurl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh\n","title":"2. Install Scarb Package Manager","titles":["Development Setup","Guide","Linux & Mac"]},"94":{"href":"/getting-started/setup#3-add-the-cairo-10-vscode-extension","html":"\n

Install the Cairo 1.0 extension for Visual Studio Code.

\n","isPage":false,"text":"\nInstall the Cairo 1.0 extension for Visual Studio Code.\n","title":"3. Add the Cairo 1.0 VSCode Extension","titles":["Development Setup","Guide","Linux & Mac"]},"95":{"href":"/getting-started/setup#windows","html":"\n

Coming soon

\n","isPage":false,"text":"\nComing soon\n","title":"Windows","titles":["Development Setup","Guide"]},"96":{"href":"/getting-started/setup#container","html":"\n

Coming soon

","isPage":false,"text":"\nComing soon","title":"Container","titles":["Development Setup","Guide"]},"97":{"href":"/community/get-started#get-started","html":"\n

Dojo is a thriving community of builders, artists, and deep thinkers, pushing the frontier of what is possible.

\n\n","isPage":true,"text":"\nDojo is a thriving community of builders, artists, and deep thinkers, pushing the frontier of what is possible.\n\nCommunity Hub\nDiscord\nTwitter\nAwesome Dojo\nDojo Blog\n\n","title":"Get Started","titles":[null]},"98":{"href":"/community/get-started#ecosystem--studios-powered-by-dojo","html":"\n

\"dojo\"/

\n","isPage":false,"text":"\n\n","title":"Ecosystem & Studios powered by Dojo","titles":[null]},"99":{"href":"/community/get-started#realms-world","html":"\n\n","isPage":false,"text":"\n\ndiscord\nwebsite\n\n","title":"Realms World","titles":[null,"Ecosystem & Studios powered by Dojo",null]},"100":{"href":"/community/get-started#briq-world","html":"\n\n","isPage":false,"text":"\n\ndiscord\nwebsite\n\n","title":"Briq World","titles":[null,"Ecosystem & Studios powered by Dojo",null]},"101":{"href":"/community/get-started#cartridge","html":"\n\n","isPage":false,"text":"\n\ndiscord\nwebsite\n\n","title":"Cartridge","titles":[null,"Ecosystem & Studios powered by Dojo",null]},"102":{"href":"/community/get-started#zkorp","html":"\n\n","isPage":false,"text":"\n\ntwitter\n\n","title":"zKorp","titles":[null,"Ecosystem & Studios powered by Dojo",null]},"103":{"href":"/community/get-started#templates--libraries","html":"\n

Templates, libraries or utilities that use Dojo.

\n\n","isPage":false,"text":"\nTemplates, libraries or utilities that use Dojo.\n\nOrigami - Cairo primitives for onchain Gaming\nCrypts And Caverns Dojo Map - An Example projects of integrating C&C maps developed by the CHE-DAO team with Dojo.\n\n","title":"Templates & Libraries","titles":[null]},"104":{"href":"/community/get-started#awesome-projects","html":"\n","isPage":false,"text":"\n\nBeer Baron - An dojo onchain simulation masked as a beer brewing game. It is designed to work with 10 - 10,000 players.\nChess Dojo - A chess game built on Dojo.\nDope Wars: Roll Your Own - An onchain adaptation of the classic Drug Wars game developed by the Cartridge team.\nDrive AI - An onchain driving simulator controlled by a neural network developed by the Cartridge team.\nEmoji Man - Pac-man inspired onchain game using dojo and phaser.\nLoot Underworld - Excavating the dangerous, endless mysteries of the subterranean in the dark depths of the Realms Autonomous (Under)World.\nPixeLAW - A pixel grid-based Autonomous World with coexisting games (i.e. Paint, Snake, Rock-Paper-Scissors).\nRealms Autonomous World - The Realms Autonomous World\nStark Lander - Land on the Moon!\nStarkLand - Full On-chain Multiplayer Online Simulation Game (FOMOSLG) built on Starknet.\nUnderdark: Lair of the Slenderduck - An unhinged on-chain generative dungeon skin crawler. Beware the Slenderduck!\nzDefender - An onchain tower defense.\nzKnight - An onchain strategy game\n","title":"Awesome Projects","titles":[null]},"105":{"href":"/misc/contributors#contributing-to-dojo-book","html":"\n

As the Dojo engine progresses and develops, it is essential for the Dojo book to keep pace with these advancements. Updating and refining the book ensures that it remains a relevant and valuable resource for those interested in understanding and utilizing the latest Dojo engine features and capabilities. All help is welcome!

\n","isPage":true,"text":"\nAs the Dojo engine progresses and develops, it is essential for the Dojo book to keep pace with these advancements. Updating and refining the book ensures that it remains a relevant and valuable resource for those interested in understanding and utilizing the latest Dojo engine features and capabilities. All help is welcome!\n","title":"Contributing to Dojo Book","titles":[null]},"106":{"href":"/misc/contributors#the-purpose-of-the-book","html":"\n

The Dojo book is designed to be a comprehensive resource that caters to users at various levels of experience. It aims to serve as both an introductory guide for those new to Dojo and its ancillary packages, as well as a reference for more experienced users seeking to deepen their understanding of the engine's features and capabilities.

\n

The book is split into some major chapters:

\n\n","isPage":false,"text":"\nThe Dojo book is designed to be a comprehensive resource that caters to users at various levels of experience. It aims to serve as both an introductory guide for those new to Dojo and its ancillary packages, as well as a reference for more experienced users seeking to deepen their understanding of the engine's features and capabilities.\nThe book is split into some major chapters:\n\nFramework Theory\nGetting Started\nBuilding a World\n\n","title":"The purpose of the book","titles":[null,"Contributing to Dojo Book"]},"107":{"href":"/misc/contributors#code-of-conduct","html":"\n

The book follows the Rust Code of Conduct.

\n","isPage":false,"text":"\nThe book follows the Rust Code of Conduct.\n","title":"Code of Conduct","titles":[null,"Contributing to Dojo Book"]},"108":{"href":"/misc/contributors#ways-to-contribute","html":"\n","isPage":false,"text":"\n","title":"Ways to contribute","titles":[null,"Contributing to Dojo Book"]},"109":{"href":"/misc/contributors#issues","html":"\n

If you think that some content is missing or out-of-date, feel free to open an issue. If you find multiple pieces of content lacking, please open up a separate issue for each.

\n

The issues will then be labeled so other contributors can find chunks of work they are interested in more easily.

\n

The issue should contain what is missing, or what could be improved, in as much detail as you deem necessary.

\n","isPage":false,"text":"\nIf you think that some content is missing or out-of-date, feel free to open an issue. If you find multiple pieces of content lacking, please open up a separate issue for each.\nThe issues will then be labeled so other contributors can find chunks of work they are interested in more easily.\nThe issue should contain what is missing, or what could be improved, in as much detail as you deem necessary.\n","title":"Issues","titles":[null,"Contributing to Dojo Book","Ways to contribute"]},"110":{"href":"/misc/contributors#pull-requests","html":"\n

Feel free to contribute changes to the book by opening a pull request - anything is welcome, from reformulating a sentence, fixing a typo, to adding new sections or chapters.

\n

When your pull request is open, other contributors will take a look and may request changes. Do not be discouraged!

\n","isPage":false,"text":"\nFeel free to contribute changes to the book by opening a pull request - anything is welcome, from reformulating a sentence, fixing a typo, to adding new sections or chapters.\nWhen your pull request is open, other contributors will take a look and may request changes. Do not be discouraged!\n","title":"Pull requests","titles":[null,"Contributing to Dojo Book","Ways to contribute"]},"111":{"href":"/misc/contributors#writing-style","html":"\n

This section documents a few standards for writing used throughout the book.

\n","isPage":false,"text":"\nThis section documents a few standards for writing used throughout the book.\n","title":"Writing style","titles":[null,"Contributing to Dojo Book"]},"112":{"href":"/misc/contributors#chapters-start-with-a-second-level-heading","html":"\n

We use:

\n
## Some Page
\n

We do not use:

\n
# Some Page
","isPage":false,"text":"\nWe use:\n## Some Page\nWe do not use:\n# Some Page","title":"Chapters start with a second level heading","titles":[null,"Contributing to Dojo Book","Writing style"]},"113":{"href":"/theory/autonomous-worlds#autonomous-worlds","html":"\n
\n

"Autonomous worlds represent persistent, permissionless, and decentralized open environments that users can freely interact with and contribute to."

\n
\n

The precise definition of Autonomous Worlds (AWs) remains somewhat elusive, as it is more of an abstract concept that has yet to be fully crystallized. Lattice first introduced the terminology in 2022, but the notion of open worlds operating on the blockchain has been around for a while. The abstraction introduced by MUD served as a catalyst for the market to recognize the potential of these worlds.

\n

Autonomous Worlds share notable similarities with blockchains in their fundamental nature. Once established, they persist, maintaining their state throughout the lifespan of the chain. Players can join or leave, and developers can expand these worlds by deploying features in a permissionless manner, much like how contracts are added to a chain. While there is no universally accepted definition for an Autonomous World, we believe that a game must possess at least the following two essential features to be considered as such:

\n
    \n
  1. \n

    Decentralized data availability layer: While the state execution may reside on a centralized layer, it is crucial that the state can be reconstructed if the execution layer ceases to exist. Rollups offer a solution, providing increased capacity execution layers while ensuring data is permanently settled on Ethereum. This guarantees the world's perpetual persistence.

    \n
  2. \n
  3. \n

    Permissionless entry point for expanding the world: The World contract must be capable of accepting new systems and components without requiring permission. While this doesn't imply that every component and system will be utilized, they must adhere to this pattern, ensuring open and unrestricted access for potential enhancements.

    \n
  4. \n
\n

We're firm believers in the potential for Autonomous Worlds to catalyze the exploration of novel forms in the medium provided by zk proofs and blockchain technology. This is not only about games, but also about new forms of artwork, coordination, fun, emerging from tinkering and radical innovation, eventually questioning the very notion of "play" in this brave new decentralized and trustless world.

\n","isPage":true,"text":"\n\n"Autonomous worlds represent persistent, permissionless, and decentralized open environments that users can freely interact with and contribute to."\n\nThe precise definition of Autonomous Worlds (AWs) remains somewhat elusive, as it is more of an abstract concept that has yet to be fully crystallized. Lattice first introduced the terminology in 2022, but the notion of open worlds operating on the blockchain has been around for a while. The abstraction introduced by MUD served as a catalyst for the market to recognize the potential of these worlds.\nAutonomous Worlds share notable similarities with blockchains in their fundamental nature. Once established, they persist, maintaining their state throughout the lifespan of the chain. Players can join or leave, and developers can expand these worlds by deploying features in a permissionless manner, much like how contracts are added to a chain. While there is no universally accepted definition for an Autonomous World, we believe that a game must possess at least the following two essential features to be considered as such:\n\n\nDecentralized data availability layer: While the state execution may reside on a centralized layer, it is crucial that the state can be reconstructed if the execution layer ceases to exist. Rollups offer a solution, providing increased capacity execution layers while ensuring data is permanently settled on Ethereum. This guarantees the world's perpetual persistence.\n\n\nPermissionless entry point for expanding the world: The World contract must be capable of accepting new systems and components without requiring permission. While this doesn't imply that every component and system will be utilized, they must adhere to this pattern, ensuring open and unrestricted access for potential enhancements.\n\n\nWe're firm believers in the potential for Autonomous Worlds to catalyze the exploration of novel forms in the medium provided by zk proofs and blockchain technology. This is not only about games, but also about new forms of artwork, coordination, fun, emerging from tinkering and radical innovation, eventually questioning the very notion of "play" in this brave new decentralized and trustless world.\n","title":"Autonomous Worlds","titles":[null]},"114":{"href":"/theory/autonomous-worlds#homework","html":"\n","isPage":false,"text":"\n\nWired - Autonomous Worlds Primer\n0xParc - Autonomous Worlds (Part 1)\nGubsheep - The Strongest Crypto Gaming Thesis\nLattice - MUD: An engine for Autonomous Worlds\nGuiltygyoza - Game 2.0\nGuiltygyoza - Composable Engineering\nJay Springett - Wind-up Worlds\nAre.na collection on Autonomous Worlds\n","title":"Homework","titles":[null,"Autonomous Worlds"]},"115":{"href":"/theory/cairo#provable-games","html":"\n

Provable games demand zero-knowledge properties for efficient scaling and verification of computations. Cairo addresses this need by providing a generalized language, eliminating the complexity of creating circuits to incorporate SNARKs.

\n

You can simply program in Cairo and your applications become automatically provable.

\n

Moreover, you can deploy your programs on the Cairo Virtual Machine (CVM), which is compatible with Starknet's Layer 2, Starknet appchains, and even in-browser through WebAssembly (WASM)! Dojo aims to supply straightforward ZK primitives to fuel your game development.

\n

For more information about Starknet, Cairo and its tech stack, check out the Starknet & Cairo book.

\n","isPage":true,"text":"\nProvable games demand zero-knowledge properties for efficient scaling and verification of computations. Cairo addresses this need by providing a generalized language, eliminating the complexity of creating circuits to incorporate SNARKs.\nYou can simply program in Cairo and your applications become automatically provable.\nMoreover, you can deploy your programs on the Cairo Virtual Machine (CVM), which is compatible with Starknet's Layer 2, Starknet appchains, and even in-browser through WebAssembly (WASM)! Dojo aims to supply straightforward ZK primitives to fuel your game development.\nFor more information about Starknet, Cairo and its tech stack, check out the Starknet & Cairo book.\n","title":"Provable games","titles":[]},"116":{"href":"/theory/cairo#cairo","html":"\n

Cairo is an open-source, Turing-complete smart contract language developed by Starkware, designed to power the Validity Rollup Starknet. The language enables highly expressive and verifiable computation, making it well-suited for building scalable and secure applications, including decentralized finance (DeFi) projects.

\n

Dojo builds on Cairo to create a robust framework for developing Autonomous Worlds (AWs). By leveraging the capabilities of Cairo, Dojo aims to streamline the development process, improve maintainability, and enhance the performance of AWs.

\n

A key feature of the Dojo framework is its use of commands. Commands are a design pattern that helps to reduce boilerplate code, resulting in cleaner and more maintainable applications. They achieve this by encapsulating specific actions or operations within self-contained, reusable units.

\n

Developers can write commands freely within Systems, and the Cairo compiler takes care of inlining the appropriate functions.

\n","isPage":false,"text":"\nCairo is an open-source, Turing-complete smart contract language developed by Starkware, designed to power the Validity Rollup Starknet. The language enables highly expressive and verifiable computation, making it well-suited for building scalable and secure applications, including decentralized finance (DeFi) projects.\nDojo builds on Cairo to create a robust framework for developing Autonomous Worlds (AWs). By leveraging the capabilities of Cairo, Dojo aims to streamline the development process, improve maintainability, and enhance the performance of AWs.\nA key feature of the Dojo framework is its use of commands. Commands are a design pattern that helps to reduce boilerplate code, resulting in cleaner and more maintainable applications. They achieve this by encapsulating specific actions or operations within self-contained, reusable units.\nDevelopers can write commands freely within Systems, and the Cairo compiler takes care of inlining the appropriate functions.\n","title":"Cairo","titles":["Provable games"]},"117":{"href":"/theory/cairo#essential-reading","html":"\n\n","isPage":false,"text":"\n\nCairo book\nAwesome Cairo\nStarknet Book\n\n","title":"Essential Reading","titles":["Provable games","Cairo",null]},"118":{"href":"/theory/cairo#starknet-as-an-l2","html":"\n

Starknet is a Validity Rollup Layer 2 (L2) solution designed to scale Ethereum. It operates by offering high transaction throughput and low gas costs while maintaining the same level of security as Ethereum Layer 1 (L1). The strategy it uses is akin to solving a sudoku puzzle: verifying a solution is easier than finding the solution from scratch. Similarly, Starknet replaces heavy and costly L1 computation with cheaper L1 verification through the use of STARK proofs computed off-chain.

\n

In more technical terms, Starknet is a permissionless Validity-Rollup (also known as a "ZK-Rollup") that supports general computation and currently runs as an L2 network over Ethereum. The network's L1 security is guaranteed by its utilization of the STARK cryptographic proof system, which is considered one of the safest and most scalable.

\n","isPage":false,"text":"\nStarknet is a Validity Rollup Layer 2 (L2) solution designed to scale Ethereum. It operates by offering high transaction throughput and low gas costs while maintaining the same level of security as Ethereum Layer 1 (L1). The strategy it uses is akin to solving a sudoku puzzle: verifying a solution is easier than finding the solution from scratch. Similarly, Starknet replaces heavy and costly L1 computation with cheaper L1 verification through the use of STARK proofs computed off-chain.\nIn more technical terms, Starknet is a permissionless Validity-Rollup (also known as a "ZK-Rollup") that supports general computation and currently runs as an L2 network over Ethereum. The network's L1 security is guaranteed by its utilization of the STARK cryptographic proof system, which is considered one of the safest and most scalable.\n","title":"Starknet as an L2","titles":["Provable games","Cairo"]},"119":{"href":"/theory/cairo#starknet-as-an-appchain","html":"\n

Cairo is an isomorphic, general-purpose language, optimized for Zero-Knowledge (ZK) proofs. It's the driving force behind Starknet, Starkex, and appchains. Remarkably, you can also run it in WebAssembly (WASM) to generate proofs on the client-side! Within the dojo toolchain exists Katana which is a gaming specific sequencer, which is perfectly suited to run a Dojo appchain.

\n

The Dojo team is also working closely with the Madara team to enable Starknet appchains to seamlessly run Dojo worlds.

","isPage":false,"text":"\nCairo is an isomorphic, general-purpose language, optimized for Zero-Knowledge (ZK) proofs. It's the driving force behind Starknet, Starkex, and appchains. Remarkably, you can also run it in WebAssembly (WASM) to generate proofs on the client-side! Within the dojo toolchain exists Katana which is a gaming specific sequencer, which is perfectly suited to run a Dojo appchain.\nThe Dojo team is also working closely with the Madara team to enable Starknet appchains to seamlessly run Dojo worlds.","title":"Starknet as an Appchain","titles":["Provable games","Cairo"]},"120":{"href":"/theory/faqs#faqs","html":"\n","isPage":true,"text":"\n","title":"FAQs","titles":[]},"121":{"href":"/theory/faqs#who-owns-dojo","html":"\n

Dojo is strictly open-source and uses the Apache 2.0 license. Anyone can use Dojo for free, and anyone can contribute to the project.

\n","isPage":false,"text":"\nDojo is strictly open-source and uses the Apache 2.0 license. Anyone can use Dojo for free, and anyone can contribute to the project.\n","title":"Who owns Dojo?","titles":["FAQs",null,null]},"122":{"href":"/theory/faqs#why-dojo","html":"\n

Dojo was created to solve problems the founders faced when building onchain games. It standardizes the process of building such games and provides a suite of tools to make it easier.

\n","isPage":false,"text":"\nDojo was created to solve problems the founders faced when building onchain games. It standardizes the process of building such games and provides a suite of tools to make it easier.\n","title":"Why Dojo?","titles":["FAQs",null,null]},"123":{"href":"/theory/faqs#what-is-the-dojo-roadmap","html":"\n

Dojo is rapidly evolving. You can find open issues on the Dojo Github and join the Discord to get involved. If you have ideas for the project, please open an issue.

\n","isPage":false,"text":"\nDojo is rapidly evolving. You can find open issues on the Dojo Github and join the Discord to get involved. If you have ideas for the project, please open an issue.\n","title":"What is the Dojo roadmap?","titles":["FAQs",null,null]},"124":{"href":"/theory/faqs#what-is-an-onchain-game","html":"\n

Onchain games are games that exist entirely on a public blockchain network; all states and logic are onchain. Clients (like web browsers) do not exist on the chain but exist purely to interact with and interpret the onchain state.

\n","isPage":false,"text":"\nOnchain games are games that exist entirely on a public blockchain network; all states and logic are onchain. Clients (like web browsers) do not exist on the chain but exist purely to interact with and interpret the onchain state.\n","title":"What is an onchain game?","titles":["FAQs",null,null]},"125":{"href":"/theory/faqs#what-is-an-autonomous-world","html":"\n

An autonomous world is one that exists entirely onchain. It's not controlled by any single entity but is instead governed by the rules set within that world. Dive deeper into the topic here: Autonomous Worlds.

\n","isPage":false,"text":"\nAn autonomous world is one that exists entirely onchain. It's not controlled by any single entity but is instead governed by the rules set within that world. Dive deeper into the topic here: Autonomous Worlds.\n","title":"What is an autonomous world?","titles":["FAQs",null,null]},"126":{"href":"/theory/faqs#what-is-cairo","html":"\n

Cairo is an opensource programming language invented by Starkware. It's a Turing-complete language meant for general-purpose computation. It's a low-level language designed to compile to the Cairo Virtual Machine. Learn more about it here: Cairo.

\n","isPage":false,"text":"\nCairo is an opensource programming language invented by Starkware. It's a Turing-complete language meant for general-purpose computation. It's a low-level language designed to compile to the Cairo Virtual Machine. Learn more about it here: Cairo.\n","title":"What is Cairo?","titles":["FAQs",null,null]},"127":{"href":"/theory/faqs#what-is-a-provable-game","html":"\n

Thanks to the magic of zero-knowledge proofs, we can ensure a game is fair by verifying a zk proof created off-chain. But what does that entail? Consider a game of chess. We aim for an experience where players trust each other's moves. In a straightforward approach — and given the simple rules of chess — if this were in a blockchain environment, every move would be a transaction on the blockchain. This is costly. We just want to know the winner, not every move.

\n

With zk proofs and client communications, players can establish a state channel, sharing moves off-chain and ensuring their validity. At the end, a zk proof can be submitted to the blockchain to confirm the game's fairness. This constitutes a provable game.

\n","isPage":false,"text":"\nThanks to the magic of zero-knowledge proofs, we can ensure a game is fair by verifying a zk proof created off-chain. But what does that entail? Consider a game of chess. We aim for an experience where players trust each other's moves. In a straightforward approach — and given the simple rules of chess — if this were in a blockchain environment, every move would be a transaction on the blockchain. This is costly. We just want to know the winner, not every move.\nWith zk proofs and client communications, players can establish a state channel, sharing moves off-chain and ensuring their validity. At the end, a zk proof can be submitted to the blockchain to confirm the game's fairness. This constitutes a provable game.\n","title":"What is a provable game?","titles":["FAQs",null,null]},"128":{"href":"/theory/faqs#can-dojo-implement-client-side-proofs","html":"\n

The ability to execute Dojo programs in the browser is entirely plausible and is on our roadmap. Expect q1/q2 in 2024, or if you are a specalist in this jump into the code and help out!

\n","isPage":false,"text":"\nThe ability to execute Dojo programs in the browser is entirely plausible and is on our roadmap. Expect q1/q2 in 2024, or if you are a specalist in this jump into the code and help out!\n","title":"Can dojo implement client side proofs?","titles":["FAQs",null,null]},"129":{"href":"/theory/faqs#can-i-deploy-dojo-on-starknet","html":"\n

Yes! Dojo can run on any StarknetVM including the public blockchains. Within the dojo toolchain exists Katana which is a gaming specific sequencer, which is perfectly suited to Dojo games.

","isPage":false,"text":"\nYes! Dojo can run on any StarknetVM including the public blockchains. Within the dojo toolchain exists Katana which is a gaming specific sequencer, which is perfectly suited to Dojo games.","title":"Can I deploy dojo on Starknet?","titles":["FAQs",null,null]},"130":{"href":"/theory/what-is-dojo#what-is-dojo","html":"\n

Dojo is the culmination of lessons learned from attempts at building onchain games, an emerging sector in the gaming industry. Any developer who has endeavored to build an on-chain game recognizes the inherent engineering hurdles - a realization that drove us to create Dojo. Just as you wouldn't recreate Unity every time you develop a new game, the same principle applies here. Dojo is designed to handle the complex infrastructure, allowing developers to focus on the unique aspects of their games.

\n

Dojo aspires to be the go-to tool for building provable games. It is radically open-source, and all contributions are welcome.

\n
\n","isPage":true,"text":"\nDojo is the culmination of lessons learned from attempts at building onchain games, an emerging sector in the gaming industry. Any developer who has endeavored to build an on-chain game recognizes the inherent engineering hurdles - a realization that drove us to create Dojo. Just as you wouldn't recreate Unity every time you develop a new game, the same principle applies here. Dojo is designed to handle the complex infrastructure, allowing developers to focus on the unique aspects of their games.\nDojo aspires to be the go-to tool for building provable games. It is radically open-source, and all contributions are welcome.\n\n","title":"What is Dojo?","titles":[]},"131":{"href":"/theory/what-is-dojo#stop-building-infrastructure-start-building-games","html":"\n

Dojo's suite of tools takes the infrastructure complexity out of building on-chain games. It includes:

\n","isPage":false,"text":"\nDojo's suite of tools takes the infrastructure complexity out of building on-chain games. It includes:\n","title":"Stop building infrastructure; start building games","titles":["What is Dojo?"]},"132":{"href":"/theory/what-is-dojo#entity-component-system-ecs","html":"\n

Dojo offers a standardized approach to building games on smart contracts. Recognizing the intricacies of game design, Dojo simplifies the development process, allowing creators to focus on gameplay logic. This standardization paves the way for an interconnected network of worlds, streamlining developer expertise and promoting game integration.

\n

Utilizing the ECS (Entity Component System) as its core architecture, Dojo effectively manages the state and behavior of Autonomous Worlds (AWs). This model revolves around systems acting on entities, which are collections of pure data components. Systems efficiently determine which entities to process based on persistent queries over these components.

\n

Read detailed information about the Dojo ECS.

\n","isPage":false,"text":"\nDojo offers a standardized approach to building games on smart contracts. Recognizing the intricacies of game design, Dojo simplifies the development process, allowing creators to focus on gameplay logic. This standardization paves the way for an interconnected network of worlds, streamlining developer expertise and promoting game integration.\nUtilizing the ECS (Entity Component System) as its core architecture, Dojo effectively manages the state and behavior of Autonomous Worlds (AWs). This model revolves around systems acting on entities, which are collections of pure data components. Systems efficiently determine which entities to process based on persistent queries over these components.\nRead detailed information about the Dojo ECS.\n","title":"Entity Component System (ECS)","titles":["What is Dojo?","Stop building infrastructure; start building games"]},"133":{"href":"/theory/what-is-dojo#what-dojo-doesnt-give-you","html":"\n
    \n
  1. Visual graphics - While Dojo provides networking and contracts, it doesn't offer graphical engines. You can bring your graphics of choice! Integrate your Dojo world with Unreal, Godot, or Unity.
  2. \n
","isPage":false,"text":"\n\nVisual graphics - While Dojo provides networking and contracts, it doesn't offer graphical engines. You can bring your graphics of choice! Integrate your Dojo world with Unreal, Godot, or Unity.\n","title":"What Dojo doesn't give you","titles":["What is Dojo?","Stop building infrastructure; start building games"]},"134":{"href":"/toolchain/dojoup#dojoup","html":"\n

Update or revert to a specific Dojo branch with ease.

\n","isPage":true,"text":"\nUpdate or revert to a specific Dojo branch with ease.\n","title":"dojoup","titles":[]},"135":{"href":"/toolchain/dojoup#installing","html":"\n
curl -L https://install.dojoengine.org | bash
\n","isPage":false,"text":"\ncurl -L https://install.dojoengine.org | bash\n","title":"Installing","titles":["dojoup"]},"136":{"href":"/toolchain/dojoup#usage","html":"\n

To install latest stable version:

\n
dojoup
\n
\n

Note: You may have to install jq to use dojoup. You can do so with the following commands:

\n
\n
# Debian\nsudo apt-get install jq\n \n# Mac\nbrew install jq
\n

To install a specific version (in this case the nightly version):

\n
dojoup --version nightly
\n

To install a specific branch (in this case the release/0.1.0 branch's latest commit):

\n
dojoup --branch release/0.1.0
\n

To install a fork's main branch (in this case tarrencev/dojo's main branch):

\n
dojoup --repo tarrencev/dojo
\n

To install a specific branch in a fork (in this case the patch-10 branch's latest commit in tarrencev/dojo):

\n
dojoup --repo tarrencev/dojo --branch patch-10
\n

To install from a specific Pull Request:

\n
dojoup --pr 1071
\n

To install from a specific commit:

\n
dojoup -c 94bfdb2
\n

To install a local directory or repository (e.g. one located at ~/git/dojo, assuming you're in the home directory)

\n","isPage":false,"text":"\nTo install latest stable version:\ndojoup\n\nNote: You may have to install jq to use dojoup. You can do so with the following commands:\n\n# Debian\nsudo apt-get install jq\n \n# Mac\nbrew install jq\nTo install a specific version (in this case the nightly version):\ndojoup --version nightly\nTo install a specific branch (in this case the release/0.1.0 branch's latest commit):\ndojoup --branch release/0.1.0\nTo install a fork's main branch (in this case tarrencev/dojo's main branch):\ndojoup --repo tarrencev/dojo\nTo install a specific branch in a fork (in this case the patch-10 branch's latest commit in tarrencev/dojo):\ndojoup --repo tarrencev/dojo --branch patch-10\nTo install from a specific Pull Request:\ndojoup --pr 1071\nTo install from a specific commit:\ndojoup -c 94bfdb2\nTo install a local directory or repository (e.g. one located at ~/git/dojo, assuming you're in the home directory)\n","title":"Usage","titles":["dojoup"]},"137":{"href":"/toolchain/dojoup#note---branch---repo-and---version-flags-are-ignored-during-local-installations","html":"\n
dojoup --path ./git/dojo
\n
\n

Tip: All flags have a single character shorthand equivalent! You can use -v instead of --version, etc.

\n
\n","isPage":false,"text":"\ndojoup --path ./git/dojo\n\nTip: All flags have a single character shorthand equivalent! You can use -v instead of --version, etc.\n\n","title":"Note: --branch, --repo, and --version flags are ignored during local installations.","titles":["dojoup","Usage",null,null]},"138":{"href":"/toolchain/dojoup#precompiled-binaries","html":"\n

Precompiled binaries are available from the GitHub releases page.\nThese are better managed by using Dojoup.

\n
\n

ℹ️ Note

\n

If you're on Windows, you will need to install and use Git BASH or WSL,\nas your terminal, since Dojoup currently does not support Powershell or Cmd.

\n
","isPage":false,"text":"\nPrecompiled binaries are available from the GitHub releases page.\nThese are better managed by using Dojoup.\n\nℹ️ Note\nIf you're on Windows, you will need to install and use Git BASH or WSL,\nas your terminal, since Dojoup currently does not support Powershell or Cmd.\n","title":"Precompiled binaries","titles":["dojoup","Usage"]},"139":{"href":"/cairo/migration/0#migration-guide-to-030","html":"\n

0.3.0 introduced some breaking changes to Systems and Models which requires reworking of your worlds.

\n\n","isPage":true,"text":"\n0.3.0 introduced some breaking changes to Systems and Models which requires reworking of your worlds.\n\nComponents\nSystems\nEvents\nNpm\n\n","title":"Migration Guide to 0.3.0","titles":[null]},"140":{"href":"/cairo/migration/0#components-to-models","html":"\n

In version 0.3.0, "components" have been renamed to "models". This has been done due to Cairo introducing the concept of Components natively.

\n

You must:

\n\n

Note: Ensure all related files and imports are updated accordingly.

\n","isPage":false,"text":"\nIn version 0.3.0, "components" have been renamed to "models". This has been done due to Cairo introducing the concept of Components natively.\nYou must:\n\nReplace #[component] with #[model].\nUpdate #[derive(Component)] to #[derive(Model)] throughout your code.\n\nNote: Ensure all related files and imports are updated accordingly.\n","title":"Components to Models","titles":[null,"Migration Guide to 0.3.0"]},"141":{"href":"/cairo/migration/0#changes-in-model-implementation","html":"\n

The trait SerdeLen is no longer implemented for models. If you relied on this previously, you should now use SchemaIntrospection.

\n","isPage":false,"text":"\nThe trait SerdeLen is no longer implemented for models. If you relied on this previously, you should now use SchemaIntrospection.\n","title":"Changes in Model Implementation","titles":[null,"Migration Guide to 0.3.0"]},"142":{"href":"/cairo/migration/0#schema-introduction","html":"\n

For models containing complex types, it's crucial to implement the SchemaIntrospection trait.

\n

Consider the model below:

\n
struct Card {\n \n    #[key]\n    token_id: u256,\n    /// The card's designated role.\n    role: Roles,\n}
\n

For complex types, like Roles in the above example, you need to implement SchemaIntrospection. Here's how:

\n
impl RolesSchemaIntrospectionImpl of SchemaIntrospection<Roles> {\n    #[inline(always)]\n    fn size() -> usize {\n        1 // Represents the byte size of the enum.\n    }\n \n    #[inline(always)]\n    fn layout(ref layout: Array<u8>) {\n        layout.append(8); // Specifies the layout byte size;\n    }\n \n    #[inline(always)]\n    fn ty() -> Ty {\n        Ty::Enum(\n            Enum {\n                name: 'Roles',\n                attrs: array![].span(),\n                children: array![\n                    ('Goalkeeper', serialize_member_type(@Ty::Tuple(array![].span()))),\n                    ('Defender', serialize_member_type(@Ty::Tuple(array![].span()))),\n                    ('Midfielder', serialize_member_type(@Ty::Tuple(array![].span()))),\n                    ('Attacker', serialize_member_type(@Ty::Tuple(array![].span()))),\n                ]\n                .span()\n            }\n        )\n    }\n}
\n

Key Takeaways from custom types:

\n\n","isPage":false,"text":"\nFor models containing complex types, it's crucial to implement the SchemaIntrospection trait.\nConsider the model below:\nstruct Card {\n \n #[key]\n token_id: u256,\n /// The card's designated role.\n role: Roles,\n}\nFor complex types, like Roles in the above example, you need to implement SchemaIntrospection. Here's how:\nimpl RolesSchemaIntrospectionImpl of SchemaIntrospection<Roles> {\n #[inline(always)]\n fn size() -> usize {\n 1 // Represents the byte size of the enum.\n }\n \n #[inline(always)]\n fn layout(ref layout: Array<u8>) {\n layout.append(8); // Specifies the layout byte size;\n }\n \n #[inline(always)]\n fn ty() -> Ty {\n Ty::Enum(\n Enum {\n name: 'Roles',\n attrs: array![].span(),\n children: array![\n ('Goalkeeper', serialize_member_type(@Ty::Tuple(array![].span()))),\n ('Defender', serialize_member_type(@Ty::Tuple(array![].span()))),\n ('Midfielder', serialize_member_type(@Ty::Tuple(array![].span()))),\n ('Attacker', serialize_member_type(@Ty::Tuple(array![].span()))),\n ]\n .span()\n }\n )\n }\n}\nKey Takeaways from custom types:\n\nsize: Defines the byte size of the type.\nlayout: Outlines the byte structure/layout for the type. Validate and adjust as necessary.\nty: Details the specific type, attributes, and subcomponents. For enums, like Roles, you need to specify each member and its type.\n\n","title":"Schema Introduction","titles":[null,"Migration Guide to 0.3.0"]},"143":{"href":"/cairo/migration/0#systems-update","html":"\n

Systems in 0.3.0 are very similar now to Cairo Contracts. You can write your systems just like regular contracts, and each dojo contract can contain mulitple systems.

\n

Important high level changes:

\n\n","isPage":false,"text":"\nSystems in 0.3.0 are very similar now to Cairo Contracts. You can write your systems just like regular contracts, and each dojo contract can contain mulitple systems.\nImportant high level changes:\n\nSystems are now starknet contracts\nDefine Interfaces for each system contract\nNew optional #[dojo::contract] decorator defining systems\nMultiple systems per dojo contract, rather than singular\nexecute is no longer required system selector name\n\n","title":"Systems Update","titles":[null,"Migration Guide to 0.3.0"]},"144":{"href":"/cairo/migration/0#interface-creation","html":"\n

System management has been revamped. Start by defining an interface for each system, which specifies its implementation:

\n
#[starknet::interface]\ntrait ICreateCard<TContractState> {\n    fn create_card(\n        self: @TContractState,\n        world: IWorldDispatcher,\n        token_id: u256,\n        dribble: u8,\n        defense: u8,\n        cost: u8,\n        role: Roles,\n        is_captain: bool\n    );\n}
\n

Ensure the trait is typed with TContractState.

\n

Note: Earlier versions required functions within the system to be named execute. This is no longer the case.

\n","isPage":false,"text":"\nSystem management has been revamped. Start by defining an interface for each system, which specifies its implementation:\n#[starknet::interface]\ntrait ICreateCard<TContractState> {\n fn create_card(\n self: @TContractState,\n world: IWorldDispatcher,\n token_id: u256,\n dribble: u8,\n defense: u8,\n cost: u8,\n role: Roles,\n is_captain: bool\n );\n}\nEnsure the trait is typed with TContractState.\nNote: Earlier versions required functions within the system to be named execute. This is no longer the case.\n","title":"Interface Creation","titles":[null,"Migration Guide to 0.3.0","Systems Update"]},"145":{"href":"/cairo/migration/0#interface-implementation","html":"\n

To implement the interface:

\n
    \n
  1. Add #[abi(embed_v0)] before each method.
  2. \n
  3. Ensure to reference the created interface in the module with use super::ICreateCard;.
  4. \n
\n
#[abi(embed_v0)]\nimpl CreateCardImpl of ICreateCard<ContractState> {\n    fn create_card(\n        self: @ContractState,\n        world: IWorldDispatcher,\n        token_id: u256,\n        dribble: u8,\n        defense: u8,\n        cost: u8,\n        role: Roles,\n        is_captain: bool\n    ) {\n        // your logic here\n    }\n}
\n

This then allows the create_card to be called just like a regular starknet function.

\n","isPage":false,"text":"\nTo implement the interface:\n\nAdd #[abi(embed_v0)] before each method.\nEnsure to reference the created interface in the module with use super::ICreateCard;.\n\n#[abi(embed_v0)]\nimpl CreateCardImpl of ICreateCard<ContractState> {\n fn create_card(\n self: @ContractState,\n world: IWorldDispatcher,\n token_id: u256,\n dribble: u8,\n defense: u8,\n cost: u8,\n role: Roles,\n is_captain: bool\n ) {\n // your logic here\n }\n}\nThis then allows the create_card to be called just like a regular starknet function.\n","title":"Interface Implementation","titles":[null,"Migration Guide to 0.3.0","Systems Update"]},"146":{"href":"/cairo/migration/0#dojocontract-decorator","html":"\n

0.3.0 introduces a new optional decorator #[dojo::contract] which indicates to the compiler to inject imports and the world dispatcher. This allows for minimal boilerplate.

\n
#[dojo::contract]\nmod move {\n....code TODO\n}
\n","isPage":false,"text":"\n0.3.0 introduces a new optional decorator #[dojo::contract] which indicates to the compiler to inject imports and the world dispatcher. This allows for minimal boilerplate.\n#[dojo::contract]\nmod move {\n....code TODO\n}\n","title":"#[dojo::contract] decorator","titles":[null,"Migration Guide to 0.3.0","Systems Update"]},"147":{"href":"/cairo/migration/0#events","html":"\n

Events should now reside within the models. Here's an example of how to migrate your events:

\n

Previous Format:

\n
#[derive(Drop, starknet::Event, Copy)]\nstruct DeckCreated {\n    player: ContractAddress,\n    token_list: Span<u256>,\n}
\n

New Format:

\n
#[event]\n#[derive(Drop, starknet::Event)]\nenum Event {\n    DeckCreated: DeckCreated\n}\n \n#[derive(Drop, starknet::Event)]\nstruct DeckCreated {\n    player: ContractAddress,\n    token_list: Span<u256>,\n}
\n","isPage":false,"text":"\nEvents should now reside within the models. Here's an example of how to migrate your events:\nPrevious Format:\n#[derive(Drop, starknet::Event, Copy)]\nstruct DeckCreated {\n player: ContractAddress,\n token_list: Span<u256>,\n}\nNew Format:\n#[event]\n#[derive(Drop, starknet::Event)]\nenum Event {\n DeckCreated: DeckCreated\n}\n \n#[derive(Drop, starknet::Event)]\nstruct DeckCreated {\n player: ContractAddress,\n token_list: Span<u256>,\n}\n","title":"Events","titles":[null,"Migration Guide to 0.3.0"]},"148":{"href":"/cairo/migration/0#testing-changes","html":"\n","isPage":false,"text":"\n","title":"Testing Changes","titles":[null,"Migration Guide to 0.3.0"]},"149":{"href":"/cairo/migration/0#setup","html":"\n

Testing has seen significant changes with the change to systems as Contracts. Instead of using world.execute, use the dispatcher.

\n
    \n
  1. Import necessary modules and traits:
  2. \n
\n
use dojo::test_utils::deploy_contract;\nuse tsubasa::systems::{ICreateCardDispatcher, ICreateCardDispatcherTrait};
\n
    \n
  1. Deploy the contract and instantiate the dispatcher:
  2. \n
\n
let contract_create_card = deploy_contract(\n    create_card_system::TEST_CLASS_HASH, array![].span()\n);\nlet create_card_system = ICreateCardDispatcher { contract_address: contract_create_card };
\n","isPage":false,"text":"\nTesting has seen significant changes with the change to systems as Contracts. Instead of using world.execute, use the dispatcher.\n\nImport necessary modules and traits:\n\nuse dojo::test_utils::deploy_contract;\nuse tsubasa::systems::{ICreateCardDispatcher, ICreateCardDispatcherTrait};\n\nDeploy the contract and instantiate the dispatcher:\n\nlet contract_create_card = deploy_contract(\n create_card_system::TEST_CLASS_HASH, array![].span()\n);\nlet create_card_system = ICreateCardDispatcher { contract_address: contract_create_card };\n","title":"Setup","titles":[null,"Migration Guide to 0.3.0","Testing Changes"]},"150":{"href":"/cairo/migration/0#function-testing","html":"\n

With the contract deployed and the dispatcher instantiated, proceed to test your functions:

\n
// ... (previous setup code)\n \nlet result = create_card_system.create_card(\n    // ... provide necessary parameters here\n);\n \n// Assert or validate the 'result' as per your test conditions
","isPage":false,"text":"\nWith the contract deployed and the dispatcher instantiated, proceed to test your functions:\n// ... (previous setup code)\n \nlet result = create_card_system.create_card(\n // ... provide necessary parameters here\n);\n \n// Assert or validate the 'result' as per your test conditions","title":"Function Testing","titles":[null,"Migration Guide to 0.3.0","Testing Changes"]},"151":{"href":"/cairo/migration/0#migration-guide-to-040","html":"\n

[todo]

","isPage":true,"text":"\n[todo]","title":"Migration Guide to 0.4.0","titles":[null]},"152":{"href":"/client/sdk/c#dojo-c","html":"\n

c bindings

","isPage":true,"text":"\nc bindings","title":"Dojo c","titles":[]},"153":{"href":"/client/sdk/dojojs#dojojs","html":"","isPage":true,"text":"","title":"dojo.js","titles":[]},"154":{"href":"/toolchain/katana/development#development","html":"","isPage":true,"text":"","title":"Development","titles":[]},"155":{"href":"/toolchain/slot/overview#slot","html":"\n

Slot is a toolchain developed by Cartrige.gg for rapidly spinning up Katana and Torii instances. Play test your game in seconds.

\n","isPage":true,"text":"\nSlot is a toolchain developed by Cartrige.gg for rapidly spinning up Katana and Torii instances. Play test your game in seconds.\n","title":"Slot","titles":[]},"156":{"href":"/toolchain/slot/overview#installation","html":"\n

Run the following command to install slot:

\n
curl -L https://slot.cartridge.sh | bash
\n

Once finished, run slotup to manage slot installations and follow the outputted directions.

\n","isPage":false,"text":"\nRun the following command to install slot:\ncurl -L https://slot.cartridge.sh | bash\nOnce finished, run slotup to manage slot installations and follow the outputted directions.\n","title":"Installation","titles":["Slot"]},"157":{"href":"/toolchain/slot/overview#deploy-using-slot","html":"\n

To deploy your projects using slot, check out the tutorial Deploy using Slot.

\n
\n

📚 Reference

\n

See the slot Reference for a complete overview of all the available subcommands.

\n
","isPage":false,"text":"\nTo deploy your projects using slot, check out the tutorial Deploy using Slot.\n\n📚 Reference\nSee the slot Reference for a complete overview of all the available subcommands.\n","title":"Deploy using Slot","titles":["Slot"]},"158":{"href":"/toolchain/slot/reference#slot-reference","html":"\n","isPage":true,"text":"\n","title":"slot reference","titles":[null]},"159":{"href":"/toolchain/slot/reference#name","html":"\n

slot - a toolchain developed for rapidly spinning up Katana and Torii instances.

\n","isPage":false,"text":"\nslot - a toolchain developed for rapidly spinning up Katana and Torii instances.\n","title":"Name","titles":[null,"slot reference"]},"160":{"href":"/toolchain/slot/reference#usage","html":"\n
slot [COMMANDS] [OPTIONS]
\n","isPage":false,"text":"\nslot [COMMANDS] [OPTIONS]\n","title":"Usage","titles":[null,"slot reference"]},"161":{"href":"/toolchain/slot/reference#commands","html":"\n

auth
\n     Manage auth credentials for the Slot CLI.

\n

deployments

\n

     Manage Slot deployments.

\n

help
\n     Print this message or the help of the given subcommand(s)

","isPage":false,"text":"\nauth\n     Manage auth credentials for the Slot CLI.\ndeployments\n     Manage Slot deployments.\nhelp\n     Print this message or the help of the given subcommand(s)","title":"Commands","titles":[null,"slot reference"]},"162":{"href":"/toolchain/torii/graphql#torii---graphql","html":"\n","isPage":true,"text":"\n","title":"Torii - GraphQL","titles":[null]},"163":{"href":"/toolchain/torii/graphql#name","html":"\n

In Dojo, you have access to custom queries and subscriptions that are specifically designed to work with the caller for client applications. GraphQL is the technology that makes this possible.

\n

GraphQL is the rising star of backend technologies. It replaces REST as an API design paradigm and is becoming the new standard for exposing the data and functionality of a web server. It allows you to specify exactly what data you want to retrieve, and it delivers that data in a structured JSON format. This flexibility in data retrieval ensures that you get the information you need efficiently and in a format that's easy to work with.

\n","isPage":false,"text":"\nIn Dojo, you have access to custom queries and subscriptions that are specifically designed to work with the caller for client applications. GraphQL is the technology that makes this possible.\nGraphQL is the rising star of backend technologies. It replaces REST as an API design paradigm and is becoming the new standard for exposing the data and functionality of a web server. It allows you to specify exactly what data you want to retrieve, and it delivers that data in a structured JSON format. This flexibility in data retrieval ensures that you get the information you need efficiently and in a format that's easy to work with.\n","title":"Name","titles":[null,"Torii - GraphQL"]},"164":{"href":"/toolchain/torii/graphql#graphql-playground","html":"\n

GraphQL Playground is a GraphQL IDE that allows you to interactively explore the functionality of a GraphQL API by sending queries and mutations to it. It’s somewhat similar to Postman which offers comparable functionality for REST APIs.

\n","isPage":false,"text":"\nGraphQL Playground is a GraphQL IDE that allows you to interactively explore the functionality of a GraphQL API by sending queries and mutations to it. It’s somewhat similar to Postman which offers comparable functionality for REST APIs.\n","title":"GraphQL Playground","titles":[null,"Torii - GraphQL","Name"]},"165":{"href":"/toolchain/torii/graphql#usage","html":"\n","isPage":false,"text":"\n","title":"USAGE","titles":[null,"Torii - GraphQL"]},"166":{"href":"/toolchain/torii/graphql#pre-requisites","html":"\n

Make sure torii is running in your local terminal.

\n
torii --world <WORLD_ADDRESS>
\n

It starts GraphQL server at http://0.0.0.0:8080/graphql

\n

After the torii server starts on your local machine, you're ready to make query and subscription operations.

\n","isPage":false,"text":"\nMake sure torii is running in your local terminal.\ntorii --world <WORLD_ADDRESS>\nIt starts GraphQL server at http://0.0.0.0:8080/graphql\nAfter the torii server starts on your local machine, you're ready to make query and subscription operations.\n","title":"Pre-requisites","titles":[null,"Torii - GraphQL","USAGE"]},"167":{"href":"/toolchain/torii/graphql#schema-and-query-defintions","html":"\n

Torii generates both the schema and queries at runtime specific to your world. There are mainly two groups of queries, predefined queries and dynamically generated custom queries.

\n

Predefined queries like entities provide a generic entry point to the entities data of the world. Custom queries on the other hand are built according to the models of the world. Each model has a correpsonding {name}Models query and retrieves the associated model data. For example: positionModels.

\n

The benefit of custom queries becomes apparent when filtering and sorting is needed. They allow much more finer control of the returned dataset.

\n","isPage":false,"text":"\nTorii generates both the schema and queries at runtime specific to your world. There are mainly two groups of queries, predefined queries and dynamically generated custom queries.\nPredefined queries like entities provide a generic entry point to the entities data of the world. Custom queries on the other hand are built according to the models of the world. Each model has a correpsonding {name}Models query and retrieves the associated model data. For example: positionModels.\nThe benefit of custom queries becomes apparent when filtering and sorting is needed. They allow much more finer control of the returned dataset.\n","title":"Schema and query defintions","titles":[null,"Torii - GraphQL"]},"168":{"href":"/toolchain/torii/graphql#query-operation","html":"\n

In hello-dojo we fetched some data from the Moves model. This time let's fetch only id, name, classHash fields from Position model .

\n
query {\n  model(id: "Position") {\n    id\n    name\n    classHash\n  }\n}
\n

After you run the query, you will receive an output like this:

\n
{\n  "data": {\n    "model": {\n      "id": "Position",\n      "name": "Position",\n      "classHash": "0x6ffc643cbc4b2fb9c424242b18175a5e142269b45f4463d1cd4dddb7a2e5095"\n    }\n  }\n}
\n

Great! If you're wondering about the number of fields a Model has or the details of a Entities, you can find all the information about the schema definition in the Documentation Explorer section of the GraphQL IDE. It's your go-to place for exploring the rest of the documentation.

\n

Now lets retrieve more data from Moves model.

\n
query {\n  movesModels {\n    edges {\n      node {\n        player\n        remaining\n        last_direction\n      }\n    }\n  }\n}
\n

After you run the query, you will receive an output like this:

\n
{\n  "data": {\n    "movesModels": {\n      "edges": [\n        {\n          "node": {\n            "player": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n            "remaining": 10,\n            "last_direction": "None"\n          }\n        }\n      ]\n    }\n  }\n}
\n","isPage":false,"text":"\nIn hello-dojo we fetched some data from the Moves model. This time let's fetch only id, name, classHash fields from Position model .\nquery {\n model(id: "Position") {\n id\n name\n classHash\n }\n}\nAfter you run the query, you will receive an output like this:\n{\n "data": {\n "model": {\n "id": "Position",\n "name": "Position",\n "classHash": "0x6ffc643cbc4b2fb9c424242b18175a5e142269b45f4463d1cd4dddb7a2e5095"\n }\n }\n}\nGreat! If you're wondering about the number of fields a Model has or the details of a Entities, you can find all the information about the schema definition in the Documentation Explorer section of the GraphQL IDE. It's your go-to place for exploring the rest of the documentation.\nNow lets retrieve more data from Moves model.\nquery {\n movesModels {\n edges {\n node {\n player\n remaining\n last_direction\n }\n }\n }\n}\nAfter you run the query, you will receive an output like this:\n{\n "data": {\n "movesModels": {\n "edges": [\n {\n "node": {\n "player": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n "remaining": 10,\n "last_direction": "None"\n }\n }\n ]\n }\n }\n}\n","title":"Query operation","titles":[null,"Torii - GraphQL"]},"169":{"href":"/toolchain/torii/graphql#transactions","html":"\n

GraphQL additionally offers an API to fetch transactions emitted from your world. Presently, you can retrieve transaction data with the potential for future support of transaction receipt. Current API includes pagination support, although filtering is not yet supported. Let's explore an example.

\n
query{\n  transactions{\n    edges{\n      node{\n        id\n        transactionHash\n        senderAddress\n        calldata\n      }\n    }\n    totalCount\n  }\n}
\n

If you execute this query after you applied sozo migrate in your hello-dojo example. You will get an output similar to this.

\n
{\n  "data": {\n    "transactions": {\n      "edges": [\n        {\n          "node": {\n            "id": "0x000000000000000000000000000000000000000000000000000000000000000a:0x0000",\n            "transactionHash": "0x2da3d65e223362c72906f97663a4e7dc81ab0bbd04bbde5532a230c1e97d93e",\n            "senderAddress": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n            "calldata": [\n              "0x1",\n              "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",\n              "0x2730079d734ee55315f4f141eaed376bddd8c2133523d223a344c5604e0f7f8",\n              "0x0",\n              "0x2",\n              "0x2",\n              "0x35ec9fd22092dc0c8fc9341e94d5f361924d921c128fa46a0648f2dac519ce4",\n              "0x2ffecbe8de6c7c10c785a6eb964ee6489f8dcf139000adbe2c0f12d249be7d8"\n            ]\n          }\n        },\n        {\n          "node": {\n            "id": "0x0000000000000000000000000000000000000000000000000000000000000008:0x0000",\n            "transactionHash": "0x2aa02de0e3fa582b3cb6cf9e4371051f44ae2e0d6c94f5c936338ffc8c2ac12",\n            "senderAddress": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n            "calldata": [\n              "0x2",\n              "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",\n              "0x1e7875674bcb09daaf984cbf77264ac98120cb39e6d17522520defcdc347476",\n              "0x0",\n              "0x1",\n              "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",\n              "0x1e7875674bcb09daaf984cbf77264ac98120cb39e6d17522520defcdc347476",\n              "0x1",\n              "0x1",\n              "0x2",\n              "0x2e5174b54aef0b99d4685827ffa51488447e1f5607908293d5c715d6bd22433",\n              "0x6a11b5b3003a3aa0ae7f8f443e48314cc0bc51eaea7c3ed1c19beb909f5dda3"\n            ]\n          }\n        },\n        {\n          "node": {\n            "id": "0x0000000000000000000000000000000000000000000000000000000000000005:0x0000",\n            "transactionHash": "0x1f03fa7dc5a673f96d53b728785a98d6ff089c182a7bb32735b150e91817e5b",\n            "senderAddress": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n            "calldata": [\n              "0x1",\n              "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf",\n              "0x1987cbd17808b9a23693d4de7e246a443cfe37e6e7fbaeabd7d7e6532b07c3d",\n              "0x0",\n              "0x6",\n              "0x6",\n              "0xb3e374b8087dca92601afbb9881fed855ac0d568e3bf878a876fca5ffcb479",\n              "0x41d7f42bf7a362f0420aaae66d7a91df981100a039ac116a1d9cb632c74ad27",\n              "0x0",\n              "0x2",\n              "0x59f31686991d7cac25a7d4844225b9647c89e3e1e2d03460dbc61e3fbfafc59",\n              "0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f"\n            ]\n          }\n        }\n      ],\n      "totalCount": 3\n    }\n  }\n}
\n

Now feel free to play around with the query by removing any fields from the selection set and observe the responses sent by the server. It is your turn to create any kind of query for entities and models!

\n","isPage":false,"text":"\nGraphQL additionally offers an API to fetch transactions emitted from your world. Presently, you can retrieve transaction data with the potential for future support of transaction receipt. Current API includes pagination support, although filtering is not yet supported. Let's explore an example.\nquery{\n transactions{\n edges{\n node{\n id\n transactionHash\n senderAddress\n calldata\n }\n }\n totalCount\n }\n}\nIf you execute this query after you applied sozo migrate in your hello-dojo example. You will get an output similar to this.\n{\n "data": {\n "transactions": {\n "edges": [\n {\n "node": {\n "id": "0x000000000000000000000000000000000000000000000000000000000000000a:0x0000",\n "transactionHash": "0x2da3d65e223362c72906f97663a4e7dc81ab0bbd04bbde5532a230c1e97d93e",\n "senderAddress": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n "calldata": [\n "0x1",\n "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",\n "0x2730079d734ee55315f4f141eaed376bddd8c2133523d223a344c5604e0f7f8",\n "0x0",\n "0x2",\n "0x2",\n "0x35ec9fd22092dc0c8fc9341e94d5f361924d921c128fa46a0648f2dac519ce4",\n "0x2ffecbe8de6c7c10c785a6eb964ee6489f8dcf139000adbe2c0f12d249be7d8"\n ]\n }\n },\n {\n "node": {\n "id": "0x0000000000000000000000000000000000000000000000000000000000000008:0x0000",\n "transactionHash": "0x2aa02de0e3fa582b3cb6cf9e4371051f44ae2e0d6c94f5c936338ffc8c2ac12",\n "senderAddress": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n "calldata": [\n "0x2",\n "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",\n "0x1e7875674bcb09daaf984cbf77264ac98120cb39e6d17522520defcdc347476",\n "0x0",\n "0x1",\n "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",\n "0x1e7875674bcb09daaf984cbf77264ac98120cb39e6d17522520defcdc347476",\n "0x1",\n "0x1",\n "0x2",\n "0x2e5174b54aef0b99d4685827ffa51488447e1f5607908293d5c715d6bd22433",\n "0x6a11b5b3003a3aa0ae7f8f443e48314cc0bc51eaea7c3ed1c19beb909f5dda3"\n ]\n }\n },\n {\n "node": {\n "id": "0x0000000000000000000000000000000000000000000000000000000000000005:0x0000",\n "transactionHash": "0x1f03fa7dc5a673f96d53b728785a98d6ff089c182a7bb32735b150e91817e5b",\n "senderAddress": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n "calldata": [\n "0x1",\n "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf",\n "0x1987cbd17808b9a23693d4de7e246a443cfe37e6e7fbaeabd7d7e6532b07c3d",\n "0x0",\n "0x6",\n "0x6",\n "0xb3e374b8087dca92601afbb9881fed855ac0d568e3bf878a876fca5ffcb479",\n "0x41d7f42bf7a362f0420aaae66d7a91df981100a039ac116a1d9cb632c74ad27",\n "0x0",\n "0x2",\n "0x59f31686991d7cac25a7d4844225b9647c89e3e1e2d03460dbc61e3fbfafc59",\n "0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f"\n ]\n }\n }\n ],\n "totalCount": 3\n }\n }\n}\nNow feel free to play around with the query by removing any fields from the selection set and observe the responses sent by the server. It is your turn to create any kind of query for entities and models!\n","title":"Transactions","titles":[null,"Torii - GraphQL","Query operation"]},"170":{"href":"/toolchain/torii/graphql#pagination","html":"\n

As the entities in your world grows, fetching all of that data at once can become inefficient and slow.

\n

Torii provides two methods to address this - cursor or offset/limit based pagination. To keep the return type consistent, both methods will return a Connection type.

\n

You can read more about graphql pagination here.

\n","isPage":false,"text":"\nAs the entities in your world grows, fetching all of that data at once can become inefficient and slow.\nTorii provides two methods to address this - cursor or offset/limit based pagination. To keep the return type consistent, both methods will return a Connection type.\nYou can read more about graphql pagination here.\n","title":"Pagination","titles":[null,"Torii - GraphQL","Query operation"]},"171":{"href":"/toolchain/torii/graphql#cursor","html":"\n

Cursor based pagination is the most efficient, allowing us to query a subset or slice of the entire set of data. Both forward and backward pagination are supported using a combination of first, last, before, after input arguments.

\n

Forward pagination uses first/after and backward pagination uses last/before. first/last are integers representing the number of items to return. after/before are the cursors to paginate from.

\n

Query for first page of 2 entities

\n
query {\n  entities (first: 2) {\n    totalCount\n    edges {\n      cursor\n      node {\n        ...\n      }\n    }\n  }\n}
\n

Result shows there are 5 entities and returns the first two

\n
{\n  "entities" {\n    "totalCount": 5,\n    "edges" [\n      {\n        "cursor": "Y3Vyc29yX29uZQ==",\n        "node" : { }\n      },\n      {\n        "cursor": "Y3Vyc29yX3R3bw==",\n        "node" : { }\n      },\n    ]\n  }\n}
\n

Query 3 entities after the second node (last 3)

\n
query {\n  entities (first: 3, after: "Y3Vyc29yX3R3bw==") {\n    ...\n  }\n}
\n","isPage":false,"text":"\nCursor based pagination is the most efficient, allowing us to query a subset or slice of the entire set of data. Both forward and backward pagination are supported using a combination of first, last, before, after input arguments.\nForward pagination uses first/after and backward pagination uses last/before. first/last are integers representing the number of items to return. after/before are the cursors to paginate from.\nQuery for first page of 2 entities\nquery {\n entities (first: 2) {\n totalCount\n edges {\n cursor\n node {\n ...\n }\n }\n }\n}\nResult shows there are 5 entities and returns the first two\n{\n "entities" {\n "totalCount": 5,\n "edges" [\n {\n "cursor": "Y3Vyc29yX29uZQ==",\n "node" : { }\n },\n {\n "cursor": "Y3Vyc29yX3R3bw==",\n "node" : { }\n },\n ]\n }\n}\nQuery 3 entities after the second node (last 3)\nquery {\n entities (first: 3, after: "Y3Vyc29yX3R3bw==") {\n ...\n }\n}\n","title":"Cursor","titles":[null,"Torii - GraphQL","Query operation","Pagination"]},"172":{"href":"/toolchain/torii/graphql#offsetlimit","html":"\n

Offset/limit based pagination can be more intuitive and easier to use. However, for very, very large datasets they can be inefficient.

\n
# essentially the same as the last query in cursor example\nquery {\n  entities (offset: 2, limit 3) {\n    ...\n  }\n}
\n","isPage":false,"text":"\nOffset/limit based pagination can be more intuitive and easier to use. However, for very, very large datasets they can be inefficient.\n# essentially the same as the last query in cursor example\nquery {\n entities (offset: 2, limit 3) {\n ...\n }\n}\n","title":"Offset/limit","titles":[null,"Torii - GraphQL","Query operation","Pagination"]},"173":{"href":"/toolchain/torii/graphql#subscription-operations","html":"\n

Subscriptions are a GraphQL feature that allows a server to send data to its clients when a specific event happens. Subscriptions are usually implemented with WebSockets. In that setup, the server maintains a steady connection to its subscribed client. This also breaks the “Request-Response-Cycle” that is used for with REST APIs.

\n

Instead, the client initially opens up a long-lived connection to the server by sending a subscription query that specifies which event it is interested in. Every time this particular event happens, the server uses the connection to push the event data to the subscribed client(s).

\n

In this example, you can listen when an Model is registered by executing this subscription

\n
subscription modelRegistered {\n  modelRegistered {\n    id\n    name\n  }\n}
\n

Graphql also supports subscription to a targeted entity or model, for this we have to pass its id as an argument

\n

In this example, our server provides a entityUpdated subscription, which should notify clients whenever an entity with id 0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20 is updated. On the same subscription we can get the model(components) values of the updated entity . A client can execute a subscription that looks like this:

\n
subscription {\n  entityUpdated(\n    id: "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20"\n  ) {\n    id\n    keys\n    eventId\n    createdAt\n    updatedAt\n    models {\n      __typename\n      ... on Moves {\n        remaining\n        player\n      }\n      ... on Position {\n        vec {\n          x\n          y\n        }\n      }\n    }\n  }\n}
\n

According to your input, you will receive an output like this:

\n
{\n  "data": {\n    "entityUpdated": {\n      "id": "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",\n      "keys": [\n        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\n      ],\n      "eventId": "0x0000000000000000000000000000000000000000000000000000000000000013:0x0000:0x0000",\n      "createdAt": "2023-10-17 11:39:42",\n      "updatedAt": "2023-10-17 11:52:48",\n      "models": [\n        {\n          "__typename": "Moves",\n          "remaining": 10,\n          "player": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\n        },\n        {\n          "__typename": "Position",\n          "vec": {\n            "x": 10,\n            "y": 10\n          }\n        }\n      ]\n    }\n  }\n}
\n","isPage":false,"text":"\nSubscriptions are a GraphQL feature that allows a server to send data to its clients when a specific event happens. Subscriptions are usually implemented with WebSockets. In that setup, the server maintains a steady connection to its subscribed client. This also breaks the “Request-Response-Cycle” that is used for with REST APIs.\nInstead, the client initially opens up a long-lived connection to the server by sending a subscription query that specifies which event it is interested in. Every time this particular event happens, the server uses the connection to push the event data to the subscribed client(s).\nIn this example, you can listen when an Model is registered by executing this subscription\nsubscription modelRegistered {\n modelRegistered {\n id\n name\n }\n}\nGraphql also supports subscription to a targeted entity or model, for this we have to pass its id as an argument\nIn this example, our server provides a entityUpdated subscription, which should notify clients whenever an entity with id 0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20 is updated. On the same subscription we can get the model(components) values of the updated entity . A client can execute a subscription that looks like this:\nsubscription {\n entityUpdated(\n id: "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20"\n ) {\n id\n keys\n eventId\n createdAt\n updatedAt\n models {\n __typename\n ... on Moves {\n remaining\n player\n }\n ... on Position {\n vec {\n x\n y\n }\n }\n }\n }\n}\nAccording to your input, you will receive an output like this:\n{\n "data": {\n "entityUpdated": {\n "id": "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",\n "keys": [\n "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\n ],\n "eventId": "0x0000000000000000000000000000000000000000000000000000000000000013:0x0000:0x0000",\n "createdAt": "2023-10-17 11:39:42",\n "updatedAt": "2023-10-17 11:52:48",\n "models": [\n {\n "__typename": "Moves",\n "remaining": 10,\n "player": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\n },\n {\n "__typename": "Position",\n "vec": {\n "x": 10,\n "y": 10\n }\n }\n ]\n }\n }\n}\n","title":"Subscription operations","titles":[null,"Torii - GraphQL"]},"174":{"href":"/toolchain/torii/graphql#susbcription-to-events","html":"\n

A valuable approach for harnessing the power of GraphQL is by actively monitoring the events emitted throughout your game. This allows you to extract essential information such as key values, data, and transaction hashes. These events are customizable and can be filtered based on keys, much like entities query, and they seamlessly support pagination. In the subsequent example, we will demonstrate how to listen for any event emitted within your program.

\n
subscription {\n  eventEmitted {\n    id\n    keys\n    data\n    transactionHash\n  }\n}
\n

If you execute this suscription after you applied sozo execute <ACTION_CONTRACT_ADDRESS> spawn in your hello-dojo example. You will get an output similar to this.

\n
{\n  "data": {\n    "eventEmitted": {\n      "id": "0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0000",\n      "keys": [\n        "0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d"\n      ],\n      "data": [\n        "0x4d6f766573",\n        "0x1",\n        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n        "0x0",\n        "0x2",\n        "0x64",\n        "0x0"\n      ],\n      "transactionHash": "0x3b7b034a087355c996abb52e363932c1135f8dd49587bc9a05902d3cf0650b"\n    }\n  }\n}\n-----------------------------------------------------------------------------------------------\n{\n  "data": {\n    "eventEmitted": {\n      "id": "0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0001",\n      "keys": [\n        "0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d"\n      ],\n      "data": [\n        "0x506f736974696f6e",\n        "0x1",\n        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n        "0x0",\n        "0x2",\n        "0xa",\n        "0xa"\n      ],\n      "transactionHash": "0x3b7b034a087355c996abb52e363932c1135f8dd49587bc9a05902d3cf0650b"\n    }\n  }\n}
","isPage":false,"text":"\nA valuable approach for harnessing the power of GraphQL is by actively monitoring the events emitted throughout your game. This allows you to extract essential information such as key values, data, and transaction hashes. These events are customizable and can be filtered based on keys, much like entities query, and they seamlessly support pagination. In the subsequent example, we will demonstrate how to listen for any event emitted within your program.\nsubscription {\n eventEmitted {\n id\n keys\n data\n transactionHash\n }\n}\nIf you execute this suscription after you applied sozo execute <ACTION_CONTRACT_ADDRESS> spawn in your hello-dojo example. You will get an output similar to this.\n{\n "data": {\n "eventEmitted": {\n "id": "0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0000",\n "keys": [\n "0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d"\n ],\n "data": [\n "0x4d6f766573",\n "0x1",\n "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n "0x0",\n "0x2",\n "0x64",\n "0x0"\n ],\n "transactionHash": "0x3b7b034a087355c996abb52e363932c1135f8dd49587bc9a05902d3cf0650b"\n }\n }\n}\n-----------------------------------------------------------------------------------------------\n{\n "data": {\n "eventEmitted": {\n "id": "0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0001",\n "keys": [\n "0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d"\n ],\n "data": [\n "0x506f736974696f6e",\n "0x1",\n "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",\n "0x0",\n "0x2",\n "0xa",\n "0xa"\n ],\n "transactionHash": "0x3b7b034a087355c996abb52e363932c1135f8dd49587bc9a05902d3cf0650b"\n }\n }\n}","title":"Susbcription to events","titles":[null,"Torii - GraphQL","Subscription operations"]},"175":{"href":"/toolchain/torii/grpc#grpc","html":"\n

TL;DR

\n\n

You can use the gRPC directly or you can use it through a developed client. A great way to use it is via dojo.js torii-client package.

","isPage":true,"text":"\nTL;DR\n\ngRPC is an efficient way to fetch your data\nYou can subscribe to entity and model events via the gRPC\nRead more - gRPC\n\nYou can use the gRPC directly or you can use it through a developed client. A great way to use it is via dojo.js torii-client package.","title":"gRPC","titles":[null]},"176":{"href":"/toolchain/torii/overview#torii","html":"\n

Torii is an automatic indexer and client for dojo worlds. Built in rust to be blazingly fast and exceptionally scalable. Torii provides a fully typed, dynamically generated GraphqQL interface and a high performance gRPC api for binding clients to the world state. There are two parts to torii, the client and the server.

\n","isPage":true,"text":"\nTorii is an automatic indexer and client for dojo worlds. Built in rust to be blazingly fast and exceptionally scalable. Torii provides a fully typed, dynamically generated GraphqQL interface and a high performance gRPC api for binding clients to the world state. There are two parts to torii, the client and the server.\n","title":"Torii","titles":[null]},"177":{"href":"/toolchain/torii/overview#torii-server","html":"\n

The torii server comprises of the rust backend that exposes the graphql and gRPC endpoints.

\n","isPage":false,"text":"\nThe torii server comprises of the rust backend that exposes the graphql and gRPC endpoints.\n","title":"Torii Server","titles":[null,"Torii"]},"178":{"href":"/toolchain/torii/overview#torii-client","html":"\n

Torii client interfaces with the server to provide an easy to use api for your clients:

\n\n","isPage":false,"text":"\nTorii client interfaces with the server to provide an easy to use api for your clients:\n\nwasm\nunity\nc\n\n","title":"Torii Client","titles":[null,"Torii"]},"179":{"href":"/toolchain/torii/overview#usage","html":"\n

Torii leverages world introspection to bootstrap directly from an onchain deployment. Simply run:

\n
torii --world <World Address>
\n

You'll have a GraphQL API running at http://localhost:8080/graphql and a gRPC api at http://localhost:8080

\n","isPage":false,"text":"\nTorii leverages world introspection to bootstrap directly from an onchain deployment. Simply run:\ntorii --world <World Address>\nYou'll have a GraphQL API running at http://localhost:8080/graphql and a gRPC api at http://localhost:8080\n","title":"Usage","titles":[null,"Torii"]},"180":{"href":"/toolchain/torii/overview#installation","html":"\n

The torii binary can be installed via dojoup, our dedicated installation package manager.

\n","isPage":false,"text":"\nThe torii binary can be installed via dojoup, our dedicated installation package manager.\n","title":"Installation","titles":[null]},"181":{"href":"/toolchain/torii/overview#installing-from-source","html":"\n

If you prefer to install from the source code:

\n
cargo install --path ./crates/torii --profile local --force
\n

This will install Torii and the required dependencies on your local system.

\n
\n

📚 Reference

\n

See the torii Reference for a complete reference.

\n
","isPage":false,"text":"\nIf you prefer to install from the source code:\ncargo install --path ./crates/torii --profile local --force\nThis will install Torii and the required dependencies on your local system.\n\n📚 Reference\nSee the torii Reference for a complete reference.\n","title":"Installing from Source","titles":[null,"Installation"]},"182":{"href":"/toolchain/torii/reference#torii-reference","html":"\n","isPage":true,"text":"\n","title":"torii reference","titles":[null]},"183":{"href":"/toolchain/torii/reference#name","html":"\n

torii - An automatic indexer and networking layer for a world contract.

\n","isPage":false,"text":"\ntorii - An automatic indexer and networking layer for a world contract.\n","title":"Name","titles":[null,"torii reference"]},"184":{"href":"/toolchain/torii/reference#usage","html":"\n
torii [OPTIONS]
\n","isPage":false,"text":"\ntorii [OPTIONS]\n","title":"USAGE","titles":[null,"torii reference"]},"185":{"href":"/toolchain/torii/reference#description","html":"\n

torii starts the indexer and exposes GraphQL/gRPC API endpoints. The indexer queries the specified Starknet RPC endpoint for transaction blocks and listens for transactions related to the world contract. These transactions can include component/system registrations, entity state updates, system calls, and events. The parsed data is then stored in a local SQLite database.

\n

The GraphQL and gRPC API endpoints run in tandem with the indexer, providing custom queries specific to the world contract for client applications.

\n","isPage":false,"text":"\ntorii starts the indexer and exposes GraphQL/gRPC API endpoints. The indexer queries the specified Starknet RPC endpoint for transaction blocks and listens for transactions related to the world contract. These transactions can include component/system registrations, entity state updates, system calls, and events. The parsed data is then stored in a local SQLite database.\nThe GraphQL and gRPC API endpoints run in tandem with the indexer, providing custom queries specific to the world contract for client applications.\n","title":"DESCRIPTION","titles":[null,"torii reference"]},"186":{"href":"/toolchain/torii/reference#database-url","html":"\n

torii uses a sqlite database to store indexed data. The database can be stored either in-memory or persistently on the filesystem.

\n\n

Note: If using in-memory db, the memory will be garbage collected after a period of inactivity, causing queries to result in errors. Workaround is to use a persistent database.

\n
# Persistent database storage using file indexer.db\ntorii --database indexer.db
\n","isPage":false,"text":"\ntorii uses a sqlite database to store indexed data. The database can be stored either in-memory or persistently on the filesystem.\n\nThe in-memory database is ephemeral and only lasts as long as the indexer is running. This is a fast and simple option to start the indexer for development/testing.\nPersistent storage should be used in production. It relies on the local filesystem for storage.\n\nNote: If using in-memory db, the memory will be garbage collected after a period of inactivity, causing queries to result in errors. Workaround is to use a persistent database.\n# Persistent database storage using file indexer.db\ntorii --database indexer.db\n","title":"Database URL","titles":[null,"torii reference","DESCRIPTION"]},"187":{"href":"/toolchain/torii/reference#options","html":"\n","isPage":false,"text":"\n","title":"OPTIONS","titles":[null,"torii reference"]},"188":{"href":"/toolchain/torii/reference#general-options","html":"\n

-w, --world
\n     Address of the world contract to index

\n

--rpc
\n     Starknet RPC endpoint to use [default: http//localhost:5050]

\n

-d, --database <DATABASE>
\n     Database filepath (ex: indexer.db) [default: :memory:]

\n

-s, --start-block <START_BLOCK>
\n     Specify a block to start indexing from, ignored if stored head exists [default: 0]

\n

--allowed-origins <ALLOWED_ORIGINS>
\n     Specify allowed origins for api endpoints (comma-separated list of allowed origins, or "*" for all) [default: *]

\n

--external-url <EXTERNAL_URL>
\n     The external url of the server, used for configuring the GraphQL Playground in a hosted environment

\n

-h, --help\n     Print help

\n

-V, --version\n     Print version

","isPage":false,"text":"\n-w, --world\n     Address of the world contract to index\n--rpc\n     Starknet RPC endpoint to use [default: http//localhost:5050]\n-d, --database <DATABASE>\n     Database filepath (ex: indexer.db) [default: :memory:]\n-s, --start-block <START_BLOCK>\n     Specify a block to start indexing from, ignored if stored head exists [default: 0]\n--allowed-origins <ALLOWED_ORIGINS>\n     Specify allowed origins for api endpoints (comma-separated list of allowed origins, or "*" for all) [default: *]\n--external-url <EXTERNAL_URL>\n     The external url of the server, used for configuring the GraphQL Playground in a hosted environment\n-h, --help\n     Print help\n-V, --version\n     Print version","title":"General Options","titles":[null,"torii reference","OPTIONS"]},"189":{"href":"/toolchain/sozo/development#development","html":"","isPage":true,"text":"","title":"Development","titles":[]},"190":{"href":"/toolchain/sozo/overview#sozo","html":"\n

sozo is a powerful all-in-one tool for managing your Dojo projects. It helps with everything from scaffolding a new project, all the way to deploying and interacting with your Dojo Worlds. It includes a migration planning tool, designed to streamline the updating and deployment of AWs. It provides a robust command-line interface (CLI) that simplifies World management tasks, enabling you to focus on the creative aspects of World-building. In the future, it may include a GUI.

\n","isPage":true,"text":"\nsozo is a powerful all-in-one tool for managing your Dojo projects. It helps with everything from scaffolding a new project, all the way to deploying and interacting with your Dojo Worlds. It includes a migration planning tool, designed to streamline the updating and deployment of AWs. It provides a robust command-line interface (CLI) that simplifies World management tasks, enabling you to focus on the creative aspects of World-building. In the future, it may include a GUI.\n","title":"Sozo","titles":[null]},"191":{"href":"/toolchain/sozo/overview#features","html":"\n\n","isPage":false,"text":"\n\nBinary CLI: Sozo provides an intuitive binary CLI, ensuring easy management of your Worlds, whether you're updating existing ones or deploying new ones.\n\n","title":"Features","titles":[null]},"192":{"href":"/toolchain/sozo/overview#installation","html":"\n

sozo binary can be installed via dojoup, our dedicated installation package manager.

\n","isPage":false,"text":"\nsozo binary can be installed via dojoup, our dedicated installation package manager.\n","title":"Installation","titles":[null]},"193":{"href":"/toolchain/sozo/overview#installing-from-source","html":"\n
git clone https://github.com/dojoengine/dojo\ncd dojo\ncargo install --path ./crates/sozo --locked --force
\n

This will install Sozo and the required dependencies on your local system.

\n
\n

📚 Reference

\n

See the sozo Reference for a complete overview of all the available subcommands.

\n
","isPage":false,"text":"\ngit clone https://github.com/dojoengine/dojo\ncd dojo\ncargo install --path ./crates/sozo --locked --force\nThis will install Sozo and the required dependencies on your local system.\n\n📚 Reference\nSee the sozo Reference for a complete overview of all the available subcommands.\n","title":"Installing from Source","titles":[null,"Installation"]},"194":{"href":"/toolchain/sozo/reference#sozo-reference","html":"\n","isPage":true,"text":"\n","title":"sozo reference","titles":[null]},"195":{"href":"/toolchain/sozo/reference#common-options","html":"\n\n","isPage":false,"text":"\n\nprofile\noffline\n\n","title":"Common options","titles":[null,"sozo reference"]},"196":{"href":"/toolchain/sozo/reference#project-commands","html":"\n\n","isPage":false,"text":"\n\ninit\nbuild\ntest\nmigrate\n\n","title":"Project Commands","titles":[null,"sozo reference"]},"197":{"href":"/toolchain/sozo/reference#world-commands","html":"\n","isPage":false,"text":"\n\nexecute\nregister\nsystem\nmodel\nevents\nauth\n","title":"World Commands","titles":[null,"sozo reference"]},"198":{"href":"/tutorial/deploy-using-slot/main#deploy-your-game-using-slot","html":"\n

Welcome to this tutorial where we'll guide you through deploying a project using the Slot.

\n
\n

Before we start, make sure you are using the latest dojo version. Run dojoup to have the latest version installed.

\n

Now, let's create a new folder and initialize it with sozo.

\n
mkdir dojo-starter && cd dojo-starter\nsozo init
\n

First, we need to set up our configuration, starting by authenticating with Cartridge. To do this, run the following command, which will then prompt a new screen where you will need to go through the authentication process.

\n
slot auth login\n \n# Slot Auth debug (if old auth credentials):\nrm ~/Library/Application\\ Support/slot/credentials.json
\n

Once successful, you can create a new deployment with a unique DEPLOYMENT_NAME. To do this, run the following command:

\n
slot deployments create DEPLOYMENT_NAME katana
\n

After that, you should receive the RPC endpoint for the katana slot. Now, you can use that and update your Scarb.toml file with the new RPC endpoint as follows:

\n
[tool.dojo.env]\nrpc_url = "YOUR_NEW_RPC_URL"
\n

Now, you can stream katana in a new terminal. Open a new terminal and run the following command:

\n
slot deployments logs DEPLOYMENT_NAME katana -f
\n

Then, copy the account address and the private key from the first account into the Scarb.toml file and replace the existing ones as follows:

\n
account_address = "YOUR_NEW_ACCOUNT_ADDRESS"\nprivate_key = "YOUR_NEW_PRIVATE_KEY"
\n

Note: For each new Katana slot, a different account seed is used, making all the accounts unique!

\n
\n

Once finished with the new configurations, we are ready to build and migrate the project. To build the project, run the following command:

\n
sozo build
\n

Now, let's migrate the project to our new katana slot:

\n
sozo migrate --name YOUR_PROJECT_NAME
\n

If the migrations have been successful, you will receive the WORLD_ADDRESS, which then you can use to interact with your world.

\n
🎉 Successfully migrated World at address WORLD_ADDRESS\n \n Updating manifest.json...\n \n Done.\n 
\n

Congratulations! You have successfully deployed your project with a Katana slot.

\n","isPage":true,"text":"\nWelcome to this tutorial where we'll guide you through deploying a project using the Slot.\n\nBefore we start, make sure you are using the latest dojo version. Run dojoup to have the latest version installed.\nNow, let's create a new folder and initialize it with sozo.\nmkdir dojo-starter && cd dojo-starter\nsozo init\nFirst, we need to set up our configuration, starting by authenticating with Cartridge. To do this, run the following command, which will then prompt a new screen where you will need to go through the authentication process.\nslot auth login\n \n# Slot Auth debug (if old auth credentials):\nrm ~/Library/Application\\ Support/slot/credentials.json\nOnce successful, you can create a new deployment with a unique DEPLOYMENT_NAME. To do this, run the following command:\nslot deployments create DEPLOYMENT_NAME katana\nAfter that, you should receive the RPC endpoint for the katana slot. Now, you can use that and update your Scarb.toml file with the new RPC endpoint as follows:\n[tool.dojo.env]\nrpc_url = "YOUR_NEW_RPC_URL"\nNow, you can stream katana in a new terminal. Open a new terminal and run the following command:\nslot deployments logs DEPLOYMENT_NAME katana -f\nThen, copy the account address and the private key from the first account into the Scarb.toml file and replace the existing ones as follows:\naccount_address = "YOUR_NEW_ACCOUNT_ADDRESS"\nprivate_key = "YOUR_NEW_PRIVATE_KEY"\nNote: For each new Katana slot, a different account seed is used, making all the accounts unique!\n\nOnce finished with the new configurations, we are ready to build and migrate the project. To build the project, run the following command:\nsozo build\nNow, let's migrate the project to our new katana slot:\nsozo migrate --name YOUR_PROJECT_NAME\nIf the migrations have been successful, you will receive the WORLD_ADDRESS, which then you can use to interact with your world.\n🎉 Successfully migrated World at address WORLD_ADDRESS\n \n✨ Updating manifest.json...\n \n✨ Done.\n \nCongratulations! You have successfully deployed your project with a Katana slot.\n","title":"Deploy your game using Slot","titles":[]},"199":{"href":"/tutorial/deploy-using-slot/main#torii","html":"\n

To initiate a Torri indexer slot, execute the following command:

\n
slot deployments create DEPLOYMENT_NAME torii --world YOUR_WORLD_ADDRESS --rpc YOUR_NEW_RPC_URL --start-block 1
\n

Once deployment is successful, you should receive the endpoints for GraphQL and gRPC.

\n

If you wish to stream the logs, you can run the following command in a new terminal:

\n
slot deployments logs DEPLOYMENT_NAME torii -f
","isPage":false,"text":"\nTo initiate a Torri indexer slot, execute the following command:\nslot deployments create DEPLOYMENT_NAME torii --world YOUR_WORLD_ADDRESS --rpc YOUR_NEW_RPC_URL --start-block 1\nOnce deployment is successful, you should receive the endpoints for GraphQL and gRPC.\nIf you wish to stream the logs, you can run the following command in a new terminal:\nslot deployments logs DEPLOYMENT_NAME torii -f","title":"Torii","titles":["Deploy your game using Slot"]},"200":{"href":"/tutorial/onchain-chess/0-setup#0-setup","html":"\n

Before starting recommend following the hello-dojo chapter to gain a basic understanding of the Dojo game.

\n","isPage":true,"text":"\nBefore starting recommend following the hello-dojo chapter to gain a basic understanding of the Dojo game.\n","title":"0. Setup","titles":[]},"201":{"href":"/tutorial/onchain-chess/0-setup#initializing-the-project","html":"\n

Create a new Dojo project folder. You can name your project what you want.

\n
mkdir chess
\n

Open the project folder.

\n
cd chess
\n

And initialize the project using sozo init.

\n
sozo init
\n","isPage":false,"text":"\nCreate a new Dojo project folder. You can name your project what you want.\nmkdir chess\nOpen the project folder.\ncd chess\nAnd initialize the project using sozo init.\nsozo init\n","title":"Initializing the Project","titles":["0. Setup"]},"202":{"href":"/tutorial/onchain-chess/0-setup#cleaning-up-the-boilerplate","html":"\n

The project comes with a lot of boilerplate codes. Clear it all. Make sure your directory looks like this

\n
├── README.md\n├── Scarb.toml\n└── src\n    ├── actions.cairo\n    ├── lib.cairo\n    ├── models\n   ├── game.cairo\n   ├── piece.cairo\n   └── player.cairo\n    ├── models.cairo\n    ├── tests\n   ├── integration.cairo\n   └── units.cairo\n    └── tests.cairo
\n

Remodel your lib.cairo, to look like this :

\n
mod actions;\nmod models;\nmod tests;
\n

Remodel your models.cairo, to look like this :

\n
mod game;\nmod piece;\nmod player;
\n

Remodel your tests.cairo, to look like this :

\n
mod integration;\nmod units;
\n

Make sure your Scarb.toml looks like this:

\n
[package]\ncairo-version = "2.4.0"\nname = "chess"\nversion = "0.4.0"\n \n[cairo]\nsierra-replace-ids = true\n \n[dependencies]\ndojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.2" }\n \n[[target.dojo]]\n \n[tool.dojo]\ninitializer_class_hash = "0xbeef"\n \n[tool.dojo.env]\nrpc_url = "http://localhost:5050/"\n# Default account for katana with seed = 0\naccount_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\nprivate_key = "0x1800000000300000180000000000030000000000003006001800006600"\n 
\n

Compile your project with:

\n
sozo build
\n","isPage":false,"text":"\nThe project comes with a lot of boilerplate codes. Clear it all. Make sure your directory looks like this\n├── README.md\n├── Scarb.toml\n└── src\n ├── actions.cairo\n ├── lib.cairo\n ├── models\n │ ├── game.cairo\n │ ├── piece.cairo\n │ └── player.cairo\n ├── models.cairo\n ├── tests\n │ ├── integration.cairo\n │ └── units.cairo\n └── tests.cairo\nRemodel your lib.cairo, to look like this :\nmod actions;\nmod models;\nmod tests;\nRemodel your models.cairo, to look like this :\nmod game;\nmod piece;\nmod player;\nRemodel your tests.cairo, to look like this :\nmod integration;\nmod units;\nMake sure your Scarb.toml looks like this:\n[package]\ncairo-version = "2.4.0"\nname = "chess"\nversion = "0.4.0"\n \n[cairo]\nsierra-replace-ids = true\n \n[dependencies]\ndojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.2" }\n \n[[target.dojo]]\n \n[tool.dojo]\ninitializer_class_hash = "0xbeef"\n \n[tool.dojo.env]\nrpc_url = "http://localhost:5050/"\n# Default account for katana with seed = 0\naccount_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\nprivate_key = "0x1800000000300000180000000000030000000000003006001800006600"\n \nCompile your project with:\nsozo build\n","title":"Cleaning Up the Boilerplate","titles":["0. Setup"]},"203":{"href":"/tutorial/onchain-chess/0-setup#basic-models","html":"\n

While there are many ways to design a chess game using the ECS model, we'll follow this approach:

\n
\n

Every square of the chess board (e.g., A1) will be treated as an entity. If a piece exists on a square position, that position will hold that piece.

\n
\n

First, add this basic player model to models/player.cairo file. If you are not familar with model syntax in Dojo engine, go back to this chapter.

\n
use starknet::ContractAddress;\n \n#[derive(Model, Drop, Serde)]\nstruct Player {\n    #[key]\n    game_id: u32,\n    #[key]\n    address: ContractAddress,\n    color: Color\n}\n \n#[derive(Serde, Drop, Copy, PartialEq, Introspect)]\nenum Color {\n    White,\n    Black,\n    None,\n}
\n

Second, we do the same for game model. Edit your models/player.cairo file and add this content.

\n
use chess::models::player::Color;\nuse starknet::ContractAddress;\n \n#[derive(Model, Drop, Serde)]\nstruct Game {\n    #[key]\n    game_id: u32,\n    winner: Color,\n    white: ContractAddress,\n    black: ContractAddress\n}\n \n#[derive(Model, Drop, Serde)]\nstruct GameTurn {\n    #[key]\n    game_id: u32,\n    player_color: Color\n}
\n

Lastly we create piece model in our models/player.cairo file.

\n
use chess::models::player::Color;\nuse starknet::ContractAddress;\n \n#[derive(Model, Drop, Serde)]\nstruct Piece {\n    #[key]\n    game_id: u32,\n    #[key]\n    position: Vec2,\n    color: Color,\n    piece_type: PieceType,\n}\n \n#[derive(Copy, Drop, Serde, Introspect)]\nstruct Vec2 {\n    x: u32,\n    y: u32\n}\n \n#[derive(Serde, Drop, Copy, PartialEq, Introspect)]\nenum PieceType {\n    Pawn,\n    Knight,\n    Bishop,\n    Rook,\n    Queen,\n    King,\n    None,\n}
\n","isPage":false,"text":"\nWhile there are many ways to design a chess game using the ECS model, we'll follow this approach:\n\nEvery square of the chess board (e.g., A1) will be treated as an entity. If a piece exists on a square position, that position will hold that piece.\n\nFirst, add this basic player model to models/player.cairo file. If you are not familar with model syntax in Dojo engine, go back to this chapter.\nuse starknet::ContractAddress;\n \n#[derive(Model, Drop, Serde)]\nstruct Player {\n #[key]\n game_id: u32,\n #[key]\n address: ContractAddress,\n color: Color\n}\n \n#[derive(Serde, Drop, Copy, PartialEq, Introspect)]\nenum Color {\n White,\n Black,\n None,\n}\nSecond, we do the same for game model. Edit your models/player.cairo file and add this content.\nuse chess::models::player::Color;\nuse starknet::ContractAddress;\n \n#[derive(Model, Drop, Serde)]\nstruct Game {\n #[key]\n game_id: u32,\n winner: Color,\n white: ContractAddress,\n black: ContractAddress\n}\n \n#[derive(Model, Drop, Serde)]\nstruct GameTurn {\n #[key]\n game_id: u32,\n player_color: Color\n}\nLastly we create piece model in our models/player.cairo file.\nuse chess::models::player::Color;\nuse starknet::ContractAddress;\n \n#[derive(Model, Drop, Serde)]\nstruct Piece {\n #[key]\n game_id: u32,\n #[key]\n position: Vec2,\n color: Color,\n piece_type: PieceType,\n}\n \n#[derive(Copy, Drop, Serde, Introspect)]\nstruct Vec2 {\n x: u32,\n y: u32\n}\n \n#[derive(Serde, Drop, Copy, PartialEq, Introspect)]\nenum PieceType {\n Pawn,\n Knight,\n Bishop,\n Rook,\n Queen,\n King,\n None,\n}\n","title":"Basic Models","titles":["0. Setup"]},"204":{"href":"/tutorial/onchain-chess/0-setup#basic-systems","html":"\n

Starting from the next chapter, you will implement the actions.cairo file. This is where our game logic/contract will reside.

\n

For now, actions.cairo should look like this:

\n
#[dojo::contract]\nmod actions {\n}
\n

It should be noted that Systems function are contract methods, by implication, rather than implementing the game logic in systems, we are implementing it in a contract.

\n","isPage":false,"text":"\nStarting from the next chapter, you will implement the actions.cairo file. This is where our game logic/contract will reside.\nFor now, actions.cairo should look like this:\n#[dojo::contract]\nmod actions {\n}\nIt should be noted that Systems function are contract methods, by implication, rather than implementing the game logic in systems, we are implementing it in a contract.\n","title":"Basic systems","titles":["0. Setup"]},"205":{"href":"/tutorial/onchain-chess/0-setup#compile-your-project","html":"\n

Now try sozo build to build.

\n

Complied? Great! then let's move on. If not fix the issues, so that you can run the sozo build command successfully.

\n","isPage":false,"text":"\nNow try sozo build to build.\nComplied? Great! then let's move on. If not fix the issues, so that you can run the sozo build command successfully.\n","title":"Compile your project","titles":["0. Setup"]},"206":{"href":"/tutorial/onchain-chess/0-setup#implement-traits-for-models","html":"\n

Before you move on, implement traits for models so we can use them in the next chapter when creating the action contract.

\n","isPage":false,"text":"\nBefore you move on, implement traits for models so we can use them in the next chapter when creating the action contract.\n","title":"Implement Traits for models","titles":["0. Setup"]},"207":{"href":"/tutorial/onchain-chess/0-setup#requirements","html":"\n

Firt we have to define the following traits for Game, Player, Piece models respectively.

\n
trait GameTurnTrait {\n    fn next_turn(self: @GameTurn) -> Color;\n}\n \ntrait PlayerTrait {\nfn is_not_my_piece(self: @Player, piece_color: Color) -> bool;\n}\n \ntrait PieceTrait {\nfn is_out_of_board(next_position: Vec2) -> bool;\nfn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool;\n}
\n

Try to implement this code by yourself, Otherwise

\n
Click to see full models.cairo code
// code for player.cairo file\ntrait PlayerTrait {\n    fn is_not_my_piece(self: @Player, piece_color: Color) -> bool;\n}\n \nimpl PalyerImpl of PlayerTrait {\n    fn is_not_my_piece(self: @Player, piece_color: Color) -> bool {\n        *self.color != piece_color\n    }\n}\n \n// code for game.cairo file\ntrait GameTurnTrait {\n    fn next_turn(self: @GameTurn) -> Color;\n}\nimpl GameTurnImpl of GameTurnTrait {\n    fn next_turn(self: @GameTurn) -> Color {\n        match self.player_color {\n            Color::White => Color::Black,\n            Color::Black => Color::White,\n            Color::None => panic(array!['Illegal turn'])\n        }\n    }\n}\n \n// code for piece.cairo file\ntrait PieceTrait {\n    fn is_out_of_board(next_position: Vec2) -> bool;\n    fn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool;\n}\n \nimpl PieceImpl of PieceTrait {\n    fn is_out_of_board(next_position: Vec2) -> bool {\n        next_position.x > 7 || next_position.y > 7\n    }\n \n    fn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool {\n        let n_x = next_position.x;\n        let n_y = next_position.y;\n        assert(!(n_x == *self.position.x && n_y == *self.position.y), 'Cannot move same position');\n        match self.piece_type {\n            PieceType::Pawn => {\n                match self.color {\n                    Color::White => {\n                        (n_x == *self.position.x && n_y == *self.position.y + 1)\n                            || (n_x == *self.position.x && n_y == *self.position.y + 2)\n                            || (n_x == *self.position.x + 1 && n_y == *self.position.y + 1)\n                            || (n_x == *self.position.x - 1 && n_y == *self.position.y + 1)\n                    },\n                    Color::Black => {\n                        (n_x == *self.position.x && n_y == *self.position.y - 1)\n                            || (n_x == *self.position.x && n_y == *self.position.y - 2)\n                            || (n_x == *self.position.x + 1 && n_y == *self.position.y - 1)\n                            || (n_x == *self.position.x - 1 && n_y == *self.position.y - 1)\n                    },\n                    Color::None => panic(array!['Should not move empty piece']),\n                }\n            },\n            PieceType::Knight => { n_x == *self.position.x + 2 && n_y == *self.position.y + 1 },\n            PieceType::Bishop => {\n                (n_x <= *self.position.x && n_y <= *self.position.y && *self.position.y\n                    - n_y == *self.position.x\n                    - n_x)\n                    || (n_x <= *self.position.x && n_y >= *self.position.y && *self.position.y\n                        - n_y == *self.position.x\n                        - n_x)\n                    || (n_x >= *self.position.x && n_y <= *self.position.y && *self.position.y\n                        - n_y == *self.position.x\n                        - n_x)\n                    || (n_x >= *self.position.x && n_y >= *self.position.y && *self.position.y\n                        - n_y == *self.position.x\n                        - n_x)\n            },\n            PieceType::Rook => {\n                (n_x == *self.position.x || n_y != *self.position.y)\n                    || (n_x != *self.position.x || n_y == *self.position.y)\n            },\n            PieceType::Queen => {\n                (n_x == *self.position.x || n_y != *self.position.y)\n                    || (n_x != *self.position.x || n_y == *self.position.y)\n                    || (n_x != *self.position.x || n_y != *self.position.y)\n            },\n            PieceType::King => {\n                (n_x <= *self.position.x + 1 && n_y <= *self.position.y + 1)\n                    || (n_x <= *self.position.x + 1 && n_y <= *self.position.y - 1)\n                    || (n_x <= *self.position.x - 1 && n_y <= *self.position.y + 1)\n                    || (n_x <= *self.position.x - 1 && n_y <= *self.position.y - 1)\n            },\n            PieceType::None => panic(array!['Should not move empty piece']),\n        }\n    }\n}
\n

This tutorial is extracted from here

\n

Congratulations! You've completed the basic setup for building an on-chain chess game 🎉

","isPage":false,"text":"\nFirt we have to define the following traits for Game, Player, Piece models respectively.\ntrait GameTurnTrait {\n fn next_turn(self: @GameTurn) -> Color;\n}\n \ntrait PlayerTrait {\nfn is_not_my_piece(self: @Player, piece_color: Color) -> bool;\n}\n \ntrait PieceTrait {\nfn is_out_of_board(next_position: Vec2) -> bool;\nfn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool;\n}\nTry to implement this code by yourself, Otherwise\nClick to see full models.cairo code// code for player.cairo file\ntrait PlayerTrait {\n fn is_not_my_piece(self: @Player, piece_color: Color) -> bool;\n}\n \nimpl PalyerImpl of PlayerTrait {\n fn is_not_my_piece(self: @Player, piece_color: Color) -> bool {\n *self.color != piece_color\n }\n}\n \n// code for game.cairo file\ntrait GameTurnTrait {\n fn next_turn(self: @GameTurn) -> Color;\n}\nimpl GameTurnImpl of GameTurnTrait {\n fn next_turn(self: @GameTurn) -> Color {\n match self.player_color {\n Color::White => Color::Black,\n Color::Black => Color::White,\n Color::None => panic(array!['Illegal turn'])\n }\n }\n}\n \n// code for piece.cairo file\ntrait PieceTrait {\n fn is_out_of_board(next_position: Vec2) -> bool;\n fn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool;\n}\n \nimpl PieceImpl of PieceTrait {\n fn is_out_of_board(next_position: Vec2) -> bool {\n next_position.x > 7 || next_position.y > 7\n }\n \n fn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool {\n let n_x = next_position.x;\n let n_y = next_position.y;\n assert(!(n_x == *self.position.x && n_y == *self.position.y), 'Cannot move same position');\n match self.piece_type {\n PieceType::Pawn => {\n match self.color {\n Color::White => {\n (n_x == *self.position.x && n_y == *self.position.y + 1)\n || (n_x == *self.position.x && n_y == *self.position.y + 2)\n || (n_x == *self.position.x + 1 && n_y == *self.position.y + 1)\n || (n_x == *self.position.x - 1 && n_y == *self.position.y + 1)\n },\n Color::Black => {\n (n_x == *self.position.x && n_y == *self.position.y - 1)\n || (n_x == *self.position.x && n_y == *self.position.y - 2)\n || (n_x == *self.position.x + 1 && n_y == *self.position.y - 1)\n || (n_x == *self.position.x - 1 && n_y == *self.position.y - 1)\n },\n Color::None => panic(array!['Should not move empty piece']),\n }\n },\n PieceType::Knight => { n_x == *self.position.x + 2 && n_y == *self.position.y + 1 },\n PieceType::Bishop => {\n (n_x <= *self.position.x && n_y <= *self.position.y && *self.position.y\n - n_y == *self.position.x\n - n_x)\n || (n_x <= *self.position.x && n_y >= *self.position.y && *self.position.y\n - n_y == *self.position.x\n - n_x)\n || (n_x >= *self.position.x && n_y <= *self.position.y && *self.position.y\n - n_y == *self.position.x\n - n_x)\n || (n_x >= *self.position.x && n_y >= *self.position.y && *self.position.y\n - n_y == *self.position.x\n - n_x)\n },\n PieceType::Rook => {\n (n_x == *self.position.x || n_y != *self.position.y)\n || (n_x != *self.position.x || n_y == *self.position.y)\n },\n PieceType::Queen => {\n (n_x == *self.position.x || n_y != *self.position.y)\n || (n_x != *self.position.x || n_y == *self.position.y)\n || (n_x != *self.position.x || n_y != *self.position.y)\n },\n PieceType::King => {\n (n_x <= *self.position.x + 1 && n_y <= *self.position.y + 1)\n || (n_x <= *self.position.x + 1 && n_y <= *self.position.y - 1)\n || (n_x <= *self.position.x - 1 && n_y <= *self.position.y + 1)\n || (n_x <= *self.position.x - 1 && n_y <= *self.position.y - 1)\n },\n PieceType::None => panic(array!['Should not move empty piece']),\n }\n }\n}\nThis tutorial is extracted from here\nCongratulations! You've completed the basic setup for building an on-chain chess game 🎉","title":"Requirements","titles":["0. Setup","Implement Traits for models"]},"208":{"href":"/tutorial/onchain-chess/2-move#2-move-function","html":"\n
    \n
  1. Write a move function that accepts the current position, next position, caller address, and game_id. The move function should look like this:
  2. \n
\n
    #[abi(embed_v0)]\n    impl PlayerActionsImpl of IActions<ContractState> {\n        fn spawn(\n            self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n        ) -> u32 {\n            // Rest of code\n        }\n        fn move(\n            self: @ContractState,\n            curr_position: Vec2,\n            next_position: Vec2,\n            caller: ContractAddress, //player\n            game_id: u32\n        ) {\n            let world = self.world_dispatcher.read();\n            let mut current_piece = get!(world, (game_id, curr_position), (Piece));\n            // check if next_position is out of board or not\n            assert(!PieceTrait::is_out_of_board(next_position), 'Should be inside board');\n \n            // check if this is the right move for this piece type\n            assert(\n                current_piece.is_right_piece_move(next_position), 'Illegal move for type of piece'\n            );\n            // Get piece data from to next_position in the board\n            let mut next_position_piece = get!(world, (game_id, next_position), (Piece));\n \n            let player = get!(world, (game_id, caller), (Player));\n            // check if there is already a piece in next_position\n            assert(\n                next_position_piece.piece_type == PieceType::None\n                    || player.is_not_my_piece(next_position_piece.color),\n                'Already same color piece exist'\n            );\n \n            next_position_piece.piece_type = current_piece.piece_type;\n            next_position_piece.color = player.color;\n            // make current_piece piece none\n            current_piece.piece_type = PieceType::None;\n            current_piece.color = Color::None;\n            set!(world, (next_position_piece));\n            set!(world, (current_piece));\n \n            // change turn\n            let mut game_turn = get!(world, game_id, (GameTurn));\n            game_turn.player_color = game_turn.next_turn();\n            set!(world, (game_turn));\n        }\n    }
\n
    \n
  1. \n

    Run sozo build to compile the code.

    \n

    Great, Now we can start testing our functions

    \n
  2. \n
\n","isPage":true,"text":"\n\nWrite a move function that accepts the current position, next position, caller address, and game_id. The move function should look like this:\n\n #[abi(embed_v0)]\n impl PlayerActionsImpl of IActions<ContractState> {\n fn spawn(\n self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n ) -> u32 {\n // Rest of code\n }\n fn move(\n self: @ContractState,\n curr_position: Vec2,\n next_position: Vec2,\n caller: ContractAddress, //player\n game_id: u32\n ) {\n let world = self.world_dispatcher.read();\n let mut current_piece = get!(world, (game_id, curr_position), (Piece));\n // check if next_position is out of board or not\n assert(!PieceTrait::is_out_of_board(next_position), 'Should be inside board');\n \n // check if this is the right move for this piece type\n assert(\n current_piece.is_right_piece_move(next_position), 'Illegal move for type of piece'\n );\n // Get piece data from to next_position in the board\n let mut next_position_piece = get!(world, (game_id, next_position), (Piece));\n \n let player = get!(world, (game_id, caller), (Player));\n // check if there is already a piece in next_position\n assert(\n next_position_piece.piece_type == PieceType::None\n || player.is_not_my_piece(next_position_piece.color),\n 'Already same color piece exist'\n );\n \n next_position_piece.piece_type = current_piece.piece_type;\n next_position_piece.color = player.color;\n // make current_piece piece none\n current_piece.piece_type = PieceType::None;\n current_piece.color = Color::None;\n set!(world, (next_position_piece));\n set!(world, (current_piece));\n \n // change turn\n let mut game_turn = get!(world, game_id, (GameTurn));\n game_turn.player_color = game_turn.next_turn();\n set!(world, (game_turn));\n }\n }\n\n\nRun sozo build to compile the code.\nGreat, Now we can start testing our functions\n\n\n","title":"2 Move function","titles":[]},"209":{"href":"/tutorial/onchain-chess/2-move#test-flow","html":"\n\n","isPage":false,"text":"\n\nSpawn the test world (spawn_test_world) that imports the models in testing.\nDeploy actions contract\nInteract with spawn function in the actions contract by providing white and black player's wallet addresses as inputs.\nRetrieve the game entity and piece entity created in actions contract.\nEnsure the game has been correctly created.\nVerify that each Piece is located in the correct position.\n\n","title":"Test Flow","titles":["2 Move function"]},"210":{"href":"/tutorial/onchain-chess/2-move#unit-tests","html":"\n\n
#[cfg(test)]\nmod tests {\n    use starknet::ContractAddress;\n    use dojo::test_utils::{spawn_test_world, deploy_contract};\n    use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};\n    use chess::models::player::{Player, Color, player};\n    use chess::models::piece::{Piece, PieceType, Vec2, piece};\n    use chess::models::game::{Game, GameTurn, game, game_turn};\n    use chess::actions::{actions, IActionsDispatcher, IActionsDispatcherTrait};\n \n    // helper setup function\n    fn setup_world() -> (IWorldDispatcher, IActionsDispatcher) {\n        // models\n        let mut models = array![\n            game::TEST_CLASS_HASH,\n            player::TEST_CLASS_HASH,\n            game_turn::TEST_CLASS_HASH,\n            piece::TEST_CLASS_HASH\n        ];\n        // deploy world with models\n        let world = spawn_test_world(models);\n \n        // deploy systems contract\n        let contract_address = world\n            .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());\n        let actions_system = IActionsDispatcher { contract_address };\n \n        (world, actions_system)\n    }\n \n    #[test]\n    #[available_gas(3000000000000000)]\n    fn test_spawn() {\n        let white = starknet::contract_address_const::<0x01>();\n        let black = starknet::contract_address_const::<0x02>();\n        let (world, actions_system) = setup_world();\n \n        //system calls\n        let game_id = actions_system.spawn(white, black);\n \n        //get game\n        let game = get!(world, game_id, (Game));\n        let game_turn = get!(world, game_id, (GameTurn));\n        assert(game_turn.player_color == Color::White, 'should be white turn');\n        assert(game.white == white, 'white address is incorrect');\n        assert(game.black == black, 'black address is incorrect');\n \n        //get a1 piece\n        let curr_pos = Vec2 { x: 0, y: 0 };\n        let a1 = get!(world, (game_id, curr_pos), (Piece));\n        assert(a1.piece_type == PieceType::Rook, 'should be Rook');\n        assert(a1.color == Color::White, 'should be white color');\n        assert(a1.piece_type != PieceType::None, 'should have piece');\n    }\n \n    #[test]\n    #[available_gas(3000000000000000)]\n    fn test_move() {\n        let white = starknet::contract_address_const::<0x01>();\n        let black = starknet::contract_address_const::<0x02>();\n \n        let (world, actions_system) = setup_world();\n        let game_id = actions_system.spawn(white, black);\n        let curr_pos = Vec2 { x: 0, y: 1 };\n        let a2 = get!(world, (game_id, curr_pos), (Piece));\n        assert(a2.piece_type == PieceType::Pawn, 'should be Pawn');\n        assert(a2.color == Color::White, 'should be white color piece 1');\n        assert(a2.piece_type != PieceType::None, 'should have piece');\n \n        let next_pos = Vec2 { x: 0, y: 2 };\n        let game_turn = get!(world, game_id, (GameTurn));\n        assert(game_turn.player_color == Color::White, 'should be white player turn');\n        actions_system.move(curr_pos, next_pos, white.into(), game_id);\n \n        let curr_pos = next_pos;\n        let c3 = get!(world, (game_id, curr_pos), (Piece));\n        assert(c3.piece_type == PieceType::Pawn, 'should be Pawn');\n        assert(c3.color == Color::White, 'should be white color piece 2');\n        assert(c3.piece_type != PieceType::None, 'should have piece');\n \n        let game_turn = get!(world, game_id, (GameTurn));\n        assert(game_turn.player_color == Color::Black, 'should be black player turn');\n    }\n}
\n","isPage":false,"text":"\n\nCopy the test below and add it to your tests/units.cairo file.\n\n#[cfg(test)]\nmod tests {\n use starknet::ContractAddress;\n use dojo::test_utils::{spawn_test_world, deploy_contract};\n use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};\n use chess::models::player::{Player, Color, player};\n use chess::models::piece::{Piece, PieceType, Vec2, piece};\n use chess::models::game::{Game, GameTurn, game, game_turn};\n use chess::actions::{actions, IActionsDispatcher, IActionsDispatcherTrait};\n \n // helper setup function\n fn setup_world() -> (IWorldDispatcher, IActionsDispatcher) {\n // models\n let mut models = array![\n game::TEST_CLASS_HASH,\n player::TEST_CLASS_HASH,\n game_turn::TEST_CLASS_HASH,\n piece::TEST_CLASS_HASH\n ];\n // deploy world with models\n let world = spawn_test_world(models);\n \n // deploy systems contract\n let contract_address = world\n .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());\n let actions_system = IActionsDispatcher { contract_address };\n \n (world, actions_system)\n }\n \n #[test]\n #[available_gas(3000000000000000)]\n fn test_spawn() {\n let white = starknet::contract_address_const::<0x01>();\n let black = starknet::contract_address_const::<0x02>();\n let (world, actions_system) = setup_world();\n \n //system calls\n let game_id = actions_system.spawn(white, black);\n \n //get game\n let game = get!(world, game_id, (Game));\n let game_turn = get!(world, game_id, (GameTurn));\n assert(game_turn.player_color == Color::White, 'should be white turn');\n assert(game.white == white, 'white address is incorrect');\n assert(game.black == black, 'black address is incorrect');\n \n //get a1 piece\n let curr_pos = Vec2 { x: 0, y: 0 };\n let a1 = get!(world, (game_id, curr_pos), (Piece));\n assert(a1.piece_type == PieceType::Rook, 'should be Rook');\n assert(a1.color == Color::White, 'should be white color');\n assert(a1.piece_type != PieceType::None, 'should have piece');\n }\n \n #[test]\n #[available_gas(3000000000000000)]\n fn test_move() {\n let white = starknet::contract_address_const::<0x01>();\n let black = starknet::contract_address_const::<0x02>();\n \n let (world, actions_system) = setup_world();\n let game_id = actions_system.spawn(white, black);\n let curr_pos = Vec2 { x: 0, y: 1 };\n let a2 = get!(world, (game_id, curr_pos), (Piece));\n assert(a2.piece_type == PieceType::Pawn, 'should be Pawn');\n assert(a2.color == Color::White, 'should be white color piece 1');\n assert(a2.piece_type != PieceType::None, 'should have piece');\n \n let next_pos = Vec2 { x: 0, y: 2 };\n let game_turn = get!(world, game_id, (GameTurn));\n assert(game_turn.player_color == Color::White, 'should be white player turn');\n actions_system.move(curr_pos, next_pos, white.into(), game_id);\n \n let curr_pos = next_pos;\n let c3 = get!(world, (game_id, curr_pos), (Piece));\n assert(c3.piece_type == PieceType::Pawn, 'should be Pawn');\n assert(c3.color == Color::White, 'should be white color piece 2');\n assert(c3.piece_type != PieceType::None, 'should have piece');\n \n let game_turn = get!(world, game_id, (GameTurn));\n assert(game_turn.player_color == Color::Black, 'should be black player turn');\n }\n}\n","title":"Unit Tests","titles":["2 Move function"]},"211":{"href":"/tutorial/onchain-chess/2-move#diving-into-the-code","html":"\n","isPage":false,"text":"\n","title":"Diving into the Code","titles":["2 Move function"]},"212":{"href":"/tutorial/onchain-chess/2-move#setup_world","html":"\n

We should list all models with each having CLASS_HASH as elements and then we deploy world to models with spawn_test_world

\n
    //models\n    let mut models = array![\n            game::TEST_CLASS_HASH,\n            player::TEST_CLASS_HASH,\n            game_turn::TEST_CLASS_HASH,\n            piece::TEST_CLASS_HASH\n        ];\n    // deploy world with models\n    let world = spawn_test_world(models);
\n

After that, we deploy our system contracts, then we return our world and actions_systems dispatchers.

\n
    let contract_address = world\n        .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());\n    let actions_system = IActionsDispatcher { contract_address };\n \n    (world, actions_system)
\n","isPage":false,"text":"\nWe should list all models with each having CLASS_HASH as elements and then we deploy world to models with spawn_test_world\n //models\n let mut models = array![\n game::TEST_CLASS_HASH,\n player::TEST_CLASS_HASH,\n game_turn::TEST_CLASS_HASH,\n piece::TEST_CLASS_HASH\n ];\n // deploy world with models\n let world = spawn_test_world(models);\nAfter that, we deploy our system contracts, then we return our world and actions_systems dispatchers.\n let contract_address = world\n .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());\n let actions_system = IActionsDispatcher { contract_address };\n \n (world, actions_system)\n","title":"setup_world","titles":["2 Move function","Diving into the Code"]},"213":{"href":"/tutorial/onchain-chess/2-move#test_spawn","html":"\n

First, we'll set up the players address and their colors.

\n
    let white = starknet::contract_address_const::<0x01>();\n    let black = starknet::contract_address_const::<0x02>();
\n

We use spawn function in actions.cairo to put our pieces on the board. Each square position holds a piece. The system's spawn function needs some input i.e the addresses of the players.

\n
    // spawn\n    let game_id = actions_system.spawn(white, black);
\n

Then we check if the players got their setup address. After that we check if a White rook is at (0,0). Remember, to get a piece that exists on the position, you need to use the keys of the Piece model, which are game_id, and curr_pos.

\n
    //get a1 square\n    let curr_pos = Vec2 { x: 0, y: 0 };\n    let a1 = get!(world, (game_id, curr_pos), (Piece));\n    assert(a1.piece_type == PieceType::Rook, 'should be Rook');\n    assert(a1.color == Color::White, 'should be white color');\n    assert(a1.piece_type != PieceType::None, 'should have piece');
\n","isPage":false,"text":"\nFirst, we'll set up the players address and their colors.\n let white = starknet::contract_address_const::<0x01>();\n let black = starknet::contract_address_const::<0x02>();\nWe use spawn function in actions.cairo to put our pieces on the board. Each square position holds a piece. The system's spawn function needs some input i.e the addresses of the players.\n // spawn\n let game_id = actions_system.spawn(white, black);\nThen we check if the players got their setup address. After that we check if a White rook is at (0,0). Remember, to get a piece that exists on the position, you need to use the keys of the Piece model, which are game_id, and curr_pos.\n //get a1 square\n let curr_pos = Vec2 { x: 0, y: 0 };\n let a1 = get!(world, (game_id, curr_pos), (Piece));\n assert(a1.piece_type == PieceType::Rook, 'should be Rook');\n assert(a1.color == Color::White, 'should be white color');\n assert(a1.piece_type != PieceType::None, 'should have piece');\n","title":"test_spawn","titles":["2 Move function","Diving into the Code"]},"214":{"href":"/tutorial/onchain-chess/2-move#test_move","html":"\n

Here, after setting up the board, we use move function in the contract to make moves. Provide the current position, the next position, the player's address, and the game id.

\n
    //Move White Pawn to (0,2)\n    actions_system.move(curr_pos, next_pos, white.into(), game_id);
\n

Then we check if a White Pawn is at the new position.

\n
    let curr_pos = next_pos;\n    let c3 = get!(world, (game_id, curr_pos), (Piece));\n    assert(c3.piece_type == PieceType::Pawn, 'should be Pawn');\n    assert(c3.color == Color::White, 'should be white color piece 2');\n    assert(c3.piece_type != PieceType::None, 'should have piece');
\n","isPage":false,"text":"\nHere, after setting up the board, we use move function in the contract to make moves. Provide the current position, the next position, the player's address, and the game id.\n //Move White Pawn to (0,2)\n actions_system.move(curr_pos, next_pos, white.into(), game_id);\nThen we check if a White Pawn is at the new position.\n let curr_pos = next_pos;\n let c3 = get!(world, (game_id, curr_pos), (Piece));\n assert(c3.piece_type == PieceType::Pawn, 'should be Pawn');\n assert(c3.color == Color::White, 'should be white color piece 2');\n assert(c3.piece_type != PieceType::None, 'should have piece');\n","title":"test_move","titles":["2 Move function","Diving into the Code"]},"215":{"href":"/tutorial/onchain-chess/2-move#need-help","html":"\n

If you're stuck, don't hesitate to ask questions at the Dojo community!

","isPage":false,"text":"\nIf you're stuck, don't hesitate to ask questions at the Dojo community!","title":"Need help?","titles":["2 Move function"]},"216":{"href":"/tutorial/onchain-chess/3-test#3-test-contract","html":"\n

In this chapter, we'll use everything we've learned to run a full chess game scenario.

\n

Here's what we'll do in our test:

\n
    \n
  1. Call spawn to setup white_pawn to (0,1) and black_pawn to (1,6)
  2. \n
  3. Move white_pawn to (0,3)
  4. \n
  5. Move black_pawn to (1,4)
  6. \n
  7. Move white_pawn to (1,4)
  8. \n
  9. Capture black_pawn
  10. \n
\n

To place the pieces, use our spawn function in our actions contract. For moving them, use the move contract. Remember to check if a piece can be captured when using move.

\n

Before we get to the code, set up your integration test like this:

\n\n","isPage":true,"text":"\nIn this chapter, we'll use everything we've learned to run a full chess game scenario.\nHere's what we'll do in our test:\n\nCall spawn to setup white_pawn to (0,1) and black_pawn to (1,6)\nMove white_pawn to (0,3)\nMove black_pawn to (1,4)\nMove white_pawn to (1,4)\nCapture black_pawn\n\nTo place the pieces, use our spawn function in our actions contract. For moving them, use the move contract. Remember to check if a piece can be captured when using move.\nBefore we get to the code, set up your integration test like this:\n\nCopy the test below and add it to your tests/integration.cairo file.\n\n","title":"3 Test Contract","titles":[]},"217":{"href":"/tutorial/onchain-chess/3-test#full-code","html":"\n
mod tests {\n    use chess::models::piece::{Piece, PieceType, Vec2};\n    use dojo::world::IWorldDispatcherTrait;\n    use chess::tests::units::tests::setup_world;\n    use chess::actions::{IActionsDispatcher, IActionsDispatcherTrait};\n    use chess::models::player::{Color};\n \n    #[test]\n    #[available_gas(3000000000000000)]\n    fn integration() {\n        let white = starknet::contract_address_const::<0x01>();\n        let black = starknet::contract_address_const::<0x02>();\n \n        let (world, actions_system) = setup_world();\n \n        //system calls\n        let game_id = actions_system.spawn(white, black);\n \n        //White pawn is setup in (0,1)\n        let wp_curr_pos = Vec2 { x: 0, y: 1 };\n        let a2 = get!(world, (game_id, wp_curr_pos), (Piece));\n        assert(a2.piece_type == PieceType::Pawn, 'should be Pawn in (0,1)');\n        assert(a2.color == Color::White, 'should be white color');\n        assert(a2.piece_type != PieceType::None, 'should have piece in (0,1)');\n \n        //Black pawn is setup in (1,6)\n        let bp_curr_pos = Vec2 { x: 1, y: 6 };\n        let b7 = get!(world, (game_id, bp_curr_pos), (Piece));\n        assert(b7.piece_type == PieceType::Pawn, 'should be Pawn in (1,6)');\n        assert(b7.color == Color::Black, 'should be black color');\n        assert(b7.piece_type != PieceType::None, 'should have piece in (1,6)');\n \n        //Move White Pawn to (0,3)\n        let wp_next_pos = Vec2 { x: 0, y: 3 };\n        actions_system.move(wp_curr_pos, wp_next_pos, white.into(), game_id);\n \n        //White pawn is now in (0,3)\n        let wp_curr_pos = wp_next_pos;\n        let a4 = get!(world, (game_id, wp_curr_pos), (Piece));\n        assert(a4.piece_type == PieceType::Pawn, 'should be Pawn in (0,3)');\n        assert(a4.color == Color::White, 'should be white color');\n        assert(a4.piece_type != PieceType::None, 'should have piece in (0,3)');\n \n        //Move black Pawn to (1,4)\n        let bp_next_pos = Vec2 { x: 1, y: 4 };\n        actions_system.move(bp_curr_pos, bp_next_pos, black.into(), game_id);\n \n        //Black pawn is now in (1,4)\n        let bp_curr_pos = bp_next_pos;\n        let b5 = get!(world, (game_id, bp_curr_pos), (Piece));\n        assert(b5.piece_type == PieceType::Pawn, 'should be Pawn in (1,4)');\n        assert(b5.color == Color::Black, 'should be black color');\n        assert(b5.piece_type != PieceType::None, 'should have piece in (1,4)');\n \n        // Move White Pawn to (1,4) and capture black pawn\n        actions_system.move(wp_curr_pos, bp_curr_pos, white.into(), game_id);\n \n        let wp_curr_pos = bp_curr_pos;\n        let b5 = get!(world, (game_id, wp_curr_pos), (Piece));\n        assert(b5.piece_type == PieceType::Pawn, 'should be Pawn in (1,4)');\n        assert(b5.color == Color::White, 'should be white color');\n        assert(b5.piece_type != PieceType::None, 'should have piece in (1,4)');\n    }\n}
\n

Keep moving pieces and checking if they're in the right places.

\n","isPage":false,"text":"\nmod tests {\n use chess::models::piece::{Piece, PieceType, Vec2};\n use dojo::world::IWorldDispatcherTrait;\n use chess::tests::units::tests::setup_world;\n use chess::actions::{IActionsDispatcher, IActionsDispatcherTrait};\n use chess::models::player::{Color};\n \n #[test]\n #[available_gas(3000000000000000)]\n fn integration() {\n let white = starknet::contract_address_const::<0x01>();\n let black = starknet::contract_address_const::<0x02>();\n \n let (world, actions_system) = setup_world();\n \n //system calls\n let game_id = actions_system.spawn(white, black);\n \n //White pawn is setup in (0,1)\n let wp_curr_pos = Vec2 { x: 0, y: 1 };\n let a2 = get!(world, (game_id, wp_curr_pos), (Piece));\n assert(a2.piece_type == PieceType::Pawn, 'should be Pawn in (0,1)');\n assert(a2.color == Color::White, 'should be white color');\n assert(a2.piece_type != PieceType::None, 'should have piece in (0,1)');\n \n //Black pawn is setup in (1,6)\n let bp_curr_pos = Vec2 { x: 1, y: 6 };\n let b7 = get!(world, (game_id, bp_curr_pos), (Piece));\n assert(b7.piece_type == PieceType::Pawn, 'should be Pawn in (1,6)');\n assert(b7.color == Color::Black, 'should be black color');\n assert(b7.piece_type != PieceType::None, 'should have piece in (1,6)');\n \n //Move White Pawn to (0,3)\n let wp_next_pos = Vec2 { x: 0, y: 3 };\n actions_system.move(wp_curr_pos, wp_next_pos, white.into(), game_id);\n \n //White pawn is now in (0,3)\n let wp_curr_pos = wp_next_pos;\n let a4 = get!(world, (game_id, wp_curr_pos), (Piece));\n assert(a4.piece_type == PieceType::Pawn, 'should be Pawn in (0,3)');\n assert(a4.color == Color::White, 'should be white color');\n assert(a4.piece_type != PieceType::None, 'should have piece in (0,3)');\n \n //Move black Pawn to (1,4)\n let bp_next_pos = Vec2 { x: 1, y: 4 };\n actions_system.move(bp_curr_pos, bp_next_pos, black.into(), game_id);\n \n //Black pawn is now in (1,4)\n let bp_curr_pos = bp_next_pos;\n let b5 = get!(world, (game_id, bp_curr_pos), (Piece));\n assert(b5.piece_type == PieceType::Pawn, 'should be Pawn in (1,4)');\n assert(b5.color == Color::Black, 'should be black color');\n assert(b5.piece_type != PieceType::None, 'should have piece in (1,4)');\n \n // Move White Pawn to (1,4) and capture black pawn\n actions_system.move(wp_curr_pos, bp_curr_pos, white.into(), game_id);\n \n let wp_curr_pos = bp_curr_pos;\n let b5 = get!(world, (game_id, wp_curr_pos), (Piece));\n assert(b5.piece_type == PieceType::Pawn, 'should be Pawn in (1,4)');\n assert(b5.color == Color::White, 'should be white color');\n assert(b5.piece_type != PieceType::None, 'should have piece in (1,4)');\n }\n}\nKeep moving pieces and checking if they're in the right places.\n","title":"Full Code","titles":["3 Test Contract"]},"218":{"href":"/tutorial/onchain-chess/3-test#congratulations","html":"\n

You've made the basic contracts for a chess game using the Dojo engine! This tutorial was just the beginning. There are many ways to make the game better, like optimizing parts, adding checks, or considering special cases. If you want to do more with this chess game, try these challenges:

\n\n

Lastly, share your project with others in the Dojo community!

","isPage":false,"text":"\nYou've made the basic contracts for a chess game using the Dojo engine! This tutorial was just the beginning. There are many ways to make the game better, like optimizing parts, adding checks, or considering special cases. If you want to do more with this chess game, try these challenges:\n\nAdd a checkmate feature. Our game doesn't end now, so decide when it should!\nInclude special moves like castling, En Passant Capture, or Pawn Promotion.\nMake your own chess rules! You could even create your own version of the immortal game\n\nLastly, share your project with others in the Dojo community!","title":"Congratulations!","titles":["3 Test Contract"]},"219":{"href":"/tutorial/onchain-chess/README#building-a-chess-game","html":"\n

"I just finished reading The Dojo Book. What should I do next?"

\n

The answers to this question are always "Make something!", sometimes followed by a list of cool projects. This is a great answer for some people, but others might be looking for a little more direction.

\n

This guide is intended to fill the gap between heavily directed beginner tutorials and working on your projects. The primary goal here is to get you to write code. The secondary goal is to get you reading documentation.

\n

If you haven't read the Dojo Book yet, it is highly encouraged for you to do so before starting this project.

\n","isPage":true,"text":"\n"I just finished reading The Dojo Book. What should I do next?"\nThe answers to this question are always "Make something!", sometimes followed by a list of cool projects. This is a great answer for some people, but others might be looking for a little more direction.\nThis guide is intended to fill the gap between heavily directed beginner tutorials and working on your projects. The primary goal here is to get you to write code. The secondary goal is to get you reading documentation.\nIf you haven't read the Dojo Book yet, it is highly encouraged for you to do so before starting this project.\n","title":"Building a Chess Game","titles":[]},"220":{"href":"/tutorial/onchain-chess/README#what-are-we-building","html":"\n

We're building an on-chain chess game contract that lets you start a new game and play chess. This guide does not cover every rules of the chess game. You will build step by step as follows:

\n
    \n
  1. A system contract to spawn all the chess pieces
  2. \n
  3. A system contract to make pieces move
  4. \n
  5. Add some functions to check a legal move
  6. \n
  7. Play chess ♟♙ - integration test!
  8. \n
\n

The full code of tutorial is based on this repo.

\n

If this seems too hard, don't worry! This guide is for beginners. If you know some basics about Cairo and Dojo, you're good. We won't make a full chess game with all the rules. We're keeping it simple.

\n","isPage":false,"text":"\nWe're building an on-chain chess game contract that lets you start a new game and play chess. This guide does not cover every rules of the chess game. You will build step by step as follows:\n\nA system contract to spawn all the chess pieces\nA system contract to make pieces move\nAdd some functions to check a legal move\nPlay chess ♟♙ - integration test!\n\nThe full code of tutorial is based on this repo.\nIf this seems too hard, don't worry! This guide is for beginners. If you know some basics about Cairo and Dojo, you're good. We won't make a full chess game with all the rules. We're keeping it simple.\n","title":"What are we building?","titles":["Building a Chess Game"]},"221":{"href":"/tutorial/onchain-chess/README#what-after-this-guide","html":"\n

We're making another guide to help design the frontend. This will make our chess game complete.

\n

After you finish all the four chapters, we can move on to the frontend guide.

","isPage":false,"text":"\nWe're making another guide to help design the frontend. This will make our chess game complete.\nAfter you finish all the four chapters, we can move on to the frontend guide.","title":"What after this guide?","titles":["Building a Chess Game"]},"222":{"href":"/toolchain/slot/deployments-commands/deployments#slot-deployments","html":"\n

It allows you the manage your slot deployments.

\n","isPage":true,"text":"\nIt allows you the manage your slot deployments.\n","title":"slot deployments","titles":[null]},"223":{"href":"/toolchain/slot/deployments-commands/deployments#commands","html":"\n

create\n    Create a new deployment.

\n

delete\n    Delete a deployment.

\n

update\n    Update a deployment.

\n

describe\n    Describe a deployment's configuration.

\n

list\n    List all deployments.

\n

logs\n    Fetch logs for a deployment.

\n

help\n    Print this message or the help of the given subcommand(s)

","isPage":false,"text":"\ncreate\n    Create a new deployment.\ndelete\n    Delete a deployment.\nupdate\n    Update a deployment.\ndescribe\n    Describe a deployment's configuration.\nlist\n    List all deployments.\nlogs\n    Fetch logs for a deployment.\nhelp\n    Print this message or the help of the given subcommand(s)","title":"Commands","titles":[null,"slot deployments"]},"224":{"href":"/toolchain/sozo/common-options/offline#offline","html":"\n","isPage":true,"text":"\n","title":"offline","titles":[]},"225":{"href":"/toolchain/sozo/common-options/offline#use-sozo-offline","html":"\n

--offline
\n    Run without accessing the network.
\n    [env: SOZO_OFFLINE=]

\n","isPage":false,"text":"\n--offline\n    Run without accessing the network.\n    [env: SOZO_OFFLINE=]\n","title":"use sozo offline","titles":["offline"]},"226":{"href":"/toolchain/sozo/common-options/offline#usage","html":"\n
sozo --offline [COMMAND]
\n

For example

\n
sozo --offline build
","isPage":false,"text":"\nsozo --offline [COMMAND]\nFor example\nsozo --offline build","title":"USAGE","titles":["offline","use sozo offline"]},"227":{"href":"/toolchain/sozo/common-options/profile#use-sozo-profiles","html":"\n

Profiles can be convenient when dealing with multiple environments (dev, staging, prod)

\n

--profile
\n    Specify profile to use by name.

\n

--dev
\n    Use dev profile.

\n

--release
\n    Use release profile.

\n","isPage":true,"text":"\nProfiles can be convenient when dealing with multiple environments (dev, staging, prod)\n--profile\n    Specify profile to use by name.\n--dev\n    Use dev profile.\n--release\n    Use release profile.\n","title":"use sozo profiles","titles":[null]},"228":{"href":"/toolchain/sozo/common-options/profile#usage","html":"\n

Multiple profiles can be defined in Scarb.toml

\n
[profile.dev.tool.dojo.env]\nrpc_url = "http://localhost:5050"\naccount_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\nprivate_key = "0x1800000000300000180000000000030000000000003006001800006600"\n \n[profile.staging.tool.dojo.env]\nrpc_url = "https://api.cartridge.gg/x/mydojoproject/katana"\naccount_address = "0x5686a647a9cdd63ade617e0baf3b364856b813b508f03903eb58a7e622d5855"\nprivate_key = "0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b"
\n

Then used with sozo commands

\n
sozo --profile dev migrate
\n

is equivalent to

\n
sozo migrate --rpc-url http://localhost:5050 --account-address 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973 --private-key 0x1800000000300000180000000000030000000000003006001800006600
","isPage":false,"text":"\nMultiple profiles can be defined in Scarb.toml\n[profile.dev.tool.dojo.env]\nrpc_url = "http://localhost:5050"\naccount_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"\nprivate_key = "0x1800000000300000180000000000030000000000003006001800006600"\n \n[profile.staging.tool.dojo.env]\nrpc_url = "https://api.cartridge.gg/x/mydojoproject/katana"\naccount_address = "0x5686a647a9cdd63ade617e0baf3b364856b813b508f03903eb58a7e622d5855"\nprivate_key = "0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b"\nThen used with sozo commands\nsozo --profile dev migrate\nis equivalent to\nsozo migrate --rpc-url http://localhost:5050 --account-address 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973 --private-key 0x1800000000300000180000000000030000000000003006001800006600","title":"USAGE","titles":[null,"use sozo profiles"]},"229":{"href":"/toolchain/sozo/world-commands/auth#sozo-auth","html":"\n

auth is used to manage world authorization.

\n
sozo auth [OPTIONS] <COMMAND> --world <WORLD_ADDRESS>
\n
Commands:\n  writer  Auth a system with the given calldata.\n  help    Print this message or the help of the given subcommand(s)
\n
# example: writer - auth a system with the given calldata\n# This will auth the spawn system with the writer role for Position component\nsozo auth writer Moves <CONTRACT_ADDRESS> --world <WORLD_ADDRESS>
","isPage":true,"text":"\nauth is used to manage world authorization.\nsozo auth [OPTIONS] <COMMAND> --world <WORLD_ADDRESS>\nCommands:\n writer Auth a system with the given calldata.\n help Print this message or the help of the given subcommand(s)\n# example: writer - auth a system with the given calldata\n# This will auth the spawn system with the writer role for Position component\nsozo auth writer Moves <CONTRACT_ADDRESS> --world <WORLD_ADDRESS>","title":"sozo auth","titles":[null]},"230":{"href":"/toolchain/sozo/world-commands/events#sozo-events","html":"\n

events is used to queries world events.

\n
sozo events
","isPage":true,"text":"\nevents is used to queries world events.\nsozo events","title":"sozo events","titles":[null]},"231":{"href":"/toolchain/sozo/world-commands/register#sozo-register","html":"\n

register is used to register new systems and components.

\n
sozo register [OPTIONS] <COMMAND>
\n
Commands:\n  component  Register a component to a world.\n  system     Register a system to a world.\n  help       Print this message or the help of the given subcommand(s)
\n
# example: component - register a component to a world\n# this will register the Moves component to the world\nsozo register component Moves\n \n# example: system - register a system to a world\n# this will register the spawn system to the world\nsozo register system spawn
","isPage":true,"text":"\nregister is used to register new systems and components.\nsozo register [OPTIONS] <COMMAND>\nCommands:\n component Register a component to a world.\n system Register a system to a world.\n help Print this message or the help of the given subcommand(s)\n# example: component - register a component to a world\n# this will register the Moves component to the world\nsozo register component Moves\n \n# example: system - register a system to a world\n# this will register the spawn system to the world\nsozo register system spawn","title":"sozo register","titles":[null]},"232":{"href":"/toolchain/sozo/project-commands/build#sozo-build","html":"\n

build is used to compile the cairo contracts, generating the necessary artifacts for deployment.

\n
sozo build
","isPage":true,"text":"\nbuild is used to compile the cairo contracts, generating the necessary artifacts for deployment.\nsozo build","title":"sozo build","titles":[null]},"233":{"href":"/toolchain/sozo/project-commands/init#sozo-init","html":"\n

init is used to initialize a new project. It will initialize a new project in the current directory by cloning the dojo-starter.

\n
sozo init
","isPage":true,"text":"\ninit is used to initialize a new project. It will initialize a new project in the current directory by cloning the dojo-starter.\nsozo init","title":"sozo init","titles":[null]},"234":{"href":"/toolchain/sozo/project-commands/test#sozo-test","html":"\n

test is used to test the project's cairo contracts. It will run all tests found within the project.

\n
sozo test
","isPage":true,"text":"\ntest is used to test the project's cairo contracts. It will run all tests found within the project.\nsozo test","title":"sozo test","titles":[null]}},"dirtCount":0,"index":[["♟♙",{"2":{"220":1}}],["│",{"2":{"202":5}}],["└──",{"2":{"202":4}}],["├──",{"2":{"202":10}}],["ℹ️",{"2":{"138":1}}],["~",{"2":{"136":1,"198":1}}],["q2",{"2":{"128":1}}],["q1",{"2":{"128":1}}],["question",{"2":{"219":1}}],["questions",{"2":{"215":1}}],["questioning",{"2":{"113":1}}],["queen",{"2":{"203":1,"207":1}}],["querying",{"2":{"23":1,"24":1,"25":1}}],["query",{"0":{"167":1,"168":1},"1":{"169":1,"170":1,"171":1,"172":1},"2":{"18":1,"29":1,"33":4,"41":2,"46":1,"166":1,"167":1,"168":4,"169":4,"171":5,"172":2,"173":1,"174":1}}],["queries",{"2":{"14":1,"33":1,"48":1,"132":1,"163":1,"164":1,"167":7,"185":2,"186":1,"230":1}}],["quantity",{"2":{"46":2}}],["quite",{"2":{"33":1}}],["quick",{"0":{"84":1},"1":{"85":1,"86":1},"2":{"5":1,"81":1,"87":1}}],["quickstart",{"2":{"1":1}}],["quot",{"2":{"7":34,"20":18,"22":6,"32":4,"33":74,"36":14,"82":2,"113":4,"118":2,"140":4,"168":36,"169":120,"171":20,"173":48,"174":64,"188":2,"198":6,"202":18,"219":4,"228":12}}],["zk",{"2":{"113":1,"115":1,"118":1,"119":1,"127":3}}],["zknight",{"2":{"104":1}}],["zkorp",{"0":{"102":1}}],["zdefender",{"2":{"104":1}}],["zero",{"2":{"42":3,"62":4,"115":1,"119":1,"127":1}}],["||",{"2":{"207":21,"208":1}}],["|",{"2":{"85":1,"93":1,"135":1,"156":1}}],["94bfdb2",{"2":{"136":1}}],["99",{"2":{"63":1}}],["9999999999999",{"2":{"43":1,"46":1}}],["9",{"2":{"33":1}}],["8",{"2":{"33":1,"45":1,"142":1}}],["8080",{"2":{"33":4,"166":1,"179":2}}],["7",{"2":{"33":1,"207":2}}],["6",{"2":{"33":1,"216":1,"217":4}}],["📚",{"2":{"157":1,"181":1,"193":1}}],["🚀",{"2":{"33":1}}],["📦",{"2":{"32":1}}],["✨",{"2":{"32":2,"198":2}}],["🎉",{"2":{"32":1,"198":1,"207":1}}],["🌎",{"2":{"32":2}}],["52",{"2":{"173":1}}],["56",{"2":{"33":2}}],["5",{"2":{"32":3,"33":1,"171":2}}],["5050",{"2":{"20":1,"188":1,"202":1,"228":2}}],["🧰",{"2":{"32":1}}],["42",{"2":{"173":1}}],["420",{"2":{"62":2}}],["48",{"2":{"33":15,"173":1}}],["49",{"2":{"33":15}}],["4",{"0":{"151":1},"2":{"20":3,"32":4,"33":1,"38":1,"202":3,"216":2,"217":8}}],["+=",{"2":{"29":2}}],["+",{"0":{"45":1},"2":{"17":2,"31":3,"46":6,"207":12}}],["king",{"2":{"203":1,"207":1}}],["kind",{"2":{"169":1}}],["knight",{"2":{"203":1,"207":1}}],["known",{"2":{"118":1}}],["knowledge",{"2":{"115":1,"119":1,"127":1}}],["know",{"2":{"33":1,"127":1,"220":1}}],["kairy",{"2":{"78":1}}],["katanas",{"2":{"9":1}}],["katana",{"0":{"4":1,"5":1,"6":1},"1":{"5":1,"6":1},"2":{"4":2,"5":4,"6":1,"7":2,"9":1,"20":1,"32":5,"33":1,"83":3,"85":1,"119":1,"129":1,"155":1,"159":1,"198":7,"202":1,"228":1}}],["keeping",{"2":{"220":1}}],["keep",{"2":{"43":1,"105":1,"170":1,"217":1}}],["keypair",{"2":{"65":1}}],["keys",{"2":{"16":1,"24":2,"33":3,"41":3,"67":4,"173":2,"174":4,"213":1}}],["key",{"0":{"41":1},"2":{"7":4,"14":1,"16":3,"20":1,"21":4,"22":1,"24":1,"29":3,"36":1,"39":2,"40":4,"41":7,"43":1,"45":1,"46":4,"49":2,"51":4,"116":1,"142":2,"174":1,"198":3,"202":1,"203":6,"228":3}}],["x",{"2":{"7":2,"17":2,"21":1,"29":6,"31":3,"36":1,"42":3,"46":5,"49":2,"60":1,"62":3,"63":3,"173":2,"203":1,"207":57,"210":3,"213":1,"217":4,"228":1}}],["x27",{"0":{"133":1},"2":{"5":1,"6":1,"11":1,"23":2,"25":1,"26":1,"28":6,"29":15,"31":5,"32":5,"33":10,"35":1,"43":1,"45":13,"48":1,"53":1,"54":2,"56":2,"59":1,"62":4,"63":8,"65":1,"67":1,"69":1,"93":2,"106":1,"113":3,"115":1,"118":1,"119":1,"125":1,"126":2,"127":2,"130":1,"131":1,"133":1,"136":5,"138":1,"142":13,"147":1,"150":2,"163":1,"166":1,"168":3,"169":1,"179":1,"191":1,"198":3,"203":1,"205":1,"207":9,"208":6,"209":1,"210":30,"212":2,"213":8,"214":7,"215":2,"216":4,"217":31,"218":2,"219":1,"220":5,"221":1,"223":1,"234":1}}],["39",{"2":{"173":1}}],["3000000000000000",{"2":{"210":2,"217":1}}],["30000000",{"2":{"63":1}}],["3",{"0":{"94":1,"139":1,"216":1},"1":{"140":1,"141":1,"142":1,"143":1,"144":1,"145":1,"146":1,"147":1,"148":1,"149":1,"150":1,"217":1,"218":1},"2":{"7":2,"22":1,"32":1,"33":1,"38":2,"139":1,"140":1,"143":1,"146":1,"169":1,"171":3,"172":1,"216":1,"217":5}}],["17",{"2":{"173":2}}],["11",{"2":{"63":1,"173":2}}],["12",{"2":{"33":5,"41":1}}],["199592z",{"2":{"33":1}}],["18",{"2":{"33":5}}],["188985z",{"2":{"33":1}}],["188611z",{"2":{"33":1}}],["188215z",{"2":{"33":1}}],["187674z",{"2":{"33":1}}],["187202z",{"2":{"33":1}}],["186720z",{"2":{"33":1}}],["186129z",{"2":{"33":1}}],["185648z",{"2":{"33":1}}],["184244z",{"2":{"33":1}}],["184233z",{"2":{"33":1}}],["18t06",{"2":{"33":15}}],["1071",{"2":{"136":1}}],["100000",{"2":{"62":2}}],["100",{"2":{"29":2,"46":2}}],["10",{"2":{"17":3,"29":3,"31":5,"33":18,"41":1,"46":5,"49":2,"56":1,"60":3,"63":1,"104":2,"136":2,"168":1,"173":5}}],["15",{"0":{"28":1},"1":{"29":1,"30":1,"31":1,"32":1,"33":1,"34":1},"2":{"7":2,"33":5}}],["1",{"0":{"92":1,"94":1},"2":{"7":1,"20":1,"22":1,"26":1,"29":6,"31":1,"32":2,"33":2,"45":1,"46":2,"60":1,"94":1,"114":1,"118":1,"136":2,"142":1,"199":1,"207":19,"210":2,"216":4,"217":16}}],["=https",{"2":{"93":1}}],["==",{"2":{"22":3,"42":3,"63":3,"207":28,"208":1,"210":11,"213":2,"214":2,"217":10}}],["=",{"2":{"7":19,"16":7,"20":12,"22":4,"26":3,"29":17,"31":2,"32":3,"36":7,"39":1,"41":3,"43":1,"46":5,"49":3,"56":2,"60":9,"62":1,"63":8,"68":1,"149":2,"150":1,"198":3,"202":12,"207":38,"208":10,"210":26,"212":4,"213":6,"214":3,"217":21,"228":6}}],["jq",{"2":{"136":3}}],["jay",{"2":{"114":1}}],["javascript",{"2":{"48":1,"69":1}}],["js",{"0":{"69":1,"153":1},"1":{"70":1,"71":1,"72":1,"73":1,"74":1,"75":1},"2":{"77":1,"175":1}}],["json",{"2":{"32":1,"36":1,"163":1,"198":2}}],["jump",{"2":{"33":1,"128":1}}],["just",{"2":{"7":1,"11":1,"20":1,"50":1,"52":1,"81":1,"87":1,"127":1,"130":1,"143":1,"145":1,"218":1,"219":1}}],["join",{"2":{"1":1,"113":1,"123":1}}],["n",{"2":{"207":56}}],["nightly",{"2":{"136":2}}],["npm",{"2":{"76":1,"139":1}}],["numbers",{"2":{"46":1}}],["number",{"2":{"40":1,"168":1,"171":1}}],["na",{"2":{"114":1}}],["nature",{"2":{"113":1}}],["natively",{"2":{"140":1}}],["native",{"2":{"47":1}}],["navigate",{"2":{"33":1}}],["named",{"2":{"144":1}}],["name",{"0":{"159":1,"163":1,"183":1},"1":{"164":1},"2":{"7":1,"20":1,"25":1,"32":1,"33":2,"35":1,"36":2,"45":1,"67":1,"142":1,"143":1,"167":1,"168":3,"173":1,"198":5,"199":2,"201":1,"202":1,"227":1}}],["neural",{"2":{"104":1}}],["next",{"0":{"34":1,"86":1},"2":{"26":3,"29":5,"31":1,"33":1,"34":1,"56":1,"60":5,"93":1,"204":1,"206":1,"207":13,"208":15,"210":3,"214":3,"217":6,"219":1}}],["new",{"0":{"48":1},"1":{"49":1,"50":1,"51":1,"52":1},"2":{"25":1,"28":1,"29":2,"31":1,"32":1,"33":4,"63":6,"80":1,"106":1,"110":1,"113":3,"130":1,"143":1,"146":1,"147":1,"163":1,"190":1,"191":1,"198":12,"199":2,"201":1,"214":1,"220":1,"223":1,"231":1,"233":2}}],["never",{"2":{"16":1}}],["necessary",{"2":{"12":1,"109":1,"142":1,"149":1,"150":1,"232":1}}],["nested",{"2":{"11":1}}],["needed",{"2":{"167":1}}],["needs",{"2":{"23":1,"54":1,"213":1}}],["need",{"0":{"215":1},"2":{"7":1,"28":1,"32":1,"41":1,"43":1,"45":1,"61":1,"82":2,"92":1,"115":1,"138":1,"142":2,"163":1,"198":2,"213":1}}],["networking",{"2":{"133":1,"183":1}}],["networks",{"2":{"7":1}}],["network",{"0":{"7":1},"1":{"8":1,"9":1,"10":1},"2":{"7":1,"76":1,"104":1,"118":2,"124":1,"132":1,"225":1}}],["node",{"2":{"168":2,"169":4,"171":4}}],["novel",{"2":{"113":1}}],["no",{"2":{"32":1,"56":1,"113":1,"141":1,"143":1,"144":1}}],["none",{"2":{"29":2,"31":1,"56":1,"60":1,"168":1,"203":2,"207":3,"208":4,"210":3,"213":1,"214":1,"217":5}}],["non",{"2":{"29":1}}],["now",{"2":{"6":1,"26":1,"28":1,"29":1,"31":1,"32":5,"33":4,"141":1,"143":2,"147":1,"168":1,"169":1,"198":4,"204":1,"205":1,"208":1,"217":2,"218":1}}],["notable",{"2":{"113":1}}],["notably",{"2":{"56":1}}],["notion",{"2":{"113":2}}],["noting",{"2":{"67":1}}],["notifications",{"2":{"33":1}}],["notify",{"2":{"29":1,"173":1}}],["notice",{"2":{"29":2,"33":1}}],["notstarted",{"2":{"22":3}}],["noted",{"2":{"204":1}}],["note",{"0":{"137":1},"2":{"21":1,"26":1,"56":1,"65":1,"92":1,"136":1,"138":1,"140":1,"144":1,"186":1,"198":1}}],["not",{"2":{"1":1,"9":1,"16":1,"20":1,"21":1,"22":3,"27":1,"37":2,"41":1,"44":1,"56":1,"62":2,"65":3,"87":1,"110":1,"112":1,"113":1,"124":1,"125":1,"127":1,"138":1,"169":1,"203":1,"205":1,"207":5,"208":2,"220":1}}],["y3vyc29yx3r3bw==",{"2":{"171":2}}],["y3vyc29yx29uzq==",{"2":{"171":1}}],["yes",{"2":{"129":1}}],["yet",{"2":{"6":1,"37":1,"113":1,"169":1,"219":1}}],["y",{"2":{"17":2,"21":1,"29":6,"31":3,"42":3,"46":5,"49":2,"60":1,"62":3,"63":3,"173":2,"203":1,"207":57,"210":3,"213":1,"217":4}}],["you",{"0":{"133":1},"2":{"1":2,"5":1,"6":3,"7":1,"8":1,"14":2,"16":4,"18":1,"22":2,"23":1,"24":1,"26":1,"27":1,"28":4,"29":3,"31":1,"32":2,"33":15,"34":1,"36":1,"40":1,"41":6,"42":1,"43":1,"45":1,"49":1,"58":1,"61":2,"62":1,"63":2,"64":1,"65":3,"67":2,"69":1,"70":1,"76":3,"80":2,"81":1,"82":2,"83":1,"85":1,"87":1,"92":1,"109":3,"115":2,"119":1,"123":2,"128":1,"130":2,"133":1,"136":3,"137":1,"138":2,"140":1,"141":2,"142":2,"143":1,"163":5,"164":1,"166":1,"168":6,"169":4,"170":1,"173":2,"174":4,"175":3,"179":1,"181":1,"190":1,"191":1,"198":10,"199":3,"201":2,"203":1,"204":1,"205":1,"206":1,"207":1,"213":1,"215":1,"218":3,"219":4,"220":4,"221":1,"222":1}}],["yourself",{"2":{"84":1,"207":1}}],["your",{"0":{"198":1,"205":1},"1":{"199":1},"2":{"1":1,"4":1,"5":3,"6":6,"7":1,"16":1,"20":1,"23":1,"24":1,"26":3,"28":2,"29":2,"32":7,"33":9,"36":1,"39":1,"41":1,"47":1,"53":1,"54":1,"61":4,"62":1,"63":2,"65":1,"70":1,"71":1,"85":1,"86":1,"92":2,"104":1,"110":1,"115":3,"133":2,"138":1,"139":1,"140":1,"143":1,"145":1,"147":1,"150":2,"155":1,"157":1,"166":2,"167":1,"168":1,"169":3,"170":1,"173":1,"174":3,"175":1,"178":1,"181":1,"190":2,"191":1,"193":1,"198":7,"199":2,"201":1,"202":6,"203":1,"210":1,"216":2,"218":3,"219":1,"222":1}}],["h",{"2":{"188":1}}],["high",{"2":{"118":1,"143":1,"176":1}}],["highly",{"2":{"26":1,"116":1,"219":1}}],["hurdles",{"2":{"130":1}}],["hub",{"2":{"97":1}}],["human",{"2":{"46":10}}],["humans",{"2":{"46":3}}],["hundreds",{"2":{"34":1}}],["http",{"2":{"20":1,"33":4,"166":1,"179":2,"188":1,"202":1,"228":2}}],["https",{"2":{"7":4,"20":1,"32":1,"36":3,"83":2,"85":1,"90":1,"93":1,"135":1,"156":1,"193":1,"202":1,"228":1}}],["hesitate",{"2":{"215":1}}],["helps",{"2":{"116":1,"190":1}}],["help",{"0":{"215":1},"2":{"105":1,"128":1,"161":2,"188":2,"221":1,"223":2,"229":2,"231":2}}],["helping",{"2":{"72":1}}],["helper",{"2":{"63":1,"210":1}}],["hello",{"0":{"27":1},"1":{"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1},"2":{"86":1,"168":1,"169":1,"174":1,"200":1}}],["hex",{"2":{"47":1}}],["heavy",{"2":{"118":1}}],["heavily",{"2":{"14":1,"219":1}}],["heading",{"0":{"112":1}}],["head",{"2":{"80":1,"86":1,"188":1}}],["health",{"2":{"21":1,"46":11}}],["here",{"2":{"9":1,"16":1,"17":1,"22":1,"31":3,"32":1,"33":1,"45":1,"51":1,"52":1,"67":1,"85":1,"125":1,"126":1,"130":1,"142":1,"145":1,"147":1,"150":1,"170":1,"207":1,"214":1,"216":1,"219":1}}],["hard",{"2":{"220":1}}],["harnessing",{"2":{"174":1}}],["happens",{"2":{"173":2}}],["having",{"2":{"46":2,"212":1}}],["haven",{"2":{"6":1,"219":1}}],["have",{"2":{"5":1,"6":1,"7":1,"27":1,"28":1,"29":4,"31":1,"32":1,"33":5,"46":2,"80":1,"123":1,"136":1,"137":1,"140":1,"163":1,"173":1,"179":1,"198":3,"207":1,"210":3,"213":1,"214":1,"217":5}}],["hang",{"2":{"28":1}}],["hand",{"2":{"167":1}}],["handy",{"2":{"26":1}}],["handle",{"2":{"21":1,"130":1}}],["hashes",{"2":{"174":1}}],["hash",{"2":{"20":1,"25":4,"32":3,"63":3,"67":3,"149":1,"202":1,"210":5,"212":6}}],["has",{"2":{"12":1,"16":1,"21":2,"37":1,"113":2,"130":1,"140":1,"144":1,"149":1,"167":1,"168":1,"209":1}}],["hold",{"2":{"203":1}}],["holds",{"2":{"29":1,"213":1}}],["home",{"2":{"136":1}}],["homework",{"0":{"114":1}}],["hooks",{"2":{"73":1}}],["houses",{"2":{"29":1}}],["hosted",{"2":{"9":1,"188":1}}],["however",{"2":{"9":1,"11":1,"34":1,"37":1,"41":1,"43":1,"46":1,"65":1,"172":1}}],["how",{"0":{"3":1,"80":1},"2":{"11":1,"29":1,"31":1,"41":1,"45":1,"49":1,"65":3,"113":1,"142":1,"147":1,"174":1}}],["v",{"2":{"137":1,"188":1}}],["vscode",{"0":{"94":1}}],["virtual",{"2":{"115":1,"126":1}}],["visual",{"2":{"82":1,"94":1,"133":1}}],["via",{"2":{"1":1,"18":1,"43":1,"66":1,"74":1,"175":2,"180":1,"192":1}}],["vast",{"2":{"34":1}}],["variables",{"2":{"32":1}}],["various",{"2":{"21":1,"40":1,"106":1}}],["valuable",{"2":{"105":1,"174":1}}],["values",{"2":{"18":1,"29":1,"67":5,"173":1,"174":1}}],["value",{"2":{"16":2,"21":2,"24":2,"36":1,"40":1,"41":1,"43":2,"46":1}}],["validate",{"2":{"142":1,"150":1}}],["validity",{"2":{"116":1,"118":2,"127":1}}],["valid",{"2":{"7":1}}],["v2",{"2":{"7":1}}],["v0",{"2":{"7":1,"29":1,"46":1,"49":1,"56":1,"60":1,"145":2,"208":1}}],["vein",{"2":{"29":1}}],["vec2trait",{"2":{"62":2}}],["vec2",{"2":{"29":5,"31":1,"49":4,"56":1,"60":2,"62":4,"203":2,"207":6,"208":2,"210":4,"213":1,"217":5}}],["vec",{"2":{"29":7,"31":3,"49":2,"60":1,"62":2,"63":2,"173":2}}],["verify",{"2":{"209":1}}],["verifying",{"2":{"118":1,"127":1}}],["verifiable",{"2":{"116":1}}],["verification",{"2":{"115":1,"118":1}}],["very",{"2":{"22":1,"113":1,"143":1,"172":2}}],["versions",{"2":{"144":1}}],["version",{"0":{"137":1},"2":{"7":2,"20":4,"32":3,"82":1,"136":4,"137":1,"140":1,"188":2,"198":2,"202":3,"218":1}}],["ve",{"2":{"5":1,"32":1,"33":2,"207":1,"216":1,"218":1}}],["rm",{"2":{"198":1}}],["rs",{"2":{"82":1}}],["rather",{"2":{"143":1,"204":1}}],["radically",{"2":{"130":1}}],["radical",{"2":{"113":1}}],["random",{"2":{"47":1}}],["ran",{"2":{"33":1}}],["rapidly",{"2":{"123":1,"155":1,"159":1}}],["rapid",{"2":{"4":1,"34":1}}],["rising",{"2":{"163":1}}],["risk",{"2":{"7":1}}],["right",{"2":{"29":1,"33":1,"63":1,"207":3,"208":2,"217":1}}],["rook",{"2":{"203":1,"207":1,"210":2,"213":3}}],["root",{"2":{"63":1}}],["roadmap",{"0":{"123":1},"2":{"128":1}}],["rock",{"2":{"104":1}}],["rollup",{"2":{"116":1,"118":3}}],["rollups",{"2":{"113":1}}],["roll",{"2":{"104":1}}],["role",{"2":{"13":1,"23":1,"45":2,"54":1,"142":2,"144":1,"145":1,"229":1}}],["rolesschemaintrospectionimpl",{"2":{"45":1,"142":1}}],["roles",{"2":{"13":1,"45":4,"142":5,"144":1,"145":1}}],["route",{"2":{"28":1}}],["robust",{"2":{"28":1,"116":1,"190":1}}],["rules",{"2":{"125":1,"127":1,"218":1,"220":2}}],["rustup",{"2":{"82":1,"92":2}}],["rust",{"0":{"78":1,"92":1},"2":{"14":1,"77":2,"82":2,"88":1,"92":1,"107":1,"176":1,"177":1}}],["runtime",{"2":{"167":1}}],["runs",{"2":{"118":1}}],["running",{"2":{"32":3,"33":2,"92":1,"93":1,"166":1,"179":1,"186":1}}],["run",{"0":{"32":1},"2":{"6":2,"9":1,"28":1,"33":3,"61":1,"83":1,"119":3,"129":1,"156":2,"168":2,"179":1,"185":1,"198":5,"199":1,"205":1,"208":1,"216":1,"225":1,"234":1}}],["rpc",{"2":{"7":3,"20":1,"185":1,"188":2,"198":4,"199":2,"202":1,"228":3}}],["renamed",{"2":{"140":1}}],["reworking",{"2":{"139":1}}],["revamped",{"2":{"144":1}}],["revert",{"2":{"134":1}}],["revolves",{"2":{"132":1}}],["revoke",{"2":{"67":2}}],["reduce",{"2":{"116":1}}],["requests",{"0":{"110":1}}],["request",{"2":{"80":1,"110":3,"136":1,"173":1}}],["requiring",{"2":{"113":1}}],["requirements",{"0":{"207":1}}],["required",{"2":{"43":1,"65":1,"143":1,"144":1,"181":1,"193":1}}],["requires",{"2":{"11":1,"139":1}}],["requisites",{"0":{"166":1}}],["requisite",{"2":{"5":1}}],["reusable",{"2":{"56":1,"63":1,"116":1}}],["reuse",{"2":{"40":1}}],["relies",{"2":{"186":1}}],["relied",{"2":{"141":1}}],["related",{"2":{"140":1,"185":1}}],["relationship",{"2":{"48":1}}],["relevant",{"2":{"105":1}}],["releases",{"2":{"138":1}}],["release",{"2":{"26":1,"136":2,"227":2}}],["reformulating",{"2":{"110":1}}],["refining",{"2":{"105":1}}],["ref",{"2":{"45":1,"67":12,"142":1}}],["refer",{"2":{"27":1,"29":1}}],["reference",{"0":{"158":1,"182":1,"194":1},"1":{"159":1,"160":1,"161":1,"183":1,"184":1,"185":1,"186":1,"187":1,"188":1,"195":1,"196":1,"197":1},"2":{"21":1,"85":1,"106":1,"145":1,"157":2,"181":3,"193":2}}],["representing",{"2":{"171":1}}],["represent",{"2":{"113":1}}],["represents",{"2":{"45":1,"142":1}}],["repository",{"2":{"70":1,"71":1,"72":1,"73":1,"74":1,"75":1,"83":2,"136":1}}],["repo",{"0":{"137":1},"2":{"36":1,"47":1,"136":2,"220":1}}],["replaces",{"2":{"118":1,"163":1}}],["replace",{"2":{"7":1,"20":1,"36":1,"140":1,"198":1,"202":1}}],["recreate",{"2":{"130":1}}],["receipt",{"2":{"169":1}}],["received",{"2":{"33":1}}],["receive",{"2":{"33":2,"168":2,"173":1,"198":2,"199":1}}],["recent",{"2":{"82":1}}],["recap",{"2":{"31":1,"33":1}}],["recognizing",{"2":{"132":1}}],["recognizes",{"2":{"130":1}}],["recognize",{"2":{"113":1}}],["recognized",{"2":{"29":1}}],["recommend",{"2":{"28":1,"200":1}}],["recommended",{"2":{"9":1}}],["reconstructed",{"2":{"113":1}}],["reconstruct",{"2":{"24":1,"66":1}}],["re",{"2":{"29":1,"113":1,"136":1,"138":1,"166":1,"168":1,"191":1,"215":1,"217":1,"220":3,"221":1}}],["reside",{"2":{"113":1,"147":1,"204":1}}],["response",{"2":{"173":1}}],["responses",{"2":{"169":1}}],["responsible",{"2":{"59":1}}],["respectively",{"2":{"31":1,"207":1}}],["resouces",{"2":{"36":1}}],["resource",{"2":{"16":3,"36":1,"41":4,"67":5,"105":1,"106":1}}],["resources",{"2":{"1":1}}],["result",{"2":{"150":2,"171":1,"186":1}}],["results",{"2":{"33":1}}],["resulting",{"2":{"33":1,"116":1}}],["rest",{"2":{"29":2,"62":1,"65":1,"163":1,"164":1,"168":1,"173":1,"208":1}}],["resemblance",{"2":{"29":1}}],["registrations",{"2":{"185":1}}],["register",{"0":{"231":1},"2":{"33":2,"64":1,"67":1,"197":1,"231":11}}],["registered",{"2":{"25":1,"32":1,"33":3,"173":1}}],["regular",{"2":{"20":1,"31":1,"49":1,"50":1,"58":1,"143":1,"145":1}}],["remember",{"2":{"213":1,"216":1}}],["remodel",{"2":{"202":3}}],["removing",{"2":{"169":1}}],["remote",{"0":{"7":1,"9":1,"10":1},"1":{"8":1,"9":1,"10":1},"2":{"4":1,"7":1,"9":2,"32":1,"36":1}}],["remarkably",{"2":{"119":1}}],["remains",{"2":{"105":1,"113":1}}],["remaining",{"2":{"17":1,"21":1,"24":2,"26":1,"29":5,"31":3,"40":1,"56":1,"60":2,"63":1,"168":2,"173":2}}],["returns",{"2":{"171":1}}],["return",{"2":{"29":1,"42":1,"170":2,"171":1,"212":1}}],["returned",{"2":{"16":1,"167":1}}],["retrieval",{"2":{"163":1}}],["retrieves",{"2":{"167":1}}],["retrieve",{"2":{"16":3,"29":3,"31":3,"33":1,"41":1,"163":1,"168":1,"169":1,"209":1}}],["retrieving",{"2":{"14":1,"16":1}}],["reach",{"2":{"76":1}}],["react",{"0":{"73":1},"2":{"48":1,"73":2}}],["readme",{"2":{"202":1}}],["reading",{"0":{"117":1},"2":{"29":2,"49":1,"84":1,"219":2}}],["read",{"2":{"21":1,"22":1,"26":1,"29":2,"32":1,"46":1,"49":1,"51":1,"60":3,"132":1,"170":1,"175":1,"208":1,"219":1}}],["readability",{"2":{"14":1}}],["ready",{"2":{"6":1,"166":1,"198":1}}],["realization",{"2":{"130":1}}],["realized",{"2":{"1":1}}],["real",{"2":{"33":1}}],["realms",{"0":{"99":1},"2":{"2":1,"104":3}}],["l1",{"2":{"118":4}}],["l2",{"0":{"118":1},"2":{"118":2}}],["l",{"2":{"85":1,"135":1,"156":1}}],["large",{"2":{"172":1}}],["lattice",{"2":{"113":1,"114":1}}],["latest",{"2":{"105":1,"136":3,"198":2}}],["later",{"2":{"29":1}}],["labeled",{"2":{"109":1}}],["lacking",{"2":{"109":1}}],["lair",{"2":{"104":1}}],["language",{"2":{"115":1,"116":2,"119":1,"126":3}}],["languages",{"2":{"77":1}}],["land",{"2":{"104":1}}],["lander",{"2":{"104":1}}],["layers",{"2":{"113":1}}],["layer",{"2":{"48":1,"113":3,"115":1,"118":2,"183":1}}],["layout",{"2":{"45":4,"67":4,"142":6}}],["lastly",{"2":{"203":1,"218":1}}],["lasts",{"2":{"186":1}}],["last",{"2":{"29":5,"31":1,"56":1,"60":2,"168":2,"171":4,"172":1}}],["launches",{"2":{"5":1}}],["ll",{"2":{"28":2,"29":4,"33":1,"179":1,"198":1,"203":1,"213":1,"216":2}}],["logs",{"2":{"198":1,"199":2,"223":2}}],["login",{"2":{"198":1}}],["logic",{"2":{"22":1,"28":1,"49":1,"54":1,"124":1,"132":1,"145":1,"204":2}}],["locked",{"2":{"193":1}}],["located",{"2":{"136":1,"209":1}}],["location",{"2":{"16":2,"41":6}}],["locally",{"0":{"32":1},"2":{"28":1,"32":1,"33":1}}],["localhost",{"2":{"20":1,"179":2,"188":1,"202":1,"228":2}}],["local",{"0":{"4":1,"137":1},"1":{"5":1,"6":1},"2":{"4":1,"5":1,"28":1,"33":4,"36":1,"83":1,"136":1,"166":2,"181":2,"185":1,"186":1,"193":1}}],["long",{"2":{"173":1,"186":1}}],["longer",{"2":{"141":1,"143":1,"144":1}}],["low",{"2":{"118":1,"126":1}}],["lower",{"2":{"77":1}}],["lowest",{"2":{"70":1}}],["loot",{"2":{"104":1}}],["looking",{"2":{"76":1,"219":1}}],["look",{"2":{"33":1,"46":1,"49":1,"56":1,"110":1,"202":3,"204":1,"208":1}}],["looks",{"2":{"33":1,"173":1,"202":2}}],["lot",{"2":{"31":1,"202":1}}],["lobby",{"2":{"22":5}}],["legal",{"2":{"220":1}}],["lessons",{"2":{"130":1}}],["learned",{"2":{"130":1,"216":1}}],["learn",{"2":{"126":1}}],["leave",{"2":{"113":1}}],["least",{"2":{"41":1,"113":1}}],["levels",{"2":{"106":1}}],["level",{"0":{"112":1},"2":{"70":1,"77":1,"118":1,"126":1,"143":1}}],["leveraging",{"2":{"14":1,"48":1,"116":1}}],["leverages",{"2":{"179":1}}],["leverage",{"2":{"14":1}}],["length",{"2":{"67":2}}],["left",{"2":{"29":2,"31":1}}],["letting",{"2":{"49":1}}],["lets",{"2":{"26":1,"49":1,"62":1,"168":1,"220":1}}],["let",{"2":{"16":4,"26":2,"28":1,"29":9,"31":3,"32":4,"33":4,"41":3,"46":4,"49":3,"56":3,"60":7,"62":1,"63":8,"68":1,"149":2,"150":1,"168":1,"169":1,"198":2,"205":1,"207":2,"208":5,"210":23,"212":4,"213":5,"214":2,"217":16}}],["little",{"2":{"219":1}}],["lived",{"2":{"173":1}}],["limit",{"0":{"172":1},"2":{"170":1,"172":2}}],["listens",{"2":{"185":1}}],["listen",{"2":{"173":1,"174":1}}],["listening",{"2":{"33":1,"66":1}}],["list",{"2":{"147":2,"188":1,"212":1,"219":1,"223":2}}],["license",{"2":{"121":1}}],["licensed",{"2":{"2":1}}],["lifespan",{"2":{"113":1}}],["linux",{"0":{"91":1},"1":{"92":1,"93":1,"94":1},"2":{"92":1}}],["links",{"2":{"35":1,"36":1}}],["line",{"2":{"31":1,"190":1}}],["libraries",{"0":{"103":1},"2":{"70":1,"103":1}}],["library",{"2":{"70":2,"198":1}}],["lib",{"2":{"29":1,"49":1,"202":2}}],["like",{"2":{"11":1,"22":1,"26":1,"29":1,"31":1,"33":3,"45":1,"46":1,"58":1,"68":1,"76":1,"113":1,"124":1,"142":2,"143":1,"145":1,"167":1,"168":2,"173":2,"174":1,"202":5,"204":1,"208":1,"216":1,"218":2}}],["lt",{"2":{"7":1,"22":1,"24":3,"29":2,"45":2,"46":1,"49":2,"56":1,"60":1,"63":1,"67":20,"142":2,"144":1,"145":1,"147":2,"166":1,"174":1,"179":1,"188":4,"207":12,"208":1,"210":4,"213":2,"217":2,"229":4,"231":1}}],["mydojoproject",{"2":{"228":1}}],["my",{"2":{"207":3,"208":1}}],["mysteries",{"2":{"104":1}}],["md",{"2":{"202":1}}],["mkdir",{"2":{"198":1,"201":1}}],["memory",{"2":{"186":4,"188":1}}],["member",{"2":{"45":4,"142":5}}],["message",{"2":{"161":1,"223":1,"229":1,"231":1}}],["medium",{"2":{"113":1}}],["media",{"2":{"35":1}}],["meant",{"2":{"65":1,"126":1}}],["meaning",{"2":{"56":1,"76":1}}],["methods",{"2":{"53":1,"170":2,"204":1}}],["method",{"2":{"43":1,"145":1}}],["metadata",{"0":{"35":1,"36":1,"37":1},"1":{"36":1,"37":1},"2":{"35":1,"36":5,"37":1,"67":2}}],["mentioned",{"2":{"33":1}}],["missing",{"2":{"92":1,"109":2}}],["minimal",{"2":{"146":1}}],["minimize",{"2":{"60":1}}],["mind",{"0":{"46":1}}],["minutes",{"0":{"28":1},"1":{"29":1,"30":1,"31":1,"32":1,"33":1,"34":1},"2":{"69":1}}],["midfielder",{"2":{"45":1,"142":1}}],["mirroring",{"2":{"48":1}}],["mirror",{"2":{"28":1}}],["might",{"2":{"20":1,"219":1}}],["migrations",{"2":{"198":1}}],["migration",{"0":{"38":1,"139":1,"151":1},"1":{"140":1,"141":1,"142":1,"143":1,"144":1,"145":1,"146":1,"147":1,"148":1,"149":1,"150":1},"2":{"32":2,"36":2,"190":1}}],["migrating",{"2":{"4":1}}],["migrated",{"2":{"6":1,"32":2,"198":1}}],["migrate",{"2":{"6":3,"8":1,"32":1,"33":1,"67":1,"147":1,"169":1,"196":1,"198":3,"228":2}}],["mulitple",{"2":{"143":1}}],["multiplayer",{"2":{"104":1}}],["multiple",{"2":{"41":2,"56":1,"109":1,"143":1,"227":1,"228":1}}],["mud",{"2":{"113":1,"114":1}}],["much",{"2":{"109":1,"113":1,"167":1,"174":1}}],["mutates",{"2":{"56":1}}],["mutations",{"2":{"54":1,"164":1}}],["mutating",{"2":{"54":1}}],["mut",{"2":{"26":2,"29":3,"60":2,"63":1,"208":3,"210":1,"212":1}}],["must",{"2":{"16":1,"29":1,"41":2,"65":1,"113":3,"140":1}}],["moving",{"2":{"216":1,"217":1}}],["move",{"0":{"208":1,"214":1},"1":{"209":1,"210":1,"211":1,"212":1,"213":1,"214":1,"215":1},"2":{"26":1,"29":6,"31":5,"60":1,"63":3,"127":2,"146":1,"205":1,"206":1,"207":6,"208":6,"210":2,"214":3,"216":5,"217":6,"220":2,"221":1}}],["moved",{"2":{"18":1,"19":1,"26":3,"29":5,"60":4}}],["movesmodels",{"2":{"168":2}}],["moves",{"2":{"13":2,"16":5,"17":3,"21":2,"24":3,"26":4,"29":21,"31":9,"32":1,"33":6,"40":1,"56":3,"60":8,"63":8,"127":2,"168":2,"173":2,"214":1,"218":1,"229":1,"231":2}}],["monitoring",{"2":{"174":1}}],["moon",{"2":{"104":1}}],["most",{"2":{"49":1,"53":1,"118":1,"171":1}}],["modules",{"2":{"149":1}}],["module",{"2":{"145":1}}],["modularity",{"0":{"46":1},"2":{"40":1}}],["modular",{"2":{"28":1}}],["modification",{"2":{"43":1}}],["modify",{"2":{"43":1}}],["mod",{"2":{"29":1,"46":1,"49":1,"56":1,"60":1,"62":1,"63":1,"146":1,"202":8,"204":1,"210":1,"217":1}}],["modelregistered",{"2":{"25":1,"173":2}}],["model",{"0":{"24":1,"51":1,"141":1},"2":{"11":2,"12":1,"13":4,"16":3,"19":1,"21":1,"22":1,"23":1,"24":3,"29":12,"31":2,"33":7,"39":1,"40":2,"41":8,"42":2,"43":3,"44":1,"45":1,"46":9,"49":1,"51":2,"55":1,"62":3,"66":1,"67":10,"132":1,"140":2,"142":1,"167":2,"168":6,"173":3,"175":1,"197":1,"203":9,"213":1}}],["models",{"0":{"39":1,"40":1,"43":1,"140":1,"203":1,"206":1},"1":{"40":1,"41":2,"42":2,"43":2,"44":2,"45":2,"46":1,"207":1},"2":{"11":1,"14":1,"16":4,"17":2,"21":5,"25":1,"28":1,"29":7,"31":2,"32":2,"33":1,"39":4,"40":5,"42":2,"43":1,"45":1,"46":5,"49":1,"51":2,"53":2,"54":1,"60":2,"62":2,"63":5,"64":3,"65":2,"139":1,"140":1,"141":1,"142":1,"147":1,"167":2,"169":1,"173":2,"202":4,"203":5,"206":1,"207":2,"209":1,"210":7,"212":6,"217":2}}],["moreover",{"2":{"23":1,"115":1}}],["more",{"2":{"2":1,"22":1,"23":1,"32":1,"33":1,"51":1,"60":1,"106":1,"109":1,"113":1,"115":1,"116":1,"118":1,"126":1,"167":1,"168":1,"170":1,"172":1,"175":1,"218":1,"219":1}}],["made",{"2":{"218":1}}],["madara",{"0":{"10":1},"2":{"7":1,"10":1,"119":1}}],["magic",{"2":{"127":1}}],["market",{"2":{"113":1}}],["marked",{"2":{"51":1}}],["major",{"2":{"106":1}}],["masked",{"2":{"104":1}}],["master",{"2":{"83":1}}],["maps",{"2":{"103":1}}],["map",{"2":{"47":1,"103":1}}],["may",{"2":{"42":1,"92":1,"110":1,"113":1,"136":1,"190":1}}],["mainly",{"2":{"167":1}}],["maintains",{"2":{"173":1}}],["maintainable",{"2":{"116":1}}],["maintainability",{"2":{"116":1}}],["maintaining",{"2":{"40":1,"113":1,"118":1}}],["main",{"2":{"33":1,"49":2,"136":2}}],["making",{"2":{"33":1,"116":1,"198":1,"221":1}}],["make",{"2":{"32":2,"33":1,"85":1,"92":1,"122":1,"166":2,"198":1,"202":2,"208":1,"214":1,"218":2,"219":1,"220":2,"221":1}}],["makes",{"2":{"7":1,"56":1,"163":1}}],["mac",{"0":{"91":1},"1":{"92":1,"93":1,"94":1},"2":{"136":1}}],["machine",{"2":{"28":1,"32":1,"33":1,"115":1,"126":1,"166":1}}],["macros",{"2":{"14":1,"26":1}}],["match",{"2":{"22":1,"29":1,"207":3}}],["managing",{"2":{"190":1}}],["management",{"2":{"144":1,"190":1,"191":1}}],["managed",{"2":{"138":1}}],["manages",{"2":{"132":1}}],["manage",{"2":{"34":1,"36":1,"65":1,"156":1,"161":2,"222":1,"229":1}}],["manager",{"0":{"93":1},"2":{"20":2,"82":1,"93":1,"180":1,"192":1}}],["manner",{"2":{"113":1}}],["man",{"2":{"104":2}}],["manually",{"2":{"83":1}}],["manifest",{"2":{"32":1,"198":1}}],["many",{"2":{"2":1,"29":1,"31":1,"203":1,"218":1}}],["000",{"2":{"104":1}}],["07",{"2":{"33":3}}],["0xa",{"2":{"174":2}}],["0xb3e374b8087dca92601afbb9881fed855ac0d568e3bf878a876fca5ffcb479",{"2":{"169":1}}],["0xbeef",{"2":{"20":1,"202":1}}],["0x4d6f766573",{"2":{"174":1}}],["0x41d7f42bf7a362f0420aaae66d7a91df981100a039ac116a1d9cb632c74ad27",{"2":{"169":1}}],["0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf",{"2":{"169":1}}],["0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",{"2":{"169":3}}],["0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b",{"2":{"228":1}}],["0x3b7b034a087355c996abb52e363932c1135f8dd49587bc9a05902d3cf0650b",{"2":{"174":2}}],["0x35ec9fd22092dc0c8fc9341e94d5f361924d921c128fa46a0648f2dac519ce4",{"2":{"169":1}}],["0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd",{"2":{"32":1,"33":2}}],["0xparc",{"2":{"114":1}}],["0x02",{"2":{"210":2,"213":1,"217":1}}],["0x01",{"2":{"210":2,"213":1,"217":1}}],["0x0",{"2":{"63":1,"169":4,"174":3}}],["0x0001",{"2":{"33":1,"174":1}}],["0x0000000000000000000000000000000000000000000000000000000000000013",{"2":{"173":1}}],["0x000000000000000000000000000000000000000000000000000000000000000b",{"2":{"174":2}}],["0x0000000000000000000000000000000000000000000000000000000000000005",{"2":{"169":1}}],["0x0000000000000000000000000000000000000000000000000000000000000008",{"2":{"169":1}}],["0x000000000000000000000000000000000000000000000000000000000000000a",{"2":{"169":1}}],["0x000000000000000000000000000000000000000000000000000000000000000e",{"2":{"33":2}}],["0x0000",{"2":{"33":3,"169":3,"173":2,"174":3}}],["0x64",{"2":{"174":1}}],["0x64495ca6dc1dc328972697b30468cea364bcb7452bbb6e4aaad3e4b3f190147",{"2":{"33":1}}],["0x6",{"2":{"169":2}}],["0x6a11b5b3003a3aa0ae7f8f443e48314cc0bc51eaea7c3ed1c19beb909f5dda3",{"2":{"169":1}}],["0x6ffc643cbc4b2fb9c424242b18175a5e142269b45f4463d1cd4dddb7a2e5095",{"2":{"168":1}}],["0x6768b97b44cfbfa9f776a3c00ebe33c228058bf8716bb0515a1363049da2a11",{"2":{"7":2}}],["0x82d996aab290f086314745685c6f05bd69730d46589339763202de5264b1b6",{"2":{"32":1}}],["0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f",{"2":{"32":1,"169":1}}],["0x5686a647a9cdd63ade617e0baf3b364856b813b508f03903eb58a7e622d5855",{"2":{"228":1}}],["0x52a1da1853c194683ca5d6d154452d0654d23f2eacd4267c555ff2338e144d6",{"2":{"32":1}}],["0x506f736974696f6e",{"2":{"174":1}}],["0x509a65bd8cc5516176a694a3b3c809011f1f0680959c567b3189e60ddab7ce1",{"2":{"32":1}}],["0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138",{"2":{"32":3,"33":1}}],["0x59f31686991d7cac25a7d4844225b9647c89e3e1e2d03460dbc61e3fbfafc59",{"2":{"32":1,"169":1}}],["0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",{"2":{"20":1,"32":1,"33":2,"168":1,"169":3,"173":2,"174":2,"202":1,"228":2}}],["0x5b328933afdbbfd44901fd69a2764a254edbb6e992ae87cf958c70493f2d201",{"2":{"7":1}}],["0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d",{"2":{"174":2}}],["0x1987cbd17808b9a23693d4de7e246a443cfe37e6e7fbaeabd7d7e6532b07c3d",{"2":{"169":1}}],["0x1f03fa7dc5a673f96d53b728785a98d6ff089c182a7bb32735b150e91817e5b",{"2":{"169":1}}],["0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f",{"2":{"7":2}}],["0x1e7875674bcb09daaf984cbf77264ac98120cb39e6d17522520defcdc347476",{"2":{"169":2}}],["0x1",{"2":{"169":5,"174":2}}],["0x1800000000300000180000000000030000000000003006001800006600",{"2":{"20":1,"202":1,"228":2}}],["0x1234",{"2":{"16":1,"41":1}}],["0xc1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d",{"2":{"7":1}}],["0x2e5174b54aef0b99d4685827ffa51488447e1f5607908293d5c715d6bd22433",{"2":{"169":1}}],["0x2aa02de0e3fa582b3cb6cf9e4371051f44ae2e0d6c94f5c936338ffc8c2ac12",{"2":{"169":1}}],["0x2ffecbe8de6c7c10c785a6eb964ee6489f8dcf139000adbe2c0f12d249be7d8",{"2":{"169":1}}],["0x2730079d734ee55315f4f141eaed376bddd8c2133523d223a344c5604e0f7f8",{"2":{"169":1}}],["0x2da3d65e223362c72906f97663a4e7dc81ab0bbd04bbde5532a230c1e97d93e",{"2":{"169":1}}],["0x2d5260ba1d62ed0ea7c598f1460d27528b27afdf3bb43524a1ba3617e8279b2",{"2":{"7":2}}],["0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",{"2":{"33":2,"173":3}}],["0x2",{"2":{"7":1,"169":5,"174":2}}],["0",{"0":{"94":1,"139":2,"151":2,"200":1},"1":{"140":2,"141":2,"142":2,"143":2,"144":2,"145":2,"146":2,"147":2,"148":2,"149":2,"150":2,"201":1,"202":1,"203":1,"204":1,"205":1,"206":1,"207":1},"2":{"2":1,"7":3,"16":1,"20":5,"22":1,"32":3,"33":17,"36":1,"38":8,"42":1,"62":4,"94":1,"114":1,"121":1,"136":4,"139":2,"140":2,"143":2,"146":2,"166":4,"188":1,"202":5,"210":4,"213":4,"214":1,"216":2,"217":9}}],["2024",{"2":{"128":1}}],["2022",{"2":{"113":1}}],["2023",{"2":{"33":20,"173":2}}],["22",{"2":{"33":3}}],["212335z",{"2":{"33":1}}],["211678z",{"2":{"33":1}}],["210571z",{"2":{"33":1}}],["210032z",{"2":{"33":1}}],["2",{"0":{"93":1,"208":1},"1":{"209":1,"210":1,"211":1,"212":1,"213":1,"214":1,"215":1},"2":{"2":1,"20":1,"22":1,"29":1,"31":1,"32":2,"33":1,"38":1,"93":1,"114":1,"115":1,"118":1,"121":1,"171":2,"172":1,"202":2,"207":3,"210":2,"214":2}}],["uuid",{"0":{"68":1},"2":{"67":1,"68":2}}],["utilities",{"2":{"103":1}}],["utilizing",{"2":{"53":1,"105":1,"132":1}}],["utilization",{"2":{"52":1,"118":1}}],["utilized",{"2":{"40":1,"113":1}}],["utils",{"0":{"72":1},"2":{"56":1,"60":1,"63":1,"72":2,"149":1,"210":1}}],["u256",{"2":{"44":1,"45":1,"142":1,"144":1,"145":1,"147":2}}],["u128",{"2":{"44":1}}],["u16",{"2":{"44":1}}],["u64",{"2":{"44":1}}],["uris",{"2":{"36":1}}],["uri",{"2":{"36":6,"37":1,"67":3}}],["url",{"0":{"186":1},"2":{"7":3,"20":1,"188":3,"198":2,"199":1,"202":1,"228":3}}],["u32",{"2":{"21":2,"22":1,"24":1,"29":2,"43":3,"44":1,"46":10,"49":2,"203":6,"208":2}}],["u8",{"2":{"21":1,"24":1,"29":1,"40":1,"41":1,"44":1,"45":1,"46":2,"67":6,"142":1,"144":3,"145":3}}],["us",{"2":{"130":1,"171":1}}],["usage",{"0":{"78":1,"136":1,"160":1,"165":1,"179":1,"184":1,"226":1,"228":1},"1":{"137":1,"138":1,"166":1}}],["usize",{"2":{"45":1,"67":3,"142":1}}],["using",{"0":{"15":1,"157":1,"198":1},"1":{"199":1},"2":{"1":1,"6":1,"15":1,"16":1,"17":1,"26":1,"29":1,"33":1,"36":2,"39":1,"41":1,"51":2,"56":1,"60":1,"83":1,"104":1,"138":1,"149":1,"157":2,"171":1,"186":2,"198":2,"201":1,"203":1,"216":1,"218":1}}],["usually",{"2":{"173":1}}],["usual",{"2":{"43":1}}],["users",{"2":{"106":2,"113":1}}],["uses",{"2":{"33":1,"61":1,"118":1,"121":1,"171":2,"173":1,"186":1}}],["useful",{"0":{"64":1},"2":{"22":1,"42":1,"46":1,"68":1}}],["used",{"2":{"15":1,"16":1,"17":1,"18":1,"29":1,"41":1,"42":1,"68":1,"70":1,"77":2,"111":1,"173":1,"186":1,"188":1,"198":1,"228":1,"229":1,"230":1,"231":1,"232":1,"233":1,"234":1}}],["use",{"0":{"225":1,"227":1},"1":{"226":1,"228":1},"2":{"7":1,"9":1,"16":2,"26":1,"29":3,"31":2,"33":2,"39":1,"44":1,"46":8,"48":1,"49":4,"56":5,"60":4,"61":1,"62":1,"63":5,"65":2,"68":1,"69":1,"70":1,"76":1,"83":1,"103":1,"112":2,"116":1,"118":1,"121":1,"136":1,"137":1,"138":1,"141":1,"145":1,"149":3,"172":1,"175":3,"178":1,"186":1,"188":1,"198":2,"203":5,"206":1,"210":7,"213":2,"214":1,"216":3,"217":5,"227":3}}],["unreal",{"2":{"133":1}}],["unrestricted",{"2":{"113":1}}],["unhinged",{"2":{"104":1}}],["unassigned",{"2":{"80":1}}],["unaudited",{"2":{"7":1}}],["unwrap",{"2":{"63":1,"210":1,"212":1}}],["unless",{"2":{"53":1}}],["universally",{"2":{"113":1}}],["unity",{"2":{"130":1,"133":1,"178":1}}],["unit",{"0":{"62":1,"210":1},"2":{"62":1}}],["units",{"2":{"29":1,"31":1,"116":1,"202":2,"210":1,"217":1}}],["uniquely",{"2":{"41":1}}],["unique",{"2":{"14":1,"68":2,"130":1,"198":2}}],["unfamiliar",{"2":{"29":1}}],["underdark",{"2":{"104":1}}],["underworld",{"2":{"104":1}}],["understand",{"2":{"54":1,"65":1}}],["understanding",{"2":{"14":2,"105":1,"106":1,"200":1}}],["under",{"2":{"2":1,"104":1}}],["upgrade",{"2":{"67":1}}],["upload",{"2":{"36":2}}],["uploading",{"2":{"36":1}}],["updating",{"2":{"14":1,"17":1,"32":1,"105":1,"190":1,"191":1,"198":1}}],["updates",{"2":{"33":1,"185":1}}],["updatedat",{"2":{"33":3,"173":2}}],["updated",{"2":{"24":1,"33":1,"140":1,"173":2}}],["update",{"0":{"143":1},"1":{"144":1,"145":1,"146":1},"2":{"12":1,"13":2,"17":1,"23":1,"29":3,"31":1,"32":1,"92":1,"134":1,"140":1,"198":1,"223":2}}],["up",{"0":{"202":1},"2":{"5":1,"28":1,"29":1,"33":1,"59":1,"87":1,"109":1,"114":1,"155":1,"159":1,"173":1,"198":1,"213":1,"214":1,"216":1}}],["ultra",{"2":{"4":1}}],["guaranteed",{"2":{"118":1}}],["guarantees",{"2":{"113":1}}],["gui",{"2":{"190":1}}],["guiltygyoza",{"2":{"114":2}}],["guide",{"0":{"6":1,"89":1,"139":1,"151":1,"221":1},"1":{"90":1,"91":1,"92":1,"93":1,"94":1,"95":1,"96":1,"140":1,"141":1,"142":1,"143":1,"144":1,"145":1,"146":1,"147":1,"148":1,"149":1,"150":1},"2":{"1":1,"3":1,"5":1,"81":1,"87":3,"106":1,"198":1,"219":1,"220":2,"221":2}}],["gubsheep",{"2":{"114":1}}],["grows",{"2":{"170":1}}],["groups",{"2":{"167":1}}],["grid",{"2":{"104":1}}],["grpc",{"0":{"175":1},"2":{"74":1,"175":4,"176":1,"177":1,"179":1,"185":2,"199":1}}],["great",{"2":{"69":1,"168":1,"175":1,"205":1,"208":1,"219":1}}],["graphqql",{"2":{"176":1}}],["graphql",{"0":{"162":1,"164":1},"1":{"163":1,"164":1,"165":1,"166":1,"167":1,"168":1,"169":1,"170":1,"171":1,"172":1,"173":1,"174":1},"2":{"33":7,"163":2,"164":3,"166":2,"168":1,"169":1,"170":1,"173":2,"174":1,"177":1,"179":2,"185":2,"188":1,"199":1}}],["graphical",{"2":{"133":1}}],["graphics",{"2":{"133":2}}],["graphiql",{"2":{"33":4}}],["grant",{"2":{"13":2,"67":2}}],["give",{"0":{"133":1}}],["given",{"2":{"55":1,"127":1,"161":1,"223":1,"229":3,"231":1}}],["git",{"2":{"7":1,"20":1,"32":1,"83":3,"90":2,"136":1,"137":1,"138":1,"193":1,"202":1}}],["github",{"2":{"3":1,"7":1,"20":1,"32":1,"36":1,"80":1,"83":2,"90":1,"123":1,"138":1,"193":1,"202":1}}],["gap",{"2":{"219":1}}],["garbage",{"2":{"186":1}}],["gas",{"2":{"62":2,"63":1,"118":1,"210":2,"217":1}}],["gain",{"2":{"53":1,"200":1}}],["gateway",{"2":{"52":1}}],["gaming",{"2":{"1":1,"103":1,"114":1,"119":1,"129":1,"130":1}}],["gameturnimpl",{"2":{"207":1}}],["gameturntrait",{"2":{"207":3}}],["gameturn",{"2":{"203":1,"207":3,"208":1,"210":4}}],["gametrait",{"2":{"22":1}}],["gameplay",{"2":{"132":1}}],["gameimpl",{"2":{"22":1}}],["gamesettings",{"2":{"43":1}}],["gamestatusfelt252",{"2":{"22":1}}],["gamestatus",{"2":{"22":11}}],["games",{"0":{"115":1,"131":1},"1":{"116":1,"117":1,"118":1,"119":1,"132":1,"133":1},"2":{"1":2,"104":1,"113":1,"115":1,"122":2,"124":2,"129":1,"130":3,"131":1,"132":1}}],["game",{"0":{"1":1,"48":1,"124":1,"127":1,"198":1,"219":1},"1":{"2":1,"3":1,"49":1,"50":1,"51":1,"52":1,"199":1,"220":1,"221":1},"2":{"1":3,"21":1,"22":10,"26":1,"43":3,"47":1,"48":1,"49":1,"68":1,"104":6,"113":1,"114":1,"115":1,"127":4,"130":2,"132":2,"155":1,"174":1,"200":1,"202":2,"203":7,"204":2,"207":3,"208":10,"209":2,"210":27,"212":2,"213":3,"214":3,"216":1,"217":9,"218":5,"220":4,"221":1}}],["global",{"2":{"43":2}}],["glimpse",{"2":{"34":1}}],["goal",{"2":{"219":2}}],["goalkeeper",{"2":{"45":1,"142":1}}],["got",{"2":{"213":1}}],["godot",{"2":{"133":1}}],["governed",{"2":{"125":1}}],["governance",{"2":{"43":1}}],["good",{"2":{"62":1,"220":1}}],["goblinactionsimpl",{"2":{"46":1}}],["goblin",{"2":{"46":10}}],["goblins",{"2":{"46":2}}],["go",{"2":{"21":1,"33":2,"130":1,"168":1,"198":1,"203":1}}],["goerli",{"2":{"7":2}}],["generic",{"2":{"167":1}}],["general",{"0":{"188":1},"2":{"118":1,"119":1,"126":1}}],["generalized",{"2":{"14":1,"115":1}}],["generative",{"2":{"104":1}}],["generating",{"2":{"14":1,"232":1}}],["generates",{"2":{"49":1,"167":1}}],["generated",{"2":{"33":1,"167":1,"176":1}}],["generate",{"2":{"13":1,"22":1,"68":2,"119":1}}],["getting",{"2":{"27":1,"106":1}}],["get",{"0":{"3":1,"16":1,"97":1},"2":{"16":5,"26":2,"29":8,"31":4,"32":1,"33":1,"41":3,"46":1,"49":5,"52":1,"56":3,"60":8,"63":3,"69":2,"86":1,"123":1,"136":1,"163":1,"169":1,"173":1,"174":1,"208":5,"210":9,"213":3,"214":1,"216":1,"217":5,"219":2}}],["gt",{"2":{"7":1,"22":6,"24":3,"29":8,"32":10,"33":1,"38":2,"42":4,"45":4,"46":1,"49":2,"56":1,"60":1,"63":2,"67":32,"142":4,"144":1,"145":1,"147":2,"166":1,"174":1,"179":1,"188":4,"207":31,"208":2,"210":5,"213":2,"217":2,"229":4,"231":1}}],["g",{"2":{"7":1,"29":1,"31":1,"136":1,"203":1}}],["gg",{"2":{"7":2,"155":1,"228":1}}],["old",{"2":{"198":1}}],["optimizing",{"2":{"218":1}}],["optimized",{"2":{"119":1}}],["options",{"0":{"187":1,"188":1,"195":1},"1":{"188":1},"2":{"160":1,"184":1,"229":1,"231":1}}],["optional",{"2":{"143":1,"146":1}}],["option",{"2":{"67":1,"82":1,"186":1}}],["operates",{"2":{"118":1}}],["operation",{"0":{"168":1},"1":{"169":1,"170":1,"171":1,"172":1}}],["operations",{"0":{"173":1},"1":{"174":1},"2":{"14":1,"33":1,"116":1,"166":1}}],["operating",{"2":{"113":1}}],["opens",{"2":{"173":1}}],["opensource",{"2":{"126":1}}],["opening",{"2":{"110":1}}],["openness",{"2":{"11":1}}],["open",{"2":{"1":1,"2":1,"11":1,"29":2,"32":1,"33":2,"79":1,"80":1,"109":2,"110":1,"113":3,"116":1,"121":1,"123":2,"130":1,"198":1,"201":1}}],["omit",{"2":{"60":1}}],["override",{"2":{"92":1}}],["over",{"2":{"48":1,"118":1,"132":1}}],["overview",{"0":{"76":1},"2":{"34":1,"157":1,"193":1}}],["observe",{"2":{"33":1,"169":1}}],["others",{"2":{"218":1,"219":1}}],["otherwise",{"2":{"207":1}}],["other",{"2":{"16":1,"35":2,"70":1,"77":1,"109":1,"110":1,"127":1,"167":1}}],["origins",{"2":{"188":4}}],["origami",{"0":{"47":1},"2":{"47":2,"103":1}}],["org",{"2":{"36":1,"85":1,"135":1}}],["organize",{"2":{"33":1}}],["organizational",{"0":{"2":1}}],["order",{"2":{"33":1}}],["or",{"2":{"11":1,"14":1,"18":1,"20":1,"33":1,"36":2,"49":1,"77":2,"83":2,"92":1,"103":1,"109":2,"110":1,"113":1,"116":1,"128":1,"133":1,"134":1,"136":1,"138":2,"150":1,"161":1,"168":1,"170":1,"171":1,"173":1,"175":1,"186":1,"188":1,"191":1,"208":1,"218":2,"223":1,"229":1,"231":1}}],["ohayoo",{"2":{"7":1}}],["owns",{"0":{"121":1}}],["owners",{"2":{"13":1,"37":1}}],["owner",{"2":{"11":1,"13":3,"54":1,"67":3}}],["own",{"2":{"7":1,"23":1,"33":1,"70":1,"104":1,"218":2}}],["ought",{"2":{"53":1}}],["our",{"2":{"3":2,"29":2,"33":4,"128":1,"173":1,"180":1,"192":1,"198":2,"203":1,"204":1,"208":1,"212":2,"213":1,"216":3,"218":1,"221":1}}],["outlines",{"2":{"142":1}}],["outputted",{"2":{"156":1}}],["output",{"2":{"32":1,"33":3,"168":2,"169":1,"173":1,"174":1}}],["out",{"2":{"1":1,"3":1,"76":1,"109":1,"115":1,"128":1,"131":1,"157":1,"207":3,"208":2}}],["online",{"2":{"104":1}}],["only",{"2":{"12":1,"13":1,"59":1,"113":1,"168":1,"186":1}}],["ones",{"2":{"191":2,"198":1}}],["one",{"2":{"29":1,"41":1,"66":1,"118":1,"125":1,"136":1,"190":1}}],["once",{"2":{"29":1,"33":1,"113":1,"156":1,"170":1,"198":2,"199":1}}],["onchain",{"0":{"48":1,"124":1},"1":{"49":1,"50":1,"51":1,"52":1},"2":{"1":1,"103":1,"104":6,"122":1,"124":3,"125":1,"130":1,"179":1}}],["on",{"0":{"6":1,"129":1},"2":{"1":2,"4":1,"7":1,"16":1,"21":1,"28":1,"29":1,"31":1,"32":1,"33":4,"35":1,"36":1,"49":2,"54":1,"70":1,"82":1,"85":1,"92":1,"104":5,"113":3,"114":1,"115":1,"116":1,"119":1,"123":1,"124":2,"127":1,"128":1,"129":1,"130":2,"131":1,"132":4,"138":1,"141":1,"166":1,"167":1,"173":3,"174":1,"181":1,"186":2,"190":1,"193":1,"203":1,"205":1,"206":1,"207":1,"213":2,"219":1,"220":2,"221":1}}],["often",{"2":{"68":1}}],["offline=",{"2":{"225":1}}],["offline",{"0":{"224":1,"225":1},"1":{"225":1,"226":2},"2":{"195":1,"225":1,"226":2}}],["off",{"2":{"118":1,"127":2}}],["offering",{"2":{"118":1}}],["offer",{"2":{"113":1,"133":1}}],["offers",{"2":{"13":1,"132":1,"164":1,"169":1}}],["offchain",{"2":{"35":1}}],["offset",{"0":{"172":1},"2":{"24":2,"67":2,"170":1,"172":2}}],["of",{"0":{"29":1,"106":1,"107":1},"2":{"1":2,"2":1,"4":2,"5":1,"13":1,"16":2,"20":1,"21":1,"22":4,"23":1,"24":2,"28":1,"29":8,"31":4,"32":1,"33":3,"34":2,"40":1,"42":1,"45":1,"46":2,"47":1,"49":2,"52":1,"56":3,"58":1,"60":1,"61":1,"62":3,"65":2,"70":2,"82":1,"83":1,"84":1,"85":1,"97":2,"103":1,"104":4,"106":2,"107":1,"109":3,"113":9,"115":2,"116":5,"118":4,"122":2,"127":3,"130":2,"131":2,"132":4,"133":1,"137":1,"139":1,"140":1,"142":3,"145":1,"147":1,"149":1,"157":1,"161":1,"163":2,"164":1,"167":5,"168":4,"169":2,"170":1,"171":5,"173":1,"174":1,"177":1,"186":1,"188":3,"190":2,"191":1,"193":1,"200":1,"202":1,"203":1,"207":6,"208":5,"213":2,"218":1,"219":1,"220":2,"223":1,"229":1,"231":1}}],["wp",{"2":{"217":11}}],["w",{"2":{"188":1}}],["wsl",{"2":{"138":1}}],["wrong",{"2":{"63":3}}],["writing",{"0":{"62":1,"63":1,"111":1},"1":{"64":1,"112":1},"2":{"60":1,"62":1,"111":1}}],["written",{"2":{"17":1,"21":1}}],["write",{"2":{"14":1,"53":1,"55":1,"61":1,"63":2,"65":1,"116":1,"143":1,"208":1,"219":1}}],["writer",{"2":{"13":4,"67":3,"229":4}}],["won",{"2":{"220":1}}],["wondering",{"2":{"168":1}}],["worry",{"2":{"220":1}}],["worth",{"2":{"67":1,"84":1}}],["workaround",{"2":{"186":1}}],["working",{"2":{"119":1,"219":1}}],["workloads",{"2":{"82":1}}],["works",{"2":{"65":1}}],["workspace",{"2":{"33":1}}],["work",{"2":{"33":1,"104":1,"109":1,"163":2}}],["world",{"0":{"25":1,"36":1,"65":1,"67":1,"99":1,"100":1,"125":1,"197":1,"212":1},"1":{"66":1,"67":1,"68":1},"2":{"4":1,"6":2,"7":3,"8":1,"11":3,"12":1,"14":1,"15":1,"16":6,"17":3,"18":1,"19":1,"20":1,"21":2,"23":2,"24":3,"25":1,"26":5,"28":2,"29":18,"31":6,"32":6,"33":8,"35":2,"36":4,"39":1,"41":2,"46":7,"49":7,"51":1,"52":3,"53":3,"54":2,"56":7,"59":1,"60":13,"63":11,"64":3,"65":9,"66":2,"67":4,"68":1,"86":1,"104":4,"106":1,"113":5,"125":2,"133":1,"144":1,"145":1,"146":1,"149":1,"166":2,"167":3,"169":1,"170":1,"176":1,"179":3,"183":1,"185":2,"188":2,"190":2,"198":4,"199":2,"208":9,"209":2,"210":19,"212":8,"213":1,"214":1,"217":9,"229":5,"230":1,"231":6}}],["worldspawned",{"2":{"25":1}}],["worlds",{"0":{"113":1},"1":{"114":1},"2":{"1":1,"2":1,"11":2,"20":1,"32":1,"34":1,"35":1,"36":2,"56":1,"77":1,"84":1,"113":7,"114":5,"116":1,"119":1,"125":1,"132":2,"139":1,"176":1,"190":1,"191":1}}],["wouldn",{"2":{"130":1}}],["would",{"2":{"16":1,"41":1,"46":1,"76":1,"127":1}}],["wallet",{"2":{"209":1}}],["wallets",{"2":{"71":1}}],["wars",{"2":{"104":2}}],["warmly",{"2":{"1":1,"79":1}}],["wasm",{"0":{"75":1},"2":{"74":1,"75":2,"77":1,"115":1,"119":1,"178":1}}],["was",{"2":{"56":1,"122":1,"218":1}}],["wanting",{"2":{"81":1,"87":1}}],["want",{"2":{"42":1,"63":1,"70":1,"76":1,"127":1,"163":1,"201":1,"218":1}}],["way",{"2":{"14":1,"55":1,"69":1,"71":1,"82":1,"132":1,"175":2,"190":1}}],["ways",{"0":{"108":1},"1":{"109":1,"110":1},"2":{"14":1,"21":1,"203":1,"218":1}}],["why",{"0":{"122":1}}],["who",{"0":{"121":1},"2":{"130":1}}],["whole",{"2":{"55":1}}],["whether",{"2":{"191":1}}],["where",{"2":{"40":1,"127":1,"198":2,"204":1}}],["whenever",{"2":{"33":1,"173":1}}],["when",{"2":{"12":1,"21":1,"24":2,"25":2,"31":2,"33":1,"42":1,"43":1,"55":1,"59":1,"65":1,"67":1,"110":1,"122":1,"167":1,"173":2,"206":1,"216":1,"218":1,"227":1}}],["white",{"2":{"203":2,"207":3,"208":1,"209":1,"210":18,"213":5,"214":5,"216":3,"217":14}}],["while",{"2":{"28":1,"40":1,"43":1,"46":1,"49":1,"113":5,"118":1,"133":1,"203":1}}],["which",{"2":{"13":1,"16":1,"18":1,"20":1,"21":2,"31":1,"33":1,"42":1,"56":1,"60":1,"67":1,"85":1,"115":1,"118":1,"119":2,"129":2,"132":2,"139":1,"144":1,"146":1,"164":1,"173":2,"198":2,"213":1}}],["what",{"0":{"47":1,"54":1,"123":1,"124":1,"125":1,"126":1,"127":1,"130":1,"133":1,"220":1,"221":1},"1":{"131":1,"132":1,"133":1},"2":{"1":1,"23":1,"34":1,"97":1,"109":2,"127":1,"163":1,"201":1,"216":1,"219":1}}],["wish",{"2":{"199":1}}],["winner",{"2":{"127":1,"203":1}}],["wind",{"2":{"114":1}}],["windows",{"0":{"95":1},"2":{"82":1,"138":1}}],["wired",{"2":{"114":1}}],["will",{"2":{"6":1,"8":1,"13":1,"14":1,"18":1,"21":1,"24":4,"26":1,"32":1,"33":4,"34":1,"36":2,"46":2,"61":1,"64":2,"82":2,"85":2,"109":1,"110":1,"113":1,"138":1,"168":2,"169":1,"170":1,"173":1,"174":2,"181":1,"186":1,"193":1,"198":3,"203":2,"204":2,"220":1,"221":1,"229":1,"231":2,"233":1,"234":1}}],["without",{"2":{"113":1,"225":1}}],["within",{"2":{"11":2,"14":1,"15":1,"21":2,"22":1,"26":1,"49":1,"54":2,"61":1,"116":2,"119":1,"125":1,"129":1,"144":1,"147":1,"174":1,"234":1}}],["with",{"0":{"4":1,"46":1,"112":1},"1":{"5":1,"6":1},"2":{"1":3,"4":1,"6":1,"9":1,"11":1,"14":1,"15":1,"20":1,"24":2,"25":1,"26":1,"27":1,"28":1,"29":3,"31":1,"33":5,"35":1,"39":1,"40":1,"41":2,"43":1,"48":1,"49":1,"50":1,"51":1,"52":1,"56":1,"60":1,"63":1,"64":1,"65":3,"67":1,"69":1,"72":1,"77":2,"80":1,"81":1,"82":3,"84":1,"85":1,"87":1,"103":1,"104":2,"105":1,"113":2,"115":1,"118":1,"119":1,"124":1,"127":1,"133":1,"134":1,"136":1,"140":1,"144":1,"145":1,"149":1,"150":1,"163":2,"169":2,"173":3,"178":1,"185":1,"190":2,"198":7,"202":3,"203":1,"209":1,"210":1,"212":3,"218":2,"220":1,"227":1,"228":1,"229":3}}],["were",{"2":{"127":1}}],["well",{"2":{"106":1,"116":1}}],["welcome",{"2":{"105":1,"110":1,"130":1,"198":1}}],["welcomes",{"2":{"1":1,"79":1}}],["websockets",{"2":{"173":1}}],["website",{"2":{"36":2,"99":1,"100":1,"101":1}}],["webassembly",{"2":{"115":1,"119":1}}],["web",{"2":{"33":1,"124":1,"163":1}}],["we",{"0":{"220":1},"2":{"16":2,"17":1,"21":2,"22":1,"28":2,"29":7,"31":4,"32":2,"33":4,"36":1,"43":2,"46":3,"49":1,"52":1,"54":1,"62":1,"65":1,"81":1,"87":1,"112":2,"113":2,"127":3,"168":1,"173":2,"174":1,"198":4,"203":3,"204":1,"206":1,"207":1,"208":1,"212":4,"213":4,"214":2,"216":4,"220":3,"221":2}}],["weeks",{"2":{"1":1}}],["f",{"2":{"198":1,"199":1}}],["flow",{"0":{"209":1}}],["flags",{"0":{"137":1},"2":{"83":1,"137":1}}],["flexibility",{"2":{"28":1,"43":1,"163":1}}],["freely",{"2":{"113":1,"116":1}}],["free",{"2":{"109":1,"110":1,"121":1,"169":1}}],["frontend",{"2":{"221":2}}],["frontier",{"2":{"97":1}}],["from",{"0":{"81":1,"181":1,"193":1},"1":{"82":1,"83":1},"2":{"1":1,"5":1,"11":1,"16":2,"19":1,"26":1,"28":2,"29":3,"31":1,"33":2,"54":1,"61":1,"62":1,"63":1,"83":1,"110":1,"113":1,"118":1,"130":1,"136":2,"138":1,"142":1,"168":3,"169":2,"171":1,"179":1,"181":1,"188":1,"190":1,"198":1,"204":1,"207":1,"208":1}}],["framework",{"2":{"28":2,"61":1,"106":1,"116":2}}],["fn",{"2":{"22":4,"26":1,"29":5,"42":4,"45":3,"46":1,"49":2,"56":1,"60":2,"62":2,"63":2,"67":22,"68":1,"142":3,"144":1,"145":1,"207":12,"208":2,"210":3,"217":1}}],["fix",{"2":{"205":1}}],["fixing",{"2":{"110":1}}],["fill",{"2":{"219":1}}],["filtered",{"2":{"174":1}}],["filtering",{"2":{"167":1,"169":1}}],["filepath",{"2":{"188":1}}],["file",{"2":{"20":2,"29":3,"32":3,"36":3,"62":1,"63":1,"186":1,"198":2,"203":3,"204":1,"207":3,"210":1,"216":1}}],["filesystem",{"2":{"186":2}}],["files",{"2":{"20":1,"29":1,"140":1}}],["firt",{"2":{"207":1}}],["firm",{"2":{"113":1}}],["first",{"2":{"28":1,"32":1,"53":1,"65":1,"86":1,"113":1,"171":7,"198":2,"203":1,"213":1}}],["finish",{"2":{"221":1}}],["finished",{"2":{"22":2,"156":1,"198":1,"219":1}}],["finer",{"2":{"167":1}}],["finance",{"2":{"116":1}}],["finding",{"2":{"118":1}}],["find",{"2":{"47":1,"85":1,"109":2,"123":1,"168":1}}],["field",{"2":{"29":4,"41":2,"51":1}}],["fields",{"2":{"16":1,"29":1,"40":1,"41":2,"168":2,"169":1}}],["fit",{"2":{"23":1}}],["four",{"2":{"221":1}}],["founders",{"2":{"122":1}}],["foundational",{"2":{"49":1}}],["found",{"2":{"32":2,"46":1,"234":1}}],["folder",{"2":{"198":1,"201":2}}],["followed",{"2":{"219":1}}],["follow",{"2":{"41":1,"43":1,"85":1,"87":1,"156":1,"203":1}}],["follows",{"2":{"22":1,"107":1,"198":2,"220":1}}],["following",{"2":{"12":1,"15":1,"24":2,"25":1,"26":1,"29":1,"33":3,"36":1,"81":1,"87":1,"113":1,"136":1,"156":1,"198":4,"199":2,"200":1,"207":1}}],["fomoslg",{"2":{"104":1}}],["focus",{"2":{"49":1,"130":1,"132":1,"190":1}}],["fosters",{"2":{"40":1}}],["forward",{"2":{"171":2}}],["format",{"2":{"147":2,"163":2}}],["forms",{"2":{"113":2}}],["fork",{"2":{"136":2}}],["force",{"2":{"83":3,"119":1,"181":1,"193":1}}],["fortunately",{"2":{"26":1}}],["for",{"0":{"206":1},"1":{"207":1},"2":{"1":2,"5":1,"6":1,"9":1,"13":1,"14":1,"16":2,"20":1,"21":1,"24":2,"25":1,"28":1,"29":4,"31":2,"32":2,"33":2,"34":1,"36":3,"37":2,"41":2,"42":2,"43":4,"45":3,"46":2,"49":2,"51":2,"59":1,"61":2,"63":3,"65":1,"68":1,"72":1,"73":1,"75":1,"77":1,"80":2,"85":1,"87":1,"94":1,"103":1,"105":2,"106":2,"109":1,"111":1,"113":6,"114":1,"115":2,"116":2,"119":1,"121":1,"123":1,"126":1,"127":1,"130":1,"132":1,"141":1,"142":4,"143":1,"144":1,"146":1,"155":1,"157":1,"159":1,"161":1,"163":2,"164":1,"167":1,"168":1,"169":2,"171":1,"172":1,"173":2,"174":2,"176":2,"178":1,"181":1,"183":1,"185":3,"186":2,"188":3,"190":1,"193":1,"198":2,"199":1,"202":1,"203":1,"204":1,"206":1,"207":5,"208":2,"216":1,"218":1,"219":3,"220":1,"223":1,"226":1,"229":1,"232":1}}],["fuel",{"2":{"115":1}}],["fun",{"2":{"113":1}}],["fundamental",{"2":{"113":1}}],["functioning",{"2":{"51":1}}],["functionality",{"2":{"42":1,"70":1,"163":1,"164":2}}],["functions",{"0":{"64":1},"2":{"14":1,"29":2,"31":3,"42":1,"46":1,"54":1,"56":1,"60":1,"62":2,"65":1,"116":1,"144":1,"150":1,"208":1,"220":1}}],["function",{"0":{"31":1,"52":1,"58":1,"59":1,"150":1,"208":1},"1":{"209":1,"210":1,"211":1,"212":1,"213":1,"214":1,"215":1},"2":{"11":1,"14":1,"29":1,"31":1,"52":1,"53":1,"56":1,"58":1,"59":1,"63":2,"64":1,"145":1,"204":1,"208":2,"209":1,"210":1,"213":2,"214":1,"216":1}}],["further",{"2":{"52":1}}],["furthermore",{"2":{"46":1}}],["future",{"2":{"43":1,"169":1,"190":1}}],["full",{"0":{"67":1,"217":1},"2":{"20":1,"26":1,"85":1,"104":1,"207":1,"216":1,"220":2}}],["fully",{"2":{"1":1,"113":1,"176":1}}],["fetching",{"2":{"170":1}}],["fetch",{"2":{"168":1,"169":1,"175":1,"223":1}}],["fetched",{"2":{"168":1}}],["feature",{"2":{"46":1,"80":1,"116":1,"173":1,"218":1}}],["features",{"0":{"191":1},"2":{"39":1,"105":1,"106":1,"113":2}}],["featuring",{"2":{"4":1}}],["felt252",{"2":{"22":2,"24":5,"25":2,"26":2,"67":29}}],["few",{"2":{"6":1,"111":1}}],["feel",{"2":{"109":1,"110":1,"169":1}}],["fee",{"2":{"5":1,"32":1}}],["familar",{"2":{"203":1}}],["familiarize",{"2":{"84":1}}],["familiarizing",{"2":{"1":1}}],["familiar",{"2":{"27":1}}],["fairness",{"2":{"127":1}}],["fair",{"2":{"127":1}}],["faced",{"2":{"122":1}}],["facilitates",{"2":{"52":1}}],["facilitate",{"2":{"14":1}}],["false",{"2":{"42":1}}],["faqs",{"0":{"120":1},"1":{"121":1,"122":1,"123":1,"124":1,"125":1,"126":1,"127":1,"128":1,"129":1}}],["faq",{"2":{"21":1}}],["fast",{"2":{"4":1,"10":1,"176":1,"186":1}}],["tsubasa",{"2":{"149":1}}],["turn",{"2":{"169":1,"207":4,"208":6,"210":11,"212":1}}],["turing",{"2":{"116":1,"126":1}}],["tutorials",{"2":{"219":1}}],["tutorial",{"2":{"157":1,"198":1,"207":1,"218":1,"220":1}}],["tuple",{"2":{"16":1,"45":4,"142":4}}],["ty",{"2":{"45":7,"142":8}}],["typo",{"2":{"110":1}}],["typename",{"2":{"173":3}}],["typed",{"2":{"144":1,"176":1}}],["type",{"2":{"45":4,"46":1,"142":8,"170":2,"203":1,"207":1,"208":6,"210":6,"213":2,"214":2,"217":10}}],["types",{"0":{"44":1,"45":1},"2":{"33":1,"39":1,"40":1,"44":2,"45":2,"142":3}}],["typical",{"2":{"29":1}}],["tcontractstate",{"2":{"29":3,"49":2,"144":3}}],["terms",{"2":{"118":1}}],["terminal",{"2":{"32":4,"33":4,"138":1,"166":1,"198":2,"199":1}}],["terminology",{"2":{"29":1,"113":1}}],["technologies",{"2":{"163":1}}],["technology",{"2":{"113":1,"163":1}}],["technical",{"2":{"118":1}}],["tech",{"2":{"115":1}}],["team",{"2":{"103":1,"104":2,"119":2}}],["templates",{"0":{"103":1},"2":{"103":1}}],["test",{"0":{"64":1,"209":1,"213":1,"214":1,"216":1,"234":1},"1":{"217":1,"218":1},"2":{"29":1,"61":2,"62":8,"63":11,"64":2,"92":2,"149":2,"150":2,"155":1,"196":1,"209":2,"210":14,"212":7,"216":3,"217":1,"220":1,"234":3}}],["tests",{"0":{"62":1,"63":1,"210":1},"1":{"64":1},"2":{"29":1,"61":2,"62":2,"63":6,"202":4,"210":2,"216":1,"217":3,"234":1}}],["testnets",{"2":{"9":1}}],["testnet",{"2":{"4":1}}],["testing",{"0":{"61":1,"148":1,"150":1},"1":{"62":1,"63":1,"64":1,"149":1,"150":1},"2":{"4":1,"61":2,"62":1,"149":1,"186":1,"208":1,"209":1}}],["tip",{"2":{"137":1}}],["tinkering",{"2":{"113":1}}],["tight",{"2":{"28":1}}],["time",{"2":{"12":1,"14":1,"23":1,"29":1,"31":1,"33":1,"37":1,"48":1,"130":1,"168":1,"173":1}}],["two",{"2":{"21":1,"31":1,"113":1,"167":1,"170":1,"171":1,"176":1}}],["twitter",{"2":{"3":1,"36":1,"97":1,"102":1}}],["trust",{"2":{"127":1}}],["trustless",{"2":{"113":1}}],["true",{"2":{"7":1,"20":1,"42":1,"202":1}}],["try",{"2":{"63":1,"205":1,"207":1,"210":1,"212":1,"218":1}}],["transactions",{"0":{"169":1},"2":{"169":3,"185":2}}],["transaction",{"2":{"118":1,"127":1,"169":2,"174":1,"185":1}}],["transactionhash",{"2":{"33":2,"169":4,"174":3}}],["transform",{"2":{"48":1}}],["traits",{"0":{"42":1,"206":1},"1":{"207":1},"2":{"39":1,"42":1,"46":2,"149":1,"206":1,"207":1}}],["trait",{"2":{"22":3,"29":2,"42":3,"45":1,"46":1,"49":1,"60":1,"67":1,"141":1,"142":1,"144":2,"207":6}}],["treated",{"2":{"21":1,"29":1,"203":1}}],["tasks",{"2":{"190":1}}],["tandem",{"2":{"185":1}}],["tangible",{"2":{"46":1}}],["tarrencev",{"2":{"136":4}}],["targeted",{"2":{"173":1}}],["target",{"2":{"20":1,"202":1}}],["tallies",{"2":{"46":1}}],["takeaways",{"2":{"142":1}}],["takes",{"2":{"116":1,"131":1}}],["take",{"2":{"43":1,"49":1,"110":1}}],["taking",{"2":{"28":1}}],["tables",{"2":{"33":1}}],["table",{"2":{"24":3}}],["tag",{"2":{"7":1,"29":1,"80":1}}],["tlsv1",{"2":{"93":1}}],["tl",{"2":{"14":1,"39":1,"53":1,"175":1}}],["t",{"0":{"133":1},"2":{"6":1,"28":1,"33":1,"67":24,"113":1,"130":1,"133":1,"215":1,"218":1,"219":1,"220":2}}],["too",{"2":{"220":1}}],["toolchain",{"2":{"27":1,"36":1,"37":1,"81":1,"87":1,"119":1,"129":1,"155":1,"159":1}}],["tool",{"2":{"13":1,"20":2,"36":1,"130":1,"190":2,"198":1,"202":2,"228":2}}],["tools",{"2":{"1":1,"85":1,"122":1,"131":1}}],["torri",{"2":{"199":1}}],["torii",{"0":{"74":1,"75":1,"77":1,"162":1,"176":1,"177":1,"178":1,"182":1,"199":1},"1":{"78":1,"163":1,"164":1,"165":1,"166":1,"167":1,"168":1,"169":1,"170":1,"171":1,"172":1,"173":1,"174":1,"177":1,"178":1,"179":1,"183":1,"184":1,"185":1,"186":1,"187":1,"188":1},"2":{"18":2,"23":1,"24":1,"25":1,"26":1,"33":20,"74":2,"75":2,"76":1,"77":1,"83":3,"85":1,"155":1,"159":1,"166":3,"167":1,"170":1,"175":1,"176":3,"177":1,"178":1,"179":2,"180":1,"181":3,"183":1,"184":1,"185":1,"186":2,"199":2}}],["todo",{"2":{"146":1,"151":1}}],["tower",{"2":{"104":1}}],["topic",{"2":{"125":1}}],["top",{"2":{"70":1}}],["tokens",{"2":{"47":1}}],["token",{"2":{"45":1,"142":1,"144":1,"145":1,"147":2}}],["totalcount",{"2":{"169":2,"171":2}}],["total",{"2":{"32":2}}],["touched",{"2":{"31":1}}],["toml",{"2":{"7":1,"8":1,"20":2,"29":1,"32":1,"36":2,"49":1,"198":2,"202":2,"228":1}}],["to",{"0":{"6":1,"7":1,"8":1,"9":1,"10":1,"48":1,"79":1,"80":1,"105":1,"108":1,"139":1,"140":1,"151":1,"174":1},"1":{"8":1,"9":1,"10":1,"49":1,"50":1,"51":1,"52":1,"80":1,"106":1,"107":1,"108":1,"109":2,"110":2,"111":1,"112":1,"140":1,"141":1,"142":1,"143":1,"144":1,"145":1,"146":1,"147":1,"148":1,"149":1,"150":1},"2":{"1":2,"2":1,"4":1,"5":2,"6":3,"7":3,"8":1,"9":2,"11":5,"12":1,"13":4,"14":5,"15":1,"16":4,"17":1,"18":1,"20":1,"21":5,"23":3,"24":1,"27":1,"28":3,"29":12,"31":2,"32":5,"33":18,"34":2,"35":1,"36":6,"37":1,"39":1,"40":3,"41":5,"42":1,"43":6,"44":1,"45":2,"46":1,"49":1,"51":1,"52":1,"53":5,"54":2,"55":3,"56":2,"60":3,"61":3,"62":2,"63":1,"65":5,"66":2,"68":2,"69":2,"70":1,"71":1,"74":1,"76":4,"77":2,"80":3,"81":1,"82":1,"83":1,"84":1,"86":2,"87":3,"92":3,"104":1,"105":1,"106":5,"109":1,"110":3,"113":8,"115":3,"116":4,"118":2,"119":4,"121":1,"122":2,"123":1,"124":1,"126":2,"127":4,"128":1,"129":1,"130":6,"132":3,"134":1,"136":10,"138":1,"139":1,"140":3,"142":3,"143":1,"144":1,"145":3,"146":2,"147":1,"149":1,"150":1,"156":2,"157":1,"163":5,"164":3,"166":1,"167":3,"168":1,"169":4,"170":2,"171":3,"172":1,"173":9,"174":3,"175":3,"176":3,"178":2,"179":1,"181":1,"185":2,"186":4,"188":3,"190":3,"198":10,"199":2,"200":1,"202":3,"203":3,"205":1,"207":3,"208":2,"210":1,"212":1,"213":3,"214":2,"215":1,"216":11,"217":3,"218":2,"219":6,"220":3,"221":2,"227":1,"228":1,"229":1,"230":1,"231":7,"232":1,"233":1,"234":1}}],["those",{"2":{"105":1,"106":1}}],["thorough",{"2":{"4":1}}],["thriving",{"2":{"97":1}}],["throughput",{"2":{"118":1}}],["throughout",{"2":{"111":1,"113":1,"140":1,"174":1}}],["through",{"2":{"53":1,"115":1,"118":1,"175":1,"198":2}}],["thinkers",{"2":{"97":1}}],["think",{"2":{"55":1,"109":1}}],["this",{"0":{"221":1},"2":{"0":1,"1":2,"5":1,"9":1,"11":2,"13":1,"18":1,"20":1,"21":2,"22":2,"24":4,"26":1,"27":1,"28":5,"29":8,"32":5,"33":10,"34":1,"35":1,"37":2,"40":1,"41":3,"42":2,"43":2,"46":2,"49":2,"51":1,"52":2,"56":3,"58":1,"59":1,"60":1,"61":1,"62":1,"63":1,"64":1,"65":1,"66":1,"67":1,"68":1,"70":1,"85":1,"87":2,"111":1,"113":5,"115":1,"116":1,"127":3,"128":1,"132":2,"136":4,"140":1,"141":1,"144":1,"145":1,"146":1,"161":1,"163":2,"168":3,"169":2,"170":1,"173":8,"174":3,"181":1,"186":1,"193":1,"198":3,"202":5,"203":4,"204":2,"207":2,"208":3,"216":2,"218":2,"219":4,"220":4,"221":1,"223":1,"229":2,"231":3}}],["than",{"2":{"118":1,"143":1,"204":1}}],["thanks",{"2":{"23":1,"127":1}}],["that",{"2":{"6":1,"14":1,"16":4,"21":3,"23":1,"26":1,"27":1,"28":1,"29":4,"32":5,"33":5,"41":3,"42":1,"43":1,"46":1,"47":1,"48":1,"54":2,"59":1,"61":1,"63":1,"65":1,"67":1,"76":1,"80":1,"92":1,"103":1,"105":1,"106":1,"109":1,"113":5,"116":1,"118":1,"124":1,"125":2,"127":1,"130":1,"163":5,"164":1,"170":1,"173":5,"177":1,"190":1,"198":2,"203":2,"204":1,"205":1,"208":1,"209":2,"212":1,"213":2,"220":1}}],["thesis",{"2":{"114":1}}],["these",{"2":{"11":1,"14":1,"18":3,"23":2,"25":2,"26":1,"29":1,"31":1,"34":1,"40":1,"43":1,"51":1,"54":1,"56":1,"72":1,"76":1,"105":1,"113":2,"132":1,"138":1,"174":1,"185":1,"218":1}}],["thereby",{"2":{"60":1}}],["there",{"2":{"23":1,"26":1,"113":1,"167":1,"171":1,"176":1,"203":1,"208":1,"218":1}}],["their",{"2":{"14":1,"20":1,"49":1,"53":1,"106":1,"113":2,"127":1,"130":1,"213":2}}],["they",{"2":{"14":1,"15":1,"22":1,"29":1,"31":2,"41":1,"46":2,"109":1,"113":2,"116":1,"167":1,"172":1,"174":1,"217":1}}],["then",{"2":{"8":1,"16":1,"22":1,"24":2,"41":1,"46":2,"63":1,"85":1,"109":1,"145":1,"185":1,"198":3,"205":1,"212":2,"213":1,"214":1,"228":1}}],["them",{"2":{"4":1,"14":1,"35":1,"39":1,"43":1,"61":1,"85":1,"206":1,"216":1}}],["theory",{"2":{"1":1,"21":1,"32":1,"84":1,"106":1}}],["the",{"0":{"1":1,"16":1,"17":1,"18":1,"19":1,"41":1,"49":1,"51":1,"60":1,"65":1,"79":1,"94":1,"106":2,"123":1,"201":1,"202":1,"211":1},"1":{"2":1,"3":1,"66":1,"67":1,"68":1,"80":1,"212":1,"213":1,"214":1},"2":{"1":6,"2":1,"4":3,"5":2,"6":1,"8":2,"11":4,"12":8,"13":7,"14":2,"15":2,"16":16,"17":6,"18":1,"19":2,"21":6,"22":2,"23":2,"24":7,"25":2,"26":2,"27":2,"28":5,"29":48,"31":24,"32":7,"33":23,"34":1,"35":2,"36":14,"37":1,"39":3,"40":3,"41":9,"42":1,"43":4,"45":7,"46":6,"47":2,"49":8,"51":5,"52":5,"53":3,"54":2,"55":2,"56":7,"59":4,"60":11,"62":5,"63":3,"64":3,"65":13,"66":3,"67":2,"68":1,"70":3,"74":1,"76":2,"80":3,"81":2,"82":4,"83":3,"84":3,"85":2,"87":2,"92":2,"93":1,"94":1,"97":1,"103":1,"104":11,"105":4,"106":3,"107":2,"109":2,"110":1,"111":1,"113":20,"114":1,"115":3,"116":8,"118":7,"119":5,"121":2,"122":2,"123":3,"124":2,"125":2,"126":1,"127":7,"128":3,"129":2,"130":7,"131":1,"132":6,"136":5,"138":1,"140":1,"141":1,"142":12,"144":3,"145":4,"146":2,"147":1,"149":4,"150":3,"156":2,"157":3,"161":3,"163":6,"164":1,"166":1,"167":9,"168":11,"169":5,"170":2,"171":6,"172":2,"173":11,"174":3,"175":2,"176":3,"177":3,"178":1,"180":1,"181":3,"185":8,"186":7,"188":4,"190":4,"193":3,"198":23,"199":4,"200":2,"201":2,"202":1,"203":3,"204":3,"205":2,"206":2,"207":2,"208":5,"209":6,"210":1,"213":9,"214":7,"215":1,"216":4,"217":1,"218":6,"219":6,"220":4,"221":3,"222":1,"223":2,"225":1,"229":6,"231":6,"232":2,"233":2,"234":2}}],["b5",{"2":{"217":8}}],["b7",{"2":{"217":4}}],["bp",{"2":{"217":10}}],["b",{"2":{"42":4}}],["but",{"2":{"113":2,"124":1,"125":1,"127":1,"219":1}}],["button",{"2":{"33":1}}],["burner",{"0":{"71":1},"2":{"71":3}}],["bun",{"2":{"70":1,"71":1,"72":1,"73":1,"74":1,"75":1}}],["builds",{"2":{"116":1}}],["builders",{"2":{"97":1}}],["building",{"0":{"81":1,"83":1,"131":2,"219":1,"220":1},"1":{"82":1,"83":1,"132":2,"133":2,"220":1,"221":1},"2":{"32":1,"65":1,"83":1,"106":1,"116":1,"122":2,"130":2,"131":1,"132":1,"190":1,"207":1,"220":1}}],["build",{"0":{"232":1},"2":{"6":1,"32":2,"70":1,"130":1,"196":1,"198":3,"202":1,"205":3,"208":1,"220":1,"226":1,"232":2}}],["built",{"2":{"1":1,"33":1,"35":1,"85":1,"104":2,"167":1,"176":1}}],["baron",{"2":{"104":1}}],["bash",{"2":{"85":1,"135":1,"138":1,"156":1}}],["basics",{"2":{"220":1}}],["basic",{"0":{"203":1,"204":1},"2":{"49":1,"200":1,"203":1,"207":1,"218":1}}],["base",{"2":{"32":1,"67":1}}],["based",{"2":{"29":1,"33":1,"104":1,"132":1,"170":1,"171":1,"172":1,"174":1,"220":1}}],["balance",{"2":{"41":2}}],["backward",{"2":{"171":2}}],["backend",{"2":{"163":1,"177":1}}],["back",{"2":{"33":2,"203":1}}],["bring",{"2":{"133":1}}],["briq",{"0":{"100":1},"2":{"2":1}}],["brave",{"2":{"113":1}}],["branch",{"0":{"137":1},"2":{"83":1,"134":1,"136":8}}],["browsers",{"2":{"124":1}}],["browser",{"2":{"33":1,"115":1,"128":1}}],["brew",{"2":{"136":1}}],["brewing",{"2":{"104":1}}],["breaks",{"2":{"173":1}}],["breakdown",{"0":{"50":1},"1":{"51":1,"52":1}}],["breaking",{"0":{"30":1,"57":1},"1":{"31":1,"58":1,"59":1,"60":1},"2":{"139":1}}],["breeze",{"2":{"32":1}}],["bishop",{"2":{"203":1,"207":1}}],["binary",{"2":{"180":1,"191":2,"192":1}}],["binaries",{"0":{"138":1},"2":{"138":1}}],["binding",{"2":{"176":1}}],["bindings",{"2":{"75":1,"77":1,"152":1}}],["bin",{"2":{"83":1}}],["bit",{"2":{"28":1,"33":1}}],["bibliothecadao",{"2":{"2":1}}],["board",{"2":{"203":1,"207":3,"208":4,"213":1,"214":1}}],["boilerplate",{"0":{"202":1},"2":{"49":1,"60":1,"116":1,"146":1,"202":1}}],["boxtrait",{"2":{"46":1}}],["box",{"2":{"46":1}}],["bootstrap",{"2":{"179":1}}],["bool",{"2":{"42":4,"67":2,"144":1,"145":1,"207":9}}],["book",{"0":{"105":1,"106":1},"1":{"106":1,"107":1,"108":1,"109":1,"110":1,"111":1,"112":1},"2":{"1":1,"105":2,"106":2,"107":1,"110":1,"111":1,"115":1,"117":2,"219":2}}],["both",{"2":{"28":1,"29":1,"31":1,"41":1,"82":1,"106":1,"167":1,"170":1,"171":1}}],["black",{"2":{"203":2,"207":3,"208":1,"209":1,"210":9,"213":2,"216":3,"217":11}}],["blazingly",{"2":{"10":1,"176":1}}],["blog",{"2":{"97":1}}],["blocks",{"2":{"185":1}}],["block",{"2":{"33":11,"66":1,"188":3,"199":1}}],["blockchains",{"2":{"113":1,"129":1}}],["blockchain",{"2":{"11":1,"113":2,"124":1,"127":3}}],["blending",{"2":{"1":1}}],["between",{"2":{"219":1}}],["better",{"2":{"138":1,"218":1}}],["becoming",{"2":{"163":1}}],["becomes",{"2":{"167":1}}],["become",{"2":{"115":1,"170":1}}],["behavior",{"2":{"132":1}}],["behind",{"2":{"49":1,"60":1,"119":1}}],["believers",{"2":{"113":1}}],["believe",{"2":{"113":1}}],["below",{"2":{"45":1,"142":1,"210":1,"216":1}}],["beware",{"2":{"104":1}}],["beer",{"2":{"104":2}}],["been",{"2":{"16":1,"21":1,"33":1,"37":1,"113":1,"140":2,"144":1,"198":1,"209":1}}],["bear",{"2":{"29":1}}],["beginners",{"2":{"220":1}}],["beginner",{"2":{"219":1}}],["beginning",{"2":{"218":1}}],["begin",{"2":{"28":1}}],["benefit",{"2":{"28":1,"167":1}}],["beneficial",{"2":{"26":1}}],["be",{"2":{"6":1,"9":1,"17":1,"18":1,"20":1,"21":2,"24":1,"26":1,"29":2,"32":3,"36":1,"41":1,"42":1,"43":1,"46":1,"47":1,"53":1,"55":1,"65":1,"67":1,"68":1,"77":2,"80":1,"106":1,"109":2,"110":1,"113":5,"127":2,"130":1,"144":1,"145":1,"172":2,"174":1,"176":1,"180":1,"186":3,"192":1,"203":1,"204":1,"208":1,"210":9,"213":2,"214":2,"216":1,"217":10,"219":1,"227":1,"228":1}}],["before",{"2":{"4":1,"16":1,"53":1,"84":1,"145":1,"171":3,"198":1,"200":1,"206":1,"216":1,"219":1}}],["best",{"2":{"1":1,"40":1,"62":1}}],["byo",{"2":{"76":1}}],["byte",{"2":{"45":2,"142":4}}],["by",{"0":{"6":1,"98":1},"1":{"99":1,"100":1,"101":1,"102":1},"2":{"1":1,"2":1,"11":1,"14":2,"18":2,"24":1,"25":1,"26":1,"28":1,"29":3,"31":1,"33":2,"36":3,"37":1,"41":3,"46":1,"48":1,"60":1,"63":1,"66":1,"67":1,"70":1,"83":2,"92":1,"93":1,"103":1,"104":3,"110":1,"113":3,"115":1,"116":3,"118":2,"125":2,"126":1,"127":1,"138":1,"144":1,"155":1,"164":1,"169":2,"173":2,"174":1,"198":1,"204":1,"207":1,"209":1,"219":1,"220":1,"227":1,"233":1}}],["c3",{"2":{"210":4,"214":4}}],["cycle",{"2":{"173":1}}],["cmd",{"2":{"138":1}}],["cvm",{"2":{"115":1}}],["circuits",{"2":{"115":1}}],["ceases",{"2":{"113":1}}],["centralized",{"2":{"113":1}}],["central",{"2":{"65":1}}],["c",{"0":{"152":1},"2":{"103":2,"136":1,"152":1,"178":1}}],["cd",{"2":{"83":1,"193":1,"198":1,"201":1}}],["c++",{"2":{"82":1}}],["cfg",{"2":{"62":1,"63":1,"210":1}}],["ctx",{"2":{"26":1}}],["clear",{"2":{"202":1}}],["cleaning",{"0":{"202":1}}],["cleaner",{"2":{"116":1}}],["clean",{"2":{"22":1,"33":1}}],["cloning",{"2":{"233":1}}],["clone",{"0":{"90":1},"2":{"83":2,"90":1,"193":1}}],["closely",{"2":{"119":1}}],["click",{"2":{"207":1}}],["clicking",{"2":{"33":1}}],["cli",{"2":{"32":1,"85":1,"161":1,"190":1,"191":2}}],["clients",{"2":{"76":1,"77":2,"124":1,"173":2,"176":1,"178":1}}],["client",{"0":{"74":1,"77":1,"128":1,"178":1},"1":{"78":1},"2":{"18":1,"67":1,"74":2,"75":1,"76":2,"77":2,"119":1,"127":1,"163":1,"173":4,"175":2,"176":2,"178":1,"185":1}}],["clarify",{"2":{"29":1}}],["classic",{"2":{"104":1}}],["classhash",{"2":{"25":4,"33":2,"67":6,"168":3}}],["class",{"2":{"20":1,"25":4,"32":3,"63":3,"67":3,"149":1,"202":1,"210":5,"212":6}}],["culmination",{"2":{"130":1}}],["curr",{"2":{"208":2,"210":7,"213":3,"214":3,"217":15}}],["current",{"2":{"16":1,"28":1,"29":4,"31":1,"169":1,"208":8,"214":1,"233":1}}],["currently",{"2":{"1":1,"44":1,"59":1,"79":1,"118":1,"138":1}}],["cursors",{"2":{"171":1}}],["cursor",{"0":{"171":1},"2":{"170":1,"171":4,"172":1}}],["curl",{"2":{"85":1,"93":1,"135":1,"156":1}}],["customizable",{"2":{"174":1}}],["custom",{"0":{"26":1,"43":1,"45":1},"2":{"18":1,"23":1,"26":2,"29":2,"39":1,"44":1,"60":1,"61":1,"142":1,"163":1,"167":3,"185":1}}],["choice",{"2":{"133":1}}],["chunks",{"2":{"109":1}}],["cheaper",{"2":{"118":1}}],["chess",{"0":{"219":1},"1":{"220":1,"221":1},"2":{"104":2,"127":2,"201":2,"202":1,"203":4,"207":1,"210":4,"216":1,"217":4,"218":3,"220":6,"221":1}}],["che",{"2":{"103":1}}],["checkmate",{"2":{"218":1}}],["checking",{"2":{"217":1}}],["checks",{"2":{"12":1,"218":1}}],["check",{"2":{"1":1,"3":1,"33":1,"63":3,"115":1,"157":1,"208":3,"213":2,"214":1,"216":1,"220":1}}],["children",{"2":{"45":1,"142":1}}],["challenges",{"2":{"218":1}}],["change",{"2":{"149":1,"208":1}}],["changes",{"0":{"141":1,"148":1},"1":{"149":1,"150":1},"2":{"33":1,"110":2,"139":1,"143":1,"149":1}}],["channel",{"2":{"127":1}}],["chain",{"2":{"104":2,"113":2,"118":1,"124":1,"127":2,"130":1,"131":1,"207":1,"220":1}}],["chains",{"2":{"11":1}}],["character",{"2":{"21":1,"137":1}}],["chapters",{"0":{"112":1},"2":{"106":1,"110":1,"221":1}}],["chapter",{"2":{"11":1,"29":1,"200":1,"203":1,"204":1,"206":1,"216":1}}],["cryptographic",{"2":{"118":1}}],["crypto",{"2":{"114":1}}],["crypts",{"2":{"103":1}}],["crystallized",{"2":{"113":1}}],["crawler",{"2":{"104":1}}],["crates",{"2":{"83":2,"181":1,"193":1}}],["crafting",{"2":{"29":1}}],["craft",{"2":{"23":1,"34":1,"43":1}}],["creators",{"2":{"132":1}}],["creative",{"2":{"190":1}}],["creativity",{"2":{"34":1}}],["creating",{"2":{"63":1,"115":1,"206":1}}],["creation",{"0":{"144":1},"2":{"22":1,"33":1,"43":1}}],["createcardimpl",{"2":{"145":1}}],["created",{"2":{"33":1,"122":1,"127":1,"145":1,"209":2}}],["createdat",{"2":{"33":5,"173":2}}],["creates",{"2":{"28":1}}],["create",{"0":{"71":1},"2":{"22":1,"33":2,"36":1,"41":1,"46":1,"63":1,"64":1,"71":2,"80":1,"86":1,"116":1,"130":1,"144":1,"145":2,"149":4,"150":2,"169":1,"198":3,"199":1,"201":1,"203":1,"218":1,"223":2}}],["credentials",{"2":{"8":1,"161":1,"198":2}}],["crucial",{"2":{"11":2,"45":1,"61":1,"113":1,"142":1}}],["colors",{"2":{"213":1}}],["color",{"2":{"203":10,"207":21,"208":7,"210":16,"213":3,"214":3,"217":16}}],["collected",{"2":{"186":1}}],["collections",{"2":{"132":1}}],["collection",{"2":{"47":1,"114":1}}],["cost",{"2":{"144":1,"145":1}}],["costly",{"2":{"118":1,"127":1}}],["costs",{"2":{"118":1}}],["coordination",{"2":{"113":1}}],["cool",{"2":{"43":2,"219":1}}],["coexisting",{"2":{"104":1}}],["count",{"2":{"46":15}}],["counter",{"2":{"46":16}}],["could",{"2":{"18":2,"36":1,"42":2,"109":1,"218":1}}],["cover",{"2":{"36":3,"220":1}}],["covered",{"2":{"31":1,"32":1,"33":1}}],["correpsonding",{"2":{"167":1}}],["corresponding",{"2":{"36":1}}],["correctly",{"2":{"209":1}}],["correct",{"2":{"8":1,"209":1}}],["core",{"0":{"70":1,"79":1},"1":{"80":1},"2":{"33":13,"65":1,"70":2,"132":1}}],["copy",{"2":{"22":2,"29":2,"33":1,"40":1,"41":1,"43":1,"46":4,"49":2,"83":1,"147":1,"198":1,"203":3,"210":1,"216":1}}],["codes",{"2":{"202":1}}],["code",{"0":{"107":1,"211":1,"217":1},"1":{"212":1,"213":1,"214":1},"2":{"14":1,"29":2,"62":1,"84":1,"94":1,"107":1,"116":1,"128":1,"140":1,"146":1,"150":1,"181":1,"207":5,"208":2,"216":1,"219":1,"220":1}}],["comes",{"2":{"202":1}}],["combination",{"2":{"171":1}}],["combat",{"2":{"43":2}}],["coming",{"2":{"95":1,"96":1}}],["com",{"2":{"7":2,"20":1,"32":1,"36":1,"83":2,"90":1,"93":1,"193":1,"202":1}}],["complied",{"2":{"205":1}}],["complete",{"2":{"46":1,"116":1,"126":1,"157":1,"181":1,"193":1,"221":1}}],["completed",{"2":{"5":1,"207":1}}],["complexity",{"2":{"115":1,"131":1}}],["complex",{"2":{"14":1,"22":1,"45":2,"130":1,"142":2}}],["comprises",{"2":{"177":1}}],["comprehensive",{"2":{"48":1,"106":1}}],["comparable",{"2":{"164":1}}],["compatible",{"2":{"115":1}}],["computed",{"2":{"118":1}}],["computation",{"2":{"116":1,"118":2,"126":1}}],["computations",{"2":{"115":1}}],["composable",{"2":{"114":1}}],["composability",{"2":{"40":1}}],["composite",{"2":{"41":2}}],["components",{"0":{"140":1},"2":{"28":1,"29":1,"34":1,"56":1,"63":1,"113":1,"132":2,"139":1,"140":2,"173":1,"231":1}}],["component",{"0":{"132":1},"2":{"28":1,"29":1,"40":1,"54":1,"56":1,"113":1,"132":1,"140":2,"185":1,"229":1,"231":6}}],["compilation",{"2":{"60":1}}],["compiling",{"2":{"6":1}}],["compiler",{"2":{"29":1,"49":2,"61":1,"82":1,"116":1,"146":1}}],["compiled",{"2":{"6":1,"32":1,"77":1}}],["compile",{"0":{"205":1},"2":{"6":1,"14":1,"20":1,"48":1,"126":1,"202":1,"208":1,"232":1}}],["comma",{"2":{"188":1}}],["commands",{"0":{"14":1,"15":1,"161":1,"196":1,"197":1,"223":1},"1":{"15":1,"16":1,"17":1,"18":1,"19":1},"2":{"14":6,"15":1,"26":1,"31":1,"32":1,"48":1,"52":2,"116":3,"136":1,"160":1,"228":1,"229":1,"231":1}}],["command",{"0":{"16":1,"17":1,"18":1,"19":1},"2":{"5":1,"13":1,"16":2,"17":1,"18":1,"19":1,"26":1,"28":1,"31":2,"33":5,"41":1,"49":2,"83":1,"85":1,"156":1,"190":1,"198":4,"199":2,"205":1,"226":1,"229":1,"231":1}}],["commit",{"2":{"136":3}}],["communications",{"2":{"127":1}}],["community",{"2":{"1":1,"97":2,"215":1,"218":1}}],["comments",{"2":{"80":1}}],["common",{"0":{"195":1},"2":{"14":1,"42":1,"46":1}}],["conditions",{"2":{"150":1}}],["conduct",{"0":{"107":1},"2":{"107":1}}],["confirm",{"2":{"92":1,"127":1}}],["configurations",{"2":{"198":1}}],["configuration",{"2":{"198":1,"223":1}}],["configuring",{"2":{"188":1}}],["config",{"0":{"20":1}}],["connection",{"2":{"170":1,"173":3}}],["connect",{"2":{"76":1}}],["concise",{"2":{"53":1}}],["concentrate",{"2":{"49":1}}],["concept",{"2":{"1":2,"2":1,"21":1,"84":1,"113":1,"140":1}}],["consistent",{"2":{"170":1}}],["considering",{"2":{"218":1}}],["considered",{"2":{"113":1,"118":1}}],["consider",{"2":{"21":1,"24":1,"40":1,"45":1,"46":1,"49":1,"127":1,"142":1}}],["considerations",{"2":{"11":1}}],["constitutes",{"2":{"127":1}}],["const",{"2":{"43":1,"46":2,"63":1,"210":4,"213":2,"217":2}}],["constant",{"2":{"43":1}}],["congratulations",{"0":{"218":1},"2":{"28":1,"198":1,"207":1}}],["continue",{"2":{"29":2}}],["continuously",{"2":{"28":1}}],["content",{"2":{"109":2,"203":1}}],["contents",{"2":{"29":1}}],["context",{"2":{"26":1,"28":1,"29":1,"35":1,"46":1,"51":1,"60":1}}],["contained",{"2":{"116":1}}],["container",{"0":{"96":1}}],["containing",{"2":{"45":1,"53":1,"142":1}}],["contains",{"2":{"29":1,"32":1,"41":1,"47":1,"70":1}}],["contain",{"2":{"21":1,"40":1,"109":1,"143":1}}],["control",{"2":{"167":1}}],["controlled",{"2":{"4":1,"104":1,"125":1}}],["contractupgraded",{"2":{"25":1}}],["contractdeployed",{"2":{"25":1}}],["contractaddress",{"2":{"21":2,"25":4,"29":4,"40":1,"41":2,"44":1,"49":3,"56":1,"60":2,"67":10,"147":2,"203":6,"208":3,"210":1}}],["contract",{"0":{"31":1,"37":1,"58":1,"60":1,"65":1,"146":1,"216":1},"1":{"66":1,"67":1,"68":1,"217":1,"218":1},"2":{"11":1,"23":1,"24":2,"25":1,"26":1,"29":1,"31":1,"32":4,"33":2,"35":1,"36":1,"37":2,"46":2,"49":3,"50":2,"52":2,"53":4,"54":1,"55":1,"56":2,"58":2,"59":1,"60":6,"63":6,"65":5,"66":2,"67":3,"70":1,"113":1,"116":1,"143":4,"146":2,"149":6,"150":1,"174":1,"183":1,"185":2,"188":1,"204":4,"206":1,"209":3,"210":9,"212":3,"213":2,"214":1,"216":2,"217":2,"220":3,"229":1}}],["contractstate",{"2":{"29":5,"46":2,"49":2,"56":2,"60":4,"145":2,"208":3}}],["contracts",{"2":{"1":1,"6":3,"25":1,"29":1,"32":1,"33":2,"35":1,"49":2,"53":1,"60":1,"61":2,"113":1,"132":1,"133":1,"143":3,"149":1,"212":1,"218":1,"232":1,"234":1}}],["contributing",{"0":{"79":1,"105":1},"1":{"80":1,"106":1,"107":1,"108":1,"109":1,"110":1,"111":1,"112":1}}],["contributions",{"2":{"130":1}}],["contribution",{"2":{"1":1,"3":1}}],["contribute",{"0":{"80":1,"108":1},"1":{"109":1,"110":1},"2":{"76":1,"110":1,"113":1,"121":1}}],["contributors",{"2":{"1":1,"2":1,"79":1,"109":1,"110":1}}],["convenient",{"2":{"13":1,"14":1,"227":1}}],["castling",{"2":{"218":1}}],["cases",{"2":{"218":1}}],["case",{"2":{"16":1,"32":1,"41":1,"136":4,"144":1}}],["causing",{"2":{"186":1}}],["catalyze",{"2":{"113":1}}],["catalyst",{"2":{"113":1}}],["caters",{"2":{"106":1}}],["capture",{"2":{"216":1,"217":1,"218":1}}],["captured",{"2":{"18":1,"24":1,"25":1,"216":1}}],["captain",{"2":{"144":1,"145":1}}],["capable",{"2":{"113":1}}],["capabilities",{"2":{"105":1,"106":1,"116":1}}],["capacity",{"2":{"113":1}}],["caverns",{"2":{"103":1}}],["cartrige",{"2":{"155":1}}],["cartridge",{"0":{"101":1},"2":{"2":1,"7":2,"104":2,"156":1,"198":1,"228":1}}],["care",{"2":{"116":1}}],["careful",{"2":{"55":1}}],["carefully",{"2":{"53":1}}],["cargo",{"2":{"82":1,"83":5,"92":1,"181":1,"193":1}}],["card",{"2":{"45":2,"142":2,"144":1,"145":2,"149":4,"150":2}}],["calculate",{"2":{"29":1}}],["calldata",{"2":{"169":4,"229":2}}],["call",{"2":{"52":1,"216":1}}],["caller",{"2":{"16":4,"17":3,"18":1,"19":1,"25":1,"26":2,"29":5,"31":1,"41":2,"49":2,"56":2,"60":3,"63":4,"163":1,"208":3}}],["called",{"2":{"12":1,"15":1,"16":1,"31":1,"59":1,"145":1}}],["calling",{"2":{"16":1}}],["calls",{"2":{"14":1,"63":1,"185":1,"210":1,"217":1}}],["cannot",{"2":{"207":1}}],["can",{"0":{"128":1,"129":1},"2":{"1":1,"13":1,"14":1,"16":1,"17":1,"21":2,"22":2,"23":1,"26":1,"29":1,"31":1,"32":1,"33":5,"35":1,"36":2,"39":1,"40":1,"41":1,"42":1,"43":1,"46":2,"47":1,"48":1,"58":3,"63":1,"65":1,"67":1,"68":1,"69":1,"76":1,"77":2,"83":1,"85":1,"109":1,"113":4,"115":2,"116":1,"119":1,"121":2,"123":1,"127":3,"129":1,"133":1,"136":1,"137":1,"143":2,"168":1,"169":1,"170":2,"172":2,"173":3,"174":1,"175":3,"180":1,"185":1,"186":1,"192":1,"198":4,"199":1,"201":1,"205":1,"206":1,"208":1,"216":1,"221":1,"227":1,"228":1}}],["cairo",{"0":{"94":1,"116":1,"126":1},"1":{"117":1,"118":1,"119":1},"2":{"1":1,"7":2,"16":1,"20":3,"22":1,"27":1,"29":13,"39":1,"48":1,"49":4,"50":1,"62":1,"63":1,"84":1,"88":1,"94":1,"103":1,"115":5,"116":4,"117":2,"119":1,"126":3,"140":1,"143":1,"202":14,"203":3,"204":2,"207":4,"210":1,"213":1,"216":1,"220":1,"232":1,"234":1}}],["square",{"2":{"203":2,"213":2}}],["sqlite",{"2":{"33":1,"185":1,"186":1}}],["snarks",{"2":{"115":1}}],["snake",{"2":{"104":1}}],["skin",{"2":{"104":1}}],["slice",{"2":{"171":1}}],["slow",{"2":{"170":1}}],["slotup",{"2":{"156":1}}],["slot",{"0":{"155":1,"157":1,"158":1,"198":1,"222":1},"1":{"156":1,"157":1,"159":1,"160":1,"161":1,"199":1,"223":1},"2":{"7":1,"9":1,"155":1,"156":3,"157":3,"159":1,"160":1,"161":2,"198":10,"199":3,"222":1}}],["slenderduck",{"2":{"104":2}}],["swmansion",{"2":{"93":1}}],["ssf",{"2":{"93":1}}],["small",{"2":{"40":1}}],["smart",{"2":{"1":1,"11":1,"61":1,"116":1,"132":1}}],["scratch",{"2":{"118":1}}],["screen",{"2":{"85":1,"198":1}}],["scissors",{"2":{"104":1}}],["scenario",{"2":{"216":1}}],["scenarios",{"2":{"53":1}}],["scenes",{"2":{"49":1,"60":1}}],["schemaintrospection",{"2":{"45":3,"141":1,"142":3}}],["schema",{"0":{"142":1,"167":1},"2":{"33":2,"36":1,"167":1,"168":1}}],["scaffolding",{"2":{"190":1}}],["scale",{"2":{"118":1}}],["scalable",{"2":{"116":1,"118":1,"176":1}}],["scalability",{"2":{"28":1}}],["scaling",{"2":{"115":1}}],["scarb",{"0":{"93":1},"2":{"7":1,"8":1,"20":3,"29":1,"32":1,"36":2,"49":1,"93":2,"198":2,"202":2,"228":1}}],["suscription",{"2":{"174":1}}],["susbcription",{"0":{"174":1}}],["sudo",{"2":{"136":1}}],["sudoku",{"2":{"118":1}}],["subsequent",{"2":{"174":1}}],["subset",{"2":{"171":1}}],["subscribe",{"2":{"175":1}}],["subscribed",{"2":{"173":2}}],["subscription",{"0":{"173":1},"1":{"174":1},"2":{"33":5,"166":1,"173":8,"174":1}}],["subscriptions",{"2":{"33":1,"163":1,"173":2}}],["subcommand",{"2":{"161":1,"223":1,"229":1,"231":1}}],["subcommands",{"2":{"157":1,"193":1}}],["subcomponents",{"2":{"142":1}}],["submitted",{"2":{"127":1}}],["subterranean",{"2":{"104":1}}],["suited",{"2":{"116":1,"119":1,"129":1}}],["suite",{"2":{"92":1,"122":1,"131":1}}],["suggested",{"2":{"87":1,"92":1}}],["suggest",{"2":{"65":1,"81":1,"87":1}}],["supply",{"2":{"115":1}}],["suppose",{"2":{"43":1}}],["supporting",{"2":{"65":1}}],["support",{"2":{"44":1,"138":1,"169":2,"174":1,"198":1}}],["supported",{"2":{"37":1,"39":1,"169":1,"171":1}}],["supports",{"2":{"35":1,"36":1,"118":1,"173":1}}],["super",{"2":{"29":1,"49":2,"56":1,"60":1,"62":1,"63":1,"145":1}}],["sure",{"2":{"32":1,"92":1,"166":1,"198":1,"202":2}}],["succinct",{"2":{"48":1}}],["successful",{"2":{"198":2,"199":1}}],["successfully",{"2":{"32":1,"33":1,"198":2,"205":1}}],["success",{"2":{"6":1,"32":1}}],["such",{"2":{"14":1,"35":1,"42":1,"43":1,"46":1,"113":1,"122":1,"174":1}}],["safest",{"2":{"118":1}}],["save",{"2":{"46":1}}],["same",{"2":{"29":1,"62":1,"118":1,"130":1,"172":1,"173":1,"203":1,"207":1,"208":1}}],["salt",{"2":{"25":1,"63":1,"67":1,"210":1,"212":1}}],["src",{"2":{"29":4,"49":1,"202":1}}],["syntax",{"2":{"15":1,"203":1}}],["system",{"0":{"31":1,"52":1,"55":1,"56":1,"58":1,"132":1},"1":{"58":1,"59":1},"2":{"11":1,"12":3,"13":2,"14":2,"16":1,"28":1,"29":1,"31":1,"32":1,"33":2,"40":1,"41":1,"54":1,"56":2,"58":1,"59":1,"60":1,"62":1,"63":7,"65":1,"67":3,"113":1,"118":1,"132":1,"143":2,"144":3,"149":2,"150":1,"181":1,"185":2,"193":1,"197":1,"210":8,"212":3,"213":2,"214":1,"217":6,"220":2,"229":3,"231":6}}],["systems",{"0":{"53":1,"54":1,"143":1,"204":1},"1":{"54":1,"55":1,"56":1,"144":1,"145":1,"146":1},"2":{"11":1,"13":1,"14":2,"15":1,"21":2,"28":1,"29":3,"34":1,"53":8,"54":2,"55":1,"56":1,"60":1,"63":1,"64":2,"65":1,"113":1,"116":1,"132":2,"139":2,"143":6,"149":2,"204":2,"210":1,"212":1,"231":1}}],["sh",{"2":{"93":2,"156":1}}],["sharing",{"2":{"127":1}}],["share",{"2":{"46":1,"113":1,"218":1}}],["shape",{"2":{"28":1}}],["shows",{"2":{"171":1}}],["show",{"2":{"62":1}}],["short",{"2":{"31":1}}],["shortly",{"2":{"28":1}}],["shorthands",{"2":{"14":1}}],["shorthand",{"2":{"14":1,"137":1}}],["should",{"2":{"20":1,"29":1,"32":2,"33":1,"109":1,"141":1,"147":1,"173":1,"186":1,"198":1,"199":1,"204":2,"207":2,"208":2,"210":12,"212":1,"213":3,"214":3,"217":15,"218":1,"219":1}}],["shinai",{"2":{"7":1}}],["spinning",{"2":{"155":1,"159":1}}],["springett",{"2":{"114":1}}],["split",{"2":{"106":1}}],["span",{"2":{"24":3,"45":6,"67":17,"142":6,"147":2,"149":1}}],["spawnhuman",{"2":{"46":1}}],["spawns",{"2":{"31":1,"59":1}}],["spawn",{"0":{"52":1,"59":1,"213":1},"2":{"13":2,"29":2,"31":2,"33":3,"46":2,"49":2,"52":1,"56":1,"59":1,"60":1,"63":3,"64":1,"174":1,"208":1,"209":3,"210":5,"212":2,"213":4,"216":2,"217":1,"220":1,"229":1,"231":2}}],["specalist",{"2":{"128":1}}],["specify",{"2":{"142":1,"163":1,"188":2,"227":1}}],["specifies",{"2":{"32":1,"45":1,"142":1,"144":1,"173":1}}],["specified",{"2":{"29":1,"46":1,"60":1,"185":1}}],["specifically",{"2":{"163":1}}],["specification",{"2":{"37":1}}],["specifics",{"2":{"50":1}}],["specific",{"2":{"20":1,"23":1,"29":1,"53":1,"116":1,"119":1,"129":1,"134":1,"136":5,"142":1,"167":1,"173":1,"185":1}}],["specialized",{"2":{"48":1}}],["special",{"2":{"1":1,"29":1,"46":1,"218":2}}],["spearheaded",{"2":{"2":1}}],["s",{"2":{"11":1,"23":2,"25":1,"26":1,"28":3,"29":10,"31":5,"32":4,"33":6,"35":1,"45":3,"48":1,"54":2,"56":2,"59":1,"65":1,"69":1,"106":1,"113":1,"115":1,"118":1,"119":1,"125":1,"126":2,"127":2,"131":1,"136":4,"142":3,"147":1,"161":1,"163":1,"164":1,"168":2,"169":1,"173":1,"188":1,"198":2,"205":1,"209":1,"213":1,"214":1,"216":1,"223":2,"229":1,"231":1,"234":1}}],["sorting",{"2":{"167":1}}],["solve",{"2":{"122":1}}],["solving",{"2":{"118":1}}],["solution",{"2":{"113":1,"118":3}}],["soon",{"2":{"95":1,"96":1}}],["software",{"2":{"61":1}}],["socials",{"2":{"36":4}}],["social",{"2":{"35":1,"36":1}}],["sometimes",{"2":{"219":1}}],["something",{"2":{"22":1,"33":2,"219":1}}],["somewhat",{"2":{"113":1,"164":1}}],["some",{"2":{"32":1,"50":1,"60":1,"106":1,"109":1,"112":2,"139":1,"168":1,"213":1,"219":1,"220":2}}],["so",{"2":{"26":1,"34":1,"36":1,"46":2,"65":1,"109":1,"136":1,"205":1,"206":1,"218":1,"219":1}}],["sovereign",{"2":{"11":1}}],["sozo",{"0":{"190":1,"194":1,"225":1,"227":1,"229":1,"230":1,"231":1,"232":1,"233":1,"234":1},"1":{"195":1,"196":1,"197":1,"226":1,"228":1},"2":{"6":3,"13":2,"28":1,"32":2,"33":2,"36":2,"60":1,"61":2,"83":3,"85":1,"169":1,"174":1,"190":1,"191":1,"192":1,"193":3,"198":4,"201":2,"202":1,"205":2,"208":1,"225":1,"226":2,"228":3,"229":2,"230":1,"231":3,"232":1,"233":1,"234":1}}],["source",{"0":{"81":1,"181":1,"193":1},"1":{"82":1,"83":1},"2":{"1":1,"2":1,"79":1,"116":1,"121":1,"130":1,"181":1}}],["singular",{"2":{"143":1}}],["single",{"2":{"83":1,"125":1,"137":1}}],["since",{"2":{"55":1,"61":1,"138":1}}],["significant",{"2":{"52":1,"149":1}}],["signals",{"2":{"29":1}}],["size",{"2":{"45":3,"142":5}}],["simulator",{"2":{"104":1}}],["simulation",{"2":{"104":2}}],["simplifies",{"2":{"48":1,"132":1,"190":1}}],["simplify",{"2":{"22":1}}],["simply",{"2":{"21":1,"22":1,"61":1,"65":1,"85":1,"115":1,"179":1}}],["simplest",{"2":{"56":1}}],["simple",{"2":{"6":1,"8":1,"21":1,"32":1,"33":1,"49":1,"55":1,"71":1,"127":1,"186":1,"220":1}}],["similarities",{"2":{"113":1}}],["similarly",{"2":{"24":1,"51":1,"118":1}}],["similar",{"2":{"11":1,"14":1,"29":1,"32":1,"143":1,"164":1,"169":1,"174":1}}],["sierra",{"2":{"7":1,"20":1,"202":1}}],["side",{"0":{"128":1},"2":{"1":1,"119":1}}],["sent",{"2":{"169":1}}],["sentence",{"2":{"110":1}}],["send",{"2":{"173":1}}],["senderaddress",{"2":{"169":4}}],["sending",{"2":{"164":1,"173":1}}],["selection",{"2":{"169":1}}],["selector",{"2":{"143":1}}],["self",{"2":{"22":8,"29":6,"42":8,"46":2,"49":3,"52":1,"56":1,"60":4,"67":22,"116":1,"144":1,"145":1,"207":67,"208":3}}],["separated",{"2":{"188":1}}],["separate",{"2":{"109":1}}],["search",{"2":{"61":1}}],["seamless",{"2":{"52":1}}],["seamlessly",{"2":{"23":1,"119":1,"174":1}}],["serialize",{"2":{"45":4,"142":4}}],["served",{"2":{"113":1}}],["serve",{"2":{"106":1}}],["serves",{"2":{"51":1}}],["server",{"0":{"177":1},"2":{"33":4,"163":1,"166":2,"169":1,"173":5,"176":1,"177":1,"178":1,"188":1}}],["services",{"2":{"35":1}}],["serdelen",{"2":{"141":1}}],["serde",{"2":{"21":2,"22":2,"29":4,"40":1,"41":1,"43":1,"46":4,"49":2,"203":7}}],["seen",{"2":{"149":1}}],["seeking",{"2":{"106":1}}],["seemingly",{"2":{"49":1}}],["seems",{"2":{"28":1,"220":1}}],["see",{"2":{"31":1,"32":1,"33":1,"58":1,"80":1,"85":1,"157":1,"181":1,"193":1,"207":1}}],["seed",{"2":{"20":1,"198":1,"202":1}}],["several",{"2":{"16":1}}],["sector",{"2":{"130":1}}],["sections",{"2":{"110":1}}],["section",{"2":{"1":1,"27":2,"33":2,"36":1,"111":1,"168":1}}],["secure",{"2":{"116":1}}],["security",{"2":{"11":1,"47":1,"53":1,"118":2}}],["secondary",{"2":{"219":1}}],["seconds",{"2":{"155":1}}],["second",{"0":{"112":1},"2":{"32":1,"171":1,"203":1}}],["settled",{"2":{"113":1}}],["settings",{"2":{"43":3,"46":1}}],["setting",{"0":{"43":1},"2":{"5":1,"36":2,"49":1,"59":1,"87":1,"214":1}}],["setup",{"0":{"87":1,"149":1,"200":1,"212":1},"1":{"88":1,"89":1,"90":1,"91":1,"92":1,"93":1,"94":1,"95":1,"96":1,"201":1,"202":1,"203":1,"204":1,"205":1,"206":1,"207":1},"2":{"49":1,"63":3,"92":2,"150":1,"173":1,"207":1,"210":4,"213":1,"216":1,"217":4}}],["set",{"0":{"17":1},"2":{"5":1,"12":2,"16":1,"17":3,"26":2,"28":1,"29":3,"31":4,"36":3,"37":1,"41":2,"46":4,"49":2,"52":1,"56":1,"60":4,"67":3,"85":1,"92":1,"125":1,"169":1,"171":1,"198":1,"208":3,"213":1,"216":1}}],["sequencer",{"2":{"4":1,"10":1,"119":1,"129":1}}],["stuck",{"2":{"215":1}}],["studios",{"0":{"98":1},"1":{"99":1,"100":1,"101":1,"102":1}}],["studio",{"2":{"82":1,"94":1}}],["steady",{"2":{"173":1}}],["steps",{"0":{"34":1,"86":1},"2":{"6":1}}],["step",{"0":{"6":2},"2":{"220":2}}],["stop",{"0":{"131":1},"1":{"132":1,"133":1}}],["storing",{"2":{"43":1}}],["stored",{"2":{"41":1,"185":1,"186":1,"188":1}}],["storedelrecord",{"2":{"24":1}}],["store",{"2":{"39":1,"40":1,"51":1,"65":2,"186":1}}],["storesetrecord",{"2":{"24":1,"66":1}}],["storage",{"2":{"16":1,"41":1,"56":3,"58":1,"186":3}}],["style",{"0":{"111":1},"1":{"112":1}}],["staging",{"2":{"227":1,"228":1}}],["stage",{"2":{"5":1,"49":1}}],["stack",{"2":{"115":1}}],["stable",{"2":{"92":1,"136":1}}],["status",{"2":{"22":4}}],["stateless",{"2":{"53":1}}],["states",{"2":{"22":1,"54":1,"124":1}}],["state",{"2":{"11":1,"12":1,"14":1,"15":1,"16":2,"17":2,"24":1,"28":1,"29":2,"31":1,"32":1,"51":1,"53":1,"56":2,"59":1,"65":1,"113":3,"124":1,"127":1,"132":1,"176":1,"185":1}}],["star",{"2":{"163":1}}],["starkex",{"2":{"119":1}}],["starkware",{"2":{"116":1,"126":1}}],["starkland",{"2":{"104":1}}],["stark",{"2":{"104":1,"118":2}}],["starknetvm",{"2":{"129":1}}],["starknet",{"0":{"8":1,"118":1,"119":1,"129":1},"2":{"4":1,"7":1,"8":1,"10":1,"24":2,"25":4,"26":1,"29":4,"31":1,"49":3,"56":2,"58":1,"60":5,"63":1,"67":1,"104":1,"115":4,"116":1,"117":1,"118":3,"119":2,"143":1,"144":1,"145":1,"147":3,"185":1,"188":1,"203":3,"210":5,"213":2,"217":2}}],["starts",{"2":{"33":1,"56":1,"166":2,"185":1}}],["starting",{"2":{"28":1,"198":1,"200":1,"204":1,"219":1}}],["starter",{"2":{"28":1,"29":3,"46":1,"62":1,"63":1,"198":2,"233":1}}],["started",{"0":{"97":1},"2":{"22":3,"27":1,"69":2,"106":1}}],["start",{"0":{"84":1,"112":1,"131":1},"1":{"85":1,"86":1,"132":1,"133":1},"2":{"5":1,"28":1,"33":1,"81":1,"87":1,"92":1,"144":1,"186":1,"188":3,"198":1,"199":1,"208":1,"220":1}}],["standardization",{"2":{"132":1}}],["standardized",{"2":{"132":1}}],["standardizes",{"2":{"122":1}}],["standards",{"2":{"111":1}}],["standard",{"2":{"1":1,"163":1}}],["stream",{"2":{"198":1,"199":1}}],["streamlining",{"2":{"60":1,"132":1}}],["streamline",{"2":{"14":1,"116":1,"190":1}}],["streamlined",{"2":{"1":1}}],["strictly",{"2":{"121":1}}],["strategy",{"2":{"104":1,"118":1}}],["straightforward",{"2":{"5":1,"115":1,"127":1}}],["strongest",{"2":{"114":1}}],["strongly",{"2":{"65":1,"81":1,"87":1}}],["strong",{"2":{"29":1}}],["structs",{"0":{"40":1},"1":{"41":1,"42":1,"43":1,"44":1,"45":1},"2":{"17":1,"21":1,"39":1,"40":1,"51":1}}],["struct",{"0":{"51":1},"2":{"16":1,"21":2,"22":1,"24":3,"25":4,"26":1,"29":8,"31":1,"40":1,"41":1,"43":1,"45":1,"46":4,"49":3,"56":1,"60":1,"142":1,"147":2,"203":5}}],["structured",{"2":{"28":1,"39":1,"163":1}}],["structures",{"2":{"25":1}}],["structure",{"0":{"2":1,"56":1},"1":{"58":1,"59":1},"2":{"11":1,"24":2,"26":1,"29":2,"56":1,"65":1,"142":1}}],["dynamically",{"2":{"167":1,"176":1}}],["dynamics",{"2":{"23":1}}],["due",{"2":{"140":1}}],["dungeon",{"2":{"104":1}}],["duration",{"2":{"43":1}}],["during",{"0":{"137":1},"2":{"36":2,"92":1}}],["d",{"2":{"43":1,"188":1}}],["date",{"2":{"109":1}}],["datasets",{"2":{"172":1}}],["dataset",{"2":{"167":1}}],["database",{"0":{"186":1},"2":{"33":1,"41":1,"185":1,"186":6,"188":3}}],["data",{"2":{"29":6,"31":2,"33":6,"39":2,"49":2,"113":2,"132":1,"163":4,"167":2,"168":4,"169":2,"170":1,"171":1,"173":3,"174":6,"175":1,"185":1,"186":1,"208":1}}],["dark",{"2":{"104":1}}],["dangerous",{"2":{"104":1}}],["dao",{"2":{"103":1}}],["days",{"2":{"1":1}}],["db",{"2":{"19":1,"186":3,"188":1}}],["dribble",{"2":{"144":1,"145":1}}],["driving",{"2":{"104":1,"119":1}}],["drive",{"2":{"104":1}}],["drove",{"2":{"130":1}}],["drop",{"2":{"21":2,"22":2,"24":2,"25":4,"26":1,"29":6,"40":1,"41":1,"43":1,"46":4,"49":2,"60":2,"147":3,"203":7}}],["drug",{"2":{"104":1}}],["dr",{"2":{"14":1,"39":1,"53":1,"175":1}}],["dive",{"2":{"125":1}}],["diving",{"0":{"211":1},"1":{"212":1,"213":1,"214":1},"2":{"84":1}}],["diffs",{"2":{"32":1}}],["diff",{"2":{"32":1}}],["differences",{"2":{"46":1}}],["difference",{"2":{"29":1}}],["different",{"2":{"21":1,"83":1,"198":1}}],["directed",{"2":{"219":1}}],["directly",{"2":{"21":1,"26":1,"54":1,"77":1,"175":1,"179":1}}],["directions",{"2":{"156":1}}],["direction",{"2":{"18":1,"19":1,"26":6,"29":27,"31":3,"56":3,"60":12,"63":2,"168":2,"219":1}}],["directory",{"2":{"5":1,"28":2,"61":1,"63":1,"136":2,"202":1,"233":1}}],["diagram",{"2":{"12":1}}],["distribution",{"2":{"92":1}}],["distribute",{"2":{"35":1}}],["distinct",{"2":{"46":1,"49":1}}],["displays",{"2":{"33":1}}],["dispatchers",{"2":{"212":1}}],["dispatcher",{"2":{"29":4,"46":1,"49":2,"52":1,"60":4,"146":1,"149":2,"150":1,"208":1}}],["discouraged",{"2":{"110":1}}],["discord",{"2":{"1":1,"3":1,"76":1,"97":1,"99":1,"100":1,"101":1,"123":1}}],["discuss",{"2":{"32":1}}],["discussed",{"2":{"11":1}}],["disable",{"2":{"5":1,"32":1}}],["dope",{"2":{"104":1}}],["doing",{"2":{"46":1}}],["doesn",{"0":{"133":1},"2":{"113":1,"133":1,"218":1}}],["does",{"2":{"36":1,"127":1,"138":1,"220":1}}],["documents",{"2":{"111":1}}],["documentation",{"2":{"33":2,"168":2,"219":1}}],["docs",{"2":{"33":1,"60":1,"93":1}}],["don",{"2":{"33":1,"67":1,"215":1,"220":1}}],["done",{"2":{"32":1,"140":1,"198":1}}],["downstream",{"2":{"70":1}}],["down",{"0":{"30":1,"57":1},"1":{"31":1,"58":1,"59":1,"60":1},"2":{"29":1,"43":2}}],["do",{"0":{"3":1},"2":{"21":1,"65":2,"110":1,"112":1,"124":1,"136":1,"198":2,"203":1,"216":1,"218":1,"219":2}}],["dojoup",{"0":{"85":1,"134":1},"1":{"135":1,"136":1,"137":1,"138":1},"2":{"83":3,"85":7,"136":8,"137":1,"138":2,"180":1,"192":1,"198":1}}],["dojostarknet",{"2":{"36":1}}],["dojoengine",{"0":{"70":1,"71":1,"72":1,"73":1,"74":1,"75":1},"2":{"7":1,"20":1,"32":1,"36":1,"70":1,"71":1,"72":1,"73":1,"74":1,"75":1,"83":2,"85":1,"90":1,"135":1,"193":1,"202":1}}],["dojo",{"0":{"1":1,"27":1,"28":1,"29":1,"51":1,"52":1,"60":1,"64":1,"69":1,"98":1,"105":1,"121":1,"122":1,"123":1,"128":1,"129":1,"130":1,"133":1,"146":1,"152":1,"153":1},"1":{"2":1,"3":1,"28":1,"29":2,"30":2,"31":2,"32":2,"33":2,"34":2,"70":1,"71":1,"72":1,"73":1,"74":1,"75":1,"99":1,"100":1,"101":1,"102":1,"106":1,"107":1,"108":1,"109":1,"110":1,"111":1,"112":1,"131":1,"132":1,"133":1},"2":{"1":5,"2":1,"4":2,"7":4,"14":2,"20":8,"21":1,"23":1,"27":1,"28":3,"29":8,"31":2,"32":5,"33":1,"34":2,"35":1,"36":1,"41":2,"46":7,"47":1,"48":2,"49":7,"50":2,"51":1,"52":1,"53":1,"54":2,"56":4,"60":6,"61":2,"62":1,"63":5,"65":2,"69":1,"70":2,"71":1,"72":1,"73":1,"76":3,"77":1,"79":1,"83":5,"85":1,"86":2,"87":1,"90":1,"97":3,"103":3,"104":4,"105":3,"106":2,"115":1,"116":3,"119":4,"121":2,"122":1,"123":2,"128":1,"129":3,"130":4,"131":1,"132":4,"133":2,"134":1,"136":5,"137":1,"143":3,"146":2,"149":1,"163":1,"168":1,"169":1,"174":1,"175":1,"176":1,"190":2,"193":2,"198":4,"200":2,"201":1,"202":5,"203":1,"204":1,"210":2,"215":1,"217":1,"218":2,"219":2,"220":1,"228":2,"233":1}}],["dealing",{"2":{"227":1}}],["demonstrate",{"2":{"174":1}}],["demand",{"2":{"115":1}}],["debug",{"2":{"198":1}}],["debugging",{"2":{"85":1}}],["debian",{"2":{"136":1}}],["determine",{"2":{"132":1}}],["detail",{"2":{"109":1}}],["detailed",{"2":{"85":1,"132":1}}],["details",{"2":{"28":1,"142":1,"168":1}}],["deem",{"2":{"109":1}}],["deepen",{"2":{"106":1}}],["deeper",{"2":{"21":1,"125":1}}],["deep",{"2":{"97":1}}],["describe",{"2":{"223":2}}],["description",{"0":{"185":1},"1":{"186":1},"2":{"35":1,"36":2}}],["desktop",{"2":{"82":1}}],["designated",{"2":{"45":1,"142":1}}],["designed",{"2":{"34":1,"104":1,"106":1,"116":1,"118":1,"126":1,"130":1,"163":1,"190":1}}],["design",{"2":{"14":1,"22":1,"28":1,"40":1,"48":1,"56":1,"116":1,"132":1,"163":1,"203":1,"221":1}}],["deduct",{"2":{"29":1}}],["dedicated",{"2":{"1":1,"2":1,"43":1,"180":1,"192":1}}],["decide",{"2":{"218":1}}],["deckcreated",{"2":{"147":4}}],["decentralized",{"2":{"43":1,"113":3,"116":1}}],["declaring",{"2":{"29":2}}],["decorator",{"0":{"60":1,"146":1},"2":{"29":2,"39":1,"53":1,"60":4,"143":1,"146":1}}],["decoding",{"2":{"23":1}}],["delivers",{"2":{"163":1}}],["delving",{"0":{"49":1}}],["delve",{"2":{"28":1,"33":1}}],["deleted",{"2":{"24":1}}],["deletes",{"2":{"19":1}}],["delete",{"0":{"19":1},"2":{"19":2,"67":1,"223":2}}],["derive",{"2":{"21":2,"22":2,"24":2,"25":4,"26":1,"29":6,"31":1,"39":1,"40":2,"41":1,"43":1,"46":4,"49":2,"51":1,"60":2,"140":2,"147":3,"203":7}}],["defense",{"2":{"104":1,"144":1,"145":1}}],["defender",{"2":{"45":1,"142":1}}],["defi",{"2":{"47":1,"116":1}}],["defintions",{"0":{"167":1}}],["definition",{"2":{"33":1,"113":2,"168":1}}],["defining",{"2":{"21":1,"41":1,"42":1,"53":1,"55":1,"143":1,"144":1}}],["define",{"2":{"22":2,"29":3,"39":2,"40":1,"41":2,"42":2,"54":1,"143":1,"207":1}}],["defined",{"2":{"17":1,"20":1,"29":1,"31":1,"36":1,"37":1,"51":1,"60":2,"228":1}}],["defines",{"2":{"16":1,"22":1,"43":1,"142":1}}],["default",{"2":{"16":1,"20":1,"36":1,"188":4,"202":1}}],["depths",{"2":{"104":1}}],["depending",{"2":{"92":1}}],["dependencies",{"0":{"92":1},"2":{"7":1,"20":1,"32":1,"92":2,"181":1,"193":1,"202":1}}],["deployed",{"2":{"32":2,"33":1,"35":1,"67":1,"150":1,"198":1}}],["deployer",{"2":{"13":1}}],["deploy",{"0":{"6":1,"8":1,"9":1,"10":1,"129":1,"157":1,"198":1},"1":{"199":1},"2":{"7":1,"8":1,"9":1,"32":3,"63":4,"64":1,"67":2,"115":1,"149":3,"157":2,"209":1,"210":4,"212":4}}],["deploying",{"2":{"5":1,"6":1,"11":1,"113":1,"190":1,"191":1,"198":1}}],["deployments",{"0":{"5":1,"222":1},"1":{"223":1},"2":{"161":2,"198":2,"199":2,"222":1,"223":1}}],["deployment",{"0":{"4":1,"7":1},"1":{"5":1,"6":1,"8":1,"9":1,"10":1},"2":{"1":1,"5":1,"6":1,"179":1,"190":1,"198":4,"199":3,"223":5,"232":1}}],["dev",{"2":{"227":3,"228":2}}],["develop",{"2":{"130":1}}],["developing",{"2":{"116":1}}],["develops",{"2":{"105":1}}],["developed",{"2":{"103":1,"104":2,"116":1,"155":1,"159":1,"175":1}}],["developer",{"2":{"67":1,"130":1,"132":1}}],["developers",{"2":{"14":1,"48":1,"49":1,"60":1,"113":1,"116":1,"130":1}}],["development",{"0":{"48":1,"87":1,"154":1,"189":1},"1":{"49":1,"50":1,"51":1,"52":1,"88":1,"89":1,"90":1,"91":1,"92":1,"93":1,"94":1,"95":1,"96":1},"2":{"1":3,"4":2,"48":1,"60":1,"61":1,"79":1,"82":1,"85":1,"87":1,"115":1,"116":1,"132":1,"186":1}}],["device",{"2":{"4":1}}],["immortal",{"2":{"218":1}}],["import",{"2":{"149":1}}],["imported",{"2":{"47":1}}],["imports",{"2":{"31":1,"60":1,"140":1,"146":1,"209":1}}],["importance",{"2":{"29":1,"31":1}}],["important",{"2":{"7":1,"20":1,"21":1,"53":1,"54":1,"55":1,"65":1,"143":1}}],["implication",{"2":{"204":1}}],["implies",{"2":{"29":1}}],["imply",{"2":{"113":1}}],["implemented",{"2":{"141":1,"173":1}}],["implements",{"2":{"42":1}}],["implementing",{"0":{"42":1},"2":{"204":2}}],["implementation",{"0":{"141":1,"145":1},"2":{"29":1,"56":1,"144":1}}],["implementations",{"2":{"14":1}}],["implement",{"0":{"128":1,"206":1},"1":{"207":1},"2":{"29":1,"39":1,"42":1,"45":2,"46":1,"58":1,"60":1,"142":2,"145":1,"204":1,"206":1,"207":1}}],["impl",{"2":{"22":2,"29":2,"42":1,"45":1,"46":2,"49":1,"56":1,"60":2,"142":1,"145":1,"207":3,"208":1}}],["improved",{"2":{"109":1}}],["improve",{"2":{"14":1,"116":1}}],["illegal",{"2":{"207":1,"208":1}}],["illustrate",{"2":{"21":1}}],["illustrates",{"2":{"12":1}}],["icreatecarddispatchertrait",{"2":{"149":1}}],["icreatecarddispatcher",{"2":{"149":2}}],["icreatecard",{"2":{"144":1,"145":2}}],["icon",{"2":{"36":3}}],["ignored",{"0":{"137":1},"2":{"188":1}}],["igoblinactions",{"2":{"46":1}}],["iworld",{"2":{"67":1}}],["iworlddispatchertrait",{"2":{"56":1,"63":1,"210":1,"217":1}}],["iworlddispatcher",{"2":{"56":2,"60":1,"63":1,"144":1,"145":1,"210":2}}],["iplayeractions",{"2":{"49":3,"56":2,"60":2}}],["ipfs",{"2":{"36":4}}],["iactionsdispatchertrait",{"2":{"63":1,"210":1,"217":1}}],["iactionsdispatcher",{"2":{"63":3,"210":3,"212":1,"217":1}}],["iactions",{"2":{"29":3,"208":1}}],["ideas",{"2":{"123":1}}],["idea",{"2":{"80":1}}],["ideal",{"2":{"28":1}}],["identifier",{"2":{"43":1}}],["identified",{"2":{"41":1}}],["identify",{"2":{"41":1}}],["ide",{"2":{"33":4,"164":1,"168":1}}],["id",{"2":{"17":1,"22":1,"33":6,"43":3,"45":1,"46":12,"68":2,"142":1,"144":1,"145":1,"168":4,"169":4,"173":6,"174":3,"203":4,"208":6,"210":10,"213":3,"214":3,"217":9}}],["ids",{"2":{"7":1,"14":1,"20":1,"67":1,"68":1,"202":1}}],["if",{"2":{"6":1,"8":1,"12":1,"16":1,"17":1,"27":1,"28":1,"29":1,"41":1,"42":1,"70":1,"76":1,"80":2,"81":1,"87":1,"109":2,"113":1,"123":1,"127":1,"128":1,"138":1,"141":1,"168":1,"169":1,"174":1,"181":1,"186":1,"188":1,"198":2,"199":1,"203":2,"205":1,"208":3,"213":2,"214":1,"215":1,"216":1,"217":1,"218":1,"219":1,"220":2}}],["i",{"0":{"3":1,"129":1},"2":{"104":1,"213":1,"219":2}}],["inactivity",{"2":{"186":1}}],["inefficient",{"2":{"170":1,"172":1}}],["inject",{"2":{"146":1}}],["injects",{"2":{"60":1}}],["inherent",{"2":{"130":1}}],["invented",{"2":{"126":1}}],["invoked",{"2":{"53":1}}],["involves",{"2":{"6":1,"40":1}}],["involved",{"0":{"3":1},"2":{"123":1}}],["inlining",{"2":{"116":1}}],["inline",{"2":{"45":3,"142":3}}],["infrastructure",{"0":{"131":1},"1":{"132":1,"133":1},"2":{"65":1,"130":1,"131":1}}],["information",{"2":{"85":1,"115":1,"132":1,"163":1,"168":1,"174":1}}],["informs",{"2":{"29":1}}],["info",{"2":{"33":15}}],["innovation",{"2":{"52":1,"113":1}}],["industry",{"2":{"130":1}}],["indicated",{"2":{"51":1}}],["indicates",{"2":{"41":1,"146":1}}],["indexer",{"2":{"176":1,"183":1,"185":3,"186":4,"188":1,"199":1}}],["indexed",{"2":{"18":1,"23":1,"24":1,"25":1,"26":1,"29":2,"33":1,"41":1,"186":1}}],["index",{"2":{"33":1,"35":1,"67":1,"188":1}}],["indexing",{"0":{"33":1},"2":{"33":1,"188":1}}],["inputs",{"2":{"209":1}}],["input",{"2":{"33":2,"171":1,"173":1,"213":1}}],["inprogress",{"2":{"22":3}}],["incorrect",{"2":{"210":2}}],["incorporate",{"2":{"71":1,"115":1}}],["increment",{"2":{"46":1}}],["increased",{"2":{"113":1}}],["increase",{"2":{"31":1}}],["including",{"2":{"60":1,"116":1,"129":1}}],["includes",{"2":{"33":1,"131":1,"169":1,"190":1}}],["include",{"2":{"26":1,"29":1,"58":1,"62":1,"185":1,"190":1,"218":1}}],["inclusion",{"2":{"29":1}}],["inside",{"2":{"208":1}}],["inspired",{"2":{"104":1}}],["inspect",{"2":{"29":1}}],["instructions",{"2":{"85":1}}],["instantiated",{"2":{"150":1}}],["instantiate",{"2":{"149":1}}],["instances",{"2":{"155":1,"159":1}}],["instance",{"2":{"5":1,"43":1,"51":1}}],["installation",{"0":{"156":1,"180":1,"192":1},"1":{"181":1,"193":1},"2":{"180":1,"192":1}}],["installations",{"0":{"137":1},"2":{"156":1}}],["installing",{"0":{"135":1,"181":1,"193":1},"2":{"92":1}}],["install",{"0":{"85":1,"92":1,"93":1},"2":{"82":1,"83":6,"85":3,"92":2,"93":2,"94":1,"135":1,"136":11,"138":1,"156":1,"181":3,"193":2}}],["installed",{"2":{"27":1,"32":1,"82":1,"180":1,"192":1,"198":1}}],["instead",{"2":{"21":1,"125":1,"137":1,"149":1,"173":1}}],["init",{"0":{"233":1},"2":{"28":1,"196":1,"198":1,"201":2,"233":2}}],["initiate",{"2":{"5":1,"199":1}}],["initiative",{"2":{"2":1}}],["initially",{"2":{"173":1}}],["initializing",{"0":{"201":1},"2":{"43":1}}],["initialize",{"2":{"198":1,"201":1,"233":2}}],["initialized",{"2":{"25":1}}],["initializer",{"2":{"20":1,"202":1}}],["initial",{"2":{"1":1,"13":1,"56":1,"59":1}}],["intuitive",{"2":{"172":1,"191":1}}],["intended",{"2":{"219":1}}],["integers",{"2":{"171":1}}],["integrate",{"2":{"133":1}}],["integrating",{"2":{"103":1}}],["integration",{"0":{"63":1},"1":{"64":1},"2":{"63":3,"132":1,"202":2,"216":2,"217":1,"220":1}}],["interconnected",{"2":{"132":1}}],["interpret",{"2":{"124":1}}],["interested",{"2":{"105":1,"109":1,"173":1}}],["interfacing",{"2":{"72":1}}],["interfaces",{"2":{"58":1,"70":1,"143":1,"178":1}}],["interface",{"0":{"144":1,"145":1},"2":{"29":2,"49":2,"56":1,"67":3,"144":2,"145":2,"176":1,"190":1}}],["interacts",{"2":{"65":2}}],["interactively",{"2":{"164":1}}],["interaction",{"2":{"52":1}}],["interacting",{"2":{"11":1,"77":1,"190":1}}],["interacted",{"2":{"33":1,"67":1}}],["interact",{"2":{"6":1,"14":1,"15":1,"33":1,"49":1,"60":1,"113":1,"124":1,"198":1,"209":1}}],["intricacies",{"2":{"132":1}}],["intricate",{"2":{"28":1}}],["intrinsic",{"2":{"46":1}}],["introduction",{"0":{"142":1}}],["introductory",{"2":{"106":1}}],["introducing",{"2":{"140":1}}],["introduced",{"2":{"113":2,"139":1}}],["introduce",{"2":{"46":1}}],["introduces",{"2":{"11":1,"60":1,"146":1}}],["introspection",{"2":{"179":1}}],["introspect",{"2":{"22":1,"29":1,"49":1,"203":3}}],["into",{"0":{"49":1,"211":1},"1":{"212":1,"213":1,"214":1},"2":{"14":1,"22":3,"28":1,"31":1,"32":1,"33":2,"34":1,"46":1,"47":1,"48":1,"59":1,"60":1,"63":1,"71":1,"76":1,"84":1,"106":1,"125":1,"128":1,"198":1,"210":2,"212":1,"214":1,"217":3}}],["in",{"0":{"28":1,"31":1,"46":2,"58":1,"78":1,"141":1},"1":{"29":1,"30":1,"31":1,"32":1,"33":1,"34":1},"2":{"1":2,"4":1,"8":1,"11":1,"12":1,"14":1,"16":3,"17":1,"20":1,"21":3,"22":3,"23":1,"24":1,"26":2,"28":3,"29":7,"31":2,"32":5,"33":5,"36":4,"39":1,"40":1,"41":1,"43":1,"45":1,"46":2,"51":2,"52":2,"53":1,"54":1,"59":1,"60":4,"62":2,"63":1,"64":1,"66":1,"69":1,"77":2,"79":1,"80":1,"85":1,"104":1,"105":1,"109":2,"113":6,"115":2,"116":1,"118":1,"119":1,"127":2,"128":3,"130":1,"136":7,"140":1,"142":1,"143":1,"145":1,"155":1,"163":4,"166":1,"168":2,"169":1,"170":1,"172":1,"173":4,"174":2,"176":1,"185":2,"186":5,"188":1,"190":2,"198":1,"199":1,"203":2,"204":2,"206":1,"208":2,"209":4,"213":1,"214":1,"216":3,"217":15,"218":1,"228":1,"233":1}}],["items",{"2":{"32":1,"171":1}}],["its",{"2":{"1":1,"13":1,"29":1,"33":1,"43":1,"48":1,"54":1,"56":1,"79":1,"106":1,"115":1,"116":1,"118":1,"132":1,"142":1,"144":1,"173":3}}],["it",{"0":{"30":1,"32":1,"57":1},"1":{"31":1,"58":1,"59":1,"60":1},"2":{"1":1,"2":1,"7":1,"13":1,"17":1,"21":1,"25":1,"26":2,"28":1,"29":2,"31":1,"32":2,"33":2,"35":1,"36":3,"37":2,"41":1,"43":1,"44":1,"45":1,"46":1,"47":1,"54":1,"55":2,"56":1,"58":1,"59":2,"60":1,"62":2,"64":1,"65":5,"67":2,"68":2,"69":1,"70":2,"77":1,"80":1,"84":1,"87":1,"104":1,"105":2,"106":1,"113":2,"116":1,"118":2,"119":2,"122":2,"125":1,"126":3,"130":1,"131":1,"133":1,"142":1,"163":3,"164":2,"166":1,"168":1,"169":1,"173":1,"175":2,"186":1,"190":4,"198":1,"202":1,"204":2,"210":1,"216":1,"218":1,"219":1,"220":1,"222":1,"233":1,"234":1}}],["isomorphic",{"2":{"119":1}}],["isolated",{"2":{"40":1}}],["issue",{"2":{"80":2,"109":3,"123":1}}],["issues",{"0":{"109":1},"2":{"80":1,"109":1,"123":1,"205":1}}],["isn",{"2":{"28":1}}],["is",{"0":{"31":1,"47":1,"58":1,"123":1,"124":1,"125":1,"126":1,"127":1,"130":1},"1":{"131":1,"132":1,"133":1},"2":{"0":1,"1":4,"2":2,"5":1,"7":1,"9":1,"10":1,"11":2,"12":2,"13":2,"14":1,"16":2,"17":1,"18":1,"20":2,"21":1,"23":1,"24":2,"29":5,"31":2,"32":1,"33":2,"34":2,"37":2,"40":1,"41":5,"42":7,"44":1,"46":1,"47":1,"49":1,"50":1,"51":2,"53":1,"55":3,"56":1,"58":1,"59":3,"60":1,"61":1,"62":8,"63":4,"65":3,"67":4,"68":1,"69":1,"70":2,"71":1,"76":2,"77":1,"79":1,"80":1,"82":1,"84":1,"85":1,"87":2,"97":2,"104":1,"105":2,"106":2,"109":2,"110":2,"113":5,"115":1,"116":2,"118":6,"119":4,"121":1,"123":1,"125":2,"126":1,"127":2,"128":2,"129":2,"130":3,"141":1,"143":1,"144":3,"145":1,"155":1,"163":3,"164":1,"166":1,"167":1,"169":2,"171":1,"173":4,"174":1,"175":2,"176":1,"185":1,"186":4,"190":1,"198":1,"199":1,"204":1,"207":10,"208":6,"209":1,"210":2,"213":1,"214":1,"217":4,"219":5,"220":2,"228":1,"229":1,"230":1,"231":1,"232":1,"233":1,"234":1}}],["a4",{"2":{"217":4}}],["a2",{"2":{"210":4,"217":4}}],["a1",{"2":{"203":1,"210":5,"213":5}}],["akin",{"2":{"118":1}}],["availability",{"2":{"113":1}}],["available",{"2":{"62":2,"63":1,"85":1,"138":1,"157":1,"193":1,"210":2,"217":1}}],["aim",{"2":{"127":1}}],["aims",{"2":{"60":1,"106":1,"115":1,"116":1}}],["ai",{"2":{"104":1}}],["away",{"2":{"65":1}}],["awesome",{"0":{"104":1},"2":{"33":1,"97":1,"117":1}}],["aws",{"2":{"2":1,"11":1,"84":1,"113":1,"116":2,"132":1,"190":1}}],["after",{"0":{"221":1},"2":{"33":1,"166":1,"168":2,"169":1,"171":5,"174":1,"186":1,"198":1,"212":1,"213":1,"214":1,"221":1}}],["again",{"2":{"29":1}}],["above",{"2":{"33":1,"45":1,"142":1}}],["about",{"2":{"22":1,"26":1,"29":1,"32":1,"33":1,"35":1,"51":1,"55":1,"85":1,"113":2,"115":1,"126":1,"132":1,"168":2,"170":1,"220":1}}],["ability",{"2":{"128":1}}],["abi",{"2":{"29":1,"46":1,"49":1,"56":1,"60":1,"145":2,"208":1}}],["abstracts",{"2":{"65":1}}],["abstraction",{"2":{"48":1,"113":1}}],["abstracting",{"2":{"14":1}}],["abstract",{"2":{"14":1,"113":1}}],["able",{"2":{"6":1,"9":1,"13":1,"65":1}}],["along",{"2":{"65":1}}],["altered",{"2":{"65":1}}],["alter",{"2":{"53":1,"56":1}}],["although",{"2":{"28":1,"65":1,"169":1}}],["algebra",{"2":{"47":1}}],["always",{"2":{"45":3,"76":1,"142":3,"219":1}}],["already",{"2":{"17":1,"22":1,"27":1,"208":2}}],["allowed",{"2":{"188":4}}],["allowing",{"2":{"43":1,"52":1,"130":1,"132":1,"171":1}}],["allow",{"2":{"24":1,"167":1}}],["allows",{"2":{"11":1,"13":1,"60":1,"61":1,"145":1,"146":1,"163":1,"164":1,"173":1,"174":1,"222":1}}],["all",{"2":{"16":1,"23":1,"33":1,"41":1,"60":1,"61":1,"62":1,"66":1,"70":1,"85":1,"105":1,"124":1,"130":1,"137":1,"140":1,"157":1,"168":1,"170":1,"188":1,"190":2,"193":1,"198":1,"202":1,"212":1,"220":2,"221":1,"223":1,"234":1}}],["also",{"2":{"11":2,"16":1,"17":1,"25":2,"29":1,"43":1,"56":1,"64":1,"82":1,"113":1,"118":1,"119":2,"173":2}}],["alchemy",{"2":{"7":1}}],["automatic",{"2":{"176":1,"183":1}}],["automatically",{"2":{"33":1,"36":1,"115":1}}],["auto",{"2":{"33":1}}],["autonomous",{"0":{"113":1,"125":1},"1":{"114":1},"2":{"1":1,"2":1,"11":1,"84":1,"104":4,"113":5,"114":4,"116":1,"125":2,"132":1}}],["authentication",{"2":{"198":1}}],["authenticating",{"2":{"198":1}}],["authorize",{"2":{"13":1}}],["authorization",{"0":{"11":1,"13":1},"1":{"12":1,"13":1},"2":{"11":3,"12":3,"13":1,"229":1}}],["auth",{"0":{"12":1,"229":1},"2":{"13":1,"161":2,"197":1,"198":3,"229":6}}],["apt",{"2":{"136":1}}],["apparent",{"2":{"167":1}}],["application",{"2":{"198":1}}],["applications",{"2":{"115":1,"116":2,"163":1,"185":1}}],["applied",{"2":{"169":1,"174":1}}],["applies",{"2":{"130":1}}],["appchain",{"0":{"119":1},"2":{"119":1}}],["appchains",{"2":{"115":1,"119":2}}],["app",{"2":{"49":1,"71":1}}],["append",{"2":{"45":1,"142":1}}],["approach",{"0":{"48":1},"1":{"49":1,"50":1,"51":1,"52":1},"2":{"40":1,"127":1,"132":1,"174":1,"203":1}}],["appropriate",{"2":{"11":1,"116":1}}],["apis",{"2":{"164":1,"173":1}}],["api",{"0":{"67":1},"2":{"7":3,"33":2,"163":1,"164":1,"169":2,"176":1,"178":1,"179":2,"185":2,"188":1,"228":1}}],["apache",{"2":{"2":1,"121":1}}],["achieve",{"2":{"43":1,"116":1}}],["across",{"2":{"40":1,"42":1,"56":1}}],["accurate",{"2":{"60":1}}],["accepts",{"2":{"208":1}}],["accepting",{"2":{"113":1}}],["accepted",{"2":{"113":1}}],["accept",{"2":{"56":1}}],["accessing",{"2":{"42":1,"225":1}}],["accessible",{"2":{"33":1}}],["access",{"2":{"29":2,"49":1,"53":1,"55":1,"74":1,"113":1,"163":1}}],["according",{"2":{"167":1,"173":1}}],["accordingly",{"2":{"140":1}}],["accomplish",{"2":{"33":2}}],["accounts",{"2":{"198":1}}],["account",{"2":{"7":4,"20":2,"32":1,"198":5,"202":2,"228":3}}],["act",{"2":{"54":1}}],["actively",{"2":{"174":1}}],["activated",{"2":{"33":1}}],["acting",{"2":{"132":1}}],["action",{"2":{"33":1,"174":1,"206":1}}],["actionsimpl",{"2":{"29":1}}],["actions",{"2":{"29":3,"32":1,"33":2,"46":1,"49":1,"56":1,"60":1,"63":7,"116":1,"202":2,"204":3,"209":3,"210":10,"212":4,"213":2,"214":1,"216":1,"217":6}}],["acts",{"2":{"4":1}}],["attempts",{"2":{"130":1}}],["attrs",{"2":{"45":1,"142":1}}],["attributes",{"2":{"29":1,"36":2,"142":1}}],["attribute",{"0":{"41":1},"2":{"29":2,"31":1,"36":1,"39":1,"40":2,"41":1,"51":2,"56":1}}],["attacker",{"2":{"45":1,"142":1}}],["attack",{"2":{"43":1}}],["attached",{"2":{"21":2}}],["at",{"2":{"7":1,"14":1,"28":1,"29":1,"32":3,"33":2,"37":1,"41":1,"48":1,"49":1,"56":1,"106":1,"113":1,"127":1,"130":1,"136":1,"166":1,"167":1,"170":1,"179":2,"198":1,"213":1,"214":1,"215":1}}],["argument",{"2":{"173":1}}],["arguments",{"2":{"171":1}}],["artwork",{"2":{"113":1}}],["artists",{"2":{"97":1}}],["artifacts",{"2":{"232":1}}],["artifact",{"2":{"32":2}}],["arise",{"2":{"92":1}}],["around",{"2":{"65":1,"85":1,"113":1,"132":1,"169":1}}],["arraytrait",{"2":{"46":1}}],["array",{"2":{"45":7,"46":1,"63":1,"67":1,"142":7,"149":1,"207":3,"210":1,"212":1}}],["arrays",{"2":{"44":1}}],["arbitrary",{"2":{"36":1}}],["are",{"0":{"40":1,"54":1,"137":1,"220":1},"1":{"41":1,"42":1,"43":1,"44":1,"45":1},"2":{"6":1,"8":1,"9":1,"11":1,"14":4,"15":2,"16":4,"17":2,"18":1,"20":1,"21":2,"22":1,"23":1,"25":3,"26":1,"27":1,"31":1,"33":1,"39":2,"40":1,"51":1,"52":1,"53":1,"60":1,"62":2,"63":1,"65":1,"72":1,"81":1,"87":1,"109":1,"113":1,"114":1,"116":1,"124":2,"128":1,"130":1,"132":1,"138":2,"140":1,"143":2,"163":1,"167":2,"171":4,"173":2,"174":1,"176":1,"198":2,"203":2,"204":2,"213":1,"218":1,"219":1}}],["architecture",{"0":{"12":1,"49":1},"2":{"1":1,"12":1,"48":1,"132":1}}],["ask",{"2":{"215":1}}],["aspires",{"2":{"130":1}}],["aspects",{"2":{"49":1,"130":1,"190":1}}],["assuming",{"2":{"136":1}}],["assumes",{"2":{"27":1}}],["assigned",{"2":{"80":1}}],["asset",{"2":{"36":1}}],["assets",{"2":{"36":3}}],["assert",{"2":{"22":6,"62":2,"63":3,"150":1,"207":1,"208":3,"210":14,"213":3,"214":3,"217":15}}],["associating",{"2":{"35":1}}],["associated",{"2":{"29":1,"167":1}}],["as",{"0":{"28":1,"118":1,"119":1},"1":{"29":1,"30":1,"31":1,"32":1,"33":1,"34":1},"2":{"4":1,"9":1,"11":2,"14":1,"16":3,"17":2,"21":1,"22":2,"29":3,"31":1,"32":1,"33":1,"35":1,"40":1,"41":4,"42":1,"43":1,"46":2,"49":1,"51":1,"53":2,"54":1,"56":2,"58":1,"60":1,"62":1,"65":3,"67":1,"104":1,"105":1,"106":3,"109":2,"113":3,"118":3,"130":1,"132":1,"138":1,"142":1,"149":1,"150":1,"163":1,"170":1,"172":1,"173":1,"174":1,"186":2,"198":2,"203":1,"209":1,"212":1,"220":1}}],["amp",{"0":{"91":1,"98":1,"103":1},"1":{"92":1,"93":1,"94":1,"99":1,"100":1,"101":1,"102":1},"2":{"2":1,"42":2,"92":4,"103":1,"115":1,"198":2,"207":44}}],["adaptation",{"2":{"104":1}}],["adaptable",{"2":{"56":1}}],["adjust",{"2":{"60":1,"142":1}}],["advancements",{"2":{"105":1}}],["advanced",{"2":{"48":1}}],["advancing",{"2":{"2":1}}],["adhering",{"2":{"40":1}}],["adhere",{"2":{"29":1,"113":1}}],["adopting",{"2":{"28":1}}],["added",{"2":{"113":1}}],["adding",{"2":{"110":1,"218":1}}],["additionally",{"2":{"169":1}}],["additional",{"2":{"1":1,"35":1,"39":1,"46":1,"92":1}}],["add",{"0":{"94":1},"2":{"36":1,"70":1,"71":1,"72":1,"73":1,"74":1,"75":1,"145":1,"203":2,"210":1,"216":1,"218":1,"220":1}}],["addresses",{"2":{"115":1,"209":1,"213":1}}],["address",{"2":{"7":4,"16":1,"18":1,"19":1,"20":1,"24":1,"25":3,"26":3,"29":7,"31":1,"32":5,"33":5,"41":1,"49":3,"53":1,"56":3,"60":3,"63":3,"65":1,"67":5,"149":1,"166":1,"170":1,"174":1,"179":1,"188":1,"198":6,"199":1,"202":1,"203":1,"208":3,"210":8,"212":2,"213":4,"214":1,"217":2,"228":3,"229":3}}],["a",{"0":{"29":1,"31":2,"48":1,"52":1,"58":2,"112":1,"127":1,"219":1},"1":{"49":1,"50":1,"51":1,"52":1,"220":1,"221":1},"2":{"1":4,"4":1,"5":1,"6":1,"7":1,"8":1,"10":1,"11":5,"12":2,"13":4,"14":1,"16":2,"18":1,"19":1,"20":3,"21":6,"22":2,"23":3,"24":2,"26":3,"28":7,"29":8,"31":7,"32":2,"33":8,"34":1,"36":4,"37":1,"40":1,"41":5,"42":2,"43":6,"46":11,"49":1,"50":1,"51":3,"52":2,"53":1,"54":3,"55":1,"56":2,"58":3,"59":1,"60":1,"61":3,"62":1,"63":2,"64":1,"65":3,"67":1,"68":1,"69":1,"71":1,"77":1,"80":1,"82":1,"83":2,"85":1,"87":2,"97":1,"104":4,"105":1,"106":3,"109":1,"110":4,"111":1,"113":7,"115":1,"116":3,"118":5,"119":2,"122":1,"124":1,"126":2,"127":9,"128":1,"129":1,"130":2,"132":1,"134":1,"136":8,"137":1,"145":1,"146":1,"155":1,"157":1,"159":1,"163":3,"164":2,"167":2,"168":2,"170":1,"171":2,"173":10,"174":1,"175":2,"176":2,"179":2,"181":1,"183":1,"185":1,"186":4,"188":2,"190":5,"193":1,"198":9,"199":2,"200":1,"201":1,"202":1,"203":3,"204":1,"208":2,"213":3,"214":1,"216":2,"218":2,"219":3,"220":5,"223":5,"229":2,"231":8,"233":2}}],["answer",{"2":{"219":1}}],["answers",{"2":{"219":1}}],["ancillary",{"2":{"106":1}}],["analogy",{"2":{"46":1}}],["anatomy",{"0":{"29":1},"2":{"31":1}}],["another",{"2":{"43":1,"221":1}}],["annotated",{"2":{"40":1}}],["anything",{"2":{"110":1}}],["anyone",{"2":{"11":1,"121":2}}],["any",{"2":{"11":1,"16":1,"33":1,"36":1,"37":1,"40":1,"61":1,"67":1,"76":1,"92":1,"125":1,"129":1,"130":1,"169":2,"174":1}}],["and",{"0":{"92":1,"137":1,"167":1},"2":{"1":5,"2":2,"3":1,"5":2,"7":1,"9":1,"13":1,"14":2,"16":2,"17":1,"20":1,"21":1,"23":1,"24":1,"25":3,"26":2,"27":1,"28":3,"29":6,"31":9,"32":2,"33":11,"34":1,"35":4,"36":3,"37":1,"39":1,"40":1,"41":1,"42":1,"46":7,"48":1,"49":1,"52":1,"53":2,"56":1,"58":1,"60":2,"61":1,"62":1,"64":3,"65":3,"69":1,"70":2,"79":1,"82":1,"84":1,"85":2,"92":1,"97":1,"103":1,"104":1,"105":5,"106":2,"110":1,"113":9,"115":4,"116":5,"118":4,"119":1,"121":2,"122":1,"123":1,"124":2,"127":3,"128":2,"130":1,"132":2,"133":1,"138":1,"139":1,"140":1,"142":3,"143":1,"146":1,"149":2,"150":1,"155":1,"156":1,"159":1,"163":5,"164":1,"166":1,"167":4,"169":2,"170":1,"171":3,"172":1,"174":3,"175":1,"176":4,"177":1,"179":1,"181":1,"183":1,"185":4,"186":2,"190":2,"193":1,"198":6,"199":1,"201":1,"203":1,"208":1,"209":2,"210":1,"212":2,"213":2,"214":1,"216":2,"217":2,"219":1,"220":2,"231":1}}],["an",{"0":{"28":1,"118":1,"119":1,"124":1,"125":1},"1":{"29":1,"30":1,"31":1,"32":1,"33":1,"34":1},"2":{"0":1,"1":1,"2":1,"4":1,"20":1,"22":2,"23":1,"24":2,"26":1,"28":2,"29":2,"32":1,"33":1,"43":1,"46":1,"48":1,"65":1,"67":1,"79":1,"80":3,"103":1,"104":6,"106":1,"109":1,"113":2,"114":1,"116":1,"118":1,"119":1,"123":1,"125":1,"126":1,"127":1,"130":2,"132":1,"144":1,"147":1,"163":1,"168":2,"169":3,"173":4,"174":1,"175":1,"176":1,"178":1,"179":1,"183":1,"191":1,"203":1,"207":1,"220":1}}],["edit",{"2":{"203":1}}],["edges",{"2":{"168":2,"169":2,"171":2}}],["errors",{"2":{"186":1}}],["erc",{"2":{"47":1}}],["ephemeral",{"2":{"186":1}}],["etc",{"2":{"137":1}}],["ethereum",{"2":{"11":1,"113":1,"118":3}}],["ecosystem",{"0":{"98":1},"1":{"99":1,"100":1,"101":1,"102":1},"2":{"84":1}}],["ecs",{"0":{"28":1,"132":1},"1":{"29":1,"30":1,"31":1,"32":1,"33":1,"34":1},"2":{"21":4,"28":1,"29":1,"40":1,"65":1,"132":2,"203":1}}],["e2e",{"2":{"63":1}}],["effectively",{"2":{"132":1}}],["effortless",{"2":{"52":1}}],["efficiently",{"2":{"49":1,"132":1,"163":1}}],["efficient",{"2":{"5":1,"23":1,"115":1,"171":1,"175":1}}],["either",{"2":{"36":1,"83":1,"186":1}}],["e",{"2":{"29":1,"31":1,"104":1,"136":1,"203":1,"213":1}}],["essential",{"0":{"117":1},"2":{"105":1,"113":1,"174":1}}],["essentially",{"2":{"29":1,"172":1}}],["establish",{"2":{"43":1,"127":1}}],["established",{"2":{"33":1,"113":1}}],["establishes",{"2":{"1":1,"32":1,"33":1}}],["equivalent",{"2":{"137":1,"228":1}}],["equipped",{"2":{"34":1}}],["equips",{"2":{"28":1}}],["equal",{"2":{"16":1,"42":3,"62":4}}],["elements",{"2":{"212":1}}],["eliminating",{"2":{"115":1}}],["eliminates",{"2":{"60":1}}],["elusive",{"2":{"113":1}}],["elucidates",{"2":{"1":1}}],["else",{"2":{"20":1}}],["emerging",{"2":{"113":1,"130":1}}],["emergent",{"2":{"1":1}}],["emoji",{"2":{"104":1}}],["employ",{"2":{"43":1}}],["empty",{"2":{"28":1,"207":2}}],["embed",{"2":{"29":1,"46":1,"49":1,"56":1,"60":1,"145":2,"208":1}}],["emitting",{"2":{"26":1}}],["emitted",{"2":{"25":1,"169":1,"174":2}}],["emits",{"2":{"23":1,"25":1,"66":1}}],["emit",{"0":{"18":1},"2":{"18":4,"24":2,"26":4,"29":2,"60":2,"67":1}}],["evaluating",{"2":{"32":1}}],["evolving",{"2":{"28":1,"123":1}}],["evolve",{"2":{"1":1}}],["eventemitted",{"2":{"174":3}}],["eventually",{"2":{"113":1}}],["eventid",{"2":{"33":3,"173":2}}],["event",{"2":{"24":4,"25":4,"26":3,"29":7,"60":5,"66":1,"147":5,"173":4,"174":1}}],["events",{"0":{"23":1,"24":1,"25":1,"26":1,"66":1,"147":1,"174":1,"230":1},"1":{"24":1,"25":1,"26":1},"2":{"18":2,"23":4,"25":3,"26":3,"66":1,"139":1,"147":2,"174":2,"175":1,"185":1,"197":1,"230":3}}],["even",{"2":{"23":1,"115":1,"218":1}}],["everything",{"2":{"28":1,"66":1,"190":1,"216":1}}],["every",{"2":{"12":1,"23":1,"56":1,"65":1,"113":1,"127":2,"130":1,"173":1,"203":1,"220":1}}],["ease",{"2":{"134":1}}],["easier",{"2":{"118":1,"122":1,"172":1}}],["easiest",{"2":{"82":1}}],["easily",{"2":{"35":1,"46":1,"85":1,"109":1}}],["easy",{"0":{"5":1},"2":{"7":1,"23":1,"33":1,"69":1,"163":1,"178":1,"191":1}}],["earlier",{"2":{"31":1,"144":1}}],["early",{"2":{"1":1,"79":1}}],["each",{"2":{"16":1,"41":2,"46":1,"63":1,"109":1,"127":1,"142":1,"143":2,"144":1,"145":1,"167":1,"198":1,"209":1,"212":1,"213":1}}],["encouraged",{"2":{"219":1}}],["encapsulating",{"2":{"116":1}}],["encapsulates",{"2":{"49":1}}],["en",{"2":{"218":1}}],["enable",{"2":{"119":1}}],["enables",{"2":{"66":1,"116":1}}],["enabling",{"2":{"4":1,"35":1,"40":1,"190":1}}],["enact",{"2":{"54":1}}],["engage",{"2":{"53":1}}],["engines",{"2":{"133":1}}],["engineering",{"2":{"114":1,"130":1}}],["engine",{"0":{"1":1},"1":{"2":1,"3":1},"2":{"1":2,"33":11,"105":2,"106":1,"114":1,"203":1,"218":1}}],["endeavored",{"2":{"130":1}}],["endless",{"2":{"104":1}}],["end",{"2":{"34":2,"127":1,"218":1}}],["endpoints",{"2":{"177":1,"185":2,"188":1,"199":1}}],["endpoint",{"2":{"7":2,"185":1,"188":1,"198":2}}],["entail",{"2":{"127":1}}],["entry",{"2":{"113":1,"167":1}}],["enter",{"2":{"33":1}}],["entirely",{"2":{"124":1,"125":1,"128":1}}],["entire",{"2":{"33":1,"63":1,"171":1}}],["entities",{"0":{"21":1},"2":{"21":3,"33":2,"67":1,"68":1,"132":2,"167":2,"168":1,"169":1,"170":1,"171":6,"172":1,"174":1}}],["entityupdated",{"2":{"33":3,"173":3}}],["entity",{"0":{"132":1},"2":{"16":2,"17":1,"21":3,"28":1,"29":1,"31":2,"33":2,"40":2,"43":1,"46":10,"67":4,"125":1,"132":1,"173":3,"175":1,"185":1,"203":1,"209":2}}],["ensuring",{"2":{"23":1,"60":1,"113":2,"127":1,"191":1}}],["ensures",{"2":{"6":1,"105":1,"163":1}}],["ensure",{"2":{"5":1,"53":1,"127":1,"140":1,"144":1,"145":1,"209":1}}],["enums",{"0":{"45":1},"2":{"22":2,"39":1,"44":1,"142":1}}],["enum",{"0":{"22":1},"2":{"22":3,"29":1,"45":3,"60":1,"142":3,"147":1,"203":2}}],["env",{"2":{"20":1,"198":1,"202":1,"225":1,"228":2}}],["environments",{"2":{"113":1,"227":1}}],["environment",{"2":{"4":1,"28":1,"32":1,"87":1,"127":1,"188":1}}],["enhancements",{"2":{"113":1}}],["enhancement",{"2":{"80":1}}],["enhance",{"2":{"11":1,"116":1}}],["ex",{"2":{"188":1}}],["extracted",{"2":{"207":1}}],["extract",{"2":{"174":1}}],["extension",{"0":{"94":1},"2":{"94":1}}],["external",{"2":{"35":1,"188":3}}],["exactly",{"2":{"163":1}}],["examine",{"2":{"29":1}}],["examples",{"2":{"20":1,"32":1,"46":4,"56":2,"60":2,"63":2}}],["example",{"0":{"0":1},"2":{"0":1,"7":1,"16":1,"20":1,"21":1,"24":1,"26":1,"36":3,"42":1,"45":1,"46":1,"62":1,"63":1,"103":1,"142":1,"147":1,"167":1,"169":2,"172":1,"173":2,"174":2,"226":1,"229":1,"231":2}}],["existing",{"2":{"191":1,"198":1}}],["exist",{"2":{"113":1,"124":3,"208":1}}],["exists",{"2":{"59":1,"119":1,"125":1,"129":1,"188":1,"203":1,"213":1}}],["exceptionally",{"2":{"176":1}}],["excellent",{"2":{"20":1}}],["excavating",{"2":{"104":1}}],["excluding",{"2":{"29":1}}],["exclusively",{"2":{"28":1}}],["exciting",{"2":{"23":1}}],["executing",{"2":{"173":1}}],["execution",{"2":{"14":1,"113":3}}],["executor",{"2":{"32":1,"67":2}}],["executed",{"2":{"12":1}}],["execute",{"2":{"5":1,"28":1,"32":2,"33":2,"128":1,"143":1,"144":1,"149":1,"169":1,"173":1,"174":2,"197":1,"199":1}}],["exposing",{"2":{"163":1}}],["exposes",{"2":{"31":1,"67":1,"70":1,"177":1,"185":1}}],["expertise",{"2":{"132":1}}],["experienced",{"2":{"106":1}}],["experiences",{"2":{"35":1}}],["experience",{"2":{"4":1,"106":1,"127":1}}],["expect",{"2":{"128":1}}],["expressive",{"2":{"116":1}}],["exploring",{"2":{"168":1}}],["exploration",{"2":{"113":1}}],["explorer",{"2":{"168":1}}],["explorers",{"2":{"66":1}}],["explored",{"2":{"52":1}}],["explore",{"2":{"1":1,"164":1,"169":1}}],["explicit",{"2":{"54":1}}],["explained",{"2":{"31":4}}],["expanding",{"2":{"113":1}}],["expand",{"2":{"76":1,"113":1}}],["expanded",{"2":{"14":1}}],["expansive",{"2":{"34":1}}],["expansion",{"2":{"29":1,"60":1}}],["people",{"2":{"219":1}}],["period",{"2":{"186":1}}],["per",{"2":{"143":1,"150":1}}],["perfectly",{"2":{"119":1,"129":1}}],["performance",{"2":{"116":1,"176":1}}],["perform",{"2":{"33":1}}],["perpetual",{"2":{"113":1}}],["permanently",{"2":{"113":1}}],["permits",{"2":{"56":1}}],["permissionless",{"2":{"113":3,"118":1}}],["permission",{"2":{"54":1,"113":1}}],["permissions",{"0":{"55":1},"2":{"53":2}}],["persistence",{"2":{"113":1}}],["persistently",{"2":{"186":1}}],["persistent",{"2":{"113":1,"132":1,"186":3}}],["persist",{"2":{"113":1}}],["put",{"2":{"213":1}}],["push",{"2":{"173":1}}],["pushing",{"2":{"97":1}}],["puzzle",{"2":{"118":1}}],["pull",{"0":{"110":1},"2":{"110":2,"136":1}}],["pure",{"2":{"132":1}}],["purely",{"2":{"49":1,"124":1}}],["purpose",{"0":{"106":1},"2":{"119":1,"126":1}}],["public",{"0":{"8":1},"2":{"11":2,"124":1,"129":1}}],["png",{"2":{"36":2}}],["pieceimpl",{"2":{"207":1}}],["piecetrait",{"2":{"207":3,"208":1}}],["piecetype",{"2":{"203":2,"207":7,"208":2,"210":7,"213":2,"214":2,"217":11}}],["piece",{"2":{"202":2,"203":5,"207":18,"208":27,"209":2,"210":19,"212":1,"213":7,"214":5,"216":1,"217":22}}],["pieces",{"2":{"109":1,"213":1,"216":1,"217":1,"220":2}}],["pixel",{"2":{"104":1}}],["pixelaw",{"2":{"104":1}}],["pivotal",{"2":{"23":1,"54":1}}],["pinned",{"2":{"20":1}}],["plausible",{"2":{"128":1}}],["planning",{"2":{"190":1}}],["plan",{"2":{"53":1}}],["places",{"2":{"217":1}}],["place",{"2":{"43":1,"168":1,"216":1}}],["playground",{"0":{"164":1},"2":{"33":1,"164":1,"188":1}}],["play",{"2":{"23":1,"54":1,"81":1,"87":1,"113":1,"155":1,"169":1,"220":2}}],["playertrait",{"2":{"207":3}}],["playeractions",{"2":{"56":1}}],["playeractionsimpl",{"2":{"49":1,"56":1,"60":1,"208":1}}],["players",{"2":{"29":1,"104":1,"113":1,"127":2,"213":3}}],["player",{"2":{"16":2,"17":2,"21":2,"24":2,"29":25,"31":11,"40":1,"41":6,"49":8,"51":1,"56":4,"59":2,"60":11,"147":2,"168":2,"173":2,"202":2,"203":8,"207":6,"208":6,"209":1,"210":9,"212":1,"214":1,"217":1}}],["please",{"2":{"27":1,"80":2,"109":1,"123":1}}],["plenty",{"2":{"21":1}}],["panic",{"2":{"207":3}}],["palyerimpl",{"2":{"207":1}}],["pawn",{"2":{"203":1,"207":1,"210":4,"214":4,"216":6,"217":18,"218":1}}],["paginate",{"2":{"171":1}}],["pagination",{"0":{"170":1},"1":{"171":1,"172":1},"2":{"169":1,"170":2,"171":4,"172":1,"174":1}}],["page",{"2":{"0":1,"112":2,"138":1,"171":1}}],["paves",{"2":{"132":1}}],["paper",{"2":{"104":1}}],["paint",{"2":{"104":1}}],["pair",{"2":{"51":1}}],["pace",{"2":{"105":1}}],["pac",{"2":{"104":1}}],["packages",{"2":{"106":1}}],["package",{"0":{"93":1},"2":{"7":1,"20":2,"82":1,"93":1,"175":1,"180":1,"192":1,"202":1}}],["patch",{"2":{"136":2}}],["path",{"2":{"83":4,"137":1,"181":1,"193":1}}],["pattern",{"2":{"28":1,"46":1,"65":1,"113":1,"116":1}}],["passant",{"2":{"218":1}}],["pass",{"2":{"53":1,"64":1,"173":1}}],["parsed",{"2":{"185":1}}],["parsing",{"2":{"36":1}}],["paradigm",{"2":{"163":1}}],["parameters",{"2":{"150":1}}],["parameter",{"2":{"43":1,"53":1,"56":2,"60":1,"65":1}}],["parts",{"2":{"176":1,"218":1}}],["particular",{"2":{"173":1}}],["partialeq",{"2":{"22":1,"203":2}}],["part",{"2":{"61":1,"114":1}}],["potions",{"2":{"46":4}}],["potential",{"2":{"1":1,"34":1,"113":3,"169":1}}],["point",{"2":{"28":1,"36":1,"113":1,"167":1}}],["pos",{"2":{"210":10,"213":3,"214":5,"217":21}}],["postman",{"2":{"164":1}}],["possess",{"2":{"46":2,"113":1}}],["possesses",{"2":{"12":1}}],["possible",{"2":{"37":1,"44":1,"56":1,"97":1,"163":1}}],["possibly",{"2":{"29":2}}],["positionmodels",{"2":{"167":1}}],["positionimpl",{"2":{"42":1}}],["positiontrait",{"2":{"42":3}}],["position",{"0":{"51":1},"2":{"16":5,"17":5,"21":1,"26":4,"29":28,"31":10,"32":1,"33":2,"42":7,"46":12,"49":7,"56":4,"60":12,"62":4,"63":12,"168":4,"173":2,"203":3,"207":65,"208":17,"209":1,"213":2,"214":3,"229":1}}],["powerful",{"2":{"190":1}}],["powershell",{"2":{"138":1}}],["powered",{"0":{"98":1},"1":{"99":1,"100":1,"101":1,"102":1}}],["power",{"2":{"4":1,"116":1,"174":1}}],["phaser",{"2":{"104":1}}],["phase",{"2":{"1":1,"79":1}}],["pr",{"2":{"136":1}}],["practise",{"2":{"62":2}}],["practice",{"0":{"46":1}}],["practices",{"2":{"1":1,"40":1}}],["principle",{"2":{"130":1}}],["print",{"2":{"22":1,"161":1,"188":2,"223":1,"229":1,"231":1}}],["prioritize",{"2":{"53":1}}],["primer",{"2":{"114":1}}],["primed",{"2":{"43":1}}],["primitives",{"2":{"47":1,"103":1,"115":1}}],["primary",{"2":{"21":2,"29":1,"32":2,"33":1,"39":1,"40":1,"49":1,"51":2,"219":1}}],["private",{"2":{"7":3,"20":1,"198":3,"202":1,"228":3}}],["prefer",{"2":{"181":1}}],["presently",{"2":{"169":1}}],["predefined",{"2":{"167":2}}],["precompiled",{"0":{"138":1},"2":{"138":1}}],["precise",{"2":{"113":1}}],["prerequisites",{"0":{"82":1,"88":1}}],["preparing",{"2":{"32":1}}],["previous",{"2":{"147":1,"150":1}}],["previously",{"2":{"141":1}}],["prev",{"2":{"25":1}}],["pre",{"0":{"166":1},"2":{"5":1}}],["prod",{"2":{"227":1}}],["production",{"2":{"9":1,"186":1}}],["profiles",{"0":{"227":1},"1":{"228":1},"2":{"227":1,"228":1}}],["profile",{"2":{"181":1,"195":1,"227":4,"228":3}}],["problems",{"2":{"122":1}}],["proof",{"2":{"118":1,"127":2}}],["proofs",{"0":{"128":1},"2":{"113":1,"118":1,"119":2,"127":2}}],["programming",{"2":{"126":1}}],["programs",{"2":{"115":1,"128":1}}],["program",{"2":{"115":1,"174":1}}],["progresses",{"2":{"105":1}}],["progress",{"2":{"22":1}}],["proto",{"2":{"93":1}}],["protoc",{"2":{"88":1}}],["properties",{"2":{"115":1}}],["proper",{"2":{"53":1}}],["proceed",{"2":{"33":1,"150":1}}],["process",{"2":{"60":1,"61":1,"92":1,"116":1,"122":1,"132":2,"198":1}}],["processors",{"2":{"33":2}}],["processed",{"2":{"33":11}}],["promotion",{"2":{"218":1}}],["promoting",{"2":{"2":1,"132":1}}],["prompt",{"2":{"198":1}}],["promises",{"2":{"28":1}}],["provides",{"2":{"34":1,"48":1,"52":1,"61":1,"122":1,"133":1,"170":1,"173":1,"176":1,"190":1,"191":1}}],["provided",{"2":{"29":1,"41":1,"113":1}}],["provide",{"2":{"14":1,"16":1,"21":1,"35":1,"41":1,"150":1,"167":1,"178":1,"214":1}}],["providing",{"0":{"13":1},"2":{"113":1,"115":1,"185":1,"209":1}}],["provable",{"0":{"1":1,"115":1,"127":1},"1":{"2":1,"3":1,"116":1,"117":1,"118":1,"119":1},"2":{"1":3,"115":2,"127":1,"130":1}}],["projects",{"0":{"78":1,"104":1},"2":{"29":2,"36":1,"103":1,"116":1,"157":1,"190":1,"219":2}}],["project",{"0":{"29":1,"196":1,"201":1,"205":1},"2":{"1":1,"5":2,"6":2,"20":1,"28":4,"29":1,"31":1,"32":4,"33":1,"61":2,"63":1,"79":1,"121":1,"123":1,"190":1,"198":6,"201":4,"202":2,"218":1,"219":1,"233":2,"234":2}}]],"serializationVersion":2} diff --git a/dojo-book/docs/dist/Built with.svg b/dojo-book/docs/dist/Built with.svg new file mode 100644 index 00000000..12c5d2ce --- /dev/null +++ b/dojo-book/docs/dist/Built with.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/dojo-book/docs/dist/Dojo - Contracts.png b/dojo-book/docs/dist/Dojo - Contracts.png new file mode 100644 index 00000000..95412269 Binary files /dev/null and b/dojo-book/docs/dist/Dojo - Contracts.png differ diff --git a/dojo-book/docs/dist/ECS.png b/dojo-book/docs/dist/ECS.png new file mode 100644 index 00000000..638e86c0 Binary files /dev/null and b/dojo-book/docs/dist/ECS.png differ diff --git a/dojo-book/docs/dist/assets/0-setup-URPrfAiZ.js b/dojo-book/docs/dist/assets/0-setup-URPrfAiZ.js new file mode 100644 index 00000000..93e1eb12 --- /dev/null +++ b/dojo-book/docs/dist/assets/0-setup-URPrfAiZ.js @@ -0,0 +1,256 @@ +import{u as e,j as i}from"./index-m6NaWekR.js";const a={title:"0. Setup",description:"undefined"};function n(h){const s={a:"a",blockquote:"blockquote",code:"code",div:"div",em:"em",figure:"figure",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",span:"span",...e(),...h.components};return i.jsxs(i.Fragment,{children:[i.jsx(s.header,{children:i.jsxs(s.h1,{id:"0-setup",children:["0. Setup",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#0-setup",children:i.jsx(s.div,{"data-autolink-icon":!0})})]})}),` +`,i.jsx(s.p,{children:i.jsxs(s.em,{children:["Before starting recommend following the ",i.jsx(s.a,{href:"/cairo/hello-dojo",children:i.jsx(s.code,{children:"hello-dojo"})})," chapter to gain a basic understanding of the Dojo game."]})}),` +`,i.jsxs(s.h2,{id:"initializing-the-project",children:["Initializing the Project",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#initializing-the-project",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"Create a new Dojo project folder. You can name your project what you want."}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"mkdir"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" chess"})]})})})}),` +`,i.jsx(s.p,{children:"Open the project folder."}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"cd"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" chess"})]})})})}),` +`,i.jsx(s.p,{children:"And initialize the project using sozo init."}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" init"})]})})})}),` +`,i.jsxs(s.h2,{id:"cleaning-up-the-boilerplate",children:["Cleaning Up the Boilerplate",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#cleaning-up-the-boilerplate",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"The project comes with a lot of boilerplate codes. Clear it all. Make sure your directory looks like this"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"shell","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"shell","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"├──"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" README.md"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"├──"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Scarb.toml"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"└──"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" src"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" ├──"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" actions.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" ├──"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" lib.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" ├──"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" models"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" │"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" ├── game.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" │"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" ├── piece.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" │"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" └── player.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" ├──"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" models.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" ├──"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" tests"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" │"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" ├── integration.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" │"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" └── units.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" └──"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" tests.cairo"})]})]})})}),` +`,i.jsxs(s.p,{children:["Remodel your ",i.jsx(s.code,{children:"lib.cairo"}),", to look like this :"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod actions;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod models;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod tests;"})})]})})}),` +`,i.jsxs(s.p,{children:["Remodel your ",i.jsx(s.code,{children:"models.cairo"}),", to look like this :"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod game;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod piece;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod player;"})})]})})}),` +`,i.jsxs(s.p,{children:["Remodel your ",i.jsx(s.code,{children:"tests.cairo"}),", to look like this :"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod integration;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod units;"})})]})})}),` +`,i.jsxs(s.p,{children:["Make sure your ",i.jsx(s.code,{children:"Scarb.toml"})," looks like this:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"toml","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"toml","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"package"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"cairo-version = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"2.4.0"'})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"name = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"chess"'})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"version = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0.4.0"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cairo"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"sierra-replace-ids = "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"true"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dependencies"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"dojo = { git = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"https://github.com/dojoengine/dojo"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", version = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0.4.2"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"[["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"target"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojo"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]]"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"tool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojo"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"initializer_class_hash = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0xbeef"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"tool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojo"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"env"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"rpc_url = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"http://localhost:5050/"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Default account for katana with seed = 0"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"account_address = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"private_key = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x1800000000300000180000000000030000000000003006001800006600"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "})]})})}),` +`,i.jsx(s.p,{children:"Compile your project with:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" build"})]})})})}),` +`,i.jsxs(s.h2,{id:"basic-models",children:["Basic Models",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#basic-models",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"While there are many ways to design a chess game using the ECS model, we'll follow this approach:"}),` +`,i.jsxs(s.blockquote,{children:[` +`,i.jsx(s.p,{children:"Every square of the chess board (e.g., A1) will be treated as an entity. If a piece exists on a square position, that position will hold that piece."}),` +`]}),` +`,i.jsxs(s.p,{children:["First, add this basic ",i.jsx(s.code,{children:"player"})," model to ",i.jsx(s.code,{children:"models/player.cairo"})," file. If you are not familar with model syntax in Dojo engine, go back to this ",i.jsx(s.a,{href:"/cairo/models",children:"chapter"}),"."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"use starknet::ContractAddress;"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Model, Drop, Serde)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"struct Player {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[key]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" game_id: u32,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[key]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" address: ContractAddress,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" color: Color"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Serde, Drop, Copy, PartialEq, Introspect)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"enum Color {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" White,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Black,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" None,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})})]})})}),` +`,i.jsxs(s.p,{children:["Second, we do the same for ",i.jsx(s.code,{children:"game"})," model. Edit your ",i.jsx(s.code,{children:"models/player.cairo"})," file and add this content."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"use chess::models::player::Color;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"use starknet::ContractAddress;"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Model, Drop, Serde)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"struct Game {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[key]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" game_id: u32,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" winner: Color,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" white: ContractAddress,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" black: ContractAddress"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Model, Drop, Serde)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"struct GameTurn {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[key]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" game_id: u32,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" player_color: Color"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})})]})})}),` +`,i.jsxs(s.p,{children:["Lastly we create ",i.jsx(s.code,{children:"piece"})," model in our ",i.jsx(s.code,{children:"models/player.cairo"})," file."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"use chess::models::player::Color;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"use starknet::ContractAddress;"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Model, Drop, Serde)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"struct Piece {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[key]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" game_id: u32,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[key]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" position: Vec2,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" color: Color,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" piece_type: PieceType,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Copy, Drop, Serde, Introspect)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"struct Vec2 {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" x: u32,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" y: u32"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Serde, Drop, Copy, PartialEq, Introspect)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"enum PieceType {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Pawn,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Knight,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Bishop,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Rook,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Queen,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" King,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" None,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})})]})})}),` +`,i.jsxs(s.h2,{id:"basic-systems",children:["Basic systems",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#basic-systems",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["Starting from the next chapter, you will implement the ",i.jsx(s.code,{children:"actions.cairo"})," file. This is where our game logic/contract will reside."]}),` +`,i.jsxs(s.p,{children:["For now, ",i.jsx(s.code,{children:"actions.cairo"})," should look like this:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[dojo::contract]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod actions {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"It should be noted that Systems function are contract methods, by implication, rather than implementing the game logic in systems, we are implementing it in a contract."}),` +`,i.jsxs(s.h2,{id:"compile-your-project",children:["Compile your project",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#compile-your-project",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["Now try ",i.jsx(s.code,{children:"sozo build"})," to build."]}),` +`,i.jsxs(s.p,{children:["Complied? Great! then let's move on. If not fix the issues, so that you can run the ",i.jsx(s.code,{children:"sozo build"})," command successfully."]}),` +`,i.jsxs(s.h2,{id:"implement-traits-for-models",children:["Implement Traits for models",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#implement-traits-for-models",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"Before you move on, implement traits for models so we can use them in the next chapter when creating the action contract."}),` +`,i.jsxs(s.h3,{id:"requirements",children:["Requirements",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#requirements",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["Firt we have to define the following traits for ",i.jsx(s.code,{children:"Game"}),", ",i.jsx(s.code,{children:"Player"}),", ",i.jsx(s.code,{children:"Piece"})," models respectively."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"trait GameTurnTrait {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" fn next_turn(self: @GameTurn) -> Color;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"trait PlayerTrait {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"fn is_not_my_piece(self: @Player, piece_color: Color) -> bool;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"trait PieceTrait {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"fn is_out_of_board(next_position: Vec2) -> bool;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"fn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"Try to implement this code by yourself, Otherwise"}),` +`,` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"c","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"c","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"// code for player.cairo file"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"trait PlayerTrait {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"is_not_my_piece"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(self: @Player, piece_color: Color) "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"->"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" bool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:";"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"impl PalyerImpl of PlayerTrait {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"is_not_my_piece"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(self: @Player, piece_color: Color) "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"->"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" bool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" piece_color"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"// code for game.cairo file"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"trait GameTurnTrait {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"next_turn"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(self: @GameTurn) -> Color;"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"impl GameTurnImpl of GameTurnTrait {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"next_turn"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(self: @GameTurn) -> Color {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" match self.player_color {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::Black,"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::Black "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White,"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::None "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" panic"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(array"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'Illegal turn'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"])"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"// code for piece.cairo file"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"trait PieceTrait {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"is_out_of_board"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(next_position: Vec2) "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"->"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" bool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:";"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"is_right_piece_move"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(self: @Piece, next_position: Vec2) "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"->"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" bool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:";"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"impl PieceImpl of PieceTrait {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"is_out_of_board"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(next_position: Vec2) "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"->"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" bool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 7"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 7"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"is_right_piece_move"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(self: @Piece, next_position: Vec2) "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"->"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" bool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_position.x;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_position.y;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y), "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'Cannot move same position'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" match self.piece_type {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Pawn "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" match self.color {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 2"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" &&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" &&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::Black "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 2"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" &&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" &&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::None "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" panic"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(array"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'Should not move empty piece'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]),"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Knight "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" { n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 2"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" &&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Bishop "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_x)"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_x)"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_x)"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"&&"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_x)"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Rook "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y)"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y)"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Queen "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y)"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y)"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y)"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::King "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" &&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" &&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" &&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"+"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (n_x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.x "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" &&"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" n_y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<="}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" *"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"self.position.y "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"-"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=>"}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" panic"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(array"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'Should not move empty piece'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]),"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,` +`,i.jsxs(s.p,{children:["This tutorial is extracted from ",i.jsx(s.a,{href:"https://github.com/dojoengine/origami/tree/main/examples/chess",children:"here"})]}),` +`,i.jsx(s.p,{children:"Congratulations! You've completed the basic setup for building an on-chain chess game 🎉"})]})}function d(h={}){const{wrapper:s}={...e(),...h.components};return s?i.jsx(s,{...h,children:i.jsx(n,{...h})}):n(h)}export{d as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/0.3.0-AZn_7z6m.js b/dojo-book/docs/dist/assets/0.3.0-AZn_7z6m.js new file mode 100644 index 00000000..8f58c7ed --- /dev/null +++ b/dojo-book/docs/dist/assets/0.3.0-AZn_7z6m.js @@ -0,0 +1,162 @@ +import{u as i,j as e}from"./index-m6NaWekR.js";const t=void 0;function s(a){const n={a:"a",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...i(),...a.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.h2,{id:"migration-guide-to-030",children:["Migration Guide to 0.3.0",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#migration-guide-to-030",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"0.3.0 introduced some breaking changes to Systems and Models which requires reworking of your worlds."}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"#components-to-models",children:"Components"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"#systems-update",children:"Systems"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"#events",children:"Events"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"#npm",children:"Npm"})}),` +`]}),` +`,e.jsxs(n.h3,{id:"components-to-models",children:["Components to Models",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#components-to-models",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:'In version 0.3.0, "components" have been renamed to "models". This has been done due to Cairo introducing the concept of Components natively.'}),` +`,e.jsx(n.p,{children:"You must:"}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsxs(n.li,{children:["Replace ",e.jsx(n.code,{children:"#[component]"})," with ",e.jsx(n.code,{children:"#[model]"}),"."]}),` +`,e.jsxs(n.li,{children:["Update ",e.jsx(n.code,{children:"#[derive(Component)]"})," to ",e.jsx(n.code,{children:"#[derive(Model)]"})," throughout your code."]}),` +`]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Note"}),": Ensure all related files and imports are updated accordingly."]}),` +`,e.jsxs(n.h3,{id:"changes-in-model-implementation",children:["Changes in Model Implementation",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#changes-in-model-implementation",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["The trait ",e.jsx(n.code,{children:"SerdeLen"})," is no longer implemented for models. If you relied on this previously, you should now use ",e.jsx(n.code,{children:"SchemaIntrospection"}),"."]}),` +`,e.jsxs(n.h3,{id:"schema-introduction",children:["Schema Introduction",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#schema-introduction",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["For models containing complex types, it's crucial to implement the ",e.jsx(n.code,{children:"SchemaIntrospection"})," trait."]}),` +`,e.jsx(n.p,{children:"Consider the model below:"}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct Card {"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" #[key]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" token_id: u256,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" /// The card's designated role."})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" role: Roles,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.p,{children:["For complex types, like ",e.jsx(n.code,{children:"Roles"})," in the above example, you need to implement ",e.jsx(n.code,{children:"SchemaIntrospection"}),". Here's how:"]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"impl RolesSchemaIntrospectionImpl of SchemaIntrospection {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" #[inline(always)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn size() -> usize {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" 1 // Represents the byte size of the enum."})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" }"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" #[inline(always)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn layout(ref layout: Array) {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" layout.append(8); // Specifies the layout byte size;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" }"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" #[inline(always)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn ty() -> Ty {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" Ty::Enum("})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" Enum {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" name: 'Roles',"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" attrs: array![].span(),"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" children: array!["})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" ('Goalkeeper', serialize_member_type(@Ty::Tuple(array![].span()))),"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" ('Defender', serialize_member_type(@Ty::Tuple(array![].span()))),"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" ('Midfielder', serialize_member_type(@Ty::Tuple(array![].span()))),"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" ('Attacker', serialize_member_type(@Ty::Tuple(array![].span()))),"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" ]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" .span()"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" }"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" )"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" }"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Key Takeaways from custom types"}),":"]}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"size"}),": Defines the byte size of the type."]}),` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"layout"}),": Outlines the byte structure/layout for the type. Validate and adjust as necessary."]}),` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"ty"}),": Details the specific type, attributes, and subcomponents. For enums, like ",e.jsx(n.code,{children:"Roles"}),", you need to specify each member and its type."]}),` +`]}),` +`,e.jsxs(n.h3,{id:"systems-update",children:["Systems Update",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#systems-update",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Systems in 0.3.0 are very similar now to Cairo Contracts. You can write your systems just like regular contracts, and each dojo contract can contain mulitple systems."}),` +`,e.jsx(n.p,{children:"Important high level changes:"}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsx(n.li,{children:"Systems are now starknet contracts"}),` +`,e.jsxs(n.li,{children:["Define ",e.jsx(n.a,{href:"#interface-creation",children:"Interfaces"})," for each system contract"]}),` +`,e.jsxs(n.li,{children:["New optional ",e.jsx(n.code,{children:"#[dojo::contract]"})," decorator defining systems"]}),` +`,e.jsx(n.li,{children:"Multiple systems per dojo contract, rather than singular"}),` +`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"execute"})," is no longer required system selector name"]}),` +`]}),` +`,e.jsxs(n.h4,{id:"interface-creation",children:["Interface Creation",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#interface-creation",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"System management has been revamped. Start by defining an interface for each system, which specifies its implementation:"}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[starknet::interface]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"trait ICreateCard {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn create_card("})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" self: @TContractState,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" world: IWorldDispatcher,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" token_id: u256,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" dribble: u8,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" defense: u8,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" cost: u8,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" role: Roles,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" is_captain: bool"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" );"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.p,{children:["Ensure the trait is typed with ",e.jsx(n.code,{children:"TContractState"}),"."]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Note"}),": Earlier versions required functions within the system to be named ",e.jsx(n.code,{children:"execute"}),". This is no longer the case."]}),` +`,e.jsxs(n.h4,{id:"interface-implementation",children:["Interface Implementation",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#interface-implementation",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"To implement the interface:"}),` +`,e.jsxs(n.ol,{children:[` +`,e.jsxs(n.li,{children:["Add ",e.jsx(n.code,{children:"#[abi(embed_v0)]"})," before each method."]}),` +`,e.jsxs(n.li,{children:["Ensure to reference the created interface in the module with ",e.jsx(n.code,{children:"use super::ICreateCard;"}),"."]}),` +`]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[abi(embed_v0)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"impl CreateCardImpl of ICreateCard {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn create_card("})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" self: @ContractState,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" world: IWorldDispatcher,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" token_id: u256,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" dribble: u8,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" defense: u8,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" cost: u8,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" role: Roles,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" is_captain: bool"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" ) {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" // your logic here"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" }"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.p,{children:["This then allows the ",e.jsx(n.code,{children:"create_card"})," to be called just like a regular starknet function."]}),` +`,e.jsxs(n.h4,{id:"dojocontract-decorator",children:[e.jsx(n.code,{children:"#[dojo::contract]"})," decorator",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojocontract-decorator",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["0.3.0 introduces a new optional decorator ",e.jsx(n.code,{children:"#[dojo::contract]"})," which indicates to the compiler to inject imports and the world dispatcher. This allows for minimal boilerplate."]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[dojo::contract]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"mod move {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"....code TODO"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.h3,{id:"events",children:["Events",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#events",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Events should now reside within the models. Here's an example of how to migrate your events:"}),` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Previous Format"}),":"]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event, Copy)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct DeckCreated {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" player: ContractAddress,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" token_list: Span,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"New Format"}),":"]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[event]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"enum Event {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" DeckCreated: DeckCreated"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct DeckCreated {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" player: ContractAddress,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" token_list: Span,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.h3,{id:"testing-changes",children:["Testing Changes",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#testing-changes",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.h4,{id:"setup",children:["Setup",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#setup",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Testing has seen significant changes with the change to systems as Contracts. Instead of using ",e.jsx(n.code,{children:"world.execute"}),", use the dispatcher."]}),` +`,e.jsxs(n.ol,{children:[` +`,e.jsx(n.li,{children:"Import necessary modules and traits:"}),` +`]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"use dojo::test_utils::deploy_contract;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"use tsubasa::systems::{ICreateCardDispatcher, ICreateCardDispatcherTrait};"})})]})})}),` +`,e.jsxs(n.ol,{start:"2",children:[` +`,e.jsx(n.li,{children:"Deploy the contract and instantiate the dispatcher:"}),` +`]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"let contract_create_card = deploy_contract("})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" create_card_system::TEST_CLASS_HASH, array![].span()"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:");"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"let create_card_system = ICreateCardDispatcher { contract_address: contract_create_card };"})})]})})}),` +`,e.jsxs(n.h4,{id:"function-testing",children:["Function Testing",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#function-testing",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"With the contract deployed and the dispatcher instantiated, proceed to test your functions:"}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"// ... (previous setup code)"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"let result = create_card_system.create_card("})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" // ... provide necessary parameters here"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:");"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"// Assert or validate the 'result' as per your test conditions"})})]})})})]})}function r(a={}){const{wrapper:n}={...i(),...a.components};return n?e.jsx(n,{...a,children:e.jsx(s,{...a})}):s(a)}export{r as default,t as frontmatter}; diff --git a/dojo-book/docs/dist/assets/0.4.0-CJRbBQ2I.js b/dojo-book/docs/dist/assets/0.4.0-CJRbBQ2I.js new file mode 100644 index 00000000..4a14e625 --- /dev/null +++ b/dojo-book/docs/dist/assets/0.4.0-CJRbBQ2I.js @@ -0,0 +1,2 @@ +import{u as i,j as n}from"./index-m6NaWekR.js";const a=void 0;function o(e){const t={a:"a",div:"div",h2:"h2",p:"p",...i(),...e.components};return n.jsxs(n.Fragment,{children:[n.jsxs(t.h2,{id:"migration-guide-to-040",children:["Migration Guide to 0.4.0",n.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#migration-guide-to-040",children:n.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(t.p,{children:"[todo]"})]})}function d(e={}){const{wrapper:t}={...i(),...e.components};return t?n.jsx(t,{...e,children:n.jsx(o,{...e})}):o(e)}export{d as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/1-action-3KNsFnxH.js b/dojo-book/docs/dist/assets/1-action-3KNsFnxH.js new file mode 100644 index 00000000..0dce21f8 --- /dev/null +++ b/dojo-book/docs/dist/assets/1-action-3KNsFnxH.js @@ -0,0 +1,146 @@ +import{u as i,j as n}from"./index-m6NaWekR.js";const l={title:"1. Actions",description:"undefined"};function s(a){const e={a:"a",code:"code",div:"div",figure:"figure",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",...i(),...a.components};return n.jsxs(n.Fragment,{children:[n.jsx(e.header,{children:n.jsxs(e.h1,{id:"1-actions",children:["1. Actions",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#1-actions",children:n.jsx(e.div,{"data-autolink-icon":!0})})]})}),` +`,n.jsxs(e.p,{children:["This chapter will address implementing ",n.jsx(e.code,{children:"actions.cairo"}),", which spawns the game & squares containing pieces and also allow players to move pieces."]}),` +`,n.jsxs(e.h2,{id:"what-is-actions-contract",children:["What is ",n.jsx(e.code,{children:"actions"})," contract?",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-is-actions-contract",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["To play chess, you need, to start game, spawn the pieces, and move around the board. The ",n.jsx(e.code,{children:"actions"})," contract has two dominant functions ",n.jsx(e.code,{children:"spawn"})," function which spawns the game entity, places each piece in its proper position on the board and returns the game_id, and the ",n.jsx(e.code,{children:"move"})," funtion which allows pieces to be moved around the board."]}),` +`,` +`,n.jsxs(e.h2,{id:"requirements",children:["Requirements",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#requirements",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.ol,{children:[` +`,n.jsxs(e.li,{children:["Write an interface for the ",n.jsx(e.code,{children:"actions"})," contract on top of your code. In this case, ",n.jsx(e.code,{children:"move"})," and ",n.jsx(e.code,{children:"spawn"})]}),` +`]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use starknet::ContractAddress;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use chess::models::piece::Vec2;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[starknet::interface]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" trait IActions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn move("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" self: @ContractState,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" curr_position: Vec2,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" next_position: Vec2,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" caller: ContractAddress, //player"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id: u32"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn spawn("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ) -> u32;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})})]})})}),` +`,n.jsxs(e.ol,{start:"2",children:[` +`,n.jsx(e.li,{children:"Bring in required imports into the contract like this :"}),` +`]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[dojo::contract]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" mod actions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use chess::models::player::{Player, Color, PlayerTrait};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use chess::models::piece::{Piece, PieceType, PieceTrait};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use chess::models::game::{Game, GameTurn, GameTurnTrait};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use super::{ContractAddress, IActions, Vec2};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})})]})})}),` +`,n.jsxs(e.p,{children:["Should be noted that ",n.jsx(e.code,{children:"actions"})," is the contract name."]}),` +`,n.jsxs(e.ol,{start:"3",children:[` +`,n.jsxs(e.li,{children:["Write a ",n.jsx(e.code,{children:"spawn"})," function that accepts the ",n.jsx(e.code,{children:"white address"}),", and ",n.jsx(e.code,{children:"black address"})," as input and set necessary states using ",n.jsx(e.code,{children:"set!(...)"}),". Implement the ",n.jsx(e.code,{children:"player"})," entity from player model. Implement the game entity, comprised of the ",n.jsx(e.code,{children:"Game"})," model and ",n.jsx(e.code,{children:"GameTurn"})," model we created in the ",n.jsx(e.code,{children:"game.cairo"})," and implement the piece entities from a1 to h8 containing the correct ",n.jsx(e.code,{children:"PieceType"})," in the ",n.jsx(e.code,{children:"spawn"})," fn."]}),` +`]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[abi(embed_v0)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" impl IActionsImpl of IActions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn spawn("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ) -> u32 {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let world = self.world_dispatcher.read();"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let game_id = world.uuid();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // set Players"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Player { game_id, address: black_address, color: Color::Black },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Player { game_id, address: white_address, color: Color::White },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" )"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // set Game and GameTurn"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Game {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id, winner: Color::None, white: white_address, black: black_address"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" GameTurn { game_id, player_color: Color::White },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" )"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // set Pieces"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" (Piece {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" color: Color::White,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" position: Vec2 { x: 0, y: 0 },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" piece_type: PieceType::Rook"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" })"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" (Piece {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" color: Color::White,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" position: Vec2 { x: 0, y: 1 },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" piece_type: PieceType::Pawn"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" })"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" (Piece {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" color: Color::Black,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" position: Vec2 { x: 1, y: 6 },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" piece_type: PieceType::Pawn"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" })"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" (Piece {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" color: Color::White,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" position: Vec2 { x: 1, y: 0 },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" piece_type: PieceType::Knight"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" })"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" (Piece {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" color: Color::None,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" position: Vec2 { x: 0, y: 2 },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" piece_type: PieceType::None"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" })"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" (Piece {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" color: Color::None,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" position: Vec2 { x: 0, y: 3 },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" piece_type: PieceType::None"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" })"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" (Piece {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" color: Color::None,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" position: Vec2 { x: 1, y: 4 },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" piece_type: PieceType::None"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" })"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" //the rest of the positions on the board goes here...."})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn move("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" self: @ContractState,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" curr_position: Vec2,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" next_position: Vec2,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" caller: ContractAddress, //player"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id: u32"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // Upcoming code"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})})]})})})]})}function r(a={}){const{wrapper:e}={...i(),...a.components};return e?n.jsx(e,{...a,children:n.jsx(s,{...a})}):s(a)}export{r as default,l as frontmatter}; diff --git a/dojo-book/docs/dist/assets/2-move-3vyTeY25.js b/dojo-book/docs/dist/assets/2-move-3vyTeY25.js new file mode 100644 index 00000000..c4bad0de --- /dev/null +++ b/dojo-book/docs/dist/assets/2-move-3vyTeY25.js @@ -0,0 +1,199 @@ +import{u as l,j as i}from"./index-m6NaWekR.js";const a={title:"2 Move function",description:"undefined"};function h(e){const s={a:"a",code:"code",div:"div",figure:"figure",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",ul:"ul",...l(),...e.components};return i.jsxs(i.Fragment,{children:[i.jsx(s.header,{children:i.jsxs(s.h1,{id:"2-move-function",children:["2 Move function",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#2-move-function",children:i.jsx(s.div,{"data-autolink-icon":!0})})]})}),` +`,i.jsxs(s.ol,{children:[` +`,i.jsxs(s.li,{children:["Write a ",i.jsx(s.code,{children:"move"})," function that accepts the ",i.jsx(s.code,{children:"current position"}),", ",i.jsx(s.code,{children:"next position"}),", ",i.jsx(s.code,{children:"caller address"}),", and ",i.jsx(s.code,{children:"game_id"}),". The ",i.jsx(s.code,{children:"move"})," function should look like this:"]}),` +`]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"c","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"c","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" #["}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"abi"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(embed_v0)]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" impl PlayerActionsImpl of IActions"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"ContractState"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"spawn"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ) -> u32 {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // Rest of code"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"move"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" self: @ContractState,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" curr_position: Vec2,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_position: Vec2,"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" caller: ContractAddress,"}),i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //player"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" game_id: u32"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ) {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let world "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" self.world_dispatcher."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"read"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let mut current_piece "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, curr_position), (Piece));"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // check if next_position is out of board or not"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"PieceTrait::is_out_of_board"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(next_position), "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'Should be inside board'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // check if this is the right move for this piece type"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" current_piece."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"is_right_piece_move"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(next_position), "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'Illegal move for type of piece'"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" );"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // Get piece data from to next_position in the board"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let mut next_position_piece "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, next_position), (Piece));"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let player "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, caller), (Player));"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // check if there is already a piece in next_position"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_position_piece.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ||"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" player."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"is_not_my_piece"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(next_position_piece.color),"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" 'Already same color piece exist'"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" );"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_position_piece.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" current_piece.piece_type;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_position_piece.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" player.color;"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // make current_piece piece none"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" current_piece.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" current_piece.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::None;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" set"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (next_position_piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" set"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (current_piece));"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // change turn"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let mut game_turn "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, game_id, (GameTurn));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" game_turn.player_color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" game_turn."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"next_turn"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" set"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_turn));"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})})]})})}),` +`,i.jsxs(s.ol,{start:"2",children:[` +`,i.jsxs(s.li,{children:[` +`,i.jsxs(s.p,{children:["Run ",i.jsx(s.code,{children:"sozo build"})," to compile the code."]}),` +`,i.jsx(s.p,{children:"Great, Now we can start testing our functions"}),` +`]}),` +`]}),` +`,i.jsxs(s.h2,{id:"test-flow",children:["Test Flow",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#test-flow",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.ul,{children:[` +`,i.jsxs(s.li,{children:["Spawn the test world (",i.jsx(s.code,{children:"spawn_test_world"}),") that imports the models in testing."]}),` +`,i.jsx(s.li,{children:"Deploy actions contract"}),` +`,i.jsxs(s.li,{children:["Interact with ",i.jsx(s.code,{children:"spawn"})," function in the ",i.jsx(s.code,{children:"actions"})," contract by providing white and black player's wallet addresses as inputs."]}),` +`,i.jsxs(s.li,{children:["Retrieve the game entity and piece entity created in ",i.jsx(s.code,{children:"actions"})," contract."]}),` +`,i.jsx(s.li,{children:"Ensure the game has been correctly created."}),` +`,i.jsxs(s.li,{children:["Verify that each ",i.jsx(s.code,{children:"Piece"})," is located in the correct position."]}),` +`]}),` +`,i.jsxs(s.h2,{id:"unit-tests",children:["Unit Tests",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#unit-tests",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.ul,{children:[` +`,i.jsxs(s.li,{children:["Copy the test below and add it to your ",i.jsx(s.code,{children:"tests/units.cairo"})," file."]}),` +`]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"c","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"c","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"#["}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"cfg"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(test)]"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"mod tests {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use starknet::ContractAddress;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use dojo::test_utils::{spawn_test_world, deploy_contract};"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use chess::models::player::{Player, Color, player};"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use chess::models::piece::{Piece, PieceType, Vec2, piece};"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use chess::models::game::{Game, GameTurn, game, game_turn};"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use chess::actions::{actions, IActionsDispatcher, IActionsDispatcherTrait};"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // helper setup function"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"setup_world"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"() "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"->"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (IWorldDispatcher, IActionsDispatcher) {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // models"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let mut models "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" array"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" game::TEST_CLASS_HASH,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" player::TEST_CLASS_HASH,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" game_turn::TEST_CLASS_HASH,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" piece::TEST_CLASS_HASH"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ];"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // deploy world with models"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let world "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" spawn_test_world"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(models);"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // deploy systems contract"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let contract_address "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" world"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"deploy_contract"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'salt'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", actions::TEST_CLASS_HASH."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"try_into"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"()."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"unwrap"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"());"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let actions_system "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" IActionsDispatcher { contract_address };"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (world, actions_system)"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" #[test]"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" #["}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"available_gas"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"3000000000000000"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"test_spawn"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"() {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let white "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" starknet::contract_address_const::"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<0x"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"01"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let black "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" starknet::contract_address_const::"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<0x"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"02"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" let"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (world, actions_system) "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" setup_world"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //system calls"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let game_id "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" actions_system."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"spawn"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(white, black);"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //get game"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let game "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, game_id, (Game));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let game_turn "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, game_id, (GameTurn));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(game_turn.player_color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white turn'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(game.white "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" white, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'white address is incorrect'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(game.black "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" black, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'black address is incorrect'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //get a1 piece"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Vec2 { x: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", y: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" };"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let a1 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a1.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Rook, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Rook'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a1.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white color'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a1.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" #[test]"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" #["}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"available_gas"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"3000000000000000"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"test_move"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"() {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let white "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" starknet::contract_address_const::"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<0x"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"01"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let black "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" starknet::contract_address_const::"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<0x"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"02"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" let"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (world, actions_system) "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" setup_world"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let game_id "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" actions_system."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"spawn"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(white, black);"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Vec2 { x: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", y: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" };"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let a2 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a2.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Pawn, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Pawn'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a2.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white color piece 1'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a2.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let next_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Vec2 { x: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", y: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"2"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" };"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let game_turn "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, game_id, (GameTurn));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(game_turn.player_color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white player turn'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" actions_system."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"move"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(curr_pos, next_pos, white."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"into"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(), game_id);"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_pos;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let c3 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(c3.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Pawn, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Pawn'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(c3.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white color piece 2'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(c3.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let game_turn "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, game_id, (GameTurn));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(game_turn.player_color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::Black, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be black player turn'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsxs(s.h2,{id:"diving-into-the-code",children:["Diving into the Code",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#diving-into-the-code",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.h3,{id:"setup_world",children:["setup_world",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#setup_world",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["We should list all models with each having CLASS_HASH as elements and then we deploy world to models with ",i.jsx(s.code,{children:"spawn_test_world"})]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" //models"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let mut models = array!["})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" game::TEST_CLASS_HASH,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" player::TEST_CLASS_HASH,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" game_turn::TEST_CLASS_HASH,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" piece::TEST_CLASS_HASH"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" ];"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // deploy world with models"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let world = spawn_test_world(models);"})})]})})}),` +`,i.jsxs(s.p,{children:["After that, we deploy our system contracts, then we return our ",i.jsx(s.code,{children:"world"})," and ",i.jsx(s.code,{children:"actions_systems"})," dispatchers."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let contract_address = world"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let actions_system = IActionsDispatcher { contract_address };"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" (world, actions_system)"})})]})})}),` +`,i.jsxs(s.h3,{id:"test_spawn",children:["test_spawn",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#test_spawn",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"First, we'll set up the players address and their colors."}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let white = starknet::contract_address_const::<0x01>();"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let black = starknet::contract_address_const::<0x02>();"})})]})})}),` +`,i.jsxs(s.p,{children:["We use ",i.jsx(s.code,{children:"spawn"})," function in ",i.jsx(s.code,{children:"actions.cairo"})," to put our pieces on the board. Each square position holds a piece. The system's ",i.jsx(s.code,{children:"spawn"})," function needs some input i.e the addresses of the players."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // spawn"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let game_id = actions_system.spawn(white, black);"})})]})})}),` +`,i.jsxs(s.p,{children:["Then we check if the players got their setup address. After that we check if a White rook is at (0,0). Remember, to get a piece that exists on the position, you need to use the keys of the ",i.jsx(s.code,{children:"Piece"})," model, which are ",i.jsx(s.code,{children:"game_id"}),", and ",i.jsx(s.code,{children:"curr_pos"}),"."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"c","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"c","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //get a1 square"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Vec2 { x: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", y: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" };"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let a1 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a1.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Rook, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Rook'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a1.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white color'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a1.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]})]})})}),` +`,i.jsxs(s.h3,{id:"test_move",children:["test_move",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#test_move",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["Here, after setting up the board, we use ",i.jsx(s.code,{children:"move"})," function in the contract to make moves. Provide the current position, the next position, the player's address, and the game id."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" //Move White Pawn to (0,2)"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" actions_system.move(curr_pos, next_pos, white.into(), game_id);"})})]})})}),` +`,i.jsx(s.p,{children:"Then we check if a White Pawn is at the new position."}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"c","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"c","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" next_pos;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let c3 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(c3.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Pawn, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Pawn'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(c3.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white color piece 2'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(c3.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]})]})})}),` +`,i.jsxs(s.h2,{id:"need-help",children:["Need help?",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#need-help",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["If you're stuck, don't hesitate to ask questions at the ",i.jsx(s.a,{href:"https://discord.gg/akd2yfuRS3",children:"Dojo community"}),"!"]})]})}function t(e={}){const{wrapper:s}={...l(),...e.components};return s?i.jsx(s,{...e,children:i.jsx(h,{...e})}):h(e)}export{t as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/3-test-crEB-KfZ.js b/dojo-book/docs/dist/assets/3-test-crEB-KfZ.js new file mode 100644 index 00000000..3de0fbb4 --- /dev/null +++ b/dojo-book/docs/dist/assets/3-test-crEB-KfZ.js @@ -0,0 +1,89 @@ +import{u as l,j as i}from"./index-m6NaWekR.js";const a={title:"3 Test Contract",description:"undefined"};function e(h){const s={a:"a",code:"code",div:"div",figure:"figure",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",ul:"ul",...l(),...h.components};return i.jsxs(i.Fragment,{children:[i.jsx(s.header,{children:i.jsxs(s.h1,{id:"3-test-contract",children:["3 Test Contract",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#3-test-contract",children:i.jsx(s.div,{"data-autolink-icon":!0})})]})}),` +`,i.jsx(s.p,{children:"In this chapter, we'll use everything we've learned to run a full chess game scenario."}),` +`,i.jsx(s.p,{children:"Here's what we'll do in our test:"}),` +`,i.jsxs(s.ol,{children:[` +`,i.jsxs(s.li,{children:["Call spawn to setup ",i.jsx(s.code,{children:"white_pawn"})," to (0,1) and ",i.jsx(s.code,{children:"black_pawn"})," to (1,6)"]}),` +`,i.jsxs(s.li,{children:["Move ",i.jsx(s.code,{children:"white_pawn"})," to (0,3)"]}),` +`,i.jsxs(s.li,{children:["Move ",i.jsx(s.code,{children:"black_pawn"})," to (1,4)"]}),` +`,i.jsxs(s.li,{children:["Move ",i.jsx(s.code,{children:"white_pawn"})," to (1,4)"]}),` +`,i.jsxs(s.li,{children:["Capture ",i.jsx(s.code,{children:"black_pawn"})]}),` +`]}),` +`,i.jsxs(s.p,{children:["To place the pieces, use our ",i.jsx(s.code,{children:"spawn"})," function in our ",i.jsx(s.code,{children:"actions"})," contract. For moving them, use the ",i.jsx(s.code,{children:"move"})," contract. Remember to check if a piece can be captured when using ",i.jsx(s.code,{children:"move"}),"."]}),` +`,i.jsx(s.p,{children:"Before we get to the code, set up your integration test like this:"}),` +`,i.jsxs(s.ul,{children:[` +`,i.jsxs(s.li,{children:["Copy the test below and add it to your ",i.jsx(s.code,{children:"tests/integration.cairo"})," file."]}),` +`]}),` +`,i.jsxs(s.h2,{id:"full-code",children:["Full Code",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#full-code",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"c","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"c","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"mod tests {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use chess::models::piece::{Piece, PieceType, Vec2};"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use dojo::world::IWorldDispatcherTrait;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use chess::tests::units::tests::setup_world;"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use chess::actions::{IActionsDispatcher, IActionsDispatcherTrait};"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" use chess::models::player::{Color};"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" #[test]"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" #["}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"available_gas"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"3000000000000000"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" fn "}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"integration"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"() {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let white "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" starknet::contract_address_const::"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<0x"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"01"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let black "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" starknet::contract_address_const::"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<0x"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"02"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" let"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" (world, actions_system) "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" setup_world"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"();"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //system calls"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let game_id "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" actions_system."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"spawn"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(white, black);"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //White pawn is setup in (0,1)"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let wp_curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Vec2 { x: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", y: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" };"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let a2 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, wp_curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a2.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Pawn, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Pawn in (0,1)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a2.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white color'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a2.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece in (0,1)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //Black pawn is setup in (1,6)"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let bp_curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Vec2 { x: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", y: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"6"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" };"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let b7 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, bp_curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(b7.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Pawn, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Pawn in (1,6)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(b7.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::Black, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be black color'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(b7.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece in (1,6)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //Move White Pawn to (0,3)"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let wp_next_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Vec2 { x: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", y: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"3"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" };"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" actions_system."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"move"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(wp_curr_pos, wp_next_pos, white."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"into"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(), game_id);"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //White pawn is now in (0,3)"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let wp_curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" wp_next_pos;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let a4 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, wp_curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a4.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Pawn, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Pawn in (0,3)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a4.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white color'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(a4.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece in (0,3)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //Move black Pawn to (1,4)"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let bp_next_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Vec2 { x: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", y: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"4"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" };"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" actions_system."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"move"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(bp_curr_pos, bp_next_pos, black."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"into"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(), game_id);"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" //Black pawn is now in (1,4)"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let bp_curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" bp_next_pos;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let b5 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, bp_curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(b5.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Pawn, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Pawn in (1,4)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(b5.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::Black, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be black color'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(b5.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece in (1,4)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" // Move White Pawn to (1,4) and capture black pawn"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" actions_system."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"move"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(wp_curr_pos, bp_curr_pos, white."}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"into"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(), game_id);"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let wp_curr_pos "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" bp_curr_pos;"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" let b5 "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" get"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(world, (game_id, wp_curr_pos), (Piece));"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(b5.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::Pawn, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be Pawn in (1,4)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(b5.color "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"=="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" Color::White, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should be white color'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" assert"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"(b5.piece_type "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"!="}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" PieceType::None, "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"'should have piece in (1,4)'"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:");"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"Keep moving pieces and checking if they're in the right places."}),` +`,i.jsxs(s.h2,{id:"congratulations",children:["Congratulations!",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#congratulations",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"You've made the basic contracts for a chess game using the Dojo engine! This tutorial was just the beginning. There are many ways to make the game better, like optimizing parts, adding checks, or considering special cases. If you want to do more with this chess game, try these challenges:"}),` +`,i.jsxs(s.ul,{children:[` +`,i.jsx(s.li,{children:"Add a checkmate feature. Our game doesn't end now, so decide when it should!"}),` +`,i.jsx(s.li,{children:"Include special moves like castling, En Passant Capture, or Pawn Promotion."}),` +`,i.jsxs(s.li,{children:["Make your own chess rules! You could even create your own version of the ",i.jsx(s.a,{href:"https://immortal.game/",children:"immortal game"})]}),` +`]}),` +`,i.jsxs(s.p,{children:["Lastly, share your project with others in the ",i.jsx(s.a,{href:"https://discord.gg/akd2yfuRS3",children:"Dojo community"}),"!"]})]})}function t(h={}){const{wrapper:s}={...l(),...h.components};return s?i.jsx(s,{...h,children:i.jsx(e,{...h})}):e(h)}export{t as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/README-_8R6Nb1A.js b/dojo-book/docs/dist/assets/README-_8R6Nb1A.js new file mode 100644 index 00000000..4e9330ec --- /dev/null +++ b/dojo-book/docs/dist/assets/README-_8R6Nb1A.js @@ -0,0 +1,18 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const a={title:"Building a Chess Game",description:"undefined"};function n(t){const i={a:"a",div:"div",em:"em",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",...s(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(i.header,{children:e.jsxs(i.h1,{id:"building-a-chess-game",children:["Building a Chess Game",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#building-a-chess-game",children:e.jsx(i.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsx(i.p,{children:e.jsx(i.em,{children:'"I just finished reading The Dojo Book. What should I do next?"'})}),` +`,e.jsx(i.p,{children:'The answers to this question are always "Make something!", sometimes followed by a list of cool projects. This is a great answer for some people, but others might be looking for a little more direction.'}),` +`,e.jsx(i.p,{children:"This guide is intended to fill the gap between heavily directed beginner tutorials and working on your projects. The primary goal here is to get you to write code. The secondary goal is to get you reading documentation."}),` +`,e.jsx(i.p,{children:"If you haven't read the Dojo Book yet, it is highly encouraged for you to do so before starting this project."}),` +`,e.jsxs(i.h2,{id:"what-are-we-building",children:["What are we building?",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-are-we-building",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"We're building an on-chain chess game contract that lets you start a new game and play chess. This guide does not cover every rules of the chess game. You will build step by step as follows:"}),` +`,e.jsxs(i.ol,{children:[` +`,e.jsx(i.li,{children:"A system contract to spawn all the chess pieces"}),` +`,e.jsx(i.li,{children:"A system contract to make pieces move"}),` +`,e.jsx(i.li,{children:"Add some functions to check a legal move"}),` +`,e.jsx(i.li,{children:"Play chess ♟♙ - integration test!"}),` +`]}),` +`,e.jsxs(i.p,{children:["The full code of tutorial is based on ",e.jsx(i.a,{href:"https://github.com/dojoengine/origami/tree/main/examples/chess",children:"this repo"}),"."]}),` +`,e.jsx(i.p,{children:"If this seems too hard, don't worry! This guide is for beginners. If you know some basics about Cairo and Dojo, you're good. We won't make a full chess game with all the rules. We're keeping it simple."}),` +`,e.jsxs(i.h2,{id:"what-after-this-guide",children:["What after this guide?",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-after-this-guide",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"We're making another guide to help design the frontend. This will make our chess game complete."}),` +`,e.jsx(i.p,{children:"After you finish all the four chapters, we can move on to the frontend guide."})]})}function r(t={}){const{wrapper:i}={...s(),...t.components};return i?e.jsx(i,{...t,children:e.jsx(n,{...t})}):n(t)}export{r as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/account-options-z9jbWLBd.js b/dojo-book/docs/dist/assets/account-options-z9jbWLBd.js new file mode 100644 index 00000000..60e29d4c --- /dev/null +++ b/dojo-book/docs/dist/assets/account-options-z9jbWLBd.js @@ -0,0 +1,3 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const r=void 0;function o(t){const n={br:"br",code:"code",em:"em",p:"p",...s(),...t.components};return e.jsxs(n.p,{children:[e.jsx(n.code,{children:"--account-address"})," ",e.jsx(n.em,{children:"ACCOUNT_ADDRESS"}),e.jsx(n.br,{}),` +`,"    The Starknet account address.",e.jsx(n.br,{}),` +`,"    ENV: ",e.jsx(n.code,{children:"DOJO_ACCOUNT_ADDRESS"})]})}function d(t={}){const{wrapper:n}={...s(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(o,{...t})}):o(t)}export{d as default,r as frontmatter}; diff --git a/dojo-book/docs/dist/assets/auth-gB0tTmD1.js b/dojo-book/docs/dist/assets/auth-gB0tTmD1.js new file mode 100644 index 00000000..697927e1 --- /dev/null +++ b/dojo-book/docs/dist/assets/auth-gB0tTmD1.js @@ -0,0 +1,9 @@ +import{u as t,j as i}from"./index-m6NaWekR.js";const d=void 0;function e(h){const s={a:"a",code:"code",div:"div",figure:"figure",h2:"h2",p:"p",pre:"pre",span:"span",...t(),...h.components};return i.jsxs(i.Fragment,{children:[i.jsxs(s.h2,{id:"sozo-auth",children:["sozo auth",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-auth",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:[i.jsx(s.code,{children:"auth"})," is used to manage world authorization."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" auth [OPTIONS] "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"COMMAN"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"D"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --world"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" <"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"WORLD_ADDRES"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"S"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})})})}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"Commands:"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" writer"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Auth a system with the given calldata."})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" help"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Print this message or the help of the given subcommand"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"s"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]})]})})}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# example: writer - auth a system with the given calldata"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# This will auth the spawn system with the writer role for Position component"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" auth writer Moves "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"CONTRACT_ADDRES"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"S"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --world"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" <"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"WORLD_ADDRES"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"S"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})]})})})]})}function n(h={}){const{wrapper:s}={...t(),...h.components};return s?i.jsx(s,{...h,children:i.jsx(e,{...h})}):e(h)}export{n as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/authorization-dlf1GSBt.js b/dojo-book/docs/dist/assets/authorization-dlf1GSBt.js new file mode 100644 index 00000000..8870c6ea --- /dev/null +++ b/dojo-book/docs/dist/assets/authorization-dlf1GSBt.js @@ -0,0 +1,15 @@ +import{u as r,j as e}from"./index-m6NaWekR.js";const o=void 0;function n(i){const t={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",img:"img",p:"p",pre:"pre",span:"span",...r(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsxs(t.h2,{id:"authorization",children:["Authorization",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#authorization",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.blockquote,{children:[` +`,e.jsx(t.p,{children:"Authorization is crucial to a world, just like how authorization is crucial to any smart contract."}),` +`]}),` +`,e.jsxs(t.p,{children:["As discussed in the ",e.jsx(t.a,{href:"/world",children:"World"})," chapter, Autonomous Worlds (AWs) function as sovereign chains nested within a public blockchain. These Worlds are also open to the public. This structure allows anyone to enhance a World by deploying models or systems. However, this openness also introduces security considerations. Similar to Ethereum, interacting with a model's state within a System requires the appropriate authorization from the model owner."]}),` +`,e.jsxs(t.h3,{id:"auth-architecture",children:["Auth Architecture",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#auth-architecture",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.p,{children:["Every time a ",e.jsx(t.code,{children:"set!"})," is called in a ",e.jsx(t.code,{children:"System"}),", the world checks if the ",e.jsx(t.code,{children:"System"})," has authorization to update the model state. Only when the ",e.jsx(t.code,{children:"System"})," possesses the necessary authorization, the ",e.jsx(t.code,{children:"set!"})," is executed. The following diagram illustrates the authorization architecture."]}),` +`,e.jsx(t.p,{children:e.jsx(t.img,{src:"/dojo-auth.png",alt:"Authorization Architecture"})}),` +`,e.jsxs(t.h3,{id:"providing-authorization",children:["Providing Authorization",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#providing-authorization",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.blockquote,{children:[` +`,e.jsxs(t.p,{children:["The deployer of the model is its initial owner. A model owner is able to grant the ",e.jsx(t.code,{children:"owner"})," and ",e.jsx(t.code,{children:"writer"})," roles. Only owners can grant a System the ",e.jsx(t.code,{children:"writer"})," role which allows it to update the model."]}),` +`]}),` +`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"sozo"})," offers a convenient tool to authorize systems."]}),` +`,e.jsx(t.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(t.pre,{tabIndex:"0","data-language":"shell","data-theme":"github-dark-dimmed github-light",children:e.jsx(t.code,{"data-language":"shell","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(t.span,{"data-line":"",children:[e.jsx(t.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(t.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" auth writer Moves spawn"})]})})})}),` +`,e.jsxs(t.p,{children:["This command will generate a ",e.jsx(t.code,{children:"writer"})," authorization for the ",e.jsx(t.code,{children:"spawn"})," system to update the ",e.jsx(t.code,{children:"Moves"})," model."]})]})}function a(i={}){const{wrapper:t}={...r(),...i.components};return t?e.jsx(t,{...i,children:e.jsx(n,{...i})}):n(i)}export{a as default,o as frontmatter}; diff --git a/dojo-book/docs/dist/assets/autonomous-worlds-UrU3SVOV.js b/dojo-book/docs/dist/assets/autonomous-worlds-UrU3SVOV.js new file mode 100644 index 00000000..6c4ed710 --- /dev/null +++ b/dojo-book/docs/dist/assets/autonomous-worlds-UrU3SVOV.js @@ -0,0 +1,26 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const r=void 0;function o(t){const n={a:"a",blockquote:"blockquote",div:"div",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",ul:"ul",...s(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.h2,{id:"autonomous-worlds",children:["Autonomous Worlds",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#autonomous-worlds",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.blockquote,{children:[` +`,e.jsx(n.p,{children:'"Autonomous worlds represent persistent, permissionless, and decentralized open environments that users can freely interact with and contribute to."'}),` +`]}),` +`,e.jsxs(n.p,{children:["The precise definition of Autonomous Worlds (AWs) remains somewhat elusive, as it is more of an abstract concept that has yet to be fully crystallized. Lattice first ",e.jsx(n.a,{href:"https://0xparc.org/blog/autonomous-worlds",children:"introduced"})," the terminology in 2022, but the notion of open worlds operating on the blockchain has been around for a while. The abstraction introduced by MUD served as a catalyst for the market to recognize the potential of these worlds."]}),` +`,e.jsx(n.p,{children:"Autonomous Worlds share notable similarities with blockchains in their fundamental nature. Once established, they persist, maintaining their state throughout the lifespan of the chain. Players can join or leave, and developers can expand these worlds by deploying features in a permissionless manner, much like how contracts are added to a chain. While there is no universally accepted definition for an Autonomous World, we believe that a game must possess at least the following two essential features to be considered as such:"}),` +`,e.jsxs(n.ol,{children:[` +`,e.jsxs(n.li,{children:[` +`,e.jsx(n.p,{children:"Decentralized data availability layer: While the state execution may reside on a centralized layer, it is crucial that the state can be reconstructed if the execution layer ceases to exist. Rollups offer a solution, providing increased capacity execution layers while ensuring data is permanently settled on Ethereum. This guarantees the world's perpetual persistence."}),` +`]}),` +`,e.jsxs(n.li,{children:[` +`,e.jsx(n.p,{children:"Permissionless entry point for expanding the world: The World contract must be capable of accepting new systems and components without requiring permission. While this doesn't imply that every component and system will be utilized, they must adhere to this pattern, ensuring open and unrestricted access for potential enhancements."}),` +`]}),` +`]}),` +`,e.jsx(n.p,{children:`We're firm believers in the potential for Autonomous Worlds to catalyze the exploration of novel forms in the medium provided by zk proofs and blockchain technology. This is not only about games, but also about new forms of artwork, coordination, fun, emerging from tinkering and radical innovation, eventually questioning the very notion of "play" in this brave new decentralized and trustless world.`}),` +`,e.jsxs(n.h3,{id:"homework",children:["Homework",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#homework",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"https://www.wired.com/story/autonomous-worlds-aim-to-free-online-games-from-corporate-control/",children:"Wired - Autonomous Worlds Primer"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"https://0xparc.org/blog/autonomous-worlds",children:"0xParc - Autonomous Worlds (Part 1)"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"https://gubsheep.substack.com/p/the-strongest-crypto-gaming-thesis",children:"Gubsheep - The Strongest Crypto Gaming Thesis"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"https://lattice.xyz/blog/mud-an-engine-for-autonomous-worlds",children:"Lattice - MUD: An engine for Autonomous Worlds"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"https://www.guiltygyoza.xyz/2022/07/game2",children:"Guiltygyoza - Game 2.0"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"https://www.guiltygyoza.xyz/2023/05/composable-engineering",children:"Guiltygyoza - Composable Engineering"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"https://www.thejaymo.net/2022/05/06/wind-up-worlds/",children:"Jay Springett - Wind-up Worlds"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"https://www.are.na/sylve-chevet/on-chain-realities-and-autonomous-worlds",children:"Are.na collection on Autonomous Worlds"})}),` +`]})]})}function a(t={}){const{wrapper:n}={...s(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(o,{...t})}):o(t)}export{a as default,r as frontmatter}; diff --git a/dojo-book/docs/dist/assets/build-9ezMYoJh.js b/dojo-book/docs/dist/assets/build-9ezMYoJh.js new file mode 100644 index 00000000..640863b0 --- /dev/null +++ b/dojo-book/docs/dist/assets/build-9ezMYoJh.js @@ -0,0 +1,3 @@ +import{u as d,j as e}from"./index-m6NaWekR.js";const a=void 0;function n(i){const t={a:"a",code:"code",div:"div",figure:"figure",h2:"h2",p:"p",pre:"pre",span:"span",...d(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsxs(t.h2,{id:"sozo-build",children:["sozo build",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-build",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"build"})," is used to compile the cairo contracts, generating the necessary artifacts for deployment."]}),` +`,e.jsx(t.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(t.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(t.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(t.span,{"data-line":"",children:[e.jsx(t.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(t.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" build"})]})})})})]})}function r(i={}){const{wrapper:t}={...d(),...i.components};return t?e.jsx(t,{...i,children:e.jsx(n,{...i})}):n(i)}export{r as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/c-R3TqCmsF.js b/dojo-book/docs/dist/assets/c-R3TqCmsF.js new file mode 100644 index 00000000..a7ae39da --- /dev/null +++ b/dojo-book/docs/dist/assets/c-R3TqCmsF.js @@ -0,0 +1,2 @@ +import{u as d,j as n}from"./index-m6NaWekR.js";const r={title:"Dojo c",description:"undefined"};function o(t){const e={a:"a",div:"div",h1:"h1",header:"header",p:"p",...d(),...t.components};return n.jsxs(n.Fragment,{children:[n.jsx(e.header,{children:n.jsxs(e.h1,{id:"dojo-c",children:["Dojo c",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojo-c",children:n.jsx(e.div,{"data-autolink-icon":!0})})]})}),` +`,n.jsx(e.p,{children:n.jsx(e.a,{href:"https://github.com/dojoengine/dojo.c",children:"c bindings"})})]})}function c(t={}){const{wrapper:e}={...d(),...t.components};return e?n.jsx(e,{...t,children:n.jsx(o,{...t})}):o(t)}export{c as default,r as frontmatter}; diff --git a/dojo-book/docs/dist/assets/cairo-i-pmMZtw.js b/dojo-book/docs/dist/assets/cairo-i-pmMZtw.js new file mode 100644 index 00000000..37aed83a --- /dev/null +++ b/dojo-book/docs/dist/assets/cairo-i-pmMZtw.js @@ -0,0 +1,22 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const o={title:"Provable games",description:"undefined"};function i(n){const a={a:"a",div:"div",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...t(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(a.header,{children:e.jsxs(a.h1,{id:"provable-games",children:["Provable games",e.jsx(a.a,{"aria-hidden":"true",tabIndex:"-1",href:"#provable-games",children:e.jsx(a.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsxs(a.p,{children:["Provable games demand ",e.jsx(a.a,{href:"https://ethereum.org/en/zero-knowledge-proofs/",children:"zero-knowledge"})," properties for efficient scaling and verification of computations. ",e.jsx(a.a,{href:"https://book.starknet.io/ch01-00-getting-started.html",children:"Cairo"})," addresses this need by providing a generalized language, eliminating the complexity of creating circuits to incorporate ",e.jsx(a.a,{href:"https://consensys.net/blog/developers/introduction-to-zk-snarks/",children:"SNARKs"}),"."]}),` +`,e.jsxs(a.p,{children:[e.jsx(a.strong,{children:"You can simply program in Cairo and your applications become automatically provable"}),"."]}),` +`,e.jsxs(a.p,{children:["Moreover, you can deploy your programs on the ",e.jsx(a.a,{href:"https://medium.com/starkware/cairo-welcome-on-board-1cf3487554f",children:"Cairo Virtual Machine"})," (CVM), which is compatible with Starknet's Layer 2, Starknet appchains, and even in-browser through WebAssembly (WASM)! Dojo aims to supply straightforward ZK primitives to fuel your game development."]}),` +`,e.jsxs(a.p,{children:["For more information about Starknet, Cairo and its tech stack, check out the ",e.jsx(a.a,{href:"https://book.starknet.io/",children:"Starknet & Cairo book"}),"."]}),` +`,e.jsxs(a.h2,{id:"cairo",children:["Cairo",e.jsx(a.a,{"aria-hidden":"true",tabIndex:"-1",href:"#cairo",children:e.jsx(a.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(a.p,{children:"Cairo is an open-source, Turing-complete smart contract language developed by Starkware, designed to power the Validity Rollup Starknet. The language enables highly expressive and verifiable computation, making it well-suited for building scalable and secure applications, including decentralized finance (DeFi) projects."}),` +`,e.jsx(a.p,{children:"Dojo builds on Cairo to create a robust framework for developing Autonomous Worlds (AWs). By leveraging the capabilities of Cairo, Dojo aims to streamline the development process, improve maintainability, and enhance the performance of AWs."}),` +`,e.jsxs(a.p,{children:["A key feature of the Dojo framework is its use of ",e.jsx(a.a,{href:"/cairo/commands",children:"commands"}),". Commands are a design pattern that helps to reduce boilerplate code, resulting in cleaner and more maintainable applications. They achieve this by encapsulating specific actions or operations within self-contained, reusable units."]}),` +`,e.jsx(a.p,{children:"Developers can write commands freely within Systems, and the Cairo compiler takes care of inlining the appropriate functions."}),` +`,e.jsxs(a.h4,{id:"essential-reading",children:["Essential Reading",e.jsx(a.a,{"aria-hidden":"true",tabIndex:"-1",href:"#essential-reading",children:e.jsx(a.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(a.ul,{children:[` +`,e.jsx(a.li,{children:e.jsx(a.a,{href:"https://github.com/cairo-book/cairo-book",children:"Cairo book"})}),` +`,e.jsx(a.li,{children:e.jsx(a.a,{href:"https://github.com/auditless/awesome-cairo",children:"Awesome Cairo"})}),` +`,e.jsx(a.li,{children:e.jsx(a.a,{href:"https://book.starknet.io/",children:"Starknet Book"})}),` +`]}),` +`,e.jsxs(a.h3,{id:"starknet-as-an-l2",children:["Starknet as an L2",e.jsx(a.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starknet-as-an-l2",children:e.jsx(a.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(a.p,{children:"Starknet is a Validity Rollup Layer 2 (L2) solution designed to scale Ethereum. It operates by offering high transaction throughput and low gas costs while maintaining the same level of security as Ethereum Layer 1 (L1). The strategy it uses is akin to solving a sudoku puzzle: verifying a solution is easier than finding the solution from scratch. Similarly, Starknet replaces heavy and costly L1 computation with cheaper L1 verification through the use of STARK proofs computed off-chain."}),` +`,e.jsx(a.p,{children:`In more technical terms, Starknet is a permissionless Validity-Rollup (also known as a "ZK-Rollup") that supports general computation and currently runs as an L2 network over Ethereum. The network's L1 security is guaranteed by its utilization of the STARK cryptographic proof system, which is considered one of the safest and most scalable.`}),` +`,e.jsxs(a.h3,{id:"starknet-as-an-appchain",children:["Starknet as an Appchain",e.jsx(a.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starknet-as-an-appchain",children:e.jsx(a.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(a.p,{children:["Cairo is an isomorphic, general-purpose language, optimized for Zero-Knowledge (ZK) proofs. It's the driving force behind Starknet, Starkex, and appchains. Remarkably, you can also run it in WebAssembly (WASM) to generate proofs on the client-side! Within the dojo toolchain exists ",e.jsx(a.a,{href:"/toolchain/katana/overview",children:"Katana"})," which is a gaming specific sequencer, which is perfectly suited to run a Dojo appchain."]}),` +`,e.jsxs(a.p,{children:["The Dojo team is also working closely with the ",e.jsx(a.a,{href:"https://github.com/keep-starknet-strange/madara",children:"Madara"})," team to enable Starknet appchains to seamlessly run Dojo worlds."]})]})}function s(n={}){const{wrapper:a}={...t(),...n.components};return a?e.jsx(a,{...n,children:e.jsx(i,{...n})}):i(n)}export{s as default,o as frontmatter}; diff --git a/dojo-book/docs/dist/assets/commands-ftWRoUrT.js b/dojo-book/docs/dist/assets/commands-ftWRoUrT.js new file mode 100644 index 00000000..a0e5d894 --- /dev/null +++ b/dojo-book/docs/dist/assets/commands-ftWRoUrT.js @@ -0,0 +1,46 @@ +import{u as a,j as e}from"./index-m6NaWekR.js";const s=void 0;function i(d){const n={a:"a",code:"code",div:"div",em:"em",figure:"figure",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...a(),...d.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.h2,{id:"commands",children:["Commands",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#commands",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.strong,{children:e.jsx(n.em,{children:"TL;DR"})}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsx(n.li,{children:"Commands are shorthand ways to write function calls"}),` +`,e.jsx(n.li,{children:"Commands abstract complex queries into shorthands"}),` +`,e.jsx(n.li,{children:"Commands are similar to rust macros"}),` +`]}),` +`,e.jsx(n.p,{children:"Understanding commands is key to understanding Dojo. You will leverage them heavily within the systems you design."}),` +`,e.jsx(n.p,{children:"Commands in Dojo are generalized functions that are expanded at compile time to facilitate system execution. They provide a convenient way for systems to interact with the world state by abstracting common operations, such as retrieving or updating models, and generating unique IDs. By leveraging these commands, developers can streamline their system implementations and improve code readability."}),` +`,e.jsxs(n.h3,{id:"using-commands",children:["Using commands",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#using-commands",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Commands are used within systems to interact with the world state. They are called using the following syntax:"}),` +`,e.jsxs(n.h3,{id:"the-get-command",children:["The ",e.jsx(n.code,{children:"get!"})," command",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#the-get-command",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["The ",e.jsx(n.code,{children:"get!"})," command is used to retrieve models from the world state:"]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"// world = calling world"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"// caller = key of the entity that called the system"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"// (Position, Moves) = tuple of models to retrieve"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"let (position, moves) = get!(world, caller, (Position, Moves));"})})]})})}),` +`,e.jsxs(n.p,{children:["Here we are retrieving the ",e.jsx(n.code,{children:"Position"})," and ",e.jsx(n.code,{children:"Moves"})," models from the world state. We are also using the ",e.jsx(n.code,{children:"caller"})," to retrieve the models for the current entity."]}),` +`,e.jsxs(n.p,{children:["You can then use ",e.jsx(n.code,{children:"position"})," and ",e.jsx(n.code,{children:"moves"})," as you would as any other Cairo struct."]}),` +`,e.jsxs(n.p,{children:["In the case that your model defines several keys as the ",e.jsx(n.a,{href:"/models",children:"resource example"}),", you must provide a value for each key."]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"let player = get_caller_address();"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"let location = 0x1234;"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"let resource = get!(world, (player, location), (Resource));"})})]})})}),` +`,e.jsxs(n.p,{children:["If you use the ",e.jsx(n.code,{children:"get!"})," command on a model that has never been set before, all the fields that are not ",e.jsx(n.code,{children:"#[key]"})," are equal to 0 in the returned model, which is the default value in the storage."]}),` +`,e.jsxs(n.h3,{id:"the-set-command",children:["The ",e.jsx(n.code,{children:"set!"})," command",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#the-set-command",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["The ",e.jsx(n.code,{children:"set!"})," command is used to update models state."]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"set !(world, ("})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" Moves {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" player: caller, remaining: 10"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" },"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" Position {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" player: caller, x: position.x + 10, y: position.y + 10"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" },"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"));"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"// If the structs are already defined it can also be written as:"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"set!(world, (moves, position));"})})]})})}),` +`,e.jsxs(n.p,{children:["Here we are updating the ",e.jsx(n.code,{children:"Moves"})," and ",e.jsx(n.code,{children:"Position"})," models in the world state using the ",e.jsx(n.code,{children:"caller"})," as the entity id."]}),` +`,e.jsxs(n.h3,{id:"the-emit-command",children:["The ",e.jsx(n.code,{children:"emit!"})," command",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#the-emit-command",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["The ",e.jsx(n.code,{children:"emit!"})," command is used to emit custom events. These events are indexed by ",e.jsx(n.a,{href:"/toolchain/torii/overview",children:"Torii"}),"."]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsx(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"emit!(world, Moved { address: caller, direction });"})})})})}),` +`,e.jsxs(n.p,{children:["This will emit these values which could be captured by a client or you could query these via ",e.jsx(n.a,{href:"/toolchain/torii/overview",children:"Torii"}),"."]}),` +`,e.jsxs(n.h3,{id:"the-delete-command",children:["The ",e.jsx(n.code,{children:"delete!"})," command",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#the-delete-command",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["The ",e.jsx(n.code,{children:"delete!"})," command deletes a model from the db."]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsx(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"delete!(world, Moved { address: caller, direction });"})})})})})]})}function r(d={}){const{wrapper:n}={...a(),...d.components};return n?e.jsx(n,{...d,children:e.jsx(i,{...d})}):i(d)}export{r as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/config-Hs2n6PbU.js b/dojo-book/docs/dist/assets/config-Hs2n6PbU.js new file mode 100644 index 00000000..9b18f9c2 --- /dev/null +++ b/dojo-book/docs/dist/assets/config-Hs2n6PbU.js @@ -0,0 +1,25 @@ +import{u as h,j as i}from"./index-m6NaWekR.js";const l={title:"Config",description:"undefined"};function n(e){const s={a:"a",code:"code",div:"div",figure:"figure",h1:"h1",header:"header",p:"p",pre:"pre",span:"span",...h(),...e.components};return i.jsxs(i.Fragment,{children:[i.jsx(s.header,{children:i.jsxs(s.h1,{id:"config",children:["Config",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#config",children:i.jsx(s.div,{"data-autolink-icon":!0})})]})}),` +`,i.jsxs(s.p,{children:["Dojo worlds are defined in their ",i.jsx(s.code,{children:"Scarb.toml"})," files. This is just a regular ",i.jsx(s.a,{href:"https://docs.swmansion.com/scarb/",children:"Scarb"})," file which is an excellent Cairo package manager and project manager."]}),` +`,i.jsxs(s.p,{children:["Full example of a ",i.jsx(s.code,{children:"Scarb.toml"})," file:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"toml","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"toml","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"package"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"cairo-version = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"2.4.0"'})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"name = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"dojo_examples"'})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"version = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0.4.0"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cairo"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"sierra-replace-ids = "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"true"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dependencies"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# IMPORTANT: Dojo should be pinned to a specific version or else your world might not compile."})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"dojo = { git = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"https://github.com/dojoengine/dojo"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", version = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0.4.1"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"[["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"target"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojo"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]]"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"tool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojo"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"initializer_class_hash = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0xbeef"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"tool"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojo"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"env"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"rpc_url = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"http://localhost:5050/"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Default account for katana with seed = 0"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"account_address = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"private_key = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x1800000000300000180000000000030000000000003006001800006600"'})]})]})})})]})}function d(e={}){const{wrapper:s}={...h(),...e.components};return s?i.jsx(s,{...e,children:i.jsx(n,{...e})}):n(e)}export{d as default,l as frontmatter}; diff --git a/dojo-book/docs/dist/assets/contributing-DkpHwxDe.js b/dojo-book/docs/dist/assets/contributing-DkpHwxDe.js new file mode 100644 index 00000000..550117a5 --- /dev/null +++ b/dojo-book/docs/dist/assets/contributing-DkpHwxDe.js @@ -0,0 +1,4 @@ +import{u as i,j as e}from"./index-m6NaWekR.js";const s={title:"Contributing to the Core",description:"undefined"};function o(n){const t={a:"a",code:"code",div:"div",h1:"h1",h2:"h2",header:"header",p:"p",...i(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(t.header,{children:e.jsxs(t.h1,{id:"contributing-to-the-core",children:["Contributing to the Core",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#contributing-to-the-core",children:e.jsx(t.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsx(t.p,{children:"Dojo is an open-source project, currently in its early development phase, and warmly welcomes contributors."}),` +`,e.jsxs(t.h2,{id:"how-to-contribute",children:["How to Contribute",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#how-to-contribute",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.p,{children:["Head to the ",e.jsx(t.a,{href:"https://github.com/dojoengine/dojo/issues",children:"Github"})," for open issues, if you see an issue that is unassigned, please request in the comments to be assigned to it. If you have an idea for a new feature, please create an issue with the ",e.jsx(t.code,{children:"enhancement"})," tag."]})]})}function a(n={}){const{wrapper:t}={...i(),...n.components};return t?e.jsx(t,{...n,children:e.jsx(o,{...n})}):o(n)}export{a as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/contributors-xNmRd5Bd.js b/dojo-book/docs/dist/assets/contributors-xNmRd5Bd.js new file mode 100644 index 00000000..88e01ecc --- /dev/null +++ b/dojo-book/docs/dist/assets/contributors-xNmRd5Bd.js @@ -0,0 +1,27 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const o=void 0;function n(i){const t={a:"a",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",span:"span",ul:"ul",...s(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsxs(t.h2,{id:"contributing-to-dojo-book",children:["Contributing to Dojo Book",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#contributing-to-dojo-book",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(t.p,{children:"As the Dojo engine progresses and develops, it is essential for the Dojo book to keep pace with these advancements. Updating and refining the book ensures that it remains a relevant and valuable resource for those interested in understanding and utilizing the latest Dojo engine features and capabilities. All help is welcome!"}),` +`,e.jsxs(t.h3,{id:"the-purpose-of-the-book",children:["The purpose of the book",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#the-purpose-of-the-book",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(t.p,{children:"The Dojo book is designed to be a comprehensive resource that caters to users at various levels of experience. It aims to serve as both an introductory guide for those new to Dojo and its ancillary packages, as well as a reference for more experienced users seeking to deepen their understanding of the engine's features and capabilities."}),` +`,e.jsx(t.p,{children:"The book is split into some major chapters:"}),` +`,e.jsxs(t.ul,{children:[` +`,e.jsx(t.li,{children:"Framework Theory"}),` +`,e.jsx(t.li,{children:"Getting Started"}),` +`,e.jsx(t.li,{children:"Building a World"}),` +`]}),` +`,e.jsxs(t.h3,{id:"code-of-conduct",children:["Code of Conduct",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#code-of-conduct",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.p,{children:["The book follows the ",e.jsx(t.a,{href:"https://www.rust-lang.org/policies/code-of-conduct",children:"Rust Code of Conduct"}),"."]}),` +`,e.jsxs(t.h3,{id:"ways-to-contribute",children:["Ways to contribute",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#ways-to-contribute",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.h4,{id:"issues",children:["Issues",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#issues",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(t.p,{children:"If you think that some content is missing or out-of-date, feel free to open an issue. If you find multiple pieces of content lacking, please open up a separate issue for each."}),` +`,e.jsx(t.p,{children:"The issues will then be labeled so other contributors can find chunks of work they are interested in more easily."}),` +`,e.jsx(t.p,{children:"The issue should contain what is missing, or what could be improved, in as much detail as you deem necessary."}),` +`,e.jsxs(t.h4,{id:"pull-requests",children:["Pull requests",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#pull-requests",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(t.p,{children:"Feel free to contribute changes to the book by opening a pull request - anything is welcome, from reformulating a sentence, fixing a typo, to adding new sections or chapters."}),` +`,e.jsx(t.p,{children:"When your pull request is open, other contributors will take a look and may request changes. Do not be discouraged!"}),` +`,e.jsxs(t.h3,{id:"writing-style",children:["Writing style",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#writing-style",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(t.p,{children:"This section documents a few standards for writing used throughout the book."}),` +`,e.jsxs(t.h4,{id:"chapters-start-with-a-second-level-heading",children:["Chapters start with a second level heading",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#chapters-start-with-a-second-level-heading",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(t.p,{children:"We use:"}),` +`,e.jsx(t.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(t.pre,{tabIndex:"0","data-language":"md","data-theme":"github-dark-dimmed github-light",children:e.jsx(t.code,{"data-language":"md","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(t.span,{"data-line":"",children:e.jsx(t.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5","--shiki-dark-font-weight":"bold","--shiki-light-font-weight":"bold"},children:"## Some Page"})})})})}),` +`,e.jsx(t.p,{children:"We do not use:"}),` +`,e.jsx(t.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(t.pre,{tabIndex:"0","data-language":"md","data-theme":"github-dark-dimmed github-light",children:e.jsx(t.code,{"data-language":"md","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(t.span,{"data-line":"",children:e.jsx(t.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5","--shiki-dark-font-weight":"bold","--shiki-light-font-weight":"bold"},children:"# Some Page"})})})})})]})}function r(i={}){const{wrapper:t}={...s(),...i.components};return t?e.jsx(t,{...i,children:e.jsx(n,{...i})}):n(i)}export{r as default,o as frontmatter}; diff --git a/dojo-book/docs/dist/assets/deployments-j27idhgy.js b/dojo-book/docs/dist/assets/deployments-j27idhgy.js new file mode 100644 index 00000000..cb925c83 --- /dev/null +++ b/dojo-book/docs/dist/assets/deployments-j27idhgy.js @@ -0,0 +1,17 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const c=void 0;function d(s){const n={a:"a",code:"code",div:"div",h2:"h2",h3:"h3",p:"p",...t(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.h2,{id:"slot-deployments",children:["slot deployments",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#slot-deployments",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"It allows you the manage your slot deployments."}),` +`,e.jsxs(n.h3,{id:"commands",children:["Commands",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#commands",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"create"}),` +    Create a new deployment.`]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"delete"}),` +    Delete a deployment.`]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"update"}),` +    Update a deployment.`]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"describe"}),` +    Describe a deployment's configuration.`]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"list"}),` +    List all deployments.`]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"logs"}),` +    Fetch logs for a deployment.`]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"help"}),` +    Print this message or the help of the given subcommand(s)`]})]})}function i(s={}){const{wrapper:n}={...t(),...s.components};return n?e.jsx(n,{...s,children:e.jsx(d,{...s})}):d(s)}export{i as default,c as frontmatter}; diff --git a/dojo-book/docs/dist/assets/development-7QOhB7-a.js b/dojo-book/docs/dist/assets/development-7QOhB7-a.js new file mode 100644 index 00000000..d533dafa --- /dev/null +++ b/dojo-book/docs/dist/assets/development-7QOhB7-a.js @@ -0,0 +1 @@ +import{u as d,j as t}from"./index-m6NaWekR.js";const a={title:"Development",description:"undefined"};function o(n){const e={a:"a",div:"div",h1:"h1",header:"header",...d(),...n.components};return t.jsx(e.header,{children:t.jsxs(e.h1,{id:"development",children:["Development",t.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#development",children:t.jsx(e.div,{"data-autolink-icon":!0})})]})})}function i(n={}){const{wrapper:e}={...d(),...n.components};return e?t.jsx(e,{...n,children:t.jsx(o,{...n})}):o(n)}export{i as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/development-fnTH7DD-.js b/dojo-book/docs/dist/assets/development-fnTH7DD-.js new file mode 100644 index 00000000..d533dafa --- /dev/null +++ b/dojo-book/docs/dist/assets/development-fnTH7DD-.js @@ -0,0 +1 @@ +import{u as d,j as t}from"./index-m6NaWekR.js";const a={title:"Development",description:"undefined"};function o(n){const e={a:"a",div:"div",h1:"h1",header:"header",...d(),...n.components};return t.jsx(e.header,{children:t.jsxs(e.h1,{id:"development",children:["Development",t.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#development",children:t.jsx(e.div,{"data-autolink-icon":!0})})]})})}function i(n={}){const{wrapper:e}={...d(),...n.components};return e?t.jsx(e,{...n,children:t.jsx(o,{...n})}):o(n)}export{i as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/dojojs-ZrFOd_Kb.js b/dojo-book/docs/dist/assets/dojojs-ZrFOd_Kb.js new file mode 100644 index 00000000..e96db84e --- /dev/null +++ b/dojo-book/docs/dist/assets/dojojs-ZrFOd_Kb.js @@ -0,0 +1,28 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const r={title:"Dojo.js",description:"undefined"};function a(n){const i={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h1:"h1",h3:"h3",header:"header",p:"p",pre:"pre",span:"span",...t(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(i.header,{children:e.jsxs(i.h1,{id:"dojojs",children:["Dojo.js",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojojs",children:e.jsx(i.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsxs(i.blockquote,{children:[` +`,e.jsx(i.p,{children:"Javascript is a great way to get started with Dojo. It's easy to use, and you can get started in minutes."}),` +`]}),` +`,e.jsxs(i.h3,{id:"dojoenginecore",children:["@dojoengine/core",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojoenginecore",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"This is the lowest level library, and is used by all other downstream libraries. It contains the core functionality of Dojo and exposes the contract interfaces. Use it if you want to build your own library on top of Dojo."}),` +`,e.jsx(i.p,{children:e.jsx(i.a,{href:"https://github.com/dojoengine/packages/tree/main/packages/core",children:"Repository"})}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"console","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"console","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"bun add @dojoengine/core"})})})})}),` +`,e.jsxs(i.h3,{id:"dojoenginecreate-burner",children:["@dojoengine/create-burner",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojoenginecreate-burner",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Create burner is a simple way to incorporate burner wallets into your Dojo app."}),` +`,e.jsx(i.p,{children:e.jsx(i.a,{href:"https://github.com/dojoengine/packages/tree/main/packages/create-burner",children:"Repository"})}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"console","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"console","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"bun add @dojoengine/create-burner"})})})})}),` +`,e.jsxs(i.h3,{id:"dojoengineutils",children:["@dojoengine/utils",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojoengineutils",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"These are utils for helping with interfacing dojo."}),` +`,e.jsx(i.p,{children:e.jsx(i.a,{href:"https://github.com/dojoengine/packages/tree/main/packages/utils",children:"Repository"})}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"console","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"console","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"bun add @dojoengine/utils"})})})})}),` +`,e.jsxs(i.h3,{id:"dojoenginereact",children:["@dojoengine/react",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojoenginereact",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"React hooks for dojo."}),` +`,e.jsx(i.p,{children:e.jsx(i.a,{href:"https://github.com/dojoengine/packages/tree/main/packages/react",children:"Repository"})}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"console","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"console","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"bun add @dojoengine/react"})})})})}),` +`,e.jsxs(i.h3,{id:"dojoenginetorii-client",children:["@dojoengine/torii-client",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojoenginetorii-client",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"The wasm client to access torii via grpc."}),` +`,e.jsx(i.p,{children:e.jsx(i.a,{href:"https://github.com/dojoengine/packages/tree/main/packages/torii-client",children:"Repository"})}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"console","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"console","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"bun add @dojoengine/torii-client"})})})})}),` +`,e.jsxs(i.h3,{id:"dojoenginetorii-wasm",children:["@dojoengine/torii-wasm",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojoenginetorii-wasm",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Torii client for wasm bindings."}),` +`,e.jsx(i.p,{children:e.jsx(i.a,{href:"https://github.com/dojoengine/packages/tree/main/packages/torii-wasm",children:"Repository"})}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"console","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"console","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"bun add @dojoengine/torii-wasm"})})})})})]})}function o(n={}){const{wrapper:i}={...t(),...n.components};return i?e.jsx(i,{...n,children:e.jsx(a,{...n})}):a(n)}export{o as default,r as frontmatter}; diff --git a/dojo-book/docs/dist/assets/dojojs-wYt-TGOs.js b/dojo-book/docs/dist/assets/dojojs-wYt-TGOs.js new file mode 100644 index 00000000..4cb3c6ab --- /dev/null +++ b/dojo-book/docs/dist/assets/dojojs-wYt-TGOs.js @@ -0,0 +1 @@ +import{u as d,j as t}from"./index-m6NaWekR.js";const s={title:"dojo.js",description:"undefined"};function o(n){const e={a:"a",div:"div",h1:"h1",header:"header",...d(),...n.components};return t.jsx(e.header,{children:t.jsxs(e.h1,{id:"dojojs",children:["dojo.js",t.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojojs",children:t.jsx(e.div,{"data-autolink-icon":!0})})]})})}function a(n={}){const{wrapper:e}={...d(),...n.components};return e?t.jsx(e,{...n,children:t.jsx(o,{...n})}):o(n)}export{a as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/dojoup-qpY2zNHi.js b/dojo-book/docs/dist/assets/dojoup-qpY2zNHi.js new file mode 100644 index 00000000..8373acb9 --- /dev/null +++ b/dojo-book/docs/dist/assets/dojoup-qpY2zNHi.js @@ -0,0 +1,41 @@ +import{u as d,j as i}from"./index-m6NaWekR.js";const h={title:"dojoup",description:"undefined"};function a(s){const e={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h1:"h1",h2:"h2",h3:"h3",h5:"h5",header:"header",hr:"hr",p:"p",pre:"pre",span:"span",strong:"strong",...d(),...s.components};return i.jsxs(i.Fragment,{children:[i.jsx(e.header,{children:i.jsxs(e.h1,{id:"dojoup",children:[i.jsx(e.code,{children:"dojoup"}),i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojoup",children:i.jsx(e.div,{"data-autolink-icon":!0})})]})}),` +`,i.jsx(e.p,{children:"Update or revert to a specific Dojo branch with ease."}),` +`,i.jsxs(e.h2,{id:"installing",children:["Installing",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#installing",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"curl"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" -L"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" https://install.dojoengine.org "}),i.jsx(e.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"|"}),i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" bash"})]})})})}),` +`,i.jsxs(e.h2,{id:"usage",children:["Usage",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.p,{children:["To install latest ",i.jsx(e.strong,{children:"stable"})," version:"]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"})})})})}),` +`,i.jsxs(e.blockquote,{children:[` +`,i.jsxs(e.p,{children:["Note: You may have to install ",i.jsx(e.code,{children:"jq"})," to use ",i.jsx(e.code,{children:"dojoup"}),". You can do so with the following commands:"]}),` +`]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsxs(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Debian"})}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sudo"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" apt-get install jq"})]}),` +`,i.jsx(e.span,{"data-line":"",children:" "}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Mac"})}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"brew"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" install jq"})]})]})})}),` +`,i.jsxs(e.p,{children:["To install a specific ",i.jsx(e.strong,{children:"version"})," (in this case the ",i.jsx(e.code,{children:"nightly"})," version):"]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --version"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" nightly"})]})})})}),` +`,i.jsxs(e.p,{children:["To install a specific ",i.jsx(e.strong,{children:"branch"})," (in this case the ",i.jsx(e.code,{children:"release/0.1.0"})," branch's latest commit):"]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --branch"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" release/0.1.0"})]})})})}),` +`,i.jsxs(e.p,{children:["To install a ",i.jsx(e.strong,{children:"fork's main branch"})," (in this case ",i.jsx(e.code,{children:"tarrencev/dojo"}),"'s main branch):"]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --repo"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" tarrencev/dojo"})]})})})}),` +`,i.jsxs(e.p,{children:["To install a ",i.jsx(e.strong,{children:"specific branch in a fork"})," (in this case the ",i.jsx(e.code,{children:"patch-10"})," branch's latest commit in ",i.jsx(e.code,{children:"tarrencev/dojo"}),"):"]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --repo"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" tarrencev/dojo --branch patch-10"})]})})})}),` +`,i.jsxs(e.p,{children:["To install from a ",i.jsx(e.strong,{children:"specific Pull Request"}),":"]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --pr"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 1071"})]})})})}),` +`,i.jsxs(e.p,{children:["To install from a ",i.jsx(e.strong,{children:"specific commit"}),":"]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" -c"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 94"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"bfdb2"})]})})})}),` +`,i.jsxs(e.p,{children:["To install a local directory or repository (e.g. one located at ",i.jsx(e.code,{children:"~/git/dojo"}),", assuming you're in the home directory)"]}),` +`,i.jsxs(e.h5,{id:"note---branch---repo-and---version-flags-are-ignored-during-local-installations",children:["Note: --branch, --repo, and --version flags are ignored during local installations.",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#note---branch---repo-and---version-flags-are-ignored-during-local-installations",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --path"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" ./git/dojo"})]})})})}),` +`,i.jsx(e.hr,{}),` +`,i.jsxs(e.p,{children:[i.jsx(e.strong,{children:"Tip"}),": All flags have a single character shorthand equivalent! You can use ",i.jsx(e.code,{children:"-v"})," instead of ",i.jsx(e.code,{children:"--version"}),", etc."]}),` +`,i.jsx(e.hr,{}),` +`,i.jsxs(e.h3,{id:"precompiled-binaries",children:["Precompiled binaries",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#precompiled-binaries",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.p,{children:["Precompiled binaries are available from the ",i.jsx(e.a,{href:"https://github.com/dojoengine/dojo/releases",children:"GitHub releases page"}),`. +These are better managed by using `,i.jsx(e.a,{href:"#using-dojoup",children:"Dojoup"}),"."]}),` +`,i.jsxs(e.blockquote,{children:[` +`,i.jsxs(e.p,{children:["ℹ️ ",i.jsx(e.strong,{children:"Note"})]}),` +`,i.jsxs(e.p,{children:["If you're on Windows, you will need to install and use ",i.jsx(e.a,{href:"https://gitforwindows.org/",children:"Git BASH"})," or ",i.jsx(e.a,{href:"https://learn.microsoft.com/en-us/windows/wsl/install",children:"WSL"}),`, +as your terminal, since Dojoup currently does not support Powershell or Cmd.`]}),` +`]})]})}function t(s={}){const{wrapper:e}={...d(),...s.components};return e?i.jsx(e,{...s,children:i.jsx(a,{...s})}):a(s)}export{t as default,h as frontmatter}; diff --git a/dojo-book/docs/dist/assets/entities-L9f5z33X.js b/dojo-book/docs/dist/assets/entities-L9f5z33X.js new file mode 100644 index 00000000..39ee5777 --- /dev/null +++ b/dojo-book/docs/dist/assets/entities-L9f5z33X.js @@ -0,0 +1,23 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const d=void 0;function a(t){const n={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",p:"p",pre:"pre",span:"span",...s(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.h2,{id:"entities",children:["Entities",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#entities",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.blockquote,{children:[` +`,e.jsx(n.p,{children:"Entities are the primary key value within the world, to which models can be attached."}),` +`]}),` +`,e.jsxs(n.p,{children:["Different ECS systems handle entities in various ways. In Dojo, entities are treated as a primary key value within the world, to which models can be attached. To illustrate this concept, consider a simple example of a character in a game that has a ",e.jsx(n.code,{children:"Moves"})," and a ",e.jsx(n.code,{children:"Position"})," model."]}),` +`,e.jsx(n.p,{children:"When defining the models for this entity, it is important to note that we do not reference the entity directly. Instead, we simply provide two structs that the entity will contain."}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Models, Drop, Serde)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct Moves {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" #[key]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" player: ContractAddress,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" remaining: u8,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Models, Drop, Serde)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct Health {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" #[key]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" player: ContractAddress,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" x: u32,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" y: u32"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.blockquote,{children:[` +`,e.jsxs(n.p,{children:["ECS Theory: Plenty has been written on ECS systems, to go deeper read ",e.jsx(n.a,{href:"https://github.com/SanderMertens/ecs-faq",children:"ECS-FAQ"})]}),` +`]})]})}function r(t={}){const{wrapper:n}={...s(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(a,{...t})}):a(t)}export{r as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/enum-L_BgoRY6.js b/dojo-book/docs/dist/assets/enum-L_BgoRY6.js new file mode 100644 index 00000000..fa269dc6 --- /dev/null +++ b/dojo-book/docs/dist/assets/enum-L_BgoRY6.js @@ -0,0 +1,47 @@ +import{u as i,j as n}from"./index-m6NaWekR.js";const d=void 0;function s(a){const e={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",p:"p",pre:"pre",span:"span",...i(),...a.components};return n.jsxs(n.Fragment,{children:[n.jsxs(e.h2,{id:"enum",children:["Enum",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#enum",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"Enums are very useful in game design, as they simplify the creation of clean, complex logic."}),` +`,n.jsx(e.p,{children:"You can define an enum as follows:"}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"// This enum simply defines the states of a game."})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Serde, Copy, Drop, Introspect, PartialEq, Print)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"enum GameStatus {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" NotStarted: (),"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Lobby: (),"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" InProgress: (),"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Finished: (),"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"// We define an into trait"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"impl GameStatusFelt252 of Into {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn into(self: GameStatus) -> felt252 {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" match self {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" GameStatus::NotStarted => 0,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" GameStatus::Lobby => 1,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" GameStatus::InProgress => 2,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" GameStatus::Finished => 3,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsx(e.p,{children:"Then within a trait you can create something like this:"}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Model, Copy, Drop, Serde)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Game {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_id: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" status: GameStatus,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[generate_trait]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"impl GameImpl of GameTrait {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn assert_in_progress(self: Game) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:' assert(self.status == GameStatus::InProgress, "Game not started");'})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn assert_lobby(self: Game) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:' assert(self.status == GameStatus::Lobby, "Game not in lobby");'})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn assert_not_started(self: Game) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:' assert(self.status == GameStatus::NotStarted, "Game already started");'})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.blockquote,{children:[` +`,n.jsxs(e.p,{children:["Read more about Cairo enums ",n.jsx(e.a,{href:"https://book.cairo-lang.org/ch06-00-enums-and-pattern-matching.html",children:"here"})]}),` +`]})]})}function r(a={}){const{wrapper:e}={...i(),...a.components};return e?n.jsx(e,{...a,children:n.jsx(s,{...a})}):s(a)}export{r as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/events-015oQFnl.js b/dojo-book/docs/dist/assets/events-015oQFnl.js new file mode 100644 index 00000000..0ef966d6 --- /dev/null +++ b/dojo-book/docs/dist/assets/events-015oQFnl.js @@ -0,0 +1,3 @@ +import{u as i,j as e}from"./index-m6NaWekR.js";const a=void 0;function s(n){const t={a:"a",code:"code",div:"div",figure:"figure",h2:"h2",p:"p",pre:"pre",span:"span",...i(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsxs(t.h2,{id:"sozo-events",children:["sozo events",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-events",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"events"})," is used to queries world events."]}),` +`,e.jsx(t.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(t.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(t.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(t.span,{"data-line":"",children:[e.jsx(t.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(t.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" events"})]})})})})]})}function r(n={}){const{wrapper:t}={...i(),...n.components};return t?e.jsx(t,{...n,children:e.jsx(s,{...n})}):s(n)}export{r as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/events-mCgQQxXl.js b/dojo-book/docs/dist/assets/events-mCgQQxXl.js new file mode 100644 index 00000000..4d9c7b70 --- /dev/null +++ b/dojo-book/docs/dist/assets/events-mCgQQxXl.js @@ -0,0 +1,72 @@ +import{u as d,j as e}from"./index-m6NaWekR.js";const t=void 0;function i(a){const n={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",p:"p",pre:"pre",span:"span",...d(),...a.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.h2,{id:"events",children:["Events",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#events",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Events play a pivotal role in decoding the dynamics of a Dojo world. Every time there's an update to a ",e.jsx(n.code,{children:"Model"}),", the ",e.jsx(n.code,{children:"World"})," contract emits these events. What's even more exciting is that you can craft your own custom events to fit specific needs! Moreover, thanks to ",e.jsx(n.a,{href:"/toolchain/torii/overview",children:"Torii"}),", all these events are seamlessly indexed, ensuring easy and efficient querying."]}),` +`,e.jsxs(n.h3,{id:"model-events",children:["Model Events",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#model-events",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Consider this example of a ",e.jsx(n.code,{children:"Moves"})," model:"]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct Moves {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" #[key]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" player: Address,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" remaining: u32,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.p,{children:["When this model is updated, the ",e.jsx(n.code,{children:"World"})," contract will emit an event with the following structure:"]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct StoreSetRecord {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" table: felt252, // Moves"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" keys: Span, // [player]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" offset: u8, // offset for the value in the table"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" value: Span, // [remaining]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.p,{children:["This will then be captured by ",e.jsx(n.a,{href:"/toolchain/torii/overview",children:"Torii"})," and indexed for querying. This will allow you to then reconstruct the state of your world."]}),` +`,e.jsxs(n.p,{children:["Similarly, when a model is deleted, the ",e.jsx(n.code,{children:"World"})," contract will emit an event with the following structure:"]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct StoreDelRecord {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" table: felt252,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" keys: Span,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.h3,{id:"world-events",children:["World Events",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#world-events",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["The ",e.jsx(n.code,{children:"World"})," contract also emits events when it's initialized and when new models and contracts are registered. These events are emitted with the following structures:"]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct WorldSpawned {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" address: ContractAddress,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" caller: ContractAddress"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct ModelRegistered {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" name: felt252,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" class_hash: ClassHash,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" prev_class_hash: ClassHash"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct ContractDeployed {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" salt: felt252,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" class_hash: ClassHash,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" address: ContractAddress,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct ContractUpgraded {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" class_hash: ClassHash,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" address: ContractAddress,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.p,{children:["These events are also captured by ",e.jsx(n.a,{href:"/toolchain/torii/overview",children:"Torii"})," and indexed for querying."]}),` +`,e.jsxs(n.h3,{id:"custom-events",children:["Custom Events",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#custom-events",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Within your game, emitting custom events can be highly beneficial. Fortunately, there's a handy ",e.jsx(n.code,{children:"emit!"})," command that lets you release events directly from your world. These events are indexed by ",e.jsx(n.a,{href:"/toolchain/torii/overview",children:"Torii"}),"."]}),` +`,e.jsx(n.p,{children:"Use it like so:"}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsx(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"emit!(world, Moved { address, direction });"})})})})}),` +`,e.jsx(n.p,{children:"Include this in your contract and it will emit an event with the following structure:"}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[derive(Drop, starknet::Event)]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"struct Moved {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" address: felt252,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" direction: felt252,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsx(n.p,{children:"Now a full example using a custom event:"}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"fn move(ctx: Context, direction: Direction) {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" let (mut position, mut moves) = get !(world, caller, (Position, Moves));"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" moves.remaining -= 1;"})}),` +`,e.jsx(n.span,{"data-line":"",children:" "}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" let next = next_position(position, direction);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" set !(world, (moves, next));"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" emit !(world, Moved { address: caller, direction });"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.blockquote,{children:[` +`,e.jsxs(n.p,{children:["Note: Read about the ",e.jsx(n.code,{children:"get!"})," and ",e.jsx(n.code,{children:"set!"})," macros in ",e.jsx(n.a,{href:"/commands",children:"Commands"}),"."]}),` +`]})]})}function r(a={}){const{wrapper:n}={...d(),...a.components};return n?e.jsx(n,{...a,children:e.jsx(i,{...a})}):i(a)}export{r as default,t as frontmatter}; diff --git a/dojo-book/docs/dist/assets/example-Q_NunrlP.js b/dojo-book/docs/dist/assets/example-Q_NunrlP.js new file mode 100644 index 00000000..56fb05b8 --- /dev/null +++ b/dojo-book/docs/dist/assets/example-Q_NunrlP.js @@ -0,0 +1,2 @@ +import{u as r,j as e}from"./index-m6NaWekR.js";const s={title:"Example",description:"undefined"};function a(t){const n={a:"a",div:"div",h1:"h1",header:"header",p:"p",...r(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(n.header,{children:e.jsxs(n.h1,{id:"example",children:["Example",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#example",children:e.jsx(n.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsx(n.p,{children:"This is an example page."})]})}function d(t={}){const{wrapper:n}={...r(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(a,{...t})}):a(t)}export{d as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/execute-ySEEuKVc.js b/dojo-book/docs/dist/assets/execute-ySEEuKVc.js new file mode 100644 index 00000000..9d7d4a95 --- /dev/null +++ b/dojo-book/docs/dist/assets/execute-ySEEuKVc.js @@ -0,0 +1,26 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const d=void 0;function s(n){const i={a:"a",br:"br",code:"code",div:"div",em:"em",figure:"figure",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",...t(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsxs(i.h2,{id:"sozo-execute",children:["sozo execute",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-execute",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"execute"})," is used to execute a World's system."]}),` +`,e.jsxs(i.p,{children:["Performing a system execution requires sending a transaction, therefore, ",e.jsx(i.code,{children:"execute"})," expects an account address as well as its respective private key in order to sign the transaction before sending it."]}),` +`,e.jsxs(i.h3,{id:"usage",children:["USAGE",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsxs(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# you can use the name or address of the contract"})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" execute "}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"CONTRAC"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"T"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" <"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"ENTRYPOIN"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"T"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})]})})}),` +`,e.jsxs(i.h3,{id:"options",children:["OPTIONS",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h4,{id:"general-options",children:["General Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#general-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--calldata"})," ",e.jsx(i.em,{children:"CALLDATA"}),e.jsx(i.br,{}),` +`,"    The calldata to be passed to the system that you want to execute.",e.jsx(i.br,{}),` +`,"    Comma separated values e.g., 0x12345,0x69420."]}),` +`,e.jsxs(i.h4,{id:"world-options",children:["World Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#world-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/world-options.md}}"}),` +`,e.jsxs(i.h4,{id:"starknet-options",children:["Starknet Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starknet-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/starknet-options.md}}"}),` +`,e.jsxs(i.h4,{id:"account-options",children:["Account Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#account-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/account-options.md}}"}),` +`,e.jsxs(i.h4,{id:"signer-options---raw",children:["Signer Options - Raw",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#signer-options---raw",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/signer-options-raw.md}}"}),` +`,e.jsxs(i.h4,{id:"signer-options---keystore",children:["Signer Options - Keystore",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#signer-options---keystore",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/signer-options-keystore.md}}"}),` +`,e.jsxs(i.h3,{id:"examples",children:["EXAMPLES",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#examples",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ol,{children:[` +`,e.jsxs(i.li,{children:["Executing the ",e.jsx(i.em,{children:"position"})," system which takes two values (",e.jsx(i.em,{children:"x"}),": 0x77 and ",e.jsx(i.em,{children:"y"}),": 0x44)"]}),` +`]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" execute moving_contract position --calldata "}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x77"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:",0x44"})]})})})})]})}function r(n={}){const{wrapper:i}={...t(),...n.components};return i?e.jsx(i,{...n,children:e.jsx(s,{...n})}):s(n)}export{r as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/faqs-3apNa4yg.js b/dojo-book/docs/dist/assets/faqs-3apNa4yg.js new file mode 100644 index 00000000..189a8359 --- /dev/null +++ b/dojo-book/docs/dist/assets/faqs-3apNa4yg.js @@ -0,0 +1,20 @@ +import{u as o,j as e}from"./index-m6NaWekR.js";const s={title:"FAQs",description:"undefined"};function i(a){const n={a:"a",div:"div",h1:"h1",h4:"h4",header:"header",p:"p",...o(),...a.components};return e.jsxs(e.Fragment,{children:[e.jsx(n.header,{children:e.jsxs(n.h1,{id:"faqs",children:["FAQs",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#faqs",children:e.jsx(n.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsxs(n.h4,{id:"who-owns-dojo",children:["Who owns Dojo?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#who-owns-dojo",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Dojo is strictly open-source and uses the Apache 2.0 license. Anyone can use Dojo for free, and anyone can contribute to the project."}),` +`,e.jsxs(n.h4,{id:"why-dojo",children:["Why Dojo?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#why-dojo",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Dojo was created to solve problems the founders faced when building onchain games. It standardizes the process of building such games and provides a suite of tools to make it easier."}),` +`,e.jsxs(n.h4,{id:"what-is-the-dojo-roadmap",children:["What is the Dojo roadmap?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-is-the-dojo-roadmap",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Dojo is rapidly evolving. You can find open issues on the ",e.jsx(n.a,{href:"https://github.com/dojoengine/dojo/issues",children:"Dojo Github"})," and join the ",e.jsx(n.a,{href:"https://discord.gg/vUN4Xq9Qv6",children:"Discord"})," to get involved. If you have ideas for the project, please open an issue."]}),` +`,e.jsxs(n.h4,{id:"what-is-an-onchain-game",children:["What is an onchain game?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-is-an-onchain-game",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Onchain games are games that exist entirely on a public blockchain network; all states and logic are onchain. Clients (like web browsers) do not exist on the chain but exist purely to interact with and interpret the onchain state."}),` +`,e.jsxs(n.h4,{id:"what-is-an-autonomous-world",children:["What is an autonomous world?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-is-an-autonomous-world",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["An autonomous world is one that exists entirely onchain. It's not controlled by any single entity but is instead governed by the rules set within that world. Dive deeper into the topic here: ",e.jsx(n.a,{href:"/theory/autonomous-worlds",children:"Autonomous Worlds"}),"."]}),` +`,e.jsxs(n.h4,{id:"what-is-cairo",children:["What is Cairo?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-is-cairo",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Cairo is an opensource programming language invented by Starkware. It's a Turing-complete language meant for general-purpose computation. It's a low-level language designed to compile to the Cairo Virtual Machine. Learn more about it here: ",e.jsx(n.a,{href:"/theory/cairo",children:"Cairo"}),"."]}),` +`,e.jsxs(n.h4,{id:"what-is-a-provable-game",children:["What is a provable game?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-is-a-provable-game",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Thanks to the magic of zero-knowledge proofs, we can ensure a game is fair by verifying a zk proof created off-chain. But what does that entail? Consider a game of chess. We aim for an experience where players trust each other's moves. In a straightforward approach — and given the simple rules of chess — if this were in a blockchain environment, every move would be a transaction on the blockchain. This is costly. We just want to know the winner, not every move."}),` +`,e.jsx(n.p,{children:"With zk proofs and client communications, players can establish a state channel, sharing moves off-chain and ensuring their validity. At the end, a zk proof can be submitted to the blockchain to confirm the game's fairness. This constitutes a provable game."}),` +`,e.jsxs(n.h4,{id:"can-dojo-implement-client-side-proofs",children:["Can dojo implement client side proofs?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#can-dojo-implement-client-side-proofs",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"The ability to execute Dojo programs in the browser is entirely plausible and is on our roadmap. Expect q1/q2 in 2024, or if you are a specalist in this jump into the code and help out!"}),` +`,e.jsxs(n.h4,{id:"can-i-deploy-dojo-on-starknet",children:["Can I deploy dojo on Starknet?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#can-i-deploy-dojo-on-starknet",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Yes! Dojo can run on any StarknetVM including the public blockchains. Within the dojo toolchain exists ",e.jsx(n.a,{href:"/toolchain/katana/overview",children:"Katana"})," which is a gaming specific sequencer, which is perfectly suited to Dojo games."]})]})}function r(a={}){const{wrapper:n}={...o(),...a.components};return n?e.jsx(n,{...a,children:e.jsx(i,{...a})}):i(a)}export{r as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/from-source-MHUyfUZR.js b/dojo-book/docs/dist/assets/from-source-MHUyfUZR.js new file mode 100644 index 00000000..f267bf23 --- /dev/null +++ b/dojo-book/docs/dist/assets/from-source-MHUyfUZR.js @@ -0,0 +1,25 @@ +import{u as t,j as i}from"./index-m6NaWekR.js";const h=void 0;function n(e){const s={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",h4:"h4",p:"p",pre:"pre",span:"span",...t(),...e.components};return i.jsxs(i.Fragment,{children:[i.jsxs(s.h2,{id:"building-from-source",children:["Building from source",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#building-from-source",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.blockquote,{children:[` +`,i.jsxs(s.p,{children:["If you are just wanting to play with the toolchain, we strongly suggest following the ",i.jsx(s.a,{href:"/quick-start",children:"Quick Start"})," guide."]}),` +`]}),` +`,i.jsxs(s.h4,{id:"prerequisites",children:["Prerequisites",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#prerequisites",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["You will need the ",i.jsx(s.a,{href:"https://rust-lang.org",children:"Rust"}),` compiler and Cargo, the Rust package manager. +The easiest way to install both is with `,i.jsx(s.a,{href:"https://rustup.rs/",children:i.jsx(s.code,{children:"rustup.rs"})}),"."]}),` +`,i.jsxs(s.p,{children:["On Windows, you will also need a recent version of ",i.jsx(s.a,{href:"https://visualstudio.microsoft.com/downloads/",children:"Visual Studio"}),`, +installed with the "Desktop Development With C++" Workloads option.`]}),` +`,i.jsxs(s.h4,{id:"building",children:["Building",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#building",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["You can either use the different ",i.jsx(s.a,{href:"/toolchain/dojoup",children:"Dojoup"})," flags:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --branch"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" master"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --path"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" path/to/dojo"})]})]})})}),` +`,i.jsx(s.p,{children:"Or, by using a single Cargo command:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cargo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" install --git https://github.com/dojoengine/dojo --force sozo katana torii"})]})})})}),` +`,i.jsxs(s.p,{children:["Or, by manually building from a local copy of the ",i.jsx(s.a,{href:"https://github.com/dojoengine/dojo",children:"Dojo repository"}),":"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# clone the repository"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"git"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" clone https://github.com/dojoengine/dojo.git"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"cd"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" dojo"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# install Sozo"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cargo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" install --path ./crates/sozo --force"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# install Katana"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cargo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" install --path ./crates/katana --force"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# install Torii"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cargo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" run -—bin torii"})]})]})})})]})}function d(e={}){const{wrapper:s}={...t(),...e.components};return s?i.jsx(s,{...e,children:i.jsx(n,{...e})}):n(e)}export{d as default,h as frontmatter}; diff --git a/dojo-book/docs/dist/assets/get-started-z5PBo8ll.js b/dojo-book/docs/dist/assets/get-started-z5PBo8ll.js new file mode 100644 index 00000000..b04c0e37 --- /dev/null +++ b/dojo-book/docs/dist/assets/get-started-z5PBo8ll.js @@ -0,0 +1,52 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const d=void 0;function r(n){const i={a:"a",div:"div",h2:"h2",h4:"h4",img:"img",li:"li",p:"p",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsxs(i.h2,{id:"get-started",children:["Get Started",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#get-started",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Dojo is a thriving community of builders, artists, and deep thinkers, pushing the frontier of what is possible."}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://dojoengine.notion.site/Dojo-Engine-Community-Hub-d316194b998941c48ddf771a4dd5ff08#bcd6a32db1b2406cb6c325f3b700d45a",children:"Community Hub"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://discord.gg/KG9w9BmDrV",children:"Discord"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://twitter.com/dojostarknet",children:"Twitter"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://github.com/dojoengine/awesome-dojo",children:"Awesome Dojo"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://www.dojoengine.org/en/articles/",children:"Dojo Blog"})}),` +`]}),` +`,e.jsxs(i.h2,{id:"ecosystem--studios-powered-by-dojo",children:["Ecosystem & Studios powered by Dojo",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#ecosystem--studios-powered-by-dojo",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:e.jsx(i.img,{src:"/Built%20with.svg",alt:"dojo"})}),` +`,e.jsxs(i.h4,{id:"realms-world",children:["Realms World",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#realms-world",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://discord.gg/realmsworld",children:"discord"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://realms.world/",children:"website"})}),` +`]}),` +`,e.jsxs(i.h4,{id:"briq-world",children:["Briq World",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#briq-world",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://discord.gg/kpvbDCw5pr",children:"discord"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://briq.construction/",children:"website"})}),` +`]}),` +`,e.jsxs(i.h4,{id:"cartridge",children:["Cartridge",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#cartridge",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://discord.gg/cartridge",children:"discord"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://cartridge.gg/",children:"website"})}),` +`]}),` +`,e.jsxs(i.h4,{id:"zkorp",children:["zKorp",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#zkorp",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://twitter.com/zKorp_",children:"twitter"})}),` +`]}),` +`,e.jsxs(i.h2,{id:"templates--libraries",children:["Templates & Libraries",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#templates--libraries",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Templates, libraries or utilities that use Dojo."}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/dojoengine/origami",children:"Origami"})," - Cairo primitives for onchain Gaming"]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/CheDAOLabs/cc-dojo-map",children:"Crypts And Caverns Dojo Map"})," - An Example projects of integrating C&C maps developed by the CHE-DAO team with Dojo."]}),` +`]}),` +`,e.jsxs(i.h2,{id:"awesome-projects",children:["Awesome Projects",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#awesome-projects",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/cartridge-gg/beer-baron",children:"Beer Baron"})," - An dojo onchain simulation masked as a beer brewing game. It is designed to work with 10 - 10,000 players."]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/rkdud007/chess-dojo",children:"Chess Dojo"})," - A chess game built on Dojo."]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/cartridge-gg/rollyourown",children:"Dope Wars: Roll Your Own"})," - An onchain adaptation of the classic Drug Wars game developed by the Cartridge team."]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/cartridge-gg/drive-ai",children:"Drive AI"})," - An onchain driving simulator controlled by a neural network developed by the Cartridge team."]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/dojoengine/emoji-man",children:"Emoji Man"})," - Pac-man inspired onchain game using dojo and phaser."]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/funDAOmental/lootunderworld",children:"Loot Underworld"})," - Excavating the dangerous, endless mysteries of the subterranean in the dark depths of the Realms Autonomous (Under)World."]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/pixelaw/game",children:"PixeLAW"})," - A pixel grid-based Autonomous World with coexisting games (i.e. Paint, Snake, Rock-Paper-Scissors)."]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/BibliothecaDAO/eternum",children:"Realms Autonomous World"})," - The Realms Autonomous World"]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/dojoengine/stark-lander",children:"Stark Lander"})," - Land on the Moon!"]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/Starklandxyz",children:"StarkLand"})," - Full On-chain Multiplayer Online Simulation Game (FOMOSLG) built on Starknet."]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/funDAOmental/underdark",children:"Underdark: Lair of the Slenderduck"})," - An unhinged on-chain generative dungeon skin crawler. Beware the Slenderduck!"]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/z-korp/zdefender-front",children:"zDefender"})," - An onchain tower defense."]}),` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/z-korp/zknight",children:"zKnight"})," - An onchain strategy game"]}),` +`]})]})}function o(n={}){const{wrapper:i}={...s(),...n.components};return i?e.jsx(i,{...n,children:e.jsx(r,{...n})}):r(n)}export{o as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/getting-started-_Glj4CGe.js b/dojo-book/docs/dist/assets/getting-started-_Glj4CGe.js new file mode 100644 index 00000000..f78a10bf --- /dev/null +++ b/dojo-book/docs/dist/assets/getting-started-_Glj4CGe.js @@ -0,0 +1,16 @@ +import{u as i,j as e}from"./index-m6NaWekR.js";const a={title:"Dojo The Provable Game Engine",description:"undefined"};function o(n){const t={a:"a",blockquote:"blockquote",div:"div",h1:"h1",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",ul:"ul",...i(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(t.header,{children:e.jsxs(t.h1,{id:"dojo-the-provable-game-engine",children:["Dojo The Provable Game Engine",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojo-the-provable-game-engine",children:e.jsx(t.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsxs(t.p,{children:["Dojo is a provable game engine built using ",e.jsx(t.a,{href:"https://github.com/starkware-libs/cairo",children:"Cairo"}),". It establishes a standard for game development via smart contracts, blending best practices with streamlined development and deployment tools. With Dojo by your side, you can evolve from initial concept to a fully realized game in days, not weeks."]}),` +`,e.jsxs(t.p,{children:["This book is dedicated to familiarizing you with the Dojo engine and the potential of Provable games. A special section on the ",e.jsx(t.a,{href:"/theory/autonomous-worlds",children:"Theory"})," elucidates this emergent concept of autonomous worlds and Provable games."]}),` +`,e.jsxs(t.ul,{children:[` +`,e.jsx(t.li,{children:e.jsx(t.a,{href:"/getting-started/quick-start",children:"Quickstart"})}),` +`,e.jsx(t.li,{children:e.jsx(t.a,{href:"/theory/what-is-dojo",children:"What is Dojo? "})}),` +`,e.jsx(t.li,{children:e.jsx(t.a,{href:"/cairo/overview",children:"Explore the Architecture"})}),` +`]}),` +`,e.jsxs(t.blockquote,{children:[` +`,e.jsxs(t.p,{children:["Dojo is an open-source onchain gaming project currently in its early development phase, and warmly welcomes contributors. For additional resources, join the community on ",e.jsx(t.a,{href:"https://discord.gg/vUN4Xq9Qv6",children:"Discord"})," and check out the ",e.jsx(t.a,{href:"/misc/contributors",children:"contribution guide"}),"."]}),` +`]}),` +`,e.jsx(t.hr,{}),` +`,e.jsxs(t.h3,{id:"organizational-structure",children:["Organizational Structure",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#organizational-structure",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.p,{children:["Dojo is an open-source initiative, licensed under Apache 2.0, dedicated to promoting and advancing the concept of Autonomous Worlds (AWs). It is spearheaded by ",e.jsx(t.a,{href:"https://cartridge.gg/",children:"Cartridge"}),", ",e.jsx(t.a,{href:"https://bibliothecadao.xyz/",children:"Realms & BibliothecaDAO"}),", ",e.jsx(t.a,{href:"https://briq.construction/",children:"briq"})," and many more ",e.jsx(t.a,{href:"https://github.com/orgs/dojoengine/people",children:"contributors"}),"."]}),` +`,e.jsxs(t.h3,{id:"how-do-i-get-involved",children:["How do I get involved?",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#how-do-i-get-involved",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.p,{children:["Check out our ",e.jsx(t.a,{href:"https://github.com/dojoengine",children:"Github"}),", our ",e.jsx(t.a,{href:"https://twitter.com/dojostarknet",children:"Twitter"}),", ",e.jsx(t.a,{href:"https://discord.gg/vUN4Xq9Qv6",children:"Discord"})," and ",e.jsx(t.a,{href:"https://book.dojoengine.org/misc/contributors.html",children:"contribution guide"})]})]})}function s(n={}){const{wrapper:t}={...i(),...n.components};return t?e.jsx(t,{...n,children:e.jsx(o,{...n})}):o(n)}export{s as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/graphql-KVzmm7by.js b/dojo-book/docs/dist/assets/graphql-KVzmm7by.js new file mode 100644 index 00000000..a65f6e45 --- /dev/null +++ b/dojo-book/docs/dist/assets/graphql-KVzmm7by.js @@ -0,0 +1,314 @@ +import{u as n,j as i}from"./index-m6NaWekR.js";const l=void 0;function a(e){const s={a:"a",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",h4:"h4",h5:"h5",p:"p",pre:"pre",span:"span",...n(),...e.components};return i.jsxs(i.Fragment,{children:[i.jsxs(s.h2,{id:"torii---graphql",children:["Torii - GraphQL",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#torii---graphql",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.h3,{id:"name",children:["Name",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#name",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["In Dojo, you have access to custom queries and subscriptions that are specifically designed to work with the ",i.jsx(s.code,{children:"caller"})," for client applications. GraphQL is the technology that makes this possible."]}),` +`,i.jsx(s.p,{children:"GraphQL is the rising star of backend technologies. It replaces REST as an API design paradigm and is becoming the new standard for exposing the data and functionality of a web server. It allows you to specify exactly what data you want to retrieve, and it delivers that data in a structured JSON format. This flexibility in data retrieval ensures that you get the information you need efficiently and in a format that's easy to work with."}),` +`,i.jsxs(s.h4,{id:"graphql-playground",children:["GraphQL Playground",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#graphql-playground",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["GraphQL Playground is a ",i.jsx(s.code,{children:"GraphQL IDE"})," that allows you to interactively explore the functionality of a GraphQL API by sending queries and mutations to it. It’s somewhat similar to Postman which offers comparable functionality for REST APIs."]}),` +`,i.jsxs(s.h3,{id:"usage",children:["USAGE",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.h4,{id:"pre-requisites",children:["Pre-requisites",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#pre-requisites",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"Make sure torii is running in your local terminal."}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"torii"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --world"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" <"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"WORLD_ADDRES"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"S"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})})})}),` +`,i.jsxs(s.p,{children:["It starts GraphQL server at ",i.jsx(s.code,{children:"http://0.0.0.0:8080/graphql"})]}),` +`,i.jsx(s.p,{children:"After the torii server starts on your local machine, you're ready to make query and subscription operations."}),` +`,i.jsxs(s.h3,{id:"schema-and-query-defintions",children:["Schema and query defintions",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#schema-and-query-defintions",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"Torii generates both the schema and queries at runtime specific to your world. There are mainly two groups of queries, predefined queries and dynamically generated custom queries."}),` +`,i.jsxs(s.p,{children:["Predefined queries like ",i.jsx(s.code,{children:"entities"})," provide a generic entry point to the entities data of the world. Custom queries on the other hand are built according to the models of the world. Each model has a correpsonding ",i.jsx(s.code,{children:"{name}Models"})," query and retrieves the associated model data. For example: ",i.jsx(s.code,{children:"positionModels"}),"."]}),` +`,i.jsx(s.p,{children:"The benefit of custom queries becomes apparent when filtering and sorting is needed. They allow much more finer control of the returned dataset."}),` +`,i.jsxs(s.h3,{id:"query-operation",children:["Query operation",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#query-operation",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["In ",i.jsx(s.a,{href:"/cairo/hello-dojo",children:i.jsx(s.code,{children:"hello-dojo"})})," we fetched some data from the ",i.jsx(s.code,{children:"Moves"})," model. This time let's fetch only ",i.jsx(s.code,{children:"id"}),", ",i.jsx(s.code,{children:"name"}),", ",i.jsx(s.code,{children:"classHash"})," fields from ",i.jsx(s.code,{children:"Position"})," model ."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"query"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" model"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:"id"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Position"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:") {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" id"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" name"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" classHash"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"After you run the query, you will receive an output like this:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"json","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"json","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "model"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Position"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "name"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Position"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "classHash"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x6ffc643cbc4b2fb9c424242b18175a5e142269b45f4463d1cd4dddb7a2e5095"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsxs(s.p,{children:["Great! If you're wondering about the number of fields a ",i.jsx(s.code,{children:"Model"})," has or the details of a ",i.jsx(s.code,{children:"Entities"}),", you can find all the information about the schema definition in the ",i.jsx(s.code,{children:"Documentation Explorer"})," section of the GraphQL IDE. It's your go-to place for exploring the rest of the documentation."]}),` +`,i.jsxs(s.p,{children:["Now lets retrieve more data from ",i.jsx(s.code,{children:"Moves"})," model."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"query"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" movesModels"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" edges"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" node"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" player"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" remaining"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" last_direction"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"After you run the query, you will receive an output like this:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"json","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"json","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "movesModels"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "edges"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "node"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "player"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "remaining"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"10"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "last_direction"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"None"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsxs(s.h4,{id:"transactions",children:["Transactions",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#transactions",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["GraphQL additionally offers an API to fetch transactions emitted from your ",i.jsx(s.code,{children:"world"}),". Presently, you can retrieve ",i.jsx(s.code,{children:"transaction data"})," with the potential for future support of ",i.jsx(s.code,{children:"transaction receipt"}),". Current API includes pagination support, although filtering is not yet supported. Let's explore an example."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"grapql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"grapql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"query{"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" transactions{"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" edges{"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" node{"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" id"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" transactionHash"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" senderAddress"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" calldata"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" totalCount"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})})]})})}),` +`,i.jsxs(s.p,{children:["If you execute this query after you applied ",i.jsx(s.code,{children:"sozo migrate"})," in your ",i.jsx(s.a,{href:"/cairo/hello-dojo",children:i.jsx(s.code,{children:"hello-dojo"})})," example. You will get an output similar to this."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"json","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"json","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "transactions"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "edges"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "node"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x000000000000000000000000000000000000000000000000000000000000000a:0x0000"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "transactionHash"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x2da3d65e223362c72906f97663a4e7dc81ab0bbd04bbde5532a230c1e97d93e"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "senderAddress"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "calldata"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2730079d734ee55315f4f141eaed376bddd8c2133523d223a344c5604e0f7f8"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x0"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x35ec9fd22092dc0c8fc9341e94d5f361924d921c128fa46a0648f2dac519ce4"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2ffecbe8de6c7c10c785a6eb964ee6489f8dcf139000adbe2c0f12d249be7d8"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "node"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x0000000000000000000000000000000000000000000000000000000000000008:0x0000"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "transactionHash"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x2aa02de0e3fa582b3cb6cf9e4371051f44ae2e0d6c94f5c936338ffc8c2ac12"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "senderAddress"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "calldata"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1e7875674bcb09daaf984cbf77264ac98120cb39e6d17522520defcdc347476"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x0"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1e7875674bcb09daaf984cbf77264ac98120cb39e6d17522520defcdc347476"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2e5174b54aef0b99d4685827ffa51488447e1f5607908293d5c715d6bd22433"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x6a11b5b3003a3aa0ae7f8f443e48314cc0bc51eaea7c3ed1c19beb909f5dda3"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "node"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x0000000000000000000000000000000000000000000000000000000000000005:0x0000"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "transactionHash"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x1f03fa7dc5a673f96d53b728785a98d6ff089c182a7bb32735b150e91817e5b"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "senderAddress"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "calldata"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1987cbd17808b9a23693d4de7e246a443cfe37e6e7fbaeabd7d7e6532b07c3d"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x0"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x6"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x6"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0xb3e374b8087dca92601afbb9881fed855ac0d568e3bf878a876fca5ffcb479"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x41d7f42bf7a362f0420aaae66d7a91df981100a039ac116a1d9cb632c74ad27"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x0"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x59f31686991d7cac25a7d4844225b9647c89e3e1e2d03460dbc61e3fbfafc59"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ],"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "totalCount"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"3"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"Now feel free to play around with the query by removing any fields from the selection set and observe the responses sent by the server. It is your turn to create any kind of query for entities and models!"}),` +`,i.jsxs(s.h4,{id:"pagination",children:["Pagination",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#pagination",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"As the entities in your world grows, fetching all of that data at once can become inefficient and slow."}),` +`,i.jsxs(s.p,{children:["Torii provides two methods to address this - cursor or offset/limit based pagination. To keep the return type consistent, both methods will return a ",i.jsx(s.a,{href:"https://relay.dev/graphql/connections.htm#sec-Connection-Types",children:i.jsx(s.code,{children:"Connection"})})," type."]}),` +`,i.jsxs(s.p,{children:["You can read more about graphql pagination ",i.jsx(s.a,{href:"https://graphql.org/learn/pagination",children:"here"}),"."]}),` +`,i.jsxs(s.h5,{id:"cursor",children:["Cursor",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#cursor",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["Cursor based pagination is the most efficient, allowing us to query a subset or slice of the entire set of data. Both forward and backward pagination are supported using a combination of ",i.jsx(s.code,{children:"first, last, before, after"})," input arguments."]}),` +`,i.jsxs(s.p,{children:["Forward pagination uses ",i.jsx(s.code,{children:"first"}),"/",i.jsx(s.code,{children:"after"})," and backward pagination uses ",i.jsx(s.code,{children:"last"}),"/",i.jsx(s.code,{children:"before"}),". ",i.jsx(s.code,{children:"first"}),"/",i.jsx(s.code,{children:"last"})," are integers representing the number of items to return. ",i.jsx(s.code,{children:"after"}),"/",i.jsx(s.code,{children:"before"})," are the cursors to paginate from."]}),` +`,i.jsx(s.p,{children:"Query for first page of 2 entities"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"query"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" entities"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ("}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:"first"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"2"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:") {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" totalCount"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" edges"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" cursor"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" node"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ..."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"Result shows there are 5 entities and returns the first two"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"json","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"json","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "entities"'}),i.jsx(s.span,{style:{"--shiki-dark":"#FF938A","--shiki-light":"#B31D28","--shiki-dark-font-style":"italic","--shiki-light-font-style":"italic"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "totalCount"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"5"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "edges"'}),i.jsx(s.span,{style:{"--shiki-dark":"#FF938A","--shiki-light":"#B31D28","--shiki-dark-font-style":"italic","--shiki-light-font-style":"italic"},children:" ["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#FF938A","--shiki-light":"#B31D28","--shiki-dark-font-style":"italic","--shiki-light-font-style":"italic"},children:" {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "cursor"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Y3Vyc29yX29uZQ=="'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "node"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" : { }"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "cursor"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Y3Vyc29yX3R3bw=="'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "node"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" : { }"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"Query 3 entities after the second node (last 3)"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"query"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" entities"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ("}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:"first"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"3"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", "}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:"after"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Y3Vyc29yX3R3bw=="'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:") {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ..."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsxs(s.h5,{id:"offsetlimit",children:["Offset/limit",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#offsetlimit",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"Offset/limit based pagination can be more intuitive and easier to use. However, for very, very large datasets they can be inefficient."}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# essentially the same as the last query in cursor example"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"query"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" entities"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ("}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:"offset"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"2"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", limit 3) {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ..."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsxs(s.h3,{id:"subscription-operations",children:["Subscription operations",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#subscription-operations",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"Subscriptions are a GraphQL feature that allows a server to send data to its clients when a specific event happens. Subscriptions are usually implemented with WebSockets. In that setup, the server maintains a steady connection to its subscribed client. This also breaks the “Request-Response-Cycle” that is used for with REST APIs."}),` +`,i.jsx(s.p,{children:"Instead, the client initially opens up a long-lived connection to the server by sending a subscription query that specifies which event it is interested in. Every time this particular event happens, the server uses the connection to push the event data to the subscribed client(s)."}),` +`,i.jsxs(s.p,{children:["In this example, you can listen when an ",i.jsx(s.code,{children:"Model"})," is registered by executing this subscription"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"subscription"}),i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:" modelRegistered"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" modelRegistered"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" id"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" name"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"Graphql also supports subscription to a targeted entity or model, for this we have to pass its id as an argument"}),` +`,i.jsxs(s.p,{children:["In this example, our server provides a ",i.jsx(s.code,{children:"entityUpdated"})," subscription, which should notify clients whenever an entity with id ",i.jsx(s.code,{children:"0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20"})," is updated. On the same subscription we can get the model(components) values of the updated entity . A client can execute a subscription that looks like this:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"subscription"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" entityUpdated"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" id"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ) {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" id"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" keys"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" eventId"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" createdAt"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" updatedAt"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" models"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" __typename"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ..."}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" on"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" Moves"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" remaining"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" player"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" ..."}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" on"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" Position"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" vec"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" x"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" y"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"According to your input, you will receive an output like this:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"json","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"json","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "entityUpdated"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "keys"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ],"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "eventId"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x0000000000000000000000000000000000000000000000000000000000000013:0x0000:0x0000"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "createdAt"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"2023-10-17 11:39:42"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "updatedAt"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"2023-10-17 11:52:48"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "models"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "__typename"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Moves"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "remaining"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"10"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "player"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "__typename"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Position"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "vec"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "x"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"10"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "y"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"10"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsxs(s.h4,{id:"susbcription-to-events",children:["Susbcription to events",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#susbcription-to-events",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["A valuable approach for harnessing the power of GraphQL is by actively monitoring the events emitted throughout your game. This allows you to extract essential information such as key values, data, and transaction hashes. These events are customizable and can be filtered based on keys, much like ",i.jsx(s.code,{children:"entities query"}),", and they seamlessly support pagination. In the subsequent example, we will demonstrate how to listen for any event emitted within your program."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"subscription"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" eventEmitted"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" id"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" keys"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" data"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" transactionHash"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsxs(s.p,{children:["If you execute this suscription after you applied ",i.jsx(s.code,{children:"sozo execute spawn"})," in your ",i.jsx(s.a,{href:"/cairo/hello-dojo",children:i.jsx(s.code,{children:"hello-dojo"})})," example. You will get an output similar to this."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"json","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"json","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "eventEmitted"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0000"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "keys"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ],"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x4d6f766573"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x0"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x64"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x0"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ],"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "transactionHash"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x3b7b034a087355c996abb52e363932c1135f8dd49587bc9a05902d3cf0650b"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"-----------------------------------------------------------------------------------------------"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "eventEmitted"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0001"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "keys"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ],"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x506f736974696f6e"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x1"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x0"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x2"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0xa"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0xa"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ],"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "transactionHash"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x3b7b034a087355c996abb52e363932c1135f8dd49587bc9a05902d3cf0650b"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})})]})}function d(e={}){const{wrapper:s}={...n(),...e.components};return s?i.jsx(s,{...e,children:i.jsx(a,{...e})}):a(e)}export{d as default,l as frontmatter}; diff --git a/dojo-book/docs/dist/assets/grpc-QEmJ8ux5.js b/dojo-book/docs/dist/assets/grpc-QEmJ8ux5.js new file mode 100644 index 00000000..778061df --- /dev/null +++ b/dojo-book/docs/dist/assets/grpc-QEmJ8ux5.js @@ -0,0 +1,8 @@ +import{u as r,j as e}from"./index-m6NaWekR.js";const o=void 0;function i(t){const n={a:"a",div:"div",em:"em",h2:"h2",li:"li",p:"p",ul:"ul",...r(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.h2,{id:"grpc",children:["gRPC",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#grpc",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:e.jsx(n.em,{children:"TL;DR"})}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsx(n.li,{children:"gRPC is an efficient way to fetch your data"}),` +`,e.jsx(n.li,{children:"You can subscribe to entity and model events via the gRPC"}),` +`,e.jsxs(n.li,{children:["Read more - ",e.jsx(n.a,{href:"https://grpc.io/docs/what-is-grpc/introduction/",children:"gRPC"})]}),` +`]}),` +`,e.jsxs(n.p,{children:["You can use the gRPC directly or you can use it through a developed client. A great way to use it is via ",e.jsx(n.a,{href:"/client/dojojs",children:"dojo.js"})," torii-client package."]})]})}function c(t={}){const{wrapper:n}={...r(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(i,{...t})}):i(t)}export{c as default,o as frontmatter}; diff --git a/dojo-book/docs/dist/assets/hello-dojo-a29ujx7Y.js b/dojo-book/docs/dist/assets/hello-dojo-a29ujx7Y.js new file mode 100644 index 00000000..3dd89cda --- /dev/null +++ b/dojo-book/docs/dist/assets/hello-dojo-a29ujx7Y.js @@ -0,0 +1,331 @@ +import{u as a,j as i}from"./index-m6NaWekR.js";const l={title:"Hello Dojo",description:"undefined"};function n(e){const s={a:"a",blockquote:"blockquote",code:"code",div:"div",em:"em",figure:"figure",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",span:"span",ul:"ul",...a(),...e.components};return i.jsxs(i.Fragment,{children:[i.jsx(s.header,{children:i.jsxs(s.h1,{id:"hello-dojo",children:["Hello Dojo",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#hello-dojo",children:i.jsx(s.div,{"data-autolink-icon":!0})})]})}),` +`,i.jsxs(s.blockquote,{children:[` +`,i.jsxs(s.p,{children:["This section assumes that you have already installed the Dojo toolchain and are familiar with Cairo. If not, please refer to the ",i.jsx(s.a,{href:"/getting-started/quick-start",children:"Getting Started"})," section."]}),` +`]}),` +`,i.jsxs(s.h2,{id:"dojo-as-an-ecs-in-15-minutes",children:["Dojo as an ECS in 15 Minutes",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojo-as-an-ecs-in-15-minutes",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["Although Dojo isn't exclusively an Entity Component System (ECS) framework, we recommend adopting this robust design pattern. In this context, systems shape the environment's logic, while components (",i.jsx(s.a,{href:"/models",children:"models"}),") mirror the state of the world. By taking this route, you'll benefit from a structured and modular framework that promises both flexibility and scalability in a continuously evolving world. If this seems a bit intricate at first, hang tight; we'll delve into the details shortly."]}),` +`,i.jsx(s.p,{children:"To start, let's set up a project to run locally on your machine. From an empty directory, execute:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"console","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"console","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"sozo init"})})})})}),` +`,i.jsxs(s.p,{children:["Congratulations! You now have a local Dojo project. This command creates a ",i.jsx(s.code,{children:"dojo-starter"})," project in your current directory. It's the ideal starting point for a new project and equips you with everything you need to begin."]}),` +`,i.jsxs(s.h4,{id:"anatomy-of-a-dojo-project",children:["Anatomy of a Dojo Project",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#anatomy-of-a-dojo-project",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["Inspect the contents of the ",i.jsx(s.code,{children:"dojo-starter"})," project, and you'll notice the following structure (excluding the non-Cairo files):"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"src"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" lib.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" systems.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" actions.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" models.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" position.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" moves.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" tests.cairo"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" -"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" test_world.cairo"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"Scarb.toml"})})]})})}),` +`,i.jsx(s.p,{children:"Dojo projects bear a strong resemblance to typical Cairo projects. The primary difference is the inclusion of a special attribute tag used to define your data models. In this context, we'll refer to these models as components."}),` +`,i.jsx(s.p,{children:"As we're crafting an ECS, we'll adhere to the specific terminology associated with Entity Component Systems."}),` +`,i.jsxs(s.p,{children:["Open the ",i.jsx(s.code,{children:"src/models/moves.cairo"})," file to continue."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Model, Drop, Serde)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"struct Moves {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[key]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" player: ContractAddress,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" remaining: u8,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" last_direction: Direction"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"...rest of code"})})]})})}),` +`,i.jsxs(s.p,{children:["Notice the ",i.jsx(s.code,{children:"#[derive(Model, Drop, Serde)]"})," attributes. For a model to be recognized, we ",i.jsx(s.em,{children:"must"})," include ",i.jsx(s.code,{children:"Model"}),". This signals to the Dojo compiler that this struct should be treated as a model."]}),` +`,i.jsxs(s.p,{children:["Our ",i.jsx(s.code,{children:"Moves"})," model houses a ",i.jsx(s.code,{children:"player"})," field. At the same time, we have the ",i.jsx(s.code,{children:"#[key]"})," attribute, it informs Dojo that this model is indexed by the ",i.jsx(s.code,{children:"player"})," field. If this is unfamiliar to you, we'll clarify its importance later in the chapter. Essentially, it implies that you can query this model using the ",i.jsx(s.code,{children:"player"})," field. Our ",i.jsx(s.code,{children:"Moves"})," model also contains the ",i.jsx(s.code,{children:"remaining"})," and ",i.jsx(s.code,{children:"last_direction"})," fields"]}),` +`,i.jsxs(s.p,{children:["Open the ",i.jsx(s.code,{children:"src/models/position.cairo"})," file to continue."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Model, Copy, Drop, Serde)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"struct Position {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[key]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" player: ContractAddress,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" vec: Vec2,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[derive(Copy, Drop, Serde, Introspect)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"struct Vec2 {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" x: u32,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" y: u32"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"...rest of code"})})]})})}),` +`,i.jsxs(s.p,{children:["In a similar vein, we have a ",i.jsx(s.code,{children:"Position"})," model that have a Vec2 data structure. Vec holds ",i.jsx(s.code,{children:"x"})," and ",i.jsx(s.code,{children:"y"})," values. Once again, this model is indexed by the ",i.jsx(s.code,{children:"player"})," field."]}),` +`,i.jsxs(s.p,{children:["Now, let's examine the ",i.jsx(s.code,{children:"src/systems/actions.cairo"})," file:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"// define the interface"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[starknet::interface]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"trait IActions {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" fn spawn(self: @TContractState);"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" fn move(self: @TContractState, direction: dojo_starter::models::moves::Direction);"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"// dojo decorator"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"#[dojo::contract]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"mod actions {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" use super::IActions;"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" use starknet::{ContractAddress, get_caller_address};"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" use dojo_starter::models::{position::{Position, Vec2}, moves::{Moves, Direction}};"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // declaring custom event struct"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[event]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[derive(Drop, starknet::Event)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" enum Event {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Moved: Moved,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // declaring custom event struct"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[derive(Drop, starknet::Event)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" struct Moved {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" player: ContractAddress,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" direction: Direction"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // define functions in your contracts like this:"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" fn next_position(mut position: Position, direction: Direction) -> Position {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" match direction {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Direction::None => { return position; },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Direction::Left => { position.vec.x -= 1; },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Direction::Right => { position.vec.x += 1; },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Direction::Up => { position.vec.y -= 1; },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Direction::Down => { position.vec.y += 1; },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" };"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" position"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // impl: implement functions specified in trait"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" #[abi(embed_v0)]"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" impl ActionsImpl of IActions {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // ContractState is defined by system decorator expansion"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" fn spawn(self: @ContractState) {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Access the world dispatcher for reading."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let world = self.world_dispatcher.read();"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Get the address of the current caller, possibly the player's address."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let player = get_caller_address();"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Retrieve the player's current position from the world."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let position = get!(world, player, (Position));"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Retrieve the player's move data, e.g., how many moves they have left."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let moves = get!(world, player, (Moves));"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Update the world state with the new data."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // 1. Set players moves to 10"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // 2. Move the player's position 100 units in both the x and y direction."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" set!("})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" world,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" ("})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Moves { player, remaining: 100, last_direction: Direction::None },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Position { player, vec: Vec2 { x: 10, y: 10 } },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" )"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" );"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Implementation of the move function for the ContractState struct."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" fn move(self: @ContractState, direction: Direction) {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Access the world dispatcher for reading."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let world = self.world_dispatcher.read();"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Get the address of the current caller, possibly the player's address."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let player = get_caller_address();"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Retrieve the player's current position and moves data from the world."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let (mut position, mut moves) = get!(world, player, (Position, Moves));"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Deduct one from the player's remaining moves."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" moves.remaining -= 1;"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Update the last direction the player moved in."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" moves.last_direction = direction;"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Calculate the player's next position based on the provided direction."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" let next = next_position(position, direction);"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Update the world state with the new moves data and position."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" set!(world, (moves, next));"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" // Emit an event to the world to notify about the player's move."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" emit!(world, Moved { player, direction });"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"}"})})]})})}),` +`,i.jsxs(s.h3,{id:"breaking-it-down",children:["Breaking it down",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#breaking-it-down",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.h4,{id:"system-is-a-function-in-a-contract",children:["System is a function in a contract",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#system-is-a-function-in-a-contract",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["As you can see a ",i.jsx(s.code,{children:"System"})," is like a regular function of a dojo(starknet) contract. It imports the Models we defined earlier and exposes two functions ",i.jsx(s.code,{children:"spawn"})," and ",i.jsx(s.code,{children:"move"}),". These functions are called when a player spawns into the world and when they move respectively."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"// Retrieve the player's current position from the world."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"let position = get!(world, player, (Position));"})}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"// Retrieve the player's move data, e.g., how many moves they have left."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"let moves = get!(world, player, (Moves));"})})]})})}),` +`,i.jsxs(s.p,{children:["Here we use ",i.jsx(s.code,{children:"get!"})," ",i.jsx(s.a,{href:"/commands",children:"command"})," to retrieve the ",i.jsx(s.code,{children:"Position"})," and ",i.jsx(s.code,{children:"Moves"})," model for the ",i.jsx(s.code,{children:"player"})," entity, which is the address of the caller."]}),` +`,i.jsx(s.p,{children:"Now the next line:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"// Update the world state with the new data."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"// 1. Increase the player's remaining moves by 10."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"// 2. Move the player's position 10 units in both the x and y direction."})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:"set!("})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" world,"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" ("})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Moves {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" player, remaining: moves.remaining + 10, last_direction: Direction::None"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" Position {"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" player, vec: Vec2 { x: position.vec.x + 10, y: position.vec.y + 10}"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" },"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:" )"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{children:");"})})]})})}),` +`,i.jsxs(s.p,{children:["Here we use the ",i.jsx(s.code,{children:"set!"})," ",i.jsx(s.a,{href:"/commands",children:"command"})," to set the ",i.jsx(s.code,{children:"Moves"})," and ",i.jsx(s.code,{children:"Position"})," models for the ",i.jsx(s.code,{children:"player"})," entity."]}),` +`,i.jsx(s.p,{children:"We covered a lot here in a short time. Let's recap:"}),` +`,i.jsxs(s.ul,{children:[` +`,i.jsx(s.li,{children:"Explained the anatomy of a Dojo project"}),` +`,i.jsxs(s.li,{children:["Explained the importance of the ",i.jsx(s.code,{children:"#[derive(Model)]"}),"attribute"]}),` +`,i.jsxs(s.li,{children:["Explained the ",i.jsx(s.code,{children:"spawn"})," and ",i.jsx(s.code,{children:"move"})," functions"]}),` +`,i.jsxs(s.li,{children:["Explained the ",i.jsx(s.code,{children:"Moves"})," and ",i.jsx(s.code,{children:"Position"})," struct"]}),` +`,i.jsxs(s.li,{children:["Touched on the ",i.jsx(s.code,{children:"get!"})," and ",i.jsx(s.code,{children:"set!"})," commands"]}),` +`]}),` +`,i.jsxs(s.h3,{id:"run-it-locally",children:["Run it locally!",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#run-it-locally",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"Now that we've covered some theory, let's build the Dojo project! In your primary terminal:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" build"})]})})})}),` +`,i.jsx(s.p,{children:"That compiled the models and system into an artifact that can be deployed! Simple as that!"}),` +`,i.jsxs(s.p,{children:["Now, let's deploy it to ",i.jsx(s.a,{href:"/toolchain/katana/overview",children:"Katana"}),"! First, we need to get Katana running. Open a second terminal and execute:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --disable-fee"})]})})})}),` +`,i.jsxs(s.p,{children:["Success! ",i.jsx(s.a,{href:"/toolchain/katana/overview",children:"Katana"})," should now be running locally on your machine. Now, let's deploy! In your primary terminal, execute:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" migrate"})]})})})}),` +`,i.jsxs(s.p,{children:["This will deploy the artifact to ",i.jsx(s.a,{href:"/toolchain/katana/overview",children:"Katana"}),". You should see terminal output similar to this:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"Migration"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" account: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"World"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" name: dojo_examples"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"1"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"] 🌎 Building World state...."})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" No"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" remote World found"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"2"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"] 🧰 Evaluating Worlds diff...."})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Total"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" diffs found: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"5"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"3"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"] 📦 Preparing "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"for"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" migration...."})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Total"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" items to be migrated "}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"5"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:": New "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"5"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Update "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Executor"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Contract"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" address: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x59f31686991d7cac25a7d4844225b9647c89e3e1e2d03460dbc61e3fbfafc59"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Base Contract"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Class"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Hash: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# World"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Contract"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" address: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Models (2)"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"Moves"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Class"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" hash: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x509a65bd8cc5516176a694a3b3c809011f1f0680959c567b3189e60ddab7ce1"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"Position"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Class"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" hash: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x52a1da1853c194683ca5d6d154452d0654d23f2eacd4267c555ff2338e144d6"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Registered"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" at: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x82d996aab290f086314745685c6f05bd69730d46589339763202de5264b1b6"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Contracts (1)"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"actions"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Contract"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" address: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"🎉"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Successfully migrated World at address "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"✨"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Updating manifest.json..."})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"✨"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Done."})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "})]})})}),` +`,i.jsxs(s.p,{children:["Your 🌎 is now deployed at ",i.jsx(s.code,{children:"0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138"}),"!"]}),` +`,i.jsx(s.p,{children:"This establishes the world address for your project."}),` +`,i.jsxs(s.p,{children:["Let's discuss the ",i.jsx(s.code,{children:"Scarb.toml"})," file in the project. This file contains environment variables that make running CLI commands in your project a breeze (read more about it ",i.jsx(s.a,{href:"/config",children:"here"}),"). Make sure your file specifies the version of Dojo you have installed! In this case version ",i.jsx(s.code,{children:"0.4.4"}),"."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"toml","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"toml","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dependencies"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"dojo = { git = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"https://github.com/dojoengine/dojo"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", version = "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0.4.4"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})]})]})})}),` +`,i.jsxs(s.h3,{id:"indexing",children:["Indexing",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#indexing",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:["With your local world address established, let's delve into indexing. You can index the entire world. To accomplish this we have to copy your ",i.jsx(s.code,{children:"world address"})," from the output of ",i.jsx(s.code,{children:"sozo migrate"}),". Now Open a new terminal and input this simple command that includes your own world address:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"torii"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --world"}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138"})]})})})}),` +`,i.jsxs(s.p,{children:["Running the command mentioned above starts a ",i.jsx(s.a,{href:"/toolchain/torii/overview",children:"Torii"})," server on your local machine. This server uses SQLite as its database and is accessible at ",i.jsx(s.a,{href:"http://0.0.0.0:8080/graphql",children:"http://0.0.0.0:8080/graphql"}),". ",i.jsx(s.a,{href:"/toolchain/torii/overview",children:"Torii"})," will automatically organize your data into tables, making it easy for you to perform queries using GraphQL. When you run the command, you'll see terminal output that looks something like this:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.184233Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii::server: 🚀 Torii listening at http://0.0.0.0:8080"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.184244Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii::server: Graphql playground: http://0.0.0.0:8080/graphql"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.185648Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.186129Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"1"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.186720Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"2"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.187202Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"3"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.187674Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"4"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.188215Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"5"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.188611Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"6"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.188985Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"7"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.199592Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::processors::register_model: Registered model: Moves"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.210032Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::processors::register_model: Registered model: Position"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.210571Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"8"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.211678Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"9"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"2023-10-18T06:49:48.212335Z"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" INFO torii_core::engine: processed block: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"10"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "})]})})}),` +`,i.jsxs(s.p,{children:["You can observe that our ",i.jsx(s.code,{children:"Moves"})," and ",i.jsx(s.code,{children:"Position"}),` models have been successfully registered. +Next, let's use the GraphiQL IDE to retrieve data from the `,i.jsx(s.code,{children:"Moves"})," model. In your web browser, navigate to ",i.jsx(s.code,{children:"http://0.0.0.0:8080/graphql"}),", and enter the following query:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"query"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" model"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:"id"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Moves"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:") {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" id"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" name"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" classHash"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" transactionHash"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" createdAt"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"After you run the query, you will receive an output like this:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"json","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"json","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "model"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Moves"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "name"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"Moves"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "classHash"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x64495ca6dc1dc328972697b30468cea364bcb7452bbb6e4aaad3e4b3f190147"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "transactionHash"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'""'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "createdAt"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"2023-12-15 18:07:22"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"Awesome, now let's work with subscriptions to get real-time updates. Let's clean up your workspace on the GraphiQL IDE and input the following subscription:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"graphql","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"graphql","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#DCBDFB","--shiki-light":"#6F42C1"},children:"subscription"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" entityUpdated"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" {"})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" id"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" keys"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" eventId"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" createdAt"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#E36209"},children:" updatedAt"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsx(s.p,{children:"Once you execute the subscription, you will receive notifications whenever new entities are updated or created. For now, don't make any changes to it and proceed to create a new entity."}),` +`,i.jsx(s.p,{children:"To accomplish this, we have to go back to our primary terminal and check the contracts section."}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Contracts (1)"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"actions"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >"}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" Contract"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" address: "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd"})]})]})})}),` +`,i.jsxs(s.p,{children:["We have to use ",i.jsx(s.code,{children:"actions"})," contract address to start to create entities. In your main local terminal, run the following command:"]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" execute "}),i.jsx(s.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" spawn"})]})})})}),` +`,i.jsx(s.p,{children:"By running this command, you've activated the spawn system, resulting in the creation of a new entity. This action establishes a local world that you can interact with."}),` +`,i.jsx(s.p,{children:"Now, go back to your GraphiQL IDE, and you will notice that you have received the subscription's results, which should look something like this:"}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"json","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"json","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "entityUpdated"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "keys"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ],"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "eventId"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x000000000000000000000000000000000000000000000000000000000000000e:0x0000:0x0000"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "createdAt"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"2023-12-15 18:07:22"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "updatedAt"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"2023-12-15 18:10:56"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"--------------------------------------------------------------------------------------------------------"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "data"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "entityUpdated"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": {"})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "id"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "keys"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": ["})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" ],"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "eventId"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x000000000000000000000000000000000000000000000000000000000000000e:0x0000:0x0001"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "createdAt"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"2023-12-15 18:07:22"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "updatedAt"'}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"2023-12-15 18:10:56"'})]}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,i.jsxs(s.p,{children:["In the GraphiQL IDE, by clicking the ",i.jsx(s.code,{children:"DOCS"}),"-button on the right, you can open the API documentation. This documentation is auto-generated based on our schema definition and displays all API operations and data types of our schema.. In order to know more about query and subscription, you can jump to ",i.jsx(s.a,{href:"/toolchain/torii/graphql",children:"GraphQL"}),` section. +We've covered quite a bit! Here's a recap:`]}),` +`,i.jsxs(s.ul,{children:[` +`,i.jsx(s.li,{children:"Built a Dojo world"}),` +`,i.jsx(s.li,{children:"Deployed the project to Katana"}),` +`,i.jsx(s.li,{children:"Indexed the world with Torii"}),` +`,i.jsx(s.li,{children:"Ran the spawn system locally"}),` +`,i.jsx(s.li,{children:"Interacted with GraphQL"}),` +`]}),` +`,i.jsxs(s.h3,{id:"next-steps",children:["Next Steps",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#next-steps",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(s.p,{children:"This overview provides a rapid end-to-end glimpse into Dojo. However, the potential of these worlds is vast! Designed to manage hundreds of systems and components, Dojo is equipped for expansive creativity. So, what will you craft next?"})]})}function t(e={}){const{wrapper:s}={...a(),...e.components};return s?i.jsx(s,{...e,children:i.jsx(n,{...e})}):n(e)}export{t as default,l as frontmatter}; diff --git a/dojo-book/docs/dist/assets/index-1gLgsY0X.js b/dojo-book/docs/dist/assets/index-1gLgsY0X.js new file mode 100644 index 00000000..9481824c --- /dev/null +++ b/dojo-book/docs/dist/assets/index-1gLgsY0X.js @@ -0,0 +1 @@ +import{j as e,L as h,c as s,a as _,b as f,R as b,d as P,T as i,C as c,u as x}from"./index-m6NaWekR.js";var H="vocs_Button_button",N="vocs_Button_button_accent";function y({children:n,className:t,href:r,variant:p}){return e.jsx(h,{className:s(t,H,p==="accent"&&N),href:r,variant:"styleless",children:n})}var L="vocs_HomePage_button",C="vocs_HomePage_buttons",M="vocs_HomePage_description",B="vocs_HomePage_logo",l="vocs_HomePage_packageManager",k="vocs_HomePage",D="vocs_HomePage_tabs",u="vocs_HomePage_tabsContent",R="vocs_HomePage_tabsList",$="vocs_HomePage_tagline",w="vocs_HomePage_title";function m({children:n,className:t}){return e.jsx("div",{className:s(t,k),children:n})}function d({className:n}){const{logoUrl:t,title:r}=_();return t?e.jsx("div",{className:s(n,B),children:e.jsx(f,{})}):e.jsx("h1",{className:s(n,w),children:r})}function E({children:n,className:t}){return e.jsx("div",{className:s(t,$),children:n})}function g({children:n,className:t}){return e.jsx("div",{className:s(t,M),children:n})}function v({children:n,className:t}){return e.jsx("div",{className:s(t,C),children:n})}function o(n){return e.jsx(y,{...n,className:s(L,n.className)})}function T({name:n,type:t="install"}){return e.jsxs(b,{className:D,defaultValue:"npm",children:[e.jsxs(P,{className:R,children:[e.jsx(i,{value:"npm",children:"npm"}),e.jsx(i,{value:"pnpm",children:"pnpm"}),e.jsx(i,{value:"yarn",children:"yarn"})]}),e.jsxs(c,{className:u,value:"npm",children:[e.jsx("span",{className:l,children:"npm"})," ",t==="init"?"init":"install"," ",n]}),e.jsxs(c,{className:u,value:"pnpm",children:[e.jsx("span",{className:l,children:"pnpm"})," ",t==="init"?"create":"install"," ",n]}),e.jsxs(c,{className:u,value:"yarn",children:[e.jsx("span",{className:l,children:"yarn"})," ",t==="init"?"create":"install"," ",n]})]})}const G=Object.freeze(Object.defineProperty({__proto__:null,Button:o,Buttons:v,Description:g,InstallPackage:T,Logo:d,Root:m,Tagline:E},Symbol.toStringTag,{value:"Module"})),O={layout:"landing"};function j(n){const t={p:"p",...x(),...n.components};return G||a("HomePage",!1),o||a("HomePage.Button",!0),v||a("HomePage.Buttons",!0),g||a("HomePage.Description",!0),d||a("HomePage.Logo",!0),m||a("HomePage.Root",!0),e.jsxs(m,{children:[e.jsx(d,{}),e.jsx(g,{children:e.jsx(t.p,{children:"Dojo is a community driven open-source, Provable Game Engine, providing a comprehensive toolkit for building verifiable games and autonomous worlds."})}),e.jsxs(v,{children:[e.jsx(o,{href:"/getting-started",variant:"accent",children:e.jsx(t.p,{children:"Get started"})}),e.jsx(o,{href:"https://github.com/dojoengine/dojo.js",children:e.jsx(t.p,{children:"GitHub"})})]})]})}function S(n={}){const{wrapper:t}={...x(),...n.components};return t?e.jsx(t,{...n,children:e.jsx(j,{...n})}):j(n)}function a(n,t){throw new Error("Expected "+(t?"component":"object")+" `"+n+"` to be defined: you likely forgot to import, pass, or provide it.")}export{S as default,O as frontmatter}; diff --git a/dojo-book/docs/dist/assets/index-m6NaWekR.js b/dojo-book/docs/dist/assets/index-m6NaWekR.js new file mode 100644 index 00000000..0ab1040d --- /dev/null +++ b/dojo-book/docs/dist/assets/index-m6NaWekR.js @@ -0,0 +1,123 @@ +function Pu(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var K1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vp={exports:{}},gl={},Bp={exports:{}},ie={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ai=Symbol.for("react.element"),G1=Symbol.for("react.portal"),Y1=Symbol.for("react.fragment"),Q1=Symbol.for("react.strict_mode"),Z1=Symbol.for("react.profiler"),X1=Symbol.for("react.provider"),J1=Symbol.for("react.context"),q1=Symbol.for("react.forward_ref"),ey=Symbol.for("react.suspense"),ty=Symbol.for("react.memo"),ny=Symbol.for("react.lazy"),cf=Symbol.iterator;function ry(e){return e===null||typeof e!="object"?null:(e=cf&&e[cf]||e["@@iterator"],typeof e=="function"?e:null)}var Up={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Hp=Object.assign,Wp={};function yo(e,t,n){this.props=e,this.context=t,this.refs=Wp,this.updater=n||Up}yo.prototype.isReactComponent={};yo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};yo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Kp(){}Kp.prototype=yo.prototype;function $u(e,t,n){this.props=e,this.context=t,this.refs=Wp,this.updater=n||Up}var Ru=$u.prototype=new Kp;Ru.constructor=$u;Hp(Ru,yo.prototype);Ru.isPureReactComponent=!0;var uf=Array.isArray,Gp=Object.prototype.hasOwnProperty,ku={current:null},Yp={key:!0,ref:!0,__self:!0,__source:!0};function Qp(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)Gp.call(t,r)&&!Yp.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1>>1,de=I[oe];if(0>>1;oeo(Ge,Q))Teo(Nt,Ge)?(I[oe]=Nt,I[Te]=Q,oe=Te):(I[oe]=Ge,I[Le]=Q,oe=Le);else if(Teo(Nt,Q))I[oe]=Nt,I[Te]=Q,oe=Te;else break e}}return F}function o(I,F){var Q=I.sortIndex-F.sortIndex;return Q!==0?Q:I.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],u=[],d=1,c=null,f=3,p=!1,x=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(I){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=I)r(u),F.sortIndex=F.expirationTime,t(s,F);else break;F=n(u)}}function E(I){if(y=!1,w(I),!x)if(n(s)!==null)x=!0,re(S);else{var F=n(u);F!==null&&B(E,F.startTime-I)}}function S(I,F){x=!1,y&&(y=!1,m(T),T=-1),p=!0;var Q=f;try{for(w(F),c=n(s);c!==null&&(!(c.expirationTime>F)||I&&!D());){var oe=c.callback;if(typeof oe=="function"){c.callback=null,f=c.priorityLevel;var de=oe(c.expirationTime<=F);F=e.unstable_now(),typeof de=="function"?c.callback=de:c===n(s)&&r(s),w(F)}else r(s);c=n(s)}if(c!==null)var dt=!0;else{var Le=n(u);Le!==null&&B(E,Le.startTime-F),dt=!1}return dt}finally{c=null,f=Q,p=!1}}var C=!1,b=null,T=-1,$=5,A=-1;function D(){return!(e.unstable_now()-A<$)}function M(){if(b!==null){var I=e.unstable_now();A=I;var F=!0;try{F=b(!0,I)}finally{F?W():(C=!1,b=null)}}else C=!1}var W;if(typeof v=="function")W=function(){v(M)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,Z=V.port2;V.port1.onmessage=M,W=function(){Z.postMessage(null)}}else W=function(){_(M,0)};function re(I){b=I,C||(C=!0,W())}function B(I,F){T=_(function(){I(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_continueExecution=function(){x||p||(x=!0,re(S))},e.unstable_forceFrameRate=function(I){0>I||125oe?(I.sortIndex=Q,t(u,I),n(s)===null&&I===n(u)&&(y?(m(T),T=-1):y=!0,B(E,Q-oe))):(I.sortIndex=de,t(s,I),x||p||(x=!0,re(S))),I},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(I){var F=f;return function(){var Q=f;f=F;try{return I.apply(this,arguments)}finally{f=Q}}}})(em);qp.exports=em;var vy=qp.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var tm=h,yt=vy;function L(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ec=Object.prototype.hasOwnProperty,gy=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ff={},hf={};function yy(e){return ec.call(hf,e)?!0:ec.call(ff,e)?!1:gy.test(e)?hf[e]=!0:(ff[e]=!0,!1)}function xy(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function wy(e,t,n,r){if(t===null||typeof t>"u"||xy(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ot(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ke[e]=new ot(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ke[t]=new ot(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ke[e]=new ot(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ke[e]=new ot(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ke[e]=new ot(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ke[e]=new ot(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ke[e]=new ot(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ke[e]=new ot(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ke[e]=new ot(e,5,!1,e.toLowerCase(),null,!1,!1)});var Au=/[\-:]([a-z])/g;function Ou(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Au,Ou);Ke[t]=new ot(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Au,Ou);Ke[t]=new ot(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Au,Ou);Ke[t]=new ot(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ke[e]=new ot(e,1,!1,e.toLowerCase(),null,!1,!1)});Ke.xlinkHref=new ot("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ke[e]=new ot(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lu(e,t,n,r){var o=Ke.hasOwnProperty(t)?Ke[t]:null;(o!==null?o.type!==0:r||!(2l||o[a]!==i[l]){var s=` +`+o[a].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=a&&0<=l);break}}}finally{os=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Go(e):""}function _y(e){switch(e.tag){case 5:return Go(e.type);case 16:return Go("Lazy");case 13:return Go("Suspense");case 19:return Go("SuspenseList");case 0:case 2:case 15:return e=is(e.type,!1),e;case 11:return e=is(e.type.render,!1),e;case 1:return e=is(e.type,!0),e;default:return""}}function oc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fr:return"Fragment";case jr:return"Portal";case tc:return"Profiler";case Iu:return"StrictMode";case nc:return"Suspense";case rc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case om:return(e.displayName||"Context")+".Consumer";case rm:return(e._context.displayName||"Context")+".Provider";case Du:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Mu:return t=e.displayName||null,t!==null?t:oc(e.type)||"Memo";case Pn:t=e._payload,e=e._init;try{return oc(e(t))}catch{}}return null}function Ey(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oc(t);case 8:return t===Iu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function am(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cy(e){var t=am(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qi(e){e._valueTracker||(e._valueTracker=Cy(e))}function lm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=am(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ic(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function sm(e,t){t=t.checked,t!=null&&Lu(e,"checked",t,!1)}function ac(e,t){sm(e,t);var n=Vn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?lc(e,t.type,n):t.hasOwnProperty("defaultValue")&&lc(e,t.type,Vn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function lc(e,t,n){(t!=="number"||Fa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yo=Array.isArray;function Jr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Zi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ci(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Sy=["Webkit","ms","Moz","O"];Object.keys(Jo).forEach(function(e){Sy.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jo[t]=Jo[e]})});function fm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jo.hasOwnProperty(e)&&Jo[e]?(""+t).trim():t+"px"}function hm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=fm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var by=Se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function uc(e,t){if(t){if(by[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function dc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fc=null;function ju(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hc=null,qr=null,eo=null;function xf(e){if(e=Ii(e)){if(typeof hc!="function")throw Error(L(280));var t=e.stateNode;t&&(t=El(t),hc(e.stateNode,e.type,t))}}function pm(e){qr?eo?eo.push(e):eo=[e]:qr=e}function mm(){if(qr){var e=qr,t=eo;if(eo=qr=null,xf(e),t)for(e=0;e>>=0,e===0?32:31-(Dy(e)/My|0)|0}var Xi=64,Ji=4194304;function Qo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ua(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~o;l!==0?r=Qo(l):(i&=a,i!==0&&(r=Qo(i)))}else a=n&~o,a!==0?r=Qo(a):i!==0&&(r=Qo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Oi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ft(t),e[t]=n}function Vy(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ei),$f=" ",Rf=!1;function Im(e,t){switch(e){case"keyup":return mx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function gx(e,t){switch(e){case"compositionend":return Dm(t);case"keypress":return t.which!==32?null:(Rf=!0,$f);case"textInput":return e=t.data,e===$f&&Rf?null:e;default:return null}}function yx(e,t){if(zr)return e==="compositionend"||!Ku&&Im(e,t)?(e=Om(),ba=Uu=Nn=null,zr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Of(n)}}function zm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vm(){for(var e=window,t=Fa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fa(e.document)}return t}function Gu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Px(e){var t=Vm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&zm(n.ownerDocument.documentElement,n)){if(r!==null&&Gu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Lf(n,i);var a=Lf(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Vr=null,xc=null,ni=null,wc=!1;function If(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wc||Vr==null||Vr!==Fa(r)||(r=Vr,"selectionStart"in r&&Gu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ni&&mi(ni,r)||(ni=r,r=Ka(xc,"onSelect"),0Hr||(e.current=Tc[Hr],Tc[Hr]=null,Hr--)}function me(e,t){Hr++,Tc[Hr]=e.current,e.current=t}var Bn={},Xe=Qn(Bn),st=Qn(!1),fr=Bn;function lo(e,t){var n=e.type.contextTypes;if(!n)return Bn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ct(e){return e=e.childContextTypes,e!=null}function Ya(){ge(st),ge(Xe)}function Bf(e,t,n){if(Xe.current!==Bn)throw Error(L(168));me(Xe,t),me(st,n)}function Zm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(L(108,Ey(e)||"Unknown",o));return Se({},n,r)}function Qa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bn,fr=Xe.current,me(Xe,e),me(st,st.current),!0}function Uf(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=Zm(e,t,fr),r.__reactInternalMemoizedMergedChildContext=e,ge(st),ge(Xe),me(Xe,e)):ge(st),me(st,n)}var tn=null,Cl=!1,xs=!1;function Xm(e){tn===null?tn=[e]:tn.push(e)}function Fx(e){Cl=!0,Xm(e)}function Zn(){if(!xs&&tn!==null){xs=!0;var e=0,t=ce;try{var n=tn;for(ce=1;e>=a,o-=a,nn=1<<32-Ft(t)+o|n<T?($=b,b=null):$=b.sibling;var A=f(m,b,w[T],E);if(A===null){b===null&&(b=$);break}e&&b&&A.alternate===null&&t(m,b),v=i(A,v,T),C===null?S=A:C.sibling=A,C=A,b=$}if(T===w.length)return n(m,b),_e&&tr(m,T),S;if(b===null){for(;TT?($=b,b=null):$=b.sibling;var D=f(m,b,A.value,E);if(D===null){b===null&&(b=$);break}e&&b&&D.alternate===null&&t(m,b),v=i(D,v,T),C===null?S=D:C.sibling=D,C=D,b=$}if(A.done)return n(m,b),_e&&tr(m,T),S;if(b===null){for(;!A.done;T++,A=w.next())A=c(m,A.value,E),A!==null&&(v=i(A,v,T),C===null?S=A:C.sibling=A,C=A);return _e&&tr(m,T),S}for(b=r(m,b);!A.done;T++,A=w.next())A=p(b,m,T,A.value,E),A!==null&&(e&&A.alternate!==null&&b.delete(A.key===null?T:A.key),v=i(A,v,T),C===null?S=A:C.sibling=A,C=A);return e&&b.forEach(function(M){return t(m,M)}),_e&&tr(m,T),S}function _(m,v,w,E){if(typeof w=="object"&&w!==null&&w.type===Fr&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Yi:e:{for(var S=w.key,C=v;C!==null;){if(C.key===S){if(S=w.type,S===Fr){if(C.tag===7){n(m,C.sibling),v=o(C,w.props.children),v.return=m,m=v;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Pn&&Zf(S)===C.type){n(m,C.sibling),v=o(C,w.props),v.ref=Io(m,C,w),v.return=m,m=v;break e}n(m,C);break}else t(m,C);C=C.sibling}w.type===Fr?(v=ur(w.props.children,m.mode,E,w.key),v.return=m,m=v):(E=Oa(w.type,w.key,w.props,null,m.mode,E),E.ref=Io(m,v,w),E.return=m,m=E)}return a(m);case jr:e:{for(C=w.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(m,v.sibling),v=o(v,w.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=Ps(w,m.mode,E),v.return=m,m=v}return a(m);case Pn:return C=w._init,_(m,v,C(w._payload),E)}if(Yo(w))return x(m,v,w,E);if(ko(w))return y(m,v,w,E);ia(m,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(m,v.sibling),v=o(v,w),v.return=m,m=v):(n(m,v),v=Ts(w,m.mode,E),v.return=m,m=v),a(m)):n(m,v)}return _}var co=iv(!0),av=iv(!1),Di={},Qt=Qn(Di),xi=Qn(Di),wi=Qn(Di);function ir(e){if(e===Di)throw Error(L(174));return e}function nd(e,t){switch(me(wi,t),me(xi,e),me(Qt,Di),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:cc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=cc(t,e)}ge(Qt),me(Qt,t)}function uo(){ge(Qt),ge(xi),ge(wi)}function lv(e){ir(wi.current);var t=ir(Qt.current),n=cc(t,e.type);t!==n&&(me(xi,e),me(Qt,n))}function rd(e){xi.current===e&&(ge(Qt),ge(xi))}var Ee=Qn(0);function tl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ws=[];function od(){for(var e=0;en?n:4,e(!0);var r=_s.transition;_s.transition={};try{e(!1),t()}finally{ce=n,_s.transition=r}}function Cv(){return $t().memoizedState}function Ux(e,t,n){var r=Fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Sv(e))bv(t,n);else if(n=tv(e,t,n,r),n!==null){var o=tt();zt(n,e,r,o),Tv(n,t,r)}}function Hx(e,t,n){var r=Fn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sv(e))bv(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(o.hasEagerState=!0,o.eagerState=l,Vt(l,a)){var s=t.interleaved;s===null?(o.next=o,ed(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=tv(e,t,o,r),n!==null&&(o=tt(),zt(n,e,r,o),Tv(n,t,r))}}function Sv(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function bv(e,t){ri=nl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Tv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zu(e,n)}}var rl={readContext:Pt,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useInsertionEffect:Ye,useLayoutEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useMutableSource:Ye,useSyncExternalStore:Ye,useId:Ye,unstable_isNewReconciler:!1},Wx={readContext:Pt,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:Jf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ra(4194308,4,yv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ra(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ra(4,2,e,t)},useMemo:function(e,t){var n=Wt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ux.bind(null,Ce,e),[r.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:Xf,useDebugValue:cd,useDeferredValue:function(e){return Wt().memoizedState=e},useTransition:function(){var e=Xf(!1),t=e[0];return e=Bx.bind(null,e[1]),Wt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ce,o=Wt();if(_e){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),Ve===null)throw Error(L(349));pr&30||uv(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Jf(fv.bind(null,r,i,e),[e]),r.flags|=2048,Ci(9,dv.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Wt(),t=Ve.identifierPrefix;if(_e){var n=rn,r=nn;n=(r&~(1<<32-Ft(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_i++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Kt]=t,e[yi]=r,Iv(e,t,!1,!1),t.stateNode=e;e:{switch(a=dc(n,r),n){case"dialog":ve("cancel",e),ve("close",e),o=r;break;case"iframe":case"object":case"embed":ve("load",e),o=r;break;case"video":case"audio":for(o=0;oho&&(t.flags|=128,r=!0,Do(i,!1),t.lanes=4194304)}else{if(!r)if(e=tl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Do(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!_e)return Qe(t),null}else 2*Ae()-i.renderingStartTime>ho&&n!==1073741824&&(t.flags|=128,r=!0,Do(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ae(),t.sibling=null,n=Ee.current,me(Ee,r?n&1|2:n&1),t):(Qe(t),null);case 22:case 23:return md(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ht&1073741824&&(Qe(t),t.subtreeFlags&6&&(t.flags|=8192)):Qe(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function qx(e,t){switch(Qu(t),t.tag){case 1:return ct(t.type)&&Ya(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return uo(),ge(st),ge(Xe),od(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return rd(t),null;case 13:if(ge(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ge(Ee),null;case 4:return uo(),null;case 10:return qu(t.type._context),null;case 22:case 23:return md(),null;case 24:return null;default:return null}}var la=!1,Ze=!1,ew=typeof WeakSet=="function"?WeakSet:Set,z=null;function Yr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$e(e,t,r)}else n.current=null}function jc(e,t,n){try{n()}catch(r){$e(e,t,r)}}var lh=!1;function tw(e,t){if(_c=Ha,e=Vm(),Gu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,s=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var p;c!==n||o!==0&&c.nodeType!==3||(l=a+o),c!==i||r!==0&&c.nodeType!==3||(s=a+r),c.nodeType===3&&(a+=c.nodeValue.length),(p=c.firstChild)!==null;)f=c,c=p;for(;;){if(c===e)break t;if(f===n&&++u===o&&(l=a),f===i&&++d===r&&(s=a),(p=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=p}n=l===-1||s===-1?null:{start:l,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ec={focusedElem:e,selectionRange:n},Ha=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,_=x.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ot(t.type,y),_);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(E){$e(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return x=lh,lh=!1,x}function oi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&jc(t,n,i)}o=o.next}while(o!==r)}}function Tl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Fc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function jv(e){var t=e.alternate;t!==null&&(e.alternate=null,jv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[yi],delete t[bc],delete t[Mx],delete t[jx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Fv(e){return e.tag===5||e.tag===3||e.tag===4}function sh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ga));else if(r!==4&&(e=e.child,e!==null))for(zc(e,t,n),e=e.sibling;e!==null;)zc(e,t,n),e=e.sibling}function Vc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Vc(e,t,n),e=e.sibling;e!==null;)Vc(e,t,n),e=e.sibling}var Ue=null,Lt=!1;function Sn(e,t,n){for(n=n.child;n!==null;)zv(e,t,n),n=n.sibling}function zv(e,t,n){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(yl,n)}catch{}switch(n.tag){case 5:Ze||Yr(n,t);case 6:var r=Ue,o=Lt;Ue=null,Sn(e,t,n),Ue=r,Lt=o,Ue!==null&&(Lt?(e=Ue,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ue.removeChild(n.stateNode));break;case 18:Ue!==null&&(Lt?(e=Ue,n=n.stateNode,e.nodeType===8?ys(e.parentNode,n):e.nodeType===1&&ys(e,n),hi(e)):ys(Ue,n.stateNode));break;case 4:r=Ue,o=Lt,Ue=n.stateNode.containerInfo,Lt=!0,Sn(e,t,n),Ue=r,Lt=o;break;case 0:case 11:case 14:case 15:if(!Ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&jc(n,t,a),o=o.next}while(o!==r)}Sn(e,t,n);break;case 1:if(!Ze&&(Yr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){$e(n,t,l)}Sn(e,t,n);break;case 21:Sn(e,t,n);break;case 22:n.mode&1?(Ze=(r=Ze)||n.memoizedState!==null,Sn(e,t,n),Ze=r):Sn(e,t,n);break;default:Sn(e,t,n)}}function ch(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ew),t.forEach(function(r){var o=uw.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function At(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=Ae()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rw(r/1960))-r,10e?16:e,An===null)var r=!1;else{if(e=An,An=null,al=0,se&6)throw Error(L(331));var o=se;for(se|=4,z=e.current;z!==null;){var i=z,a=i.child;if(z.flags&16){var l=i.deletions;if(l!==null){for(var s=0;sAe()-hd?cr(e,0):fd|=n),ut(e,t)}function Yv(e,t){t===0&&(e.mode&1?(t=Ji,Ji<<=1,!(Ji&130023424)&&(Ji=4194304)):t=1);var n=tt();e=cn(e,t),e!==null&&(Oi(e,t,n),ut(e,n))}function cw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yv(e,n)}function uw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(L(314))}r!==null&&r.delete(t),Yv(e,n)}var Qv;Qv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lt=!1,Xx(e,t,n);lt=!!(e.flags&131072)}else lt=!1,_e&&t.flags&1048576&&Jm(t,Xa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ka(e,t),e=t.pendingProps;var o=lo(t,Xe.current);no(t,n),o=ad(null,t,r,e,o,n);var i=ld();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ct(r)?(i=!0,Qa(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,td(t),o.updater=Sl,t.stateNode=o,o._reactInternals=t,Nc(t,r,e,n),t=Lc(null,t,r,!0,i,n)):(t.tag=0,_e&&i&&Yu(t),qe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ka(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=fw(r),e=Ot(r,e),o){case 0:t=Oc(null,t,r,e,n);break e;case 1:t=oh(null,t,r,e,n);break e;case 11:t=nh(null,t,r,e,n);break e;case 14:t=rh(null,t,r,Ot(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ot(r,o),Oc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ot(r,o),oh(e,t,r,o,n);case 3:e:{if(Av(t),e===null)throw Error(L(387));r=t.pendingProps,i=t.memoizedState,o=i.element,nv(e,t),el(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=fo(Error(L(423)),t),t=ih(e,t,r,n,o);break e}else if(r!==o){o=fo(Error(L(424)),t),t=ih(e,t,r,n,o);break e}else for(mt=Dn(t.stateNode.containerInfo.firstChild),vt=t,_e=!0,Dt=null,n=av(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===o){t=un(e,t,n);break e}qe(e,t,r,n)}t=t.child}return t;case 5:return lv(t),e===null&&$c(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Cc(r,o)?a=null:i!==null&&Cc(r,i)&&(t.flags|=32),Nv(e,t),qe(e,t,a,n),t.child;case 6:return e===null&&$c(t),null;case 13:return Ov(e,t,n);case 4:return nd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):qe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ot(r,o),nh(e,t,r,o,n);case 7:return qe(e,t,t.pendingProps,n),t.child;case 8:return qe(e,t,t.pendingProps.children,n),t.child;case 12:return qe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,me(Ja,r._currentValue),r._currentValue=a,i!==null)if(Vt(i.value,a)){if(i.children===o.children&&!st.current){t=un(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var s=l.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=on(-1,n&-n),s.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?s.next=s:(s.next=d.next,d.next=s),u.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Rc(i.return,n,t),l.lanes|=n;break}s=s.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(L(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Rc(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}qe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,no(t,n),o=Pt(o),r=r(o),t.flags|=1,qe(e,t,r,n),t.child;case 14:return r=t.type,o=Ot(r,t.pendingProps),o=Ot(r.type,o),rh(e,t,r,o,n);case 15:return Rv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ot(r,o),ka(e,t),t.tag=1,ct(r)?(e=!0,Qa(t)):e=!1,no(t,n),ov(t,r,o),Nc(t,r,o,n),Lc(null,t,r,!0,e,n);case 19:return Lv(e,t,n);case 22:return kv(e,t,n)}throw Error(L(156,t.tag))};function Zv(e,t){return Em(e,t)}function dw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,t,n,r){return new dw(e,t,n,r)}function gd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fw(e){if(typeof e=="function")return gd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Du)return 11;if(e===Mu)return 14}return 2}function zn(e,t){var n=e.alternate;return n===null?(n=bt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Oa(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")gd(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Fr:return ur(n.children,o,i,t);case Iu:a=8,o|=8;break;case tc:return e=bt(12,n,t,o|2),e.elementType=tc,e.lanes=i,e;case nc:return e=bt(13,n,t,o),e.elementType=nc,e.lanes=i,e;case rc:return e=bt(19,n,t,o),e.elementType=rc,e.lanes=i,e;case im:return $l(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rm:a=10;break e;case om:a=9;break e;case Du:a=11;break e;case Mu:a=14;break e;case Pn:a=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=bt(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ur(e,t,n,r){return e=bt(7,e,r,t),e.lanes=n,e}function $l(e,t,n,r){return e=bt(22,e,r,t),e.elementType=im,e.lanes=n,e.stateNode={isHidden:!1},e}function Ts(e,t,n){return e=bt(6,e,null,t),e.lanes=n,e}function Ps(e,t,n){return t=bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hw(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ls(0),this.expirationTimes=ls(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ls(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function yd(e,t,n,r,o,i,a,l,s){return e=new hw(e,t,n,l,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=bt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},td(i),e}function pw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e0)}catch(e){console.error(e)}}e0(),Jp.exports=xt;var _o=Jp.exports;const t0=Gn(_o),xw=Pu({__proto__:null,default:t0},[_o]);var n0,gh=_o;gh.createRoot,n0=gh.hydrateRoot;/** + * @remix-run/router v1.14.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Re(){return Re=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function gr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _w(){return Math.random().toString(36).substr(2,8)}function xh(e,t){return{usr:e.state,key:e.key,idx:t}}function bi(e,t,n,r){return n===void 0&&(n=null),Re({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?vn(t):t,{state:n,key:t&&t.key||r||_w()})}function yr(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function vn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Ew(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=ke.Pop,s=null,u=d();u==null&&(u=0,a.replaceState(Re({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function c(){l=ke.Pop;let _=d(),m=_==null?null:_-u;u=_,s&&s({action:l,location:y.location,delta:m})}function f(_,m){l=ke.Push;let v=bi(y.location,_,m);n&&n(v,_),u=d()+1;let w=xh(v,u),E=y.createHref(v);try{a.pushState(w,"",E)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;o.location.assign(E)}i&&s&&s({action:l,location:y.location,delta:1})}function p(_,m){l=ke.Replace;let v=bi(y.location,_,m);n&&n(v,_),u=d();let w=xh(v,u),E=y.createHref(v);a.replaceState(w,"",E),i&&s&&s({action:l,location:y.location,delta:0})}function x(_){let m=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof _=="string"?_:yr(_);return ee(m,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,m)}let y={get action(){return l},get location(){return e(o,a)},listen(_){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(yh,c),s=_,()=>{o.removeEventListener(yh,c),s=null}},createHref(_){return t(o,_)},createURL:x,encodeLocation(_){let m=x(_);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(_){return a.go(_)}};return y}var Pe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Pe||(Pe={}));const Cw=new Set(["lazy","caseSensitive","path","id","index","children"]);function Sw(e){return e.index===!0}function Kc(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let a=[...n,i],l=typeof o.id=="string"?o.id:a.join("-");if(ee(o.index!==!0||!o.children,"Cannot specify children on an index route"),ee(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),Sw(o)){let s=Re({},o,t(o),{id:l});return r[l]=s,s}else{let s=Re({},o,t(o),{id:l,children:void 0});return r[l]=s,o.children&&(s.children=Kc(o.children,t,a,r)),s}})}function ar(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?vn(t):t,o=Cr(r.pathname||"/",n);if(o==null)return null;let i=o0(e);bw(i);let a=null;for(let l=0;a==null&&l{let s={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};s.relativePath.startsWith("/")&&(ee(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let u=an([r,s.relativePath]),d=n.concat(s);i.children&&i.children.length>0&&(ee(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),o0(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Aw(u,i.index),routesMeta:d})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let s of i0(i.path))o(i,a,s)}),t}function i0(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=i0(r.join("/")),l=[];return l.push(...a.map(s=>s===""?i:[i,s].join("/"))),o&&l.push(...a),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function bw(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ow(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Tw=/^:[\w-]+$/,Pw=3,$w=2,Rw=1,kw=10,Nw=-2,wh=e=>e==="*";function Aw(e,t){let n=e.split("/"),r=n.length;return n.some(wh)&&(r+=Nw),t&&(r+=$w),n.filter(o=>!wh(o)).reduce((o,i)=>o+(Tw.test(i)?Pw:i===""?Rw:kw),r)}function Ow(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Lw(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{let{paramName:f,isOptional:p}=d;if(f==="*"){let y=l[c]||"";a=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const x=l[c];return p&&!x?u[f]=void 0:u[f]=Mw(x||"",f),u},{}),pathname:i,pathnameBase:a,pattern:e}}function Iw(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),gr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,s)=>(r.push({paramName:l,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Dw(e){try{return decodeURI(e)}catch(t){return gr(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Mw(e,t){try{return decodeURIComponent(e)}catch(n){return gr(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Cr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function jw(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?vn(e):e;return{pathname:n?n.startsWith("/")?n:Fw(n,t):t,search:Vw(r),hash:Bw(o)}}function Fw(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function $s(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function a0(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ed(e,t){let n=a0(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Cd(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=vn(e):(o=Re({},e),ee(!o.pathname||!o.pathname.includes("?"),$s("?","pathname","search",o)),ee(!o.pathname||!o.pathname.includes("#"),$s("#","pathname","hash",o)),ee(!o.search||!o.search.includes("#"),$s("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(a==null)l=n;else{let c=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),c-=1;o.pathname=f.join("/")}l=c>=0?t[c]:"/"}let s=jw(o,l),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||d)&&(s.pathname+="/"),s}const an=e=>e.join("/").replace(/\/\/+/g,"/"),zw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Bw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Sd{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function l0(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const s0=["post","put","patch","delete"],Uw=new Set(s0),Hw=["get",...s0],Ww=new Set(Hw),Kw=new Set([301,302,303,307,308]),Gw=new Set([307,308]),Rs={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Yw={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},jo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},c0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qw=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),u0="remix-router-transitions";function Zw(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;ee(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let P=e.detectErrorBoundary;o=k=>({hasErrorBoundary:P(k)})}else o=Qw;let i={},a=Kc(e.routes,o,void 0,i),l,s=e.basename||"/",u=Re({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),d=null,c=new Set,f=null,p=null,x=null,y=e.hydrationData!=null,_=ar(a,e.history.location,s),m=null;if(_==null){let P=Et(404,{pathname:e.history.location.pathname}),{matches:k,route:N}=$h(a);_=k,m={[N.id]:P}}let v,w=_.some(P=>P.route.lazy),E=_.some(P=>P.route.loader);if(w)v=!1;else if(!E)v=!0;else if(u.v7_partialHydration){let P=e.hydrationData?e.hydrationData.loaderData:null,k=e.hydrationData?e.hydrationData.errors:null;v=_.every(N=>N.route.loader&&N.route.loader.hydrate!==!0&&(P&&P[N.route.id]!==void 0||k&&k[N.route.id]!==void 0))}else v=e.hydrationData!=null;let S,C={historyAction:e.history.action,location:e.history.location,matches:_,initialized:v,navigation:Rs,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||m,fetchers:new Map,blockers:new Map},b=ke.Pop,T=!1,$,A=!1,D=new Map,M=null,W=!1,V=!1,Z=[],re=[],B=new Map,I=0,F=-1,Q=new Map,oe=new Set,de=new Map,dt=new Map,Le=new Set,Ge=new Map,Te=new Map,Nt=!1;function Ul(){if(d=e.history.listen(P=>{let{action:k,location:N,delta:j}=P;if(Nt){Nt=!1;return}gr(Te.size===0||j!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let U=af({currentLocation:C.location,nextLocation:N,historyAction:k});if(U&&j!=null){Nt=!0,e.history.go(j*-1),Hi(U,{state:"blocked",location:N,proceed(){Hi(U,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),e.history.go(j)},reset(){let ne=new Map(C.blockers);ne.set(U,jo),Je({blockers:ne})}});return}return ft(k,N)}),n){l_(t,D);let P=()=>s_(t,D);t.addEventListener("pagehide",P),M=()=>t.removeEventListener("pagehide",P)}return C.initialized||ft(ke.Pop,C.location,{initialHydration:!0}),S}function $r(){d&&d(),M&&M(),c.clear(),$&&$.abort(),C.fetchers.forEach((P,k)=>Ui(k)),C.blockers.forEach((P,k)=>of(k))}function Hl(P){return c.add(P),()=>c.delete(P)}function Je(P,k){k===void 0&&(k={}),C=Re({},C,P);let N=[],j=[];u.v7_fetcherPersist&&C.fetchers.forEach((U,ne)=>{U.state==="idle"&&(Le.has(ne)?j.push(ne):N.push(ne))}),[...c].forEach(U=>U(C,{deletedFetchers:j,unstable_viewTransitionOpts:k.viewTransitionOpts,unstable_flushSync:k.flushSync===!0})),u.v7_fetcherPersist&&(N.forEach(U=>C.fetchers.delete(U)),j.forEach(U=>Ui(U)))}function qn(P,k,N){var j,U;let{flushSync:ne}=N===void 0?{}:N,X=C.actionData!=null&&C.navigation.formMethod!=null&&It(C.navigation.formMethod)&&C.navigation.state==="loading"&&((j=P.state)==null?void 0:j._isRedirect)!==!0,Y;k.actionData?Object.keys(k.actionData).length>0?Y=k.actionData:Y=null:X?Y=C.actionData:Y=null;let K=k.loaderData?Ph(C.loaderData,k.loaderData,k.matches||[],k.errors):C.loaderData,ae=C.blockers;ae.size>0&&(ae=new Map(ae),ae.forEach((he,Be)=>ae.set(Be,jo)));let je=T===!0||C.navigation.formMethod!=null&&It(C.navigation.formMethod)&&((U=P.state)==null?void 0:U._isRedirect)!==!0;l&&(a=l,l=void 0),W||b===ke.Pop||(b===ke.Push?e.history.push(P,P.state):b===ke.Replace&&e.history.replace(P,P.state));let q;if(b===ke.Pop){let he=D.get(C.location.pathname);he&&he.has(P.pathname)?q={currentLocation:C.location,nextLocation:P}:D.has(P.pathname)&&(q={currentLocation:P,nextLocation:C.location})}else if(A){let he=D.get(C.location.pathname);he?he.add(P.pathname):(he=new Set([P.pathname]),D.set(C.location.pathname,he)),q={currentLocation:C.location,nextLocation:P}}Je(Re({},k,{actionData:Y,loaderData:K,historyAction:b,location:P,initialized:!0,navigation:Rs,revalidation:"idle",restoreScrollPosition:sf(P,k.matches||C.matches),preventScrollReset:je,blockers:ae}),{viewTransitionOpts:q,flushSync:ne===!0}),b=ke.Pop,T=!1,A=!1,W=!1,V=!1,Z=[],re=[]}async function Vi(P,k){if(typeof P=="number"){e.history.go(P);return}let N=Gc(C.location,C.matches,s,u.v7_prependBasename,P,u.v7_relativeSplatPath,k==null?void 0:k.fromRouteId,k==null?void 0:k.relative),{path:j,submission:U,error:ne}=_h(u.v7_normalizeFormMethod,!1,N,k),X=C.location,Y=bi(C.location,j,k&&k.state);Y=Re({},Y,e.history.encodeLocation(Y));let K=k&&k.replace!=null?k.replace:void 0,ae=ke.Push;K===!0?ae=ke.Replace:K===!1||U!=null&&It(U.formMethod)&&U.formAction===C.location.pathname+C.location.search&&(ae=ke.Replace);let je=k&&"preventScrollReset"in k?k.preventScrollReset===!0:void 0,q=(k&&k.unstable_flushSync)===!0,he=af({currentLocation:X,nextLocation:Y,historyAction:ae});if(he){Hi(he,{state:"blocked",location:Y,proceed(){Hi(he,{state:"proceeding",proceed:void 0,reset:void 0,location:Y}),Vi(P,k)},reset(){let Be=new Map(C.blockers);Be.set(he,jo),Je({blockers:Be})}});return}return await ft(ae,Y,{submission:U,pendingError:ne,preventScrollReset:je,replace:k&&k.replace,enableViewTransition:k&&k.unstable_viewTransition,flushSync:q})}function Wl(){if(Zl(),Je({revalidation:"loading"}),C.navigation.state!=="submitting"){if(C.navigation.state==="idle"){ft(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}ft(b||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation})}}async function ft(P,k,N){$&&$.abort(),$=null,b=P,W=(N&&N.startUninterruptedRevalidation)===!0,U1(C.location,C.matches),T=(N&&N.preventScrollReset)===!0,A=(N&&N.enableViewTransition)===!0;let j=l||a,U=N&&N.overrideNavigation,ne=ar(j,k,s),X=(N&&N.flushSync)===!0;if(!ne){let Be=Et(404,{pathname:k.pathname}),{matches:_t,route:Fe}=$h(j);Xl(),qn(k,{matches:_t,loaderData:{},errors:{[Fe.id]:Be}},{flushSync:X});return}if(C.initialized&&!V&&t_(C.location,k)&&!(N&&N.submission&&It(N.submission.formMethod))){qn(k,{matches:ne},{flushSync:X});return}$=new AbortController;let Y=zo(e.history,k,$.signal,N&&N.submission),K,ae;if(N&&N.pendingError)ae={[li(ne).route.id]:N.pendingError};else if(N&&N.submission&&It(N.submission.formMethod)){let Be=await Bi(Y,k,N.submission,ne,{replace:N.replace,flushSync:X});if(Be.shortCircuited)return;K=Be.pendingActionData,ae=Be.pendingActionError,U=ks(k,N.submission),X=!1,Y=new Request(Y.url,{signal:Y.signal})}let{shortCircuited:je,loaderData:q,errors:he}=await Kl(Y,k,ne,U,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,N&&N.initialHydration===!0,X,K,ae);je||($=null,qn(k,Re({matches:ne},K?{actionData:K}:{},{loaderData:q,errors:he})))}async function Bi(P,k,N,j,U){U===void 0&&(U={}),Zl();let ne=i_(k,N);Je({navigation:ne},{flushSync:U.flushSync===!0});let X,Y=Qc(j,k);if(!Y.route.action&&!Y.route.lazy)X={type:Pe.error,error:Et(405,{method:P.method,pathname:k.pathname,routeId:Y.route.id})};else if(X=await Fo("action",P,Y,j,i,o,s,u.v7_relativeSplatPath),P.signal.aborted)return{shortCircuited:!0};if(sr(X)){let K;return U&&U.replace!=null?K=U.replace:K=X.location===C.location.pathname+C.location.search,await Bt(C,X,{submission:N,replace:K}),{shortCircuited:!0}}if(Zr(X)){let K=li(j,Y.route.id);return(U&&U.replace)!==!0&&(b=ke.Push),{pendingActionData:{},pendingActionError:{[K.route.id]:X.error}}}if(lr(X))throw Et(400,{type:"defer-action"});return{pendingActionData:{[Y.route.id]:X.data}}}async function Kl(P,k,N,j,U,ne,X,Y,K,ae,je){let q=j||ks(k,U),he=U||ne||Nh(q),Be=l||a,[_t,Fe]=Eh(e.history,C,N,he,k,u.v7_partialHydration&&Y===!0,V,Z,re,Le,de,oe,Be,s,ae,je);if(Xl(fe=>!(N&&N.some(ye=>ye.route.id===fe))||_t&&_t.some(ye=>ye.route.id===fe)),F=++I,_t.length===0&&Fe.length===0){let fe=nf();return qn(k,Re({matches:N,loaderData:{},errors:je||null},ae?{actionData:ae}:{},fe?{fetchers:new Map(C.fetchers)}:{}),{flushSync:K}),{shortCircuited:!0}}if(!W&&(!u.v7_partialHydration||!Y)){Fe.forEach(ye=>{let Ut=C.fetchers.get(ye.key),Ki=Vo(void 0,Ut?Ut.data:void 0);C.fetchers.set(ye.key,Ki)});let fe=ae||C.actionData;Je(Re({navigation:q},fe?Object.keys(fe).length===0?{actionData:null}:{actionData:fe}:{},Fe.length>0?{fetchers:new Map(C.fetchers)}:{}),{flushSync:K})}Fe.forEach(fe=>{B.has(fe.key)&&En(fe.key),fe.controller&&B.set(fe.key,fe.controller)});let Rr=()=>Fe.forEach(fe=>En(fe.key));$&&$.signal.addEventListener("abort",Rr);let{results:Jl,loaderResults:kr,fetcherResults:Cn}=await qd(C.matches,N,_t,Fe,P);if(P.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",Rr),Fe.forEach(fe=>B.delete(fe.key));let er=Rh(Jl);if(er){if(er.idx>=_t.length){let fe=Fe[er.idx-_t.length].key;oe.add(fe)}return await Bt(C,er.result,{replace:X}),{shortCircuited:!0}}let{loaderData:ql,errors:es}=Th(C,N,_t,kr,je,Fe,Cn,Ge);Ge.forEach((fe,ye)=>{fe.subscribe(Ut=>{(Ut||fe.done)&&Ge.delete(ye)})});let ts=nf(),Nr=rf(F),Wi=ts||Nr||Fe.length>0;return Re({loaderData:ql,errors:es},Wi?{fetchers:new Map(C.fetchers)}:{})}function Gl(P,k,N,j){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");B.has(P)&&En(P);let U=(j&&j.unstable_flushSync)===!0,ne=l||a,X=Gc(C.location,C.matches,s,u.v7_prependBasename,N,u.v7_relativeSplatPath,k,j==null?void 0:j.relative),Y=ar(ne,X,s);if(!Y){Ro(P,k,Et(404,{pathname:X}),{flushSync:U});return}let{path:K,submission:ae,error:je}=_h(u.v7_normalizeFormMethod,!0,X,j);if(je){Ro(P,k,je,{flushSync:U});return}let q=Qc(Y,K);if(T=(j&&j.preventScrollReset)===!0,ae&&It(ae.formMethod)){Yl(P,k,K,q,Y,U,ae);return}de.set(P,{routeId:k,path:K}),Ql(P,k,K,q,Y,U,ae)}async function Yl(P,k,N,j,U,ne,X){if(Zl(),de.delete(P),!j.route.action&&!j.route.lazy){let ye=Et(405,{method:X.formMethod,pathname:N,routeId:k});Ro(P,k,ye,{flushSync:ne});return}let Y=C.fetchers.get(P);_n(P,a_(X,Y),{flushSync:ne});let K=new AbortController,ae=zo(e.history,N,K.signal,X);B.set(P,K);let je=I,q=await Fo("action",ae,j,U,i,o,s,u.v7_relativeSplatPath);if(ae.signal.aborted){B.get(P)===K&&B.delete(P);return}if(u.v7_fetcherPersist&&Le.has(P)){if(sr(q)||Zr(q)){_n(P,bn(void 0));return}}else{if(sr(q))if(B.delete(P),F>je){_n(P,bn(void 0));return}else return oe.add(P),_n(P,Vo(X)),Bt(C,q,{fetcherSubmission:X});if(Zr(q)){Ro(P,k,q.error);return}}if(lr(q))throw Et(400,{type:"defer-action"});let he=C.navigation.location||C.location,Be=zo(e.history,he,K.signal),_t=l||a,Fe=C.navigation.state!=="idle"?ar(_t,C.navigation.location,s):C.matches;ee(Fe,"Didn't find any matches after fetcher action");let Rr=++I;Q.set(P,Rr);let Jl=Vo(X,q.data);C.fetchers.set(P,Jl);let[kr,Cn]=Eh(e.history,C,Fe,X,he,!1,V,Z,re,Le,de,oe,_t,s,{[j.route.id]:q.data},void 0);Cn.filter(ye=>ye.key!==P).forEach(ye=>{let Ut=ye.key,Ki=C.fetchers.get(Ut),W1=Vo(void 0,Ki?Ki.data:void 0);C.fetchers.set(Ut,W1),B.has(Ut)&&En(Ut),ye.controller&&B.set(Ut,ye.controller)}),Je({fetchers:new Map(C.fetchers)});let er=()=>Cn.forEach(ye=>En(ye.key));K.signal.addEventListener("abort",er);let{results:ql,loaderResults:es,fetcherResults:ts}=await qd(C.matches,Fe,kr,Cn,Be);if(K.signal.aborted)return;K.signal.removeEventListener("abort",er),Q.delete(P),B.delete(P),Cn.forEach(ye=>B.delete(ye.key));let Nr=Rh(ql);if(Nr){if(Nr.idx>=kr.length){let ye=Cn[Nr.idx-kr.length].key;oe.add(ye)}return Bt(C,Nr.result)}let{loaderData:Wi,errors:fe}=Th(C,C.matches,kr,es,void 0,Cn,ts,Ge);if(C.fetchers.has(P)){let ye=bn(q.data);C.fetchers.set(P,ye)}rf(Rr),C.navigation.state==="loading"&&Rr>F?(ee(b,"Expected pending action"),$&&$.abort(),qn(C.navigation.location,{matches:Fe,loaderData:Wi,errors:fe,fetchers:new Map(C.fetchers)})):(Je({errors:fe,loaderData:Ph(C.loaderData,Wi,Fe,fe),fetchers:new Map(C.fetchers)}),V=!1)}async function Ql(P,k,N,j,U,ne,X){let Y=C.fetchers.get(P);_n(P,Vo(X,Y?Y.data:void 0),{flushSync:ne});let K=new AbortController,ae=zo(e.history,N,K.signal);B.set(P,K);let je=I,q=await Fo("loader",ae,j,U,i,o,s,u.v7_relativeSplatPath);if(lr(q)&&(q=await h0(q,ae.signal,!0)||q),B.get(P)===K&&B.delete(P),!ae.signal.aborted){if(Le.has(P)){_n(P,bn(void 0));return}if(sr(q))if(F>je){_n(P,bn(void 0));return}else{oe.add(P),await Bt(C,q);return}if(Zr(q)){Ro(P,k,q.error);return}ee(!lr(q),"Unhandled fetcher deferred data"),_n(P,bn(q.data))}}async function Bt(P,k,N){let{submission:j,fetcherSubmission:U,replace:ne}=N===void 0?{}:N;k.revalidate&&(V=!0);let X=bi(P.location,k.location,{_isRedirect:!0});if(ee(X,"Expected a location on the redirect navigation"),n){let he=!1;if(k.reloadDocument)he=!0;else if(c0.test(k.location)){const Be=e.history.createURL(k.location);he=Be.origin!==t.location.origin||Cr(Be.pathname,s)==null}if(he){ne?t.location.replace(k.location):t.location.assign(k.location);return}}$=null;let Y=ne===!0?ke.Replace:ke.Push,{formMethod:K,formAction:ae,formEncType:je}=P.navigation;!j&&!U&&K&&ae&&je&&(j=Nh(P.navigation));let q=j||U;if(Gw.has(k.status)&&q&&It(q.formMethod))await ft(Y,X,{submission:Re({},q,{formAction:k.location}),preventScrollReset:T});else{let he=ks(X,j);await ft(Y,X,{overrideNavigation:he,fetcherSubmission:U,preventScrollReset:T})}}async function qd(P,k,N,j,U){let ne=await Promise.all([...N.map(K=>Fo("loader",U,K,k,i,o,s,u.v7_relativeSplatPath)),...j.map(K=>K.matches&&K.match&&K.controller?Fo("loader",zo(e.history,K.path,K.controller.signal),K.match,K.matches,i,o,s,u.v7_relativeSplatPath):{type:Pe.error,error:Et(404,{pathname:K.path})})]),X=ne.slice(0,N.length),Y=ne.slice(N.length);return await Promise.all([kh(P,N,X,X.map(()=>U.signal),!1,C.loaderData),kh(P,j.map(K=>K.match),Y,j.map(K=>K.controller?K.controller.signal:null),!0)]),{results:ne,loaderResults:X,fetcherResults:Y}}function Zl(){V=!0,Z.push(...Xl()),de.forEach((P,k)=>{B.has(k)&&(re.push(k),En(k))})}function _n(P,k,N){N===void 0&&(N={}),C.fetchers.set(P,k),Je({fetchers:new Map(C.fetchers)},{flushSync:(N&&N.flushSync)===!0})}function Ro(P,k,N,j){j===void 0&&(j={});let U=li(C.matches,k);Ui(P),Je({errors:{[U.route.id]:N},fetchers:new Map(C.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function ef(P){return u.v7_fetcherPersist&&(dt.set(P,(dt.get(P)||0)+1),Le.has(P)&&Le.delete(P)),C.fetchers.get(P)||Yw}function Ui(P){let k=C.fetchers.get(P);B.has(P)&&!(k&&k.state==="loading"&&Q.has(P))&&En(P),de.delete(P),Q.delete(P),oe.delete(P),Le.delete(P),C.fetchers.delete(P)}function z1(P){if(u.v7_fetcherPersist){let k=(dt.get(P)||0)-1;k<=0?(dt.delete(P),Le.add(P)):dt.set(P,k)}else Ui(P);Je({fetchers:new Map(C.fetchers)})}function En(P){let k=B.get(P);ee(k,"Expected fetch controller: "+P),k.abort(),B.delete(P)}function tf(P){for(let k of P){let N=ef(k),j=bn(N.data);C.fetchers.set(k,j)}}function nf(){let P=[],k=!1;for(let N of oe){let j=C.fetchers.get(N);ee(j,"Expected fetcher: "+N),j.state==="loading"&&(oe.delete(N),P.push(N),k=!0)}return tf(P),k}function rf(P){let k=[];for(let[N,j]of Q)if(j0}function V1(P,k){let N=C.blockers.get(P)||jo;return Te.get(P)!==k&&Te.set(P,k),N}function of(P){C.blockers.delete(P),Te.delete(P)}function Hi(P,k){let N=C.blockers.get(P)||jo;ee(N.state==="unblocked"&&k.state==="blocked"||N.state==="blocked"&&k.state==="blocked"||N.state==="blocked"&&k.state==="proceeding"||N.state==="blocked"&&k.state==="unblocked"||N.state==="proceeding"&&k.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+k.state);let j=new Map(C.blockers);j.set(P,k),Je({blockers:j})}function af(P){let{currentLocation:k,nextLocation:N,historyAction:j}=P;if(Te.size===0)return;Te.size>1&&gr(!1,"A router only supports one blocker at a time");let U=Array.from(Te.entries()),[ne,X]=U[U.length-1],Y=C.blockers.get(ne);if(!(Y&&Y.state==="proceeding")&&X({currentLocation:k,nextLocation:N,historyAction:j}))return ne}function Xl(P){let k=[];return Ge.forEach((N,j)=>{(!P||P(j))&&(N.cancel(),k.push(j),Ge.delete(j))}),k}function B1(P,k,N){if(f=P,x=k,p=N||null,!y&&C.navigation===Rs){y=!0;let j=sf(C.location,C.matches);j!=null&&Je({restoreScrollPosition:j})}return()=>{f=null,x=null,p=null}}function lf(P,k){return p&&p(P,k.map(j=>r0(j,C.loaderData)))||P.key}function U1(P,k){if(f&&x){let N=lf(P,k);f[N]=x()}}function sf(P,k){if(f){let N=lf(P,k),j=f[N];if(typeof j=="number")return j}return null}function H1(P){i={},l=Kc(P,o,void 0,i)}return S={get basename(){return s},get future(){return u},get state(){return C},get routes(){return a},get window(){return t},initialize:Ul,subscribe:Hl,enableScrollRestoration:B1,navigate:Vi,fetch:Gl,revalidate:Wl,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:ef,deleteFetcher:z1,dispose:$r,getBlocker:V1,deleteBlocker:of,_internalFetchControllers:B,_internalActiveDeferreds:Ge,_internalSetRoutes:H1},S}function Xw(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Gc(e,t,n,r,o,i,a,l){let s,u;if(a){s=[];for(let c of t)if(s.push(c),c.route.id===a){u=c;break}}else s=t,u=t[t.length-1];let d=Cd(o||".",Ed(s,i),Cr(e.pathname,n)||e.pathname,l==="path");return o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!bd(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:an([n,d.pathname])),yr(d)}function _h(e,t,n,r){if(!r||!Xw(r))return{path:n};if(r.formMethod&&!o_(r.formMethod))return{path:n,error:Et(405,{method:r.formMethod})};let o=()=>({path:n,error:Et(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=f0(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!It(a))return o();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,x)=>{let[y,_]=x;return""+p+y+"="+_+` +`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!It(a))return o();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return o()}}}ee(typeof FormData=="function","FormData is not available in this environment");let s,u;if(r.formData)s=Yc(r.formData),u=r.formData;else if(r.body instanceof FormData)s=Yc(r.body),u=r.body;else if(r.body instanceof URLSearchParams)s=r.body,u=bh(s);else if(r.body==null)s=new URLSearchParams,u=new FormData;else try{s=new URLSearchParams(r.body),u=bh(s)}catch{return o()}let d={formMethod:a,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(It(d.formMethod))return{path:n,submission:d};let c=vn(n);return t&&c.search&&bd(c.search)&&s.append("index",""),c.search="?"+s,{path:yr(c),submission:d}}function Jw(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Eh(e,t,n,r,o,i,a,l,s,u,d,c,f,p,x,y){let _=y?Object.values(y)[0]:x?Object.values(x)[0]:void 0,m=e.createURL(t.location),v=e.createURL(o),w=y?Object.keys(y)[0]:void 0,S=Jw(n,w).filter((b,T)=>{let{route:$}=b;if($.lazy)return!0;if($.loader==null)return!1;if(i)return $.loader.hydrate?!0:t.loaderData[$.id]===void 0&&(!t.errors||t.errors[$.id]===void 0);if(qw(t.loaderData,t.matches[T],b)||l.some(M=>M===b.route.id))return!0;let A=t.matches[T],D=b;return Ch(b,Re({currentUrl:m,currentParams:A.params,nextUrl:v,nextParams:D.params},r,{actionResult:_,defaultShouldRevalidate:a||m.pathname+m.search===v.pathname+v.search||m.search!==v.search||d0(A,D)}))}),C=[];return d.forEach((b,T)=>{if(i||!n.some(W=>W.route.id===b.routeId)||u.has(T))return;let $=ar(f,b.path,p);if(!$){C.push({key:T,routeId:b.routeId,path:b.path,matches:null,match:null,controller:null});return}let A=t.fetchers.get(T),D=Qc($,b.path),M=!1;c.has(T)?M=!1:s.includes(T)?M=!0:A&&A.state!=="idle"&&A.data===void 0?M=a:M=Ch(D,Re({currentUrl:m,currentParams:t.matches[t.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:_,defaultShouldRevalidate:a})),M&&C.push({key:T,routeId:b.routeId,path:b.path,matches:$,match:D,controller:new AbortController})}),[S,C]}function qw(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function d0(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ch(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Sh(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];ee(o,"No route found in manifest");let i={};for(let a in r){let s=o[a]!==void 0&&a!=="hasErrorBoundary";gr(!s,'Route "'+o.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!s&&!Cw.has(a)&&(i[a]=r[a])}Object.assign(o,i),Object.assign(o,Re({},t(o),{lazy:void 0}))}async function Fo(e,t,n,r,o,i,a,l,s){s===void 0&&(s={});let u,d,c,f=y=>{let _,m=new Promise((v,w)=>_=w);return c=()=>_(),t.signal.addEventListener("abort",c),Promise.race([y({request:t,params:n.params,context:s.requestContext}),m])};try{let y=n.route[e];if(n.route.lazy)if(y){let _,m=await Promise.all([f(y).catch(v=>{_=v}),Sh(n.route,i,o)]);if(_)throw _;d=m[0]}else if(await Sh(n.route,i,o),y=n.route[e],y)d=await f(y);else if(e==="action"){let _=new URL(t.url),m=_.pathname+_.search;throw Et(405,{method:t.method,pathname:m,routeId:n.route.id})}else return{type:Pe.data,data:void 0};else if(y)d=await f(y);else{let _=new URL(t.url),m=_.pathname+_.search;throw Et(404,{pathname:m})}ee(d!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(y){u=Pe.error,d=y}finally{c&&t.signal.removeEventListener("abort",c)}if(r_(d)){let y=d.status;if(Kw.has(y)){let m=d.headers.get("Location");if(ee(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!c0.test(m))m=Gc(new URL(t.url),r.slice(0,r.indexOf(n)+1),a,!0,m,l);else if(!s.isStaticRequest){let v=new URL(t.url),w=m.startsWith("//")?new URL(v.protocol+m):new URL(m),E=Cr(w.pathname,a)!=null;w.origin===v.origin&&E&&(m=w.pathname+w.search+w.hash)}if(s.isStaticRequest)throw d.headers.set("Location",m),d;return{type:Pe.redirect,status:y,location:m,revalidate:d.headers.get("X-Remix-Revalidate")!==null,reloadDocument:d.headers.get("X-Remix-Reload-Document")!==null}}if(s.isRouteRequest)throw{type:u===Pe.error?Pe.error:Pe.data,response:d};let _;try{let m=d.headers.get("Content-Type");m&&/\bapplication\/json\b/.test(m)?d.body==null?_=null:_=await d.json():_=await d.text()}catch(m){return{type:Pe.error,error:m}}return u===Pe.error?{type:u,error:new Sd(y,d.statusText,_),headers:d.headers}:{type:Pe.data,data:_,statusCode:d.status,headers:d.headers}}if(u===Pe.error)return{type:u,error:d};if(n_(d)){var p,x;return{type:Pe.deferred,deferredData:d,statusCode:(p=d.init)==null?void 0:p.status,headers:((x=d.init)==null?void 0:x.headers)&&new Headers(d.init.headers)}}return{type:Pe.data,data:d}}function zo(e,t,n,r){let o=e.createURL(f0(t)).toString(),i={signal:n};if(r&&It(r.formMethod)){let{formMethod:a,formEncType:l}=r;i.method=a.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(r.json)):l==="text/plain"?i.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?i.body=Yc(r.formData):i.body=r.formData}return new Request(o,i)}function Yc(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function bh(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function e_(e,t,n,r,o){let i={},a=null,l,s=!1,u={};return n.forEach((d,c)=>{let f=t[c].route.id;if(ee(!sr(d),"Cannot handle redirect results in processLoaderData"),Zr(d)){let p=li(e,f),x=d.error;r&&(x=Object.values(r)[0],r=void 0),a=a||{},a[p.route.id]==null&&(a[p.route.id]=x),i[f]=void 0,s||(s=!0,l=l0(d.error)?d.error.status:500),d.headers&&(u[f]=d.headers)}else lr(d)?(o.set(f,d.deferredData),i[f]=d.deferredData.data):i[f]=d.data,d.statusCode!=null&&d.statusCode!==200&&!s&&(l=d.statusCode),d.headers&&(u[f]=d.headers)}),r&&(a=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:u}}function Th(e,t,n,r,o,i,a,l){let{loaderData:s,errors:u}=e_(t,n,r,o,l);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function $h(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Et(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o&&n&&r?l="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",l='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",o&&n&&r?l="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new Sd(e||500,a,new Error(l),!0)}function Rh(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(sr(n))return{result:n,idx:t}}}function f0(e){let t=typeof e=="string"?vn(e):e;return yr(Re({},t,{hash:""}))}function t_(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function lr(e){return e.type===Pe.deferred}function Zr(e){return e.type===Pe.error}function sr(e){return(e&&e.type)===Pe.redirect}function n_(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function r_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function o_(e){return Ww.has(e.toLowerCase())}function It(e){return Uw.has(e.toLowerCase())}async function kh(e,t,n,r,o,i){for(let a=0;ac.route.id===s.route.id),d=u!=null&&!d0(u,s)&&(i&&i[s.route.id])!==void 0;if(lr(l)&&(o||d)){let c=r[a];ee(c,"Expected an AbortSignal for revalidating fetcher deferred result"),await h0(l,c,o).then(f=>{f&&(n[a]=f||n[a])})}}}async function h0(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Pe.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Pe.error,error:o}}return{type:Pe.data,data:e.deferredData.data}}}function bd(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qc(e,t){let n=typeof t=="string"?vn(t).search:t.search;if(e[e.length-1].route.index&&bd(n||""))return e[e.length-1];let r=a0(e);return r[r.length-1]}function Nh(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:a}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function ks(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function i_(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Vo(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function a_(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function bn(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function l_(e,t){try{let n=e.sessionStorage.getItem(u0);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function s_(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(u0,JSON.stringify(n))}catch(r){gr(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.21.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ti(){return Ti=Object.assign?Object.assign.bind():function(e){for(var t=1;tOl(e,t),[t,e])}function m0(e){h.useContext(Xn).static||h.useLayoutEffect(e)}function Pd(){let{isDataRoute:e}=h.useContext(Sr);return e?C_():d_()}function d_(){Eo()||ee(!1);let e=h.useContext(Mi),{basename:t,future:n,navigator:r}=h.useContext(Xn),{matches:o}=h.useContext(Sr),{pathname:i}=be(),a=JSON.stringify(Ed(o,n.v7_relativeSplatPath)),l=h.useRef(!1);return m0(()=>{l.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let c=Cd(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:an([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,a,i,e])}function v0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(Xn),{matches:o}=h.useContext(Sr),{pathname:i}=be(),a=JSON.stringify(Ed(o,r.v7_relativeSplatPath));return h.useMemo(()=>Cd(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function f_(e,t,n,r){Eo()||ee(!1);let{navigator:o}=h.useContext(Xn),{matches:i}=h.useContext(Sr),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:"/";a&&a.route;let u=be(),d;if(t){var c;let _=typeof t=="string"?vn(t):t;s==="/"||(c=_.pathname)!=null&&c.startsWith(s)||ee(!1),d=_}else d=u;let f=d.pathname||"/",p=s==="/"?f:f.slice(s.length)||"/",x=ar(e,{pathname:p}),y=g_(x&&x.map(_=>Object.assign({},_,{params:Object.assign({},l,_.params),pathname:an([s,o.encodeLocation?o.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?s:an([s,o.encodeLocation?o.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),i,n,r);return t&&y?h.createElement(Ll.Provider,{value:{location:Ti({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ke.Pop}},y):y}function h_(){let e=E_(),t=l0(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:o},n):null,null)}const p_=h.createElement(h_,null);class m_ extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(Sr.Provider,{value:this.props.routeContext},h.createElement(p0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function v_(e){let{routeContext:t,match:n,children:r}=e,o=h.useContext(Mi);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Sr.Provider,{value:t},r)}function g_(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let a=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let d=a.findIndex(c=>c.route.id&&(l==null?void 0:l[c.route.id]));d>=0||ee(!1),a=a.slice(0,Math.min(a.length,d+1))}let s=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,c,f)=>{let p,x=!1,y=null,_=null;n&&(p=l&&c.route.id?l[c.route.id]:void 0,y=c.route.errorElement||p_,s&&(u<0&&f===0?(S_("route-fallback",!1),x=!0,_=null):u===f&&(x=!0,_=c.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,f+1)),v=()=>{let w;return p?w=y:x?w=_:c.route.Component?w=h.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=d,h.createElement(v_,{match:c,routeContext:{outlet:d,matches:m,isDataRoute:n!=null},children:w})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?h.createElement(m_,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var g0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(g0||{}),po=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(po||{});function y_(e){let t=h.useContext(Mi);return t||ee(!1),t}function $d(e){let t=h.useContext(Td);return t||ee(!1),t}function x_(e){let t=h.useContext(Sr);return t||ee(!1),t}function y0(e){let t=x_(),n=t.matches[t.matches.length-1];return n.route.id||ee(!1),n.route.id}function w_(){return $d(po.UseNavigation).navigation}function __(){let{matches:e,loaderData:t}=$d(po.UseMatches);return h.useMemo(()=>e.map(n=>r0(n,t)),[e,t])}function E_(){var e;let t=h.useContext(p0),n=$d(po.UseRouteError),r=y0(po.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function C_(){let{router:e}=y_(g0.UseNavigateStable),t=y0(po.UseNavigateStable),n=h.useRef(!1);return m0(()=>{n.current=!0}),h.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Ti({fromRouteId:t},i)))},[e,t])}const Ah={};function S_(e,t,n){!t&&!Ah[e]&&(Ah[e]=!0)}function b_(e){let{basename:t="/",children:n=null,location:r,navigationType:o=ke.Pop,navigator:i,static:a=!1,future:l}=e;Eo()&&ee(!1);let s=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:s,navigator:i,static:a,future:Ti({v7_relativeSplatPath:!1},l)}),[s,l,i,a]);typeof r=="string"&&(r=vn(r));let{pathname:d="/",search:c="",hash:f="",state:p=null,key:x="default"}=r,y=h.useMemo(()=>{let _=Cr(d,s);return _==null?null:{location:{pathname:_,search:c,hash:f,state:p,key:x},navigationType:o}},[s,d,c,f,p,x,o]);return y==null?null:h.createElement(Xn.Provider,{value:u},h.createElement(Ll.Provider,{children:n,value:y}))}new Promise(()=>{});function T_(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:h.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.21.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function mo(){return mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function $_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function R_(e,t){return e.button===0&&(!t||t==="_self")&&!$_(e)}const k_=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];function N_(e,t){return Zw({basename:t==null?void 0:t.basename,future:mo({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:ww({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||A_(),routes:e,mapRouteProperties:T_,window:t==null?void 0:t.window}).initialize()}function A_(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=mo({},t,{errors:O_(t.errors)})),t}function O_(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Sd(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const L_=h.createContext({isTransitioning:!1}),I_=h.createContext(new Map),D_="startTransition",Oh=Zp[D_],M_="flushSync",Lh=xw[M_];function j_(e){Oh?Oh(e):e()}function Bo(e){Lh?Lh(e):e()}class F_{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function z_(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=h.useState(n.state),[a,l]=h.useState(),[s,u]=h.useState({isTransitioning:!1}),[d,c]=h.useState(),[f,p]=h.useState(),[x,y]=h.useState(),_=h.useRef(new Map),{v7_startTransition:m}=r||{},v=h.useCallback(b=>{m?j_(b):b()},[m]),w=h.useCallback((b,T)=>{let{deletedFetchers:$,unstable_flushSync:A,unstable_viewTransitionOpts:D}=T;$.forEach(W=>_.current.delete(W)),b.fetchers.forEach((W,V)=>{W.data!==void 0&&_.current.set(V,W.data)});let M=n.window==null||typeof n.window.document.startViewTransition!="function";if(!D||M){A?Bo(()=>i(b)):v(()=>i(b));return}if(A){Bo(()=>{f&&(d&&d.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let W=n.window.document.startViewTransition(()=>{Bo(()=>i(b))});W.finished.finally(()=>{Bo(()=>{c(void 0),p(void 0),l(void 0),u({isTransitioning:!1})})}),Bo(()=>p(W));return}f?(d&&d.resolve(),f.skipTransition(),y({state:b,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(l(b),u({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[n.window,f,d,_,v]);h.useLayoutEffect(()=>n.subscribe(w),[n,w]),h.useEffect(()=>{s.isTransitioning&&!s.flushSync&&c(new F_)},[s]),h.useEffect(()=>{if(d&&a&&n.window){let b=a,T=d.promise,$=n.window.document.startViewTransition(async()=>{v(()=>i(b)),await T});$.finished.finally(()=>{c(void 0),p(void 0),l(void 0),u({isTransitioning:!1})}),p($)}},[v,a,d,n.window]),h.useEffect(()=>{d&&a&&o.location.key===a.location.key&&d.resolve()},[d,f,o.location,a]),h.useEffect(()=>{!s.isTransitioning&&x&&(l(x.state),u({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),y(void 0))},[s.isTransitioning,x]),h.useEffect(()=>{},[]);let E=h.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:b=>n.navigate(b),push:(b,T,$)=>n.navigate(b,{state:T,preventScrollReset:$==null?void 0:$.preventScrollReset}),replace:(b,T,$)=>n.navigate(b,{replace:!0,state:T,preventScrollReset:$==null?void 0:$.preventScrollReset})}),[n]),S=n.basename||"/",C=h.useMemo(()=>({router:n,navigator:E,static:!1,basename:S}),[n,E,S]);return h.createElement(h.Fragment,null,h.createElement(Mi.Provider,{value:C},h.createElement(Td.Provider,{value:o},h.createElement(I_.Provider,{value:_.current},h.createElement(L_.Provider,{value:s},h.createElement(b_,{basename:S,location:o.location,navigationType:o.historyAction,navigator:E,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?h.createElement(V_,{routes:n.routes,future:n.future,state:o}):t))))),null)}function V_(e){let{routes:t,future:n,state:r}=e;return f_(t,void 0,r,n)}const B_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",U_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,x0=h.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:l,target:s,to:u,preventScrollReset:d,unstable_viewTransition:c}=t,f=P_(t,k_),{basename:p}=h.useContext(Xn),x,y=!1;if(typeof u=="string"&&U_.test(u)&&(x=u,B_))try{let w=new URL(window.location.href),E=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=Cr(E.pathname,p);E.origin===w.origin&&S!=null?u=S+E.search+E.hash:y=!0}catch{}let _=c_(u,{relative:o}),m=G_(u,{replace:a,state:l,target:s,preventScrollReset:d,relative:o,unstable_viewTransition:c});function v(w){r&&r(w),w.defaultPrevented||m(w)}return h.createElement("a",mo({},f,{href:x||_,onClick:y||i?r:v,ref:n,target:s}))});function H_(e){let{getKey:t,storageKey:n}=e;return Y_({getKey:t,storageKey:n}),null}var Zc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Zc||(Zc={}));var Xc;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Xc||(Xc={}));function W_(e){let t=h.useContext(Mi);return t||ee(!1),t}function K_(e){let t=h.useContext(Td);return t||ee(!1),t}function G_(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:l}=t===void 0?{}:t,s=Pd(),u=be(),d=v0(e,{relative:a});return h.useCallback(c=>{if(R_(c,n)){c.preventDefault();let f=r!==void 0?r:yr(u)===yr(d);s(e,{replace:f,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:l})}},[u,s,d,r,o,n,e,i,a,l])}const Ih="react-router-scroll-positions";let ua={};function Y_(e){let{getKey:t,storageKey:n}=e===void 0?{}:e,{router:r}=W_(Zc.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:i}=K_(Xc.UseScrollRestoration),{basename:a}=h.useContext(Xn),l=be(),s=__(),u=w_();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Q_(h.useCallback(()=>{if(u.state==="idle"){let d=(t?t(l,s):null)||l.key;ua[d]=window.scrollY}try{sessionStorage.setItem(n||Ih,JSON.stringify(ua))}catch{}window.history.scrollRestoration="auto"},[n,t,u.state,l,s])),typeof document<"u"&&(h.useLayoutEffect(()=>{try{let d=sessionStorage.getItem(n||Ih);d&&(ua=JSON.parse(d))}catch{}},[n]),h.useLayoutEffect(()=>{let d=t&&a!=="/"?(f,p)=>t(mo({},f,{pathname:Cr(f.pathname,a)||f.pathname}),p):t,c=r==null?void 0:r.enableScrollRestoration(ua,()=>window.scrollY,d);return()=>c&&c()},[r,a,t]),h.useLayoutEffect(()=>{if(o!==!1){if(typeof o=="number"){window.scrollTo(0,o);return}if(l.hash){let d=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(d){d.scrollIntoView();return}}i!==!0&&window.scrollTo(0,0)}},[l,o,i]))}function Q_(e,t){let{capture:n}=t||{};h.useEffect(()=>{let r=n!=null?{capture:n}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,n])}const w0={blogDir:"./pages/blog",font:{google:"Poppins"},ogImageUrl:"https://vocs.dev/api/og?logo=%logo&title=%title&description=%description",rootDir:"docs",title:"Dojo Book",titleTemplate:"%s – Dojo Book",iconUrl:"/dojo-mark-full-dark.svg",topNav:[{text:"Blog",link:"https://www.dojoengine.org/en/articles",id:110,items:[]},{text:"Releases",link:"https://github.com/dojoengine/dojo/releases",id:111,items:[]},{text:"0.5.0",items:[{text:"Changelog",link:"https://github.com/wevm/vocs/blob/main/src/CHANGELOG.md",id:113,items:[]},{text:"Contributing",link:"https://github.com/wevm/vocs/blob/main/.github/CONTRIBUTING.md",id:114,items:[]}],id:112}],theme:{accentColor:{backgroundAccent:{dark:"#FF2F42",light:"#FF2F42"},backgroundAccentHover:{dark:"#f01938",light:"#f01938"},backgroundAccentText:{dark:"black",light:"black"},borderAccent:{dark:"#ff5057",light:"#f01938"},textAccent:{dark:"#FF2F42",light:"#FF2F42"},textAccentHover:{dark:"#e1002e",light:"#e1002e"}},variables:{color:{background:{light:"white",dark:"black"}},content:{horizontalPadding:"40px",verticalPadding:"80px"}}},sidebar:[{text:"🏁 Theory",collapsed:!0,items:[{text:"Foreword",link:"/getting-started"},{text:"What is Dojo?",link:"/theory/what-is-dojo"},{text:"AW Theory",link:"/theory/autonomous-worlds"},{text:"Cairo Ecosystem",link:"/theory/cairo"},{text:"FAQs",link:"/theory/faqs"}]},{text:"🚀 Getting Started",collapsed:!0,items:[{text:"Quick Start",link:"/getting-started/quick-start"},{text:"Manual Install",link:"/getting-started/from-source"},{text:"Development Setup",link:"/getting-started/setup"},{text:"Contributing",link:"/getting-started/contributing"}]},{text:"🫂 Community",link:"/community/get-started"},{text:"🏛️ Architecture",collapsed:!0,items:[{text:"Overview",link:"/cairo/overview"},{text:"World",link:"/cairo/world"},{text:"Systems",link:"/cairo/systems"},{text:"Models",link:"/cairo/models"},{text:"Commands",link:"/cairo/commands"},{text:"Config",link:"/cairo/config"},{text:"Events",link:"/cairo/events"},{text:"Authorization",link:"/cairo/authorization"},{text:"Metadata",link:"/cairo/metadata"},{text:"Enum",link:"/cairo/enum"},{text:"Migration",link:"/cairo/migration"},{text:"0.2.0 -> 0.3.0",link:"/cairo/migration/0.3.0"},{text:"ECS in 15 minutes",link:"/cairo/hello-dojo"},{text:"Entities",link:"/cairo/entities"},{text:"Testing",link:"/cairo/testing"}]},{text:"🖥️ Client SDKs + Origami",collapsed:!0,items:[{text:"Origami",link:"/cairo/origami"},{text:"SDKs",link:"/client/overview",items:[{text:"dojo.js",link:"/client/sdk/dojojs"},{text:"unity",link:"/client/sdk/unity"},{text:"c",link:"/client/sdk/c"}]}]},{text:"⛓️ Toolchain",collapsed:!0,items:[{text:"Dojoup",link:"/toolchain/dojoup"},{text:"Sozo",link:"/toolchain/sozo/overview",items:[{text:"Reference",link:"/toolchain/sozo/reference"},{text:"profile",link:"/toolchain/sozo/common-options/profile"},{text:"offline",link:"/toolchain/sozo/common-options/offline"},{text:"init",link:"/toolchain/sozo/project-commands/init"},{text:"build",link:"/toolchain/sozo/project-commands/build"},{text:"test",link:"/toolchain/sozo/project-commands/test"},{text:"migrate",link:"/toolchain/sozo/project-commands/migrate"},{text:"execute",link:"/toolchain/sozo/world-commands/execute"},{text:"register",link:"/toolchain/sozo/world-commands/register"},{text:"system",link:"/toolchain/sozo/world-commands/system"},{text:"model",link:"/toolchain/sozo/world-commands/model"},{text:"events",link:"/toolchain/sozo/world-commands/events"},{text:"auth",link:"/toolchain/sozo/world-commands/auth"}]},{text:"Katana",link:"/toolchain/katana/overview",items:[{text:"Reference",link:"/toolchain/katana/reference"}]},{text:"Torii",link:"/toolchain/torii/overview",items:[{text:"Reference",link:"/toolchain/torii/reference"},{text:"Graphql",link:"/toolchain/torii/graphql"},{text:"gRPC",link:"/toolchain/torii/grpc"}]},{text:"Slot",link:"/toolchain/slot/overview",items:[{text:"Reference",link:"/toolchain/slot/reference"},{text:"Deployments",link:"/toolchain/slot/deployments-commands/deployments"}]}]},{text:"🌌 Deploying",collapsed:!0,items:[{text:"Locally",link:"/deployment/locally"},{text:"Remote",link:"/deployment/remote"}]},{text:"🙌 Tutorial",collapsed:!0,items:[{text:"Onchain Chess",link:"/tutorial/onchain-chess/README",items:[{text:"0. Setup",link:"/tutorial/onchain-chess/0-setup"},{text:"1. Initiate",link:"/tutorial/onchain-chess/1-action"},{text:"2. Move",link:"/tutorial/onchain-chess/2-move"},{text:"3. Test Chess",link:"/tutorial/onchain-chess/3-test"}]},{text:"Deploy using Slot",link:"/tutorial/deploy-using-slot/main"}]},{text:"Contributors",link:"/misc/contributors"}],markdown:{code:{keepBackground:!1,theme:{dark:"github-dark-dimmed",light:"github-light"}}},socials:[]},_0=h.createContext(w0);function Z_({children:e,config:t}){const[n,r]=h.useState(()=>t||(typeof window<"u",w0));return h.useEffect(()=>{},[]),h.useEffect(()=>{typeof window<"u"},[n]),g.jsx(_0.Provider,{value:n,children:e})}function kt(){return h.useContext(_0)}const X_="modulepreload",J_=function(e){return"/"+e},Dh={},R=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){const i=document.getElementsByTagName("link");o=Promise.all(n.map(a=>{if(a=J_(a),a in Dh)return;Dh[a]=!0;const l=a.endsWith(".css"),s=l?'[rel="stylesheet"]':"";if(!!r)for(let c=i.length-1;c>=0;c--){const f=i[c];if(f.href===a&&(!l||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${s}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":X_,l||(d.as="script",d.crossOrigin=""),d.href=a,document.head.appendChild(d),l)return new Promise((c,f)=>{d.addEventListener("load",c),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${a}`)))})}))}return o.then(()=>t()).catch(i=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i})},Rd=[{lazy:()=>R(()=>import("./example-Q_NunrlP.js"),__vite__mapDeps([])),path:"/example",type:"mdx",filePath:"example.mdx"},{lazy:()=>R(()=>import("./example-Q_NunrlP.js"),__vite__mapDeps([])),path:"/example.html",type:"mdx",filePath:"example.mdx"},{lazy:()=>R(()=>import("./getting-started-_Glj4CGe.js"),__vite__mapDeps([])),path:"/getting-started",type:"mdx",filePath:"getting-started.md"},{lazy:()=>R(()=>import("./getting-started-_Glj4CGe.js"),__vite__mapDeps([])),path:"/getting-started.html",type:"mdx",filePath:"getting-started.md"},{lazy:()=>R(()=>import("./index-1gLgsY0X.js"),__vite__mapDeps([])),path:"/",type:"mdx",filePath:"index.mdx"},{lazy:()=>R(()=>import("./dojojs-ZrFOd_Kb.js"),__vite__mapDeps([])),path:"/client/dojojs",type:"mdx",filePath:"client/dojojs.md"},{lazy:()=>R(()=>import("./dojojs-ZrFOd_Kb.js"),__vite__mapDeps([])),path:"/client/dojojs.html",type:"mdx",filePath:"client/dojojs.md"},{lazy:()=>R(()=>import("./overview-oCI3OrOD.js"),__vite__mapDeps([])),path:"/client/overview",type:"mdx",filePath:"client/overview.md"},{lazy:()=>R(()=>import("./overview-oCI3OrOD.js"),__vite__mapDeps([])),path:"/client/overview.html",type:"mdx",filePath:"client/overview.md"},{lazy:()=>R(()=>import("./torii-plxfmtKY.js"),__vite__mapDeps([])),path:"/client/torii",type:"mdx",filePath:"client/torii.md"},{lazy:()=>R(()=>import("./torii-plxfmtKY.js"),__vite__mapDeps([])),path:"/client/torii.html",type:"mdx",filePath:"client/torii.md"},{lazy:()=>R(()=>import("./get-started-z5PBo8ll.js"),__vite__mapDeps([])),path:"/community/get-started",type:"mdx",filePath:"community/get-started.md"},{lazy:()=>R(()=>import("./get-started-z5PBo8ll.js"),__vite__mapDeps([])),path:"/community/get-started.html",type:"mdx",filePath:"community/get-started.md"},{lazy:()=>R(()=>import("./authorization-dlf1GSBt.js"),__vite__mapDeps([])),path:"/cairo/authorization",type:"mdx",filePath:"cairo/authorization.md"},{lazy:()=>R(()=>import("./authorization-dlf1GSBt.js"),__vite__mapDeps([])),path:"/cairo/authorization.html",type:"mdx",filePath:"cairo/authorization.md"},{lazy:()=>R(()=>import("./commands-ftWRoUrT.js"),__vite__mapDeps([])),path:"/cairo/commands",type:"mdx",filePath:"cairo/commands.md"},{lazy:()=>R(()=>import("./commands-ftWRoUrT.js"),__vite__mapDeps([])),path:"/cairo/commands.html",type:"mdx",filePath:"cairo/commands.md"},{lazy:()=>R(()=>import("./config-Hs2n6PbU.js"),__vite__mapDeps([])),path:"/cairo/config",type:"mdx",filePath:"cairo/config.md"},{lazy:()=>R(()=>import("./config-Hs2n6PbU.js"),__vite__mapDeps([])),path:"/cairo/config.html",type:"mdx",filePath:"cairo/config.md"},{lazy:()=>R(()=>import("./entities-L9f5z33X.js"),__vite__mapDeps([])),path:"/cairo/entities",type:"mdx",filePath:"cairo/entities.md"},{lazy:()=>R(()=>import("./entities-L9f5z33X.js"),__vite__mapDeps([])),path:"/cairo/entities.html",type:"mdx",filePath:"cairo/entities.md"},{lazy:()=>R(()=>import("./enum-L_BgoRY6.js"),__vite__mapDeps([])),path:"/cairo/enum",type:"mdx",filePath:"cairo/enum.md"},{lazy:()=>R(()=>import("./enum-L_BgoRY6.js"),__vite__mapDeps([])),path:"/cairo/enum.html",type:"mdx",filePath:"cairo/enum.md"},{lazy:()=>R(()=>import("./events-mCgQQxXl.js"),__vite__mapDeps([])),path:"/cairo/events",type:"mdx",filePath:"cairo/events.md"},{lazy:()=>R(()=>import("./events-mCgQQxXl.js"),__vite__mapDeps([])),path:"/cairo/events.html",type:"mdx",filePath:"cairo/events.md"},{lazy:()=>R(()=>import("./hello-dojo-a29ujx7Y.js"),__vite__mapDeps([])),path:"/cairo/hello-dojo",type:"mdx",filePath:"cairo/hello-dojo.md"},{lazy:()=>R(()=>import("./hello-dojo-a29ujx7Y.js"),__vite__mapDeps([])),path:"/cairo/hello-dojo.html",type:"mdx",filePath:"cairo/hello-dojo.md"},{lazy:()=>R(()=>import("./metadata-_R8xKgtY.js"),__vite__mapDeps([])),path:"/cairo/metadata",type:"mdx",filePath:"cairo/metadata.md"},{lazy:()=>R(()=>import("./metadata-_R8xKgtY.js"),__vite__mapDeps([])),path:"/cairo/metadata.html",type:"mdx",filePath:"cairo/metadata.md"},{lazy:()=>R(()=>import("./migration-VRLLzZlR.js"),__vite__mapDeps([])),path:"/cairo/migration",type:"mdx",filePath:"cairo/migration.md"},{lazy:()=>R(()=>import("./migration-VRLLzZlR.js"),__vite__mapDeps([])),path:"/cairo/migration.html",type:"mdx",filePath:"cairo/migration.md"},{lazy:()=>R(()=>import("./models-BIgvTGgw.js"),__vite__mapDeps([])),path:"/cairo/models",type:"mdx",filePath:"cairo/models.md"},{lazy:()=>R(()=>import("./models-BIgvTGgw.js"),__vite__mapDeps([])),path:"/cairo/models.html",type:"mdx",filePath:"cairo/models.md"},{lazy:()=>R(()=>import("./origami-c05UNJ02.js"),__vite__mapDeps([])),path:"/cairo/origami",type:"mdx",filePath:"cairo/origami.md"},{lazy:()=>R(()=>import("./origami-c05UNJ02.js"),__vite__mapDeps([])),path:"/cairo/origami.html",type:"mdx",filePath:"cairo/origami.md"},{lazy:()=>R(()=>import("./overview-1_4YeOzi.js"),__vite__mapDeps([])),path:"/cairo/overview",type:"mdx",filePath:"cairo/overview.md"},{lazy:()=>R(()=>import("./overview-1_4YeOzi.js"),__vite__mapDeps([])),path:"/cairo/overview.html",type:"mdx",filePath:"cairo/overview.md"},{lazy:()=>R(()=>import("./systems-Zj0xof5B.js"),__vite__mapDeps([])),path:"/cairo/systems",type:"mdx",filePath:"cairo/systems.md"},{lazy:()=>R(()=>import("./systems-Zj0xof5B.js"),__vite__mapDeps([])),path:"/cairo/systems.html",type:"mdx",filePath:"cairo/systems.md"},{lazy:()=>R(()=>import("./testing-NtBMGpQw.js"),__vite__mapDeps([])),path:"/cairo/testing",type:"mdx",filePath:"cairo/testing.md"},{lazy:()=>R(()=>import("./testing-NtBMGpQw.js"),__vite__mapDeps([])),path:"/cairo/testing.html",type:"mdx",filePath:"cairo/testing.md"},{lazy:()=>R(()=>import("./world-vFW-p2ED.js"),__vite__mapDeps([])),path:"/cairo/world",type:"mdx",filePath:"cairo/world.md"},{lazy:()=>R(()=>import("./world-vFW-p2ED.js"),__vite__mapDeps([])),path:"/cairo/world.html",type:"mdx",filePath:"cairo/world.md"},{lazy:()=>R(()=>import("./locally-cPsTVd1T.js"),__vite__mapDeps([])),path:"/deployment/locally",type:"mdx",filePath:"deployment/locally.md"},{lazy:()=>R(()=>import("./locally-cPsTVd1T.js"),__vite__mapDeps([])),path:"/deployment/locally.html",type:"mdx",filePath:"deployment/locally.md"},{lazy:()=>R(()=>import("./remote-Wmy08Tq_.js"),__vite__mapDeps([])),path:"/deployment/remote",type:"mdx",filePath:"deployment/remote.md"},{lazy:()=>R(()=>import("./remote-Wmy08Tq_.js"),__vite__mapDeps([])),path:"/deployment/remote.html",type:"mdx",filePath:"deployment/remote.md"},{lazy:()=>R(()=>import("./contributing-DkpHwxDe.js"),__vite__mapDeps([])),path:"/getting-started/contributing",type:"mdx",filePath:"getting-started/contributing.md"},{lazy:()=>R(()=>import("./contributing-DkpHwxDe.js"),__vite__mapDeps([])),path:"/getting-started/contributing.html",type:"mdx",filePath:"getting-started/contributing.md"},{lazy:()=>R(()=>import("./from-source-MHUyfUZR.js"),__vite__mapDeps([])),path:"/getting-started/from-source",type:"mdx",filePath:"getting-started/from-source.md"},{lazy:()=>R(()=>import("./from-source-MHUyfUZR.js"),__vite__mapDeps([])),path:"/getting-started/from-source.html",type:"mdx",filePath:"getting-started/from-source.md"},{lazy:()=>R(()=>import("./quick-start-wS1fd9tk.js"),__vite__mapDeps([])),path:"/getting-started/quick-start",type:"mdx",filePath:"getting-started/quick-start.md"},{lazy:()=>R(()=>import("./quick-start-wS1fd9tk.js"),__vite__mapDeps([])),path:"/getting-started/quick-start.html",type:"mdx",filePath:"getting-started/quick-start.md"},{lazy:()=>R(()=>import("./setup-xdoxF8F9.js"),__vite__mapDeps([])),path:"/getting-started/setup",type:"mdx",filePath:"getting-started/setup.md"},{lazy:()=>R(()=>import("./setup-xdoxF8F9.js"),__vite__mapDeps([])),path:"/getting-started/setup.html",type:"mdx",filePath:"getting-started/setup.md"},{lazy:()=>R(()=>import("./contributors-xNmRd5Bd.js"),__vite__mapDeps([])),path:"/misc/contributors",type:"mdx",filePath:"misc/contributors.md"},{lazy:()=>R(()=>import("./contributors-xNmRd5Bd.js"),__vite__mapDeps([])),path:"/misc/contributors.html",type:"mdx",filePath:"misc/contributors.md"},{lazy:()=>R(()=>import("./autonomous-worlds-UrU3SVOV.js"),__vite__mapDeps([])),path:"/theory/autonomous-worlds",type:"mdx",filePath:"theory/autonomous-worlds.md"},{lazy:()=>R(()=>import("./autonomous-worlds-UrU3SVOV.js"),__vite__mapDeps([])),path:"/theory/autonomous-worlds.html",type:"mdx",filePath:"theory/autonomous-worlds.md"},{lazy:()=>R(()=>import("./cairo-i-pmMZtw.js"),__vite__mapDeps([])),path:"/theory/cairo",type:"mdx",filePath:"theory/cairo.md"},{lazy:()=>R(()=>import("./cairo-i-pmMZtw.js"),__vite__mapDeps([])),path:"/theory/cairo.html",type:"mdx",filePath:"theory/cairo.md"},{lazy:()=>R(()=>import("./faqs-3apNa4yg.js"),__vite__mapDeps([])),path:"/theory/faqs",type:"mdx",filePath:"theory/faqs.md"},{lazy:()=>R(()=>import("./faqs-3apNa4yg.js"),__vite__mapDeps([])),path:"/theory/faqs.html",type:"mdx",filePath:"theory/faqs.md"},{lazy:()=>R(()=>import("./what-is-dojo-skF15-K7.js"),__vite__mapDeps([])),path:"/theory/what-is-dojo",type:"mdx",filePath:"theory/what-is-dojo.md"},{lazy:()=>R(()=>import("./what-is-dojo-skF15-K7.js"),__vite__mapDeps([])),path:"/theory/what-is-dojo.html",type:"mdx",filePath:"theory/what-is-dojo.md"},{lazy:()=>R(()=>import("./dojoup-qpY2zNHi.js"),__vite__mapDeps([])),path:"/toolchain/dojoup",type:"mdx",filePath:"toolchain/dojoup.md"},{lazy:()=>R(()=>import("./dojoup-qpY2zNHi.js"),__vite__mapDeps([])),path:"/toolchain/dojoup.html",type:"mdx",filePath:"toolchain/dojoup.md"},{lazy:()=>R(()=>import("./0.3.0-AZn_7z6m.js"),__vite__mapDeps([])),path:"/cairo/migration/0",type:"mdx",filePath:"cairo/migration/0.3.0.md"},{lazy:()=>R(()=>import("./0.3.0-AZn_7z6m.js"),__vite__mapDeps([])),path:"/cairo/migration/0.html",type:"mdx",filePath:"cairo/migration/0.3.0.md"},{lazy:()=>R(()=>import("./0.4.0-CJRbBQ2I.js"),__vite__mapDeps([])),path:"/cairo/migration/0",type:"mdx",filePath:"cairo/migration/0.4.0.md"},{lazy:()=>R(()=>import("./0.4.0-CJRbBQ2I.js"),__vite__mapDeps([])),path:"/cairo/migration/0.html",type:"mdx",filePath:"cairo/migration/0.4.0.md"},{lazy:()=>R(()=>import("./c-R3TqCmsF.js"),__vite__mapDeps([])),path:"/client/sdk/c",type:"mdx",filePath:"client/sdk/c.md"},{lazy:()=>R(()=>import("./c-R3TqCmsF.js"),__vite__mapDeps([])),path:"/client/sdk/c.html",type:"mdx",filePath:"client/sdk/c.md"},{lazy:()=>R(()=>import("./dojojs-wYt-TGOs.js"),__vite__mapDeps([])),path:"/client/sdk/dojojs",type:"mdx",filePath:"client/sdk/dojojs.md"},{lazy:()=>R(()=>import("./dojojs-wYt-TGOs.js"),__vite__mapDeps([])),path:"/client/sdk/dojojs.html",type:"mdx",filePath:"client/sdk/dojojs.md"},{lazy:()=>R(()=>import("./unity-6JzmRrbN.js"),__vite__mapDeps([])),path:"/client/sdk/unity",type:"mdx",filePath:"client/sdk/unity.md"},{lazy:()=>R(()=>import("./unity-6JzmRrbN.js"),__vite__mapDeps([])),path:"/client/sdk/unity.html",type:"mdx",filePath:"client/sdk/unity.md"},{lazy:()=>R(()=>import("./development-fnTH7DD-.js"),__vite__mapDeps([])),path:"/toolchain/katana/development",type:"mdx",filePath:"toolchain/katana/development.md"},{lazy:()=>R(()=>import("./development-fnTH7DD-.js"),__vite__mapDeps([])),path:"/toolchain/katana/development.html",type:"mdx",filePath:"toolchain/katana/development.md"},{lazy:()=>R(()=>import("./overview-mNwg_WUI.js"),__vite__mapDeps([])),path:"/toolchain/katana/overview",type:"mdx",filePath:"toolchain/katana/overview.md"},{lazy:()=>R(()=>import("./overview-mNwg_WUI.js"),__vite__mapDeps([])),path:"/toolchain/katana/overview.html",type:"mdx",filePath:"toolchain/katana/overview.md"},{lazy:()=>R(()=>import("./reference-Kzn8R6aJ.js"),__vite__mapDeps([])),path:"/toolchain/katana/reference",type:"mdx",filePath:"toolchain/katana/reference.md"},{lazy:()=>R(()=>import("./reference-Kzn8R6aJ.js"),__vite__mapDeps([])),path:"/toolchain/katana/reference.html",type:"mdx",filePath:"toolchain/katana/reference.md"},{lazy:()=>R(()=>import("./overview-kL5rWS2u.js"),__vite__mapDeps([])),path:"/toolchain/slot/overview",type:"mdx",filePath:"toolchain/slot/overview.md"},{lazy:()=>R(()=>import("./overview-kL5rWS2u.js"),__vite__mapDeps([])),path:"/toolchain/slot/overview.html",type:"mdx",filePath:"toolchain/slot/overview.md"},{lazy:()=>R(()=>import("./reference-YEtbbTw1.js"),__vite__mapDeps([])),path:"/toolchain/slot/reference",type:"mdx",filePath:"toolchain/slot/reference.md"},{lazy:()=>R(()=>import("./reference-YEtbbTw1.js"),__vite__mapDeps([])),path:"/toolchain/slot/reference.html",type:"mdx",filePath:"toolchain/slot/reference.md"},{lazy:()=>R(()=>import("./development-7QOhB7-a.js"),__vite__mapDeps([])),path:"/toolchain/sozo/development",type:"mdx",filePath:"toolchain/sozo/development.md"},{lazy:()=>R(()=>import("./development-7QOhB7-a.js"),__vite__mapDeps([])),path:"/toolchain/sozo/development.html",type:"mdx",filePath:"toolchain/sozo/development.md"},{lazy:()=>R(()=>import("./overview-0xDPAt9E.js"),__vite__mapDeps([])),path:"/toolchain/sozo/overview",type:"mdx",filePath:"toolchain/sozo/overview.md"},{lazy:()=>R(()=>import("./overview-0xDPAt9E.js"),__vite__mapDeps([])),path:"/toolchain/sozo/overview.html",type:"mdx",filePath:"toolchain/sozo/overview.md"},{lazy:()=>R(()=>import("./reference-Amyb_7Dy.js"),__vite__mapDeps([])),path:"/toolchain/sozo/reference",type:"mdx",filePath:"toolchain/sozo/reference.md"},{lazy:()=>R(()=>import("./reference-Amyb_7Dy.js"),__vite__mapDeps([])),path:"/toolchain/sozo/reference.html",type:"mdx",filePath:"toolchain/sozo/reference.md"},{lazy:()=>R(()=>import("./graphql-KVzmm7by.js"),__vite__mapDeps([])),path:"/toolchain/torii/graphql",type:"mdx",filePath:"toolchain/torii/graphql.md"},{lazy:()=>R(()=>import("./graphql-KVzmm7by.js"),__vite__mapDeps([])),path:"/toolchain/torii/graphql.html",type:"mdx",filePath:"toolchain/torii/graphql.md"},{lazy:()=>R(()=>import("./grpc-QEmJ8ux5.js"),__vite__mapDeps([])),path:"/toolchain/torii/grpc",type:"mdx",filePath:"toolchain/torii/grpc.md"},{lazy:()=>R(()=>import("./grpc-QEmJ8ux5.js"),__vite__mapDeps([])),path:"/toolchain/torii/grpc.html",type:"mdx",filePath:"toolchain/torii/grpc.md"},{lazy:()=>R(()=>import("./overview-YSYgj0Zr.js"),__vite__mapDeps([])),path:"/toolchain/torii/overview",type:"mdx",filePath:"toolchain/torii/overview.md"},{lazy:()=>R(()=>import("./overview-YSYgj0Zr.js"),__vite__mapDeps([])),path:"/toolchain/torii/overview.html",type:"mdx",filePath:"toolchain/torii/overview.md"},{lazy:()=>R(()=>import("./reference-Q9lg16nI.js"),__vite__mapDeps([])),path:"/toolchain/torii/reference",type:"mdx",filePath:"toolchain/torii/reference.md"},{lazy:()=>R(()=>import("./reference-Q9lg16nI.js"),__vite__mapDeps([])),path:"/toolchain/torii/reference.html",type:"mdx",filePath:"toolchain/torii/reference.md"},{lazy:()=>R(()=>import("./main-1N4wUr9G.js"),__vite__mapDeps([])),path:"/tutorial/deploy-using-slot/main",type:"mdx",filePath:"tutorial/deploy-using-slot/main.md"},{lazy:()=>R(()=>import("./main-1N4wUr9G.js"),__vite__mapDeps([])),path:"/tutorial/deploy-using-slot/main.html",type:"mdx",filePath:"tutorial/deploy-using-slot/main.md"},{lazy:()=>R(()=>import("./0-setup-URPrfAiZ.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/0-setup",type:"mdx",filePath:"tutorial/onchain-chess/0-setup.md"},{lazy:()=>R(()=>import("./0-setup-URPrfAiZ.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/0-setup.html",type:"mdx",filePath:"tutorial/onchain-chess/0-setup.md"},{lazy:()=>R(()=>import("./1-action-3KNsFnxH.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/1-action",type:"mdx",filePath:"tutorial/onchain-chess/1-action.md"},{lazy:()=>R(()=>import("./1-action-3KNsFnxH.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/1-action.html",type:"mdx",filePath:"tutorial/onchain-chess/1-action.md"},{lazy:()=>R(()=>import("./2-move-3vyTeY25.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/2-move",type:"mdx",filePath:"tutorial/onchain-chess/2-move.md"},{lazy:()=>R(()=>import("./2-move-3vyTeY25.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/2-move.html",type:"mdx",filePath:"tutorial/onchain-chess/2-move.md"},{lazy:()=>R(()=>import("./3-test-crEB-KfZ.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/3-test",type:"mdx",filePath:"tutorial/onchain-chess/3-test.md"},{lazy:()=>R(()=>import("./3-test-crEB-KfZ.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/3-test.html",type:"mdx",filePath:"tutorial/onchain-chess/3-test.md"},{lazy:()=>R(()=>import("./README-_8R6Nb1A.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/README",type:"mdx",filePath:"tutorial/onchain-chess/README.md"},{lazy:()=>R(()=>import("./README-_8R6Nb1A.js"),__vite__mapDeps([])),path:"/tutorial/onchain-chess/README.html",type:"mdx",filePath:"tutorial/onchain-chess/README.md"},{lazy:()=>R(()=>import("./deployments-j27idhgy.js"),__vite__mapDeps([])),path:"/toolchain/slot/deployments-commands/deployments",type:"mdx",filePath:"toolchain/slot/deployments-commands/deployments.md"},{lazy:()=>R(()=>import("./deployments-j27idhgy.js"),__vite__mapDeps([])),path:"/toolchain/slot/deployments-commands/deployments.html",type:"mdx",filePath:"toolchain/slot/deployments-commands/deployments.md"},{lazy:()=>R(()=>import("./account-options-z9jbWLBd.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/account-options",type:"mdx",filePath:"toolchain/sozo/common/account-options.md"},{lazy:()=>R(()=>import("./account-options-z9jbWLBd.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/account-options.html",type:"mdx",filePath:"toolchain/sozo/common/account-options.md"},{lazy:()=>R(()=>import("./signer-options-keystore-MrGUSaHf.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/signer-options-keystore",type:"mdx",filePath:"toolchain/sozo/common/signer-options-keystore.md"},{lazy:()=>R(()=>import("./signer-options-keystore-MrGUSaHf.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/signer-options-keystore.html",type:"mdx",filePath:"toolchain/sozo/common/signer-options-keystore.md"},{lazy:()=>R(()=>import("./signer-options-raw-EMh7FC6H.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/signer-options-raw",type:"mdx",filePath:"toolchain/sozo/common/signer-options-raw.md"},{lazy:()=>R(()=>import("./signer-options-raw-EMh7FC6H.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/signer-options-raw.html",type:"mdx",filePath:"toolchain/sozo/common/signer-options-raw.md"},{lazy:()=>R(()=>import("./starknet-options-9t73ffGJ.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/starknet-options",type:"mdx",filePath:"toolchain/sozo/common/starknet-options.md"},{lazy:()=>R(()=>import("./starknet-options-9t73ffGJ.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/starknet-options.html",type:"mdx",filePath:"toolchain/sozo/common/starknet-options.md"},{lazy:()=>R(()=>import("./world-options-GVwfXmVB.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/world-options",type:"mdx",filePath:"toolchain/sozo/common/world-options.md"},{lazy:()=>R(()=>import("./world-options-GVwfXmVB.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common/world-options.html",type:"mdx",filePath:"toolchain/sozo/common/world-options.md"},{lazy:()=>R(()=>import("./offline-GhfX_FSu.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common-options/offline",type:"mdx",filePath:"toolchain/sozo/common-options/offline.md"},{lazy:()=>R(()=>import("./offline-GhfX_FSu.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common-options/offline.html",type:"mdx",filePath:"toolchain/sozo/common-options/offline.md"},{lazy:()=>R(()=>import("./profile-BF-BPoNG.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common-options/profile",type:"mdx",filePath:"toolchain/sozo/common-options/profile.md"},{lazy:()=>R(()=>import("./profile-BF-BPoNG.js"),__vite__mapDeps([])),path:"/toolchain/sozo/common-options/profile.html",type:"mdx",filePath:"toolchain/sozo/common-options/profile.md"},{lazy:()=>R(()=>import("./build-9ezMYoJh.js"),__vite__mapDeps([])),path:"/toolchain/sozo/project-commands/build",type:"mdx",filePath:"toolchain/sozo/project-commands/build.md"},{lazy:()=>R(()=>import("./build-9ezMYoJh.js"),__vite__mapDeps([])),path:"/toolchain/sozo/project-commands/build.html",type:"mdx",filePath:"toolchain/sozo/project-commands/build.md"},{lazy:()=>R(()=>import("./init-yrb-8U3j.js"),__vite__mapDeps([])),path:"/toolchain/sozo/project-commands/init",type:"mdx",filePath:"toolchain/sozo/project-commands/init.md"},{lazy:()=>R(()=>import("./init-yrb-8U3j.js"),__vite__mapDeps([])),path:"/toolchain/sozo/project-commands/init.html",type:"mdx",filePath:"toolchain/sozo/project-commands/init.md"},{lazy:()=>R(()=>import("./migrate-JW9j5S22.js"),__vite__mapDeps([])),path:"/toolchain/sozo/project-commands/migrate",type:"mdx",filePath:"toolchain/sozo/project-commands/migrate.md"},{lazy:()=>R(()=>import("./migrate-JW9j5S22.js"),__vite__mapDeps([])),path:"/toolchain/sozo/project-commands/migrate.html",type:"mdx",filePath:"toolchain/sozo/project-commands/migrate.md"},{lazy:()=>R(()=>import("./test-hYP7ueFm.js"),__vite__mapDeps([])),path:"/toolchain/sozo/project-commands/test",type:"mdx",filePath:"toolchain/sozo/project-commands/test.md"},{lazy:()=>R(()=>import("./test-hYP7ueFm.js"),__vite__mapDeps([])),path:"/toolchain/sozo/project-commands/test.html",type:"mdx",filePath:"toolchain/sozo/project-commands/test.md"},{lazy:()=>R(()=>import("./auth-gB0tTmD1.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/auth",type:"mdx",filePath:"toolchain/sozo/world-commands/auth.md"},{lazy:()=>R(()=>import("./auth-gB0tTmD1.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/auth.html",type:"mdx",filePath:"toolchain/sozo/world-commands/auth.md"},{lazy:()=>R(()=>import("./events-015oQFnl.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/events",type:"mdx",filePath:"toolchain/sozo/world-commands/events.md"},{lazy:()=>R(()=>import("./events-015oQFnl.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/events.html",type:"mdx",filePath:"toolchain/sozo/world-commands/events.md"},{lazy:()=>R(()=>import("./execute-ySEEuKVc.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/execute",type:"mdx",filePath:"toolchain/sozo/world-commands/execute.md"},{lazy:()=>R(()=>import("./execute-ySEEuKVc.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/execute.html",type:"mdx",filePath:"toolchain/sozo/world-commands/execute.md"},{lazy:()=>R(()=>import("./model-cgjH83bt.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/model",type:"mdx",filePath:"toolchain/sozo/world-commands/model.md"},{lazy:()=>R(()=>import("./model-cgjH83bt.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/model.html",type:"mdx",filePath:"toolchain/sozo/world-commands/model.md"},{lazy:()=>R(()=>import("./register-6ALlJdbf.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/register",type:"mdx",filePath:"toolchain/sozo/world-commands/register.md"},{lazy:()=>R(()=>import("./register-6ALlJdbf.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/register.html",type:"mdx",filePath:"toolchain/sozo/world-commands/register.md"},{lazy:()=>R(()=>import("./system-4mpOFZD1.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/system",type:"mdx",filePath:"toolchain/sozo/world-commands/system.md"},{lazy:()=>R(()=>import("./system-4mpOFZD1.js"),__vite__mapDeps([])),path:"/toolchain/sozo/world-commands/system.html",type:"mdx",filePath:"toolchain/sozo/world-commands/system.md"}];var Ns={horizontalPadding:"var(--vocs-content_horizontalPadding)",verticalPadding:"var(--vocs-content_verticalPadding)",width:"var(--vocs-content_width)"},q_={default:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif",mono:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},e2={default:"var(--vocs-fontFamily_default)",mono:"var(--vocs-fontFamily_mono)"},As={0:"var(--vocs-space_0)",1:"var(--vocs-space_1)",2:"var(--vocs-space_2)",3:"var(--vocs-space_3)",4:"var(--vocs-space_4)",6:"var(--vocs-space_6)",8:"var(--vocs-space_8)",12:"var(--vocs-space_12)",14:"var(--vocs-space_14)",16:"var(--vocs-space_16)",18:"var(--vocs-space_18)",20:"var(--vocs-space_20)",22:"var(--vocs-space_22)",24:"var(--vocs-space_24)",28:"var(--vocs-space_28)",32:"var(--vocs-space_32)",36:"var(--vocs-space_36)",40:"var(--vocs-space_40)",44:"var(--vocs-space_44)",48:"var(--vocs-space_48)",56:"var(--vocs-space_56)",64:"var(--vocs-space_64)",72:"var(--vocs-space_72)",80:"var(--vocs-space_80)"};function E0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;tg.jsx("a",{ref:i,className:O(e,n||typeof t!="string"?void 0:t2),href:r,target:"_blank",rel:"noopener noreferrer",...o,children:t}));var Mh="vocs_Link_accent_underlined",jh="vocs_Link",Fh="vocs_Link_styleless",Jc=new Map,da=new WeakMap,zh=0,r2=void 0;function o2(e){return e?(da.has(e)||(zh+=1,da.set(e,zh.toString())),da.get(e)):"0"}function i2(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?o2(e.root):e[t]}`).toString()}function a2(e){let t=i2(e),n=Jc.get(t);if(!n){const r=new Map;let o;const i=new IntersectionObserver(a=>{a.forEach(l=>{var s;const u=l.isIntersecting&&o.some(d=>l.intersectionRatio>=d);e.trackVisibility&&typeof l.isVisible>"u"&&(l.isVisible=u),(s=r.get(l.target))==null||s.forEach(d=>{d(u,l)})})},e);o=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:i,elements:r},Jc.set(t,n)}return n}function l2(e,t,n={},r=r2){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const s=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:s,intersectionRect:s,rootBounds:s}),()=>{}}const{id:o,observer:i,elements:a}=a2(n);let l=a.get(e)||[];return a.has(e)||a.set(e,l),l.push(t),i.observe(e),function(){l.splice(l.indexOf(t),1),l.length===0&&(a.delete(e),i.unobserve(e)),a.size===0&&(i.disconnect(),Jc.delete(o))}}function C0({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:o,triggerOnce:i,skip:a,initialInView:l,fallbackInView:s,onChange:u}={}){var d;const[c,f]=h.useState(null),p=h.useRef(),[x,y]=h.useState({inView:!!l,entry:void 0});p.current=u,h.useEffect(()=>{if(a||!c)return;let w;return w=l2(c,(E,S)=>{y({inView:E,entry:S}),p.current&&p.current(E,S),S.isIntersecting&&i&&w&&(w(),w=void 0)},{root:o,rootMargin:r,threshold:e,trackVisibility:n,delay:t},s),()=>{w&&w()}},[Array.isArray(e)?e.toString():e,c,o,r,i,a,n,s,t]);const _=(d=x.entry)==null?void 0:d.target,m=h.useRef();!c&&_&&!i&&!a&&m.current!==_&&(m.current=_,y({inView:!!l,entry:void 0}));const v=[f,x.inView,x.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}function s2(...e){return t=>{c2(t,...e)}}function c2(e,...t){t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}const Un=h.forwardRef((e,t)=>{const n=()=>{var i;return(i=Rd.find(a=>a.path===e.to))==null?void 0:i.lazy()},{ref:r,inView:o}=C0();return h.useEffect(()=>{o&&n()},[o,n]),g.jsx(x0,{ref:s2(t,r),...e})}),Zt=h.forwardRef((e,t)=>{const{href:n,variant:r="accent underlined"}=e,{pathname:o}=be();if(n!=null&&n.match(/^(www|https?)/))return g.jsx(n2,{...e,ref:t,className:O(e.className,jh,r==="accent underlined"&&Mh,r==="styleless"&&Fh),hideExternalIcon:e.hideExternalIcon});const[i,a]=(n||"").split("#"),l=`${i||o}${a?`#${a}`:""}`;return g.jsx(Un,{...e,ref:t,className:O(e.className,jh,r==="accent underlined"&&Mh,r==="styleless"&&Fh),to:l})});var u2="vocs_NotFound_divider",d2="vocs_NotFound",f2="vocs_H1",S0="vocs_Heading",b0="vocs_Heading_slugTarget";function Co({level:e,...t}){const n=`h${e}`;return g.jsxs(n,{...t,id:void 0,className:O(t.className,S0),children:[g.jsx("div",{id:t.id,className:b0}),t.children]})}function T0(e){return g.jsx(Co,{...e,className:O(e.className,f2),level:1})}var h2="vocs_Paragraph";function P0(e){return g.jsx("p",{...e,className:O(e.className,h2)})}function p2(){return g.jsxs("div",{className:d2,children:[g.jsx(T0,{children:"Page Not Found"}),g.jsx("div",{style:{height:As[24]}}),g.jsx("hr",{className:u2}),g.jsx("div",{style:{height:As[24]}}),g.jsx(P0,{children:"The page you were looking for could not be found."}),g.jsx("div",{style:{height:As[8]}}),g.jsx(Zt,{href:"/",children:"Go to Home Page"})]})}function Vh(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function m2(e,t){var n=e;for(var r of t){if(!(r in n))throw new Error("Path ".concat(t.join(" -> ")," does not exist in object"));n=n[r]}return n}function $0(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=e.constructor();for(var o in e){var i=e[o],a=[...n,o];typeof i=="string"||typeof i=="number"||i==null?r[o]=t(i,a):typeof i=="object"&&!Array.isArray(i)?r[o]=$0(i,t,a):console.warn('Skipping invalid key "'.concat(a.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(i)?"Array":typeof i,'"'))}return r}function xr(e,t){var n={};if(typeof t=="object"){var r=e;$0(t,(l,s)=>{if(l!=null){var u=m2(r,s);n[Vh(u)]=String(l)}})}else{var o=e;for(var i in o){var a=o[i];a!=null&&(n[Vh(i)]=a)}}return Object.defineProperty(n,"toString",{value:function(){return Object.keys(this).map(s=>"".concat(s,":").concat(this[s])).join(";")},writable:!1}),n}var v2="var(--vocs_Banner_bannerBackgroundColor)",g2="var(--vocs_Banner_bannerHeight)",y2="var(--vocs_Banner_bannerTextColor)",x2="vocs_Banner_closeButton",w2="vocs_Banner_content",_2="vocs_Banner_inner",E2="vocs_Banner";const C2=Object.getPrototypeOf(S2).constructor;async function S2(e,t){return new C2(String(e))(t)}function b2(e,t){return new Function(String(e))(t)}function So(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var T2=["color"],P2=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=So(e,T2);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M6.85355 3.14645C7.04882 3.34171 7.04882 3.65829 6.85355 3.85355L3.70711 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H3.70711L6.85355 11.1464C7.04882 11.3417 7.04882 11.6583 6.85355 11.8536C6.65829 12.0488 6.34171 12.0488 6.14645 11.8536L2.14645 7.85355C1.95118 7.65829 1.95118 7.34171 2.14645 7.14645L6.14645 3.14645C6.34171 2.95118 6.65829 2.95118 6.85355 3.14645Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),$2=["color"],R2=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=So(e,$2);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),k2=["color"],N2=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=So(e,k2);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),A2=["color"],O2=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=So(e,A2);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M3.5 2C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V6H8.5C8.22386 6 8 5.77614 8 5.5V2H3.5ZM9 2.70711L11.2929 5H9V2.70711ZM2 2.5C2 1.67157 2.67157 1 3.5 1H8.5C8.63261 1 8.75979 1.05268 8.85355 1.14645L12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5V12.5C13 13.3284 12.3284 14 11.5 14H3.5C2.67157 14 2 13.3284 2 12.5V2.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),L2=["color"],I2=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=So(e,L2);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M1.5 5.25C1.91421 5.25 2.25 4.91421 2.25 4.5C2.25 4.08579 1.91421 3.75 1.5 3.75C1.08579 3.75 0.75 4.08579 0.75 4.5C0.75 4.91421 1.08579 5.25 1.5 5.25ZM4 4.5C4 4.22386 4.22386 4 4.5 4H13.5C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H4.5C4.22386 5 4 4.77614 4 4.5ZM4.5 7C4.22386 7 4 7.22386 4 7.5C4 7.77614 4.22386 8 4.5 8H13.5C13.7761 8 14 7.77614 14 7.5C14 7.22386 13.7761 7 13.5 7H4.5ZM4.5 10C4.22386 10 4 10.2239 4 10.5C4 10.7761 4.22386 11 4.5 11H13.5C13.7761 11 14 10.7761 14 10.5C14 10.2239 13.7761 10 13.5 10H4.5ZM2.25 7.5C2.25 7.91421 1.91421 8.25 1.5 8.25C1.08579 8.25 0.75 7.91421 0.75 7.5C0.75 7.08579 1.08579 6.75 1.5 6.75C1.91421 6.75 2.25 7.08579 2.25 7.5ZM1.5 11.25C1.91421 11.25 2.25 10.9142 2.25 10.5C2.25 10.0858 1.91421 9.75 1.5 9.75C1.08579 9.75 0.75 10.0858 0.75 10.5C0.75 10.9142 1.08579 11.25 1.5 11.25Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),D2=["color"],kd=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=So(e,D2);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function qc(e,t){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map((r,o)=>qc(r,o));const n=e.props.children?{...e.props,children:qc(e.props.children)}:e.props;return G.createElement(e.type,{...n,key:t})}function M2({hide:e}){const{banner:t}=kt(),n=h.useMemo(()=>{const r=(t==null?void 0:t.content)??"";if(!r)return null;if(typeof r!="string")return()=>qc(r);const{default:o}=b2(r,{...my,Fragment:h.Fragment});return o},[t]);return n?g.jsx("div",{className:O(E2),style:xr({[v2]:t==null?void 0:t.backgroundColor,[y2]:t==null?void 0:t.textColor}),children:g.jsxs("div",{className:O(_2),children:[g.jsx("div",{className:O(w2),children:g.jsx(n,{})}),(t==null?void 0:t.dismissable)!=="false"&&g.jsx("button",{className:O(x2),onClick:e,type:"button",children:g.jsx(N2,{width:14,height:14})})]})}):null}var j2="vocs_Content";function R0({children:e,className:t}){return g.jsx("article",{className:O(t,j2),children:e})}function k0({items:e,pathname:t}){const n=t.replace(/\.html$/,""),r=[];for(const o of e)(o.link&&n.startsWith(o.match||o.link)||o.items&&k0({items:o.items,pathname:t}).length>0)&&r.push(o.id);return r}function ji({items:e,pathname:t}){return h.useMemo(()=>k0({items:e,pathname:t}),[e,t])}function bo(){const e=h.useContext(N0);if(!e)throw new Error("`usePageData` must be used within `PageDataContext.Provider`.");return e}const N0=h.createContext(void 0);function Il(){const{pathname:e}=be(),t=kt(),{sidebar:n}=t;if(!n)return{items:[]};if(Array.isArray(n))return{items:n};const r=h.useMemo(()=>{const o=Object.keys(n).filter(i=>e.startsWith(i));return o[o.length-1]},[n,e]);return r?Array.isArray(n[r])?{key:r,items:n[r]}:{...n[r],key:r}:{items:[]}}function br(){const e=Il(),{frontmatter:t}=bo(),{layout:n,showLogo:r,showOutline:o,showSidebar:i,showTopNav:a}=t||{},l=n??"docs";return{layout:l,get showLogo(){return typeof r<"u"?r:!0},get showOutline(){return typeof o<"u"?o:l==="docs"},get showSidebar(){return e.items.length===0?!1:typeof i<"u"?i:!(l==="minimal"||l==="landing")},get showTopNav(){return typeof a<"u"?a:!0}}}function F2(){const[e,t]=h.useState(()=>{if(!(typeof window>"u")){if(localStorage.getItem("vocs.theme")){const n=localStorage.getItem("vocs.theme");if(n)return n}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}});return h.useEffect(()=>{e&&localStorage.setItem("vocs.theme",e),e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),{theme:e,toggle(){t(n=>n==="light"?"dark":"light")}}}var z2="vocs_utils_visibleDark",V2="vocs_utils_visibleLight",A0="vocs_utils_visuallyHidden";function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach(n=>B2(n,t))}function Me(...e){return h.useCallback(O0(...e),e)}function gn(e,t=[]){let n=[];function r(i,a){const l=h.createContext(a),s=n.length;n=[...n,a];function u(c){const{scope:f,children:p,...x}=c,y=(f==null?void 0:f[e][s])||l,_=h.useMemo(()=>x,Object.values(x));return h.createElement(y.Provider,{value:_},p)}function d(c,f){const p=(f==null?void 0:f[e][s])||l,x=h.useContext(p);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(a=>h.createContext(a));return function(l){const s=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:s}}),[l,s])}};return o.scopeName=e,[r,U2(o,...t)]}function U2(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((l,{useScope:s,scopeName:u})=>{const c=s(i)[`__scope${u}`];return{...l,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}const dn=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},H2=Zp.useId||(()=>{});let W2=0;function Xt(e){const[t,n]=h.useState(H2());return dn(()=>{e||n(r=>r??String(W2++))},[e]),e||(t?`radix-${t}`:"")}function et(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Jn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=K2({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,l=et(n),s=h.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&l(c)}else o(u)},[i,e,o,l]);return[a,s]}function K2({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,o=h.useRef(r),i=et(t);return h.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const vo=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(Y2);if(i){const a=i.props.children,l=o.map(s=>s===i?h.Children.count(a)>1?h.Children.only(null):h.isValidElement(a)?a.props.children:null:s);return h.createElement(eu,H({},r,{ref:t}),h.isValidElement(a)?h.cloneElement(a,void 0,l):null)}return h.createElement(eu,H({},r,{ref:t}),n)});vo.displayName="Slot";const eu=h.forwardRef((e,t)=>{const{children:n,...r}=e;return h.isValidElement(n)?h.cloneElement(n,{...Q2(r,n.props),ref:t?O0(t,n.ref):n.ref}):h.Children.count(n)>1?h.Children.only(null):null});eu.displayName="SlotClone";const G2=({children:e})=>h.createElement(h.Fragment,null,e);function Y2(e){return h.isValidElement(e)&&e.type===G2}function Q2(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{i(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Z2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ue=Z2.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...a}=r,l=i?vo:t;return h.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),h.createElement(l,H({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function tu(e,t){e&&_o.flushSync(()=>e.dispatchEvent(t))}function X2(e,t=globalThis==null?void 0:globalThis.document){const n=et(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const nu="dismissableLayer.update",J2="dismissableLayer.pointerDownOutside",q2="dismissableLayer.focusOutside";let Bh;const e3=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Nd=h.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:s,...u}=e,d=h.useContext(e3),[c,f]=h.useState(null),p=(n=c==null?void 0:c.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,x]=h.useState({}),y=Me(t,T=>f(T)),_=Array.from(d.layers),[m]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=_.indexOf(m),w=c?_.indexOf(c):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=v,C=t3(T=>{const $=T.target,A=[...d.branches].some(D=>D.contains($));!S||A||(i==null||i(T),l==null||l(T),T.defaultPrevented||s==null||s())},p),b=n3(T=>{const $=T.target;[...d.branches].some(D=>D.contains($))||(a==null||a(T),l==null||l(T),T.defaultPrevented||s==null||s())},p);return X2(T=>{w===d.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},p),h.useEffect(()=>{if(c)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Bh=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(c)),d.layers.add(c),Uh(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Bh)}},[c,p,r,d]),h.useEffect(()=>()=>{c&&(d.layers.delete(c),d.layersWithOutsidePointerEventsDisabled.delete(c),Uh())},[c,d]),h.useEffect(()=>{const T=()=>x({});return document.addEventListener(nu,T),()=>document.removeEventListener(nu,T)},[]),h.createElement(ue.div,H({},u,{ref:y,style:{pointerEvents:E?S?"auto":"none":void 0,...e.style},onFocusCapture:le(e.onFocusCapture,b.onFocusCapture),onBlurCapture:le(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:le(e.onPointerDownCapture,C.onPointerDownCapture)}))});function t3(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let u=function(){L0(J2,n,s,{discrete:!0})};const s={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function n3(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!r.current&&L0(q2,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Uh(){const e=new CustomEvent(nu);document.dispatchEvent(e)}function L0(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?tu(o,i):o.dispatchEvent(i)}const Os="focusScope.autoFocusOnMount",Ls="focusScope.autoFocusOnUnmount",Hh={bubbles:!1,cancelable:!0},I0=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,s]=h.useState(null),u=et(o),d=et(i),c=h.useRef(null),f=Me(t,y=>s(y)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let y=function(w){if(p.paused||!l)return;const E=w.target;l.contains(E)?c.current=E:Tn(c.current,{select:!0})},_=function(w){if(p.paused||!l)return;const E=w.relatedTarget;E!==null&&(l.contains(E)||Tn(c.current,{select:!0}))},m=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Tn(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",_);const v=new MutationObserver(m);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",_),v.disconnect()}}},[r,l,p.paused]),h.useEffect(()=>{if(l){Kh.add(p);const y=document.activeElement;if(!l.contains(y)){const m=new CustomEvent(Os,Hh);l.addEventListener(Os,u),l.dispatchEvent(m),m.defaultPrevented||(r3(s3(D0(l)),{select:!0}),document.activeElement===y&&Tn(l))}return()=>{l.removeEventListener(Os,u),setTimeout(()=>{const m=new CustomEvent(Ls,Hh);l.addEventListener(Ls,d),l.dispatchEvent(m),m.defaultPrevented||Tn(y??document.body,{select:!0}),l.removeEventListener(Ls,d),Kh.remove(p)},0)}}},[l,u,d,p]);const x=h.useCallback(y=>{if(!n&&!r||p.paused)return;const _=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,m=document.activeElement;if(_&&m){const v=y.currentTarget,[w,E]=o3(v);w&&E?!y.shiftKey&&m===E?(y.preventDefault(),n&&Tn(w,{select:!0})):y.shiftKey&&m===w&&(y.preventDefault(),n&&Tn(E,{select:!0})):m===v&&y.preventDefault()}},[n,r,p.paused]);return h.createElement(ue.div,H({tabIndex:-1},a,{ref:f,onKeyDown:x}))});function r3(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Tn(r,{select:t}),document.activeElement!==n)return}function o3(e){const t=D0(e),n=Wh(t,e),r=Wh(t.reverse(),e);return[n,r]}function D0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Wh(e,t){for(const n of e)if(!i3(n,{upTo:t}))return n}function i3(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function a3(e){return e instanceof HTMLInputElement&&"select"in e}function Tn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&a3(e)&&t&&e.select()}}const Kh=l3();function l3(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Gh(e,t),e.unshift(t)},remove(t){var n;e=Gh(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function Gh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function s3(e){return e.filter(t=>t.tagName!=="A")}const M0=h.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?t0.createPortal(h.createElement(ue.div,H({},o,{ref:t})),r):null});function c3(e,t){return h.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const yn=e=>{const{present:t,children:n}=e,r=u3(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=Me(r.ref,o.ref);return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:i}):null};yn.displayName="Presence";function u3(e){const[t,n]=h.useState(),r=h.useRef({}),o=h.useRef(e),i=h.useRef("none"),a=e?"mounted":"unmounted",[l,s]=c3(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=fa(r.current);i.current=l==="mounted"?u:"none"},[l]),dn(()=>{const u=r.current,d=o.current;if(d!==e){const f=i.current,p=fa(u);e?s("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?s("UNMOUNT"):s(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,s]),dn(()=>{if(t){const u=c=>{const p=fa(r.current).includes(c.animationName);c.target===t&&p&&_o.flushSync(()=>s("ANIMATION_END"))},d=c=>{c.target===t&&(i.current=fa(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function fa(e){return(e==null?void 0:e.animationName)||"none"}let Is=0;function j0(){h.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:Yh()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:Yh()),Is++,()=>{Is===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Is--}},[])}function Yh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Gt=function(){return Gt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return T3;var t=P3(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},R3=B0(),k3=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(f3,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(l,"px ").concat(r,`; + } + body { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(l,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(La,` { + right: `).concat(l,"px ").concat(r,`; + } + + .`).concat(Ia,` { + margin-right: `).concat(l,"px ").concat(r,`; + } + + .`).concat(La," .").concat(La,` { + right: 0 `).concat(r,`; + } + + .`).concat(Ia," .").concat(Ia,` { + margin-right: 0 `).concat(r,`; + } + + body { + `).concat(h3,": ").concat(l,`px; + } +`)},N3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=h.useMemo(function(){return $3(o)},[o]);return h.createElement(R3,{styles:k3(i,!t,o,n?"":"!important")})},ru=!1;if(typeof window<"u")try{var ha=Object.defineProperty({},"passive",{get:function(){return ru=!0,!0}});window.addEventListener("test",ha,ha),window.removeEventListener("test",ha,ha)}catch{ru=!1}var Or=ru?{passive:!1}:!1,A3=function(e){return e.tagName==="TEXTAREA"},U0=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!A3(e)&&n[t]==="visible")},O3=function(e){return U0(e,"overflowY")},L3=function(e){return U0(e,"overflowX")},Zh=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=H0(e,n);if(r){var o=W0(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},I3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},D3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},H0=function(e,t){return e==="v"?O3(t):L3(t)},W0=function(e,t){return e==="v"?I3(t):D3(t)},M3=function(e,t){return e==="h"&&t==="rtl"?-1:1},j3=function(e,t,n,r,o){var i=M3(e,window.getComputedStyle(t).direction),a=i*r,l=n.target,s=t.contains(l),u=!1,d=a>0,c=0,f=0;do{var p=W0(e,l),x=p[0],y=p[1],_=p[2],m=y-_-i*x;(x||m)&&H0(e,l)&&(c+=m,f+=x),l=l.parentNode}while(!s&&l!==document.body||s&&(t.contains(l)||t===l));return(d&&(o&&c===0||!o&&a>c)||!d&&(o&&f===0||!o&&-a>f))&&(u=!0),u},pa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Xh=function(e){return[e.deltaX,e.deltaY]},Jh=function(e){return e&&"current"in e?e.current:e},F3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},z3=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},V3=0,Lr=[];function B3(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(V3++)[0],i=h.useState(function(){return B0()})[0],a=h.useRef(e);h.useEffect(function(){a.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=d3([e.lockRef.current],(e.shards||[]).map(Jh),!0).filter(Boolean);return y.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(y,_){if("touches"in y&&y.touches.length===2)return!a.current.allowPinchZoom;var m=pa(y),v=n.current,w="deltaX"in y?y.deltaX:v[0]-m[0],E="deltaY"in y?y.deltaY:v[1]-m[1],S,C=y.target,b=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in y&&b==="h"&&C.type==="range")return!1;var T=Zh(b,C);if(!T)return!0;if(T?S=b:(S=b==="v"?"h":"v",T=Zh(b,C)),!T)return!1;if(!r.current&&"changedTouches"in y&&(w||E)&&(r.current=S),!S)return!0;var $=r.current||S;return j3($,_,y,$==="h"?w:E,!0)},[]),s=h.useCallback(function(y){var _=y;if(!(!Lr.length||Lr[Lr.length-1]!==i)){var m="deltaY"in _?Xh(_):pa(_),v=t.current.filter(function(S){return S.name===_.type&&S.target===_.target&&F3(S.delta,m)})[0];if(v&&v.should){_.cancelable&&_.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(Jh).filter(Boolean).filter(function(S){return S.contains(_.target)}),E=w.length>0?l(_,w[0]):!a.current.noIsolation;E&&_.cancelable&&_.preventDefault()}}},[]),u=h.useCallback(function(y,_,m,v){var w={name:y,delta:_,target:m,should:v};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),d=h.useCallback(function(y){n.current=pa(y),r.current=void 0},[]),c=h.useCallback(function(y){u(y.type,Xh(y),y.target,l(y,e.lockRef.current))},[]),f=h.useCallback(function(y){u(y.type,pa(y),y.target,l(y,e.lockRef.current))},[]);h.useEffect(function(){return Lr.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:f}),document.addEventListener("wheel",s,Or),document.addEventListener("touchmove",s,Or),document.addEventListener("touchstart",d,Or),function(){Lr=Lr.filter(function(y){return y!==i}),document.removeEventListener("wheel",s,Or),document.removeEventListener("touchmove",s,Or),document.removeEventListener("touchstart",d,Or)}},[]);var p=e.removeScrollBar,x=e.inert;return h.createElement(h.Fragment,null,x?h.createElement(i,{styles:z3(o)}):null,p?h.createElement(N3,{gapMode:"margin"}):null)}const U3=x3(V0,B3);var K0=h.forwardRef(function(e,t){return h.createElement(Dl,Gt({},e,{ref:t,sideCar:U3}))});K0.classNames=Dl.classNames;const G0=K0;var H3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ir=new WeakMap,ma=new WeakMap,va={},Fs=0,Y0=function(e){return e&&(e.host||Y0(e.parentNode))},W3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Y0(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},K3=function(e,t,n,r){var o=W3(t,Array.isArray(e)?e:[e]);va[n]||(va[n]=new WeakMap);var i=va[n],a=[],l=new Set,s=new Set(o),u=function(c){!c||l.has(c)||(l.add(c),u(c.parentNode))};o.forEach(u);var d=function(c){!c||s.has(c)||Array.prototype.forEach.call(c.children,function(f){if(l.has(f))d(f);else{var p=f.getAttribute(r),x=p!==null&&p!=="false",y=(Ir.get(f)||0)+1,_=(i.get(f)||0)+1;Ir.set(f,y),i.set(f,_),a.push(f),y===1&&x&&ma.set(f,!0),_===1&&f.setAttribute(n,"true"),x||f.setAttribute(r,"true")}})};return d(t),l.clear(),Fs++,function(){a.forEach(function(c){var f=Ir.get(c)-1,p=i.get(c)-1;Ir.set(c,f),i.set(c,p),f||(ma.has(c)||c.removeAttribute(r),ma.delete(c)),p||c.removeAttribute(n)}),Fs--,Fs||(Ir=new WeakMap,Ir=new WeakMap,ma=new WeakMap,va={})}},Q0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||H3(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),K3(r,o,n,"aria-hidden")):function(){return null}};const Z0="Dialog",[X0,qb]=gn(Z0),[G3,xn]=X0(Z0),Y3=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=h.useRef(null),s=h.useRef(null),[u=!1,d]=Jn({prop:r,defaultProp:o,onChange:i});return h.createElement(G3,{scope:t,triggerRef:l,contentRef:s,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(c=>!c),[d]),modal:a},n)},Q3="DialogTrigger",Z3=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=xn(Q3,n),i=Me(t,o.triggerRef);return h.createElement(ue.button,H({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ad(o.open)},r,{ref:i,onClick:le(e.onClick,o.onOpenToggle)}))}),J0="DialogPortal",[X3,q0]=X0(J0,{forceMount:void 0}),J3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=xn(J0,t);return h.createElement(X3,{scope:t,forceMount:n},h.Children.map(r,a=>h.createElement(yn,{present:n||i.open},h.createElement(M0,{asChild:!0,container:o},a))))},ou="DialogOverlay",q3=h.forwardRef((e,t)=>{const n=q0(ou,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=xn(ou,e.__scopeDialog);return i.modal?h.createElement(yn,{present:r||i.open},h.createElement(eE,H({},o,{ref:t}))):null}),eE=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=xn(ou,n);return h.createElement(G0,{as:vo,allowPinchZoom:!0,shards:[o.contentRef]},h.createElement(ue.div,H({"data-state":Ad(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Pi="DialogContent",tE=h.forwardRef((e,t)=>{const n=q0(Pi,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=xn(Pi,e.__scopeDialog);return h.createElement(yn,{present:r||i.open},i.modal?h.createElement(nE,H({},o,{ref:t})):h.createElement(rE,H({},o,{ref:t})))}),nE=h.forwardRef((e,t)=>{const n=xn(Pi,e.__scopeDialog),r=h.useRef(null),o=Me(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return Q0(i)},[]),h.createElement(eg,H({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:le(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:le(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&i.preventDefault()}),onFocusOutside:le(e.onFocusOutside,i=>i.preventDefault())}))}),rE=h.forwardRef((e,t)=>{const n=xn(Pi,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return h.createElement(eg,H({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a;if((a=e.onCloseAutoFocus)===null||a===void 0||a.call(e,i),!i.defaultPrevented){var l;r.current||(l=n.triggerRef.current)===null||l===void 0||l.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var a,l;(a=e.onInteractOutside)===null||a===void 0||a.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((l=n.triggerRef.current)===null||l===void 0?void 0:l.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),eg=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,l=xn(Pi,n),s=h.useRef(null),u=Me(t,s);return j0(),h.createElement(h.Fragment,null,h.createElement(I0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},h.createElement(Nd,H({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ad(l.open)},a,{ref:u,onDismiss:()=>l.onOpenChange(!1)}))),!1)}),oE="DialogTitle",iE=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=xn(oE,n);return h.createElement(ue.h2,H({id:o.titleId},r,{ref:t}))});function Ad(e){return e?"open":"closed"}const tg=Y3,ng=Z3,aE=J3,lE=q3,sE=tE,cE=iE;var pe=function(){return pe=Object.assign||function(t){for(var n,r=1,o=arguments.length;r0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ne(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}var fE="ENTRIES",rg="KEYS",og="VALUES",He="",zs=function(){function e(t,n){var r=t._tree,o=Array.from(r.keys());this.set=t,this._type=n,this._path=o.length>0?[{node:r,keys:o}]:[]}return e.prototype.next=function(){var t=this.dive();return this.backtrack(),t},e.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var t=Dr(this._path),n=t.node,r=t.keys;if(Dr(r)===He)return{done:!1,value:this.result()};var o=n.get(Dr(r));return this._path.push({node:o,keys:Array.from(o.keys())}),this.dive()},e.prototype.backtrack=function(){if(this._path.length!==0){var t=Dr(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}},e.prototype.key=function(){return this.set._prefix+this._path.map(function(t){var n=t.keys;return Dr(n)}).filter(function(t){return t!==He}).join("")},e.prototype.value=function(){return Dr(this._path).node.get(He)},e.prototype.result=function(){switch(this._type){case og:return this.value();case rg:return this.key();default:return[this.key(),this.value()]}},e.prototype[Symbol.iterator]=function(){return this},e}(),Dr=function(e){return e[e.length-1]},hE=function(e,t,n){var r=new Map;if(t===void 0)return r;for(var o=t.length+1,i=o+n,a=new Uint8Array(i*o).fill(n+1),l=0;ln)continue e}ig(e.get(p),t,n,r,o,y,a,l+p)}}}catch(W){s={error:W}}finally{try{f&&!f.done&&(u=c.return)&&u.call(c)}finally{if(s)throw s.error}}},Vs=function(){function e(t,n){t===void 0&&(t=new Map),n===void 0&&(n=""),this._size=void 0,this._tree=t,this._prefix=n}return e.prototype.atPrefix=function(t){var n,r;if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");var o=Ne(cl(this._tree,t.slice(this._prefix.length)),2),i=o[0],a=o[1];if(i===void 0){var l=Ne(Od(a),2),s=l[0],u=l[1];try{for(var d=te(s.keys()),c=d.next();!c.done;c=d.next()){var f=c.value;if(f!==He&&f.startsWith(u)){var p=new Map;return p.set(f.slice(u.length),s.get(f)),new e(p,t)}}}catch(x){n={error:x}}finally{try{c&&!c.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}return new e(i,t)},e.prototype.clear=function(){this._size=void 0,this._tree.clear()},e.prototype.delete=function(t){return this._size=void 0,pE(this._tree,t)},e.prototype.entries=function(){return new zs(this,fE)},e.prototype.forEach=function(t){var n,r;try{for(var o=te(this),i=o.next();!i.done;i=o.next()){var a=Ne(i.value,2),l=a[0],s=a[1];t(l,s,this)}}catch(u){n={error:u}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.fuzzyGet=function(t,n){return hE(this._tree,t,n)},e.prototype.get=function(t){var n=iu(this._tree,t);return n!==void 0?n.get(He):void 0},e.prototype.has=function(t){var n=iu(this._tree,t);return n!==void 0&&n.has(He)},e.prototype.keys=function(){return new zs(this,rg)},e.prototype.set=function(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;var r=Bs(this._tree,t);return r.set(He,n),this},Object.defineProperty(e.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),e.prototype.update=function(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;var r=Bs(this._tree,t);return r.set(He,n(r.get(He))),this},e.prototype.fetch=function(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;var r=Bs(this._tree,t),o=r.get(He);return o===void 0&&r.set(He,o=n()),o},e.prototype.values=function(){return new zs(this,og)},e.prototype[Symbol.iterator]=function(){return this.entries()},e.from=function(t){var n,r,o=new e;try{for(var i=te(t),a=i.next();!a.done;a=i.next()){var l=Ne(a.value,2),s=l[0],u=l[1];o.set(s,u)}}catch(d){n={error:d}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},e.fromObject=function(t){return e.from(Object.entries(t))},e}(),cl=function(e,t,n){var r,o;if(n===void 0&&(n=[]),t.length===0||e==null)return[e,n];try{for(var i=te(e.keys()),a=i.next();!a.done;a=i.next()){var l=a.value;if(l!==He&&t.startsWith(l))return n.push([e,l]),cl(e.get(l),t.slice(l.length),n)}}catch(s){r={error:s}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return n.push([e,t]),cl(void 0,"",n)},iu=function(e,t){var n,r;if(t.length===0||e==null)return e;try{for(var o=te(e.keys()),i=o.next();!i.done;i=o.next()){var a=i.value;if(a!==He&&t.startsWith(a))return iu(e.get(a),t.slice(a.length))}}catch(l){n={error:l}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},Bs=function(e,t){var n,r,o=t.length;e:for(var i=0;e&&i0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Vs,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},e.prototype.discard=function(t){var n=this,r=this._idToShortId.get(t);if(r==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(t,": it is not in the index"));this._idToShortId.delete(t),this._documentIds.delete(r),this._storedFields.delete(r),(this._fieldLength.get(r)||[]).forEach(function(o,i){n.removeFieldLength(r,i,n._documentCount,o)}),this._fieldLength.delete(r),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},e.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var t=this._options.autoVacuum,n=t.minDirtFactor,r=t.minDirtCount,o=t.batchSize,i=t.batchWait;this.conditionalVacuum({batchSize:o,batchWait:i},{minDirtCount:r,minDirtFactor:n})}},e.prototype.discardAll=function(t){var n,r,o=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var i=te(t),a=i.next();!a.done;a=i.next()){var l=a.value;this.discard(l)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}finally{this._options.autoVacuum=o}this.maybeAutoVacuum()},e.prototype.replace=function(t){var n=this._options,r=n.idField,o=n.extractField,i=o(t,r);this.discard(i),this.add(t)},e.prototype.vacuum=function(t){return t===void 0&&(t={}),this.conditionalVacuum(t)},e.prototype.conditionalVacuum=function(t,n){var r=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var o=r._enqueuedVacuumConditions;return r._enqueuedVacuumConditions=lu,r.performVacuuming(t,o)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)},e.prototype.performVacuuming=function(t,n){return uE(this,void 0,void 0,function(){var r,o,i,a,l,s,u,d,c,f,p,x,y,_,m,v,w,E,S,C,b,T,$,A,D;return dE(this,function(M){switch(M.label){case 0:if(r=this._dirtCount,!this.vacuumConditionsMet(n))return[3,10];o=t.batchSize||au.batchSize,i=t.batchWait||au.batchWait,a=1,M.label=1;case 1:M.trys.push([1,7,8,9]),l=te(this._index),s=l.next(),M.label=2;case 2:if(s.done)return[3,6];u=Ne(s.value,2),d=u[0],c=u[1];try{for(f=(T=void 0,te(c)),p=f.next();!p.done;p=f.next()){x=Ne(p.value,2),y=x[0],_=x[1];try{for(m=(A=void 0,te(_)),v=m.next();!v.done;v=m.next())w=Ne(v.value,1),E=w[0],!this._documentIds.has(E)&&(_.size<=1?c.delete(y):_.delete(E))}catch(W){A={error:W}}finally{try{v&&!v.done&&(D=m.return)&&D.call(m)}finally{if(A)throw A.error}}}}catch(W){T={error:W}}finally{try{p&&!p.done&&($=f.return)&&$.call(f)}finally{if(T)throw T.error}}return this._index.get(d).size===0&&this._index.delete(d),a%o!==0?[3,4]:[4,new Promise(function(W){return setTimeout(W,i)})];case 3:M.sent(),M.label=4;case 4:a+=1,M.label=5;case 5:return s=l.next(),[3,2];case 6:return[3,9];case 7:return S=M.sent(),C={error:S},[3,9];case 8:try{s&&!s.done&&(b=l.return)&&b.call(l)}finally{if(C)throw C.error}return[7];case 9:this._dirtCount-=r,M.label=10;case 10:return[4,null];case 11:return M.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},e.prototype.vacuumConditionsMet=function(t){if(t==null)return!0;var n=t.minDirtCount,r=t.minDirtFactor;return n=n||Ws.minDirtCount,r=r||Ws.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r},Object.defineProperty(e.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),e.prototype.has=function(t){return this._idToShortId.has(t)},e.prototype.getStoredFields=function(t){var n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)},e.prototype.search=function(t,n){var r,o;n===void 0&&(n={});var i=this.executeQuery(t,n),a=[];try{for(var l=te(i),s=l.next();!s.done;s=l.next()){var u=Ne(s.value,2),d=u[0],c=u[1],f=c.score,p=c.terms,x=c.match,y=p.length||1,_={id:this._documentIds.get(d),score:f*y,terms:Object.keys(x),queryTerms:p,match:x};Object.assign(_,this._storedFields.get(d)),(n.filter==null||n.filter(_))&&a.push(_)}}catch(m){r={error:m}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}return t===e.wildcard&&n.boostDocument==null&&this._options.searchOptions.boostDocument==null||a.sort(tp),a},e.prototype.autoSuggest=function(t,n){var r,o,i,a;n===void 0&&(n={}),n=pe(pe({},this._options.autoSuggestOptions),n);var l=new Map;try{for(var s=te(this.search(t,n)),u=s.next();!u.done;u=s.next()){var d=u.value,c=d.score,f=d.terms,p=f.join(" "),x=l.get(p);x!=null?(x.score+=c,x.count+=1):l.set(p,{score:c,terms:f,count:1})}}catch(S){r={error:S}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}var y=[];try{for(var _=te(l),m=_.next();!m.done;m=_.next()){var v=Ne(m.value,2),x=v[0],w=v[1],c=w.score,f=w.terms,E=w.count;y.push({suggestion:x,terms:f,score:c/E})}}catch(S){i={error:S}}finally{try{m&&!m.done&&(a=_.return)&&a.call(_)}finally{if(i)throw i.error}}return y.sort(tp),y},Object.defineProperty(e.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),e.loadJSON=function(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)},e.getDefault=function(t){if(Hs.hasOwnProperty(t))return Us(Hs,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},e.loadJS=function(t,n){var r,o,i,a,l,s,u=t.index,d=t.documentCount,c=t.nextId,f=t.documentIds,p=t.fieldIds,x=t.fieldLength,y=t.averageFieldLength,_=t.storedFields,m=t.dirtCount,v=t.serializationVersion;if(v!==1&&v!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new e(n);w._documentCount=d,w._nextId=c,w._documentIds=ga(f),w._idToShortId=new Map,w._fieldIds=p,w._fieldLength=ga(x),w._avgFieldLength=y,w._storedFields=ga(_),w._dirtCount=m||0,w._index=new Vs;try{for(var E=te(w._documentIds),S=E.next();!S.done;S=E.next()){var C=Ne(S.value,2),b=C[0],T=C[1];w._idToShortId.set(T,b)}}catch(F){r={error:F}}finally{try{S&&!S.done&&(o=E.return)&&o.call(E)}finally{if(r)throw r.error}}try{for(var $=te(u),A=$.next();!A.done;A=$.next()){var D=Ne(A.value,2),M=D[0],W=D[1],V=new Map;try{for(var Z=(l=void 0,te(Object.keys(W))),re=Z.next();!re.done;re=Z.next()){var B=re.value,I=W[B];v===1&&(I=I.ds),V.set(parseInt(B,10),ga(I))}}catch(F){l={error:F}}finally{try{re&&!re.done&&(s=Z.return)&&s.call(Z)}finally{if(l)throw l.error}}w._index.set(M,V)}}catch(F){i={error:F}}finally{try{A&&!A.done&&(a=$.return)&&a.call($)}finally{if(i)throw i.error}}return w},e.prototype.executeQuery=function(t,n){var r=this;if(n===void 0&&(n={}),t===e.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){var o=pe(pe(pe({},n),t),{queries:void 0}),i=t.queries.map(function(_){return r.executeQuery(_,o)});return this.combineResults(i,o.combineWith)}var a=this._options,l=a.tokenize,s=a.processTerm,u=a.searchOptions,d=pe(pe({tokenize:l,processTerm:s},u),n),c=d.tokenize,f=d.processTerm,p=c(t).flatMap(function(_){return f(_)}).filter(function(_){return!!_}),x=p.map(wE(d)),y=x.map(function(_){return r.executeQuerySpec(_,d)});return this.combineResults(y,d.combineWith)},e.prototype.executeQuerySpec=function(t,n){var r,o,i,a,l=pe(pe({},this._options.searchOptions),n),s=(l.fields||this._options.fields).reduce(function(B,I){var F;return pe(pe({},B),(F={},F[I]=Us(l.boost,I)||1,F))},{}),u=l.boostDocument,d=l.weights,c=l.maxFuzzy,f=l.bm25,p=pe(pe({},qh.weights),d),x=p.fuzzy,y=p.prefix,_=this._index.get(t.term),m=this.termResults(t.term,t.term,1,_,s,u,f),v,w;if(t.prefix&&(v=this._index.atPrefix(t.term)),t.fuzzy){var E=t.fuzzy===!0?.2:t.fuzzy,S=E<1?Math.min(c,Math.round(t.term.length*E)):E;S&&(w=this._index.fuzzyGet(t.term,S))}if(v)try{for(var C=te(v),b=C.next();!b.done;b=C.next()){var T=Ne(b.value,2),$=T[0],A=T[1],D=$.length-t.term.length;if(D){w==null||w.delete($);var M=y*$.length/($.length+.3*D);this.termResults(t.term,$,M,A,s,u,f,m)}}}catch(B){r={error:B}}finally{try{b&&!b.done&&(o=C.return)&&o.call(C)}finally{if(r)throw r.error}}if(w)try{for(var W=te(w.keys()),V=W.next();!V.done;V=W.next()){var $=V.value,Z=Ne(w.get($),2),re=Z[0],D=Z[1];if(D){var M=x*$.length/($.length+D);this.termResults(t.term,$,M,re,s,u,f,m)}}}catch(B){i={error:B}}finally{try{V&&!V.done&&(a=W.return)&&a.call(W)}finally{if(i)throw i.error}}return m},e.prototype.executeWildcardQuery=function(t){var n,r,o=new Map,i=pe(pe({},this._options.searchOptions),t);try{for(var a=te(this._documentIds),l=a.next();!l.done;l=a.next()){var s=Ne(l.value,2),u=s[0],d=s[1],c=i.boostDocument?i.boostDocument(d,"",this._storedFields.get(u)):1;o.set(u,{score:c,terms:[],match:{}})}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},e.prototype.combineResults=function(t,n){if(n===void 0&&(n=Ld),t.length===0)return new Map;var r=n.toLowerCase();return t.reduce(gE[r])||new Map},e.prototype.toJSON=function(){var t,n,r,o,i=[];try{for(var a=te(this._index),l=a.next();!l.done;l=a.next()){var s=Ne(l.value,2),u=s[0],d=s[1],c={};try{for(var f=(r=void 0,te(d)),p=f.next();!p.done;p=f.next()){var x=Ne(p.value,2),y=x[0],_=x[1];c[y]=Object.fromEntries(_)}}catch(m){r={error:m}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}i.push([u,c])}}catch(m){t={error:m}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:i,serializationVersion:2}},e.prototype.termResults=function(t,n,r,o,i,a,l,s){var u,d,c,f,p;if(s===void 0&&(s=new Map),o==null)return s;try{for(var x=te(Object.keys(i)),y=x.next();!y.done;y=x.next()){var _=y.value,m=i[_],v=this._fieldIds[_],w=o.get(v);if(w!=null){var E=w.size,S=this._avgFieldLength[v];try{for(var C=(c=void 0,te(w.keys())),b=C.next();!b.done;b=C.next()){var T=b.value;if(!this._documentIds.has(T)){this.removeTerm(v,T,n),E-=1;continue}var $=a?a(this._documentIds.get(T),n,this._storedFields.get(T)):1;if($){var A=w.get(T),D=this._fieldLength.get(T)[v],M=xE(A,E,this._documentCount,D,S,l),W=r*m*$*M,V=s.get(T);if(V){V.score+=W,EE(V.terms,t);var Z=Us(V.match,n);Z?Z.push(_):V.match[n]=[_]}else s.set(T,{score:W,terms:[t],match:(p={},p[n]=[_],p)})}}}catch(re){c={error:re}}finally{try{b&&!b.done&&(f=C.return)&&f.call(C)}finally{if(c)throw c.error}}}}}catch(re){u={error:re}}finally{try{y&&!y.done&&(d=x.return)&&d.call(x)}finally{if(u)throw u.error}}return s},e.prototype.addTerm=function(t,n,r){var o=this._index.fetch(r,np),i=o.get(t);if(i==null)i=new Map,i.set(n,1),o.set(t,i);else{var a=i.get(n);i.set(n,(a||0)+1)}},e.prototype.removeTerm=function(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}var o=this._index.fetch(r,np),i=o.get(t);i==null||i.get(n)==null?this.warnDocumentChanged(n,t,r):i.get(n)<=1?i.size<=1?o.delete(t):i.delete(n):i.set(n,i.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)},e.prototype.warnDocumentChanged=function(t,n,r){var o,i;try{for(var a=te(Object.keys(this._fieldIds)),l=a.next();!l.done;l=a.next()){var s=l.value;if(this._fieldIds[s]===n){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(r,'" was not present in field "').concat(s,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(u){o={error:u}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}},e.prototype.addDocumentId=function(t){var n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n},e.prototype.addFields=function(t){for(var n=0;nJSON.stringify(await(await fetch("/.vocs/search-index-6abb3f38.json")).json());let Ks;function cg(){const[e,t]=h.useState();return h.useEffect(()=>{(async()=>{Ks||(Ks=SE());const n=await Ks,r=vE.loadJSON(n,{fields:["title","titles","text"],searchOptions:{boost:{title:4,text:2,titles:1},fuzzy:.2,prefix:!0},storeFields:["href","html","isPage","text","title","titles"]});t(r)})()},[]),h.useEffect(()=>{},[]),e}var bE="vocs_DesktopSearch_search",TE="vocs_DesktopSearch_searchCommand";const PE=h.forwardRef((e,t)=>h.createElement(ue.label,H({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),$E=PE;var ug={exports:{}};/*!*************************************************** +* mark.js v8.11.1 +* https://markjs.io/ +* Copyright (c) 2014–2018, Julian Kühnel +* Released under the MIT license https://git.io/vwTVl +*****************************************************/(function(e,t){(function(n,r){e.exports=r()})(K1,function(){var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},r=function(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")},o=function(){function u(d,c){for(var f=0;f1&&arguments[1]!==void 0?arguments[1]:!0,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5e3;r(this,u),this.ctx=d,this.iframes=c,this.exclude=f,this.iframesTimeout=p}return o(u,[{key:"getContexts",value:function(){var c=void 0,f=[];return typeof this.ctx>"u"||!this.ctx?c=[]:NodeList.prototype.isPrototypeOf(this.ctx)?c=Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?c=this.ctx:typeof this.ctx=="string"?c=Array.prototype.slice.call(document.querySelectorAll(this.ctx)):c=[this.ctx],c.forEach(function(p){var x=f.filter(function(y){return y.contains(p)}).length>0;f.indexOf(p)===-1&&!x&&f.push(p)}),f}},{key:"getIframeContents",value:function(c,f){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},x=void 0;try{var y=c.contentWindow;if(x=y.document,!y||!x)throw new Error("iframe inaccessible")}catch{p()}x&&f(x)}},{key:"isIframeBlank",value:function(c){var f="about:blank",p=c.getAttribute("src").trim(),x=c.contentWindow.location.href;return x===f&&p!==f&&p}},{key:"observeIframeLoad",value:function(c,f,p){var x=this,y=!1,_=null,m=function v(){if(!y){y=!0,clearTimeout(_);try{x.isIframeBlank(c)||(c.removeEventListener("load",v),x.getIframeContents(c,f,p))}catch{p()}}};c.addEventListener("load",m),_=setTimeout(m,this.iframesTimeout)}},{key:"onIframeReady",value:function(c,f,p){try{c.contentWindow.document.readyState==="complete"?this.isIframeBlank(c)?this.observeIframeLoad(c,f,p):this.getIframeContents(c,f,p):this.observeIframeLoad(c,f,p)}catch{p()}}},{key:"waitForIframes",value:function(c,f){var p=this,x=0;this.forEachIframe(c,function(){return!0},function(y){x++,p.waitForIframes(y.querySelector("html"),function(){--x||f()})},function(y){y||f()})}},{key:"forEachIframe",value:function(c,f,p){var x=this,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){},_=c.querySelectorAll("iframe"),m=_.length,v=0;_=Array.prototype.slice.call(_);var w=function(){--m<=0&&y(v)};m||w(),_.forEach(function(E){u.matches(E,x.exclude)?w():x.onIframeReady(E,function(S){f(E)&&(v++,p(S)),w()},w)})}},{key:"createIterator",value:function(c,f,p){return document.createNodeIterator(c,f,p,!1)}},{key:"createInstanceOnIframe",value:function(c){return new u(c.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(c,f,p){var x=c.compareDocumentPosition(p),y=Node.DOCUMENT_POSITION_PRECEDING;if(x&y)if(f!==null){var _=f.compareDocumentPosition(p),m=Node.DOCUMENT_POSITION_FOLLOWING;if(_&m)return!0}else return!0;return!1}},{key:"getIteratorNode",value:function(c){var f=c.previousNode(),p=void 0;return f===null?p=c.nextNode():p=c.nextNode()&&c.nextNode(),{prevNode:f,node:p}}},{key:"checkIframeFilter",value:function(c,f,p,x){var y=!1,_=!1;return x.forEach(function(m,v){m.val===p&&(y=v,_=m.handled)}),this.compareNodeIframe(c,f,p)?(y===!1&&!_?x.push({val:p,handled:!0}):y!==!1&&!_&&(x[y].handled=!0),!0):(y===!1&&x.push({val:p,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(c,f,p,x){var y=this;c.forEach(function(_){_.handled||y.getIframeContents(_.val,function(m){y.createInstanceOnIframe(m).forEachNode(f,p,x)})})}},{key:"iterateThroughNodes",value:function(c,f,p,x,y){for(var _=this,m=this.createIterator(f,c,x),v=[],w=[],E=void 0,S=void 0,C=function(){var T=_.getIteratorNode(m);return S=T.prevNode,E=T.node,E};C();)this.iframes&&this.forEachIframe(f,function(b){return _.checkIframeFilter(E,S,b,v)},function(b){_.createInstanceOnIframe(b).forEachNode(c,function(T){return w.push(T)},x)}),w.push(E);w.forEach(function(b){p(b)}),this.iframes&&this.handleOpenIframes(v,c,p,x),y()}},{key:"forEachNode",value:function(c,f,p){var x=this,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){},_=this.getContexts(),m=_.length;m||y(),_.forEach(function(v){var w=function(){x.iterateThroughNodes(c,v,f,p,function(){--m<=0&&y()})};x.iframes?x.waitForIframes(v,w):w()})}}],[{key:"matches",value:function(c,f){var p=typeof f=="string"?[f]:f,x=c.matches||c.matchesSelector||c.msMatchesSelector||c.mozMatchesSelector||c.oMatchesSelector||c.webkitMatchesSelector;if(x){var y=!1;return p.every(function(_){return x.call(c,_)?(y=!0,!1):!0}),y}else return!1}}]),u}(),l=function(){function u(d){r(this,u),this.ctx=d,this.ie=!1;var c=window.navigator.userAgent;(c.indexOf("MSIE")>-1||c.indexOf("Trident")>-1)&&(this.ie=!0)}return o(u,[{key:"log",value:function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"debug",p=this.opt.log;this.opt.debug&&(typeof p>"u"?"undefined":n(p))==="object"&&typeof p[f]=="function"&&p[f]("mark.js: "+c)}},{key:"escapeStr",value:function(c){return c.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(c){return this.opt.wildcards!=="disabled"&&(c=this.setupWildcardsRegExp(c)),c=this.escapeStr(c),Object.keys(this.opt.synonyms).length&&(c=this.createSynonymsRegExp(c)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(c=this.setupIgnoreJoinersRegExp(c)),this.opt.diacritics&&(c=this.createDiacriticsRegExp(c)),c=this.createMergedBlanksRegExp(c),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(c=this.createJoinersRegExp(c)),this.opt.wildcards!=="disabled"&&(c=this.createWildcardsRegExp(c)),c=this.createAccuracyRegExp(c),c}},{key:"createSynonymsRegExp",value:function(c){var f=this.opt.synonyms,p=this.opt.caseSensitive?"":"i",x=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var y in f)if(f.hasOwnProperty(y)){var _=f[y],m=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(y):this.escapeStr(y),v=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(_):this.escapeStr(_);m!==""&&v!==""&&(c=c.replace(new RegExp("("+this.escapeStr(m)+"|"+this.escapeStr(v)+")","gm"+p),x+("("+this.processSynomyms(m)+"|")+(this.processSynomyms(v)+")")+x))}return c}},{key:"processSynomyms",value:function(c){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(c=this.setupIgnoreJoinersRegExp(c)),c}},{key:"setupWildcardsRegExp",value:function(c){return c=c.replace(/(?:\\)*\?/g,function(f){return f.charAt(0)==="\\"?"?":""}),c.replace(/(?:\\)*\*/g,function(f){return f.charAt(0)==="\\"?"*":""})}},{key:"createWildcardsRegExp",value:function(c){var f=this.opt.wildcards==="withSpaces";return c.replace(/\u0001/g,f?"[\\S\\s]?":"\\S?").replace(/\u0002/g,f?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(c){return c.replace(/[^(|)\\]/g,function(f,p,x){var y=x.charAt(p+1);return/[(|)\\]/.test(y)||y===""?f:f+"\0"})}},{key:"createJoinersRegExp",value:function(c){var f=[],p=this.opt.ignorePunctuation;return Array.isArray(p)&&p.length&&f.push(this.escapeStr(p.join(""))),this.opt.ignoreJoiners&&f.push("\\u00ad\\u200b\\u200c\\u200d"),f.length?c.split(/\u0000+/).join("["+f.join("")+"]*"):c}},{key:"createDiacriticsRegExp",value:function(c){var f=this.opt.caseSensitive?"":"i",p=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],x=[];return c.split("").forEach(function(y){p.every(function(_){if(_.indexOf(y)!==-1){if(x.indexOf(_)>-1)return!1;c=c.replace(new RegExp("["+_+"]","gm"+f),"["+_+"]"),x.push(_)}return!0})}),c}},{key:"createMergedBlanksRegExp",value:function(c){return c.replace(/[\s]+/gmi,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(c){var f=this,p="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿",x=this.opt.accuracy,y=typeof x=="string"?x:x.value,_=typeof x=="string"?[]:x.limiters,m="";switch(_.forEach(function(v){m+="|"+f.escapeStr(v)}),y){case"partially":default:return"()("+c+")";case"complementary":return m="\\s"+(m||this.escapeStr(p)),"()([^"+m+"]*"+c+"[^"+m+"]*)";case"exactly":return"(^|\\s"+m+")("+c+")(?=$|\\s"+m+")"}}},{key:"getSeparatedKeywords",value:function(c){var f=this,p=[];return c.forEach(function(x){f.opt.separateWordSearch?x.split(" ").forEach(function(y){y.trim()&&p.indexOf(y)===-1&&p.push(y)}):x.trim()&&p.indexOf(x)===-1&&p.push(x)}),{keywords:p.sort(function(x,y){return y.length-x.length}),length:p.length}}},{key:"isNumeric",value:function(c){return Number(parseFloat(c))==c}},{key:"checkRanges",value:function(c){var f=this;if(!Array.isArray(c)||Object.prototype.toString.call(c[0])!=="[object Object]")return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(c),[];var p=[],x=0;return c.sort(function(y,_){return y.start-_.start}).forEach(function(y){var _=f.callNoMatchOnInvalidRanges(y,x),m=_.start,v=_.end,w=_.valid;w&&(y.start=m,y.length=v-m,p.push(y),x=v)}),p}},{key:"callNoMatchOnInvalidRanges",value:function(c,f){var p=void 0,x=void 0,y=!1;return c&&typeof c.start<"u"?(p=parseInt(c.start,10),x=p+parseInt(c.length,10),this.isNumeric(c.start)&&this.isNumeric(c.length)&&x-f>0&&x-p>0?y=!0:(this.log("Ignoring invalid or overlapping range: "+(""+JSON.stringify(c))),this.opt.noMatch(c))):(this.log("Ignoring invalid range: "+JSON.stringify(c)),this.opt.noMatch(c)),{start:p,end:x,valid:y}}},{key:"checkWhitespaceRanges",value:function(c,f,p){var x=void 0,y=!0,_=p.length,m=f-_,v=parseInt(c.start,10)-m;return v=v>_?_:v,x=v+parseInt(c.length,10),x>_&&(x=_,this.log("End range automatically set to the max value of "+_)),v<0||x-v<0||v>_||x>_?(y=!1,this.log("Invalid range: "+JSON.stringify(c)),this.opt.noMatch(c)):p.substring(v,x).replace(/\s+/g,"")===""&&(y=!1,this.log("Skipping whitespace only range: "+JSON.stringify(c)),this.opt.noMatch(c)),{start:v,end:x,valid:y}}},{key:"getTextNodes",value:function(c){var f=this,p="",x=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(y){x.push({start:p.length,end:(p+=y.textContent).length,node:y})},function(y){return f.matchesExclude(y.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){c({value:p,nodes:x})})}},{key:"matchesExclude",value:function(c){return a.matches(c,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(c,f,p){var x=this.opt.element?this.opt.element:"mark",y=c.splitText(f),_=y.splitText(p-f),m=document.createElement(x);return m.setAttribute("data-markjs","true"),this.opt.className&&m.setAttribute("class",this.opt.className),m.textContent=y.textContent,y.parentNode.replaceChild(m,y),_}},{key:"wrapRangeInMappedTextNode",value:function(c,f,p,x,y){var _=this;c.nodes.every(function(m,v){var w=c.nodes[v+1];if(typeof w>"u"||w.start>f){if(!x(m.node))return!1;var E=f-m.start,S=(p>m.end?m.end:p)-m.start,C=c.value.substr(0,m.start),b=c.value.substr(S+m.start);if(m.node=_.wrapRangeInTextNode(m.node,E,S),c.value=C+b,c.nodes.forEach(function(T,$){$>=v&&(c.nodes[$].start>0&&$!==v&&(c.nodes[$].start-=S),c.nodes[$].end-=S)}),p-=S,y(m.node.previousSibling,m.start),p>m.end)f=m.end;else return!1}return!0})}},{key:"wrapMatches",value:function(c,f,p,x,y){var _=this,m=f===0?0:f+1;this.getTextNodes(function(v){v.nodes.forEach(function(w){w=w.node;for(var E=void 0;(E=c.exec(w.textContent))!==null&&E[m]!=="";)if(p(E[m],w)){var S=E.index;if(m!==0)for(var C=1;C{const o=setTimeout(()=>r(e),t||500);return()=>{clearTimeout(o)}},[e,t]),n}function su(e,t){const[n,r]=h.useState();h.useEffect(()=>{const i=AE(e);r(typeof i>"u"||i===null?typeof t=="function"?t():t:i)},[t,e]);const o=h.useCallback(i=>{r(a=>{let l;typeof i=="function"?l=i(a):l=i;try{localStorage.setItem(e,JSON.stringify(l))}catch{}return l})},[e]);return[n,o]}function AE(e){try{const t=localStorage.getItem(e);return typeof t=="string"?JSON.parse(t):void 0}catch{return}}var OE="vocs_Kbd";function dg(e){return g.jsx("kbd",{...e,className:O(e.className,OE)})}var LE="vocs_KeyboardShortcut_kbdGroup",IE="vocs_KeyboardShortcut";function Xr(e){const{description:t,keys:n}=e;return g.jsxs("span",{className:IE,children:[t,g.jsx("span",{className:LE,children:n.map(r=>g.jsx(dg,{children:r},r))})]})}var DE="vocs_SearchDialog_content",rp="vocs_SearchDialog_excerpt",ME="vocs_SearchDialog_overlay",jE="vocs_SearchDialog_result",op="vocs_SearchDialog_resultIcon",FE="vocs_SearchDialog_resultSelected",zE="vocs_SearchDialog_results",VE="vocs_SearchDialog",BE="vocs_SearchDialog_searchBox",UE="vocs_SearchDialog_searchInput",ya="vocs_SearchDialog_searchInputIcon",HE="vocs_SearchDialog_searchInputIconDesktop",WE="vocs_SearchDialog_searchInputIconMobile",KE="vocs_SearchDialog_searchShortcuts",ip="vocs_SearchDialog_title",GE="vocs_SearchDialog_titleIcon",YE="vocs_SearchDialog_titles";function fg(e){const t=Pd(),n=h.useRef(null),r=h.useRef(null),[o,i]=su("filterText",""),a=NE(o,200),l=cg(),[s,u]=h.useState(-1),[d,c]=h.useState(!1),[f,p]=su("showDetailView",!0),x=h.useMemo(()=>l?a?(u(0),l.search(a).slice(0,16)):(u(-1),[]):[],[l,a]),y=x.length,_=x[s],m=h.useCallback(()=>{var S,C,b;if(!r.current)return;const v=new Set;for(const T of x)for(const $ in T.match)v.add($);const w=new kE(r.current);w.unmark({done(){w==null||w.markRegExp(QE(v))}});const E=r.current.querySelectorAll(`.${rp}`);for(const T of E)(S=T.querySelector('mark[data-markjs="true"]'))==null||S.scrollIntoView({block:"center"});(b=(C=r.current)==null?void 0:C.firstElementChild)==null||b.scrollIntoView({block:"start"})},[x]);return h.useEffect(()=>{if(!e.open)return;function v(w){var E;switch(w.key){case"ArrowDown":{w.preventDefault(),u(S=>{var T;let C=S+1;C>=y&&(C=0);const b=(T=r.current)==null?void 0:T.children[C];return b==null||b.scrollIntoView({block:"nearest"}),C}),c(!0);break}case"ArrowUp":{w.preventDefault(),u(S=>{var T;let C=S-1;C<0&&(C=y-1);const b=(T=r.current)==null?void 0:T.children[C];return b==null||b.scrollIntoView({block:"nearest"}),C}),c(!0);break}case"Backspace":{if(!w.metaKey)return;w.preventDefault(),i(""),(E=n.current)==null||E.focus();break}case"Enter":{if(w.target instanceof HTMLButtonElement&&w.target.type!=="submit"||!_)return;w.preventDefault(),t(_.href),e.onClose();break}}}return window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v)}},[t,y,i,_,e.open,e.onClose]),h.useEffect(()=>{a!==""&&r.current&&m()},[m,a]),g.jsxs(aE,{children:[g.jsx(lE,{className:ME}),g.jsxs(sE,{onOpenAutoFocus:v=>{n.current&&(v.preventDefault(),n.current.focus()),m()},onCloseAutoFocus:()=>{u(0)},className:VE,"aria-describedby":void 0,children:[g.jsx(cE,{className:A0,children:"Search"}),g.jsxs("form",{className:BE,children:[g.jsx("button",{"aria-label":"Close search dialog",type:"button",onClick:()=>e.onClose(),className:WE,children:g.jsx(P2,{className:ya,height:20,width:20})}),g.jsx($E,{htmlFor:"search-input",children:g.jsx(kd,{"aria-label":"Search",className:O(ya,HE),height:20,width:20})}),g.jsx("input",{ref:n,tabIndex:0,className:UE,id:"search-input",onChange:v=>i(v.target.value),placeholder:"Search",type:"search",value:o}),g.jsx("button",{"aria-label":"Toggle detail view",type:"button",onClick:()=>p(v=>!v),children:g.jsx(I2,{className:ya,height:20,width:20})}),g.jsx("button",{"aria-label":"Reset search",type:"button",className:ya,onClick:()=>{var v;i(""),(v=n.current)==null||v.focus()},children:"⌫"})]}),g.jsxs("ul",{className:zE,role:x.length?"listbox":void 0,onMouseMove:()=>c(!1),ref:r,children:[a&&x.length===0&&g.jsxs("li",{children:['No results for "',g.jsx("span",{children:a}),'"']}),x.map((v,w)=>{var E;return g.jsx("li",{role:"option",className:O(jE,w===s&&FE),"aria-selected":w===s,"aria-label":[...v.titles.filter(S=>!!S),v.title].join(" > "),children:g.jsxs(x0,{to:v.href,onClick:S=>{S.metaKey||e.onClose()},onMouseEnter:()=>!d&&u(w),onFocus:()=>u(w),children:[g.jsxs("div",{className:YE,children:[v.isPage?g.jsx(O2,{className:op}):g.jsx("span",{className:op,children:"#"}),v.titles.filter(S=>!!S).map(S=>g.jsxs("span",{className:ip,children:[g.jsx("span",{dangerouslySetInnerHTML:{__html:S}}),g.jsx(R2,{className:GE})]},S)),g.jsx("span",{className:ip,children:g.jsx("span",{dangerouslySetInnerHTML:{__html:v.title}})})]}),f&&((E=v.text)==null?void 0:E.trim())&&g.jsx("div",{className:rp,children:g.jsx(R0,{className:DE,children:g.jsx("div",{dangerouslySetInnerHTML:{__html:v.html}})})})]})},v.id)})]}),g.jsxs("div",{className:KE,children:[g.jsx(Xr,{description:"Navigate",keys:["↑","↓"]}),g.jsx(Xr,{description:"Select",keys:["enter"]}),g.jsx(Xr,{description:"Close",keys:["esc"]}),g.jsx(Xr,{description:"Reset",keys:["⌘","⌫"]})]})]})]})}function QE(e){return new RegExp([...e].sort((t,n)=>n.length-t.length).map(t=>`(${t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")})`).join("|"),"gi")}function ZE(){cg();const[e,t]=h.useState(!1);return h.useEffect(()=>{function n(r){const o=document.activeElement instanceof HTMLElement&&(["input","select","textarea"].includes(document.activeElement.tagName.toLowerCase())||document.activeElement.isContentEditable);r.key==="/"&&!e&&!o?(r.preventDefault(),t(!0)):r.metaKey===!0&&r.key==="k"&&(r.preventDefault(),t(i=>!i))}return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[e]),g.jsxs(tg,{open:e,onOpenChange:t,children:[g.jsx(ng,{asChild:!0,children:g.jsxs("button",{className:bE,type:"button",children:[g.jsx(kd,{style:{marginTop:2}}),"Search",g.jsx("div",{className:TE,children:g.jsx("div",{style:{background:"currentColor",transform:"rotate(45deg)",width:1.5,borderRadius:2,height:"100%"}})})]})}),g.jsx(fg,{open:e,onClose:()=>t(!1)})]})}var hg="vocs_DesktopTopNav_button",XE="vocs_DesktopTopNav_content",JE="vocs_DesktopTopNav_curtain",ap="vocs_DesktopTopNav_divider",Gs="vocs_DesktopTopNav_group",xa="vocs_DesktopTopNav_hideCompact",cu="vocs_DesktopTopNav_icon",ul="vocs_DesktopTopNav_item",qE="vocs_DesktopTopNav_logo",e5="vocs_DesktopTopNav_logoWrapper",t5="vocs_DesktopTopNav",lp="vocs_DesktopTopNav_section",n5="vocs_DesktopTopNav_withLogo",r5="vocs_Icon",uu="var(--vocs_Icon_size)";function nt({className:e,label:t,icon:n,size:r,style:o}){return g.jsx("div",{"aria-label":t,className:O(r5,e),role:"img",style:{...o,...xr({[uu]:r})},children:g.jsx(n,{height:r,width:r})})}var o5="vocs_Logo_logoDark",i5="vocs_Logo_logoLight",Ys="vocs_Logo";function a5({className:e}){const{logoUrl:t}=kt();return t?g.jsx(g.Fragment,{children:typeof t=="string"?g.jsx("img",{alt:"Logo",className:O(e,Ys),src:t}):g.jsxs(g.Fragment,{children:[g.jsx("img",{alt:"Logo",className:O(e,Ys,o5),src:t.dark}),g.jsx("img",{alt:"Logo",className:O(e,Ys,i5),src:t.light})]})}):null}var l5="vocs_NavLogo_logoImage",s5="vocs_NavLogo_title";function Id(){const e=kt();return e.logoUrl?g.jsx(a5,{className:l5}):g.jsx("div",{className:s5,children:e.title})}const c5=h.createContext(void 0);function Ml(e){const t=h.useContext(c5);return e||t||"ltr"}function jl(e){const t=e+"CollectionProvider",[n,r]=gn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:x,children:y}=p,_=G.useRef(null),m=G.useRef(new Map).current;return G.createElement(o,{scope:x,itemMap:m,collectionRef:_},y)},l=e+"CollectionSlot",s=G.forwardRef((p,x)=>{const{scope:y,children:_}=p,m=i(l,y),v=Me(x,m.collectionRef);return G.createElement(vo,{ref:v},_)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",c=G.forwardRef((p,x)=>{const{scope:y,children:_,...m}=p,v=G.useRef(null),w=Me(x,v),E=i(u,y);return G.useEffect(()=>(E.itemMap.set(v,{ref:v,...m}),()=>void E.itemMap.delete(v))),G.createElement(vo,{[d]:"",ref:w},_)});function f(p){const x=i(e+"CollectionConsumer",p);return G.useCallback(()=>{const _=x.collectionRef.current;if(!_)return[];const m=Array.from(_.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((E,S)=>m.indexOf(E.ref.current)-m.indexOf(S.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:s,ItemSlot:c},f,r]}function u5(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const d5=h.forwardRef((e,t)=>h.createElement(ue.span,H({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),f5=d5,Fi="NavigationMenu",[Dd,h5,p5]=jl(Fi),[du,m5,v5]=jl(Fi),[Md,eT]=gn(Fi,[p5,v5]),[g5,Tr]=Md(Fi),[y5,tT]=Md(Fi),x5=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,delayDuration:a=200,skipDelayDuration:l=300,orientation:s="horizontal",dir:u,...d}=e,[c,f]=h.useState(null),p=Me(t,$=>f($)),x=Ml(u),y=h.useRef(0),_=h.useRef(0),m=h.useRef(0),[v,w]=h.useState(!0),[E="",S]=Jn({prop:r,onChange:$=>{const A=$!=="",D=l>0;A?(window.clearTimeout(m.current),D&&w(!1)):(window.clearTimeout(m.current),m.current=window.setTimeout(()=>w(!0),l)),o==null||o($)},defaultProp:i}),C=h.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>S(""),150)},[S]),b=h.useCallback($=>{window.clearTimeout(_.current),S($)},[S]),T=h.useCallback($=>{E===$?window.clearTimeout(_.current):y.current=window.setTimeout(()=>{window.clearTimeout(_.current),S($)},a)},[E,S,a]);return h.useEffect(()=>()=>{window.clearTimeout(y.current),window.clearTimeout(_.current),window.clearTimeout(m.current)},[]),h.createElement(w5,{scope:n,isRootMenu:!0,value:E,dir:x,orientation:s,rootNavigationMenu:c,onTriggerEnter:$=>{window.clearTimeout(y.current),v?T($):b($)},onTriggerLeave:()=>{window.clearTimeout(y.current),C()},onContentEnter:()=>window.clearTimeout(_.current),onContentLeave:C,onItemSelect:$=>{S(A=>A===$?"":$)},onItemDismiss:()=>S("")},h.createElement(ue.nav,H({"aria-label":"Main","data-orientation":s,dir:x},d,{ref:p})))}),w5=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:o,orientation:i,children:a,value:l,onItemSelect:s,onItemDismiss:u,onTriggerEnter:d,onTriggerLeave:c,onContentEnter:f,onContentLeave:p}=e,[x,y]=h.useState(null),[_,m]=h.useState(new Map),[v,w]=h.useState(null);return h.createElement(g5,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:l,previousValue:u5(l),baseId:Xt(),dir:o,orientation:i,viewport:x,onViewportChange:y,indicatorTrack:v,onIndicatorTrackChange:w,onTriggerEnter:et(d),onTriggerLeave:et(c),onContentEnter:et(f),onContentLeave:et(p),onItemSelect:et(s),onItemDismiss:et(u),onViewportContentChange:h.useCallback((E,S)=>{m(C=>(C.set(E,S),new Map(C)))},[]),onViewportContentRemove:h.useCallback(E=>{m(S=>S.has(E)?(S.delete(E),new Map(S)):S)},[])},h.createElement(Dd.Provider,{scope:t},h.createElement(y5,{scope:t,items:_},a)))},_5="NavigationMenuList",E5=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Tr(_5,n),i=h.createElement(ue.ul,H({"data-orientation":o.orientation},r,{ref:t}));return h.createElement(ue.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange},h.createElement(Dd.Slot,{scope:n},o.isRootMenu?h.createElement(mg,{asChild:!0},i):i))}),C5="NavigationMenuItem",[S5,pg]=Md(C5),b5=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...o}=e,i=Xt(),a=r||i||"LEGACY_REACT_AUTO_VALUE",l=h.useRef(null),s=h.useRef(null),u=h.useRef(null),d=h.useRef(()=>{}),c=h.useRef(!1),f=h.useCallback((x="start")=>{if(l.current){d.current();const y=fu(l.current);y.length&&jd(x==="start"?y:y.reverse())}},[]),p=h.useCallback(()=>{if(l.current){const x=fu(l.current);x.length&&(d.current=O5(x))}},[]);return h.createElement(S5,{scope:n,value:a,triggerRef:s,contentRef:l,focusProxyRef:u,wasEscapeCloseRef:c,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:p,onContentFocusOutside:p},h.createElement(ue.li,H({},o,{ref:t})))}),sp="NavigationMenuTrigger",T5=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...o}=e,i=Tr(sp,e.__scopeNavigationMenu),a=pg(sp,e.__scopeNavigationMenu),l=h.useRef(null),s=Me(l,a.triggerRef,t),u=yg(i.baseId,a.value),d=xg(i.baseId,a.value),c=h.useRef(!1),f=h.useRef(!1),p=a.value===i.value;return h.createElement(h.Fragment,null,h.createElement(Dd.ItemSlot,{scope:n,value:a.value},h.createElement(vg,{asChild:!0},h.createElement(ue.button,H({id:u,disabled:r,"data-disabled":r?"":void 0,"data-state":gg(p),"aria-expanded":p,"aria-controls":d},o,{ref:s,onPointerEnter:le(e.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:le(e.onPointerMove,hu(()=>{r||f.current||a.wasEscapeCloseRef.current||c.current||(i.onTriggerEnter(a.value),c.current=!0)})),onPointerLeave:le(e.onPointerLeave,hu(()=>{r||(i.onTriggerLeave(),c.current=!1)})),onClick:le(e.onClick,()=>{i.onItemSelect(a.value),f.current=p}),onKeyDown:le(e.onKeyDown,x=>{const _={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];p&&x.key===_&&(a.onEntryKeyDown(),x.preventDefault())})})))),p&&h.createElement(h.Fragment,null,h.createElement(f5,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const y=a.contentRef.current,_=x.relatedTarget,m=_===l.current,v=y==null?void 0:y.contains(_);(m||!v)&&a.onFocusProxyEnter(m?"start":"end")}}),i.viewport&&h.createElement("span",{"aria-owns":d})))}),cp="navigationMenu.linkSelect",P5=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:o,...i}=e;return h.createElement(vg,{asChild:!0},h.createElement(ue.a,H({"data-active":r?"":void 0,"aria-current":r?"page":void 0},i,{ref:t,onClick:le(e.onClick,a=>{const l=a.target,s=new CustomEvent(cp,{bubbles:!0,cancelable:!0});if(l.addEventListener(cp,u=>o==null?void 0:o(u),{once:!0}),tu(l,s),!s.defaultPrevented&&!a.metaKey){const u=new CustomEvent(Da,{bubbles:!0,cancelable:!0});tu(l,u)}},{checkForDefaultPrevented:!1})})))}),dl="NavigationMenuContent",$5=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Tr(dl,e.__scopeNavigationMenu),i=pg(dl,e.__scopeNavigationMenu),a=Me(i.contentRef,t),l=i.value===o.value,s={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return o.viewport?h.createElement(R5,H({forceMount:n},s,{ref:a})):h.createElement(yn,{present:n||l},h.createElement(k5,H({"data-state":gg(l)},s,{ref:a,onPointerEnter:le(e.onPointerEnter,o.onContentEnter),onPointerLeave:le(e.onPointerLeave,hu(o.onContentLeave)),style:{pointerEvents:!l&&o.isRootMenu?"none":void 0,...s.style}})))}),R5=h.forwardRef((e,t)=>{const n=Tr(dl,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:o}=n;return dn(()=>{r(e.value,{ref:t,...e})},[e,t,r]),dn(()=>()=>o(e.value),[e.value,o]),null}),Da="navigationMenu.rootContentDismiss",k5=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:o,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:l,onContentFocusOutside:s,...u}=e,d=Tr(dl,n),c=h.useRef(null),f=Me(c,t),p=yg(d.baseId,r),x=xg(d.baseId,r),y=h5(n),_=h.useRef(null),{onItemDismiss:m}=d;h.useEffect(()=>{const w=c.current;if(d.isRootMenu&&w){const E=()=>{var S;m(),l(),w.contains(document.activeElement)&&((S=o.current)===null||S===void 0||S.focus())};return w.addEventListener(Da,E),()=>w.removeEventListener(Da,E)}},[d.isRootMenu,e.value,o,m,l]);const v=h.useMemo(()=>{const E=y().map(A=>A.value);d.dir==="rtl"&&E.reverse();const S=E.indexOf(d.value),C=E.indexOf(d.previousValue),b=r===d.value,T=C===E.indexOf(r);if(!b&&!T)return _.current;const $=(()=>{if(S!==C){if(b&&C!==-1)return S>C?"from-end":"from-start";if(T&&S!==-1)return S>C?"to-start":"to-end"}return null})();return _.current=$,$},[d.previousValue,d.value,d.dir,y,r]);return h.createElement(mg,{asChild:!0},h.createElement(Nd,H({id:x,"aria-labelledby":p,"data-motion":v,"data-orientation":d.orientation},u,{ref:f,onDismiss:()=>{var w;const E=new Event(Da,{bubbles:!0,cancelable:!0});(w=c.current)===null||w===void 0||w.dispatchEvent(E)},onFocusOutside:le(e.onFocusOutside,w=>{var E;s();const S=w.target;(E=d.rootNavigationMenu)!==null&&E!==void 0&&E.contains(S)&&w.preventDefault()}),onPointerDownOutside:le(e.onPointerDownOutside,w=>{var E;const S=w.target,C=y().some(T=>{var $;return($=T.ref.current)===null||$===void 0?void 0:$.contains(S)}),b=d.isRootMenu&&((E=d.viewport)===null||E===void 0?void 0:E.contains(S));(C||b||!d.isRootMenu)&&w.preventDefault()}),onKeyDown:le(e.onKeyDown,w=>{const E=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!E){const b=fu(w.currentTarget),T=document.activeElement,$=b.findIndex(M=>M===T),D=w.shiftKey?b.slice(0,$).reverse():b.slice($+1,b.length);if(jd(D))w.preventDefault();else{var C;(C=i.current)===null||C===void 0||C.focus()}}}),onEscapeKeyDown:le(e.onEscapeKeyDown,w=>{a.current=!0})})))}),N5="FocusGroup",mg=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Tr(N5,n);return h.createElement(du.Provider,{scope:n},h.createElement(du.Slot,{scope:n},h.createElement(ue.div,H({dir:o.dir},r,{ref:t}))))}),up=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],A5="FocusGroupItem",vg=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=m5(n),i=Tr(A5,n);return h.createElement(du.ItemSlot,{scope:n},h.createElement(ue.button,H({},r,{ref:t,onKeyDown:le(e.onKeyDown,a=>{if(["Home","End",...up].includes(a.key)){let s=o().map(c=>c.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&s.reverse(),up.includes(a.key)){const c=s.indexOf(a.currentTarget);s=s.slice(c+1)}setTimeout(()=>jd(s)),a.preventDefault()}})})))});function fu(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function jd(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function O5(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function gg(e){return e?"open":"closed"}function yg(e,t){return`${e}-trigger-${t}`}function xg(e,t){return`${e}-content-${t}`}function hu(e){return t=>t.pointerType==="mouse"?e(t):void 0}const L5=x5,I5=E5,D5=b5,M5=T5,j5=P5,F5=$5;var z5="vocs_NavigationMenu_content",V5="vocs_NavigationMenu_item",B5="vocs_NavigationMenu_link",U5="vocs_NavigationMenu_list",H5="vocs_NavigationMenu",W5="vocs_NavigationMenu_trigger vocs_NavigationMenu_link";const wg=e=>g.jsx(L5,{...e,className:O(e.className,H5)}),_g=e=>g.jsx(I5,{...e,className:O(e.className,U5)}),Fl=({active:e,children:t,className:n,href:r})=>g.jsx(j5,{asChild:!0,children:g.jsx(Zt,{"data-active":e,className:O(n,B5),href:r,variant:"styleless",children:t})}),Eg=e=>g.jsx(D5,{...e,className:O(e.className,V5)}),Cg=({active:e,className:t,...n})=>g.jsx(M5,{...n,"data-active":e,className:O(t,W5)}),Sg=e=>g.jsx(F5,{...e,className:O(e.className,z5)});function bg(){return g.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 127.14 96.36",children:[g.jsx("title",{children:"Discord"}),g.jsx("g",{id:"图层_2","data-name":"图层 2",children:g.jsx("g",{id:"Discord_Logos","data-name":"Discord Logos",children:g.jsx("g",{id:"Discord_Logo_-_Large_-_White","data-name":"Discord Logo - Large - White",children:g.jsx("path",{d:"M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z",fill:"currentColor"})})})})]})}function Tg(){return g.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 98 96",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("title",{children:"GitHub"}),g.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})]})}function K5(){return g.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 78 82",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("title",{children:"Moon"}),g.jsx("path",{d:"M62.8455 45.9668C63.6268 45.9668 64.2127 45.3809 64.3104 44.5508C65.4334 34.3457 66.0682 33.9551 76.4197 32.3438C77.3963 32.1973 77.9334 31.7578 77.9334 30.8789C77.9334 30.0977 77.3963 29.5605 76.6151 29.4629C66.1658 27.4609 65.4334 27.4609 64.3104 17.2559C64.2127 16.377 63.6268 15.8398 62.8455 15.8398C62.0154 15.8398 61.4783 16.377 61.3807 17.207C60.1111 27.6074 59.6229 28.0957 49.0272 29.4629C48.2947 29.5117 47.7088 30.0977 47.7088 30.8789C47.7088 31.709 48.2947 32.1973 49.0272 32.3438C59.6229 34.3457 60.0623 34.4434 61.3807 44.6484C61.4783 45.3809 62.0154 45.9668 62.8455 45.9668ZM44.535 19.5508C45.0233 19.5508 45.3162 19.2578 45.4139 18.7695C46.6834 12.4707 46.5369 12.373 53.1287 11.0547C53.5682 10.957 53.91 10.7129 53.91 10.1758C53.91 9.63868 53.5682 9.39448 53.1287 9.29688C46.5369 7.97848 46.6834 7.88089 45.4139 1.58199C45.3162 1.09379 45.0233 0.800781 44.535 0.800781C43.9979 0.800781 43.7049 1.09379 43.6072 1.58199C42.3377 7.88089 42.4842 7.97848 35.9412 9.29688C35.4529 9.39448 35.1111 9.63868 35.1111 10.1758C35.1111 10.7129 35.4529 10.957 35.9412 11.0547C42.4842 12.373 42.3865 12.4707 43.6072 18.7695C43.7049 19.2578 43.9979 19.5508 44.535 19.5508Z",fill:"currentColor"}),g.jsx("path",{d:"M34.3298 81.2696C48.49 81.2696 59.9157 74.043 65.0915 61.7872C65.8239 59.9806 65.5798 58.6134 64.7497 57.7833C64.0173 57.0509 62.7478 56.9044 61.3318 57.4903C58.4509 58.6134 54.9353 59.2481 50.6384 59.2481C33.695 59.2481 22.7575 48.6036 22.7575 32.2462C22.7575 27.4122 23.6853 22.6759 24.7595 20.5763C25.5407 18.9161 25.4919 17.5001 24.8083 16.67C24.0271 15.7423 22.6599 15.4005 20.7068 16.1329C8.64624 20.7716 0.345459 33.4181 0.345459 47.8712C0.345459 66.8165 14.5056 81.2696 34.3298 81.2696ZM34.4275 74.5801C18.4607 74.5801 7.03494 62.9591 7.03494 47.3341C7.03494 38.2521 10.9411 30.0489 17.6306 24.629C16.8005 27.0704 16.361 30.6837 16.361 34.1505C16.361 52.8517 29.5446 65.6935 48.8806 65.6935C52.0544 65.6935 54.9841 65.3517 56.4001 64.9122C51.615 70.918 43.4607 74.5801 34.4275 74.5801Z",fill:"currentColor"})]})}function G5(){return g.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 84 84",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("title",{children:"Sun"}),g.jsx("path",{d:"M41.8675 15.5254C43.9183 15.5254 45.6273 13.7676 45.6273 11.7168V3.80658C45.6273 1.75588 43.9183 0.046875 41.8675 0.046875C39.7679 0.046875 38.0589 1.75588 38.0589 3.80658V11.7168C38.0589 13.7676 39.7679 15.5254 41.8675 15.5254ZM60.3246 23.2402C61.7895 24.7051 64.2309 24.7539 65.7446 23.2402L71.3598 17.6738C72.7758 16.209 72.7758 13.7188 71.3598 12.2539C69.8949 10.7891 67.4535 10.7891 65.9887 12.2539L60.3246 17.918C58.9086 19.3828 58.9086 21.7754 60.3246 23.2402ZM67.9906 41.7461C67.9906 43.7969 69.7485 45.5547 71.7992 45.5547H79.6117C81.7113 45.5547 83.4202 43.7969 83.4202 41.7461C83.4202 39.6953 81.7113 37.9375 79.6117 37.9375H71.7992C69.7485 37.9375 67.9906 39.6953 67.9906 41.7461ZM60.3246 60.3008C58.9086 61.7656 58.9086 64.1582 60.3246 65.623L65.9887 71.2871C67.4535 72.7519 69.8949 72.7031 71.3598 71.2383C72.7758 69.7734 72.7758 67.332 71.3598 65.8672L65.6957 60.3008C64.2309 58.8359 61.7895 58.8359 60.3246 60.3008ZM41.8675 67.9668C39.7679 67.9668 38.0589 69.7246 38.0589 71.7754V79.6855C38.0589 81.7363 39.7679 83.4453 41.8675 83.4453C43.9183 83.4453 45.6273 81.7363 45.6273 79.6855V71.7754C45.6273 69.7246 43.9183 67.9668 41.8675 67.9668ZM23.3617 60.3008C21.8969 58.8359 19.4067 58.8359 17.9418 60.3008L12.3754 65.8184C10.9106 67.2832 10.9106 69.7246 12.3266 71.1894C13.7914 72.6543 16.2328 72.7031 17.6977 71.2383L23.3129 65.623C24.7778 64.1582 24.7778 61.7656 23.3617 60.3008ZM15.6957 41.7461C15.6957 39.6953 13.9867 37.9375 11.8871 37.9375H4.07455C1.97497 37.9375 0.265991 39.6953 0.265991 41.7461C0.265991 43.7969 1.97497 45.5547 4.07455 45.5547H11.8871C13.9867 45.5547 15.6957 43.7969 15.6957 41.7461ZM23.3129 23.2402C24.7778 21.8242 24.7778 19.334 23.3617 17.918L17.7465 12.2539C16.3305 10.8379 13.8403 10.7891 12.4242 12.2539C10.9594 13.7188 10.9594 16.209 12.3754 17.625L17.9418 23.2402C19.4067 24.7051 21.8481 24.7051 23.3129 23.2402Z",fill:"currentColor"}),g.jsx("path",{d:"M41.8675 61.668C52.7073 61.668 61.7405 52.6836 61.7405 41.7461C61.7405 30.8086 52.7073 21.8242 41.8675 21.8242C30.9788 21.8242 21.9456 30.8086 21.9456 41.7461C21.9456 52.6836 30.9788 61.668 41.8675 61.668ZM41.8675 55.0273C34.5921 55.0273 28.5862 48.9727 28.5862 41.7461C28.5862 34.5195 34.5921 28.4648 41.8675 28.4648C49.0941 28.4648 55.0999 34.5195 55.0999 41.7461C55.0999 48.9727 49.0941 55.0273 41.8675 55.0273Z",fill:"currentColor"})]})}function Pg(){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 50 50",children:[g.jsx("title",{children:"Telegram"}),g.jsx("path",{d:"M25 2c12.703 0 23 10.297 23 23S37.703 48 25 48 2 37.703 2 25 12.297 2 25 2zm7.934 32.375c.423-1.298 2.405-14.234 2.65-16.783.074-.772-.17-1.285-.648-1.514-.578-.278-1.434-.139-2.427.219-1.362.491-18.774 7.884-19.78 8.312-.954.405-1.856.847-1.856 1.487 0 .45.267.703 1.003.966.766.273 2.695.858 3.834 1.172 1.097.303 2.346.04 3.046-.395.742-.461 9.305-6.191 9.92-6.693.614-.502 1.104.141.602.644-.502.502-6.38 6.207-7.155 6.997-.941.959-.273 1.953.358 2.351.721.454 5.906 3.932 6.687 4.49.781.558 1.573.811 2.298.811.725 0 1.107-.955 1.468-2.064z",fill:"currentColor"})]})}function $g(){return g.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 1200 1227",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("title",{children:"X"}),g.jsx("path",{d:"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z",fill:"currentColor"})]})}pu.Curtain=Y5;function pu(){var r,o,i,a;const e=kt(),{showLogo:t,showSidebar:n}=br();return g.jsxs("div",{className:O(t5,t&&!n&&n5),children:[g.jsx(ZE,{}),t&&g.jsx("div",{className:e5,children:g.jsx("div",{className:qE,children:g.jsx(Un,{to:"/",style:{alignItems:"center",display:"flex",height:"56px",marginTop:"4px"},children:g.jsx(Id,{})})})}),g.jsx("div",{className:lp}),g.jsxs("div",{className:lp,children:[(((r=e.topNav)==null?void 0:r.length)||0)>0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:Gs,children:g.jsx(Q5,{})}),g.jsx("div",{className:O(ap,xa)})]}),e.socials&&((o=e.socials)==null?void 0:o.length)>0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:O(Gs,xa),style:{marginLeft:"-8px",marginRight:"-8px"},children:e.socials.map((l,s)=>g.jsx("div",{className:ul,children:g.jsx(e4,{...l})},s))}),!((i=e.theme)!=null&&i.colorScheme)&&g.jsx("div",{className:O(ap,xa)})]}),!((a=e.theme)!=null&&a.colorScheme)&&g.jsx("div",{className:O(Gs,xa),style:{marginLeft:"-8px",marginRight:"-8px"},children:g.jsx("div",{className:ul,children:g.jsx(X5,{})})})]})]})}function Y5(){return g.jsx("div",{className:JE})}function Q5(){const{topNav:e}=kt();if(!e)return null;const{pathname:t}=be(),n=ji({pathname:t,items:e});return g.jsx(wg,{delayDuration:0,children:g.jsx(_g,{children:e.map((r,o)=>r.link?g.jsx(Fl,{active:n.includes(r.id),className:ul,href:r.link,children:r.text},o):r.items?g.jsxs(Eg,{className:ul,children:[g.jsx(Cg,{active:n.includes(r.id),children:r.text}),g.jsx(Sg,{className:XE,children:g.jsx(Z5,{items:r.items})})]},o):null)})})}function Z5({items:e}){const{pathname:t}=be(),n=ji({pathname:t,items:e});return g.jsx("ul",{children:e==null?void 0:e.map((r,o)=>g.jsx(Fl,{active:n.includes(r.id),href:r.link,children:r.text},o))})}function X5(){const{toggle:e}=F2();return g.jsxs("button",{className:hg,onClick:e,type:"button",children:[g.jsx(nt,{className:O(cu,z2),size:"20px",label:"Light",icon:G5}),g.jsx(nt,{className:O(cu,V2),size:"20px",label:"Dark",icon:K5,style:{marginTop:"-2px"}})]})}const J5={discord:bg,github:Tg,telegram:Pg,x:$g},q5={discord:"23px",github:"20px",telegram:"21px",x:"18px"};function e4({icon:e,label:t,link:n}){return g.jsx("a",{className:hg,href:n,target:"_blank",rel:"noopener noreferrer",children:g.jsx(nt,{className:cu,label:t,icon:J5[e],size:q5[e]||"20px"})})}const t4=({children:e})=>e,n4=({children:e})=>e;function r4(){const e=bo(),t=kt();return h.useMemo(()=>{const{pattern:n="",text:r="Edit page"}=t.editLink??{};let o="";return typeof n=="function"?o="":e.filePath&&(o=n.replace(/:path/g,e.filePath)),{url:o,text:r}},[t.editLink,e.filePath])}var o4="vocs_Footer_editLink",i4="vocs_Footer_navigation",dp="vocs_Footer_navigationIcon",a4="vocs_Footer_navigationIcon_left",l4="vocs_Footer_navigationIcon_right",fp="vocs_Footer_navigationItem",s4="vocs_Footer_navigationItem_left",c4="vocs_Footer_navigationItem_right",hp="vocs_Footer_navigationText",pp="vocs_Footer_navigationTextInner",u4="vocs_Footer";function d4(){return g.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 72 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("title",{children:"Arrow Left"}),g.jsx("path",{d:"M0.325684 29.7461C0.325684 30.8203 0.813963 31.8457 1.69286 32.6758L26.8882 57.8223C27.7671 58.6524 28.7437 59.043 29.7691 59.043C31.9175 59.043 33.5777 57.4317 33.5777 55.2344C33.5777 54.209 33.2359 53.1836 32.5035 52.5L25.7652 45.5176L9.26126 30.6738L8.38236 32.7734L21.3706 33.7012H67.4644C69.7593 33.7012 71.3706 32.041 71.3706 29.7461C71.3706 27.4512 69.7593 25.791 67.4644 25.791H21.3706L8.38236 26.7188L9.26126 28.8672L25.7652 13.9746L32.5035 6.99221C33.2359 6.30861 33.5777 5.28322 33.5777 4.25782C33.5777 2.06052 31.9175 0.449219 29.7691 0.449219C28.7437 0.449219 27.7671 0.839814 26.8882 1.66991L1.69286 26.8164C0.813963 27.6465 0.325684 28.6719 0.325684 29.7461Z",fill:"currentColor"})]})}function f4(){return g.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 72 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("title",{children:"Arrow Right"}),g.jsx("path",{d:"M71.3706 29.7461C71.3706 28.6719 70.8824 27.6465 70.0035 26.8164L44.8081 1.66991C43.9292 0.839814 42.9527 0.449219 41.9273 0.449219C39.7789 0.449219 38.1187 2.06052 38.1187 4.25782C38.1187 5.28322 38.4605 6.30861 39.1929 6.99221L45.9312 13.9746L62.4351 28.8672L63.314 26.7188L50.3257 25.791H4.23196C1.93706 25.791 0.325684 27.4512 0.325684 29.7461C0.325684 32.041 1.93706 33.7012 4.23196 33.7012H50.3257L63.314 32.7734L62.4351 30.6738L45.9312 45.5176L39.1929 52.5C38.4605 53.1836 38.1187 54.209 38.1187 55.2344C38.1187 57.4317 39.7789 59.043 41.9273 59.043C42.9527 59.043 43.9292 58.6524 44.8081 57.8223L70.0035 32.6758C70.8824 31.8457 71.3706 30.8203 71.3706 29.7461Z",fill:"currentColor"})]})}function h4(){const{layout:e}=br();return g.jsxs("footer",{className:u4,children:[e==="docs"&&g.jsxs(g.Fragment,{children:[g.jsx(p4,{}),g.jsx(m4,{})]}),g.jsx(n4,{})]})}function p4(){const e=r4();return e.url?g.jsx("div",{children:g.jsx(Zt,{className:o4,href:e.url,children:e.text})}):null}function m4(){const e=Il(),{pathname:t}=be(),n=h.useMemo(()=>Rg(e.items||[]).filter(l=>l.link),[e]),r=h.useMemo(()=>n.findIndex(l=>l.link===t),[n,t]),[o,i]=h.useMemo(()=>r<0?[]:r===0?[null,n[r+1]]:r===n.length-1?[n[r-1],null]:[n[r-1],n[r+1]],[r,n]),a=Pd();return h.useEffect(()=>{let l=r,s=!1;const u=c=>{if(c.code==="ShiftLeft"&&(s=!0),s){const f=n[l+1],p=n[l-1];c.code==="ArrowRight"&&(f!=null&&f.link)&&(a(f.link),l++),c.code==="ArrowLeft"&&(p!=null&&p.link)&&(a(p.link),l--)}},d=c=>{c.code==="ShiftLeft"&&(s=!1)};return window.addEventListener("keydown",u),window.addEventListener("keyup",d),()=>{window.removeEventListener("keydown",u),window.removeEventListener("keyup",d)}},[]),g.jsxs("div",{className:i4,children:[o?g.jsxs(Zt,{className:O(fp,s4),href:o.link,variant:"styleless",children:[g.jsxs("div",{className:hp,children:[g.jsx("div",{className:O(dp,a4),style:xr({[uu]:"0.75em"}),children:g.jsx(nt,{label:"Previous",icon:d4})}),g.jsx("div",{className:pp,children:o.text})]}),g.jsx(Xr,{description:"Previous",keys:["shift","←"]})]}):g.jsx("div",{}),i?g.jsxs(Zt,{className:O(fp,c4),href:i.link,variant:"styleless",children:[g.jsxs("div",{className:hp,children:[g.jsx("div",{className:pp,style:{textAlign:"right"},children:i.text}),g.jsx("div",{className:O(dp,l4),style:xr({[uu]:"0.75em"}),children:g.jsx(nt,{label:"Next",icon:f4})})]}),g.jsx(Xr,{description:"Next",keys:["shift","→"]})]}):g.jsx("div",{})]})}function Rg(e){const t=[];for(const n of e){if(n.items){t.push(...Rg(n.items));continue}t.push(n)}return t}const kg="Collapsible",[v4,Ng]=gn(kg),[g4,Fd]=v4(kg),y4=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:a,...l}=e,[s=!1,u]=Jn({prop:r,defaultProp:o,onChange:a});return h.createElement(g4,{scope:n,disabled:i,contentId:Xt(),open:s,onOpenToggle:h.useCallback(()=>u(d=>!d),[u])},h.createElement(ue.div,H({"data-state":zd(s),"data-disabled":i?"":void 0},l,{ref:t})))}),x4="CollapsibleTrigger",w4=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Fd(x4,n);return h.createElement(ue.button,H({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":zd(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:le(e.onClick,o.onOpenToggle)}))}),Ag="CollapsibleContent",_4=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Fd(Ag,e.__scopeCollapsible);return h.createElement(yn,{present:n||o.open},({present:i})=>h.createElement(E4,H({},r,{ref:t,present:i})))}),E4=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=Fd(Ag,n),[l,s]=h.useState(r),u=h.useRef(null),d=Me(t,u),c=h.useRef(0),f=c.current,p=h.useRef(0),x=p.current,y=a.open||l,_=h.useRef(y),m=h.useRef();return h.useEffect(()=>{const v=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(v)},[]),dn(()=>{const v=u.current;if(v){m.current=m.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();c.current=w.height,p.current=w.width,_.current||(v.style.transitionDuration=m.current.transitionDuration,v.style.animationName=m.current.animationName),s(r)}},[a.open,r]),h.createElement(ue.div,H({"data-state":zd(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!y},i,{ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style}}),y&&o)});function zd(e){return e?"open":"closed"}const C4=y4,S4=w4,b4=_4,Pr="Accordion",T4=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Vd,P4,$4]=jl(Pr),[zl,nT]=gn(Pr,[$4,Ng]),Bd=Ng(),Og=G.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return G.createElement(Vd.Provider,{scope:e.__scopeAccordion},n==="multiple"?G.createElement(A4,H({},i,{ref:t})):G.createElement(N4,H({},o,{ref:t})))});Og.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[Lg,R4]=zl(Pr),[Ig,k4]=zl(Pr,{collapsible:!1}),N4=G.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...a}=e,[l,s]=Jn({prop:n,defaultProp:r,onChange:o});return G.createElement(Lg,{scope:e.__scopeAccordion,value:l?[l]:[],onItemOpen:s,onItemClose:G.useCallback(()=>i&&s(""),[i,s])},G.createElement(Ig,{scope:e.__scopeAccordion,collapsible:i},G.createElement(Dg,H({},a,{ref:t}))))}),A4=G.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],l]=Jn({prop:n,defaultProp:r,onChange:o}),s=G.useCallback(d=>l((c=[])=>[...c,d]),[l]),u=G.useCallback(d=>l((c=[])=>c.filter(f=>f!==d)),[l]);return G.createElement(Lg,{scope:e.__scopeAccordion,value:a,onItemOpen:s,onItemClose:u},G.createElement(Ig,{scope:e.__scopeAccordion,collapsible:!0},G.createElement(Dg,H({},i,{ref:t}))))}),[O4,Ud]=zl(Pr),Dg=G.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...a}=e,l=G.useRef(null),s=Me(l,t),u=P4(n),c=Ml(o)==="ltr",f=le(e.onKeyDown,p=>{var x;if(!T4.includes(p.key))return;const y=p.target,_=u().filter($=>{var A;return!((A=$.ref.current)!==null&&A!==void 0&&A.disabled)}),m=_.findIndex($=>$.ref.current===y),v=_.length;if(m===-1)return;p.preventDefault();let w=m;const E=0,S=v-1,C=()=>{w=m+1,w>S&&(w=E)},b=()=>{w=m-1,w{const{__scopeAccordion:n,value:r,...o}=e,i=Ud(mu,n),a=R4(mu,n),l=Bd(n),s=Xt(),u=r&&a.value.includes(r)||!1,d=i.disabled||e.disabled;return G.createElement(L4,{scope:n,open:u,disabled:d,triggerId:s},G.createElement(C4,H({"data-orientation":i.orientation,"data-state":F4(u)},l,o,{ref:t,disabled:d,open:u,onOpenChange:c=>{c?a.onItemOpen(r):a.onItemClose(r)}})))}),mp="AccordionTrigger",D4=G.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Ud(Pr,n),i=Mg(mp,n),a=k4(mp,n),l=Bd(n);return G.createElement(Vd.ItemSlot,{scope:n},G.createElement(S4,H({"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},l,r,{ref:t})))}),M4="AccordionContent",j4=G.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Ud(Pr,n),i=Mg(M4,n),a=Bd(n);return G.createElement(b4,H({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},a,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function F4(e){return e?"open":"closed"}const z4=Og,V4=I4,B4=D4,U4=j4;var H4="vocs_MobileSearch_searchButton";function W4(){const[e,t]=h.useState(!1);return g.jsxs(tg,{open:e,onOpenChange:t,children:[g.jsx(ng,{asChild:!0,children:g.jsx("button",{className:H4,type:"button","aria-label":"Search",children:g.jsx(kd,{height:21,width:21})})}),g.jsx(fg,{open:e,onClose:()=>t(!1)})]})}var K4="vocs_MobileTopNav_button",G4="vocs_MobileTopNav_content",Y4="vocs_MobileTopNav_curtain",vp="vocs_MobileTopNav_curtainGroup",Qs="vocs_MobileTopNav_curtainItem",Q4="vocs_MobileTopNav_divider",wa="vocs_MobileTopNav_group",Z4="vocs_MobileTopNav_icon",X4="vocs_MobileTopNav_item",J4="vocs_MobileTopNav_logo",q4="vocs_MobileTopNav_menuTitle",jg="vocs_MobileTopNav_menuTrigger",Fg="vocs_MobileTopNav_navigation",e6="vocs_MobileTopNav_navigationContent",Ho="vocs_MobileTopNav_navigationItem",t6="vocs_MobileTopNav_trigger",n6="vocs_MobileTopNav_navigation_compact",r6="vocs_MobileTopNav_outlinePopover",gp="vocs_MobileTopNav_outlineTrigger",o6="vocs_MobileTopNav",yp="vocs_MobileTopNav_section",i6="vocs_MobileTopNav_separator",a6="vocs_MobileTopNav_sidebarPopover",l6="vocs_MobileTopNav_topNavPopover";function s6(e,t){let n=!1;return()=>{n=!0,setTimeout(()=>{n&&e(),n=!1},t)}}var c6="vocs_Outline_heading",u6="vocs_Outline_item",d6="vocs_Outline_items",f6="vocs_Outline_link",h6="vocs_Outline_nav",p6="vocs_Outline";function zg({minLevel:e=2,maxLevel:t=3,highlightActive:n=!0,onClickItem:r,showTitle:o=!0}={}){const{showOutline:i}=br(),a=typeof i=="number"?e+i-1:t,l=h.useRef(!0),{pathname:s,hash:u}=be(),[d,c]=h.useState([]);h.useEffect(()=>{if(typeof window>"u")return;const _=Array.from(document.querySelectorAll(`.${S0}`));c(_)},[s]);const f=h.useMemo(()=>d?d.map(_=>{const m=_.querySelector(`.${b0}`);if(!m)return null;const v=m.getBoundingClientRect(),w=m.id,E=Number(_.tagName[1]),S=_.textContent,C=window.scrollY+v.top;return Ea?null:{id:w,level:E,slugTargetElement:m,text:S,topOffset:C}}).filter(Boolean):[],[d,a,e]),[p,x]=h.useState(u.replace("#",""));if(h.useEffect(()=>{if(typeof window>"u")return;const _=new IntersectionObserver(([m])=>{var w;if(!l.current)return;const v=m.target.id;if(m.isIntersecting)x(v);else{if(!(m.target.getBoundingClientRect().top>0))return;const C=f.findIndex(T=>T.id===p),b=(w=f[C-1])==null?void 0:w.id;x(b)}},{rootMargin:"0px 0px -95% 0px"});for(const m of f)_.observe(m.slugTargetElement);return()=>_.disconnect()},[p,f]),h.useEffect(()=>{if(typeof window>"u")return;const _=new IntersectionObserver(([m])=>{var w;if(!l.current)return;const v=(w=f[f.length-1])==null?void 0:w.id;m.isIntersecting?x(v):p===v&&x(f[f.length-2].id)});return _.observe(document.querySelector("[data-bottom-observer]")),()=>_.disconnect()},[p,f]),h.useEffect(()=>{if(typeof window>"u")return;const _=s6(()=>{var m,v;if(l.current){if(window.scrollY===0){x(f[0].id);return}if(window.scrollY+document.documentElement.clientHeight>=document.documentElement.scrollHeight){x((m=f[f.length-1])==null?void 0:m.id);return}for(let w=0;wwindow.removeEventListener("scroll",_)},[f]),f.length===0)return null;const y=f.filter(_=>_.level===e);return g.jsx("aside",{className:p6,children:g.jsxs("nav",{className:h6,children:[o&&g.jsx("h2",{className:c6,children:"On this page"}),g.jsx(Vg,{activeId:n?p:null,items:f,onClickItem:()=>{r==null||r(),l.current=!1,setTimeout(()=>{l.current=!0},500)},levelItems:y,setActiveId:x})]})})}function Vg({activeId:e,items:t,levelItems:n,onClickItem:r,setActiveId:o}){const{pathname:i}=be();return g.jsx("ul",{className:d6,children:n.map(({id:a,level:l,text:s})=>{const u=`#${a}`,d=e===a,c=(()=>{var _;const p=t.findIndex(m=>m.id===a)+1,x=(_=t[p])==null?void 0:_.level;if(x<=l)return null;const y=[];for(let m=p;m{r==null||r(),o(a)},className:f6,children:s})}),c&&g.jsx(Vg,{activeId:e,levelItems:c,items:t,onClickItem:r,setActiveId:o})]},a)})})}const m6=["top","right","bottom","left"],Hn=Math.min,pt=Math.max,fl=Math.round,_a=Math.floor,Wn=e=>({x:e,y:e}),v6={left:"right",right:"left",bottom:"top",top:"bottom"},g6={start:"end",end:"start"};function vu(e,t,n){return pt(e,Hn(t,n))}function fn(e,t){return typeof e=="function"?e(t):e}function hn(e){return e.split("-")[0]}function To(e){return e.split("-")[1]}function Hd(e){return e==="x"?"y":"x"}function Wd(e){return e==="y"?"height":"width"}function Po(e){return["top","bottom"].includes(hn(e))?"y":"x"}function Kd(e){return Hd(Po(e))}function y6(e,t,n){n===void 0&&(n=!1);const r=To(e),o=Kd(e),i=Wd(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=hl(a)),[a,hl(a)]}function x6(e){const t=hl(e);return[gu(e),t,gu(t)]}function gu(e){return e.replace(/start|end/g,t=>g6[t])}function w6(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function _6(e,t,n,r){const o=To(e);let i=w6(hn(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(gu)))),i}function hl(e){return e.replace(/left|right|bottom|top/g,t=>v6[t])}function E6(e){return{top:0,right:0,bottom:0,left:0,...e}}function Bg(e){return typeof e!="number"?E6(e):{top:e,right:e,bottom:e,left:e}}function pl(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function xp(e,t,n){let{reference:r,floating:o}=e;const i=Po(t),a=Kd(t),l=Wd(a),s=hn(t),u=i==="y",d=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,f=r[l]/2-o[l]/2;let p;switch(s){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:c};break;case"left":p={x:r.x-o.width,y:c};break;default:p={x:r.x,y:r.y}}switch(To(t)){case"start":p[a]-=f*(n&&u?-1:1);break;case"end":p[a]+=f*(n&&u?-1:1);break}return p}const C6=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:c}=xp(u,r,s),f=r,p={},x=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:s}=t,{element:u,padding:d=0}=fn(e,t)||{};if(u==null)return{};const c=Bg(d),f={x:n,y:r},p=Kd(o),x=Wd(p),y=await a.getDimensions(u),_=p==="y",m=_?"top":"left",v=_?"bottom":"right",w=_?"clientHeight":"clientWidth",E=i.reference[x]+i.reference[p]-f[p]-i.floating[x],S=f[p]-i.reference[p],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let b=C?C[w]:0;(!b||!await(a.isElement==null?void 0:a.isElement(C)))&&(b=l.floating[w]||i.floating[x]);const T=E/2-S/2,$=b/2-y[x]/2-1,A=Hn(c[m],$),D=Hn(c[v],$),M=A,W=b-y[x]-D,V=b/2-y[x]/2+T,Z=vu(M,V,W),re=!s.arrow&&To(o)!=null&&V!=Z&&i.reference[x]/2-(VM<=0)){var $,A;const M=((($=i.flip)==null?void 0:$.index)||0)+1,W=S[M];if(W)return{data:{index:M,overflows:T},reset:{placement:W}};let V=(A=T.filter(Z=>Z.overflows[0]<=0).sort((Z,re)=>Z.overflows[1]-re.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(p){case"bestFit":{var D;const Z=(D=T.map(re=>[re.placement,re.overflows.filter(B=>B>0).reduce((B,I)=>B+I,0)]).sort((re,B)=>re[1]-B[1])[0])==null?void 0:D[0];Z&&(V=Z);break}case"initialPlacement":V=l;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function wp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _p(e){return m6.some(t=>e[t]>=0)}const T6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=fn(e,t);switch(r){case"referenceHidden":{const i=await $i(t,{...o,elementContext:"reference"}),a=wp(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:_p(a)}}}case"escaped":{const i=await $i(t,{...o,altBoundary:!0}),a=wp(i,n.floating);return{data:{escapedOffsets:a,escaped:_p(a)}}}default:return{}}}}};async function P6(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=hn(n),l=To(n),s=Po(n)==="y",u=["left","top"].includes(a)?-1:1,d=i&&s?-1:1,c=fn(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:x}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),s?{x:p*d,y:f*u}:{x:f*u,y:p*d}}const $6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:l}=t,s=await P6(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:a}}}}},R6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:_=>{let{x:m,y:v}=_;return{x:m,y:v}}},...s}=fn(e,t),u={x:n,y:r},d=await $i(t,s),c=Po(hn(o)),f=Hd(c);let p=u[f],x=u[c];if(i){const _=f==="y"?"top":"left",m=f==="y"?"bottom":"right",v=p+d[_],w=p-d[m];p=vu(v,p,w)}if(a){const _=c==="y"?"top":"left",m=c==="y"?"bottom":"right",v=x+d[_],w=x-d[m];x=vu(v,x,w)}const y=l.fn({...t,[f]:p,[c]:x});return{...y,data:{x:y.x-n,y:y.y-r}}}}},k6=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:s=!0,crossAxis:u=!0}=fn(e,t),d={x:n,y:r},c=Po(o),f=Hd(c);let p=d[f],x=d[c];const y=fn(l,t),_=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(s){const w=f==="y"?"height":"width",E=i.reference[f]-i.floating[w]+_.mainAxis,S=i.reference[f]+i.reference[w]-_.mainAxis;pS&&(p=S)}if(u){var m,v;const w=f==="y"?"width":"height",E=["top","left"].includes(hn(o)),S=i.reference[c]-i.floating[w]+(E&&((m=a.offset)==null?void 0:m[c])||0)+(E?0:_.crossAxis),C=i.reference[c]+i.reference[w]+(E?0:((v=a.offset)==null?void 0:v[c])||0)-(E?_.crossAxis:0);xC&&(x=C)}return{[f]:p,[c]:x}}}},N6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=()=>{},...l}=fn(e,t),s=await $i(t,l),u=hn(n),d=To(n),c=Po(n)==="y",{width:f,height:p}=r.floating;let x,y;u==="top"||u==="bottom"?(x=u,y=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(y=u,x=d==="end"?"top":"bottom");const _=p-s[x],m=f-s[y],v=!t.middlewareData.shift;let w=_,E=m;if(c){const C=f-s.left-s.right;E=d||v?Hn(m,C):C}else{const C=p-s.top-s.bottom;w=d||v?Hn(_,C):C}if(v&&!d){const C=pt(s.left,0),b=pt(s.right,0),T=pt(s.top,0),$=pt(s.bottom,0);c?E=f-2*(C!==0||b!==0?C+b:pt(s.left,s.right)):w=p-2*(T!==0||$!==0?T+$:pt(s.top,s.bottom))}await a({...t,availableWidth:E,availableHeight:w});const S=await o.getDimensions(i.floating);return f!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function Kn(e){return Ug(e)?(e.nodeName||"").toLowerCase():"#document"}function gt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wn(e){var t;return(t=(Ug(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ug(e){return e instanceof Node||e instanceof gt(e).Node}function pn(e){return e instanceof Element||e instanceof gt(e).Element}function Jt(e){return e instanceof HTMLElement||e instanceof gt(e).HTMLElement}function Ep(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gt(e).ShadowRoot}function zi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function A6(e){return["table","td","th"].includes(Kn(e))}function Gd(e){const t=Yd(),n=Rt(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function O6(e){let t=go(e);for(;Jt(t)&&!Vl(t);){if(Gd(t))return t;t=go(t)}return null}function Yd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vl(e){return["html","body","#document"].includes(Kn(e))}function Rt(e){return gt(e).getComputedStyle(e)}function Bl(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function go(e){if(Kn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ep(e)&&e.host||wn(e);return Ep(t)?t.host:t}function Hg(e){const t=go(e);return Vl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jt(t)&&zi(t)?t:Hg(t)}function Ri(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Hg(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=gt(o);return i?t.concat(a,a.visualViewport||[],zi(o)?o:[],a.frameElement&&n?Ri(a.frameElement):[]):t.concat(o,Ri(o,[],n))}function Wg(e){const t=Rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jt(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=fl(n)!==i||fl(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function Qd(e){return pn(e)?e:e.contextElement}function oo(e){const t=Qd(e);if(!Jt(t))return Wn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Wg(t);let a=(i?fl(n.width):n.width)/r,l=(i?fl(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const L6=Wn(0);function Kg(e){const t=gt(e);return!Yd()||!t.visualViewport?L6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function I6(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gt(e)?!1:t}function wr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Qd(e);let a=Wn(1);t&&(r?pn(r)&&(a=oo(r)):a=oo(e));const l=I6(i,n,r)?Kg(i):Wn(0);let s=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,d=o.width/a.x,c=o.height/a.y;if(i){const f=gt(i),p=r&&pn(r)?gt(r):r;let x=f.frameElement;for(;x&&r&&p!==f;){const y=oo(x),_=x.getBoundingClientRect(),m=Rt(x),v=_.left+(x.clientLeft+parseFloat(m.paddingLeft))*y.x,w=_.top+(x.clientTop+parseFloat(m.paddingTop))*y.y;s*=y.x,u*=y.y,d*=y.x,c*=y.y,s+=v,u+=w,x=gt(x).frameElement}}return pl({width:d,height:c,x:s,y:u})}function D6(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Jt(n),i=wn(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},l=Wn(1);const s=Wn(0);if((o||!o&&r!=="fixed")&&((Kn(n)!=="body"||zi(i))&&(a=Bl(n)),Jt(n))){const u=wr(n);l=oo(n),s.x=u.x+n.clientLeft,s.y=u.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+s.x,y:t.y*l.y-a.scrollTop*l.y+s.y}}function M6(e){return Array.from(e.getClientRects())}function Gg(e){return wr(wn(e)).left+Bl(e).scrollLeft}function j6(e){const t=wn(e),n=Bl(e),r=e.ownerDocument.body,o=pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Gg(e);const l=-n.scrollTop;return Rt(r).direction==="rtl"&&(a+=pt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}function F6(e,t){const n=gt(e),r=wn(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const u=Yd();(!u||u&&t==="fixed")&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}function z6(e,t){const n=wr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Jt(e)?oo(e):Wn(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,s=o*i.x,u=r*i.y;return{width:a,height:l,x:s,y:u}}function Cp(e,t,n){let r;if(t==="viewport")r=F6(e,n);else if(t==="document")r=j6(wn(e));else if(pn(t))r=z6(t,n);else{const o=Kg(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return pl(r)}function Yg(e,t){const n=go(e);return n===t||!pn(n)||Vl(n)?!1:Rt(n).position==="fixed"||Yg(n,t)}function V6(e,t){const n=t.get(e);if(n)return n;let r=Ri(e,[],!1).filter(l=>pn(l)&&Kn(l)!=="body"),o=null;const i=Rt(e).position==="fixed";let a=i?go(e):e;for(;pn(a)&&!Vl(a);){const l=Rt(a),s=Gd(a);!s&&l.position==="fixed"&&(o=null),(i?!s&&!o:!s&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||zi(a)&&!s&&Yg(e,a))?r=r.filter(d=>d!==a):o=l,a=go(a)}return t.set(e,r),r}function B6(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?V6(t,this._c):[].concat(n),r],l=a[0],s=a.reduce((u,d)=>{const c=Cp(t,d,o);return u.top=pt(c.top,u.top),u.right=Hn(c.right,u.right),u.bottom=Hn(c.bottom,u.bottom),u.left=pt(c.left,u.left),u},Cp(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function U6(e){const{width:t,height:n}=Wg(e);return{width:t,height:n}}function H6(e,t,n){const r=Jt(t),o=wn(t),i=n==="fixed",a=wr(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const s=Wn(0);if(r||!r&&!i)if((Kn(t)!=="body"||zi(o))&&(l=Bl(t)),r){const u=wr(t,!0,i,t);s.x=u.x+t.clientLeft,s.y=u.y+t.clientTop}else o&&(s.x=Gg(o));return{x:a.left+l.scrollLeft-s.x,y:a.top+l.scrollTop-s.y,width:a.width,height:a.height}}function Sp(e,t){return!Jt(e)||Rt(e).position==="fixed"?null:t?t(e):e.offsetParent}function Qg(e,t){const n=gt(e);if(!Jt(e))return n;let r=Sp(e,t);for(;r&&A6(r)&&Rt(r).position==="static";)r=Sp(r,t);return r&&(Kn(r)==="html"||Kn(r)==="body"&&Rt(r).position==="static"&&!Gd(r))?n:r||O6(e)||n}const W6=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Qg,i=this.getDimensions;return{reference:H6(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function K6(e){return Rt(e).direction==="rtl"}const G6={convertOffsetParentRelativeRectToViewportRelativeRect:D6,getDocumentElement:wn,getClippingRect:B6,getOffsetParent:Qg,getElementRects:W6,getClientRects:M6,getDimensions:U6,getScale:oo,isElement:pn,isRTL:K6};function Y6(e,t){let n=null,r;const o=wn(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function a(l,s){l===void 0&&(l=!1),s===void 0&&(s=1),i();const{left:u,top:d,width:c,height:f}=e.getBoundingClientRect();if(l||t(),!c||!f)return;const p=_a(d),x=_a(o.clientWidth-(u+c)),y=_a(o.clientHeight-(d+f)),_=_a(u),v={rootMargin:-p+"px "+-x+"px "+-y+"px "+-_+"px",threshold:pt(0,Hn(1,s))||1};let w=!0;function E(S){const C=S[0].intersectionRatio;if(C!==s){if(!w)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(E,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,v)}n.observe(e)}return a(!0),i}function Q6(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,u=Qd(e),d=o||i?[...u?Ri(u):[],...Ri(t)]:[];d.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const c=u&&l?Y6(u,n):null;let f=-1,p=null;a&&(p=new ResizeObserver(m=>{let[v]=m;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),u&&!s&&p.observe(u),p.observe(t));let x,y=s?wr(e):null;s&&_();function _(){const m=wr(e);y&&(m.x!==y.x||m.y!==y.y||m.width!==y.width||m.height!==y.height)&&n(),y=m,x=requestAnimationFrame(_)}return n(),()=>{d.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),c&&c(),p&&p.disconnect(),p=null,s&&cancelAnimationFrame(x)}}const Z6=R6,X6=b6,J6=N6,q6=T6,bp=S6,e8=k6,t8=(e,t,n)=>{const r=new Map,o={platform:G6,...n},i={...o.platform,_c:r};return C6(e,t,{...o,platform:i})},n8=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?bp({element:r.current,padding:o}).fn(n):{}:r?bp({element:r,padding:o}).fn(n):{}}}};var Ma=typeof document<"u"?h.useLayoutEffect:h.useEffect;function ml(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ml(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ml(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Zg(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tp(e,t){const n=Zg(e);return Math.round(t*n)/n}function Pp(e){const t=h.useRef(e);return Ma(()=>{t.current=e}),t}function r8(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:s,open:u}=e,[d,c]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=h.useState(r);ml(f,r)||p(r);const[x,y]=h.useState(null),[_,m]=h.useState(null),v=h.useCallback(B=>{B!==C.current&&(C.current=B,y(B))},[]),w=h.useCallback(B=>{B!==b.current&&(b.current=B,m(B))},[]),E=i||x,S=a||_,C=h.useRef(null),b=h.useRef(null),T=h.useRef(d),$=s!=null,A=Pp(s),D=Pp(o),M=h.useCallback(()=>{if(!C.current||!b.current)return;const B={placement:t,strategy:n,middleware:f};D.current&&(B.platform=D.current),t8(C.current,b.current,B).then(I=>{const F={...I,isPositioned:!0};W.current&&!ml(T.current,F)&&(T.current=F,_o.flushSync(()=>{c(F)}))})},[f,t,n,D]);Ma(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,c(B=>({...B,isPositioned:!1})))},[u]);const W=h.useRef(!1);Ma(()=>(W.current=!0,()=>{W.current=!1}),[]),Ma(()=>{if(E&&(C.current=E),S&&(b.current=S),E&&S){if(A.current)return A.current(E,S,M);M()}},[E,S,M,A,$]);const V=h.useMemo(()=>({reference:C,floating:b,setReference:v,setFloating:w}),[v,w]),Z=h.useMemo(()=>({reference:E,floating:S}),[E,S]),re=h.useMemo(()=>{const B={position:n,left:0,top:0};if(!Z.floating)return B;const I=Tp(Z.floating,d.x),F=Tp(Z.floating,d.y);return l?{...B,transform:"translate("+I+"px, "+F+"px)",...Zg(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:F}},[n,l,Z.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:M,refs:V,elements:Z,floatingStyles:re}),[d,M,V,Z,re])}function o8(e){const[t,n]=h.useState(void 0);return dn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,l;if("borderBoxSize"in i){const s=i.borderBoxSize,u=Array.isArray(s)?s[0]:s;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Xg="Popper",[Jg,qg]=gn(Xg),[i8,e1]=Jg(Xg),a8=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return h.createElement(i8,{scope:t,anchor:r,onAnchorChange:o},n)},l8="PopperAnchor",s8=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=e1(l8,n),a=h.useRef(null),l=Me(t,a);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:h.createElement(ue.div,H({},o,{ref:l}))}),t1="PopperContent",[c8,rT]=Jg(t1),u8=h.forwardRef((e,t)=>{var n,r,o,i,a,l,s,u;const{__scopePopper:d,side:c="bottom",sideOffset:f=0,align:p="center",alignOffset:x=0,arrowPadding:y=0,avoidCollisions:_=!0,collisionBoundary:m=[],collisionPadding:v=0,sticky:w="partial",hideWhenDetached:E=!1,updatePositionStrategy:S="optimized",onPlaced:C,...b}=e,T=e1(t1,d),[$,A]=h.useState(null),D=Me(t,ft=>A(ft)),[M,W]=h.useState(null),V=o8(M),Z=(n=V==null?void 0:V.width)!==null&&n!==void 0?n:0,re=(r=V==null?void 0:V.height)!==null&&r!==void 0?r:0,B=c+(p!=="center"?"-"+p:""),I=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},F=Array.isArray(m)?m:[m],Q=F.length>0,oe={padding:I,boundary:F.filter(d8),altBoundary:Q},{refs:de,floatingStyles:dt,placement:Le,isPositioned:Ge,middlewareData:Te}=r8({strategy:"fixed",placement:B,whileElementsMounted:(...ft)=>Q6(...ft,{animationFrame:S==="always"}),elements:{reference:T.anchor},middleware:[$6({mainAxis:f+re,alignmentAxis:x}),_&&Z6({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?e8():void 0,...oe}),_&&X6({...oe}),J6({...oe,apply:({elements:ft,rects:Bi,availableWidth:Kl,availableHeight:Gl})=>{const{width:Yl,height:Ql}=Bi.reference,Bt=ft.floating.style;Bt.setProperty("--radix-popper-available-width",`${Kl}px`),Bt.setProperty("--radix-popper-available-height",`${Gl}px`),Bt.setProperty("--radix-popper-anchor-width",`${Yl}px`),Bt.setProperty("--radix-popper-anchor-height",`${Ql}px`)}}),M&&n8({element:M,padding:y}),f8({arrowWidth:Z,arrowHeight:re}),E&&q6({strategy:"referenceHidden",...oe})]}),[Nt,Ul]=n1(Le),$r=et(C);dn(()=>{Ge&&($r==null||$r())},[Ge,$r]);const Hl=(o=Te.arrow)===null||o===void 0?void 0:o.x,Je=(i=Te.arrow)===null||i===void 0?void 0:i.y,qn=((a=Te.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Vi,Wl]=h.useState();return dn(()=>{$&&Wl(window.getComputedStyle($).zIndex)},[$]),h.createElement("div",{ref:de.setFloating,"data-radix-popper-content-wrapper":"",style:{...dt,transform:Ge?dt.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Vi,"--radix-popper-transform-origin":[(l=Te.transformOrigin)===null||l===void 0?void 0:l.x,(s=Te.transformOrigin)===null||s===void 0?void 0:s.y].join(" ")},dir:e.dir},h.createElement(c8,{scope:d,placedSide:Nt,onArrowChange:W,arrowX:Hl,arrowY:Je,shouldHideArrow:qn},h.createElement(ue.div,H({"data-side":Nt,"data-align":Ul},b,{ref:D,style:{...b.style,animation:Ge?void 0:"none",opacity:(u=Te.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function d8(e){return e!==null}const f8=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:l,rects:s,middlewareData:u}=t,c=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=c?0:e.arrowWidth,p=c?0:e.arrowHeight,[x,y]=n1(l),_={start:"0%",center:"50%",end:"100%"}[y],m=((r=(o=u.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+f/2,v=((i=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+p/2;let w="",E="";return x==="bottom"?(w=c?_:`${m}px`,E=`${-p}px`):x==="top"?(w=c?_:`${m}px`,E=`${s.floating.height+p}px`):x==="right"?(w=`${-p}px`,E=c?_:`${v}px`):x==="left"&&(w=`${s.floating.width+p}px`,E=c?_:`${v}px`),{data:{x:w,y:E}}}});function n1(e){const[t,n="center"]=e.split("-");return[t,n]}const h8=a8,p8=s8,m8=u8,r1="Popover",[o1,oT]=gn(r1,[qg]),Zd=qg(),[v8,$o]=o1(r1),g8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,l=Zd(t),s=h.useRef(null),[u,d]=h.useState(!1),[c=!1,f]=Jn({prop:r,defaultProp:o,onChange:i});return h.createElement(h8,l,h.createElement(v8,{scope:t,contentId:Xt(),triggerRef:s,open:c,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:h.useCallback(()=>d(!0),[]),onCustomAnchorRemove:h.useCallback(()=>d(!1),[]),modal:a},n))},y8="PopoverTrigger",x8=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=$o(y8,n),i=Zd(n),a=Me(t,o.triggerRef),l=h.createElement(ue.button,H({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":l1(o.open)},r,{ref:a,onClick:le(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?l:h.createElement(p8,H({asChild:!0},i),l)}),i1="PopoverPortal",[w8,_8]=o1(i1,{forceMount:void 0}),E8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=$o(i1,t);return h.createElement(w8,{scope:t,forceMount:n},h.createElement(yn,{present:n||i.open},h.createElement(M0,{asChild:!0,container:o},r)))},ki="PopoverContent",C8=h.forwardRef((e,t)=>{const n=_8(ki,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=$o(ki,e.__scopePopover);return h.createElement(yn,{present:r||i.open},i.modal?h.createElement(S8,H({},o,{ref:t})):h.createElement(b8,H({},o,{ref:t})))}),S8=h.forwardRef((e,t)=>{const n=$o(ki,e.__scopePopover),r=h.useRef(null),o=Me(t,r),i=h.useRef(!1);return h.useEffect(()=>{const a=r.current;if(a)return Q0(a)},[]),h.createElement(G0,{as:vo,allowPinchZoom:!0},h.createElement(a1,H({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:le(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),i.current||(l=n.triggerRef.current)===null||l===void 0||l.focus()}),onPointerDownOutside:le(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0,u=l.button===2||s;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:le(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})))}),b8=h.forwardRef((e,t)=>{const n=$o(ki,e.__scopePopover),r=h.useRef(!1),o=h.useRef(!1);return h.createElement(a1,H({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a;if((a=e.onCloseAutoFocus)===null||a===void 0||a.call(e,i),!i.defaultPrevented){var l;r.current||(l=n.triggerRef.current)===null||l===void 0||l.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var a,l;(a=e.onInteractOutside)===null||a===void 0||a.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((l=n.triggerRef.current)===null||l===void 0?void 0:l.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),a1=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,...c}=e,f=$o(ki,n),p=Zd(n);return j0(),h.createElement(I0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},h.createElement(Nd,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1)},h.createElement(m8,H({"data-state":l1(f.open),role:"dialog",id:f.contentId},p,c,{ref:t,style:{...c.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function l1(e){return e?"open":"closed"}const T8=g8,P8=x8,$8=E8,R8=C8;var k8="vocs_Popover";Mt.Root=T8;Mt.Trigger=P8;function Mt({children:e,className:t}){return g.jsx($8,{children:g.jsx(R8,{className:O(k8,t),sideOffset:12,children:e})})}var N8="vocs_Sidebar_backLink",A8="vocs_Sidebar_divider",O8="vocs_Sidebar_group",Xo="vocs_Sidebar_item",s1="vocs_Sidebar_items",L8="vocs_Sidebar_level",I8="vocs_Sidebar_levelCollapsed",D8="vocs_Sidebar_levelInset",M8="vocs_Sidebar_logo",j8="vocs_Sidebar_logoWrapper",F8="vocs_Sidebar_navigation",z8="vocs_Sidebar",c1="vocs_Sidebar_section",V8="vocs_Sidebar_sectionCollapse",B8="vocs_Sidebar_sectionCollapseActive",U8="vocs_Sidebar_sectionHeader",H8="vocs_Sidebar_sectionHeaderActive",$p="vocs_Sidebar_sectionTitle";function u1(){return g.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 39 69",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("title",{children:"Chevron Right"}),g.jsx("path",{d:"M38.8697 34.7461C38.8697 33.6719 38.4791 32.6953 37.649 31.8652L7.47318 1.8848C6.74078 1.1035 5.76418 0.712891 4.64118 0.712891C2.34618 0.712891 0.588379 2.42189 0.588379 4.71679C0.588379 5.79099 1.07668 6.81639 1.76028 7.59769L29.0552 34.7461L1.76028 61.8945C1.07668 62.6758 0.588379 63.6523 0.588379 64.7754C0.588379 67.0703 2.34618 68.7793 4.64118 68.7793C5.76418 68.7793 6.74078 68.3887 7.47318 67.6074L37.649 37.627C38.4791 36.7969 38.8697 35.8203 38.8697 34.7461Z",fill:"currentColor"})]})}function d1(e){const{className:t,onClickItem:n}=e,{previousPath:r}=bo(),o=h.useRef(null),i=Il(),[a,l]=h.useState("/");if(h.useEffect(()=>{typeof window>"u"||r&&l(r)},[i.key,i.backLink]),!i)return null;const s=W8(i.items);return g.jsxs("aside",{ref:o,className:O(z8,t),children:[g.jsxs("div",{className:j8,children:[g.jsx("div",{className:M8,children:g.jsx(Un,{to:"/",style:{alignItems:"center",display:"flex",height:"100%"},children:g.jsx(Id,{})})}),g.jsx("div",{className:A8})]}),g.jsx("nav",{className:F8,children:g.jsxs("div",{className:O8,children:[i.backLink&&g.jsx("section",{className:c1,children:g.jsx("div",{className:s1,children:g.jsxs(Un,{className:O(Xo,N8),to:a,children:["←"," ",typeof history<"u"&&history.state.key&&a!=="/"?"Back":"Home"]})})}),s.map((u,d)=>g.jsx(h1,{depth:0,item:u,onClick:n,sidebarRef:o},`${u.text}${d}`))]})})]},i.key)}function W8(e){const t=[];let n=0;for(const r of e){if(r.items){n=t.push(r);continue}t[n]?t[n].items.push(r):t.push({text:"",items:[r]})}return t}function f1(e,t){return e.find(n=>Ol(t,n.link??"")||n.link===t?!0:n.items?f1(n.items,t):!1)}function h1(e){const{depth:t,item:n,onClick:r,sidebarRef:o}=e,i=h.useRef(null),{pathname:a}=be(),l=u_(n.link??""),s=h.useMemo(()=>n.items?!!f1(n.items,a):!1,[n.items,a]),[u,d]=h.useState(()=>l||!n.items||s?!1:!!n.collapsed),c=n.collapsed!==void 0&&n.items!==void 0,f=h.useCallback(y=>{"key"in y&&y.key!=="Enter"||n.link||d(_=>!_)},[n.link]),p=h.useCallback(y=>{"key"in y&&y.key!=="Enter"||n.link&&d(_=>!_)},[n.link]),x=h.useRef(!0);return h.useEffect(()=>{!x.current||(x.current=!1,!Ol(a,n.link??""))||requestAnimationFrame(()=>{var v,w,E;const _=((v=i.current)==null?void 0:v.offsetTop)??0,m=((w=o==null?void 0:o.current)==null?void 0:w.clientHeight)??0;_0&&t<5&&n.items.map((y,_)=>g.jsx(h1,{depth:t+1,item:y,onClick:r,sidebarRef:o},`${y.text}${_}`))})]}):g.jsx(g.Fragment,{children:n.link?g.jsx(Un,{ref:i,"data-active":!!l,onClick:r,className:Xo,to:n.link,children:n.text}):g.jsx("div",{className:Xo,children:n.text})})}function K8(){return g.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 69 39",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("title",{children:"Chevron Down"}),g.jsx("path",{d:"M34.8677 38.8398C35.9419 38.8398 37.0161 38.4492 37.7485 37.6191L67.729 7.44339C68.4614 6.71089 68.9009 5.73439 68.9009 4.61129C68.9009 2.31639 67.1919 0.558594 64.897 0.558594C63.8227 0.558594 62.7485 1.04689 62.0161 1.73049L32.5727 31.2715H37.1138L7.67042 1.73049C6.93802 1.04689 5.96142 0.558594 4.83842 0.558594C2.54342 0.558594 0.785645 2.31639 0.785645 4.61129C0.785645 5.73439 1.22512 6.71089 1.95752 7.44339L31.9868 37.6191C32.768 38.4492 33.7446 38.8398 34.8677 38.8398Z",fill:"currentColor"})]})}function G8(){return g.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 69 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("title",{children:"Chevron Up"}),g.jsx("path",{d:"M1.95752 32.2441C1.22512 32.9277 0.785645 33.9531 0.785645 35.0762C0.785645 37.3711 2.54342 39.1289 4.83842 39.1289C5.96142 39.1289 6.98682 38.6895 7.67042 37.957L37.1138 8.36716H32.5727L62.0161 37.957C62.6997 38.6895 63.8227 39.1289 64.897 39.1289C67.1919 39.1289 68.9009 37.3711 68.9009 35.0762C68.9009 33.9531 68.4614 32.9277 67.729 32.2441L37.7485 2.06836C37.0161 1.23826 35.9419 0.847656 34.8677 0.847656C33.7446 0.847656 32.7192 1.23826 31.9868 2.06836L1.95752 32.2441Z",fill:"currentColor"})]})}function Y8(){return g.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 79 48",fill:"none",children:[g.jsx("title",{children:"Menu"}),g.jsx("path",{fill:"currentColor",d:"M19.528 47.232h40.87c1.952 0 3.515-1.562 3.515-3.564a3.5 3.5 0 0 0-3.516-3.516H19.528a3.501 3.501 0 0 0-3.515 3.516c0 2.002 1.562 3.564 3.515 3.564ZM12.057 27.262h55.81a3.501 3.501 0 0 0 3.516-3.516 3.501 3.501 0 0 0-3.515-3.515h-55.81a3.501 3.501 0 0 0-3.516 3.515 3.501 3.501 0 0 0 3.515 3.516ZM4.391 7.34H75.29c2.002 0 3.515-1.563 3.515-3.516 0-2.002-1.513-3.564-3.515-3.564H4.39C2.438.26.876 1.822.876 3.824A3.501 3.501 0 0 0 4.39 7.34Z"})]})}yu.Curtain=tC;function yu(){var n,r;const e=kt(),{showLogo:t}=br();return g.jsxs("div",{className:o6,children:[g.jsxs("div",{className:yp,children:[t&&g.jsx("div",{className:wa,children:g.jsx("div",{className:J4,children:g.jsx(Un,{to:"/",style:{alignItems:"center",display:"flex",height:"100%"},children:g.jsx(Id,{})})})}),e.topNav&&g.jsx(g.Fragment,{children:g.jsxs("div",{className:wa,children:[g.jsx(Q8,{items:e.topNav}),g.jsx(X8,{items:e.topNav})]})})]}),g.jsxs("div",{className:yp,children:[g.jsx("div",{className:wa,style:{marginRight:"-8px"},children:g.jsx(W4,{})}),e.socials&&((n=e.socials)==null?void 0:n.length)>0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:Q4}),g.jsx("div",{className:wa,style:{marginLeft:"-8px"},children:(r=e.socials)==null?void 0:r.map((o,i)=>g.jsx(eC,{...o},i))})]})]})]})}function Q8({items:e}){const{pathname:t}=be(),n=ji({pathname:t,items:e});return g.jsx(wg,{className:Fg,children:g.jsx(_g,{children:e.map((r,o)=>r!=null&&r.link?g.jsx(Fl,{active:n==null?void 0:n.includes(r.id),href:r.link,children:r.text},o):g.jsxs(Eg,{className:X4,children:[g.jsx(Cg,{active:n==null?void 0:n.includes(r.id),children:r.text}),g.jsx(Sg,{className:G4,children:g.jsx(Z8,{items:r.items||[]})})]},o))})})}function Z8({items:e}){const{pathname:t}=be(),n=ji({pathname:t,items:e});return g.jsx("ul",{children:e==null?void 0:e.map((r,o)=>g.jsx(Fl,{active:n.includes(r.id),href:r.link,children:r.text},o))})}function X8({items:e}){var a;const[t,n]=h.useState(!1),{pathname:r}=be(),o=ji({pathname:r,items:e}),i=e.filter(l=>l.id===o[0])[0];return g.jsx("div",{className:O(Fg,n6),children:i?g.jsxs(Mt.Root,{modal:!0,open:t,onOpenChange:n,children:[g.jsxs(Mt.Trigger,{className:O(jg,Ho),children:[i.text,g.jsx(nt,{label:"Menu",icon:K8,size:"11px"})]}),g.jsx(Mt,{className:l6,children:g.jsx(z4,{type:"single",collapsible:!0,style:{display:"flex",flexDirection:"column"},children:e.map((l,s)=>{var u;return l!=null&&l.link?g.jsx(Zt,{"data-active":o.includes(l.id),className:Ho,href:l.link,onClick:()=>n(!1),variant:"styleless",children:l.text},s):g.jsxs(V4,{value:s.toString(),children:[g.jsx(B4,{className:O(Ho,t6),"data-active":o.includes(l.id),children:l.text}),g.jsx(U4,{className:e6,children:(u=l.items)==null?void 0:u.map((d,c)=>g.jsx(Zt,{className:Ho,href:d.link,onClick:()=>n(!1),variant:"styleless",children:d.text},c))})]},s)})})})]}):(a=e[0])!=null&&a.link?g.jsx(Zt,{className:Ho,href:e[0].link,variant:"styleless",children:e[0].text}):null})}const J8={discord:bg,github:Tg,telegram:Pg,x:$g},q8={discord:"21px",github:"18px",telegram:"21px",x:"16px"};function eC({icon:e,label:t,link:n,type:r}){return g.jsx("a",{className:K4,href:n,target:"_blank",rel:"noopener noreferrer",children:g.jsx(nt,{className:Z4,label:t,icon:J8[e],size:q8[r]||"18px"})})}function tC({enableScrollToTop:e}){const{pathname:t}=be(),{layout:n,showSidebar:r}=br(),{frontmatter:o={}}=bo(),i=Il(),[a,l]=h.useState(!1),[s,u]=h.useState(!1),d=h.useMemo(()=>{if(!i||n==="minimal")return;const p=p1({sidebarItems:i.items,pathname:t});return p==null?void 0:p.text},[n,t,i]),c=h.useMemo(()=>{var p;if(!(typeof window>"u"))return(p=document.querySelector(".vocs_Content h1"))==null?void 0:p.textContent},[]),f=d||o.title||c;return g.jsxs("div",{className:Y4,children:[g.jsx("div",{className:vp,children:g.jsx("div",{className:Qs,children:r?g.jsxs(Mt.Root,{modal:!0,open:s,onOpenChange:u,children:[g.jsxs(Mt.Trigger,{className:jg,children:[g.jsx(nt,{label:"Menu",icon:Y8,size:"13px"}),g.jsx("div",{className:q4,children:f})]}),g.jsx(Mt,{className:a6,children:g.jsx(d1,{onClickItem:()=>u(!1)})})]}):f})}),g.jsxs("div",{className:vp,children:[e&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:Qs,children:g.jsxs("button",{className:gp,onClick:()=>window.scrollTo({behavior:"smooth",top:0}),type:"button",children:["Top",g.jsx(nt,{label:"Scroll to top",icon:G8,size:"10px"})]})}),g.jsx("div",{className:i6})]}),n==="docs"&&g.jsx("div",{className:Qs,children:g.jsxs(Mt.Root,{modal:!0,open:a,onOpenChange:l,children:[g.jsxs(Mt.Trigger,{className:gp,children:["On this page",g.jsx(nt,{label:"On this page",icon:u1,size:"10px"})]}),g.jsx(Mt,{className:r6,children:g.jsx(zg,{onClickItem:()=>l(!1),showTitle:!1})})]})})]})]})}function p1({sidebarItems:e,pathname:t}){const n=t.replace(/(.+)\/$/,"$1");for(const r of e){if((r==null?void 0:r.link)===n)return r;if(r.items){const o=p1({sidebarItems:r.items,pathname:n});if(o)return o}}}var nC="vocs_SkipLink";const m1="vocs-content";function rC(){const{pathname:e}=be();return g.jsx("a",{className:O(nC,A0),href:`${e}#${m1}`,children:"Skip to content"})}var oC="vocs_DocsLayout_content",iC="vocs_DocsLayout_content_withSidebar",aC="vocs_DocsLayout_content_withTopNav",lC="vocs_DocsLayout_gutterLeft",sC="vocs_DocsLayout_gutterRight",cC="vocs_DocsLayout_gutterRight_withSidebar",uC="vocs_DocsLayout_gutterTop",dC="vocs_DocsLayout_gutterTopCurtain",fC="vocs_DocsLayout_gutterTopCurtain_hidden",hC="vocs_DocsLayout_gutterTopCurtain_withSidebar",pC="vocs_DocsLayout_gutterTop_offsetLeftGutter",mC="vocs_DocsLayout_gutterTop_sticky",vC="vocs_DocsLayout",gC="vocs_DocsLayout_sidebar";function xu({children:e}){const{banner:t,font:n}=kt(),{frontmatter:r={}}=bo(),{content:o}=r,{layout:i,showOutline:a,showSidebar:l,showTopNav:s}=br(),{ref:u,inView:d}=C0({initialInView:!0,rootMargin:"100px 0px 0px 0px"}),[c,f]=su("banner",!0);return g.jsxs("div",{className:vC,"data-layout":i,style:xr({[g2]:c?t==null?void 0:t.height:void 0,[e2.default]:n!=null&&n.google?`${n.google}, ${q_.default}`:void 0}),children:[g.jsx(rC,{}),c&&g.jsx(M2,{hide:()=>f(!1)}),l&&g.jsx("div",{className:lC,children:g.jsx(d1,{className:gC})}),s&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{ref:u,className:O(uC,l&&pC,(i==="minimal"||i==="landing")&&mC),children:[g.jsx(pu,{}),g.jsx(yu,{})]}),g.jsxs("div",{className:O(dC,l&&hC,(i==="minimal"||i==="landing")&&fC),children:[g.jsx(pu.Curtain,{}),g.jsx(yu.Curtain,{enableScrollToTop:!d})]})]}),a&&g.jsx("div",{className:O(sC,l&&cC),children:g.jsx(zg,{})}),g.jsxs("div",{id:m1,className:O(oC,l&&iC,s&&aC),style:xr({[Ns.horizontalPadding]:o==null?void 0:o.horizontalPadding,[Ns.width]:o==null?void 0:o.width,[Ns.verticalPadding]:o==null?void 0:o.verticalPadding}),children:[g.jsx(R0,{children:e}),g.jsx(h4,{})]}),g.jsx("div",{"data-bottom-observer":!0})]})}const wu={},v1=G.createContext(wu);function yC(e){const t=G.useContext(v1);return G.useMemo(function(){return typeof e=="function"?e(t):{...t,...e}},[t,e])}function xC(e){let t;return e.disableParentContext?t=typeof e.components=="function"?e.components(wu):e.components||wu:t=yC(e.components),G.createElement(v1.Provider,{value:t},e.children)}var g1={exports:{}},wC="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",_C=wC,EC=_C;function y1(){}function x1(){}x1.resetWarningCache=y1;var CC=function(){function e(r,o,i,a,l,s){if(s!==EC){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:x1,resetWarningCache:y1};return n.PropTypes=n,n};g1.exports=CC();var SC=g1.exports;const xe=Gn(SC);function bC(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var w1=h,TC=bC(w1);function Rp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PC(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var $C=!!(typeof window<"u"&&window.document&&window.document.createElement);function RC(e,t,n){if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof n<"u"&&typeof n!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function r(o){return o.displayName||o.name||"Component"}return function(i){if(typeof i!="function")throw new Error("Expected WrappedComponent to be a React component.");var a=[],l;function s(){l=e(a.map(function(d){return d.props})),u.canUseDOM?t(l):n&&(l=n(l))}var u=function(d){PC(c,d);function c(){return d.apply(this,arguments)||this}c.peek=function(){return l},c.rewind=function(){if(c.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var x=l;return l=void 0,a=[],x};var f=c.prototype;return f.UNSAFE_componentWillMount=function(){a.push(this),s()},f.componentDidUpdate=function(){s()},f.componentWillUnmount=function(){var x=a.indexOf(this);a.splice(x,1),s()},f.render=function(){return TC.createElement(i,this.props)},c}(w1.PureComponent);return Rp(u,"displayName","SideEffect("+r(i)+")"),Rp(u,"canUseDOM",$C),u}}var kC=RC;const NC=Gn(kC);var AC=typeof Element<"u",OC=typeof Map=="function",LC=typeof Set=="function",IC=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ja(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ja(e[r],t[r]))return!1;return!0}var i;if(OC&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!ja(r.value[1],t.get(r.value[0])))return!1;return!0}if(LC&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(IC&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(AC&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&e.$$typeof)&&!ja(e[o[r]],t[o[r]]))return!1;return!0}return e!==e&&t!==t}var DC=function(t,n){try{return ja(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const MC=Gn(DC);/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var kp=Object.getOwnPropertySymbols,jC=Object.prototype.hasOwnProperty,FC=Object.prototype.propertyIsEnumerable;function zC(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function VC(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var BC=VC()?Object.assign:function(e,t){for(var n,r=zC(e),o,i=1;i=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},ZC=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},_u=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n===!1?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},XC=function(t){var n=io(t,J.TITLE),r=io(t,Ni.TITLE_TEMPLATE);if(r&&n)return r.replace(/%s/g,function(){return Array.isArray(n)?n.join(""):n});var o=io(t,Ni.DEFAULT_TITLE);return n||o||void 0},JC=function(t){return io(t,Ni.ON_CHANGE_CLIENT_STATE)||function(){}},Zs=function(t,n){return n.filter(function(r){return typeof r[t]<"u"}).map(function(r){return r[t]}).reduce(function(r,o){return it({},r,o)},{})},qC=function(t,n){return n.filter(function(r){return typeof r[J.BASE]<"u"}).map(function(r){return r[J.BASE]}).reverse().reduce(function(r,o){if(!r.length)for(var i=Object.keys(o),a=0;a=0;r--){var o=t[r];if(o.hasOwnProperty(n))return o[n]}return null},e7=function(t){return{baseTag:qC([we.HREF,we.TARGET],t),bodyAttributes:Zs(dr.BODY,t),defer:io(t,Ni.DEFER),encode:io(t,Ni.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Zs(dr.HTML,t),linkTags:Wo(J.LINK,[we.REL,we.HREF],t),metaTags:Wo(J.META,[we.NAME,we.CHARSET,we.HTTPEQUIV,we.PROPERTY,we.ITEM_PROP],t),noscriptTags:Wo(J.NOSCRIPT,[we.INNER_HTML],t),onChangeClientState:JC(t),scriptTags:Wo(J.SCRIPT,[we.SRC,we.INNER_HTML],t),styleTags:Wo(J.STYLE,[we.CSS_TEXT],t),title:XC(t),titleAttributes:Zs(dr.TITLE,t)}},Eu=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){Eu(t)},0)}}(),Ap=function(t){return clearTimeout(t)},t7=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Eu:global.requestAnimationFrame||Eu,n7=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Ap:global.cancelAnimationFrame||Ap,r7=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},Ko=null,o7=function(t){Ko&&n7(Ko),t.defer?Ko=t7(function(){Op(t,function(){Ko=null})}):(Op(t),Ko=null)},Op=function(t,n){var r=t.baseTag,o=t.bodyAttributes,i=t.htmlAttributes,a=t.linkTags,l=t.metaTags,s=t.noscriptTags,u=t.onChangeClientState,d=t.scriptTags,c=t.styleTags,f=t.title,p=t.titleAttributes;Cu(J.BODY,o),Cu(J.HTML,i),i7(f,p);var x={baseTag:Mr(J.BASE,r),linkTags:Mr(J.LINK,a),metaTags:Mr(J.META,l),noscriptTags:Mr(J.NOSCRIPT,s),scriptTags:Mr(J.SCRIPT,d),styleTags:Mr(J.STYLE,c)},y={},_={};Object.keys(x).forEach(function(m){var v=x[m],w=v.newTags,E=v.oldTags;w.length&&(y[m]=w),E.length&&(_[m]=x[m].oldTags)}),n&&n(),u(t,y,_)},_1=function(t){return Array.isArray(t)?t.join(""):t},i7=function(t,n){typeof t<"u"&&document.title!==t&&(document.title=_1(t)),Cu(J.TITLE,n)},Cu=function(t,n){var r=document.getElementsByTagName(t)[0];if(r){for(var o=r.getAttribute(jt),i=o?o.split(","):[],a=[].concat(i),l=Object.keys(n),s=0;s=0;f--)r.removeAttribute(a[f]);i.length===a.length?r.removeAttribute(jt):r.getAttribute(jt)!==l.join(",")&&r.setAttribute(jt,l.join(","))}},Mr=function(t,n){var r=document.head||document.querySelector(J.HEAD),o=r.querySelectorAll(t+"["+jt+"]"),i=Array.prototype.slice.call(o),a=[],l=void 0;return n&&n.length&&n.forEach(function(s){var u=document.createElement(t);for(var d in s)if(s.hasOwnProperty(d))if(d===we.INNER_HTML)u.innerHTML=s.innerHTML;else if(d===we.CSS_TEXT)u.styleSheet?u.styleSheet.cssText=s.cssText:u.appendChild(document.createTextNode(s.cssText));else{var c=typeof s[d]>"u"?"":s[d];u.setAttribute(d,c)}u.setAttribute(jt,"true"),i.some(function(f,p){return l=p,u.isEqualNode(f)})?i.splice(l,1):a.push(u)}),i.forEach(function(s){return s.parentNode.removeChild(s)}),a.forEach(function(s){return r.appendChild(s)}),{oldTags:i,newTags:a}},E1=function(t){return Object.keys(t).reduce(function(n,r){var o=typeof t[r]<"u"?r+'="'+t[r]+'"':""+r;return n?n+" "+o:o},"")},a7=function(t,n,r,o){var i=E1(r),a=_1(n);return i?"<"+t+" "+jt+'="true" '+i+">"+_u(a,o)+"":"<"+t+" "+jt+'="true">'+_u(a,o)+""},l7=function(t,n,r){return n.reduce(function(o,i){var a=Object.keys(i).filter(function(u){return!(u===we.INNER_HTML||u===we.CSS_TEXT)}).reduce(function(u,d){var c=typeof i[d]>"u"?d:d+'="'+_u(i[d],r)+'"';return u?u+" "+c:c},""),l=i.innerHTML||i.cssText||"",s=WC.indexOf(t)===-1;return o+"<"+t+" "+jt+'="true" '+a+(s?"/>":">"+l+"")},"")},C1=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[vl[o]||o]=t[o],r},n)},s7=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[HC[o]||o]=t[o],r},n)},c7=function(t,n,r){var o,i=(o={key:n},o[jt]=!0,o),a=C1(r,i);return[G.createElement(J.TITLE,a,n)]},u7=function(t,n){return n.map(function(r,o){var i,a=(i={key:o},i[jt]=!0,i);return Object.keys(r).forEach(function(l){var s=vl[l]||l;if(s===we.INNER_HTML||s===we.CSS_TEXT){var u=r.innerHTML||r.cssText;a.dangerouslySetInnerHTML={__html:u}}else a[s]=r[l]}),G.createElement(t,a)})},qt=function(t,n,r){switch(t){case J.TITLE:return{toComponent:function(){return c7(t,n.title,n.titleAttributes)},toString:function(){return a7(t,n.title,n.titleAttributes,r)}};case dr.BODY:case dr.HTML:return{toComponent:function(){return C1(n)},toString:function(){return E1(n)}};default:return{toComponent:function(){return u7(t,n)},toString:function(){return l7(t,n,r)}}}},S1=function(t){var n=t.baseTag,r=t.bodyAttributes,o=t.encode,i=t.htmlAttributes,a=t.linkTags,l=t.metaTags,s=t.noscriptTags,u=t.scriptTags,d=t.styleTags,c=t.title,f=c===void 0?"":c,p=t.titleAttributes;return{base:qt(J.BASE,n,o),bodyAttributes:qt(dr.BODY,r,o),htmlAttributes:qt(dr.HTML,i,o),link:qt(J.LINK,a,o),meta:qt(J.META,l,o),noscript:qt(J.NOSCRIPT,s,o),script:qt(J.SCRIPT,u,o),style:qt(J.STYLE,d,o),title:qt(J.TITLE,{title:f,titleAttributes:p},o)}},d7=function(t){var n,r;return r=n=function(o){QC(i,o);function i(){return GC(this,i),ZC(this,o.apply(this,arguments))}return i.prototype.shouldComponentUpdate=function(l){return!MC(this.props,l)},i.prototype.mapNestedChildrenToProps=function(l,s){if(!s)return null;switch(l.type){case J.SCRIPT:case J.NOSCRIPT:return{innerHTML:s};case J.STYLE:return{cssText:s}}throw new Error("<"+l.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},i.prototype.flattenArrayTypeChildren=function(l){var s,u=l.child,d=l.arrayTypeChildren,c=l.newChildProps,f=l.nestedChildren;return it({},d,(s={},s[u.type]=[].concat(d[u.type]||[],[it({},c,this.mapNestedChildrenToProps(u,f))]),s))},i.prototype.mapObjectTypeChildren=function(l){var s,u,d=l.child,c=l.newProps,f=l.newChildProps,p=l.nestedChildren;switch(d.type){case J.TITLE:return it({},c,(s={},s[d.type]=p,s.titleAttributes=it({},f),s));case J.BODY:return it({},c,{bodyAttributes:it({},f)});case J.HTML:return it({},c,{htmlAttributes:it({},f)})}return it({},c,(u={},u[d.type]=it({},f),u))},i.prototype.mapArrayTypeChildrenToProps=function(l,s){var u=it({},s);return Object.keys(l).forEach(function(d){var c;u=it({},u,(c={},c[d]=l[d],c))}),u},i.prototype.warnOnInvalidChildren=function(l,s){return!0},i.prototype.mapChildrenToProps=function(l,s){var u=this,d={};return G.Children.forEach(l,function(c){if(!(!c||!c.props)){var f=c.props,p=f.children,x=Np(f,["children"]),y=s7(x);switch(u.warnOnInvalidChildren(c,p),c.type){case J.LINK:case J.META:case J.NOSCRIPT:case J.SCRIPT:case J.STYLE:d=u.flattenArrayTypeChildren({child:c,arrayTypeChildren:d,newChildProps:y,nestedChildren:p});break;default:s=u.mapObjectTypeChildren({child:c,newProps:s,newChildProps:y,nestedChildren:p});break}}}),s=this.mapArrayTypeChildrenToProps(d,s),s},i.prototype.render=function(){var l=this.props,s=l.children,u=Np(l,["children"]),d=it({},u);return s&&(d=this.mapChildrenToProps(s,d)),G.createElement(t,d)},YC(i,null,[{key:"canUseDOM",set:function(l){t.canUseDOM=l}}]),i}(G.Component),n.propTypes={base:xe.object,bodyAttributes:xe.object,children:xe.oneOfType([xe.arrayOf(xe.node),xe.node]),defaultTitle:xe.string,defer:xe.bool,encodeSpecialCharacters:xe.bool,htmlAttributes:xe.object,link:xe.arrayOf(xe.object),meta:xe.arrayOf(xe.object),noscript:xe.arrayOf(xe.object),onChangeClientState:xe.func,script:xe.arrayOf(xe.object),style:xe.arrayOf(xe.object),title:xe.string,titleAttributes:xe.object,titleTemplate:xe.string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var o=t.rewind();return o||(o=S1({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),o},r},f7=function(){return null},h7=NC(e7,o7,S1)(f7),Su=d7(h7);Su.renderStatic=Su.rewind;var Xs="vocs_Anchor",p7="vocs_Autolink";function m7(e){const{pathname:t}=be();return g.jsx("a",{...e,className:O(e.className,p7),href:`${t}${e.href}`})}function v7(e){const{children:t,href:n}=e,{pathname:r}=be();return t&&typeof t=="object"&&"props"in t&&t.props["data-autolink-icon"]?g.jsx(m7,{className:O(e.className,Xs),...e}):n!=null&&n.match(/^#/)?g.jsx("a",{className:O(e.className,Xs),...e,href:`${r}${n}`}):g.jsx(Zt,{className:O(e.className,Xs),...e})}var g7="vocs_Callout_danger",y7="vocs_Callout_info",x7="vocs_Callout_note",b1="vocs_Callout",w7="vocs_Callout_success",_7="vocs_Callout_tip",E7="vocs_Callout_warning";const C7=Object.freeze(Object.defineProperty({__proto__:null,danger:g7,info:y7,note:x7,root:b1,success:w7,tip:_7,warning:E7},Symbol.toStringTag,{value:"Module"}));function S7({className:e,children:t,type:n}){return g.jsx("aside",{className:O(e,b1,C7[n]),children:t})}var b7="vocs_Aside";function T7(e){const t=O(e.className,b7);return"data-callout"in e?g.jsx(S7,{className:t,type:e["data-callout"],children:e.children}):g.jsx("aside",{...e,className:t})}var P7="vocs_Blockquote";function $7(e){return g.jsx("blockquote",{...e,className:O(e.className,P7)})}var R7="vocs_Code";function k7(e){const t=N7(e.children);return g.jsx("code",{...e,className:O(e.className,R7),children:t})}function N7(e){return Array.isArray(e)?e.map((t,n)=>{var r,o,i;return t.props&&"data-line"in t.props&&typeof t.props.children=="string"&&t.props.children.trim()===""&&((i=(o=(r=e[n+1])==null?void 0:r.props)==null?void 0:o.className)!=null&&i.includes("twoslash-tag-line"))?null:t}).filter(Boolean):e}var A7="vocs_Details";function O7(e){return g.jsx("details",{...e,className:O(e.className,A7)})}var L7="vocs_Authors_authors",I7="vocs_Authors_link",D7="vocs_Authors",Lp="vocs_Authors_separator";function T1(e){const{frontmatter:t}=bo(),{authors:n=t==null?void 0:t.authors,date:r=t==null?void 0:t.date}=e,o=h.useMemo(()=>{if(n)return Array.isArray(n)?n:n.split(",").map(a=>a.trim())},[n]),i=h.useMemo(()=>r?new Date(r).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):null,[r]);return g.jsxs("div",{className:D7,children:[i,o&&i?" by ":"By ",g.jsx("span",{className:L7,children:o==null?void 0:o.map((a,l)=>{const{text:s,url:u}=M7(a);return g.jsxs(h.Fragment,{children:[u?g.jsx("a",{className:I7,href:u,target:"_blank",rel:"noopener noreferrer",children:s}):s,lg.jsxs(h.Fragment,{children:[g.jsx("div",{className:z7,children:g.jsxs(Un,{to:e.path,children:[g.jsx("h2",{className:U7,children:e.title}),g.jsx(T1,{authors:e.authors,date:e.date}),g.jsxs("p",{className:j7,children:[e.description," ",g.jsx("span",{className:V7,children:"[→]"})]})]})}),tg.jsxs(h.Fragment,{children:[g.jsx("div",{className:J7,children:t.name}),t.items.map((r,o)=>{var i;return g.jsx("div",{className:Z7,style:xr({[K7]:r.length.toString(),[G7]:`${((i=t.height)==null?void 0:i.toString())??"40"}px`}),children:r.map((a,l)=>g.jsx(Zt,{className:O(W7,a?X7:void 0),hideExternalIcon:!0,href:a==null?void 0:a.link,variant:"styleless",children:g.jsx("img",{className:Y7,src:a==null?void 0:a.image,alt:a==null?void 0:a.name})},l))},o)})]},n))})}var eS="vocs_AutolinkIcon";function tS(e){return g.jsx("div",{...e,className:O(e.className,eS)})}const Js="rovingFocusGroup.onEntryFocus",nS={bubbles:!1,cancelable:!0},Xd="RovingFocusGroup",[bu,P1,rS]=jl(Xd),[oS,$1]=gn(Xd,[rS]),[iS,aS]=oS(Xd),lS=h.forwardRef((e,t)=>h.createElement(bu.Provider,{scope:e.__scopeRovingFocusGroup},h.createElement(bu.Slot,{scope:e.__scopeRovingFocusGroup},h.createElement(sS,H({},e,{ref:t}))))),sS=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:s,onEntryFocus:u,...d}=e,c=h.useRef(null),f=Me(t,c),p=Ml(i),[x=null,y]=Jn({prop:a,defaultProp:l,onChange:s}),[_,m]=h.useState(!1),v=et(u),w=P1(n),E=h.useRef(!1),[S,C]=h.useState(0);return h.useEffect(()=>{const b=c.current;if(b)return b.addEventListener(Js,v),()=>b.removeEventListener(Js,v)},[v]),h.createElement(iS,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:x,onItemFocus:h.useCallback(b=>y(b),[y]),onItemShiftTab:h.useCallback(()=>m(!0),[]),onFocusableItemAdd:h.useCallback(()=>C(b=>b+1),[]),onFocusableItemRemove:h.useCallback(()=>C(b=>b-1),[])},h.createElement(ue.div,H({tabIndex:_||S===0?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...e.style},onMouseDown:le(e.onMouseDown,()=>{E.current=!0}),onFocus:le(e.onFocus,b=>{const T=!E.current;if(b.target===b.currentTarget&&T&&!_){const $=new CustomEvent(Js,nS);if(b.currentTarget.dispatchEvent($),!$.defaultPrevented){const A=w().filter(Z=>Z.focusable),D=A.find(Z=>Z.active),M=A.find(Z=>Z.id===x),V=[D,M,...A].filter(Boolean).map(Z=>Z.ref.current);R1(V)}}E.current=!1}),onBlur:le(e.onBlur,()=>m(!1))})))}),cS="RovingFocusGroupItem",uS=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,l=Xt(),s=i||l,u=aS(cS,n),d=u.currentTabStopId===s,c=P1(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=u;return h.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),h.createElement(bu.ItemSlot,{scope:n,id:s,focusable:r,active:o},h.createElement(ue.span,H({tabIndex:d?0:-1,"data-orientation":u.orientation},a,{ref:t,onMouseDown:le(e.onMouseDown,x=>{r?u.onItemFocus(s):x.preventDefault()}),onFocus:le(e.onFocus,()=>u.onItemFocus(s)),onKeyDown:le(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=hS(x,u.orientation,u.dir);if(y!==void 0){x.preventDefault();let m=c().filter(v=>v.focusable).map(v=>v.ref.current);if(y==="last")m.reverse();else if(y==="prev"||y==="next"){y==="prev"&&m.reverse();const v=m.indexOf(x.currentTarget);m=u.loop?pS(m,v+1):m.slice(v+1)}setTimeout(()=>R1(m))}})})))}),dS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function fS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function hS(e,t,n){const r=fS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return dS[r]}function R1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function pS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const mS=lS,vS=uS,k1="Tabs",[gS,iT]=gn(k1,[$1]),N1=$1(),[yS,Jd]=gS(k1),xS=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:l,activationMode:s="automatic",...u}=e,d=Ml(l),[c,f]=Jn({prop:r,onChange:o,defaultProp:i});return h.createElement(yS,{scope:n,baseId:Xt(),value:c,onValueChange:f,orientation:a,dir:d,activationMode:s},h.createElement(ue.div,H({dir:d,"data-orientation":a},u,{ref:t})))}),wS="TabsList",_S=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Jd(wS,n),a=N1(n);return h.createElement(mS,H({asChild:!0},a,{orientation:i.orientation,dir:i.dir,loop:r}),h.createElement(ue.div,H({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),ES="TabsTrigger",CS=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=Jd(ES,n),l=N1(n),s=A1(a.baseId,r),u=O1(a.baseId,r),d=r===a.value;return h.createElement(vS,H({asChild:!0},l,{focusable:!o,active:d}),h.createElement(ue.button,H({type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:s},i,{ref:t,onMouseDown:le(e.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?a.onValueChange(r):c.preventDefault()}),onKeyDown:le(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&a.onValueChange(r)}),onFocus:le(e.onFocus,()=>{const c=a.activationMode!=="manual";!d&&!o&&c&&a.onValueChange(r)})})))}),SS="TabsContent",bS=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,l=Jd(SS,n),s=A1(l.baseId,r),u=O1(l.baseId,r),d=r===l.value,c=h.useRef(d);return h.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),h.createElement(yn,{present:o||d},({present:f})=>h.createElement(ue.div,H({"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":s,hidden:!f,id:u,tabIndex:0},a,{ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0}}),f&&i))});function A1(e,t){return`${e}-trigger-${t}`}function O1(e,t){return`${e}-content-${t}`}const TS=xS,PS=_S,$S=CS,RS=bS;var kS="vocs_Tabs_content",NS="vocs_Tabs_list",AS="vocs_Tabs",OS="vocs_Tabs_trigger";function LS(e){return g.jsx(TS,{...e,className:O(e.className,AS)})}function IS(e){return g.jsx(PS,{...e,className:O(e.className,NS)})}function DS(e){return g.jsx($S,{...e,className:O(e.className,OS)})}function MS(e){return g.jsx(RS,{...e,className:O(e.className,kS)})}var jS="vocs_CodeGroup";function FS({children:e}){const t=e.map(n=>{const r=n.props["data-title"]?n:n.props.children,{props:o}=r,i=o["data-title"],a=o.children;return{title:i,content:a}});return g.jsxs(LS,{className:jS,defaultValue:t[0].title,children:[g.jsx(IS,{"aria-label":"Code group",children:t.map(({title:n},r)=>g.jsx(DS,{value:n||r.toString(),children:n},n||r.toString()))}),t.map(({title:n,content:r},o)=>{const i=r.props&&"data-rehype-pretty-code-figure"in r.props;return g.jsx(MS,{"data-pretty-code":i,value:n||o.toString(),children:r},n||o.toString())})]})}var zS="vocs_Div",VS="vocs_Step_content",BS="vocs_Step",L1="vocs_Step_title",US="vocs_H2";function I1(e){return g.jsx(Co,{...e,className:O(e.className,US),level:2})}var HS="vocs_H3";function D1(e){return g.jsx(Co,{...e,className:O(e.className,HS),level:3})}var WS="vocs_H4";function M1(e){return g.jsx(Co,{...e,className:O(e.className,WS),level:4})}var KS="vocs_H5";function j1(e){return g.jsx(Co,{...e,className:O(e.className,KS),level:5})}var GS="vocs_H6";function F1(e){return g.jsx(Co,{...e,className:O(e.className,GS),level:6})}function YS({children:e,className:t,title:n,titleLevel:r=2}){const o=(()=>{if(r===2)return I1;if(r===3)return D1;if(r===4)return M1;if(r===5)return j1;if(r===6)return F1;throw new Error("Invalid.")})();return g.jsxs("div",{className:O(t,BS),children:[typeof n=="string"?g.jsx(o,{className:L1,children:n}):n,g.jsx("div",{className:VS,children:e})]})}var QS="vocs_Steps";function ZS({children:e,className:t}){return g.jsx("div",{className:O(t,QS),children:e})}function XS({children:e}){return Array.isArray(e)?g.jsx(ZS,{children:e.map(({props:t},n)=>{const[r,...o]=Array.isArray(t.children)?t.children:[t.children];return g.jsx(YS,{title:h.cloneElement(r,{className:L1}),children:o},n)})}):null}var JS="vocs_Subtitle";function qS({children:e}){return g.jsx("div",{className:JS,role:"doc-subtitle",children:e})}function eb(e){const{layout:t}=br(),n=O(e.className,zS);return e.className==="code-group"?g.jsx(FS,{...e,className:n}):"data-authors"in e?g.jsx(T1,{}):"data-blog-posts"in e?g.jsx(H7,{}):"data-sponsors"in e?g.jsx(q7,{}):"data-autolink-icon"in e&&t==="docs"?g.jsx(tS,{...e,className:n}):"data-vocs-steps"in e?g.jsx(XS,{...e,className:n}):e.role==="doc-subtitle"?g.jsx(qS,{...e}):g.jsx("div",{...e,className:n})}function tb(){return g.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 94 99",fill:"none",children:[g.jsx("title",{children:"File"}),g.jsx("rect",{width:"77px",height:"89px",x:"8px",y:"3px",stroke:"currentColor",strokeWidth:"6px",rx:"7px"}),g.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"6px",d:"M25 22h43M25 35h43M25 48h22"})]})}function nb(){return g.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 79 95",fill:"none",children:[g.jsx("title",{children:"Terminal"}),g.jsx("path",{fill:"currentColor",d:"M38.281 34.033c0-1.074-.39-2.05-1.22-2.88L6.885 1.171C6.152.39 5.175 0 4.053 0 1.758 0 0 1.709 0 4.004c0 1.074.488 2.1 1.172 2.88l27.295 27.15L1.172 61.181C.488 61.962 0 62.939 0 64.062c0 2.295 1.758 4.004 4.053 4.004 1.123 0 2.1-.39 2.832-1.172l30.176-29.98c.83-.83 1.22-1.807 1.22-2.88Z"}),g.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"8px",d:"M36 75h55"})]})}var rb="vocs_CodeTitle";function ob({children:e,className:t,...n}){const r="data-language"in n?n["data-language"]:void 0;return g.jsxs("div",{...n,className:O(t,rb),children:[r==="bash"?g.jsx(nt,{label:"Terminal",size:"14px",icon:nb,style:{marginTop:3}}):e.match(/\.(.*)$/)?g.jsx(nt,{label:"File",size:"14px",icon:tb,style:{marginTop:1}}):null,e]})}var ib="vocs_Figcaption";function ab(e){const t=O(e.className,ib);return"data-rehype-pretty-code-title"in e?g.jsx(ob,{...e,className:t}):g.jsx("figcaption",{...e,className:t})}var lb="vocs_CodeBlock";function sb(e){return g.jsx("div",{...e,className:O(e.className,lb)})}var cb="vocs_Figure";function ub(e){const t=O(e.className,cb);return"data-rehype-pretty-code-figure"in e?g.jsx(sb,{...e,className:t}):g.jsx("figure",{...e,className:t})}var db="vocs_Header";function fb(e){return g.jsx("header",{...e,className:O(e.className,db)})}var hb="vocs_HorizontalRule";function pb(e){return g.jsx("hr",{...e,className:O(e.className,hb)})}var mb="vocs_List_ordered",vb="vocs_List",gb="vocs_List_unordered";function Dp({ordered:e,...t}){const n=e?"ol":"ul";return g.jsx(n,{...t,className:O(t.className,vb,e?mb:gb)})}var yb="vocs_ListItem";function xb(e){return g.jsx("li",{...e,className:O(e.className,yb)})}function wb(){const e=h.useRef(null),[t,n]=h.useState(!1);h.useEffect(()=>{if(!t)return;const o=setTimeout(()=>n(!1),1e3);return()=>clearTimeout(o)},[t]);function r(){var a;n(!0);const o=(a=e.current)==null?void 0:a.cloneNode(!0),i=o==null?void 0:o.querySelectorAll("button,[data-line].diff.remove,.twoslash-popup-info-hover,.twoslash-popup-info,.twoslash-meta-line,.twoslash-tag-line");for(const l of i??[])l.remove();navigator.clipboard.writeText(o==null?void 0:o.textContent)}return{copied:t,copy:r,ref:e}}var _b="vocs_CopyButton";function Eb(){return g.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 68 67",children:[g.jsx("title",{children:"Checkmark"}),g.jsx("path",{fill:"currentColor",d:"M26.175 66.121c1.904 0 3.418-.83 4.492-2.49L66.263 7.332c.83-1.27 1.123-2.295 1.123-3.32 0-2.393-1.563-4.004-4.004-4.004-1.758 0-2.734.586-3.809 2.295L25.98 56.209 8.304 32.381c-1.123-1.514-2.198-2.149-3.809-2.149-2.441 0-4.2 1.71-4.2 4.15 0 1.026.44 2.15 1.27 3.224l19.971 25.927c1.367 1.758 2.734 2.588 4.639 2.588Z"})]})}function Cb(){return g.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 82 82",children:[g.jsx("title",{children:"Copy"}),g.jsx("path",{fill:"currentColor",d:"M12.451 63.281h38.38c8.3 0 12.45-4.053 12.45-12.256v-38.77C63.281 4.054 59.131 0 50.831 0H12.45C4.101 0 0 4.053 0 12.256v38.77C0 59.227 4.102 63.28 12.451 63.28Zm.098-7.031c-3.516 0-5.518-1.904-5.518-5.615V12.647c0-3.711 2.002-5.616 5.518-5.616h38.183c3.516 0 5.518 1.905 5.518 5.615v37.989c0 3.71-2.002 5.615-5.518 5.615H12.55Z"}),g.jsx("path",{stroke:"currentColor",strokeWidth:"6.75px",d:"M69.385 78.266h-38.38c-3.679 0-5.782-.894-6.987-2.081-1.196-1.178-2.088-3.219-2.088-6.8v-38.77c0-3.581.892-5.622 2.088-6.8 1.205-1.187 3.308-2.08 6.988-2.08h38.379c3.65 0 5.758.89 6.973 2.084 1.203 1.182 2.103 3.225 2.103 6.796v38.77c0 3.57-.9 5.614-2.103 6.796-1.215 1.193-3.323 2.085-6.973 2.085Z"})]})}function Sb({copy:e,copied:t}){return g.jsx("button",{className:_b,onClick:e,type:"button",children:t?g.jsx(nt,{label:"Copied",size:"14px",icon:Eb}):g.jsx(nt,{label:"Copy",size:"18px",icon:Cb})})}var bb="vocs_Pre",Tb="vocs_Pre_wrapper";function Pb({children:e,...t}){const{copied:n,copy:r,ref:o}=wb();function i(l){return!l||typeof l!="object"?l:"props"in l?{...l,props:{...l.props,children:Array.isArray(l.props.children)?l.props.children.map(i):i(l.props.children)}}:l}const a=h.useMemo(()=>i(e),[e]);return g.jsx("div",{className:O(Tb),children:g.jsxs("pre",{ref:o,...t,className:O(t.className,bb),children:["data-language"in t&&g.jsx(Sb,{copied:n,copy:r}),a]})})}var $b="vocs_Footnotes";function Rb(e){return g.jsx("section",{...e,className:O(e.className,$b)})}var Mp="vocs_Section";function kb(e){return"data-footnotes"in e?g.jsx(Rb,{...e,className:O(e.className,Mp)}):g.jsx("section",{...e,className:O(e.className,Mp)})}var jp="vocs_Span";function Nb({children:e,...t}){const n=h.useRef(null);return h.useEffect(()=>{(async()=>{const{createPopper:r}=await R(()=>import("./index-vhRs_HGv.js"),__vite__mapDeps([]));if(!n.current)return;const o=n.current.querySelector(".twoslash-target"),i=n.current.querySelector(".twoslash-popup-info-hover");if(!o||!i)return;const a=r(o,i,{modifiers:[{name:"offset",options:{offset:[-8,8]}}],placement:"bottom-start"});let l=!1;function s(){setTimeout(()=>{i==null||i.setAttribute("data-show","")},64),a.setOptions(f=>({...f,modifiers:[...f.modifiers||[],{name:"eventListeners",enabled:!0}]})),a.update()}function u(){setTimeout(()=>{l||i==null||i.removeAttribute("data-show"),l=!1},64),a.setOptions(f=>({...f,modifiers:[...f.modifiers||[],{name:"eventListeners",enabled:!1}]}))}function d(){l=!0}function c(){l=!1,i==null||i.removeAttribute("data-show")}for(const f of["mouseenter","focus"])o.addEventListener(f,s),i.addEventListener(f,d);for(const f of["mouseleave","blur"])o.addEventListener(f,u),i.addEventListener(f,c)})()},[]),g.jsx("span",{ref:n,...t,children:e})}function Ab(e){var n;const t=O(e.className,jp);return(n=e.className)!=null&&n.includes("twoslash-hover")?g.jsx(Nb,{...e,className:t}):g.jsx("span",{...e,className:O(e.className,jp)})}var Ob="vocs_CalloutTitle";function Lb({className:e,children:t}){return g.jsx("strong",{className:O(e,Ob),children:t})}var Fp="vocs_Strong";function Ib(e){return"data-callout-title"in e&&typeof e.children=="string"?g.jsx(Lb,{...e,className:O(e.className,Fp),children:e.children}):g.jsx("strong",{...e,className:O(e.className,Fp)})}var Db="vocs_Summary";function Mb(e){return g.jsx("summary",{...e,className:O(e.className,Db)})}var jb="vocs_Table";function Fb(e){return g.jsx("table",{...e,className:O(e.className,jb)})}var zb="vocs_TableCell";function Vb(e){return g.jsx("td",{...e,className:O(e.className,zb)})}var Bb="vocs_TableHeader";function Ub(e){return g.jsx("th",{...e,className:O(e.className,Bb)})}var Hb="vocs_TableRow";function Wb(e){return g.jsx("tr",{...e,className:O(e.className,Hb)})}const Kb={a:v7,aside:T7,blockquote:$7,code:k7,details:O7,div:eb,pre:Pb,header:fb,figcaption:ab,figure:ub,h1:T0,h2:I1,h3:D1,h4:M1,h5:j1,h6:F1,hr:pb,kd:dg,li:xb,ol:e=>g.jsx(Dp,{ordered:!0,...e}),p:P0,section:kb,span:Ab,strong:Ib,summary:Mb,table:Fb,td:Vb,th:Ub,tr:Wb,ul:e=>g.jsx(Dp,{ordered:!1,...e})};function Gb(){const{pathname:e}=be(),t=kt(),{ogImageUrl:n}=t;if(!n)return;if(typeof n=="string")return n;const r=h.useMemo(()=>{const o=Object.keys(n).filter(i=>e.startsWith(i));return o[o.length-1]},[n,e]);if(r)return n[r]}function Tu(e){const{children:t,filePath:n,frontmatter:r,path:o}=e,{pathname:i}=be(),a=h.useRef();return h.useEffect(()=>{a.current=i}),g.jsxs(g.Fragment,{children:[g.jsx(Yb,{frontmatter:r}),typeof window<"u"&&g.jsx(H_,{}),g.jsx(xC,{components:Kb,children:g.jsx(t4,{frontmatter:r,path:o,children:g.jsx(N0.Provider,{value:{filePath:n,frontmatter:r,previousPath:a.current},children:t})})})]})}function Yb({frontmatter:e}){const t=kt(),n=Gb(),{baseUrl:r,font:o,iconUrl:i,logoUrl:a}=t,l=(e==null?void 0:e.title)??t.title,s=(e==null?void 0:e.description)??t.description,u=t.title&&!l.includes(t.title);return g.jsxs(Su,{defaultTitle:t.title,titleTemplate:u?t.titleTemplate:void 0,children:[l&&g.jsx("title",{children:l}),r&&!0&&g.jsx("base",{href:r}),s!=="undefined"&&g.jsx("meta",{name:"description",content:s}),i&&typeof i=="string"&&g.jsx("link",{rel:"icon",href:i,type:qs(i)}),i&&typeof i!="string"&&g.jsx("link",{rel:"icon",href:i.light,type:qs(i.light)}),i&&typeof i!="string"&&g.jsx("link",{rel:"icon",href:i.dark,type:qs(i.dark),media:"(prefers-color-scheme: dark)"}),g.jsx("meta",{property:"og:type",content:"website"}),g.jsx("meta",{property:"og:title",content:l||t.title}),r&&g.jsx("meta",{property:"og:url",content:r}),s!=="undefined"&&g.jsx("meta",{property:"og:description",content:s}),n&&g.jsx("meta",{property:"og:image",content:n.replace("%logo",`${r||""}${typeof a=="string"?a:(a==null?void 0:a.dark)||""}`).replace("%title",l||"").replace("%description",(s!=="undefined"?s:"")||"")}),(o==null?void 0:o.google)&&g.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),(o==null?void 0:o.google)&&g.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:""}),(o==null?void 0:o.google)&&g.jsx("link",{href:`https://fonts.googleapis.com/css2?family=${o.google}:wght@300;400;500&display=swap`,rel:"stylesheet"}),g.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),n&&g.jsx("meta",{property:"twitter:image",content:n.replace("%logo",`${r||""}${typeof a=="string"?a:(a==null?void 0:a.dark)||""}`).replace("%title",l||"").replace("%description",(s!=="undefined"?s:"")||"")})]})}function qs(e){if(e.endsWith(".svg"))return"image/svg+xml";if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg"))return"image/jpeg";if(e.endsWith(".ico"))return"image/x-icon";if(e.endsWith(".webp"))return"image/webp"}const Qb=(()=>{const e=Rd.find(({path:t})=>t==="*");return e?{path:e.path,lazy:async()=>{const{frontmatter:t,...n}=await e.lazy();return{...n,element:g.jsx(Tu,{frontmatter:t,path:e.path,children:g.jsx(xu,{children:g.jsx(n.default,{})})})}}}:{path:"*",lazy:void 0,element:g.jsx(Tu,{frontmatter:{layout:"minimal"},path:"*",children:g.jsx(xu,{children:g.jsx(p2,{})})})}})(),zp=[...Rd.filter(({path:e})=>e!=="*").map(e=>({path:e.path,lazy:async()=>{const{frontmatter:t,...n}=await e.lazy();return{...n,element:g.jsx(Tu,{filePath:e.filePath,frontmatter:t,path:e.path,children:g.jsx(xu,{children:g.jsx(n.default,{})})})}}})),Qb];async function Zb(e){var n;const t=(n=ar(e,window.location))==null?void 0:n.filter(r=>r.route.lazy);t&&(t==null?void 0:t.length)>0&&await Promise.all(t.map(async r=>{const o=await r.route.lazy();Object.assign(r.route,{...o,lazy:void 0})}))}function Xb(){const e=document.querySelectorAll('style[data-vocs-temp-style="true"]');for(const t of e)t.remove()}Jb();async function Jb(){await Zb(zp),Xb();const e=N_(zp);n0(document.getElementById("app"),g.jsx(Z_,{children:g.jsx(z_,{router:e})}))}export{MS as C,Zt as L,LS as R,DS as T,kt as a,a5 as b,O as c,IS as d,g as j,yC as u}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} diff --git a/dojo-book/docs/dist/assets/index-vhRs_HGv.js b/dojo-book/docs/dist/assets/index-vhRs_HGv.js new file mode 100644 index 00000000..55244e34 --- /dev/null +++ b/dojo-book/docs/dist/assets/index-vhRs_HGv.js @@ -0,0 +1 @@ +var R="top",T="bottom",L="right",B="left",Pe="auto",fe=[R,T,L,B],Q="start",ie="end",mt="clippingParents",Qe="viewport",ae="popper",gt="reference",qe=fe.reduce(function(e,t){return e.concat([t+"-"+Q,t+"-"+ie])},[]),Ze=[].concat(fe,[Pe]).reduce(function(e,t){return e.concat([t,t+"-"+Q,t+"-"+ie])},[]),yt="beforeRead",bt="read",wt="afterRead",xt="beforeMain",Ot="main",At="afterMain",Et="beforeWrite",Pt="write",Dt="afterWrite",$t=[yt,bt,wt,xt,Ot,At,Et,Pt,Dt];function V(e){return e?(e.nodeName||"").toLowerCase():null}function S(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function J(e){var t=S(e).Element;return e instanceof t||e instanceof Element}function k(e){var t=S(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function De(e){if(typeof ShadowRoot>"u")return!1;var t=S(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function jt(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var a=t.styles[r]||{},n=t.attributes[r]||{},o=t.elements[r];!k(o)||!V(o)||(Object.assign(o.style,a),Object.keys(n).forEach(function(p){var s=n[p];s===!1?o.removeAttribute(p):o.setAttribute(p,s===!0?"":s)}))})}function Rt(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(a){var n=t.elements[a],o=t.attributes[a]||{},p=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:r[a]),s=p.reduce(function(i,c){return i[c]="",i},{});!k(n)||!V(n)||(Object.assign(n.style,s),Object.keys(o).forEach(function(i){n.removeAttribute(i)}))})}}const _e={name:"applyStyles",enabled:!0,phase:"write",fn:jt,effect:Rt,requires:["computeStyles"]};function H(e){return e.split("-")[0]}var G=Math.max,ge=Math.min,Z=Math.round;function Ae(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function et(){return!/^((?!chrome|android).)*safari/i.test(Ae())}function _(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var a=e.getBoundingClientRect(),n=1,o=1;t&&k(e)&&(n=e.offsetWidth>0&&Z(a.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Z(a.height)/e.offsetHeight||1);var p=J(e)?S(e):window,s=p.visualViewport,i=!et()&&r,c=(a.left+(i&&s?s.offsetLeft:0))/n,f=(a.top+(i&&s?s.offsetTop:0))/o,h=a.width/n,y=a.height/o;return{width:h,height:y,top:f,right:c+h,bottom:f+y,left:c,x:c,y:f}}function $e(e){var t=_(e),r=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:a}}function tt(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&De(r)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function N(e){return S(e).getComputedStyle(e)}function Bt(e){return["table","td","th"].indexOf(V(e))>=0}function q(e){return((J(e)?e.ownerDocument:e.document)||window.document).documentElement}function ye(e){return V(e)==="html"?e:e.assignedSlot||e.parentNode||(De(e)?e.host:null)||q(e)}function Xe(e){return!k(e)||N(e).position==="fixed"?null:e.offsetParent}function Ct(e){var t=/firefox/i.test(Ae()),r=/Trident/i.test(Ae());if(r&&k(e)){var a=N(e);if(a.position==="fixed")return null}var n=ye(e);for(De(n)&&(n=n.host);k(n)&&["html","body"].indexOf(V(n))<0;){var o=N(n);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return n;n=n.parentNode}return null}function pe(e){for(var t=S(e),r=Xe(e);r&&Bt(r)&&N(r).position==="static";)r=Xe(r);return r&&(V(r)==="html"||V(r)==="body"&&N(r).position==="static")?t:r||Ct(e)||t}function je(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ne(e,t,r){return G(e,ge(t,r))}function St(e,t,r){var a=ne(e,t,r);return a>r?r:a}function rt(){return{top:0,right:0,bottom:0,left:0}}function at(e){return Object.assign({},rt(),e)}function nt(e,t){return t.reduce(function(r,a){return r[a]=e,r},{})}var kt=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,at(typeof t!="number"?t:nt(t,fe))};function Tt(e){var t,r=e.state,a=e.name,n=e.options,o=r.elements.arrow,p=r.modifiersData.popperOffsets,s=H(r.placement),i=je(s),c=[B,L].indexOf(s)>=0,f=c?"height":"width";if(!(!o||!p)){var h=kt(n.padding,r),y=$e(o),u=i==="y"?R:B,w=i==="y"?T:L,d=r.rects.reference[f]+r.rects.reference[i]-p[i]-r.rects.popper[f],v=p[i]-r.rects.reference[i],b=pe(o),O=b?i==="y"?b.clientHeight||0:b.clientWidth||0:0,A=d/2-v/2,l=h[u],m=O-y[f]-h[w],g=O/2-y[f]/2+A,x=ne(l,g,m),D=i;r.modifiersData[a]=(t={},t[D]=x,t.centerOffset=x-g,t)}}function Lt(e){var t=e.state,r=e.options,a=r.element,n=a===void 0?"[data-popper-arrow]":a;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||tt(t.elements.popper,n)&&(t.elements.arrow=n))}const Mt={name:"arrow",enabled:!0,phase:"main",fn:Tt,effect:Lt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ee(e){return e.split("-")[1]}var Wt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ht(e,t){var r=e.x,a=e.y,n=t.devicePixelRatio||1;return{x:Z(r*n)/n||0,y:Z(a*n)/n||0}}function Ie(e){var t,r=e.popper,a=e.popperRect,n=e.placement,o=e.variation,p=e.offsets,s=e.position,i=e.gpuAcceleration,c=e.adaptive,f=e.roundOffsets,h=e.isFixed,y=p.x,u=y===void 0?0:y,w=p.y,d=w===void 0?0:w,v=typeof f=="function"?f({x:u,y:d}):{x:u,y:d};u=v.x,d=v.y;var b=p.hasOwnProperty("x"),O=p.hasOwnProperty("y"),A=B,l=R,m=window;if(c){var g=pe(r),x="clientHeight",D="clientWidth";if(g===S(r)&&(g=q(r),N(g).position!=="static"&&s==="absolute"&&(x="scrollHeight",D="scrollWidth")),g=g,n===R||(n===B||n===L)&&o===ie){l=T;var P=h&&g===m&&m.visualViewport?m.visualViewport.height:g[x];d-=P-a.height,d*=i?1:-1}if(n===B||(n===R||n===T)&&o===ie){A=L;var E=h&&g===m&&m.visualViewport?m.visualViewport.width:g[D];u-=E-a.width,u*=i?1:-1}}var $=Object.assign({position:s},c&&Wt),M=f===!0?Ht({x:u,y:d},S(r)):{x:u,y:d};if(u=M.x,d=M.y,i){var j;return Object.assign({},$,(j={},j[l]=O?"0":"",j[A]=b?"0":"",j.transform=(m.devicePixelRatio||1)<=1?"translate("+u+"px, "+d+"px)":"translate3d("+u+"px, "+d+"px, 0)",j))}return Object.assign({},$,(t={},t[l]=O?d+"px":"",t[A]=b?u+"px":"",t.transform="",t))}function Vt(e){var t=e.state,r=e.options,a=r.gpuAcceleration,n=a===void 0?!0:a,o=r.adaptive,p=o===void 0?!0:o,s=r.roundOffsets,i=s===void 0?!0:s,c={placement:H(t.placement),variation:ee(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ie(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:p,roundOffsets:i})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ie(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ot={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Vt,data:{}};var he={passive:!0};function Nt(e){var t=e.state,r=e.instance,a=e.options,n=a.scroll,o=n===void 0?!0:n,p=a.resize,s=p===void 0?!0:p,i=S(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(f){f.addEventListener("scroll",r.update,he)}),s&&i.addEventListener("resize",r.update,he),function(){o&&c.forEach(function(f){f.removeEventListener("scroll",r.update,he)}),s&&i.removeEventListener("resize",r.update,he)}}const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Nt,data:{}};var Ft={left:"right",right:"left",bottom:"top",top:"bottom"};function me(e){return e.replace(/left|right|bottom|top/g,function(t){return Ft[t]})}var qt={start:"end",end:"start"};function Ye(e){return e.replace(/start|end/g,function(t){return qt[t]})}function Re(e){var t=S(e),r=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:r,scrollTop:a}}function Be(e){return _(q(e)).left+Re(e).scrollLeft}function Xt(e,t){var r=S(e),a=q(e),n=r.visualViewport,o=a.clientWidth,p=a.clientHeight,s=0,i=0;if(n){o=n.width,p=n.height;var c=et();(c||!c&&t==="fixed")&&(s=n.offsetLeft,i=n.offsetTop)}return{width:o,height:p,x:s+Be(e),y:i}}function It(e){var t,r=q(e),a=Re(e),n=(t=e.ownerDocument)==null?void 0:t.body,o=G(r.scrollWidth,r.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),p=G(r.scrollHeight,r.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-a.scrollLeft+Be(e),i=-a.scrollTop;return N(n||r).direction==="rtl"&&(s+=G(r.clientWidth,n?n.clientWidth:0)-o),{width:o,height:p,x:s,y:i}}function Ce(e){var t=N(e),r=t.overflow,a=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+n+a)}function st(e){return["html","body","#document"].indexOf(V(e))>=0?e.ownerDocument.body:k(e)&&Ce(e)?e:st(ye(e))}function oe(e,t){var r;t===void 0&&(t=[]);var a=st(e),n=a===((r=e.ownerDocument)==null?void 0:r.body),o=S(a),p=n?[o].concat(o.visualViewport||[],Ce(a)?a:[]):a,s=t.concat(p);return n?s:s.concat(oe(ye(p)))}function Ee(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Yt(e,t){var r=_(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function ze(e,t,r){return t===Qe?Ee(Xt(e,r)):J(t)?Yt(t,r):Ee(It(q(e)))}function zt(e){var t=oe(ye(e)),r=["absolute","fixed"].indexOf(N(e).position)>=0,a=r&&k(e)?pe(e):e;return J(a)?t.filter(function(n){return J(n)&&tt(n,a)&&V(n)!=="body"}):[]}function Ut(e,t,r,a){var n=t==="clippingParents"?zt(e):[].concat(t),o=[].concat(n,[r]),p=o[0],s=o.reduce(function(i,c){var f=ze(e,c,a);return i.top=G(f.top,i.top),i.right=ge(f.right,i.right),i.bottom=ge(f.bottom,i.bottom),i.left=G(f.left,i.left),i},ze(e,p,a));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ft(e){var t=e.reference,r=e.element,a=e.placement,n=a?H(a):null,o=a?ee(a):null,p=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,i;switch(n){case R:i={x:p,y:t.y-r.height};break;case T:i={x:p,y:t.y+t.height};break;case L:i={x:t.x+t.width,y:s};break;case B:i={x:t.x-r.width,y:s};break;default:i={x:t.x,y:t.y}}var c=n?je(n):null;if(c!=null){var f=c==="y"?"height":"width";switch(o){case Q:i[c]=i[c]-(t[f]/2-r[f]/2);break;case ie:i[c]=i[c]+(t[f]/2-r[f]/2);break}}return i}function se(e,t){t===void 0&&(t={});var r=t,a=r.placement,n=a===void 0?e.placement:a,o=r.strategy,p=o===void 0?e.strategy:o,s=r.boundary,i=s===void 0?mt:s,c=r.rootBoundary,f=c===void 0?Qe:c,h=r.elementContext,y=h===void 0?ae:h,u=r.altBoundary,w=u===void 0?!1:u,d=r.padding,v=d===void 0?0:d,b=at(typeof v!="number"?v:nt(v,fe)),O=y===ae?gt:ae,A=e.rects.popper,l=e.elements[w?O:y],m=Ut(J(l)?l:l.contextElement||q(e.elements.popper),i,f,p),g=_(e.elements.reference),x=ft({reference:g,element:A,strategy:"absolute",placement:n}),D=Ee(Object.assign({},A,x)),P=y===ae?D:g,E={top:m.top-P.top+b.top,bottom:P.bottom-m.bottom+b.bottom,left:m.left-P.left+b.left,right:P.right-m.right+b.right},$=e.modifiersData.offset;if(y===ae&&$){var M=$[n];Object.keys(E).forEach(function(j){var X=[L,T].indexOf(j)>=0?1:-1,I=[R,T].indexOf(j)>=0?"y":"x";E[j]+=M[I]*X})}return E}function Gt(e,t){t===void 0&&(t={});var r=t,a=r.placement,n=r.boundary,o=r.rootBoundary,p=r.padding,s=r.flipVariations,i=r.allowedAutoPlacements,c=i===void 0?Ze:i,f=ee(a),h=f?s?qe:qe.filter(function(w){return ee(w)===f}):fe,y=h.filter(function(w){return c.indexOf(w)>=0});y.length===0&&(y=h);var u=y.reduce(function(w,d){return w[d]=se(e,{placement:d,boundary:n,rootBoundary:o,padding:p})[H(d)],w},{});return Object.keys(u).sort(function(w,d){return u[w]-u[d]})}function Jt(e){if(H(e)===Pe)return[];var t=me(e);return[Ye(e),t,Ye(t)]}function Kt(e){var t=e.state,r=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var n=r.mainAxis,o=n===void 0?!0:n,p=r.altAxis,s=p===void 0?!0:p,i=r.fallbackPlacements,c=r.padding,f=r.boundary,h=r.rootBoundary,y=r.altBoundary,u=r.flipVariations,w=u===void 0?!0:u,d=r.allowedAutoPlacements,v=t.options.placement,b=H(v),O=b===v,A=i||(O||!w?[me(v)]:Jt(v)),l=[v].concat(A).reduce(function(K,F){return K.concat(H(F)===Pe?Gt(t,{placement:F,boundary:f,rootBoundary:h,padding:c,flipVariations:w,allowedAutoPlacements:d}):F)},[]),m=t.rects.reference,g=t.rects.popper,x=new Map,D=!0,P=l[0],E=0;E=0,I=X?"width":"height",C=se(t,{placement:$,boundary:f,rootBoundary:h,altBoundary:y,padding:c}),W=X?j?L:B:j?T:R;m[I]>g[I]&&(W=me(W));var ce=me(W),Y=[];if(o&&Y.push(C[M]<=0),s&&Y.push(C[W]<=0,C[ce]<=0),Y.every(function(K){return K})){P=$,D=!1;break}x.set($,Y)}if(D)for(var ue=w?3:1,be=function(F){var re=l.find(function(ve){var z=x.get(ve);if(z)return z.slice(0,F).every(function(we){return we})});if(re)return P=re,"break"},te=ue;te>0;te--){var le=be(te);if(le==="break")break}t.placement!==P&&(t.modifiersData[a]._skip=!0,t.placement=P,t.reset=!0)}}const Qt={name:"flip",enabled:!0,phase:"main",fn:Kt,requiresIfExists:["offset"],data:{_skip:!1}};function Ue(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Ge(e){return[R,L,T,B].some(function(t){return e[t]>=0})}function Zt(e){var t=e.state,r=e.name,a=t.rects.reference,n=t.rects.popper,o=t.modifiersData.preventOverflow,p=se(t,{elementContext:"reference"}),s=se(t,{altBoundary:!0}),i=Ue(p,a),c=Ue(s,n,o),f=Ge(i),h=Ge(c);t.modifiersData[r]={referenceClippingOffsets:i,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}const _t={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Zt};function er(e,t,r){var a=H(e),n=[B,R].indexOf(a)>=0?-1:1,o=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,p=o[0],s=o[1];return p=p||0,s=(s||0)*n,[B,L].indexOf(a)>=0?{x:s,y:p}:{x:p,y:s}}function tr(e){var t=e.state,r=e.options,a=e.name,n=r.offset,o=n===void 0?[0,0]:n,p=Ze.reduce(function(f,h){return f[h]=er(h,t.rects,o),f},{}),s=p[t.placement],i=s.x,c=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=c),t.modifiersData[a]=p}const rr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tr};function ar(e){var t=e.state,r=e.name;t.modifiersData[r]=ft({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const pt={name:"popperOffsets",enabled:!0,phase:"read",fn:ar,data:{}};function nr(e){return e==="x"?"y":"x"}function or(e){var t=e.state,r=e.options,a=e.name,n=r.mainAxis,o=n===void 0?!0:n,p=r.altAxis,s=p===void 0?!1:p,i=r.boundary,c=r.rootBoundary,f=r.altBoundary,h=r.padding,y=r.tether,u=y===void 0?!0:y,w=r.tetherOffset,d=w===void 0?0:w,v=se(t,{boundary:i,rootBoundary:c,padding:h,altBoundary:f}),b=H(t.placement),O=ee(t.placement),A=!O,l=je(b),m=nr(l),g=t.modifiersData.popperOffsets,x=t.rects.reference,D=t.rects.popper,P=typeof d=="function"?d(Object.assign({},t.rects,{placement:t.placement})):d,E=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(g){if(o){var j,X=l==="y"?R:B,I=l==="y"?T:L,C=l==="y"?"height":"width",W=g[l],ce=W+v[X],Y=W-v[I],ue=u?-D[C]/2:0,be=O===Q?x[C]:D[C],te=O===Q?-D[C]:-x[C],le=t.elements.arrow,K=u&&le?$e(le):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:rt(),re=F[X],ve=F[I],z=ne(0,x[C],K[C]),we=A?x[C]/2-ue-z-re-E.mainAxis:be-z-re-E.mainAxis,ct=A?-x[C]/2+ue+z+ve+E.mainAxis:te+z+ve+E.mainAxis,xe=t.elements.arrow&&pe(t.elements.arrow),ut=xe?l==="y"?xe.clientTop||0:xe.clientLeft||0:0,ke=(j=$==null?void 0:$[l])!=null?j:0,lt=W+we-ke-ut,vt=W+ct-ke,Te=ne(u?ge(ce,lt):ce,W,u?G(Y,vt):Y);g[l]=Te,M[l]=Te-W}if(s){var Le,dt=l==="x"?R:B,ht=l==="x"?T:L,U=g[m],de=m==="y"?"height":"width",Me=U+v[dt],We=U-v[ht],Oe=[R,B].indexOf(b)!==-1,He=(Le=$==null?void 0:$[m])!=null?Le:0,Ve=Oe?Me:U-x[de]-D[de]-He+E.altAxis,Ne=Oe?U+x[de]+D[de]-He-E.altAxis:We,Fe=u&&Oe?St(Ve,U,Ne):ne(u?Ve:Me,U,u?Ne:We);g[m]=Fe,M[m]=Fe-U}t.modifiersData[a]=M}}const ir={name:"preventOverflow",enabled:!0,phase:"main",fn:or,requiresIfExists:["offset"]};function sr(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function fr(e){return e===S(e)||!k(e)?Re(e):sr(e)}function pr(e){var t=e.getBoundingClientRect(),r=Z(t.width)/e.offsetWidth||1,a=Z(t.height)/e.offsetHeight||1;return r!==1||a!==1}function cr(e,t,r){r===void 0&&(r=!1);var a=k(t),n=k(t)&&pr(t),o=q(t),p=_(e,n,r),s={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(a||!a&&!r)&&((V(t)!=="body"||Ce(o))&&(s=fr(t)),k(t)?(i=_(t,!0),i.x+=t.clientLeft,i.y+=t.clientTop):o&&(i.x=Be(o))),{x:p.left+s.scrollLeft-i.x,y:p.top+s.scrollTop-i.y,width:p.width,height:p.height}}function ur(e){var t=new Map,r=new Set,a=[];e.forEach(function(o){t.set(o.name,o)});function n(o){r.add(o.name);var p=[].concat(o.requires||[],o.requiresIfExists||[]);p.forEach(function(s){if(!r.has(s)){var i=t.get(s);i&&n(i)}}),a.push(o)}return e.forEach(function(o){r.has(o.name)||n(o)}),a}function lr(e){var t=ur(e);return $t.reduce(function(r,a){return r.concat(t.filter(function(n){return n.phase===a}))},[])}function vr(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function dr(e){var t=e.reduce(function(r,a){var n=r[a.name];return r[a.name]=n?Object.assign({},n,a,{options:Object.assign({},n.options,a.options),data:Object.assign({},n.data,a.data)}):a,r},{});return Object.keys(t).map(function(r){return t[r]})}var Je={placement:"bottom",modifiers:[],strategy:"absolute"};function Ke(){for(var e=arguments.length,t=new Array(e),r=0;r"})," with ",e.jsx(i.code,{children:"WORLD_ADDRESS"})," being the address of the remote World. In the background, ",e.jsx(i.code,{children:"migrate"})," will compute the diffs of the local and remote World, then, start constructing a migration strategy to determine, if any, which part of the local World needs to be pushed upstream."]}),` +`,e.jsxs(i.h3,{id:"usage",children:["USAGE",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" migrate [OPTIONS]"})]})})})}),` +`,e.jsxs(i.h3,{id:"options",children:["OPTIONS",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h4,{id:"general-options",children:["General Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#general-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--name"})," ",e.jsx(i.em,{children:"NAME"}),e.jsx(i.br,{}),` +`,"    Name of the World. At the moment, the only usage for this option is to be used as a salt when deploying the World contract to avoid address conflicts. This option is ",e.jsx(i.strong,{children:"required"})," when performing the initial migration of the World."]}),` +`,e.jsxs(i.h4,{id:"world-options",children:["World Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#world-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/world-options.md}}"}),` +`,e.jsxs(i.h4,{id:"starknet-options",children:["Starknet Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starknet-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/starknet-options.md}}"}),` +`,e.jsxs(i.h4,{id:"account-options",children:["Account Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#account-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/account-options.md}}"}),` +`,e.jsxs(i.h4,{id:"signer-options---raw",children:["Signer Options - Raw",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#signer-options---raw",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/signer-options-raw.md}}"}),` +`,e.jsxs(i.h4,{id:"signer-options---keystore",children:["Signer Options - Keystore",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#signer-options---keystore",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/signer-options-keystore.md}}"}),` +`,e.jsxs(i.h3,{id:"examples",children:["EXAMPLES",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#examples",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ol,{children:[` +`,e.jsx(i.li,{children:"Deploying your World for the first time to a local Katana node"}),` +`]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" migrate --name ohayo --rpc-url http://localhost:5050"})]})})})}),` +`,e.jsxs(i.ol,{start:"2",children:[` +`,e.jsx(i.li,{children:"Updating a remote World after making some changes"}),` +`]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" migrate --world "}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x123456"})]})})})}),` +`,e.jsxs(i.ol,{start:"3",children:[` +`,e.jsxs(i.li,{children:["Deploying your World using ",e.jsx(i.a,{href:"/Users/os/Documents/code/dojo/book/dojo-book/docs/pages/toolchain/sozo/common-options/profile",children:"profile options"})]}),` +`]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --profile"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" dev migrate"})]})})})})]})}function r(n={}){const{wrapper:i}={...d(),...n.components};return i?e.jsx(i,{...n,children:e.jsx(t,{...n})}):t(n)}export{r as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/migration-VRLLzZlR.js b/dojo-book/docs/dist/assets/migration-VRLLzZlR.js new file mode 100644 index 00000000..90489e50 --- /dev/null +++ b/dojo-book/docs/dist/assets/migration-VRLLzZlR.js @@ -0,0 +1,3 @@ +import{u as r,j as n}from"./index-m6NaWekR.js";const o=void 0;function i(e){const t={a:"a",div:"div",h2:"h2",p:"p",...r(),...e.components};return n.jsxs(n.Fragment,{children:[n.jsxs(t.h2,{id:"migration",children:["Migration",n.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#migration",children:n.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(t.p,{children:n.jsx(t.a,{href:"/migration/0.3.0",children:"0.2.0 -> 0.3.0"})}),` +`,n.jsx(t.p,{children:n.jsx(t.a,{href:"/migration/0.3.0",children:"0.3.0 -> 0.4.0"})})]})}function s(e={}){const{wrapper:t}={...r(),...e.components};return t?n.jsx(t,{...e,children:n.jsx(i,{...e})}):i(e)}export{s as default,o as frontmatter}; diff --git a/dojo-book/docs/dist/assets/model-cgjH83bt.js b/dojo-book/docs/dist/assets/model-cgjH83bt.js new file mode 100644 index 00000000..b6280c9e --- /dev/null +++ b/dojo-book/docs/dist/assets/model-cgjH83bt.js @@ -0,0 +1,44 @@ +import{u as a,j as i}from"./index-m6NaWekR.js";const n={title:"models",description:"undefined"};function d(s){const e={a:"a",br:"br",code:"code",div:"div",em:"em",figure:"figure",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",header:"header",p:"p",pre:"pre",span:"span",strong:"strong",...a(),...s.components};return i.jsxs(i.Fragment,{children:[i.jsx(e.header,{children:i.jsxs(e.h1,{id:"models",children:["models",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#models",children:i.jsx(e.div,{"data-autolink-icon":!0})})]})}),` +`,i.jsxs(e.h2,{id:"sozo-model",children:["sozo model",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-model",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.p,{children:[i.jsx(e.code,{children:"model"})," is used to interact with a World's models. It is useful for querying about a model's information, or a model value of an entity."]}),` +`,i.jsxs(e.h3,{id:"usage",children:["USAGE",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsxs(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" model "}),i.jsx(e.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"COMMAN"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"D"}),i.jsx(e.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]}),` +`,i.jsx(e.span,{"data-line":"",children:" "}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"Commands:"})}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" class-hash"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Get the class hash of a model"})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" schema"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Retrieve the schema for a model"})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" get"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Get the model value for an entity"})]})]})})}),` +`,i.jsxs(e.h3,{id:"subcommands",children:["SUBCOMMANDS",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#subcommands",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.p,{children:[i.jsx(e.strong,{children:"Note"}),": Before to execute the following subcommands, ensure you have added your ",i.jsx(e.code,{children:"world address"})," to your Scarb.toml file."]}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"toml","data-theme":"github-dark-dimmed github-light",children:i.jsxs(e.code,{"data-language":"toml","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"tool"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojo"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"."}),i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"env"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"rpc_url = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"http://localhost:5050/"'})]}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Default account for katana with seed = 0"})}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"account_address = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"private_key = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x1800000000300000180000000000030000000000003006001800006600"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"world_address = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x28f5999ae62fec17c09c52a800e244961dba05251f5aaf923afabd9c9804d1a"'})]})]})})}),` +`,i.jsxs(e.h4,{id:"class-hash",children:[i.jsx(e.code,{children:"class-hash"}),i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#class-hash",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.p,{children:"Get the class hash of a model"}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" model class-hash "}),i.jsx(e.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"NAM"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"E"}),i.jsx(e.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})})})}),` +`,i.jsxs(e.h5,{id:"arguments",children:["Arguments",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#arguments",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.p,{children:[i.jsx(e.em,{children:i.jsx(e.code,{children:"NAME"})}),i.jsx(e.br,{}),` +`,"    The name of the model"]}),` +`,i.jsxs(e.h4,{id:"schema",children:[i.jsx(e.code,{children:"schema"}),i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#schema",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.p,{children:"Retrieve the schema for a model"}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" model schema "}),i.jsx(e.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"NAM"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"E"}),i.jsx(e.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})})})}),` +`,i.jsxs(e.h5,{id:"arguments-1",children:["Arguments",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#arguments-1",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.p,{children:[i.jsx(e.em,{children:i.jsx(e.code,{children:"NAME"})}),i.jsx(e.br,{}),` +`,"    The name of the model"]}),` +`,i.jsxs(e.h4,{id:"get",children:[i.jsx(e.code,{children:"get"}),i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#get",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.p,{children:"Get the model value for an entity"}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" model get "}),i.jsx(e.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"NAM"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"E"}),i.jsx(e.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" [KEYS]..."})]})})})}),` +`,i.jsxs(e.h5,{id:"arguments-2",children:["Arguments",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#arguments-2",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.p,{children:[i.jsx(e.em,{children:i.jsx(e.code,{children:"NAME"})}),i.jsx(e.br,{}),` +`,"    The name of the model"]}),` +`,i.jsxs(e.p,{children:[i.jsx(e.em,{children:i.jsx(e.code,{children:"KEYS"})}),i.jsx(e.br,{}),` +`,"    The keys of the entity that you want to query.",i.jsx(e.br,{}),` +`,"    Comma separated values e.g., 0x12345,0x69420,..."]}),` +`,i.jsxs(e.h3,{id:"options",children:["OPTIONS",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#options",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.h4,{id:"world-options",children:["World Options",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#world-options",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.p,{children:"{{#include ../common/world-options.md}}"}),` +`,i.jsxs(e.h4,{id:"starknet-options",children:["Starknet Options",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starknet-options",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.p,{children:"{{#include ../common/starknet-options.md}}"})]})}function t(s={}){const{wrapper:e}={...a(),...s.components};return e?i.jsx(e,{...s,children:i.jsx(d,{...s})}):d(s)}export{t as default,n as frontmatter}; diff --git a/dojo-book/docs/dist/assets/models-BIgvTGgw.js b/dojo-book/docs/dist/assets/models-BIgvTGgw.js new file mode 100644 index 00000000..3ad2b97b --- /dev/null +++ b/dojo-book/docs/dist/assets/models-BIgvTGgw.js @@ -0,0 +1,236 @@ +import{u as i,j as n}from"./index-m6NaWekR.js";const l=void 0;function s(a){const e={a:"a",blockquote:"blockquote",code:"code",div:"div",em:"em",figure:"figure",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...i(),...a.components};return n.jsxs(n.Fragment,{children:[n.jsxs(e.h2,{id:"models",children:["Models",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#models",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.blockquote,{children:[` +`,n.jsx(e.p,{children:"Models = Data"}),` +`]}),` +`,n.jsx(e.strong,{children:n.jsx(e.em,{children:"TL;DR"})}),` +`,n.jsxs(e.ul,{children:[` +`,n.jsx(e.li,{children:"Models store structured data in your world."}),` +`,n.jsx(e.li,{children:"Models are Cairo structs with additional features."}),` +`,n.jsx(e.li,{children:"Models can implement traits."}),` +`,n.jsxs(e.li,{children:["Use the ",n.jsx(e.code,{children:"#[derive(Model)]"})," decorator to define them."]}),` +`,n.jsx(e.li,{children:"Custom enums and types are supported."}),` +`,n.jsxs(e.li,{children:["Define the primary key using the ",n.jsx(e.code,{children:"#[key]"})," attribute."]}),` +`]}),` +`,n.jsxs(e.h3,{id:"models-are-structs",children:["Models are Structs",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#models-are-structs",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["Models are structs annotated with the ",n.jsx(e.code,{children:"#[derive(Model)]"})," attribute. Consider these models as a key-value store, where the ",n.jsx(e.code,{children:"#[key]"})," attribute is utilized to define the primary key. While models can contain any number of fields, adhering to best practices in Entity-Component-System (ECS) design involves maintaining small, isolated models."]}),` +`,n.jsx(e.p,{children:"This approach fosters modularity and composability, enabling you to reuse models across various entity types."}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Model, Copy, Drop, Serde)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Moves {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" player: ContractAddress,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" remaining: u8,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.h4,{id:"the-key-attribute",children:["The #[key] attribute",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#the-key-attribute",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["The ",n.jsx(e.code,{children:"#[key]"})," attribute indicates to Dojo that this model is indexed by the ",n.jsx(e.code,{children:"player"})," field. A field that is identified as a ",n.jsx(e.code,{children:"#[key]"})," is not stored. It is used by the dojo database system to uniquely identify the storage location that contains your model."]}),` +`,n.jsxs(e.p,{children:["You need to define at least one key for each model, as this is how you query the model. However, you can create composite keys by defining multiple fields as keys. If you define multiple keys, they must ",n.jsx(e.strong,{children:"all"})," be provided to query the model."]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Model, Copy, Drop, Serde)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Resource {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" player: ContractAddress,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" location: ContractAddress,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" balance: u8,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsx(e.p,{children:"In this case you then would set the model with both the player and location fields:"}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Resource {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" player: caller,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" location: 12,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" balance: 10"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" )"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:");"})})]})})}),` +`,n.jsxs(e.p,{children:["To retrieve a model with a composite key using the ",n.jsx(e.a,{href:"/commands",children:"get!"})," command, you must provide a value for each key as follow:"]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"let player = get_caller_address();"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"let location = 0x1234;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"let resource = get!(world, (player, location), (Resource));"})})]})})}),` +`,n.jsxs(e.h4,{id:"implementing-traits",children:["Implementing Traits",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#implementing-traits",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["Models can implement traits. This is useful for defining common functionality across models. For example, you may want to define a ",n.jsx(e.code,{children:"Position"})," model that implements a ",n.jsx(e.code,{children:"PositionTrait"})," trait. This trait could define functions such as ",n.jsx(e.code,{children:"is_zero"})," and ",n.jsx(e.code,{children:"is_equal"})," which could be used when accessing the model."]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"trait PositionTrait {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn is_zero(self: Position) -> bool;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn is_equal(self: Position, b: Position) -> bool;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"impl PositionImpl of PositionTrait {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn is_zero(self: Position) -> bool {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" if self.x - self.y == 0 {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" return true;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" false"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn is_equal(self: Position, b: Position) -> bool {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" self.x == b.x && self.y == b.y"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.h4,{id:"custom-setting-models",children:["Custom Setting models",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#custom-setting-models",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["Suppose we need a place to keep a global value with the flexibility to modify it in the future. Take, for instance, a global ",n.jsx(e.code,{children:"combat_cool_down"})," parameter that defines the duration required for an entity to be primed for another attack. To achieve this, we can craft a model dedicated to storing this value, while also allowing for its modification via a decentralized governance model."]}),` +`,n.jsx(e.p,{children:"To establish these models, you'd follow the usual creation method. However, when initializing them, employ a constant identifier, such as GAME_SETTINGS_ID."}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"const GAME_SETTINGS_ID: u32 = 9999999999999;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(model, Copy, Drop, Serde)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct GameSettings {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" game_settings_id: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" combat_cool_down: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.h4,{id:"types",children:["Types",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#types",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"Support model types:"}),` +`,n.jsxs(e.ul,{children:[` +`,n.jsx(e.li,{children:n.jsx(e.code,{children:"u8"})}),` +`,n.jsx(e.li,{children:n.jsx(e.code,{children:"u16"})}),` +`,n.jsx(e.li,{children:n.jsx(e.code,{children:"u32"})}),` +`,n.jsx(e.li,{children:n.jsx(e.code,{children:"u64"})}),` +`,n.jsx(e.li,{children:n.jsx(e.code,{children:"u128"})}),` +`,n.jsx(e.li,{children:n.jsx(e.code,{children:"u256"})}),` +`,n.jsx(e.li,{children:n.jsx(e.code,{children:"ContractAddress"})}),` +`,n.jsx(e.li,{children:"Enums"}),` +`,n.jsx(e.li,{children:"Custom Types"}),` +`]}),` +`,n.jsx(e.p,{children:"It is currently not possible to use Arrays."}),` +`,n.jsxs(e.h4,{id:"custom-types--enums",children:["Custom Types + Enums",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#custom-types--enums",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["For models containing complex types, it's crucial to implement the ",n.jsx(e.code,{children:"SchemaIntrospection"})," trait."]}),` +`,n.jsx(e.p,{children:"Consider the model below:"}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Card {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" token_id: u256,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" /// The card's designated role."})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" role: Roles,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.p,{children:["For complex types, like ",n.jsx(e.code,{children:"Roles"})," in the above example, you need to implement ",n.jsx(e.code,{children:"SchemaIntrospection"}),". Here's how:"]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"impl RolesSchemaIntrospectionImpl for SchemaIntrospection {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[inline(always)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn size() -> usize {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" 1 // Represents the byte size of the enum."})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[inline(always)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn layout(ref layout: Array) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" layout.append(8); // Specifies the layout byte size;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[inline(always)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn ty() -> Ty {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Ty::Enum("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Enum {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" name: 'Roles',"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" attrs: array![].span(),"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" children: array!["})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ('Goalkeeper', serialize_member_type(@Ty::Tuple(array![].span()))),"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ('Defender', serialize_member_type(@Ty::Tuple(array![].span()))),"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ('Midfielder', serialize_member_type(@Ty::Tuple(array![].span()))),"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ('Attacker', serialize_member_type(@Ty::Tuple(array![].span()))),"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" .span()"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" )"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.h3,{id:"in-practice-with-modularity-in-mind",children:["In practice with modularity in mind",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#in-practice-with-modularity-in-mind",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"Consider a tangible analogy: Humans and Goblins. While they possess intrinsic differences, they share common traits, such as having a position and health. However, humans possess an additional model. Furthermore, we introduce a Counter model, a distinct feature that tallies the numbers of humans and goblins."}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Model, Copy, Drop, Serde)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Potions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" entity_id: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" quantity: u8,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Model, Copy, Drop, Serde)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Health {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" entity_id: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" health: u8,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Model, Copy, Drop, Serde)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Position {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" entity_id: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" x: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" y: u32"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"// Special counter model"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Model, Copy, Drop, Serde)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Counter {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" counter: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" goblin_count: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" human_count: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.p,{children:["So the Human will have a ",n.jsx(e.code,{children:"Potions"}),", ",n.jsx(e.code,{children:"Health"})," and ",n.jsx(e.code,{children:"Position"})," model, and the Goblin will have a ",n.jsx(e.code,{children:"Health"})," and ",n.jsx(e.code,{children:"Position"})," model. By doing we save having to create Health and Position models for each entity type."]}),` +`,n.jsx(e.p,{children:"So then a contract would look like this:"}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[dojo::contract]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"mod spawnHuman {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use array::ArrayTrait;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use box::BoxTrait;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use traits::Into;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo::world::Context;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::models::Position;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::models::Health;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::models::Potions;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::models::Counter;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // we can set the counter value as a const, then query it easily! This pattern is useful for settings."})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" const COUNTER_ID: u32 = 9999999999999;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // impl: implement functions specified in trait"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[abi(embed_v0)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" impl GoblinActionsImpl of IGoblinActions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn goblin_actions(self: @ContractState, entity_id: u32) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let world = self.world_dispatcher.read();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let counter = get!(world, COUNTER_ID, (Counter));"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let human_count = counter.human_count + 1;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let goblin_count = counter.goblin_count + 1;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // spawn a human"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Health {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" entity_id: human_count, health: 100"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Position {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" entity_id: human_count, x: position.x + 10, y: position.y + 10,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Potions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" entity_id: human_count, quantity: 10"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" )"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // spawn a goblin"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Health {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" entity_id: goblin_count, health: 100"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Position {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" entity_id: goblin_count, x: position.x + 10, y: position.y + 10,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" )"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // increment the counter"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Counter {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" counter: COUNTER_ID, human_count: human_count, goblin_count: goblin_count"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" )"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.blockquote,{children:[` +`,n.jsxs(e.p,{children:["A complete example can be found in the ",n.jsx(e.a,{href:"https://github.com/dojoengine/dojo-starter",children:"Dojo Starter"})]}),` +`]})]})}function t(a={}){const{wrapper:e}={...i(),...a.components};return e?n.jsx(e,{...a,children:n.jsx(s,{...a})}):s(a)}export{t as default,l as frontmatter}; diff --git a/dojo-book/docs/dist/assets/offline-GhfX_FSu.js b/dojo-book/docs/dist/assets/offline-GhfX_FSu.js new file mode 100644 index 00000000..fd709758 --- /dev/null +++ b/dojo-book/docs/dist/assets/offline-GhfX_FSu.js @@ -0,0 +1,9 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const a={title:"offline",description:"undefined"};function d(n){const i={a:"a",br:"br",code:"code",div:"div",figure:"figure",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",span:"span",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(i.header,{children:e.jsxs(i.h1,{id:"offline",children:["offline",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#offline",children:e.jsx(i.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsxs(i.h2,{id:"use-sozo-offline",children:["use sozo offline",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#use-sozo-offline",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--offline"}),e.jsx(i.br,{}),` +`,"    Run without accessing the network.",e.jsx(i.br,{}),` +`,"    [env: SOZO_OFFLINE=]"]}),` +`,e.jsxs(i.h3,{id:"usage",children:["USAGE",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --offline"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" [COMMAND]"})]})})})}),` +`,e.jsx(i.p,{children:"For example"}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --offline"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" build"})]})})})})]})}function h(n={}){const{wrapper:i}={...s(),...n.components};return i?e.jsx(i,{...n,children:e.jsx(d,{...n})}):d(n)}export{h as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/origami-c05UNJ02.js b/dojo-book/docs/dist/assets/origami-c05UNJ02.js new file mode 100644 index 00000000..29d81c72 --- /dev/null +++ b/dojo-book/docs/dist/assets/origami-c05UNJ02.js @@ -0,0 +1,16 @@ +import{u as r,j as i}from"./index-m6NaWekR.js";const s=void 0;function t(e){const n={a:"a",blockquote:"blockquote",div:"div",h2:"h2",img:"img",li:"li",p:"p",ul:"ul",...r(),...e.components};return i.jsxs(i.Fragment,{children:[i.jsx(n.p,{children:i.jsx(n.img,{src:"/origami.png",alt:"origami"})}),` +`,i.jsxs(n.blockquote,{children:[` +`,i.jsx(n.p,{children:"The magic of origami is in seeing a single piece of cairo evolve into a masterpiece through careful folds."}),` +`]}),` +`,i.jsxs(n.h2,{id:"what-is-origami",children:["What is Origami?",i.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-is-origami",children:i.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(n.p,{children:"Origami is the native dojo collection of primitives that can be imported into your game."}),` +`,i.jsx(n.p,{children:"It contains:"}),` +`,i.jsxs(n.ul,{children:[` +`,i.jsx(n.li,{children:"algebra"}),` +`,i.jsx(n.li,{children:"defi"}),` +`,i.jsx(n.li,{children:"hex map"}),` +`,i.jsx(n.li,{children:"random"}),` +`,i.jsx(n.li,{children:"security"}),` +`,i.jsx(n.li,{children:"erc tokens"}),` +`]}),` +`,i.jsxs(n.p,{children:["Find the ",i.jsx(n.a,{href:"https://github.com/dojoengine/origami",children:"Origami repo"})]})]})}function a(e={}){const{wrapper:n}={...r(),...e.components};return n?i.jsx(n,{...e,children:i.jsx(t,{...e})}):t(e)}export{a as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/overview-0xDPAt9E.js b/dojo-book/docs/dist/assets/overview-0xDPAt9E.js new file mode 100644 index 00000000..fae4fe49 --- /dev/null +++ b/dojo-book/docs/dist/assets/overview-0xDPAt9E.js @@ -0,0 +1,18 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const r=void 0;function s(i){const n={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...t(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(n.p,{children:e.jsx(n.img,{src:"/sozo-icon-word.png",alt:"katana"})}),` +`,e.jsxs(n.h2,{id:"sozo",children:["Sozo",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"sozo"})," is a powerful all-in-one tool for managing your Dojo projects. It helps with everything from scaffolding a new project, all the way to deploying and interacting with your Dojo Worlds. It includes a migration planning tool, designed to streamline the updating and deployment of AWs. It provides a robust command-line interface (CLI) that simplifies World management tasks, enabling you to focus on the creative aspects of World-building. In the future, it may include a GUI."]}),` +`,e.jsxs(n.h2,{id:"features",children:["Features",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#features",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Binary CLI"}),": Sozo provides an intuitive binary CLI, ensuring easy management of your Worlds, whether you're updating existing ones or deploying new ones."]}),` +`]}),` +`,e.jsxs(n.h2,{id:"installation",children:["Installation",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#installation",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"sozo"})," binary can be installed via ",e.jsx(n.a,{href:"/getting-started/quick-start",children:e.jsx(n.code,{children:"dojoup"})}),", our dedicated installation package manager."]}),` +`,e.jsxs(n.h3,{id:"installing-from-source",children:["Installing from Source",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#installing-from-source",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsxs(n.span,{"data-line":"",children:[e.jsx(n.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"git"}),e.jsx(n.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" clone https://github.com/dojoengine/dojo"})]}),` +`,e.jsxs(n.span,{"data-line":"",children:[e.jsx(n.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"cd"}),e.jsx(n.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" dojo"})]}),` +`,e.jsxs(n.span,{"data-line":"",children:[e.jsx(n.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cargo"}),e.jsx(n.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" install --path ./crates/sozo --locked --force"})]})]})})}),` +`,e.jsx(n.p,{children:"This will install Sozo and the required dependencies on your local system."}),` +`,e.jsxs(n.blockquote,{children:[` +`,e.jsxs(n.p,{children:["📚 ",e.jsx(n.strong,{children:"Reference"})]}),` +`,e.jsxs(n.p,{children:["See the ",e.jsxs(n.a,{href:"/reference",children:[e.jsx(n.code,{children:"sozo"})," Reference"]})," for a complete overview of all the available subcommands."]}),` +`]})]})}function o(i={}){const{wrapper:n}={...t(),...i.components};return n?e.jsx(n,{...i,children:e.jsx(s,{...i})}):s(i)}export{o as default,r as frontmatter}; diff --git a/dojo-book/docs/dist/assets/overview-1_4YeOzi.js b/dojo-book/docs/dist/assets/overview-1_4YeOzi.js new file mode 100644 index 00000000..d6caee6c --- /dev/null +++ b/dojo-book/docs/dist/assets/overview-1_4YeOzi.js @@ -0,0 +1,73 @@ +import{u as i,j as n}from"./index-m6NaWekR.js";const t=void 0;function s(a){const e={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",span:"span",...i(),...a.components};return n.jsxs(n.Fragment,{children:[n.jsxs(e.blockquote,{children:[` +`,n.jsxs(e.p,{children:["You should have a good understanding of Cairo before proceeding. If you're unfamiliar with Cairo, we recommend you read the ",n.jsx(e.a,{href:"https://book.cairo-lang.org/title-page.html",children:"Cairo documentation"})," first."]}),` +`]}),` +`,n.jsxs(e.h2,{id:"a-new-approach-to-onchain-game-development",children:["A New Approach to Onchain Game Development",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#a-new-approach-to-onchain-game-development",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"Dojo provides an advanced abstraction layer over Cairo, mirroring React's relationship with JavaScript. Its specialized architecture simplifies game design and development."}),` +`,n.jsxs(e.p,{children:["By leveraging Dojo, developers can use succinct ",n.jsx(e.a,{href:"/commands",children:"commands"})," that transform into comprehensive queries at compile time."]}),` +`,n.jsxs(e.h4,{id:"delving-into-the-architecture",children:["Delving into the Architecture",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#delving-into-the-architecture",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"Dojo efficiently encapsulates boilerplate contracts within the compiler, letting developers concentrate on the distinct aspects of their game or app."}),` +`,n.jsx(e.p,{children:"Consider this as the most basic Dojo world setup:"}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"- src"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" - main.cairo"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" - lib.cairo"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"- Scarb.toml"})})]})})}),` +`,n.jsx(e.p,{children:"While seemingly simple, behind the scenes Dojo compiler generates foundational contracts, setting the stage for you to focus purely on data and logic."}),` +`,n.jsxs(e.p,{children:["Lets take a look at the ",n.jsx(e.code,{children:"main.cairo"}),":"]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"use starknet::ContractAddress;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"// dojo data models"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Model, Copy, Drop, Serde)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Position {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[key] // primary key"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" player: ContractAddress,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" vec: Vec2,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"// regular cairo struct"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[derive(Copy, Drop, Serde, Introspect)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"struct Vec2 {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" x: u32,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" y: u32"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"// interface"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[starknet::interface]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"trait IPlayerActions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn spawn(self: @TContractState);"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"// contract"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[dojo::contract]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"mod player_actions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use starknet::{ContractAddress, get_caller_address};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use super::{Position, Vec2};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use super::IPlayerActions;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[abi(embed_v0)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" impl PlayerActionsImpl of IPlayerActions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" //"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // This is how we interact with the world contract."})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" //"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn spawn(self: @ContractState) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // Access the world dispatcher for reading."})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let world = self.world_dispatcher.read();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // get player address"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let player = get_caller_address();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // dojo command - get player position"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let position = get!(world, player, (Position));"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // dojo command - set player position"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!(world, (Position { player, vec: Vec2 { x: 10, y: 10 } }));"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.h3,{id:"breakdown",children:["Breakdown",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#breakdown",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"Dojo contract is just a regular Cairo contract, with some dojo specifics."}),` +`,n.jsxs(e.h4,{id:"position-struct---the-dojo-model",children:[n.jsx(e.code,{children:"Position"})," struct - the dojo model",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#position-struct---the-dojo-model",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["In a Dojo world, state is defined using models. These are structs marked with the ",n.jsx(e.code,{children:"#[derive(Model)]"})," attribute, functioning similarly to a key-pair store. The primary key for a model is indicated using the ",n.jsx(e.code,{children:"#[key]"})," attribute; for instance, the ",n.jsx(e.code,{children:"player"})," field serves as the primary key in this context."]}),` +`,n.jsxs(e.p,{children:["Read more about models ",n.jsx(e.a,{href:"/models",children:"here"}),"."]}),` +`,n.jsxs(e.h4,{id:"spawn-function---a-dojo-system",children:[n.jsx(e.code,{children:"spawn"})," function - a dojo system",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#spawn-function---a-dojo-system",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["In the ",n.jsx(e.code,{children:"spawn"})," function, we just call ",n.jsx(e.code,{children:"self.world_dispatcher"}),". This provides a gateway to the world contract. This facilitates the effortless utilization of the get! and set! commands, allowing seamless interaction with the world contract."]}),` +`,n.jsxs(e.p,{children:["Commands, a significant innovation in Dojo, are further explored ",n.jsx(e.a,{href:"/commands",children:"here"}),"."]})]})}function r(a={}){const{wrapper:e}={...i(),...a.components};return e?n.jsx(e,{...a,children:n.jsx(s,{...a})}):s(a)}export{r as default,t as frontmatter}; diff --git a/dojo-book/docs/dist/assets/overview-YSYgj0Zr.js b/dojo-book/docs/dist/assets/overview-YSYgj0Zr.js new file mode 100644 index 00000000..fd5b1238 --- /dev/null +++ b/dojo-book/docs/dist/assets/overview-YSYgj0Zr.js @@ -0,0 +1,26 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const s=void 0;function r(n){const i={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...t(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(i.p,{children:e.jsx(i.img,{src:"/torii-icon-word.png",alt:"katana"})}),` +`,e.jsxs(i.h2,{id:"torii",children:["Torii",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#torii",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Torii is an automatic indexer and client for dojo worlds. Built in rust to be blazingly fast and exceptionally scalable. Torii provides a fully typed, dynamically generated GraphqQL interface and a high performance gRPC api for binding clients to the world state. There are two parts to torii, the client and the server."}),` +`,e.jsxs(i.h3,{id:"torii-server",children:["Torii Server",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#torii-server",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"The torii server comprises of the rust backend that exposes the graphql and gRPC endpoints."}),` +`,e.jsxs(i.h3,{id:"torii-client",children:["Torii Client",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#torii-client",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Torii client interfaces with the server to provide an easy to use api for your clients:"}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"/client/dojojs",children:"wasm"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"/client/sdk/unity",children:"unity"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"/client/sdk/unity",children:"c"})}),` +`]}),` +`,e.jsxs(i.h3,{id:"usage",children:["Usage",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Torii leverages world introspection to bootstrap directly from an onchain deployment. Simply run:"}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"torii"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --world"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" <"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"World Addres"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"s"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})})})}),` +`,e.jsxs(i.p,{children:["You'll have a GraphQL API running at ",e.jsx(i.code,{children:"http://localhost:8080/graphql"})," and a gRPC api at ",e.jsx(i.code,{children:"http://localhost:8080"})]}),` +`,e.jsxs(i.h2,{id:"installation",children:["Installation",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#installation",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:["The ",e.jsx(i.code,{children:"torii"})," binary can be installed via ",e.jsx(i.a,{href:"/getting-started/quick-start",children:e.jsx(i.code,{children:"dojoup"})}),", our dedicated installation package manager."]}),` +`,e.jsxs(i.h3,{id:"installing-from-source",children:["Installing from Source",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#installing-from-source",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"If you prefer to install from the source code:"}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cargo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" install --path ./crates/torii --profile local --force"})]})})})}),` +`,e.jsx(i.p,{children:"This will install Torii and the required dependencies on your local system."}),` +`,e.jsxs(i.blockquote,{children:[` +`,e.jsxs(i.p,{children:["📚 ",e.jsx(i.strong,{children:"Reference"})]}),` +`,e.jsxs(i.p,{children:["See the ",e.jsxs(i.a,{href:"/reference",children:[e.jsx(i.code,{children:"torii"})," Reference"]})," for a complete reference."]}),` +`]})]})}function d(n={}){const{wrapper:i}={...t(),...n.components};return i?e.jsx(i,{...n,children:e.jsx(r,{...n})}):r(n)}export{d as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/overview-kL5rWS2u.js b/dojo-book/docs/dist/assets/overview-kL5rWS2u.js new file mode 100644 index 00000000..e7b8f090 --- /dev/null +++ b/dojo-book/docs/dist/assets/overview-kL5rWS2u.js @@ -0,0 +1,12 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const l={title:"Slot",description:"undefined"};function t(n){const i={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",span:"span",strong:"strong",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(i.header,{children:e.jsxs(i.h1,{id:"slot",children:["Slot",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#slot",children:e.jsx(i.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsxs(i.p,{children:["Slot is a toolchain developed by ",e.jsx(i.a,{href:"https://github.com/cartridge-gg/slot",children:"Cartrige.gg"})," for rapidly spinning up Katana and Torii instances. Play test your game in seconds."]}),` +`,e.jsxs(i.h2,{id:"installation",children:["Installation",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#installation",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Run the following command to install slot:"}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"curl"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" -L"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" https://slot.cartridge.sh "}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"|"}),e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" bash"})]})})})}),` +`,e.jsxs(i.p,{children:["Once finished, run ",e.jsx(i.code,{children:"slotup"})," to manage slot installations and follow the outputted directions."]}),` +`,e.jsxs(i.h2,{id:"deploy-using-slot",children:["Deploy using Slot",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#deploy-using-slot",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:["To deploy your projects using slot, check out the tutorial ",e.jsx(i.a,{href:"/tutorial/deploy-using-slot/main",children:"Deploy using Slot"}),"."]}),` +`,e.jsxs(i.blockquote,{children:[` +`,e.jsxs(i.p,{children:["📚 ",e.jsx(i.strong,{children:"Reference"})]}),` +`,e.jsxs(i.p,{children:["See the ",e.jsxs(i.a,{href:"/reference",children:[e.jsx(i.code,{children:"slot"})," Reference"]})," for a complete overview of all the available subcommands."]}),` +`]})]})}function r(n={}){const{wrapper:i}={...s(),...n.components};return i?e.jsx(i,{...n,children:e.jsx(t,{...n})}):t(n)}export{r as default,l as frontmatter}; diff --git a/dojo-book/docs/dist/assets/overview-mNwg_WUI.js b/dojo-book/docs/dist/assets/overview-mNwg_WUI.js new file mode 100644 index 00000000..714b6e52 --- /dev/null +++ b/dojo-book/docs/dist/assets/overview-mNwg_WUI.js @@ -0,0 +1,54 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const t=void 0;function a(n){const i={a:"a",blockquote:"blockquote",code:"code",div:"div",em:"em",figure:"figure",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(i.p,{children:e.jsx(i.img,{src:"/katana-icon-word.png",alt:"katana"})}),` +`,e.jsxs(i.p,{children:["Katana is a ",e.jsx(i.em,{children:"blazingly fast"})," sequencer, designed to support both local development as well as production deployments."]}),` +`,e.jsx(i.p,{children:"In development mode, Katana provides the tool necessary for rapid iteration, including custom development RPCs for manipulating the execution context."}),` +`,e.jsx(i.p,{children:"In produciton mode, Katana provides a high performance sequencer optimized for gaming workloads, with support for settlment and cross layer communication."}),` +`,e.jsxs(i.h3,{id:"features",children:["Features",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#features",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsxs(i.li,{children:[e.jsx(i.a,{href:"https://github.com/starkware-libs/starknet-specs/tree/v0.3.0",children:"Starknet JSON-RPC v0.3.0"})," support"]}),` +`,e.jsx(i.li,{children:"Cross layer communication (L1 <> L2, LN <> LN+1)"}),` +`,e.jsx(i.li,{children:"Custom methods for manipulating the blockchain states"}),` +`]}),` +`,e.jsxs(i.h2,{id:"installation",children:["Installation",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#installation",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"katana"})," binary is available via ",e.jsx(i.a,{href:"/getting-started/quick-start",children:e.jsx(i.code,{children:"dojoup"})}),"."]}),` +`,e.jsxs(i.h3,{id:"installing-from-source",children:["Installing from source",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#installing-from-source",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsxs(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"git"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" clone https://github.com/dojoengine/dojo"})]}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"cd"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" dojo"})]}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cargo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" install --path ./crates/katana --locked --force"})]})]})})}),` +`,e.jsxs(i.h3,{id:"usage",children:["Usage",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"console","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"console","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"katana"})})})})}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"console","data-theme":"github-dark-dimmed github-light",children:e.jsxs(i.code,{"data-language":"console","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"██╗ ██╗ █████╗ ████████╗ █████╗ ███╗ ██╗ █████╗"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"██║ ██╔╝██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║██╔══██╗"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"█████╔╝ ███████║ ██║ ███████║██╔██╗ ██║███████║"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"██╔═██╗ ██╔══██║ ██║ ██╔══██║██║╚██╗██║██╔══██║"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"██║ ██╗██║ ██║ ██║ ██║ ██║██║ ╚████║██║ ██║"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝"})}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"PREFUNDED ACCOUNTS"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"=================="})}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"| Account address | 0x3ee9e18edc71a6df30ac3aca2e0b02a198fbce19b7480a63a0d71cbd76652e0"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"| Private key | 0x300001800000000300000180000000000030000000000003006001800006600"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"| Public key | 0x1b7b37a580d91bc3ad4f9933ed61f3a395e0e51c9dd5553323b8ca3942bb44e"})}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"| Account address | 0x33c627a3e5213790e246a917770ce23d7e562baa5b4d2917c23b1be6d91961c"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"| Private key | 0x333803103001800039980190300d206608b0070db0012135bd1fb5f6282170b"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"| Public key | 0x4486e2308ef3513531042acb8ead377b887af16bd4cdd8149812dfef1ba924d"})}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"ACCOUNTS SEED"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"============="})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"})}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"🚀 JSON-RPC server started: http://0.0.0.0:5050"})}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:" "})]})})}),` +`,e.jsxs(i.p,{children:["To enable development features, run using the ",e.jsx(i.code,{children:"--dev"})," flag."]}),` +`,e.jsxs(i.blockquote,{children:[` +`,e.jsxs(i.p,{children:["📚 ",e.jsx(i.strong,{children:"Reference"})]}),` +`,e.jsxs(i.p,{children:["See the ",e.jsxs(i.a,{href:"/reference",children:[e.jsx(i.code,{children:"katana"})," Reference"]})," for an in depth reference and documentation on Katana."]}),` +`]})]})}function l(n={}){const{wrapper:i}={...s(),...n.components};return i?e.jsx(i,{...n,children:e.jsx(a,{...n})}):a(n)}export{l as default,t as frontmatter}; diff --git a/dojo-book/docs/dist/assets/overview-oCI3OrOD.js b/dojo-book/docs/dist/assets/overview-oCI3OrOD.js new file mode 100644 index 00000000..50711d19 --- /dev/null +++ b/dojo-book/docs/dist/assets/overview-oCI3OrOD.js @@ -0,0 +1,9 @@ +import{u as i,j as e}from"./index-m6NaWekR.js";const s={title:"Overview",description:"undefined"};function o(t){const n={a:"a",blockquote:"blockquote",div:"div",h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...i(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(n.header,{children:e.jsxs(n.h1,{id:"overview",children:["Overview",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#overview",children:e.jsx(n.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsx(n.p,{children:"Dojo is BYO client, meaning that you can use any client you want to connect to the Dojo network."}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"/dojojs",children:"npm"})}),` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"torii.md",children:"torii"})}),` +`]}),` +`,e.jsxs(n.blockquote,{children:[` +`,e.jsxs(n.p,{children:["Dojo is always looking to expand these clients, if you would like to contribute reach out into the ",e.jsx(n.a,{href:"https://discord.gg/KG9w9BmDrV",children:"Discord"})]}),` +`]})]})}function c(t={}){const{wrapper:n}={...i(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(o,{...t})}):o(t)}export{c as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/profile-BF-BPoNG.js b/dojo-book/docs/dist/assets/profile-BF-BPoNG.js new file mode 100644 index 00000000..68ed35f8 --- /dev/null +++ b/dojo-book/docs/dist/assets/profile-BF-BPoNG.js @@ -0,0 +1,23 @@ +import{u as d,j as i}from"./index-m6NaWekR.js";const h=void 0;function a(s){const e={a:"a",br:"br",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",p:"p",pre:"pre",span:"span",...d(),...s.components};return i.jsxs(i.Fragment,{children:[i.jsxs(e.h2,{id:"use-sozo-profiles",children:["use sozo profiles",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#use-sozo-profiles",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.p,{children:"Profiles can be convenient when dealing with multiple environments (dev, staging, prod)"}),` +`,i.jsxs(e.p,{children:[i.jsx(e.code,{children:"--profile"}),i.jsx(e.br,{}),` +`,"    Specify profile to use by name."]}),` +`,i.jsxs(e.p,{children:[i.jsx(e.code,{children:"--dev"}),i.jsx(e.br,{}),` +`,"    Use dev profile."]}),` +`,i.jsxs(e.p,{children:[i.jsx(e.code,{children:"--release"}),i.jsx(e.br,{}),` +`,"    Use release profile."]}),` +`,i.jsxs(e.h3,{id:"usage",children:["USAGE",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.p,{children:"Multiple profiles can be defined in Scarb.toml"}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsxs(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"[profile.dev.tool.dojo.env]"})}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"rpc_url"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' = "http://localhost:5050"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"account_address"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"private_key"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' = "0x1800000000300000180000000000030000000000003006001800006600"'})]}),` +`,i.jsx(e.span,{"data-line":"",children:" "}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"[profile.staging.tool.dojo.env]"})}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"rpc_url"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' = "https://api.cartridge.gg/x/mydojoproject/katana"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"account_address"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' = "0x5686a647a9cdd63ade617e0baf3b364856b813b508f03903eb58a7e622d5855"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"private_key"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:' = "0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b"'})]})]})})}),` +`,i.jsx(e.p,{children:"Then used with sozo commands"}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --profile"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" dev migrate"})]})})})}),` +`,i.jsx(e.p,{children:"is equivalent to"}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(e.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" migrate --rpc-url http://localhost:5050 --account-address "}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" --private-key "}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0x1800000000300000180000000000030000000000003006001800006600"})]})})})})]})}function t(s={}){const{wrapper:e}={...d(),...s.components};return e?i.jsx(e,{...s,children:i.jsx(a,{...s})}):a(s)}export{t as default,h as frontmatter}; diff --git a/dojo-book/docs/dist/assets/quick-start-wS1fd9tk.js b/dojo-book/docs/dist/assets/quick-start-wS1fd9tk.js new file mode 100644 index 00000000..3d6cc6dc --- /dev/null +++ b/dojo-book/docs/dist/assets/quick-start-wS1fd9tk.js @@ -0,0 +1,15 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const d=void 0;function n(t){const i={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",p:"p",pre:"pre",span:"span",...s(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsxs(i.h2,{id:"quick-start",children:["Quick Start",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#quick-start",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.blockquote,{children:[` +`,e.jsxs(i.p,{children:["It is worth reading ",e.jsx(i.a,{href:"/theory/autonomous-worlds",children:"theory"})," to familiarize yourself with the concept of Autonomous Worlds (AWs) and the ",e.jsx(i.a,{href:"/theory/cairo",children:"Cairo ecosystem"})," before diving into the code."]}),` +`]}),` +`,e.jsxs(i.h3,{id:"install-dojoup",children:["Install Dojoup",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#install-dojoup",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:["Dojo is built around a set of development tools - Katana, Torii and Sozo. Install them all easily with Dojoup. You can find detailed information about Dojoup ",e.jsx(i.a,{href:"https://github.com/dojoengine/dojo/blob/master/dojoup/README.md",children:"here"}),"."]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"curl"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" -L"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" https://install.dojoengine.org "}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"|"}),e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" bash"})]})})})}),` +`,e.jsxs(i.p,{children:[`This will install Dojoup, then simply follow the instructions on-screen, +which will make the `,e.jsx(i.code,{children:"dojoup"})," command available in your CLI."]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dojoup"})})})})}),` +`,e.jsxs(i.p,{children:["For full ",e.jsx(i.code,{children:"dojoup"})," reference and debugging see ",e.jsx(i.a,{href:"/toolchain/dojoup",children:"Dojoup"}),"."]}),` +`,e.jsxs(i.h3,{id:"next-steps",children:["Next steps",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#next-steps",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.blockquote,{children:[` +`,e.jsxs(i.p,{children:["Head to ",e.jsx(i.a,{href:"/cairo/hello-dojo",children:"Hello Dojo"})," to get create your first Dojo world."]}),` +`]})]})}function o(t={}){const{wrapper:i}={...s(),...t.components};return i?e.jsx(i,{...t,children:e.jsx(n,{...t})}):n(t)}export{o as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/reference-Amyb_7Dy.js b/dojo-book/docs/dist/assets/reference-Amyb_7Dy.js new file mode 100644 index 00000000..59ef7ca5 --- /dev/null +++ b/dojo-book/docs/dist/assets/reference-Amyb_7Dy.js @@ -0,0 +1,22 @@ +import{u as d,j as n}from"./index-m6NaWekR.js";const o=void 0;function i(r){const e={a:"a",div:"div",h2:"h2",h3:"h3",li:"li",ul:"ul",...d(),...r.components};return n.jsxs(n.Fragment,{children:[n.jsxs(e.h2,{id:"sozo-reference",children:["sozo reference",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-reference",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.h3,{id:"common-options",children:["Common options",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#common-options",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.ul,{children:[` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/common-options/profile",children:"profile"})}),` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/common-options/offline",children:"offline"})}),` +`]}),` +`,n.jsxs(e.h3,{id:"project-commands",children:["Project Commands",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#project-commands",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.ul,{children:[` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/project-commands/init",children:"init"})}),` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/project-commands/build",children:"build"})}),` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/project-commands/test",children:"test"})}),` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/project-commands/migrate",children:"migrate"})}),` +`]}),` +`,n.jsxs(e.h3,{id:"world-commands",children:["World Commands",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#world-commands",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.ul,{children:[` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/world-commands/execute",children:"execute"})}),` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/world-commands/register",children:"register"})}),` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/world-commands/system",children:"system"})}),` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/world-commands/model",children:"model"})}),` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/world-commands/events",children:"events"})}),` +`,n.jsx(e.li,{children:n.jsx(e.a,{href:"/world-commands/auth",children:"auth"})}),` +`]})]})}function c(r={}){const{wrapper:e}={...d(),...r.components};return e?n.jsx(e,{...r,children:n.jsx(i,{...r})}):i(r)}export{c as default,o as frontmatter}; diff --git a/dojo-book/docs/dist/assets/reference-Kzn8R6aJ.js b/dojo-book/docs/dist/assets/reference-Kzn8R6aJ.js new file mode 100644 index 00000000..38d4fbc8 --- /dev/null +++ b/dojo-book/docs/dist/assets/reference-Kzn8R6aJ.js @@ -0,0 +1,208 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const d=void 0;function n(s){const i={a:"a",br:"br",code:"code",div:"div",em:"em",figure:"figure",h2:"h2",h3:"h3",h4:"h4",h5:"h5",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...t(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsxs(i.h2,{id:"katana-reference",children:["katana reference",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#katana-reference",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h3,{id:"name",children:["NAME",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#name",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"katana - Create a local testnet node for deploying and testing Starknet smart contracts."}),` +`,e.jsxs(i.h3,{id:"usage",children:["USAGE",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" [OPTIONS]"})]})})})}),` +`,e.jsxs(i.h3,{id:"description",children:["DESCRIPTION",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#description",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:["Create a local testnet node for deploying and testing Starknet smart contracts. Katana supports deployment and execution of the ",e.jsx(i.strong,{children:"new"})," as well as the ",e.jsx(i.strong,{children:"legacy"})," (Cairo 0) Cairo contracts."]}),` +`,e.jsx(i.p,{children:"This section covers an extensive list of information about Mining Modes, Supported RPC Methods, Katana flags and their usages. You can run multiple flags at the same time."}),` +`,e.jsxs(i.h4,{id:"mining-modes",children:["Mining Modes",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#mining-modes",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"In Katana, mining modes determine how frequent blocks are mined. By default, a new block is automatically mined as soon as a transaction is submitted."}),` +`,e.jsxs(i.p,{children:["You can switch from the default mining behaviour to interval mining, where a new block is created at a fixed time interval selected by the user. To enable this mode of mining, use the ",e.jsx(i.code,{children:"--block-time "})," flag, as demonstrated in the following example."]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsxs(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Produces a new block every 10 seconds"})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --block-time"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 10000"})]})]})})}),` +`,e.jsxs(i.h4,{id:"forking",children:["Forking",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#forking",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:["Katana supports forking from a Starknet RPC provider. You can configure your node to enable the forking feature by providing a valid RPC provider using the ",e.jsx(i.code,{children:"--rpc-url "})," flag., which would initiate Katana to fork the latest block of the provided network. If you would like to fork from a specific block, you can do so using ",e.jsx(i.code,{children:"--fork-block-number "}),"."]}),` +`,e.jsx(i.p,{children:"NOTE: This does not allow fetching of historical blocks but only blocks that are mined by Katana. However, support for fetching historical blocks will be added in the future."}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsxs(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Forks the network at block 1200"})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --rpc-url"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" http://your-rpc-provider.com --fork-block-number "}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"1200"})]})]})})}),` +`,e.jsxs(i.h4,{id:"messaging",children:["Messaging",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#messaging",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Katana also allows users to perform L1 <-> L2 integration using the messaging feature. There are two types of messaging service supported by Katana:"}),` +`,e.jsxs(i.ol,{children:[` +`,e.jsx(i.li,{children:e.jsx(i.em,{children:"Ethereum"})}),` +`,e.jsxs(i.li,{children:[e.jsx(i.em,{children:"Starknet"})," (",e.jsx(i.strong,{children:"experimental"}),")"]}),` +`]}),` +`,e.jsxs(i.p,{children:["If configured to ",e.jsx(i.em,{children:"Ethereum"})," messaging, Katana will listen/send messages on an Ethereum chain. This type of messaging behaves similar to the canonical Starknet sequencer with the exception that messages from L2 -> L1 will be sent directly to the settlement chain for consumption, instead of having to wait for the corresponding blocks of the messages to be proven on the settlement chain (which in reality would be a very time consuming process)."]}),` +`,e.jsxs(i.p,{children:["The ",e.jsx(i.em,{children:"Starknet"})," messaging, however, is an experimental feature that allows Katana to listen/send messages on a Starknet chain. It attempts to replicate the behaviour of Ethereum messaging but with a Starknet chain as the settlement layer. This is achieved by having Katana listen to the Starknet chain for new blocks and then sending the messages to the settlement chain for consumption. This is an experimental and opinionated feature, and is not recommended for production use."]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --messaging"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" path/to/messaging/config.json"})]})})})}),` +`,e.jsx(i.p,{children:"The messaging config file is a JSON file that contains the following fields:"}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"json","data-theme":"github-dark-dimmed github-light",children:e.jsxs(i.code,{"data-language":"json","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"{"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:' /// The type of messaging service to use. Can be either "ethereum" or "starknet".'})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "chain"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"ethereum"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" /// The RPC-URL of the settlement chain."})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "rpc_url"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"http://127.0.0.1:8545"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" /// The messaging-contract address on the settlement chain."})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "contract_address"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x5FbDB2315678afecb367f032d93F642f64180aa3"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" /// The address to use for settling messages. It should be a valid address that"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" /// can be used to send a transaction on the settlement chain."})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "sender_address"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" /// The private key associated to `sender_address`."})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "private_key"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" /// The interval, in seconds, at which the messaging service will fetch and settle messages"})}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" /// from/to the settlement chain."})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "interval"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"2"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:","})]}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:" /// The block on settlement chain from where Katana will start fetching messages."})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#8DDB8C","--shiki-light":"#005CC5"},children:' "from_block"'}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:": "}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"0"})]}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"}"})})]})})}),` +`,e.jsxs(i.h4,{id:"supported-transport-layers",children:["Supported Transport Layers",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#supported-transport-layers",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Only HTTP connection is supported at the moment. The server listens on port 5050 by default, but it can be changed by running the following command:"}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --port"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" <"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"POR"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"T"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})})})}),` +`,e.jsxs(i.h4,{id:"starknet-feature-compatibility",children:["Starknet Feature Compatibility",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starknet-feature-compatibility",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h5,{id:"supported-transaction-type",children:["Supported Transaction Type",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#supported-transaction-type",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.table,{children:[e.jsx(i.thead,{children:e.jsxs(i.tr,{children:[e.jsx(i.th,{children:"Type"}),e.jsx(i.th,{children:"Version"})]})}),e.jsxs(i.tbody,{children:[e.jsxs(i.tr,{children:[e.jsx(i.td,{children:"INVOKE"}),e.jsx(i.td,{children:"1"})]}),e.jsxs(i.tr,{children:[e.jsx(i.td,{children:"DECLARE"}),e.jsx(i.td,{children:"1, 2"})]}),e.jsxs(i.tr,{children:[e.jsx(i.td,{children:"DEPLOY_ACCOUNT"}),e.jsx(i.td,{})]})]})]}),` +`,e.jsxs(i.h4,{id:"supported-rpc-methods",children:["Supported RPC Methods",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#supported-rpc-methods",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h5,{id:"starknet-methods",children:["Starknet Methods",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starknet-methods",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:["Katana supports version ",e.jsx(i.strong,{children:"v0.3.0"})," of the Starknet JSON-RPC specifications. The standard methods are based on ",e.jsx(i.a,{href:"https://github.com/starkware-libs/starknet-specs/tree/v0.3.0",children:"this"})," reference."]}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_blockNumber"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_blockHashAndNumber"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getBlockWithTxs"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getBlockWithTxHashes"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getBlockTransactionCount"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getTransactionByHash"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getTransactionByBlockIdAndIndex"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getTransactionReceipt"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_pendingTransactions"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getStateUpdate"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_call"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_estimateFee"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_chainId"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getNonce"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getEvents"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getStorageAt"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getClassHashAt"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_getClass"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.strong,{children:e.jsx(i.code,{children:"starknet_getClassAt"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_addInvokeTransaction"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_addDeclareTransaction"})}),` +`]}),` +`,e.jsxs(i.li,{children:[` +`,e.jsx(i.p,{children:e.jsx(i.code,{children:"starknet_addDeployAccountTransaction"})}),` +`]}),` +`]}),` +`,e.jsxs(i.h5,{id:"custom-methods",children:["Custom Methods",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#custom-methods",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Katana provides a convenient set of custom RPC methods to quickly and easily configure the node to suit your testing environment."}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"katana_generateBlock"}),e.jsx(i.br,{}),` +`,"Mine a new block which includes all currently pending transactions."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"katana_nextBlockTimestamp"}),e.jsx(i.br,{}),` +`,"Get the time for the next block."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"katana_increaseNextBlockTimestamp"}),e.jsx(i.br,{}),` +`,"Increase the time for the block by a given amount of time, in seconds."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"katana_setNextBlockTimestamp"}),e.jsx(i.br,{}),` +`,"Similar to ",e.jsx(i.code,{children:"katana_increaseNextBlockTimestamp"})," but takes the exact timestamp that you want in the next block."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"katana_predeployedAccounts"}),e.jsx(i.br,{}),` +`,"Get the info for all of the predeployed accounts."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"katana_setStorageAt"}),e.jsx(i.br,{}),` +`,"Set an exact value of a contract's storage slot."]}),` +`,e.jsxs(i.h3,{id:"options",children:["OPTIONS",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h4,{id:"general-options",children:["General Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#general-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--silent"}),e.jsx(i.br,{}),` +`,"     Don't print anything on startup."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--no-mining"}),e.jsx(i.br,{}),` +`,"     Disable auto and interval mining, and mine on demand instead."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"-b, --block-time "}),e.jsx(i.br,{}),` +`,"     Block time in milliseconds for interval mining."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--dump-state "}),e.jsx(i.br,{}),` +`,"     Dump the state of chain on exit to the given file.",e.jsx(i.br,{}),` +`,"     If the value is a directory, the state will be written to ",e.jsx(i.code,{children:"/state.bin"}),"."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--rpc-url "}),e.jsx(i.br,{}),` +`,"     The Starknet RPC provider to fork the network from."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--json-log"}),e.jsx(i.br,{}),` +`,"     Output logs in JSON format."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--fork-block-number "}),e.jsx(i.br,{}),` +`,"     Fork the network at a specific block."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--messaging "}),e.jsx(i.br,{}),` +`,"     Configure the messaging service to allow Katana to listen/send messages on a settlement chain that can be either Ethereum or another Starknet sequencer (experimental)."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"-h, --help"}),e.jsx(i.br,{}),` +`,"     Print help (see a summary with '-h')."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"-V, --version"}),e.jsx(i.br,{}),` +`,"     Print version information."]}),` +`,e.jsxs(i.h4,{id:"server-options",children:["Server Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#server-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"-p, --port "}),e.jsx(i.br,{}),` +`,"     Port number to listen on. [default: 5050]"]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--host "}),e.jsx(i.br,{}),` +`,"     The IP address the server will listen on."]}),` +`,e.jsxs(i.h4,{id:"starknet-options",children:["Starknet Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starknet-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--seed "}),e.jsx(i.br,{}),` +`,"     Specify the seed for randomness of accounts to be predeployed."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--accounts "}),e.jsx(i.br,{}),` +`,"     Number of pre-funded accounts to generate. [default: 10]"]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--disable-fee"}),e.jsx(i.br,{}),` +`,"     Disable charging fee for transactions."]}),` +`,e.jsxs(i.h4,{id:"environment-options",children:["Environment Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#environment-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--chain-id "}),e.jsx(i.br,{}),` +`,"     The chain ID. [default: KATANA]"]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--gas-price "}),e.jsx(i.br,{}),` +`,"     The gas price."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--validate-max-steps "}),e.jsx(i.br,{}),` +`,"     The maximum number of steps available for the account validation logic."]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--invoke-max-steps "}),e.jsx(i.br,{}),` +`,"     The maximum number of steps available for the account execution logic."]}),` +`,e.jsxs(i.h3,{id:"shell-completions",children:["Shell Completions",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#shell-completions",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"katana"})," completions shell"]}),` +`,e.jsx(i.p,{children:"Generates a shell completions script for the given shell."}),` +`,e.jsx(i.p,{children:"Supported shells are:"}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsx(i.li,{children:"bash"}),` +`,e.jsx(i.li,{children:"elvish"}),` +`,e.jsx(i.li,{children:"fish"}),` +`,e.jsx(i.li,{children:"powershell"}),` +`,e.jsx(i.li,{children:"zsh"}),` +`]}),` +`,e.jsxs(i.h4,{id:"examples",children:["EXAMPLES",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#examples",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:["Generate shell completions script for ",e.jsx(i.code,{children:"bash"})," and appends it to a ",e.jsx(i.code,{children:".bashrc"})," file:"]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" completions bash"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:" >>"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" ~/.bashrc"})]})})})}),` +`,e.jsxs(i.h3,{id:"examples-1",children:["EXAMPLES",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#examples-1",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ol,{children:[` +`,e.jsx(i.li,{children:"Create 15 dev accounts and disable transaction fee mechanism"}),` +`]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --accounts"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" 15"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" --disable-fee"})]})})})}),` +`,e.jsxs(i.ol,{start:"2",children:[` +`,e.jsxs(i.li,{children:["Set the chain id to ",e.jsx(i.code,{children:"SN_GOERLI"})," and run the server on port 8545"]}),` +`]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --chain-id"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" SN_GOERLI --port "}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"8545"})]})})})}),` +`,e.jsxs(i.ol,{start:"3",children:[` +`,e.jsx(i.li,{children:"Load previously stored state and dump the state of this session to a file on shutdown"}),` +`]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"katana"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --load-state"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" ./dump-state.bin --dump-state ./dump-state.bin"})]})})})})]})}function r(s={}){const{wrapper:i}={...t(),...s.components};return i?e.jsx(i,{...s,children:e.jsx(n,{...s})}):n(s)}export{r as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/reference-Q9lg16nI.js b/dojo-book/docs/dist/assets/reference-Q9lg16nI.js new file mode 100644 index 00000000..7905735a --- /dev/null +++ b/dojo-book/docs/dist/assets/reference-Q9lg16nI.js @@ -0,0 +1,35 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const a=void 0;function t(n){const i={a:"a",br:"br",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",span:"span",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsxs(i.h2,{id:"torii-reference",children:["torii reference",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#torii-reference",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h3,{id:"name",children:["Name",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#name",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"torii - An automatic indexer and networking layer for a world contract."}),` +`,e.jsxs(i.h3,{id:"usage",children:["USAGE",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"torii"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" [OPTIONS]"})]})})})}),` +`,e.jsxs(i.h3,{id:"description",children:["DESCRIPTION",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#description",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"torii"})," starts the indexer and exposes GraphQL/gRPC API endpoints. The indexer queries the specified Starknet RPC endpoint for transaction blocks and listens for transactions related to the world contract. These transactions can include component/system registrations, entity state updates, system calls, and events. The parsed data is then stored in a local SQLite database."]}),` +`,e.jsx(i.p,{children:"The GraphQL and gRPC API endpoints run in tandem with the indexer, providing custom queries specific to the world contract for client applications."}),` +`,e.jsxs(i.h4,{id:"database-url",children:["Database URL",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#database-url",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"torii"})," uses a sqlite database to store indexed data. The database can be stored either in-memory or persistently on the filesystem."]}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsx(i.li,{children:"The in-memory database is ephemeral and only lasts as long as the indexer is running. This is a fast and simple option to start the indexer for development/testing."}),` +`,e.jsx(i.li,{children:"Persistent storage should be used in production. It relies on the local filesystem for storage."}),` +`]}),` +`,e.jsx(i.p,{children:"Note: If using in-memory db, the memory will be garbage collected after a period of inactivity, causing queries to result in errors. Workaround is to use a persistent database."}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsxs(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# Persistent database storage using file indexer.db"})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"torii"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --database"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" indexer.db"})]})]})})}),` +`,e.jsxs(i.h3,{id:"options",children:["OPTIONS",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h4,{id:"general-options",children:["General Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#general-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"-w, --world"}),e.jsx(i.br,{}),` +`,"     Address of the world contract to index"]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--rpc"}),e.jsx(i.br,{}),` +`,"     Starknet RPC endpoint to use [default: http//localhost:5050]"]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"-d, --database "}),e.jsx(i.br,{}),` +`,"     Database filepath (ex: indexer.db) [default: :memory:]"]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"-s, --start-block "}),e.jsx(i.br,{}),` +`,"     Specify a block to start indexing from, ignored if stored head exists [default: 0]"]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--allowed-origins "}),e.jsx(i.br,{}),` +`,'     Specify allowed origins for api endpoints (comma-separated list of allowed origins, or "*" for all) [default: *]']}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"--external-url "}),e.jsx(i.br,{}),` +`,"     The external url of the server, used for configuring the GraphQL Playground in a hosted environment"]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"-h, --help"}),` +     Print help`]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"-V, --version"}),` +     Print version`]})]})}function d(n={}){const{wrapper:i}={...s(),...n.components};return i?e.jsx(i,{...n,children:e.jsx(t,{...n})}):t(n)}export{d as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/reference-YEtbbTw1.js b/dojo-book/docs/dist/assets/reference-YEtbbTw1.js new file mode 100644 index 00000000..b8cfa580 --- /dev/null +++ b/dojo-book/docs/dist/assets/reference-YEtbbTw1.js @@ -0,0 +1,12 @@ +import{u as i,j as e}from"./index-m6NaWekR.js";const t=void 0;function d(a){const n={a:"a",br:"br",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",p:"p",pre:"pre",span:"span",...i(),...a.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.h2,{id:"slot-reference",children:["slot reference",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#slot-reference",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.h3,{id:"name",children:["Name",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#name",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"slot - a toolchain developed for rapidly spinning up Katana and Torii instances."}),` +`,e.jsxs(n.h3,{id:"usage",children:["Usage",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(n.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(n.span,{"data-line":"",children:[e.jsx(n.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"slot"}),e.jsx(n.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" [COMMANDS] [OPTIONS]"})]})})})}),` +`,e.jsxs(n.h3,{id:"commands",children:["Commands",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#commands",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"auth"}),e.jsx(n.br,{}),` +`,"     Manage auth credentials for the Slot CLI."]}),` +`,e.jsx(n.p,{children:e.jsx(n.a,{href:"/deployments-commands/deployments",children:e.jsx(n.code,{children:"deployments"})})}),` +`,e.jsx(n.p,{children:"     Manage Slot deployments."}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"help"}),e.jsx(n.br,{}),` +`,"     Print this message or the help of the given subcommand(s)"]})]})}function r(a={}){const{wrapper:n}={...i(),...a.components};return n?e.jsx(n,{...a,children:e.jsx(d,{...a})}):d(a)}export{r as default,t as frontmatter}; diff --git a/dojo-book/docs/dist/assets/register-6ALlJdbf.js b/dojo-book/docs/dist/assets/register-6ALlJdbf.js new file mode 100644 index 00000000..e1a6f6b1 --- /dev/null +++ b/dojo-book/docs/dist/assets/register-6ALlJdbf.js @@ -0,0 +1,14 @@ +import{u as n,j as i}from"./index-m6NaWekR.js";const h=void 0;function t(e){const s={a:"a",code:"code",div:"div",figure:"figure",h2:"h2",p:"p",pre:"pre",span:"span",...n(),...e.components};return i.jsxs(i.Fragment,{children:[i.jsxs(s.h2,{id:"sozo-register",children:["sozo register",i.jsx(s.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-register",children:i.jsx(s.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(s.p,{children:[i.jsx(s.code,{children:"register"})," is used to register new systems and components."]}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsx(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" register [OPTIONS] "}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"COMMAN"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"D"}),i.jsx(s.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})})})}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"Commands:"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" component"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Register a component to a world."})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" system"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Register a system to a world."})]}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" help"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Print this message or the help of the given subcommand"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"("}),i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"s"}),i.jsx(s.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:")"})]})]})})}),` +`,i.jsx(s.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(s.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:i.jsxs(s.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# example: component - register a component to a world"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# this will register the Moves component to the world"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" register component Moves"})]}),` +`,i.jsx(s.span,{"data-line":"",children:" "}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# example: system - register a system to a world"})}),` +`,i.jsx(s.span,{"data-line":"",children:i.jsx(s.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# this will register the spawn system to the world"})}),` +`,i.jsxs(s.span,{"data-line":"",children:[i.jsx(s.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),i.jsx(s.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" register system spawn"})]})]})})})]})}function d(e={}){const{wrapper:s}={...n(),...e.components};return s?i.jsx(s,{...e,children:i.jsx(t,{...e})}):t(e)}export{d as default,h as frontmatter}; diff --git a/dojo-book/docs/dist/assets/remote-Wmy08Tq_.js b/dojo-book/docs/dist/assets/remote-Wmy08Tq_.js new file mode 100644 index 00000000..080fcba2 --- /dev/null +++ b/dojo-book/docs/dist/assets/remote-Wmy08Tq_.js @@ -0,0 +1,41 @@ +import{u as n,j as i}from"./index-m6NaWekR.js";const t=void 0;function a(s){const e={a:"a",blockquote:"blockquote",code:"code",div:"div",em:"em",figure:"figure",h2:"h2",h3:"h3",p:"p",pre:"pre",span:"span",...n(),...s.components};return i.jsxs(i.Fragment,{children:[i.jsxs(e.h2,{id:"deployment-to-remote-network",children:["Deployment to Remote Network",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#deployment-to-remote-network",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.blockquote,{children:[` +`,i.jsx(e.p,{children:i.jsx(e.em,{children:"IMPORTANT: Dojo is unaudited. Use at your own risk."})}),` +`]}),` +`,i.jsx(e.p,{children:"Dojo makes it easy to deploy to remote networks, you just need to have a valid account and network endpoint."}),` +`,i.jsx(e.p,{children:"Scarb.toml"}),` +`,i.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:i.jsx(e.pre,{tabIndex:"0","data-language":"toml","data-theme":"github-dark-dimmed github-light",children:i.jsxs(e.code,{"data-language":"toml","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"package"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"name = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"ohayoo"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"version = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0.1.0"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"cairo-version = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0.3.15"'})]}),` +`,i.jsx(e.span,{"data-line":"",children:" "}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cairo"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"sierra-replace-ids = "}),i.jsx(e.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:"true"})]}),` +`,i.jsx(e.span,{"data-line":"",children:" "}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"["}),i.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"dependencies"}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"]"})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"dojo = { git = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"https://github.com/dojoengine/dojo"'}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:", tag = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"v0.3.15"'}),i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:" }"})]}),` +`,i.jsx(e.span,{"data-line":"",children:" "}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# KATANA on slot"})}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:'# rpc_url = "https://api.cartridge.gg/x/example/katana"'})}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:'# account_address = "0x2d5260ba1d62ed0ea7c598f1460d27528b27afdf3bb43524a1ba3617e8279b2"'})}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:'# private_key = "0x6768b97b44cfbfa9f776a3c00ebe33c228058bf8716bb0515a1363049da2a11"'})}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:'# world = "0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f"'})}),` +`,i.jsx(e.span,{"data-line":"",children:" "}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# ENDPOINT"})}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"rpc_url = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"https://api.cartridge.gg/x/shinai/madara"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"account_address = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x2"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"private_key = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0xc1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d"'})]}),` +`,i.jsxs(e.span,{"data-line":"",children:[i.jsx(e.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"world_address = "}),i.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:'"0x5b328933afdbbfd44901fd69a2764a254edbb6e992ae87cf958c70493f2d201"'})]}),` +`,i.jsx(e.span,{"data-line":"",children:" "}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:"# GOERLI"})}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:'# rpc_url = "https://starknet-goerli.g.alchemy.com/v2/"'})}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:'# account_address = "0x2d5260ba1d62ed0ea7c598f1460d27528b27afdf3bb43524a1ba3617e8279b2"'})}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:'# private_key = "0x6768b97b44cfbfa9f776a3c00ebe33c228058bf8716bb0515a1363049da2a11"'})}),` +`,i.jsx(e.span,{"data-line":"",children:i.jsx(e.span,{style:{"--shiki-dark":"#768390","--shiki-light":"#6A737D"},children:'# world = "0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f"'})})]})})}),` +`,i.jsxs(e.h3,{id:"deploy-to-public-starknet",children:["Deploy to public Starknet",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#deploy-to-public-starknet",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.p,{children:"If you credentials are correct in the Scarb.toml then a simple migrate will deploy the world to Starknet."}),` +`,i.jsxs(e.h3,{id:"deploy-to-remote-katana",children:["Deploy to Remote ",i.jsx(e.a,{href:"/toolchain/katana/overview",children:"Katana"}),i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#deploy-to-remote-katana",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsx(e.p,{children:"Katanas are able to be hosted and run as remote testnets, however this is not recommended for production use."}),` +`,i.jsxs(e.p,{children:["Deploy to remote katana with slot ",i.jsx(e.a,{href:"/tutorial/deploy-using-slot/main",children:"here"})]}),` +`,i.jsxs(e.h3,{id:"deploy-to-remote-madara",children:["Deploy to Remote Madara",i.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#deploy-to-remote-madara",children:i.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,i.jsxs(e.p,{children:[i.jsx(e.a,{href:"https://github.com/keep-starknet-strange/madara",children:"Madara"})," is a blazingly fast Starknet sequencer."]})]})}function h(s={}){const{wrapper:e}={...n(),...s.components};return e?i.jsx(e,{...s,children:i.jsx(a,{...s})}):a(s)}export{h as default,t as frontmatter}; diff --git a/dojo-book/docs/dist/assets/setup-xdoxF8F9.js b/dojo-book/docs/dist/assets/setup-xdoxF8F9.js new file mode 100644 index 00000000..3e89e7e8 --- /dev/null +++ b/dojo-book/docs/dist/assets/setup-xdoxF8F9.js @@ -0,0 +1,29 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const d={title:"Development Setup",description:"undefined"};function n(s){const i={a:"a",blockquote:"blockquote",code:"code",div:"div",em:"em",figure:"figure",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",span:"span",ul:"ul",...t(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsx(i.header,{children:e.jsxs(i.h1,{id:"development-setup",children:["Development Setup",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#development-setup",children:e.jsx(i.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsxs(i.blockquote,{children:[` +`,e.jsxs(i.p,{children:["This is a guide to setting up a development environment for Dojo. It is not suggested to follow this guide if you are just wanting to play with the toolchain. We strongly suggest following the ",e.jsx(i.a,{href:"/getting-started/quick-start",children:"Quick Start"})," guide."]}),` +`]}),` +`,e.jsxs(i.h3,{id:"prerequisites",children:["Prerequisites",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#prerequisites",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ul,{children:[` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://github.com/rust-lang/rust",children:"Rust"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://github.com/starkware-libs/cairo",children:"Cairo"})}),` +`,e.jsx(i.li,{children:e.jsx(i.a,{href:"https://github.com/protocolbuffers/protobuf",children:"protoc"})}),` +`]}),` +`,e.jsxs(i.h2,{id:"guide",children:["Guide",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#guide",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h3,{id:"clone",children:["Clone",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#clone",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"git"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" clone https://github.com/dojoengine/dojo.git"})]})})})}),` +`,e.jsxs(i.h3,{id:"linux--mac",children:["Linux & Mac",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#linux--mac",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h4,{id:"1-install-rust-and-dependencies",children:["1. Install Rust and Dependencies",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#1-install-rust-and-dependencies",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Start by installing Rust and running the test suite to confirm your setup:"}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"rustup"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" override set stable "}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"&& "}),e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"rustup"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" update "}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"&& "}),e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cargo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" test"})]})})})}),` +`,e.jsxs(i.blockquote,{children:[` +`,e.jsx(i.p,{children:"Note: Depending on your Linux distribution, you may need to install additional dependencies. Make sure to install any suggested or missing dependencies that arise during the setup process."}),` +`]}),` +`,e.jsxs(i.h4,{id:"2-install-scarb-package-manager",children:["2. Install Scarb Package Manager",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#2-install-scarb-package-manager",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:["Next, install the ",e.jsx(i.a,{href:"https://docs.swmansion.com/scarb",children:"Scarb"})," package manager by running:"]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"curl"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --proto"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" '=https'"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" --tlsv1.2"}),e.jsx(i.span,{style:{"--shiki-dark":"#6CB6FF","--shiki-light":"#005CC5"},children:" -sSf"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" https://docs.swmansion.com/scarb/install.sh "}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"|"}),e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" sh"})]})})})}),` +`,e.jsxs(i.h4,{id:"3-add-the-cairo-10-vscode-extension",children:["3. Add the Cairo 1.0 VSCode Extension",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#3-add-the-cairo-10-vscode-extension",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:["Install the ",e.jsx(i.a,{href:"https://marketplace.visualstudio.com/items?itemName=starkware.cairo1",children:"Cairo 1.0"})," extension for Visual Studio Code."]}),` +`,e.jsxs(i.h3,{id:"windows",children:["Windows",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#windows",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:e.jsx(i.em,{children:"Coming soon"})}),` +`,e.jsxs(i.h3,{id:"container",children:["Container",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#container",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:e.jsx(i.em,{children:"Coming soon"})})]})}function r(s={}){const{wrapper:i}={...t(),...s.components};return i?e.jsx(i,{...s,children:e.jsx(n,{...s})}):n(s)}export{r as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/signer-options-keystore-MrGUSaHf.js b/dojo-book/docs/dist/assets/signer-options-keystore-MrGUSaHf.js new file mode 100644 index 00000000..f9398d96 --- /dev/null +++ b/dojo-book/docs/dist/assets/signer-options-keystore-MrGUSaHf.js @@ -0,0 +1,5 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const c=void 0;function r(s){const n={br:"br",code:"code",em:"em",p:"p",...t(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.p,{children:[e.jsx(n.code,{children:"--keystore"})," ",e.jsx(n.em,{children:"PATH"}),e.jsx(n.br,{}),` +`,"    Use the keystore in the given folder or file."]}),` +`,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"--password"})," ",e.jsx(n.em,{children:"PASSWORD"}),e.jsx(n.br,{}),` +`,"    The keystore password. Used with --keystore.",e.jsx(n.br,{}),` +`,"    ENV: ",e.jsx(n.code,{children:"DOJO_KEYSTORE_PASSWORD"})]})]})}function d(s={}){const{wrapper:n}={...t(),...s.components};return n?e.jsx(n,{...s,children:e.jsx(r,{...s})}):r(s)}export{d as default,c as frontmatter}; diff --git a/dojo-book/docs/dist/assets/signer-options-raw-EMh7FC6H.js b/dojo-book/docs/dist/assets/signer-options-raw-EMh7FC6H.js new file mode 100644 index 00000000..3b92d10d --- /dev/null +++ b/dojo-book/docs/dist/assets/signer-options-raw-EMh7FC6H.js @@ -0,0 +1,3 @@ +import{u as c,j as n}from"./index-m6NaWekR.js";const s=void 0;function o(t){const e={br:"br",code:"code",em:"em",p:"p",...c(),...t.components};return n.jsxs(e.p,{children:[n.jsx(e.code,{children:"--private-key"})," ",n.jsx(e.em,{children:"PRIVATE_KEY"}),n.jsx(e.br,{}),` +`,"    The raw private key associated with the account contract.",n.jsx(e.br,{}),` +`,"    ENV: ",n.jsx(e.code,{children:"DOJO_PRIVATE_KEY"})]})}function a(t={}){const{wrapper:e}={...c(),...t.components};return e?n.jsx(e,{...t,children:n.jsx(o,{...t})}):o(t)}export{a as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/starknet-options-9t73ffGJ.js b/dojo-book/docs/dist/assets/starknet-options-9t73ffGJ.js new file mode 100644 index 00000000..ba718978 --- /dev/null +++ b/dojo-book/docs/dist/assets/starknet-options-9t73ffGJ.js @@ -0,0 +1,3 @@ +import{u as r,j as e}from"./index-m6NaWekR.js";const s=void 0;function o(t){const n={br:"br",code:"code",em:"em",p:"p",...r(),...t.components};return e.jsxs(n.p,{children:[e.jsx(n.code,{children:"--rpc-url"})," ",e.jsx(n.em,{children:"URL"}),e.jsx(n.br,{}),` +`,"    The Starknet RPC endpoint. [default: http://localhost:5050]",e.jsx(n.br,{}),` +`,"    ENV: ",e.jsx(n.code,{children:"STARKNET_RPC_URL"})]})}function d(t={}){const{wrapper:n}={...r(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(o,{...t})}):o(t)}export{d as default,s as frontmatter}; diff --git a/dojo-book/docs/dist/assets/style-UeJaGVQg.css b/dojo-book/docs/dist/assets/style-UeJaGVQg.css new file mode 100644 index 00000000..92d038ba --- /dev/null +++ b/dojo-book/docs/dist/assets/style-UeJaGVQg.css @@ -0,0 +1 @@ +@layer vocs_preflight;:root{--vocs-color_white: rgba(255 255 255 / 100%);--vocs-color_black: rgba(0 0 0 / 100%);--vocs-color_background: rgba(255 255 255 / 100%);--vocs-color_background2: #f9f9f9;--vocs-color_background3: #f6f6f6;--vocs-color_background4: #f0f0f0;--vocs-color_background5: #e8e8e8;--vocs-color_backgroundAccent: #5b5bd6;--vocs-color_backgroundAccentHover: #5151cd;--vocs-color_backgroundAccentText: rgba(255 255 255 / 100%);--vocs-color_backgroundBlueTint: #008cff0b;--vocs-color_backgroundDark: #f9f9f9;--vocs-color_backgroundGreenTint: #00a32f0b;--vocs-color_backgroundGreenTint2: #00a43319;--vocs-color_backgroundIrisTint: #0000ff07;--vocs-color_backgroundRedTint: #ff000008;--vocs-color_backgroundRedTint2: #f3000d14;--vocs-color_backgroundYellowTint: #f4dd0016;--vocs-color_border: #ececec;--vocs-color_border2: #cecece;--vocs-color_borderAccent: #5753c6;--vocs-color_borderBlue: #009eff2a;--vocs-color_borderGreen: #019c393b;--vocs-color_borderIris: #dadcff;--vocs-color_borderRed: #ff000824;--vocs-color_borderYellow: #ffd5008f;--vocs-color_heading: #202020;--vocs-color_inverted: rgba(0 0 0 / 100%);--vocs-color_shadow: #0000000f;--vocs-color_shadow2: #00000006;--vocs-color_text: #4c4c4c;--vocs-color_text2: #646464;--vocs-color_text3: #838383;--vocs-color_text4: #bbbbbb;--vocs-color_textAccent: #5753c6;--vocs-color_textAccentHover: #272962;--vocs-color_textBlue: #0d74ce;--vocs-color_textBlueHover: #113264;--vocs-color_textGreen: #218358;--vocs-color_textGreenHover: #193b2d;--vocs-color_textIris: #5753c6;--vocs-color_textIrisHover: #272962;--vocs-color_textRed: #ce2c31;--vocs-color_textRedHover: #641723;--vocs-color_textYellow: #9e6c00;--vocs-color_textYellowHover: #473b1f;--vocs-color_title: #202020}:root.dark{--vocs-color_white: rgba(255 255 255 / 100%);--vocs-color_black: rgba(0 0 0 / 100%);--vocs-color_background: #232225;--vocs-color_background2: #2b292d;--vocs-color_background3: #2e2c31;--vocs-color_background4: #323035;--vocs-color_background5: #3c393f;--vocs-color_backgroundAccent: #5b5bd6;--vocs-color_backgroundAccentHover: #5753c6;--vocs-color_backgroundAccentText: rgba(255 255 255 / 100%);--vocs-color_backgroundBlueTint: #008ff519;--vocs-color_backgroundDark: #1e1d1f;--vocs-color_backgroundGreenTint: #00a43319;--vocs-color_backgroundGreenTint2: #00a83829;--vocs-color_backgroundIrisTint: #000bff19;--vocs-color_backgroundRedTint: #f3000d14;--vocs-color_backgroundRedTint2: #ff000824;--vocs-color_backgroundYellowTint: #f4dd0016;--vocs-color_border: #3c393f;--vocs-color_border2: #6f6d78;--vocs-color_borderAccent: #6e6ade;--vocs-color_borderBlue: #009eff2a;--vocs-color_borderGreen: #019c393b;--vocs-color_borderIris: #303374;--vocs-color_borderRed: #ff000824;--vocs-color_borderYellow: #f4dd0016;--vocs-color_heading: #e9e9ea;--vocs-color_inverted: rgba(255 255 255 / 100%);--vocs-color_shadow: #00000000;--vocs-color_shadow2: rgba(0, 0, 0, .05);--vocs-color_text: #cfcfcf;--vocs-color_text2: #bdbdbe;--vocs-color_text3: #a7a7a8;--vocs-color_text4: #656567;--vocs-color_textAccent: #b1a9ff;--vocs-color_textAccentHover: #6e6ade;--vocs-color_textBlue: #70b8ff;--vocs-color_textBlueHover: #3b9eff;--vocs-color_textGreen: #3dd68c;--vocs-color_textGreenHover: #33b074;--vocs-color_textIris: #b1a9ff;--vocs-color_textIrisHover: #6e6ade;--vocs-color_textRed: #ff9592;--vocs-color_textRedHover: #ec5d5e;--vocs-color_textYellow: #f5e147;--vocs-color_textYellowHover: #e2a336;--vocs-color_title: rgba(255 255 255 / 100%)}:root{--vocs-color_blockquoteBorder: var(--vocs-color_border);--vocs-color_blockquoteText: var(--vocs-color_text3);--vocs-color_dangerBackground: var(--vocs-color_backgroundRedTint);--vocs-color_dangerBorder: var(--vocs-color_borderRed);--vocs-color_dangerText: var(--vocs-color_textRed);--vocs-color_dangerTextHover: var(--vocs-color_textRedHover);--vocs-color_infoBackground: var(--vocs-color_backgroundBlueTint);--vocs-color_infoBorder: var(--vocs-color_borderBlue);--vocs-color_infoText: var(--vocs-color_textBlue);--vocs-color_infoTextHover: var(--vocs-color_textBlueHover);--vocs-color_noteBackground: var(--vocs-color_background2);--vocs-color_noteBorder: var(--vocs-color_border);--vocs-color_noteText: var(--vocs-color_text2);--vocs-color_successBackground: var(--vocs-color_backgroundGreenTint);--vocs-color_successBorder: var(--vocs-color_borderGreen);--vocs-color_successText: var(--vocs-color_textGreen);--vocs-color_successTextHover: var(--vocs-color_textGreenHover);--vocs-color_tipBackground: var(--vocs-color_backgroundIrisTint);--vocs-color_tipBorder: var(--vocs-color_borderIris);--vocs-color_tipText: var(--vocs-color_textIris);--vocs-color_tipTextHover: var(--vocs-color_textIrisHover);--vocs-color_warningBackground: var(--vocs-color_backgroundYellowTint);--vocs-color_warningBorder: var(--vocs-color_borderYellow);--vocs-color_warningText: var(--vocs-color_textYellow);--vocs-color_warningTextHover: var(--vocs-color_textYellowHover);--vocs-color_codeBlockBackground: var(--vocs-color_background2);--vocs-color_codeCharacterHighlightBackground: var(--vocs-color_background5);--vocs-color_codeHighlightBackground: var(--vocs-color_background4);--vocs-color_codeHighlightBorder: var(--vocs-color_border2);--vocs-color_codeInlineBackground: var(--vocs-color_background4);--vocs-color_codeInlineBorder: var(--vocs-color_border);--vocs-color_codeInlineText: var(--vocs-color_text2);--vocs-color_codeTitleBackground: var(--vocs-color_background4);--vocs-color_lineNumber: var(--vocs-color_text4);--vocs-color_hr: var(--vocs-color_border);--vocs-color_link: var(--vocs-color_textAccent);--vocs-color_linkHover: var(--vocs-color_textAccentHover);--vocs-color_searchHighlightBackground: var(--vocs-color_borderAccent);--vocs-color_searchHighlightText: var(--vocs-color_background);--vocs-color_tableBorder: var(--vocs-color_border);--vocs-color_tableHeaderBackground: var(--vocs-color_background2);--vocs-color_tableHeaderText: var(--vocs-color_text2)}:root{--vocs-borderRadius_0: 0;--vocs-borderRadius_2: 2px;--vocs-borderRadius_3: 3px;--vocs-borderRadius_4: 4px;--vocs-borderRadius_6: 6px;--vocs-borderRadius_8: 8px}:root{--vocs-fontFamily_default: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;--vocs-fontFamily_mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}:root{--vocs-fontSize_9: .5625rem;--vocs-fontSize_11: .6875rem;--vocs-fontSize_12: .75rem;--vocs-fontSize_13: .8125rem;--vocs-fontSize_14: .875rem;--vocs-fontSize_15: .9375rem;--vocs-fontSize_16: 1rem;--vocs-fontSize_18: 1.125rem;--vocs-fontSize_20: 1.25rem;--vocs-fontSize_24: 1.5rem;--vocs-fontSize_32: 2rem;--vocs-fontSize_64: 3rem;--vocs-fontSize_root: 16px;--vocs-fontSize_h1: var(--vocs-fontSize_32);--vocs-fontSize_h2: var(--vocs-fontSize_24);--vocs-fontSize_h3: var(--vocs-fontSize_20);--vocs-fontSize_h4: var(--vocs-fontSize_18);--vocs-fontSize_h5: var(--vocs-fontSize_16);--vocs-fontSize_h6: var(--vocs-fontSize_16);--vocs-fontSize_code: .875em;--vocs-fontSize_codeBlock: var(--vocs-fontSize_14);--vocs-fontSize_lineNumber: var(--vocs-fontSize_15);--vocs-fontSize_subtitle: var(--vocs-fontSize_20);--vocs-fontSize_th: var(--vocs-fontSize_14);--vocs-fontSize_td: var(--vocs-fontSize_14)}:root{--vocs-fontWeight_regular: 300;--vocs-fontWeight_medium: 400;--vocs-fontWeight_semibold: 500}:root{--vocs-lineHeight_code: 1.75em;--vocs-lineHeight_heading: 1.5em;--vocs-lineHeight_listItem: 1.5em;--vocs-lineHeight_outlineItem: 1em;--vocs-lineHeight_paragraph: 1.75em;--vocs-lineHeight_sidebarItem: 1.375em}:root{--vocs-space_0: 0px;--vocs-space_1: 1px;--vocs-space_2: .125rem;--vocs-space_3: .1875rem;--vocs-space_4: .25rem;--vocs-space_6: .375rem;--vocs-space_8: .5rem;--vocs-space_12: .75rem;--vocs-space_14: .875rem;--vocs-space_16: 1rem;--vocs-space_18: 1.125rem;--vocs-space_20: 1.25rem;--vocs-space_22: 1.375rem;--vocs-space_24: 1.5rem;--vocs-space_28: 1.75rem;--vocs-space_32: 2rem;--vocs-space_36: 2.25rem;--vocs-space_40: 2.5rem;--vocs-space_44: 2.75rem;--vocs-space_48: 3rem;--vocs-space_56: 3.5rem;--vocs-space_64: 4rem;--vocs-space_72: 4.5rem;--vocs-space_80: 5rem}:root{--vocs-zIndex_backdrop: 69420;--vocs-zIndex_drawer: 69421;--vocs-zIndex_gutterRight: 11;--vocs-zIndex_gutterLeft: 14;--vocs-zIndex_gutterTop: 13;--vocs-zIndex_gutterTopCurtain: 12;--vocs-zIndex_popover: 69422;--vocs-zIndex_surface: 10}:root{--vocs-content_horizontalPadding: var(--vocs-space_48);--vocs-content_verticalPadding: var(--vocs-space_32);--vocs-content_width: calc(70ch + (var(--vocs-content_horizontalPadding) * 2))}:root{--vocs-outline_width: 280px}:root{--vocs-sidebar_horizontalPadding: var(--vocs-space_24);--vocs-sidebar_verticalPadding: var(--vocs-space_0);--vocs-sidebar_width: 300px}:root{--vocs-topNav_height: 60px;--vocs-topNav_horizontalPadding: var(--vocs-content_horizontalPadding);--vocs-topNav_curtainHeight: 40px}@media screen and (width <= 1080px){:root{--vocs-content_verticalPadding: var(--vocs-space_48);--vocs-content_horizontalPadding: var(--vocs-space_24);--vocs-sidebar_horizontalPadding: var(--vocs-space_16);--vocs-sidebar_verticalPadding: var(--vocs-space_16);--vocs-sidebar_width: 300px;--vocs-topNav_height: 48px}}@media screen and (width <= 720px){:root{--vocs-content_horizontalPadding: var(--vocs-space_16);--vocs-content_verticalPadding: var(--vocs-space_32)}}.vocs_Banner{background-color:var(--vocs_Banner_bannerBackgroundColor, var(--vocs-color_backgroundAccent));border-bottom:1px solid var(--vocs_Banner_bannerBackgroundColor, var(--vocs-color_borderAccent));color:var(--vocs_Banner_bannerTextColor, var(--vocs-color_backgroundAccentText));height:var(--vocs_Banner_bannerHeight, 36px);position:fixed;top:0;width:100%;z-index:var(--vocs-zIndex_gutterTop)}.vocs_Banner_content{font-size:var(--vocs-fontSize_14);overflow-x:scroll;padding-left:var(--vocs-space_8);padding-right:var(--vocs-space_8);margin-right:var(--vocs-space_24);-ms-overflow-style:none;scrollbar-width:none;white-space:pre}.vocs_Banner_content::-webkit-scrollbar{display:none}.vocs_Banner_inner{align-items:center;display:flex;height:100%;justify-content:center;position:relative;width:100%}.vocs_Banner_closeButton{align-items:center;background-color:var(--vocs_Banner_bannerBackgroundColor, var(--vocs-color_backgroundAccent));display:flex;justify-content:center;height:100%;position:absolute;right:0;width:var(--vocs-space_24)}.vocs_Banner_content a{font-weight:400;text-underline-offset:2px;text-decoration:underline}@media screen and (width <= 1080px){.vocs_Banner{position:initial}}.vocs_DocsLayout{--vocs_DocsLayout_leftGutterWidth: max(calc((100vw - var(--vocs-content_width)) / 2), var(--vocs-sidebar_width))}.vocs_DocsLayout_content{background-color:var(--vocs-color_background);margin-left:auto;margin-right:auto;max-width:var(--vocs-content_width);min-height:100vh}.vocs_DocsLayout_content_withSidebar{margin-left:var(--vocs_DocsLayout_leftGutterWidth);margin-right:unset}.vocs_DocsLayout_gutterLeft{background-color:var(--vocs-color_backgroundDark);justify-content:flex-end;display:flex;height:100vh;position:fixed;top:var(--vocs_Banner_bannerHeight, 0px);width:var(--vocs_DocsLayout_leftGutterWidth);z-index:var(--vocs-zIndex_gutterLeft)}.vocs_DocsLayout_gutterTop{align-items:center;background-color:color-mix(in srgb,var(--vocs-color_background) 98%,transparent);height:var(--vocs-topNav_height);width:100vw;z-index:var(--vocs-zIndex_gutterTop)}.vocs_DocsLayout_gutterTopCurtain{display:flex;height:var(--vocs-topNav_curtainHeight);width:100vw;z-index:var(--vocs-zIndex_gutterTopCurtain)}.vocs_DocsLayout_gutterTopCurtain_hidden{background:unset;display:none}.vocs_DocsLayout_gutterRight{display:flex;height:100vh;overflow-y:auto;padding:calc(var(--vocs-content_verticalPadding) + var(--vocs-topNav_height) + var(--vocs-space_8)) var(--vocs-space_24) 0 0;position:fixed;top:var(--vocs_Banner_bannerHeight, 0px);right:0;width:calc((100vw - var(--vocs-content_width)) / 2);z-index:var(--vocs-zIndex_gutterRight)}.vocs_DocsLayout_gutterRight::-webkit-scrollbar{display:none}.vocs_DocsLayout_gutterRight_withSidebar{width:calc(100vw - var(--vocs-content_width) - var(--vocs_DocsLayout_leftGutterWidth))}.vocs_DocsLayout_outlinePopover{display:none;overflow-y:auto;height:calc(100vh - var(--vocs-topNav_height) - var(--vocs-topNav_curtainHeight))}.vocs_DocsLayout_sidebar{padding:var(--vocs-space_0) var(--vocs-sidebar_horizontalPadding) var(--vocs-space_24) var(--vocs-sidebar_horizontalPadding)}.vocs_DocsLayout_sidebarDrawer{display:none}@media screen and (width <= 720px){.vocs_DocsLayout_content{overflow-x:hidden}}@media screen and (width > 1080px){.vocs_DocsLayout_content_withTopNav{padding-top:calc(var(--vocs-topNav_height) + var(--vocs_Banner_bannerHeight, 0px))}.vocs_DocsLayout_gutterTop{padding-left:calc(var(--vocs_DocsLayout_leftGutterWidth) - var(--vocs-sidebar_width));padding-right:calc(var(--vocs_DocsLayout_leftGutterWidth) - var(--vocs-sidebar_width));position:fixed;top:var(--vocs_Banner_bannerHeight, 0px)}.vocs_DocsLayout_gutterTop_offsetLeftGutter{padding-left:var(--vocs_DocsLayout_leftGutterWidth)}.vocs_DocsLayout_gutterTopCurtain{position:fixed;top:calc(var(--vocs-topNav_height) + var(--vocs_Banner_bannerHeight, 0px))}.vocs_DocsLayout_gutterTopCurtain_withSidebar{margin-left:var(--vocs_DocsLayout_leftGutterWidth)}}@media screen and (width <= 1080px){.vocs_DocsLayout_content{margin-left:auto;margin-right:auto}.vocs_DocsLayout_gutterLeft{display:none}.vocs_DocsLayout_gutterTop{position:initial}.vocs_DocsLayout_gutterTop_sticky,.vocs_DocsLayout_gutterTopCurtain{position:sticky;top:0}.vocs_DocsLayout_outlinePopover,.vocs_DocsLayout_sidebarDrawer{display:block}}@media screen and (width <= 1280px){.vocs_DocsLayout_gutterRight{display:none}}@layer vocs_reset_reset;html,body,.vocs_DocsLayout{font-family:var(--vocs-fontFamily_default);font-feature-settings:"rlig" 1,"calt" 1;font-size:var(--vocs-fontSize_root)}button,select{text-transform:none}button,select{-webkit-appearance:button;-moz-appearance:button;appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{outline:auto}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;-moz-appearance:button;appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1}input::placeholder,textarea::placeholder{opacity:1}button,[role=button]{cursor:pointer}:disabled{overflow:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}@layer vocs_reset_reset{*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid}*:focus-visible{outline:2px solid var(--vocs-color_borderAccent);outline-offset:2px;outline-style:dashed}html,body{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:inherit;margin:0;padding:0;border:0;text-rendering:optimizeLegibility}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit;text-wrap:balance}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--vocs-fontFamily_mono);font-size:var(--vocs-fontSize_root)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-color:inherit;border-collapse:collapse;text-indent:0}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}}.vocs_Tabs{background-color:var(--vocs-color_codeBlockBackground);border:1px solid var(--vocs-color_codeInlineBorder);border-radius:var(--vocs-borderRadius_4)}.vocs_Tabs_list{background-color:var(--vocs-color_codeTitleBackground);border-bottom:1px solid var(--vocs-color_border);border-top-left-radius:var(--vocs-borderRadius_4);border-top-right-radius:var(--vocs-borderRadius_4);display:flex;padding:var(--vocs-space_0) var(--vocs-space_14)}.vocs_Tabs_trigger{border-bottom:2px solid transparent;color:var(--vocs-color_text3);font-size:var(--vocs-fontSize_14);font-weight:var(--vocs-fontWeight_medium);padding:var(--vocs-space_8) var(--vocs-space_8) var(--vocs-space_6) var(--vocs-space_8);transition:color .1s}.vocs_Tabs_trigger:hover{color:var(--vocs-color_text)}.vocs_Tabs_trigger[data-state=active]{border-bottom:2px solid var(--vocs-color_borderAccent);color:var(--vocs-color_text)}.vocs_Tabs_content{background-color:var(--vocs-color_codeBlockBackground)}.vocs_Tabs_content:not([data-pretty-code=true]){padding:var(--vocs-space_20) var(--vocs-space_22)}.vocs_Tabs [data-rehype-pretty-code-figure],.vocs_Tabs pre{margin-bottom:var(--vocs-space_0)}@media screen and (width <= 720px){.vocs_Tabs_list{border-radius:0;padding:var(--vocs-space_0) var(--vocs-space_8)}.vocs_Tabs_content:not([data-pretty-code=true]){padding:var(--vocs-space_20) var(--vocs-space_16)}.vocs_Tabs pre{margin:unset}}.vocs_CodeTitle{align-items:center;background-color:var(--vocs-color_codeTitleBackground);border-bottom:1px solid var(--vocs-color_border);color:var(--vocs-color_text3);display:flex;font-size:var(--vocs-fontSize_14);font-weight:var(--vocs-fontWeight_medium);gap:var(--vocs-space_6);padding:var(--vocs-space_8) var(--vocs-space_24)}@media screen and (width <= 720px){.vocs_CodeTitle{border-radius:0;padding-left:var(--vocs-space_16);padding-right:var(--vocs-space_16)}}.vocs_Header{border-bottom:1px solid var(--vocs-color_border)}.vocs_Header:not(:last-child){margin-bottom:var(--vocs-space_28);padding-bottom:var(--vocs-space_28)}[data-layout=landing] .vocs_Header{padding-bottom:var(--vocs-space_16)}[data-layout=landing] .vocs_Header:not(:first-child){padding-top:var(--vocs-space_36)}.vocs_H2{font-size:var(--vocs-fontSize_h2);letter-spacing:-.02em}.vocs_H2.vocs_H2:not(:last-child){margin-bottom:var(--vocs-space_24)}:not(.vocs_Header)+.vocs_H2:not(:only-child){border-top:1px solid var(--vocs-color_border);margin-top:var(--vocs-space_56);padding-top:var(--vocs-space_24)}[data-layout=landing] .vocs_H2.vocs_H2{border-top:none;margin-top:var(--vocs-space_24);padding-top:0}.vocs_H3{font-size:var(--vocs-fontSize_h3)}.vocs_H3:not(:first-child){margin-top:var(--vocs-space_18);padding-top:var(--vocs-space_18)}.vocs_H3.vocs_H3:not(:last-child){margin-bottom:var(--vocs-space_24)}.vocs_H2+.vocs_H3{padding-top:var(--vocs-space_0)}.vocs_H4{font-size:var(--vocs-fontSize_h4)}.vocs_H4:not(:first-child){margin-top:var(--vocs-space_18);padding-top:var(--vocs-space_12)}.vocs_H4.vocs_H4:not(:last-child){margin-bottom:var(--vocs-space_24)}.vocs_H3+.vocs_H4{padding-top:var(--vocs-space_0)}.vocs_H5{font-size:var(--vocs-fontSize_h5)}.vocs_H5:not(:first-child){margin-top:var(--vocs-space_16)}.vocs_H5.vocs_H5:not(:last-child){margin-bottom:var(--vocs-space_24)}.vocs_H4+.vocs_H5{padding-top:var(--vocs-space_0)}.vocs_H6{font-size:var(--vocs-fontSize_h6)}.vocs_H6:not(:first-child){margin-top:var(--vocs-space_16)}.vocs_H6.vocs_H6:not(:last-child){margin-bottom:var(--vocs-space_24)}.vocs_H5+.vocs_H6{padding-top:var(--vocs-space_0)}.vocs_Pre_wrapper{position:relative}.vocs_Step:not(:last-child){margin-bottom:var(--vocs-space_24)}.vocs_Step_title{margin-bottom:var(--vocs-space_8);position:relative}.vocs_Step_title:before{content:counter(step);align-items:center;background-color:var(--vocs-color_background5);border-radius:100%;border:.5em solid var(--vocs-color_background);box-sizing:content-box;color:var(--vocs-color_text2);counter-increment:step;display:flex;font-size:.625em;font-weight:var(--vocs-fontWeight_regular);height:2em;justify-content:center;left:calc(-25.125px - 1.45em);position:absolute;top:-.25em;width:2em}.vocs_H2+.vocs_Step_content,.vocs_H3+.vocs_Step_content,.vocs_H4+.vocs_Step_content,.vocs_H5+.vocs_Step_content,.vocs_H6+.vocs_Step_content{margin-top:calc(var(--vocs-space_8) * -1)}.vocs_Step_content>*:not(:last-child){margin-bottom:var(--vocs-space_16)}.vocs_Step_content>*:last-child{margin-bottom:var(--vocs-space_0)}@media screen and (width <= 720px){.vocs_Step_content [data-rehype-pretty-code-figure],.vocs_Step_content .vocs_Tabs{border-top:6px solid var(--vocs-color_background);border-bottom:6px solid var(--vocs-color_background);margin-left:calc(-1 * var(--vocs-space_44) - 2px)}.vocs_Step_content .vocs_Tabs{margin-left:calc(-1 * var(--vocs-space_44) - 2px);margin-right:calc(-1 * var(--vocs-space_16))}.vocs_Step_content .vocs_Tabs [data-rehype-pretty-code-figure]{border-top:none}.vocs_Step_content .vocs_CodeTitle,.vocs_Step_content .vocs_Tabs_list{border-top:1px solid var(--vocs-color_border)}.vocs_Step_content .vocs_Pre{border-bottom:1px solid var(--vocs-color_border)}}.vocs_Callout{border-radius:var(--vocs-borderRadius_4);font-size:var(--vocs-fontSize_14);padding:var(--vocs-space_16) var(--vocs-space_20);margin-bottom:var(--vocs-space_16)}.vocs_Callout_note{background-color:var(--vocs-color_noteBackground);border:1px solid var(--vocs-color_noteBorder);color:var(--vocs-color_noteText)}.vocs_Callout_info{background-color:var(--vocs-color_infoBackground);border:1px solid var(--vocs-color_infoBorder);color:var(--vocs-color_infoText)}.vocs_Callout_warning{background-color:var(--vocs-color_warningBackground);border:1px solid var(--vocs-color_warningBorder);color:var(--vocs-color_warningText)}.vocs_Callout_danger{background-color:var(--vocs-color_dangerBackground);border:1px solid var(--vocs-color_dangerBorder);color:var(--vocs-color_dangerText)}.vocs_Callout_tip{background-color:var(--vocs-color_tipBackground);border:1px solid var(--vocs-color_tipBorder);color:var(--vocs-color_tipText)}.vocs_Callout_success{background-color:var(--vocs-color_successBackground);border:1px solid var(--vocs-color_successBorder);color:var(--vocs-color_successText)}@media screen and (width <= 720px){:not(.vocs_Step_content)>.vocs_Callout{border-radius:0;border-left-width:0;border-right-width:0;margin-left:calc(-1 * var(--vocs-space_16));margin-right:calc(-1 * var(--vocs-space_16))}}.vocs_Content{background-color:var(--vocs-color_background);max-width:var(--vocs-content_width);padding:var(--vocs-content_verticalPadding) var(--vocs-content_horizontalPadding);width:100%}.vocs_Callout>*+.vocs_Details{margin-top:-8px}@layer vocs_global_global;:root.dark{color-scheme:dark}:root:not(.dark) [data-rehype-pretty-code-figure] span:not([data-line]){color:var(--shiki-light);background-color:var(--shiki-light-bg)}:root.dark [data-rehype-pretty-code-figure] span:not([data-line]){color:var(--shiki-dark);background-color:var(--shiki-dark-bg)}.vocs_Content>*:not(:last-child),.vocs_Details>*:not(:last-child){margin-bottom:var(--vocs-space_24)}.vocs_Callout>*:not(:last-child),.vocs_Callout>.vocs_Details>*:not(:last-child){margin-bottom:var(--vocs-space_16)}.vocs_Content>*:last-child,.vocs_Callout>*:last-child,.vocs_Details>*:last-child{margin-bottom:var(--vocs-space_0)}#app[aria-hidden=true]{background:var(--vocs-color_background)}@layer vocs_global_global{:root{background-color:var(--vocs-color_background);color:var(--vocs-color_text);line-height:var(--vocs-lineHeight_paragraph);font-size:var(--vocs-fontSize_root);font-weight:var(--vocs-fontWeight_regular)}}@media screen and (width <= 720px){:root{background-color:var(--vocs-color_backgroundDark)}}:root{--vocs-twoslash_borderColor: var(--vocs-color_border2);--vocs-twoslash_underlineColor: currentColor;--vocs-twoslash_popupBackground: var(--vocs-color_background2);--vocs-twoslash_popupShadow: rgba(0, 0, 0, .08) 0px 1px 4px;--vocs-twoslash_matchedColor: inherit;--vocs-twoslash_unmatchedColor: #888;--vocs-twoslash_cursorColor: #8888;--vocs-twoslash_errorColor: var(--vocs-color_textRed);--vocs-twoslash_errorBackground: var(--vocs-color_backgroundRedTint2);--vocs-twoslash_highlightedBackground: var(--vocs-color_background);--vocs-twoslash_highlightedBorder: var(--vocs-color_background);--vocs-twoslash_tagColor: var(--vocs-color_textBlue);--vocs-twoslash_tagBackground: var(--vocs-color_backgroundBlueTint);--vocs-twoslash_tagWarnColor: var(--vocs-color_textYellow);--vocs-twoslash_tagWarnBackground: var(--vocs-color_backgroundYellowTint);--vocs-twoslash_tagAnnotateColor: var(--vocs-color_textGreen);--vocs-twoslash_tagAnnotateBackground: var(--vocs-color_backgroundGreenTint2)}:root.dark{--vocs-twoslash_borderColor: var(--vocs-color_border2);--vocs-twoslash_underlineColor: currentColor;--vocs-twoslash_popupBackground: var(--vocs-color_background5);--vocs-twoslash_popupShadow: rgba(0, 0, 0, .08) 0px 1px 4px;--vocs-twoslash_matchedColor: inherit;--vocs-twoslash_unmatchedColor: #888;--vocs-twoslash_cursorColor: #8888;--vocs-twoslash_errorColor: var(--vocs-color_textRed);--vocs-twoslash_errorBackground: var(--vocs-color_backgroundRedTint2);--vocs-twoslash_highlightedBackground: var(--vocs-color_background);--vocs-twoslash_highlightedBorder: var(--vocs-color_background);--vocs-twoslash_tagColor: var(--vocs-color_textBlue);--vocs-twoslash_tagBackground: var(--vocs-color_backgroundBlueTint);--vocs-twoslash_tagWarnColor: var(--vocs-color_textYellow);--vocs-twoslash_tagWarnBackground: var(--vocs-color_backgroundYellowTint);--vocs-twoslash_tagAnnotateColor: var(--vocs-color_textGreen);--vocs-twoslash_tagAnnotateBackground: var(--vocs-color_backgroundGreenTint2)}:root .twoslash-popup-info-hover,:root .twoslash-popup-info{--shiki-light-bg: var(--vocs-color_background2)}:root .twoslash-popup-info{width:-moz-max-content;width:max-content}:root.dark .twoslash-popup-info,:root.dark .twoslash-popup-info-hover{--shiki-dark-bg: var(--vocs-color_background5)}.twoslash-query-presisted>.twoslash-popup-info,.twoslash-query-presisted>.twoslash-popup-info-hover{z-index:1}:not(.twoslash-query-presisted)>.twoslash-popup-info,:not(.twoslash-query-presisted)>.twoslash-popup-info-hover{z-index:2}.twoslash:hover .twoslash-hover{border-color:var(--vocs-twoslash_underlineColor)}.twoslash .twoslash-hover{border-bottom:1px dotted transparent;transition-timing-function:ease;transition:border-color .3s}.twoslash-query-presisted{position:relative}.twoslash .twoslash-popup-info{position:absolute;top:0;left:0;opacity:0;display:inline-block;transform:translateY(1.1em);background:var(--vocs-twoslash_popupBackground);border:1px solid var(--vocs-twoslash_borderColor);transition:opacity .3s;border-radius:4px;max-width:540px;padding:4px 6px;pointer-events:none;text-align:left;z-index:20;white-space:pre-wrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-shadow:var(--vocs-twoslash_popupShadow)}.twoslash .twoslash-popup-info-hover{background:var(--vocs-twoslash_popupBackground);border:1px solid var(--vocs-twoslash_borderColor);border-radius:4px;box-shadow:var(--vocs-twoslash_popupShadow);display:inline-block;max-width:500px;padding:4px 0;pointer-events:none;position:fixed;opacity:0;transition:opacity .3s;white-space:pre-wrap;-webkit-user-select:none;-moz-user-select:none;user-select:none}.twoslash .twoslash-popup-scroll-container{max-height:300px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.twoslash .twoslash-popup-scroll-container::-webkit-scrollbar{display:none}.twoslash .twoslash-popup-jsdoc{border-top:1px solid var(--vocs-color_border2);color:var(--vocs-color_text);font-family:sans-serif;font-weight:500;margin-top:4px;padding:4px 10px 0}.twoslash-tag-line+.twoslash-tag-line{margin-top:-.2em}.twoslash-query-presisted .twoslash-popup-info{z-index:9;transform:translateY(1.5em)}.twoslash-hover:hover .twoslash-popup-info,.twoslash-query-presisted .twoslash-popup-info{opacity:1;pointer-events:auto}.twoslash-popup-info-hover[data-show]{opacity:1;pointer-events:auto;z-index:20}.twoslash-popup-info:hover,.twoslash-popup-info-hover:hover{-webkit-user-select:auto;-moz-user-select:auto;user-select:auto}.twoslash-popup-arrow{position:absolute;top:-4px;left:1em;border-top:1px solid var(--vocs-twoslash_borderColor);border-right:1px solid var(--vocs-twoslash_borderColor);background:var(--vocs-twoslash_popupBackground);transform:rotate(-45deg);width:6px;height:6px;pointer-events:none}.twoslash-error-line{position:relative;background-color:var(--vocs-twoslash_errorBackground);border-left:2px solid var(--vocs-twoslash_errorColor);color:var(--vocs-twoslash_errorColor);margin:.2em 0}.twoslash-error{background:url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c94824'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") repeat-x bottom left;padding-bottom:2px}.twoslash-completion-cursor{position:relative}.twoslash-completion-cursor .twoslash-completion-list{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:absolute;top:0;left:0;transform:translateY(1.2em);margin:3px 0 0 -1px;z-index:8;box-shadow:var(--vocs-twoslash_popupShadow);background:var(--vocs-twoslash_popupBackground);border:1px solid var(--vocs-twoslash_borderColor)}.twoslash-completion-list{border-radius:4px;font-size:.8rem;padding:4px;display:flex;flex-direction:column;gap:4px;width:240px}.twoslash-completion-list:hover{-webkit-user-select:auto;-moz-user-select:auto;user-select:auto}.twoslash-completion-list:before{content:" ";background-color:var(--vocs-twoslash_cursorColor);width:2px;position:absolute;top:-1.6em;height:1.4em;left:-1px}.twoslash-completion-list .twoslash-completion-list-item{overflow:hidden;display:flex;align-items:center;gap:.5em;line-height:1em}.twoslash-completion-list .twoslash-completion-list-item span.twoslash-completions-unmatched.twoslash-completions-unmatched{color:var(--vocs-twoslash_unmatchedColor)}.twoslash-completion-list .deprecated{text-decoration:line-through;opacity:.5}.twoslash-completion-list .twoslash-completion-list-item span.twoslash-completions-matched.twoslash-completions-unmatched{color:var(--vocs-twoslash_matchedColor)}.twoslash-tag-line{position:relative;background-color:var(--vocs-twoslash_tagBackground);border-left:2px solid var(--vocs-twoslash_tagColor);color:var(--vocs-twoslash_tagColor);margin:.2em 0;display:flex;align-items:center;gap:.3em}.twoslash-tag-line .twoslash-tag-icon{width:1.1em;color:inherit}.twoslash-tag-line.twoslash-tag-error-line{background-color:var(--vocs-twoslash_errorBackground);border-left:2px solid var(--vocs-twoslash_errorColor);color:var(--vocs-twoslash_errorColor)}.twoslash-tag-line.twoslash-tag-warn-line{background-color:var(--vocs-twoslash_tagWarnBackground);border-left:2px solid var(--vocs-twoslash_tagWarnColor);color:var(--vocs-twoslash_tagWarnColor)}.twoslash-tag-line.twoslash-tag-annotate-line{background-color:var(--vocs-twoslash_tagAnnotateBackground);border-left:2px solid var(--vocs-twoslash_tagAnnotateColor);color:var(--vocs-twoslash_tagAnnotateColor)}.twoslash-highlighted{border-radius:var(--vocs-borderRadius_2);background-color:var(--vocs-color_codeCharacterHighlightBackground)!important;box-shadow:0 0 0 4px var(--vocs-color_codeCharacterHighlightBackground)}@media (prefers-reduced-motion: reduce){.twoslash *{transition:none!important}}.vocs_ExternalLink:after{content:"";background-color:currentColor;color:var(--vocs_ExternalLink_arrowColor);display:inline-block;height:.5em;margin-left:.325em;margin-right:.25em;width:.5em;-webkit-mask:url(/.vocs/icons/arrow-diagonal.svg) no-repeat center / contain;mask:url(/.vocs/icons/arrow-diagonal.svg) no-repeat center / contain}.vocs_Link_accent_underlined{color:var(--vocs-color_link);font-weight:var(--vocs-fontWeight_medium);text-underline-offset:var(--vocs-space_2);text-decoration:underline;transition:color .1s}.vocs_Link_accent_underlined:hover{color:var(--vocs-color_linkHover)}.vocs_Link_styleless{--vocs_ExternalLink_arrowColor: var(--vocs-color_text3)}.vocs_NotFound{align-items:center;display:flex;flex-direction:column;max-width:400px;margin:0 auto;padding-top:var(--vocs-space_64)}.vocs_NotFound_divider{border-color:var(--vocs-color_border);width:50%}.vocs_H1{font-size:var(--vocs-fontSize_h1);letter-spacing:-.02em}.vocs_Heading{align-items:center;color:var(--vocs-color_heading);font-weight:var(--vocs-fontWeight_semibold);gap:.25em;line-height:var(--vocs-lineHeight_heading);position:relative}.vocs_Heading_slugTarget{position:absolute;top:0;visibility:hidden}@media screen and (width > 1080px){.vocs_Heading_slugTarget{top:calc(-1 * (var(--vocs-topNav_height)))}.vocs_Header .vocs_Heading_slugTarget,.vocs_Step_title .vocs_Heading_slugTarget,.vocs_Header+.vocs_Heading .vocs_Heading_slugTarget{top:calc(-1 * (var(--vocs-topNav_height) + var(--vocs-space_24)))}}@media screen and (width <= 1080px){.vocs_Heading_slugTarget{top:calc(-1 * var(--vocs-topNav_curtainHeight))}.vocs_Header .vocs_Heading_slugTarget,.vocs_Header+.vocs_Heading .vocs_Heading_slugTarget{top:calc(-1 * calc(var(--vocs-topNav_curtainHeight) + var(--vocs-space_24)))}}.vocs_Blockquote{border-left:2px solid var(--vocs-color_blockquoteBorder);padding-left:var(--vocs-space_16);margin-bottom:var(--vocs-space_16)}.vocs_H2+.vocs_List,.vocs_H3+.vocs_List,.vocs_H4+.vocs_List,.vocs_H5+.vocs_List,.vocs_H6+.vocs_List{margin-top:calc(var(--vocs-space_8) * -1)}.vocs_Paragraph+.vocs_List{margin-top:calc(-1 * var(--vocs-space_8))}.vocs_List_ordered{list-style:decimal;padding-left:var(--vocs-space_20);margin-bottom:var(--vocs-space_16)}.vocs_List_ordered .vocs_List_ordered{list-style:lower-alpha}.vocs_List_ordered .vocs_List_ordered .vocs_List_ordered{list-style:lower-roman}.vocs_List_unordered{list-style:disc;padding-left:var(--vocs-space_24);margin-bottom:var(--vocs-space_16)}.vocs_List_unordered .vocs_List_unordered{list-style:circle}.vocs_List_ordered .vocs_List_ordered,.vocs_List_unordered .vocs_List_unordered,.vocs_List_ordered .vocs_List_unordered,.vocs_List_unordered .vocs_List_ordered{margin-bottom:var(--vocs-space_0);padding-top:var(--vocs-space_8);padding-left:var(--vocs-space_16);padding-bottom:var(--vocs-space_0)}.vocs_List_unordered.contains-task-list{list-style:none;padding-left:var(--vocs-space_12)}.vocs_Paragraph{line-height:var(--vocs-lineHeight_paragraph)}.vocs_Blockquote>.vocs_Paragraph{color:var(--vocs-color_blockquoteText);margin-bottom:var(--vocs-space_8)}.vocs_H2+.vocs_Paragraph,.vocs_H3+.vocs_Paragraph,.vocs_H4+.vocs_Paragraph,.vocs_H5+.vocs_Paragraph,.vocs_H6+.vocs_Paragraph,.vocs_List+.vocs_Paragraph{margin-top:calc(var(--vocs-space_8) * -1)}.vocs_Paragraph+.vocs_Paragraph{margin-top:calc(-1 * var(--vocs-space_8))}:root:not(.dark) .vocs_utils_visibleDark{display:none}:root.dark .vocs_utils_visibleLight{display:none}.vocs_utils_visuallyHidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.vocs_DesktopSearch_search{align-items:center;background-color:var(--vocs-color_backgroundDark);border:1px solid var(--vocs-color_backgroundDark);border-radius:var(--vocs-borderRadius_8);color:var(--vocs-color_text2);display:flex;font-size:var(--vocs-fontSize_14);font-weight:var(--vocs-fontWeight_medium);gap:var(--vocs-space_6);height:var(--vocs-space_40);max-width:15.5rem;padding-left:var(--vocs-space_12);padding-right:var(--vocs-space_12);position:relative;width:100%;transition:color .1s,border-color .1s}.vocs_DesktopSearch_search:hover{color:var(--vocs-color_text);border-color:var(--vocs-color_text3)}.vocs_DesktopSearch_searchCommand{align-items:center;border:1.5px solid var(--vocs-color_text3);border-radius:var(--vocs-borderRadius_4);color:var(--vocs-color_text3);display:flex;height:var(--vocs-space_12);justify-content:center;margin-left:auto;margin-top:var(--vocs-space_1);padding:var(--vocs-space_1);width:var(--vocs-space_12)}.vocs_Kbd{color:var(--vocs-color_text2);display:inline-block;border-radius:var(--vocs-borderRadius_3);font-size:var(--vocs-fontSize_11);font-family:var(--vocs-fontFamily_default);font-feature-settings:cv08;line-height:105%;min-width:20px;padding:var(--vocs-space_3);padding-left:var(--vocs-space_4);padding-right:var(--vocs-space_4);padding-top:var(--vocs-space_3);text-align:center;text-transform:capitalize;vertical-align:baseline;border:.5px solid var(--vocs-color_border);background-color:var(--vocs-color_background3);box-shadow:var(--vocs-color_shadow2) 0 2px 0 0}.vocs_KeyboardShortcut{align-items:center;display:inline-flex;gap:var(--vocs-space_6);font-size:var(--vocs-fontSize_12)}.vocs_KeyboardShortcut_kbdGroup{align-items:center;display:inline-flex;gap:var(--vocs-space_3)}@media screen and (width <= 720px){.vocs_KeyboardShortcut{display:none}}@keyframes vocs_SearchDialog_fadeIn{0%{opacity:0}to{opacity:1}}@keyframes vocs_SearchDialog_fadeAndSlideIn{0%{opacity:0;transform:translate(-50%,-5%) scale(.96)}to{opacity:1;transform:translate(-50%) scale(1)}}.vocs_SearchDialog{animation:vocs_SearchDialog_fadeAndSlideIn .1s ease-in-out;background:var(--vocs-color_background);border-radius:var(--vocs-borderRadius_6);display:flex;flex-direction:column;gap:var(--vocs-space_8);height:-moz-min-content;height:min-content;left:50%;margin:64px auto;max-height:min(100vh - 128px,900px);padding:var(--vocs-space_12);padding-bottom:var(--vocs-space_8);position:fixed;top:0;transform:translate(-50%);width:min(100vw - 60px,775px);z-index:var(--vocs-zIndex_backdrop)}.vocs_SearchDialog_overlay{animation:vocs_SearchDialog_fadeIn .1s ease-in-out;background:#0009;position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--vocs-zIndex_backdrop)}.vocs_SearchDialog_searchBox{align-items:center;border:1px solid var(--vocs-color_border);border-radius:var(--vocs-borderRadius_4);display:flex;gap:var(--vocs-space_8);padding-left:var(--vocs-space_8);padding-right:var(--vocs-space_8);margin-bottom:var(--vocs-space_8);width:100%}.vocs_SearchDialog_searchBox:focus-within{border-color:var(--vocs-color_borderAccent)}.vocs_SearchDialog_searchInput{background:transparent;display:flex;font-size:var(--vocs-fontSize_16);height:var(--vocs-space_40);width:100%}.vocs_SearchDialog_searchInput:focus{outline:none}.vocs_SearchDialog_searchInput::-moz-placeholder{color:var(--vocs-color_text4)}.vocs_SearchDialog_searchInput::placeholder{color:var(--vocs-color_text4)}.vocs_SearchDialog_searchInputIcon{color:var(--vocs-color_text3)}.vocs_SearchDialog_searchInputIconMobile{display:none}.vocs_SearchDialog_results{display:flex;flex-direction:column;gap:var(--vocs-space_8);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;width:100%}.vocs_SearchDialog_result{border:1.5px solid var(--vocs-color_border);border-radius:var(--vocs-borderRadius_4);width:100%}.vocs_SearchDialog_result:focus-within{border-color:var(--vocs-color_borderAccent)}.vocs_SearchDialog_result>a{display:flex;flex-direction:column;gap:var(--vocs-space_8);min-height:var(--vocs-space_36);outline:none;justify-content:center;padding:var(--vocs-space_12);width:100%}.vocs_SearchDialog_resultSelected{border-color:var(--vocs-color_borderAccent)}.vocs_SearchDialog_resultIcon{color:var(--vocs-color_textAccent);margin-right:1px;width:15px}.vocs_SearchDialog_titles{align-items:center;display:flex;flex-wrap:wrap;font-weight:var(--vocs-fontWeight_medium);gap:var(--vocs-space_4);line-height:22px}.vocs_SearchDialog_title{align-items:center;display:flex;gap:var(--vocs-space_4);white-space:nowrap}.vocs_SearchDialog_titleIcon{color:var(--vocs-color_text);display:inline-block;opacity:.5}.vocs_SearchDialog_resultSelected .vocs_SearchDialog_title,.vocs_SearchDialog_resultSelected .vocs_SearchDialog_titleIcon{color:var(--vocs-color_textAccent)}.vocs_SearchDialog_content{padding:0}.vocs_SearchDialog_excerpt{max-height:8.75rem;overflow:hidden;opacity:.5;position:relative}.vocs_SearchDialog_excerpt:before{content:"";position:absolute;top:-1px;left:0;width:100%;height:8px;background:linear-gradient(var(--vocs-color_background),transparent);z-index:1000}.vocs_SearchDialog_excerpt:after{content:"";position:absolute;bottom:-1px;left:0;width:100%;height:12px;background:linear-gradient(transparent,var(--vocs-color_background));z-index:1000}.vocs_SearchDialog_title mark,.vocs_SearchDialog_excerpt mark{background-color:var(--vocs-color_searchHighlightBackground);color:var(--vocs-color_searchHighlightText);border-radius:var(--vocs-borderRadius_2);padding-bottom:0;padding-left:var(--vocs-space_2);padding-right:var(--vocs-space_2);padding-top:0}.vocs_SearchDialog_resultSelected .vocs_SearchDialog_excerpt{opacity:1}.vocs_SearchDialog_searchShortcuts{align-items:center;color:var(--vocs-color_text2);display:flex;gap:var(--vocs-space_20);font-size:var(--vocs-fontSize_14)}.vocs_SearchDialog_searchShortcutsGroup{align-items:center;display:inline-flex;gap:var(--vocs-space_3);margin-right:var(--vocs-space_6)}@media screen and (width <= 720px){.vocs_SearchDialog{border-radius:0;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));margin:0;max-height:unset;width:100vw}.vocs_SearchDialog_searchInputIconDesktop{display:none}.vocs_SearchDialog_searchInputIconMobile{display:block}.vocs_SearchDialog_excerpt{opacity:1}.vocs_SearchDialog_searchShortcuts{display:none}}.vocs_DesktopTopNav{align-items:center;display:flex;justify-content:space-between;padding:0 var(--vocs-topNav_horizontalPadding);height:var(--vocs-topNav_height)}.vocs_DesktopTopNav_withLogo{padding-left:calc(((100% - var(--vocs-content_width)) / 2) + var(--vocs-topNav_horizontalPadding))}.vocs_DesktopTopNav_button{border-radius:var(--vocs-borderRadius_4);padding:var(--vocs-space_8)}.vocs_DesktopTopNav_content{right:calc(-1 * var(--vocs-space_24))}.vocs_DesktopTopNav_curtain{background:linear-gradient(var(--vocs-color_background),transparent 70%);height:30px;opacity:.98;width:100%}.vocs_DesktopTopNav_divider{background-color:var(--vocs-color_border);height:35%;width:1px}.vocs_DesktopTopNav_group{align-items:center;display:flex}.vocs_DesktopTopNav_icon{color:var(--vocs-color_text2);transition:color .1s}.vocs_DesktopTopNav_button:hover .vocs_DesktopTopNav_icon{color:var(--vocs-color_text)}.vocs_DesktopTopNav_item{align-items:center;display:flex;height:100%;position:relative}.vocs_DesktopTopNav_logo{padding-left:var(--vocs-sidebar_horizontalPadding);padding-right:var(--vocs-sidebar_horizontalPadding);width:var(--vocs-sidebar_width)}.vocs_DesktopTopNav_logoWrapper{display:flex;height:100%;justify-content:flex-end;left:0;position:absolute;width:var(--vocs_DocsLayout_leftGutterWidth)}.vocs_DesktopTopNav_section{align-items:center;display:flex;height:100%;gap:var(--vocs-space_24)}@media screen and (width <= 1080px){.vocs_DesktopTopNav,.vocs_DesktopTopNav_curtain{display:none}}@media screen and (width <= 1280px){.vocs_DesktopTopNav_hideCompact{display:none}}.vocs_Icon{align-items:center;display:flex;height:var(--vocs_Icon_size);width:var(--vocs_Icon_size)}:root:not(.dark) .vocs_Logo_logoDark{display:none}:root.dark .vocs_Logo_logoLight{display:none}.vocs_NavLogo_logoImage{height:50%;width:auto}.vocs_NavLogo_title{font-size:var(--vocs-fontSize_18);font-weight:var(--vocs-fontWeight_semibold);line-height:var(--vocs-lineHeight_heading)}@keyframes vocs_NavigationMenu_fadeIn{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}.vocs_NavigationMenu_list{display:flex;gap:var(--vocs-space_20)}.vocs_NavigationMenu_link{align-items:center;display:flex;font-size:var(--vocs-fontSize_14);font-weight:var(--vocs-fontWeight_medium);height:100%}.vocs_NavigationMenu_link:hover,.vocs_NavigationMenu_link[data-active=true]{color:var(--vocs-color_textAccent)}.vocs_NavigationMenu_trigger:after{content:"";background-color:currentColor;color:var(--vocs-color_text3);display:inline-block;height:.625em;margin-left:.325em;width:.625em;-webkit-mask:url(/.vocs/icons/chevron-down.svg) no-repeat center / contain;mask:url(/.vocs/icons/chevron-down.svg) no-repeat center / contain}.vocs_NavigationMenu_content{background-color:var(--vocs-color_background2);border:1px solid var(--vocs-color_border);border-radius:var(--vocs-borderRadius_4);box-shadow:0 3px 10px var(--vocs-color_shadow);display:flex;flex-direction:column;padding:var(--vocs-space_12) var(--vocs-space_16);position:absolute;top:calc(100% + var(--vocs-space_8));min-width:200px;z-index:var(--vocs-zIndex_popover);animation:vocs_NavigationMenu_fadeIn .5s cubic-bezier(.16,1,.3,1)}.vocs_Footer{--vocs_Footer_iconWidth: 24px;display:flex;flex-direction:column;gap:var(--vocs-space_32);max-width:var(--vocs-content_width);overflow-x:hidden;padding:var(--vocs-space_24) var(--vocs-content_horizontalPadding) var(--vocs-space_48)}.vocs_Footer_editLink{font-size:var(--vocs-fontSize_14);text-decoration:none}.vocs_Footer_navigation{display:flex;justify-content:space-between}.vocs_Footer_navigationIcon{width:var(--vocs_Footer_iconWidth)}.vocs_Footer_navigationIcon_left{display:flex}.vocs_Footer_navigationIcon_right{display:flex;justify-content:flex-end}.vocs_Footer_navigationItem{display:flex;flex-direction:column;gap:var(--vocs-space_4)}.vocs_Footer_navigationItem_right{align-items:flex-end}.vocs_Footer_navigationText{align-items:center;display:flex;font-size:var(--vocs-fontSize_18);font-weight:var(--vocs-fontWeight_medium)}.vocs_Footer_navigationTextInner{overflow:hidden;text-overflow:ellipsis;width:26ch;white-space:pre}@media screen and (width <= 720px){.vocs_Footer_navigationIcon_left,.vocs_Footer_navigationIcon_right{justify-content:center}.vocs_Footer_navigationText{font-size:var(--vocs-fontSize_12)}}@media screen and (width <= 480px){.vocs_Footer_navigationTextInner{width:20ch}}.vocs_MobileSearch_searchButton{align-items:center;display:flex;color:var(--vocs-color_text);height:var(--vocs-space_28);justify-content:center;width:var(--vocs-space_28)}@keyframes vocs_MobileTopNav_fadeIn{0%{opacity:0}to{opacity:1}}.vocs_MobileTopNav{align-items:center;background-color:var(--vocs-color_backgroundDark);border-bottom:1px solid var(--vocs-color_border);display:none;height:100%;justify-content:space-between;padding:var(--vocs-space_0) var(--vocs-content_horizontalPadding);width:100%}.vocs_MobileTopNav_button{border-radius:var(--vocs-borderRadius_4);padding:var(--vocs-space_8)}.vocs_MobileTopNav_content{left:calc(-1 * var(--vocs-space_24))}.vocs_MobileTopNav_curtain{align-items:center;background-color:var(--vocs-color_backgroundDark);border-bottom:1px solid var(--vocs-color_border);display:none;justify-content:space-between;font-size:var(--vocs-fontSize_13);font-weight:var(--vocs-fontWeight_medium);height:100%;padding:var(--vocs-space_0) var(--vocs-content_horizontalPadding);width:100%}.vocs_MobileTopNav_curtainGroup{align-items:center;display:flex;gap:var(--vocs-space_12)}.vocs_MobileTopNav_divider{background-color:var(--vocs-color_border);height:35%;width:1px}.vocs_MobileTopNav_group{align-items:center;display:flex;height:100%}.vocs_MobileTopNav_icon{color:var(--vocs-color_text2);transition:color .1s}.vocs_MobileTopNav_button:hover .vocs_MobileTopNav_icon{color:var(--vocs-color_text)}.vocs_MobileTopNav_item{position:relative}.vocs_MobileTopNav_logo{align-items:center;display:flex;height:var(--vocs-topNav_height)}.vocs_MobileTopNav_logoImage{height:30%}.vocs_MobileTopNav_menuTrigger{align-items:center;display:flex;gap:var(--vocs-space_8)}.vocs_MobileTopNav_menuTitle{max-width:22ch;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:pre}.vocs_MobileTopNav_navigation{margin-left:var(--vocs-space_8)}.vocs_MobileTopNav_navigationContent{display:flex;flex-direction:column;margin-left:var(--vocs-space_8)}.vocs_MobileTopNav_navigationItem{align-items:center;display:flex;justify-content:flex-start;font-size:var(--vocs-fontSize_14);font-weight:var(--vocs-fontWeight_medium);width:100%}.vocs_MobileTopNav_navigationItem:hover,.vocs_MobileTopNav_navigationItem[data-active=true],.vocs_MobileTopNav_navigationItem[data-state=open]{color:var(--vocs-color_textAccent)}.vocs_MobileTopNav_trigger:after{content:"";background-color:currentColor;display:inline-block;height:.625em;margin-left:.325em;width:.625em;-webkit-mask:url(/.vocs/icons/chevron-down.svg) no-repeat center / contain;mask:url(/.vocs/icons/chevron-down.svg) no-repeat center / contain}.vocs_MobileTopNav_trigger[data-state=open]:after{-webkit-mask:url(/.vocs/icons/chevron-up.svg) no-repeat center / contain;mask:url(/.vocs/icons/chevron-up.svg) no-repeat center / contain}.vocs_MobileTopNav_outlineTrigger{animation:vocs_MobileTopNav_fadeIn .5s cubic-bezier(.16,1,.3,1);align-items:center;color:var(--vocs-color_text2);display:flex;gap:var(--vocs-space_6)}.vocs_MobileTopNav_outlineTrigger[data-state=open]{color:var(--vocs-color_textAccent)}.vocs_MobileTopNav_outlinePopover{display:none;overflow-y:scroll;padding:var(--vocs-space_16);max-height:80vh}.vocs_MobileTopNav_section{align-items:center;display:flex;height:100%;gap:var(--vocs-space_16)}.vocs_MobileTopNav_separator{background-color:var(--vocs-color_border);height:1.75em;width:1px}.vocs_MobileTopNav_sidebarPopover{display:none;overflow-y:scroll;padding:0 var(--vocs-sidebar_horizontalPadding);max-height:80vh;width:var(--vocs-sidebar_width)}.vocs_MobileTopNav_title{font-size:var(--vocs-fontSize_18);font-weight:var(--vocs-fontWeight_semibold);line-height:var(--vocs-lineHeight_heading)}.vocs_MobileTopNav_topNavPopover{display:none;overflow-y:scroll;padding:var(--vocs-sidebar_verticalPadding) var(--vocs-sidebar_horizontalPadding);max-height:80vh;width:var(--vocs-sidebar_width)}@media screen and (width <= 1080px){.vocs_MobileTopNav,.vocs_MobileTopNav_curtain{display:flex}.vocs_MobileTopNav_outlinePopover{display:block;max-width:300px}.vocs_MobileTopNav_sidebarPopover{display:block}.vocs_MobileTopNav_topNavPopover{display:flex;flex-direction:column}}@media screen and (width <= 720px){.vocs_MobileTopNav_navigation:not(.vocs_MobileTopNav_navigation_compact){display:none}}@media screen and (width > 720px){.vocs_MobileTopNav_navigation.vocs_MobileTopNav_navigation_compact{display:none}}.vocs_Outline{width:100%}.vocs_Outline_nav{display:flex;flex-direction:column;gap:var(--vocs-space_8)}.vocs_DocsLayout_gutterRight .vocs_Outline_nav{border-left:1px solid var(--vocs-color_border);padding-left:var(--vocs-space_16)}.vocs_Outline_heading{color:var(--vocs-color_title);font-size:var(--vocs-fontSize_13);font-weight:var(--vocs-fontWeight_semibold);line-height:var(--vocs-lineHeight_heading);letter-spacing:.025em}.vocs_Outline_items .vocs_Outline_items{padding-left:var(--vocs-space_12)}.vocs_Outline_item{line-height:var(--vocs-lineHeight_outlineItem);margin-bottom:var(--vocs-space_8);overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.vocs_Outline_link{color:var(--vocs-color_text2);font-weight:var(--vocs-fontWeight_medium);font-size:var(--vocs-fontSize_13);transition:color .1s}.vocs_Outline_link[data-active=true]{color:var(--vocs-color_textAccent)}.vocs_Outline_link[data-active=true]:hover{color:var(--vocs-color_textAccentHover)}.vocs_Outline_link:hover{color:var(--vocs-color_text)}.vocs_Popover{background-color:var(--vocs-color_background2);border:1px solid var(--vocs-color_border);border-radius:var(--vocs-borderRadius_4);margin:0 var(--vocs-space_6);z-index:var(--vocs-zIndex_popover)}.vocs_Sidebar{display:flex;flex-direction:column;font-size:var(--vocs-fontSize_14);overflow-y:auto;width:var(--vocs-sidebar_width)}.vocs_Sidebar_backLink{text-align:left}.vocs_Sidebar_divider{background-color:var(--vocs-color_border);width:100%;height:1px}.vocs_Sidebar_navigation{outline:0}.vocs_Sidebar_navigation:first-child{padding-top:var(--vocs-space_16)}.vocs_Sidebar_group{display:flex;flex-direction:column}.vocs_Sidebar_logo{align-items:center;display:flex;height:var(--vocs-topNav_height);padding-top:var(--vocs-space_4)}.vocs_Sidebar_logoWrapper{background-color:var(--vocs-color_backgroundDark);position:sticky;top:0;z-index:var(--vocs-zIndex_gutterTopCurtain)}.vocs_Sidebar_section{display:flex;flex-direction:column;font-size:1em}.vocs_Sidebar_navigation>.vocs_Sidebar_group>.vocs_Sidebar_section+.vocs_Sidebar_section{border-top:1px solid var(--vocs-color_border)}.vocs_Sidebar_levelCollapsed{gap:var(--vocs-space_4);padding-bottom:var(--vocs-space_12)}.vocs_Sidebar_levelInset{border-left:1px solid var(--vocs-color_border);font-size:var(--vocs-fontSize_13);margin-top:var(--vocs-space_8);padding-left:var(--vocs-space_12)}.vocs_Sidebar_levelInset.vocs_Sidebar_levelInset.vocs_Sidebar_levelInset{font-weight:var(--vocs-fontWeight_regular);padding-top:0;padding-bottom:0}.vocs_Sidebar_items{display:flex;flex-direction:column;gap:.625em;padding-top:var(--vocs-space_16);padding-bottom:var(--vocs-space_16);font-weight:var(--vocs-fontWeight_medium)}.vocs_Sidebar_level .vocs_Sidebar_items{padding-top:var(--vocs-space_6)}.vocs_Sidebar_item{color:var(--vocs-color_text3);letter-spacing:.25px;line-height:var(--vocs-lineHeight_sidebarItem);width:100%;transition:color .1s}.vocs_Sidebar_item:hover{color:var(--vocs-color_text)}.vocs_Sidebar_item[data-active=true]{color:var(--vocs-color_textAccent)}.vocs_Sidebar_sectionHeader{align-items:center;display:flex;justify-content:space-between}.vocs_Sidebar_level>.vocs_Sidebar_sectionHeader{padding-top:var(--vocs-space_12)}.vocs_Sidebar_sectionHeaderActive{color:var(--vocs-color_text)}.vocs_Sidebar_sectionTitle{color:var(--vocs-color_title);font-size:var(--vocs-fontSize_14);font-weight:var(--vocs-fontWeight_semibold);letter-spacing:.25px;width:100%}.vocs_Sidebar_sectionCollapse{color:var(--vocs-color_text3);transform:rotate(90deg);transition:transform .25s}.vocs_Sidebar_sectionCollapseActive{transform:rotate(0)}@media screen and (max-width: 1080px){.vocs_Sidebar{width:100%}.vocs_Sidebar_logoWrapper{display:none}}.vocs_SkipLink{background:var(--vocs-color_background);border-radius:var(--vocs-borderRadius_4);color:var(--vocs-color_link);font-size:var(--vocs-fontSize_14);font-weight:var(--vocs-fontWeight_semibold);left:var(--vocs-space_8);padding:var(--vocs-space_8) var(--vocs-space_16);position:fixed;text-decoration:none;top:var(--vocs-space_8);z-index:999}.vocs_SkipLink:focus{clip:auto;-webkit-clip-path:none;clip-path:none;height:auto;width:auto}:root{--vocs-color_backgroundAccent: #FF2F42}:root.dark{--vocs-color_backgroundAccent: #FF2F42}:root{--vocs-color_backgroundAccentHover: #f01938}:root.dark{--vocs-color_backgroundAccentHover: #f01938}:root{--vocs-color_backgroundAccentText: black}:root.dark{--vocs-color_backgroundAccentText: black}:root{--vocs-color_borderAccent: #f01938}:root.dark{--vocs-color_borderAccent: #ff5057}:root{--vocs-color_textAccent: #FF2F42}:root.dark{--vocs-color_textAccent: #FF2F42}:root{--vocs-color_textAccentHover: #e1002e}:root.dark{--vocs-color_textAccentHover: #e1002e}:root{--vocs-color_background: white}:root.dark{--vocs-color_background: black}:root{--vocs-content_horizontalPadding: 40px}:root.dark{--vocs-content_horizontalPadding: 40px}:root{--vocs-content_verticalPadding: 80px}:root.dark{--vocs-content_verticalPadding: 80px}.vocs_Section{border-top:1px solid var(--vocs-color_border);margin-top:var(--vocs-space_56);padding-top:var(--vocs-space_24)}.vocs_Anchor{color:var(--vocs-color_link);font-weight:var(--vocs-fontWeight_medium);text-underline-offset:var(--vocs-space_2);text-decoration:underline;transition:color .1s}.vocs_Callout_danger .vocs_Anchor{color:var(--vocs-color_dangerText)}.vocs_Callout_danger .vocs_Anchor:hover{color:var(--vocs-color_dangerTextHover)}.vocs_Callout_info .vocs_Anchor{color:var(--vocs-color_infoText)}.vocs_Callout_info .vocs_Anchor:hover{color:var(--vocs-color_infoTextHover)}.vocs_Callout_success .vocs_Anchor{color:var(--vocs-color_successText)}.vocs_Callout_success .vocs_Anchor:hover{color:var(--vocs-color_successTextHover)}.vocs_Callout_tip .vocs_Anchor{color:var(--vocs-color_tipText)}.vocs_Callout_tip .vocs_Anchor:hover{color:var(--vocs-color_tipTextHover)}.vocs_Callout_warning .vocs_Anchor{color:var(--vocs-color_warningText)}.vocs_Callout_warning .vocs_Anchor:hover{color:var(--vocs-color_warningTextHover)}.vocs_Anchor:hover{color:var(--vocs-color_linkHover)}.vocs_Section a.data-footnote-backref{color:var(--vocs-color_link);font-weight:var(--vocs-fontWeight_medium);text-underline-offset:var(--vocs-space_2);text-decoration:underline}.vocs_Section a.data-footnote-backref:hover{color:var(--vocs-color_linkHover)}.vocs_Autolink{opacity:0;margin-top:.1em;position:absolute;transition:opacity .1s,transform .1s;transform:translate(-2px) scale(.98)}.vocs_Heading:hover .vocs_Autolink{opacity:1;transform:translate(0) scale(1)}.vocs_Code{transition:color .1s}:not(.vocs_Pre)>.vocs_Code{background-color:var(--vocs-color_codeInlineBackground);border:1px solid var(--vocs-color_codeInlineBorder);border-radius:var(--vocs-borderRadius_4);color:var(--vocs-color_codeInlineText);font-size:var(--vocs-fontSize_code);padding:var(--vocs-space_3) var(--vocs-space_6)}.vocs_Anchor>.vocs_Code{color:var(--vocs-color_link);text-decoration:underline;text-underline-offset:var(--vocs-space_2)}.vocs_Anchor:hover>.vocs_Code{color:var(--vocs-color_linkHover)}.vocs_Callout_danger .vocs_Code{color:var(--vocs-color_dangerText)}.vocs_Callout_info .vocs_Code{color:var(--vocs-color_infoText)}.vocs_Callout_success .vocs_Code{color:var(--vocs-color_successText)}.vocs_Callout_tip .vocs_Code{color:var(--vocs-color_tipText)}.vocs_Callout_warning .vocs_Code{color:var(--vocs-color_warningText)}.twoslash-popup-info-hover>.vocs_Code{background-color:inherit;padding:0;text-wrap:wrap}.vocs_Authors{color:var(--vocs-color_text3);font-size:var(--vocs-fontSize_14)}.vocs_Authors_authors{color:var(--vocs-color_text)}.vocs_Authors_link{text-decoration:underline;text-underline-offset:2px}.vocs_Authors_link:hover{color:var(--vocs-color_text2)}.vocs_Authors_separator{color:var(--vocs-color_text3)}.vocs_BlogPosts{display:flex;flex-direction:column;gap:var(--vocs-space_32)}.vocs_BlogPosts_description{margin-top:var(--vocs-space_16)}.vocs_BlogPosts_divider{border-color:var(--vocs-color_background4)}.vocs_BlogPosts_post:hover .vocs_BlogPosts_readMore{color:var(--vocs-color_textAccent)}.vocs_BlogPosts_title{font-size:var(--vocs-fontSize_h2);font-weight:var(--vocs-fontWeight_semibold)}.vocs_Sponsors{border-radius:var(--vocs-borderRadius_8);display:flex;flex-direction:column;gap:var(--vocs-space_4);overflow:hidden}.vocs_Sponsors_title{background-color:var(--vocs-color_background3);color:var(--vocs-color_text3);font-size:var(--vocs-fontSize_13);font-weight:var(--vocs-fontWeight_medium);padding:var(--vocs-space_4) 0;text-align:center}.vocs_Sponsors_row{display:flex;flex-direction:row;gap:var(--vocs-space_4)}.vocs_Sponsors_column{align-items:center;background-color:var(--vocs-color_background3);display:flex;justify-content:center;padding:var(--vocs-space_32);width:calc(var(--vocs_Sponsors_columns) * 100%)}.vocs_Sponsors_sponsor{transition:background-color .1s}.vocs_Sponsors_sponsor:hover{background-color:var(--vocs-color_background5)}.dark .vocs_Sponsors_sponsor:hover{background-color:var(--vocs-color_white)}.vocs_Sponsors_image{filter:grayscale(1);height:var(--vocs_Sponsors_height);transition:filter .1s}.dark .vocs_Sponsors_image{filter:grayscale(1) invert(1)}.vocs_Sponsors_column:hover .vocs_Sponsors_image{filter:none}.vocs_AutolinkIcon{background-color:var(--vocs-color_textAccent);display:inline-block;margin-left:.25em;height:.8em;width:.8em;-webkit-mask:url(/.vocs/icons/link.svg) no-repeat center / contain;mask:url(/.vocs/icons/link.svg) no-repeat center / contain;transition:background-color .1s}.vocs_Autolink:hover .vocs_AutolinkIcon{background-color:var(--vocs-color_textAccentHover)}@media screen and (width <= 720px){.vocs_CodeGroup{border-radius:0;border-right:none;border-left:none;margin-left:calc(-1 * var(--vocs-space_16));margin-right:calc(-1 * var(--vocs-space_16))}}.vocs_Steps{border-left:1.5px solid var(--vocs-color_border);counter-reset:step;padding-left:var(--vocs-space_24);margin-left:var(--vocs-space_12);margin-top:var(--vocs-space_24)}@media screen and (width <= 720px){.vocs_Steps{margin-left:var(--vocs-space_4)}}.vocs_Subtitle{color:var(--vocs-color_text2);font-size:var(--vocs-fontSize_subtitle);font-weight:var(--vocs-fontWeight_regular);letter-spacing:-.02em;line-height:var(--vocs-lineHeight_heading);margin-top:var(--vocs-space_4);text-wrap:balance}.vocs_CodeBlock{border:1px solid var(--vocs-color_codeInlineBorder);border-radius:var(--vocs-borderRadius_4)}.vocs_Tabs .vocs_CodeBlock{border:none;margin-left:unset;margin-right:unset}.vocs_CodeBlock code{font-size:var(--vocs-fontSize_codeBlock)}.vocs_CodeBlock pre{background-color:var(--vocs-color_codeBlockBackground);border-radius:var(--vocs-borderRadius_4);overflow-x:auto;padding:var(--vocs-space_20) var(--vocs-space_0)}.vocs_Callout .vocs_CodeBlock pre{background-color:color-mix(in srgb,var(--vocs-color_codeBlockBackground) 65%,transparent);border:1px solid var(--vocs-color_codeInlineBorder);padding:var(--vocs-space_12) var(--vocs-space_0)}.vocs_CodeBlock [data-rehype-pretty-code-title]+pre{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.vocs_CodeBlock [data-line]{border-left:2px solid transparent;padding:var(--vocs-space_0) var(--vocs-space_22);line-height:var(--vocs-lineHeight_code)}.vocs_Callout .vocs_CodeBlock [data-line]{padding:var(--vocs-space_0) var(--vocs-space_12)}.vocs_CodeBlock .twoslash-popup-info [data-line]{padding:var(--vocs-space_0) var(--vocs-space_4)}.vocs_CodeBlock .twoslash-popup-info-hover [data-line]{display:inline-block;padding:var(--vocs-space_0) var(--vocs-space_8)}.vocs_CodeBlock .twoslash-error-line,.vocs_CodeBlock .twoslash-tag-line{padding:var(--vocs-space_0) var(--vocs-space_22)}.vocs_CodeBlock [data-line-numbers]{counter-reset:line}.vocs_CodeBlock [data-line-numbers] [data-line]{padding:var(--vocs-space_0) var(--vocs-space_16)}.vocs_CodeBlock [data-line-numbers] [data-line]:before{content:counter(line);color:var(--vocs-color_lineNumber);counter-increment:line;display:inline-block;font-size:var(--vocs-fontSize_lineNumber);margin-right:var(--vocs-space_16);text-align:right;width:1rem}.vocs_CodeBlock [data-highlighted-line],.vocs_CodeBlock .highlighted{background-color:var(--vocs-color_codeHighlightBackground);border-left:2px solid var(--vocs-color_codeHighlightBorder);box-sizing:content-box}.vocs_CodeBlock [data-highlighted-chars],.vocs_CodeBlock .highlighted-word{border-radius:var(--vocs-borderRadius_2);background-color:var(--vocs-color_codeCharacterHighlightBackground)!important;box-shadow:0 0 0 4px var(--vocs-color_codeCharacterHighlightBackground)}.vocs_CodeBlock .has-diff{position:relative}.vocs_CodeBlock [data-line].diff:before{position:absolute;left:10px}.vocs_CodeBlock [data-line].diff.add{background-color:var(--vocs-color_backgroundGreenTint2)}.vocs_CodeBlock [data-line].diff.add:before{content:"+";color:var(--vocs-color_textGreen)}.vocs_CodeBlock [data-line].diff.remove{background-color:var(--vocs-color_backgroundRedTint2);opacity:.6}.vocs_CodeBlock [data-line].diff.remove>span{filter:grayscale(1)}.vocs_CodeBlock [data-line].diff.remove:before{content:"-";color:var(--vocs-color_textRed)}.vocs_CodeBlock .has-focused>code>[data-line]:not(.focused),.vocs_CodeBlock .has-focused>code>.twoslash-meta-line:not(.focused){opacity:.3;transition:opacity .2s}.vocs_CodeBlock:hover .has-focused [data-line]:not(.focused),.vocs_CodeBlock:hover .has-focused .twoslash-meta-line:not(.focused){opacity:1;transition:opacity .2s}@media screen and (width <= 720px){.vocs_CodeBlock{border-radius:0;border-right:none;border-left:none;margin-left:calc(-1 * var(--vocs-space_16));margin-right:calc(-1 * var(--vocs-space_16))}.vocs_CodeBlock pre{border-radius:0}.vocs_CodeBlock [data-line],.vocs_CodeBlock .twoslash-error-line,.vocs_CodeBlock .twoslash-tag-line{padding:0 var(--vocs-space_16)}.vocs_CodeBlock [data-line].diff:before{left:var(--vocs-space_6)}}.vocs_HorizontalRule{border-top:1px solid var(--vocs-color_hr);margin-bottom:var(--vocs-space_16)}.vocs_ListItem{line-height:var(--vocs-lineHeight_listItem)}.vocs_ListItem:not(:last-child){margin-bottom:.5em}.vocs_CopyButton{align-items:center;background-color:color-mix(in srgb,var(--vocs-color_background2) 75%,transparent);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);border:1px solid var(--vocs-color_border);border-radius:var(--vocs-borderRadius_4);color:var(--vocs-color_text3);display:flex;justify-content:center;position:absolute;right:var(--vocs-space_18);top:var(--vocs-space_18);opacity:0;height:32px;width:32px;transition:background-color .15s,opacity .15s;z-index:var(--vocs-zIndex_surface)}.vocs_CopyButton:hover{background-color:var(--vocs-color_background4);transition:background-color .05s}.vocs_CopyButton:focus-visible{background-color:var(--vocs-color_background4);opacity:1;transition:background-color .05s}.vocs_CopyButton:hover:active{background-color:var(--vocs-color_background2)}.vocs_Pre:hover .vocs_CopyButton{opacity:1}.vocs_CalloutTitle{font-size:var(--vocs-fontSize_12);letter-spacing:.02em;text-transform:uppercase}.vocs_Strong{font-weight:var(--vocs-fontWeight_semibold)}.vocs_Content>.vocs_Strong{display:block}.vocs_Callout>.vocs_Strong{display:block;margin-bottom:var(--vocs-space_4)}.vocs_Summary{cursor:pointer}.vocs_Summary.vocs_Summary:hover{text-decoration:underline}.vocs_Details[open] .vocs_Summary{margin-bottom:var(--vocs-space_4)}.vocs_Callout .vocs_Summary{font-weight:var(--vocs-fontWeight_medium)}.vocs_Details .vocs_Summary.vocs_Summary{margin-bottom:0}.vocs_Table{display:block;border-collapse:collapse;overflow-x:auto;margin-bottom:var(--vocs-space_24)}.vocs_TableCell{border:1px solid var(--vocs-color_tableBorder);font-size:var(--vocs-fontSize_td);padding:var(--vocs-space_8) var(--vocs-space_12)}.vocs_TableHeader{border:1px solid var(--vocs-color_tableBorder);background-color:var(--vocs-color_tableHeaderBackground);color:var(--vocs-color_tableHeaderText);font-size:var(--vocs-fontSize_th);font-weight:var(--vocs-fontWeight_medium);padding:var(--vocs-space_8) var(--vocs-space_12);text-align:left}.vocs_TableHeader[align=center]{text-align:center}.vocs_TableHeader[align=right]{text-align:right}.vocs_TableRow{border-top:1px solid var(--vocs-color_tableBorder)}.vocs_TableRow:nth-child(2n){background-color:var(--vocs-color_background2)}.vocs_Button_button{align-items:center;background:var(--vocs-color_background4);border:1px solid var(--vocs-color_border);border-radius:var(--vocs-borderRadius_4);color:var(--vocs-color_text);display:flex;font-size:var(--vocs-fontSize_14);font-weight:var(--vocs-fontWeight_medium);height:36px;padding:0 var(--vocs-space_16);transition:background .1s;white-space:pre;width:-moz-fit-content;width:fit-content}.vocs_Button_button:hover{background:var(--vocs-color_background3)}.vocs_Button_button_accent{background:var(--vocs-color_backgroundAccent);color:var(--vocs-color_backgroundAccentText);border:1px solid var(--vocs-color_borderAccent)}.vocs_Button_button_accent:hover{background:var(--vocs-color_backgroundAccentHover)}.vocs_HomePage{align-items:center;display:flex;flex-direction:column;padding-top:var(--vocs-space_64);text-align:center;gap:var(--vocs-space_32)}.vocs_HomePage_logo{display:flex;justify-content:center;height:48px}.vocs_HomePage_title{font-size:var(--vocs-fontSize_64);font-weight:var(--vocs-fontWeight_semibold);line-height:1em}.vocs_HomePage_tagline{color:var(--vocs-color_text2);font-size:var(--vocs-fontSize_20);font-weight:var(--vocs-fontWeight_medium);line-height:1.5em}.vocs_HomePage_title+.vocs_HomePage_tagline{margin-top:calc(-1 * var(--vocs-space_8))}.vocs_HomePage_description{color:var(--vocs-color_text);font-size:var(--vocs-fontSize_16);font-weight:var(--vocs-fontWeight_regular);line-height:var(--vocs-lineHeight_paragraph)}.vocs_HomePage_tagline+.vocs_HomePage_description{margin-top:calc(-1 * var(--vocs-space_8))}.vocs_HomePage_buttons{display:flex;gap:var(--vocs-space_16)}.vocs_HomePage_tabs{min-width:300px}.vocs_HomePage_tabsList{display:flex;justify-content:center}.vocs_HomePage_tabsContent{color:var(--vocs-color_text2);font-family:var(--vocs-fontFamily_mono)}.vocs_HomePage_packageManager{color:var(--vocs-color_textAccent)}@media screen and (width <= 720px){.vocs_HomePage{padding-top:var(--vocs-space_32)}.vocs_HomePage_logo{height:36px}} diff --git a/dojo-book/docs/dist/assets/system-4mpOFZD1.js b/dojo-book/docs/dist/assets/system-4mpOFZD1.js new file mode 100644 index 00000000..dee8e917 --- /dev/null +++ b/dojo-book/docs/dist/assets/system-4mpOFZD1.js @@ -0,0 +1,35 @@ +import{u as d,j as e}from"./index-m6NaWekR.js";const a=void 0;function n(s){const i={a:"a",br:"br",code:"code",div:"div",em:"em",figure:"figure",h2:"h2",h3:"h3",h4:"h4",h5:"h5",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",...d(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsxs(i.h2,{id:"sozo-system",children:["sozo system",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-system",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"system"})," is used to interact with a World's systems. It is useful for querying about a system's information."]}),` +`,e.jsxs(i.h3,{id:"usage",children:["USAGE",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsxs(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" system "}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"COMMAN"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"D"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]}),` +`,e.jsx(i.span,{"data-line":"",children:" "}),` +`,e.jsx(i.span,{"data-line":"",children:e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"Commands:"})}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" get"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Get the class hash of a system."})]}),` +`,e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:" dependency"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" Retrieve the component dependencies of a system."})]})]})})}),` +`,e.jsxs(i.h3,{id:"subcommands",children:["SUBCOMMANDS",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#subcommands",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h4,{id:"get",children:[e.jsx(i.code,{children:"get"}),e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#get",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Get the class hash of a system"}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" system get "}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"NAM"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"E"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})})})}),` +`,e.jsxs(i.h5,{id:"arguments",children:["Arguments",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#arguments",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.em,{children:e.jsx(i.code,{children:"NAME"})}),e.jsx(i.br,{}),` +`,"    The name of the system"]}),` +`,e.jsxs(i.h4,{id:"dependency",children:[e.jsx(i.code,{children:"dependency"}),e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dependency",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"Retrieve the component dependencies of a system"}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" system dependency "}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:"<"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:"NAM"}),e.jsx(i.span,{style:{"--shiki-dark":"#ADBAC7","--shiki-light":"#24292E"},children:"E"}),e.jsx(i.span,{style:{"--shiki-dark":"#F47067","--shiki-light":"#D73A49"},children:">"})]})})})}),` +`,e.jsxs(i.h5,{id:"arguments-1",children:["Arguments",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#arguments-1",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.p,{children:[e.jsx(i.em,{children:e.jsx(i.code,{children:"NAME"})}),e.jsx(i.br,{}),` +`,"    The name of the system"]}),` +`,e.jsxs(i.h3,{id:"options",children:["OPTIONS",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.h4,{id:"world-options",children:["World Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#world-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/world-options.md}}"}),` +`,e.jsxs(i.h4,{id:"starknet-options",children:["Starknet Options",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starknet-options",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(i.p,{children:"{{#include ../common/starknet-options.md}}"}),` +`,e.jsxs(i.h3,{id:"examples",children:["EXAMPLES",e.jsx(i.a,{"aria-hidden":"true",tabIndex:"-1",href:"#examples",children:e.jsx(i.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(i.ol,{children:[` +`,e.jsxs(i.li,{children:["Get the class hash of the ",e.jsx(i.em,{children:"spawn"})," system"]}),` +`]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" system get spawn"})]})})})}),` +`,e.jsxs(i.ol,{start:"2",children:[` +`,e.jsxs(i.li,{children:["Get the component dependencies of the ",e.jsx(i.em,{children:"spawn"})," system"]}),` +`]}),` +`,e.jsx(i.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(i.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(i.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(i.span,{"data-line":"",children:[e.jsx(i.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(i.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" system dependency spawn"})]})})})})]})}function h(s={}){const{wrapper:i}={...d(),...s.components};return i?e.jsx(i,{...s,children:e.jsx(n,{...s})}):n(s)}export{h as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/systems-Zj0xof5B.js b/dojo-book/docs/dist/assets/systems-Zj0xof5B.js new file mode 100644 index 00000000..cb99a466 --- /dev/null +++ b/dojo-book/docs/dist/assets/systems-Zj0xof5B.js @@ -0,0 +1,136 @@ +import{u as i,j as n}from"./index-m6NaWekR.js";const d=void 0;function a(s){const e={a:"a",blockquote:"blockquote",code:"code",div:"div",em:"em",figure:"figure",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...i(),...s.components};return n.jsxs(n.Fragment,{children:[n.jsxs(e.h2,{id:"systems",children:["Systems",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#systems",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.blockquote,{children:[` +`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"IMPORTANT:"})," Before defining your systems, prioritize permissions. Plan carefully to ensure proper access and security."]}),` +`]}),` +`,n.jsx(e.strong,{children:n.jsx(e.em,{children:"TL;DR"})}),` +`,n.jsxs(e.ul,{children:[` +`,n.jsx(e.li,{children:"Systems function as contract methods."}),` +`,n.jsx(e.li,{children:"Contracts containing Systems gain permissions to write to models."}),` +`,n.jsxs(e.li,{children:["Systems pass a ",n.jsx(e.code,{children:"world"})," address as their first parameter unless utilizing the ",n.jsx(e.a,{href:"#the-dojocontract-decorator",children:n.jsx(e.code,{children:"#[dojo::contract]"})})," decorator."]}),` +`,n.jsx(e.li,{children:"Systems engage the world contract to alter models' state."}),` +`,n.jsx(e.li,{children:"The world contract is invoked through systems."}),` +`,n.jsx(e.li,{children:"Systems ought to be concise and specific."}),` +`,n.jsx(e.li,{children:"In most scenarios, systems are stateless."}),` +`]}),` +`,n.jsxs(e.h3,{id:"what-are-systems",children:["What are Systems?",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-are-systems",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"Within dojo we define systems as functions within a Dojo Contract that act on the world."}),` +`,n.jsxs(e.p,{children:["Systems play a pivotal role in your world's logic, directly mutating its component states. It's important to understand that to enact these mutations, a system needs explicit permission from the ",n.jsx(e.a,{href:"/models",children:n.jsx(e.code,{children:"models"})})," owner."]}),` +`,n.jsxs(e.h3,{id:"system-permissions",children:["System Permissions",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#system-permissions",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"Since the whole contract is given write access to the model, it is important to be careful when defining systems. A simple way to think about it is:"}),` +`,n.jsx(e.p,{children:n.jsx(e.img,{src:"/permissions.png",alt:"System Permissions"})}),` +`,n.jsxs(e.h3,{id:"system-structure",children:["System Structure",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#system-structure",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["Every system function starts with a ",n.jsx(e.a,{href:"/world",children:n.jsx(e.code,{children:"world"})})," address as its initial parameter. This design permits these functions to alter the world's state. Notably, this structure also makes systems adaptable and reusable across multiple worlds!"]}),` +`,n.jsxs(e.p,{children:["Let's look at the simplest possible system which mutates the state of the ",n.jsx(e.code,{children:"Moves"})," component."]}),` +`,n.jsxs(e.blockquote,{children:[` +`,n.jsx(e.p,{children:"NOTE: This is not using the #[dojo::contract] attribute meaning it was to accept the world as a parameter."}),` +`]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[starknet::contract]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"mod player_actions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use starknet::{ContractAddress, get_caller_address};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::components::{Position, Moves, Direction, Vec2};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::utils::next_position;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use super::IPlayerActions;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // no storage"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[storage]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" struct Storage {}"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // implementation of the PlayerActions interface"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[abi(embed_v0)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" impl PlayerActionsImpl of IPlayerActions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn spawn(self: @ContractState, world: IWorldDispatcher) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let player = get_caller_address();"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let position = get!(world, player, (Position));"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Moves {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" player,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" remaining: 10,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" last_direction: Direction::None(())"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" )"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.h2,{id:"breaking-it-down",children:["Breaking it down",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#breaking-it-down",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.h4,{id:"system-is-a-function-in-a-contract",children:["System is a function in a contract",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#system-is-a-function-in-a-contract",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"As you can see a System is like a regular function of a Starknet contract. This contract can include storage, and it can implement interfaces."}),` +`,n.jsxs(e.h4,{id:"spawn-function",children:[n.jsx(e.code,{children:"Spawn"})," function",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#spawn-function",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"The spawn function is currently the only system that exists in this contract. It is called when a player spawns into the world. It is responsible for setting up the player's initial state."}),` +`,n.jsxs(e.h3,{id:"the-dojocontract-decorator",children:["The ",n.jsx(e.code,{children:"#[dojo::contract]"})," Decorator",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#the-dojocontract-decorator",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["All Starknet contracts are defined using the ",n.jsx(e.code,{children:"#[starknet::contract]"})," decorator, ensuring accurate compilation. In this context, Dojo introduces the ",n.jsx(e.code,{children:"#[dojo::contract]"})," decorator, which aims to minimize boilerplate in contract writing."]}),` +`,n.jsxs(e.p,{children:["The ",n.jsx(e.code,{children:"#[dojo::contract]"})," decorator allows developers to omit including ",n.jsx(e.code,{children:"world: IWorldDispatcher"})," as a parameter. Behind the scenes, it injects the world into the contract and eliminates some imports, thereby streamlining the development process."]}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[dojo::contract]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"mod player_actions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use starknet::{ContractAddress, get_caller_address};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::models::{Position, Moves, Direction, Vec2};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::utils::next_position;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use super::IPlayerActions;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[event]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[derive(Drop, starknet::Event)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" enum Event {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Moved: Moved,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[derive(Drop, starknet::Event)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" struct Moved {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" player: ContractAddress,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" direction: Direction"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // impl: implement functions specified in trait"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[abi(embed_v0)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" impl PlayerActionsImpl of IPlayerActions {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // ContractState is defined by system decorator expansion"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn spawn(self: @ContractState) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // world dispatcher"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let world = self.world_dispatcher.read();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // player"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let player = get_caller_address();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // get the position"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let position = get!(world, player, (Position));"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // set the position"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" world,"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" ("})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Moves { player, remaining: 10, last_direction: Direction::None(()) },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" Position { player, vec: Vec2 { x: 10, y: 10 } },"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" )"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" );"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn move(self: @ContractState, direction: Direction) {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // world dispatcher"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let world = self.world_dispatcher.read();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // player"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let player = get_caller_address();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // get the position and moves"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let (mut position, mut moves) = get!(world, player, (Position, Moves));"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // adjust"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" moves.remaining -= 1;"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" moves.last_direction = direction;"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // get next direction"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let next = next_position(position, direction);"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // set models"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" set!(world, (moves, next));"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // emit custom event"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" emit!(world, Moved { player, direction });"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.blockquote,{children:[` +`,n.jsxs(e.p,{children:["To interact with Systems read more in the ",n.jsx(e.a,{href:"/toolchain/sozo/overview",children:"sozo"})," docs."]}),` +`]})]})}function r(s={}){const{wrapper:e}={...i(),...s.components};return e?n.jsx(e,{...s,children:n.jsx(a,{...s})}):a(s)}export{r as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/test-hYP7ueFm.js b/dojo-book/docs/dist/assets/test-hYP7ueFm.js new file mode 100644 index 00000000..6caab2f2 --- /dev/null +++ b/dojo-book/docs/dist/assets/test-hYP7ueFm.js @@ -0,0 +1,3 @@ +import{u as i,j as e}from"./index-m6NaWekR.js";const d=void 0;function n(s){const t={a:"a",code:"code",div:"div",figure:"figure",h2:"h2",p:"p",pre:"pre",span:"span",...i(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsxs(t.h2,{id:"sozo-test",children:["sozo test",e.jsx(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-test",children:e.jsx(t.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"test"})," is used to test the project's cairo contracts. It will run all tests found within the project."]}),` +`,e.jsx(t.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(t.pre,{tabIndex:"0","data-language":"sh","data-theme":"github-dark-dimmed github-light",children:e.jsx(t.code,{"data-language":"sh","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsxs(t.span,{"data-line":"",children:[e.jsx(t.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),e.jsx(t.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" test"})]})})})})]})}function r(s={}){const{wrapper:t}={...i(),...s.components};return t?e.jsx(t,{...s,children:e.jsx(n,{...s})}):n(s)}export{r as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/testing-NtBMGpQw.js b/dojo-book/docs/dist/assets/testing-NtBMGpQw.js new file mode 100644 index 00000000..d4ce60eb --- /dev/null +++ b/dojo-book/docs/dist/assets/testing-NtBMGpQw.js @@ -0,0 +1,89 @@ +import{u as i,j as n}from"./index-m6NaWekR.js";const d=void 0;function a(s){const e={a:"a",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",span:"span",...i(),...s.components};return n.jsxs(n.Fragment,{children:[n.jsxs(e.h2,{id:"testing",children:["Testing",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#testing",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["Testing is a crucial part of any software development process. Dojo provides a testing framework that allows you to write tests for your smart contracts. Since Dojo uses a custom compiler, you need to use ",n.jsx(e.code,{children:"sozo"})," to test your contracts."]}),` +`,n.jsx(e.p,{children:"From your project directory, simply:"}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"shell","data-theme":"github-dark-dimmed github-light",children:n.jsx(e.code,{"data-language":"shell","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:n.jsxs(e.span,{"data-line":"",children:[n.jsx(e.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"sozo"}),n.jsx(e.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" test"})]})})})}),` +`,n.jsx(e.p,{children:"This will search for all tests within your project and run them."}),` +`,n.jsxs(e.h3,{id:"writing-unit-tests",children:["Writing Unit Tests",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#writing-unit-tests",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"It is best practise to include unit tests in the same file as the Model/System you are writing."}),` +`,n.jsxs(e.p,{children:["Lets show a ",n.jsx(e.code,{children:"model"})," test example from the ",n.jsx(e.a,{href:"https://github.com/dojoengine/dojo-starter",children:"dojo-starter"}),":"]}),` +`,n.jsx(e.p,{children:n.jsx(e.code,{children:"models.cairo"})}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"...//rest of code"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[cfg(test)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"mod tests {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use super::{Position, Vec2, Vec2Trait};"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[test]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[available_gas(100000)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn test_vec_is_zero() {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" assert(Vec2Trait::is_zero(Vec2 { x: 0, y: 0 }), 'not zero');"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[test]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[available_gas(100000)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn test_vec_is_equal() {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let position = Vec2 { x: 420, y: 0 };"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" assert(position.is_equal(Vec2 { x: 420, y: 0 }), 'not equal');"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.p,{children:["In this test we are testing the ",n.jsx(e.code,{children:"is_zero"})," and ",n.jsx(e.code,{children:"is_equal"})," functions of the ",n.jsx(e.code,{children:"Position"})," model. It is good practise to test all functions of your models."]}),` +`,n.jsxs(e.h3,{id:"writing-integration-tests",children:["Writing Integration Tests",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#writing-integration-tests",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:["Integration tests are e2e tests that test the entire system. You can write integration tests for your world by creating a ",n.jsx(e.code,{children:"tests"})," directory in your project root. Then create a file for each integration test you want to write."]}),` +`,n.jsxs(e.p,{children:["This is the example from the ",n.jsx(e.a,{href:"https://github.com/dojoengine/dojo-starter",children:"dojo-starter"}),":"]}),` +`,n.jsx(e.p,{children:n.jsx(e.code,{children:"move.cairo"})}),` +`,n.jsx(e.figure,{"data-rehype-pretty-code-figure":"",children:n.jsx(e.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:n.jsxs(e.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"#[cfg(test)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"mod tests {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo::world::{IWorldDispatcherTrait, IWorldDispatcher};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo::test_utils::{spawn_test_world, deploy_contract};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::models::{position, moves};"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use dojo_examples::models::{Position, Moves, Direction};"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" use super::{actions, IActionsDispatcher, IActionsDispatcherTrait};"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // helper setup function"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // reusable function for tests"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn setup_world() -> IActionsDispatcher {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // components"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let mut models = array![position::TEST_CLASS_HASH, moves::TEST_CLASS_HASH];"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // deploy world with models"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let world = spawn_test_world(models);"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // deploy systems contract"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let contract_address = world"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let actions_system = IActionsDispatcher { contract_address };"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" actions_system"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[test]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" #[available_gas(30000000)]"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" fn test_move() {"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // caller"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let caller = starknet::contract_address_const::<0x0>();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let actions_system = setup_world();"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // System calls"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" actions_system.spawn();"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" actions_system.move(Direction::Right(()));"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // check moves"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let moves = get!(world, caller, (Moves));"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" assert(moves.remaining == 99, 'moves is wrong');"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // get new_position"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" let new_position = get!(world, caller, Position);"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // check new position x"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" assert(new_position.vec.x == 11, 'position x is wrong');"})}),` +`,n.jsx(e.span,{"data-line":"",children:" "}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" // check new position y"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" assert(new_position.vec.y == 10, 'position y is wrong');"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:" }"})}),` +`,n.jsx(e.span,{"data-line":"",children:n.jsx(e.span,{children:"}"})})]})})}),` +`,n.jsxs(e.h4,{id:"useful-dojo-test-functions",children:["Useful Dojo Test Functions",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#useful-dojo-test-functions",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsxs(e.p,{children:[n.jsx(e.code,{children:"spawn_test_world(models)"})," - This function will create a test world with the models and systems you pass in. It will also deploy the world and register the models and systems."]})]})}function r(s={}){const{wrapper:e}={...i(),...s.components};return e?n.jsx(e,{...s,children:n.jsx(a,{...s})}):a(s)}export{r as default,d as frontmatter}; diff --git a/dojo-book/docs/dist/assets/torii-plxfmtKY.js b/dojo-book/docs/dist/assets/torii-plxfmtKY.js new file mode 100644 index 00000000..f670f978 --- /dev/null +++ b/dojo-book/docs/dist/assets/torii-plxfmtKY.js @@ -0,0 +1,5 @@ +import{u as s,j as n}from"./index-m6NaWekR.js";const a=void 0;function i(t){const e={a:"a",div:"div",h2:"h2",h3:"h3",p:"p",strong:"strong",...s(),...t.components};return n.jsxs(n.Fragment,{children:[n.jsxs(e.h2,{id:"torii-client",children:["Torii Client",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#torii-client",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.p,{children:"Torii client is a rust client for interacting with Dojo worlds. It can be compiled to wasm to be used in JS clients, or can used directly in Rust clients or other lower level languages with bindings."}),` +`,n.jsxs(e.h3,{id:"usage-in-rust-projects",children:["Usage in Rust projects",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage-in-rust-projects",children:n.jsx(e.div,{"data-autolink-icon":!0})})]}),` +`,n.jsx(e.strong,{children:"@kairy"}),` +`,n.jsxs(e.h3,{id:"usage-in-js-clients",children:["Usage in JS Clients",n.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage-in-js-clients",children:n.jsx(e.div,{"data-autolink-icon":!0})})]})]})}function o(t={}){const{wrapper:e}={...s(),...t.components};return e?n.jsx(e,{...t,children:n.jsx(i,{...t})}):i(t)}export{o as default,a as frontmatter}; diff --git a/dojo-book/docs/dist/assets/unity-6JzmRrbN.js b/dojo-book/docs/dist/assets/unity-6JzmRrbN.js new file mode 100644 index 00000000..2a0eabda --- /dev/null +++ b/dojo-book/docs/dist/assets/unity-6JzmRrbN.js @@ -0,0 +1,90 @@ +import{u as s,j as e}from"./index-m6NaWekR.js";const o={title:"dojo.unity",description:"undefined"};function r(i){const n={a:"a",code:"code",div:"div",figure:"figure",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...s(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(n.header,{children:e.jsxs(n.h1,{id:"dojounity",children:["dojo.unity",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojounity",children:e.jsx(n.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsxs(n.h3,{id:"prerequisites",children:["Prerequisites",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#prerequisites",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Before getting started, there are a few steps you must follow in order to get the project up and running."}),` +`,e.jsxs(n.h4,{id:"dojo",children:["Dojo",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojo",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Ensure that you're using the latest supported Dojo ",e.jsx(n.a,{href:"https://github.com/dojoengine/dojo/releases",children:"version"}),"."]}),` +`,e.jsxs(n.h4,{id:"binaries",children:["Binaries",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#binaries",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["If you are using Windows or Linux, you will need to build ",e.jsx(n.a,{href:"https://github.com/dojoengine/dojo.c",children:"dojo.c"})," yourself. Make sure that you're using the latest supported version"]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"bash","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"bash","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsxs(n.span,{"data-line":"",children:[e.jsx(n.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"git"}),e.jsx(n.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" clone https://github.com/dojoengine/dojo.c"})]}),` +`,e.jsxs(n.span,{"data-line":"",children:[e.jsx(n.span,{style:{"--shiki-dark":"#F69D50","--shiki-light":"#6F42C1"},children:"cargo"}),e.jsx(n.span,{style:{"--shiki-dark":"#96D0FF","--shiki-light":"#032F62"},children:" build --release"})]})]})})}),` +`,e.jsxs(n.p,{children:["This will generate a ",e.jsx(n.code,{children:".dll"})," or ",e.jsx(n.code,{children:".so"})," binary in the ",e.jsx(n.code,{children:"target/release"})," directory, depending on your platform. You will need to copy it to the following location ",e.jsx(n.code,{children:"Packages/Dojo/Libraries"})]}),` +`,e.jsx(n.hr,{}),` +`,e.jsxs(n.h3,{id:"watch-video",children:["Watch video",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#watch-video",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,` +`,e.jsxs(n.h2,{id:"dojo-unity-concepts",children:["Dojo Unity Concepts",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#dojo-unity-concepts",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Building on-chain games and worlds with Unity involves understanding several key concepts and components. Let's go over them to give you a clearer picture:"}),` +`,e.jsxs(n.h2,{id:"world-manager",children:["World Manager",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#world-manager",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:e.jsx(n.img,{src:"/unity/world-manager.png",alt:"world-manager"})}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Function"}),": The World Manager acts as the central hub for your Dojo world within Unity. It's the starting point where all entities from your Dojo world will be managed."]}),` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Implementation"}),": In your Unity scene, you'll find a ",e.jsx(n.code,{children:"WorldManager"})," game object. Under this object, all entities from your Dojo world will be instantiated."]}),` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Customization"}),": The WorldManager script component comes with default values, but you have the option to modify these. Specifically, you can update the URLs for your Katana and Torii instances and set your own world address."]}),` +`]}),` +`,e.jsxs(n.h2,{id:"synchronization-master",children:["Synchronization Master",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#synchronization-master",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:e.jsx(n.img,{src:"/unity/sync-master.png",alt:"world-manager"})}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Role"}),": This component is crucial for managing the synchronization of entities between your Dojo world and the Unity world."]}),` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Features"}),": In the SynchronizationMaster, you can specify the maximum number of entities you want to synchronize. It also handles the synchronization of your models' components."]}),` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Models Component"}),":",` +`,e.jsxs(n.ul,{children:[` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Purpose"}),": These are the components that will be synchronized between the two worlds."]}),` +`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Management"}),": You have the flexibility to add as many models as needed. However, it's important to ensure that the models you add here are also present in your Dojo world for proper synchronization."]}),` +`]}),` +`]}),` +`]}),` +`,e.jsxs(n.h2,{id:"models",children:["Models",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#models",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:e.jsx(n.img,{src:"/unity/models.png",alt:"models"})}),` +`,e.jsxs(n.p,{children:["You should have a deep understanding of models in dojo if not checkout out models ",e.jsx(n.a,{href:"/cairo/models",children:"here"})," before continuing."]}),` +`,e.jsxs(n.h3,{id:"what-are-models-in-dojo",children:["What are Models in Dojo?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-are-models-in-dojo",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.ol,{children:[` +`,e.jsxs(n.li,{children:[` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Definition"}),": In Dojo, ",e.jsx(n.a,{href:"/cairo/models",children:"models"})," are essential state that represent various parts of ",e.jsx(n.a,{href:"/cairo/entities",children:"entities"})," within your game. They are the building blocks that make up the content of your game world. Read about ",e.jsx(n.a,{href:"/cairo/hello-dojo",children:"ECS"}),"."]}),` +`]}),` +`,e.jsxs(n.li,{children:[` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Synchronization Role"}),":"]}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsx(n.li,{children:"Models act as the key elements that are synchronized between the onchain Dojo world and the Unity world (your game's visual and interactive representation)."}),` +`,e.jsx(n.li,{children:"This synchronization ensures that changes or interactions happening within the Unity environment are accurately reflected in the Dojo world, and vice versa."}),` +`]}),` +`]}),` +`,e.jsxs(n.li,{children:[` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Flexibility in Adding Models"}),":"]}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsxs(n.li,{children:["You have the freedom to add as many ",e.jsx(n.a,{href:"/cairo/models",children:"models"})," as needed for your game's design and functionality."]}),` +`,e.jsxs(n.li,{children:["It's vital, however, to ensure that these ",e.jsx(n.a,{href:"/cairo/models",children:"models"})," are consistent across both the Dojo and Unity. This means that for every model you have in Unity, there should be a corresponding model in your Dojo world."]}),` +`]}),` +`]}),` +`,e.jsxs(n.li,{children:[` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Future Developments"}),":"]}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsxs(n.li,{children:["An important aspect to note is that in future versions of the Dojo-Unity integration, the process of adding and synchronizing ",e.jsx(n.a,{href:"/cairo/models",children:"models"})," will be further streamlined."]}),` +`,e.jsxs(n.li,{children:["The plan is to have these ",e.jsx(n.a,{href:"/cairo/models",children:"models"})," auto-generated, which would significantly simplify the development process and reduce the manual effort required for synchronization."]}),` +`]}),` +`]}),` +`,e.jsxs(n.li,{children:[` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Importance of Understanding Models"}),":"]}),` +`,e.jsxs(n.ul,{children:[` +`,e.jsxs(n.li,{children:["Before diving into game development with Dojo in Unity, it’s recommended to have a solid understanding of how ",e.jsx(n.a,{href:"/cairo/models",children:"models"})," work in the Dojo environment."]}),` +`,e.jsx(n.li,{children:"This knowledge is crucial for effectively designing and implementing game elements that interact seamlessly between the blockchain and the game's user interface."}),` +`]}),` +`]}),` +`]}),` +`,e.jsxs(n.p,{children:["In summary, ",e.jsx(n.a,{href:"/cairo/models",children:"models"})," are the bridge between the onchain (Dojo) and off-chain (Unity) aspects of your game."]}),` +`,e.jsxs(n.h3,{id:"adding-models",children:["Adding Models",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#adding-models",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"The process to add models is:"}),` +`,e.jsxs(n.ol,{children:[` +`,e.jsx(n.li,{children:"Define in your dojo cairo contracts"}),` +`,e.jsx(n.li,{children:"Define in your Unity world making sure they accurately reflect"}),` +`]}),` +`,e.jsxs(n.h3,{id:"adding-systems",children:["Adding Systems",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#adding-systems",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"[insert]"}),` +`,e.jsxs(n.h3,{id:"entities",children:["Entities",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#entities",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Via toriiClient ",e.jsx(n.a,{href:"/cairo/entities",children:"models"})," are synced to Unity and are comprised of the models that you defined."]}),` +`,e.jsxs(n.h3,{id:"starter-project",children:["Starter Project",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#starter-project",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Get started by:"}),` +`,e.jsxs(n.ol,{start:"0",children:[` +`,e.jsx(n.li,{children:e.jsx(n.a,{href:"#prerequisites",children:"Prerequisites"})}),` +`,e.jsxs(n.li,{children:["Cloning the ",e.jsx(n.a,{href:"https://github.com/dojoengine/dojo.unity",children:"dojo.unity"})]}),` +`,e.jsx(n.li,{children:"Open project within Unity"}),` +`,e.jsxs(n.li,{children:["Run the ",e.jsx(n.a,{href:"https://github.com/dojoengine/dojo-starter-unity",children:"dojo-starter"})," project and make sure to have Katana and Torii running."]}),` +`]})]})}function d(i={}){const{wrapper:n}={...s(),...i.components};return n?e.jsx(n,{...i,children:e.jsx(r,{...i})}):r(i)}export{d as default,o as frontmatter}; diff --git a/dojo-book/docs/dist/assets/what-is-dojo-skF15-K7.js b/dojo-book/docs/dist/assets/what-is-dojo-skF15-K7.js new file mode 100644 index 00000000..741fb357 --- /dev/null +++ b/dojo-book/docs/dist/assets/what-is-dojo-skF15-K7.js @@ -0,0 +1,22 @@ +import{u as o,j as e}from"./index-m6NaWekR.js";const r={title:"What is Dojo?",description:"undefined"};function i(t){const n={a:"a",div:"div",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",...o(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(n.p,{children:e.jsx(n.img,{src:"/Dojo%20-%20Contracts.png",alt:"dojo"})}),` +`,e.jsx(n.header,{children:e.jsxs(n.h1,{id:"what-is-dojo",children:["What is Dojo?",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-is-dojo",children:e.jsx(n.div,{"data-autolink-icon":!0})})]})}),` +`,e.jsxs(n.p,{children:["Dojo is the culmination of lessons learned from attempts at building ",e.jsx(n.a,{href:"https://naavik.co/digest/primer-fully-on-chain-gaming",children:"onchain games"}),", an emerging sector in the gaming industry. Any developer who has endeavored to build an on-chain game recognizes the inherent engineering hurdles - a realization that drove us to create Dojo. Just as you wouldn't recreate Unity every time you develop a new game, the same principle applies here. Dojo is designed to handle the complex infrastructure, allowing developers to focus on the unique aspects of their games."]}),` +`,e.jsx(n.p,{children:"Dojo aspires to be the go-to tool for building provable games. It is radically open-source, and all contributions are welcome."}),` +`,e.jsx(n.hr,{}),` +`,e.jsxs(n.h2,{id:"stop-building-infrastructure-start-building-games",children:["Stop building infrastructure; start building games",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#stop-building-infrastructure-start-building-games",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Dojo's suite of tools takes the infrastructure complexity out of building on-chain games. It includes:"}),` +`,e.jsxs(n.h3,{id:"entity-component-system-ecs",children:["Entity Component System (ECS)",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#entity-component-system-ecs",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Dojo offers a standardized approach to building games on smart contracts. Recognizing the intricacies of game design, Dojo simplifies the development process, allowing creators to focus on gameplay logic. This standardization paves the way for an interconnected network of worlds, streamlining developer expertise and promoting game integration."}),` +`,e.jsx(n.p,{children:"Utilizing the ECS (Entity Component System) as its core architecture, Dojo effectively manages the state and behavior of Autonomous Worlds (AWs). This model revolves around systems acting on entities, which are collections of pure data components. Systems efficiently determine which entities to process based on persistent queries over these components."}),` +`,e.jsxs(n.p,{children:["Read detailed information about the ",e.jsx(n.a,{href:"/cairo/overview",children:"Dojo ECS"}),"."]}),` +`,e.jsxs(n.h3,{id:"torii---starknet-indexer",children:[e.jsx(n.a,{href:"/toolchain/torii/overview",children:"Torii"})," - Starknet Indexer",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#torii---starknet-indexer",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["Building on-chain games often involves grappling with the challenge of indexing on-chain state. However, Dojo standardizes contract states to mirror traditional relational databases. This setup enables the ",e.jsx(n.a,{href:"/toolchain/torii/overview",children:"Torii Indexer"})," to auto-index all contract states, ensuring efficient and streamlined queries. Torii then exposes these states via a GraphQL API or gRPC, allowing developers to easily query and retrieve data."]}),` +`,e.jsx(n.p,{children:"Using Torii drastically reduces the time and effort required to build on-chain games. It also eliminates the need to manually create indexers, which can be a tedious and error-prone process."}),` +`,e.jsxs(n.h3,{id:"katana---blazingly-fast-development-network",children:[e.jsx(n.a,{href:"/toolchain/katana/overview",children:"Katana"})," - Blazingly fast development network",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#katana---blazingly-fast-development-network",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Katana is a customizable Starknet development network. It is blazingly fast and allows you to iterate on your game logic swiftly."}),` +`,e.jsxs(n.h3,{id:"sozo-cli---cli-management-tool",children:[e.jsx(n.a,{href:"/toolchain/sozo/overview",children:"Sozo CLI"})," - CLI Management Tool",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sozo-cli---cli-management-tool",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"Dojo worlds are poised to become some of the largest contracts. Sozo is a CLI tool that assists you in managing your worlds. It enables you to create, build, test, and deploy your worlds. Additionally, you can craft new components and systems and register them with your world."}),` +`,e.jsxs(n.h3,{id:"what-dojo-doesnt-give-you",children:["What Dojo doesn't give you",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-dojo-doesnt-give-you",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.ol,{children:[` +`,e.jsx(n.li,{children:"Visual graphics - While Dojo provides networking and contracts, it doesn't offer graphical engines. You can bring your graphics of choice! Integrate your Dojo world with Unreal, Godot, or Unity."}),` +`]})]})}function s(t={}){const{wrapper:n}={...o(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(i,{...t})}):i(t)}export{s as default,r as frontmatter}; diff --git a/dojo-book/docs/dist/assets/world-options-GVwfXmVB.js b/dojo-book/docs/dist/assets/world-options-GVwfXmVB.js new file mode 100644 index 00000000..812469cb --- /dev/null +++ b/dojo-book/docs/dist/assets/world-options-GVwfXmVB.js @@ -0,0 +1,3 @@ +import{u as r,j as n}from"./index-m6NaWekR.js";const c=void 0;function o(t){const e={br:"br",code:"code",em:"em",p:"p",...r(),...t.components};return n.jsxs(e.p,{children:[n.jsx(e.code,{children:"--world"})," ",n.jsx(e.em,{children:"WORLD_ADDRESS"}),n.jsx(e.br,{}),` +`,"    The address of the World contract.",n.jsx(e.br,{}),` +`,"    ENV: ",n.jsx(e.code,{children:"DOJO_WORLD_ADDRESS"})]})}function d(t={}){const{wrapper:e}={...r(),...t.components};return e?n.jsx(e,{...t,children:n.jsx(o,{...t})}):o(t)}export{d as default,c as frontmatter}; diff --git a/dojo-book/docs/dist/assets/world-vFW-p2ED.js b/dojo-book/docs/dist/assets/world-vFW-p2ED.js new file mode 100644 index 00000000..df9441f4 --- /dev/null +++ b/dojo-book/docs/dist/assets/world-vFW-p2ED.js @@ -0,0 +1,60 @@ +import{u as t,j as e}from"./index-m6NaWekR.js";const i=void 0;function a(s){const n={a:"a",blockquote:"blockquote",code:"code",div:"div",figure:"figure",h2:"h2",h3:"h3",img:"img",p:"p",pre:"pre",span:"span",strong:"strong",...t(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsxs(n.blockquote,{children:[` +`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"To think about:"})," Consider Autonomous Worlds as sovereign blockchains residing within another blockchain - a nested blockchain, so to speak. Just as you can deploy contracts onto Ethereum to enhance its functionality, you can similarly introduce systems into the World contract to enrich its features. While anyone can contribute to the World, akin to Ethereum, authorization is required to interact with model state. There is a dedicated topic to ",e.jsx(n.a,{href:"/authorization",children:"Authorisation"}),"."]}),` +`]}),` +`,e.jsx(n.p,{children:e.jsx(n.img,{src:"/world-map.png",alt:"overview"})}),` +`,e.jsxs(n.h2,{id:"the-world-contract",children:["The World Contract",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#the-world-contract",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsx(n.p,{children:"The world contract functions as a central store for the world models and systems. Every contract that interacts with the world, must use the world contract address as the first parameter. This is how the world contract is able to manage the state of the world."}),` +`,e.jsx(n.p,{children:"Although we suggest strongly to structure your world around an ECS pattern you are not required to do so. You can simply use the dojo-models as a keypair store along with the supporting infrastructure."}),` +`,e.jsxs(n.blockquote,{children:[` +`,e.jsx(n.p,{children:"NOTE: Dojo core abstracts the world contract away, you do not write it and it is not meant to be altered when building a world. However, it's important to understand how it works and how it interacts with the rest of the system."}),` +`]}),` +`,e.jsxs(n.h3,{id:"events",children:["Events",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#events",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["The world contract emits all model events via the ",e.jsx(n.code,{children:"StoreSetRecord"})," event. This enables block explorers to reconstruct everything in the world by listening to one contract."]}),` +`,e.jsxs(n.h3,{id:"full-world-api",children:["Full World API",e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#full-world-api",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["The world exposes an interface which can be interacted with by any client. It is worth noting here that as a developer you don't deploy this world, it is deployed when you ",e.jsx(n.a,{href:"/toolchain/sozo/overview",children:"migrate"})," the world."]}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsxs(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:[e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"// World interface"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"#[starknet::interface]"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"trait IWorld {"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn metadata_uri(self: @T, resource: felt252) -> Span;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn set_metadata_uri(ref self: T, resource: felt252, uri: Span);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn model(self: @T, name: felt252) -> ClassHash;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn register_model(ref self: T, class_hash: ClassHash);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn deploy_contract(ref self: T, salt: felt252, class_hash: ClassHash) -> ContractAddress;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn upgrade_contract(ref self: T, address: ContractAddress, class_hash: ClassHash) -> ClassHash;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn uuid(ref self: T) -> usize;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn emit(self: @T, keys: Array, values: Span);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn entity("})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" self: @T, model: felt252, keys: Span, offset: u8, length: usize, layout: Span"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" ) -> Span;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn set_entity("})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" ref self: T,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" model: felt252,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" keys: Span,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" offset: u8,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" values: Span,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" layout: Span"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" );"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn entities("})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" self: @T,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" model: felt252,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" index: Option,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" values: Span,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" values_length: usize,"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" values_layout: Span"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" ) -> (Span, Span>);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn entity_ids(self: @T, model: felt252) -> Span;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn set_executor(ref self: T, contract_address: ContractAddress);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn executor(self: @T) -> ContractAddress;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn base(self: @T) -> ClassHash;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn delete_entity(ref self: T, model: felt252, keys: Span, layout: Span);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn is_owner(self: @T, address: ContractAddress, resource: felt252) -> bool;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn grant_owner(ref self: T, address: ContractAddress, resource: felt252);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn revoke_owner(ref self: T, address: ContractAddress, resource: felt252);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn is_writer(self: @T, model: felt252, system: ContractAddress) -> bool;"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn grant_writer(ref self: T, model: felt252, system: ContractAddress);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:" fn revoke_writer(ref self: T, model: felt252, system: ContractAddress);"})}),` +`,e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"}"})})]})})}),` +`,e.jsxs(n.h3,{id:"uuid",children:[e.jsx(n.code,{children:"uuid()"}),e.jsx(n.a,{"aria-hidden":"true",tabIndex:"-1",href:"#uuid",children:e.jsx(n.div,{"data-autolink-icon":!0})})]}),` +`,e.jsxs(n.p,{children:["It is often useful to generate unique IDs for entities. The ",e.jsx(n.code,{children:"uuid()"})," fn can be used to generate a unique ID."]}),` +`,e.jsx(n.p,{children:"Use it like this:"}),` +`,e.jsx(n.figure,{"data-rehype-pretty-code-figure":"",children:e.jsx(n.pre,{tabIndex:"0","data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",children:e.jsx(n.code,{"data-language":"rust,ignore","data-theme":"github-dark-dimmed github-light",style:{display:"grid"},children:e.jsx(n.span,{"data-line":"",children:e.jsx(n.span,{children:"let game_id = world.uuid();"})})})})})]})}function d(s={}){const{wrapper:n}={...t(),...s.components};return n?e.jsx(n,{...s,children:e.jsx(a,{...s})}):a(s)}export{d as default,i as frontmatter}; diff --git a/dojo-book/docs/dist/board.png b/dojo-book/docs/dist/board.png new file mode 100644 index 00000000..ce3ab4c8 Binary files /dev/null and b/dojo-book/docs/dist/board.png differ diff --git a/dojo-book/docs/dist/cairo/authorization/index.html b/dojo-book/docs/dist/cairo/authorization/index.html new file mode 100644 index 00000000..6ca8ebf2 --- /dev/null +++ b/dojo-book/docs/dist/cairo/authorization/index.html @@ -0,0 +1,35 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Authorization

+
+

Authorization is crucial to a world, just like how authorization is crucial to any smart contract.

+
+

As discussed in the World chapter, Autonomous Worlds (AWs) function as sovereign chains nested within a public blockchain. These Worlds are also open to the public. This structure allows anyone to enhance a World by deploying models or systems. However, this openness also introduces security considerations. Similar to Ethereum, interacting with a model's state within a System requires the appropriate authorization from the model owner.

+

Auth Architecture

+

Every time a set! is called in a System, the world checks if the System has authorization to update the model state. Only when the System possesses the necessary authorization, the set! is executed. The following diagram illustrates the authorization architecture.

+

Authorization Architecture

+

Providing Authorization

+
+

The deployer of the model is its initial owner. A model owner is able to grant the owner and writer roles. Only owners can grant a System the writer role which allows it to update the model.

+
+

sozo offers a convenient tool to authorize systems.

+
sozo auth writer Moves spawn
+

This command will generate a writer authorization for the spawn system to update the Moves model.

+ + diff --git a/dojo-book/docs/dist/cairo/commands/index.html b/dojo-book/docs/dist/cairo/commands/index.html new file mode 100644 index 00000000..776d2d71 --- /dev/null +++ b/dojo-book/docs/dist/cairo/commands/index.html @@ -0,0 +1,66 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Commands

+TL;DR +
    +
  • Commands are shorthand ways to write function calls
  • +
  • Commands abstract complex queries into shorthands
  • +
  • Commands are similar to rust macros
  • +
+

Understanding commands is key to understanding Dojo. You will leverage them heavily within the systems you design.

+

Commands in Dojo are generalized functions that are expanded at compile time to facilitate system execution. They provide a convenient way for systems to interact with the world state by abstracting common operations, such as retrieving or updating models, and generating unique IDs. By leveraging these commands, developers can streamline their system implementations and improve code readability.

+

Using commands

+

Commands are used within systems to interact with the world state. They are called using the following syntax:

+

The get! command

+

The get! command is used to retrieve models from the world state:

+
// world = calling world
+// caller = key of the entity that called the system
+// (Position, Moves) = tuple of models to retrieve
+let (position, moves) = get!(world, caller, (Position, Moves));
+

Here we are retrieving the Position and Moves models from the world state. We are also using the caller to retrieve the models for the current entity.

+

You can then use position and moves as you would as any other Cairo struct.

+

In the case that your model defines several keys as the resource example, you must provide a value for each key.

+
let player = get_caller_address();
+let location = 0x1234;
+ 
+let resource = get!(world, (player, location), (Resource));
+

If you use the get! command on a model that has never been set before, all the fields that are not #[key] are equal to 0 in the returned model, which is the default value in the storage.

+

The set! command

+

The set! command is used to update models state.

+
set !(world, (
+    Moves {
+        player: caller, remaining: 10
+    },
+    Position {
+        player: caller, x: position.x + 10, y: position.y + 10
+    },
+));
+ 
+// If the structs are already defined it can also be written as:
+set!(world, (moves, position));
+

Here we are updating the Moves and Position models in the world state using the caller as the entity id.

+

The emit! command

+

The emit! command is used to emit custom events. These events are indexed by Torii.

+
emit!(world, Moved { address: caller, direction });
+

This will emit these values which could be captured by a client or you could query these via Torii.

+

The delete! command

+

The delete! command deletes a model from the db.

+
delete!(world, Moved { address: caller, direction });
+ + diff --git a/dojo-book/docs/dist/cairo/config/index.html b/dojo-book/docs/dist/cairo/config/index.html new file mode 100644 index 00000000..a2094083 --- /dev/null +++ b/dojo-book/docs/dist/cairo/config/index.html @@ -0,0 +1,45 @@ + + + + + + + + Config – Dojo Book + + + + + + + + + + +
Skip to content

Config

+

Dojo worlds are defined in their Scarb.toml files. This is just a regular Scarb file which is an excellent Cairo package manager and project manager.

+

Full example of a Scarb.toml file:

+
[package]
+cairo-version = "2.4.0"
+name = "dojo_examples"
+version = "0.4.0"
+ 
+[cairo]
+sierra-replace-ids = true
+ 
+[dependencies]
+# IMPORTANT: Dojo should be pinned to a specific version or else your world might not compile.
+dojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.1" }
+ 
+[[target.dojo]]
+ 
+[tool.dojo]
+initializer_class_hash = "0xbeef"
+ 
+[tool.dojo.env]
+rpc_url = "http://localhost:5050/"
+# Default account for katana with seed = 0
+account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
+private_key = "0x1800000000300000180000000000030000000000003006001800006600"
+ + diff --git a/dojo-book/docs/dist/cairo/entities/index.html b/dojo-book/docs/dist/cairo/entities/index.html new file mode 100644 index 00000000..0277afc3 --- /dev/null +++ b/dojo-book/docs/dist/cairo/entities/index.html @@ -0,0 +1,43 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Entities

+
+

Entities are the primary key value within the world, to which models can be attached.

+
+

Different ECS systems handle entities in various ways. In Dojo, entities are treated as a primary key value within the world, to which models can be attached. To illustrate this concept, consider a simple example of a character in a game that has a Moves and a Position model.

+

When defining the models for this entity, it is important to note that we do not reference the entity directly. Instead, we simply provide two structs that the entity will contain.

+
#[derive(Models, Drop, Serde)]
+struct Moves {
+    #[key]
+    player: ContractAddress,
+    remaining: u8,
+}
+ 
+#[derive(Models, Drop, Serde)]
+struct Health {
+    #[key]
+    player: ContractAddress,
+    x: u32,
+    y: u32
+}
+
+

ECS Theory: Plenty has been written on ECS systems, to go deeper read ECS-FAQ

+
+ + diff --git a/dojo-book/docs/dist/cairo/enum/index.html b/dojo-book/docs/dist/cairo/enum/index.html new file mode 100644 index 00000000..83fc7216 --- /dev/null +++ b/dojo-book/docs/dist/cairo/enum/index.html @@ -0,0 +1,67 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Enum

+

Enums are very useful in game design, as they simplify the creation of clean, complex logic.

+

You can define an enum as follows:

+
 
+// This enum simply defines the states of a game.
+#[derive(Serde, Copy, Drop, Introspect, PartialEq, Print)]
+enum GameStatus {
+    NotStarted: (),
+    Lobby: (),
+    InProgress: (),
+    Finished: (),
+}
+ 
+// We define an into trait
+impl GameStatusFelt252 of Into<GameStatus, felt252> {
+    fn into(self: GameStatus) -> felt252 {
+        match self {
+            GameStatus::NotStarted => 0,
+            GameStatus::Lobby => 1,
+            GameStatus::InProgress => 2,
+            GameStatus::Finished => 3,
+        }
+    }
+}
+

Then within a trait you can create something like this:

+
#[derive(Model, Copy, Drop, Serde)]
+struct Game {
+    #[key]
+    game_id: u32,
+    status: GameStatus,
+}
+ 
+#[generate_trait]
+impl GameImpl of GameTrait {
+    fn assert_in_progress(self: Game) {
+        assert(self.status == GameStatus::InProgress, "Game not started");
+    }
+    fn assert_lobby(self: Game) {
+        assert(self.status == GameStatus::Lobby, "Game not in lobby");
+    }
+    fn assert_not_started(self: Game) {
+        assert(self.status == GameStatus::NotStarted, "Game already started");
+    }
+}
+
+

Read more about Cairo enums here

+
+ + diff --git a/dojo-book/docs/dist/cairo/events/index.html b/dojo-book/docs/dist/cairo/events/index.html new file mode 100644 index 00000000..97320689 --- /dev/null +++ b/dojo-book/docs/dist/cairo/events/index.html @@ -0,0 +1,92 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Events

+

Events play a pivotal role in decoding the dynamics of a Dojo world. Every time there's an update to a Model, the World contract emits these events. What's even more exciting is that you can craft your own custom events to fit specific needs! Moreover, thanks to Torii, all these events are seamlessly indexed, ensuring easy and efficient querying.

+

Model Events

+

Consider this example of a Moves model:

+
struct Moves {
+    #[key]
+    player: Address,
+    remaining: u32,
+}
+

When this model is updated, the World contract will emit an event with the following structure:

+
#[derive(Drop, starknet::Event)]
+struct StoreSetRecord {
+    table: felt252, // Moves
+    keys: Span<felt252>, // [player]
+    offset: u8, // offset for the value in the table
+    value: Span<felt252>, // [remaining]
+}
+

This will then be captured by Torii and indexed for querying. This will allow you to then reconstruct the state of your world.

+

Similarly, when a model is deleted, the World contract will emit an event with the following structure:

+
#[derive(Drop, starknet::Event)]
+struct StoreDelRecord {
+    table: felt252,
+    keys: Span<felt252>,
+}
+

World Events

+

The World contract also emits events when it's initialized and when new models and contracts are registered. These events are emitted with the following structures:

+
#[derive(Drop, starknet::Event)]
+struct WorldSpawned {
+    address: ContractAddress,
+    caller: ContractAddress
+}
+
#[derive(Drop, starknet::Event)]
+struct ModelRegistered {
+    name: felt252,
+    class_hash: ClassHash,
+    prev_class_hash: ClassHash
+}
+
#[derive(Drop, starknet::Event)]
+struct ContractDeployed {
+    salt: felt252,
+    class_hash: ClassHash,
+    address: ContractAddress,
+}
+ 
+#[derive(Drop, starknet::Event)]
+struct ContractUpgraded {
+    class_hash: ClassHash,
+    address: ContractAddress,
+}
+

These events are also captured by Torii and indexed for querying.

+

Custom Events

+

Within your game, emitting custom events can be highly beneficial. Fortunately, there's a handy emit! command that lets you release events directly from your world. These events are indexed by Torii.

+

Use it like so:

+
emit!(world, Moved { address, direction });
+

Include this in your contract and it will emit an event with the following structure:

+
#[derive(Drop, starknet::Event)]
+struct Moved {
+    address: felt252,
+    direction: felt252,
+}
+

Now a full example using a custom event:

+
fn move(ctx: Context, direction: Direction) {
+    let (mut position, mut moves) = get !(world, caller, (Position, Moves));
+    moves.remaining -= 1;
+ 
+    let next = next_position(position, direction);
+    set !(world, (moves, next));
+    emit !(world, Moved { address: caller, direction });
+}
+
+

Note: Read about the get! and set! macros in Commands.

+
+ + diff --git a/dojo-book/docs/dist/cairo/hello-dojo/index.html b/dojo-book/docs/dist/cairo/hello-dojo/index.html new file mode 100644 index 00000000..c1c9e748 --- /dev/null +++ b/dojo-book/docs/dist/cairo/hello-dojo/index.html @@ -0,0 +1,351 @@ + + + + + + + + Hello Dojo – Dojo Book + + + + + + + + + + +
Skip to content

Hello Dojo

+
+

This section assumes that you have already installed the Dojo toolchain and are familiar with Cairo. If not, please refer to the Getting Started section.

+
+

Dojo as an ECS in 15 Minutes

+

Although Dojo isn't exclusively an Entity Component System (ECS) framework, we recommend adopting this robust design pattern. In this context, systems shape the environment's logic, while components (models) mirror the state of the world. By taking this route, you'll benefit from a structured and modular framework that promises both flexibility and scalability in a continuously evolving world. If this seems a bit intricate at first, hang tight; we'll delve into the details shortly.

+

To start, let's set up a project to run locally on your machine. From an empty directory, execute:

+
sozo init
+

Congratulations! You now have a local Dojo project. This command creates a dojo-starter project in your current directory. It's the ideal starting point for a new project and equips you with everything you need to begin.

+

Anatomy of a Dojo Project

+

Inspect the contents of the dojo-starter project, and you'll notice the following structure (excluding the non-Cairo files):

+
src
+  - lib.cairo
+    - systems.cairo
+      - actions.cairo
+    - models.cairo
+      - position.cairo
+      - moves.cairo
+    - tests.cairo
+      - test_world.cairo
+Scarb.toml
+

Dojo projects bear a strong resemblance to typical Cairo projects. The primary difference is the inclusion of a special attribute tag used to define your data models. In this context, we'll refer to these models as components.

+

As we're crafting an ECS, we'll adhere to the specific terminology associated with Entity Component Systems.

+

Open the src/models/moves.cairo file to continue.

+
#[derive(Model, Drop, Serde)]
+struct Moves {
+    #[key]
+    player: ContractAddress,
+    remaining: u8,
+    last_direction: Direction
+}
+...rest of code
+

Notice the #[derive(Model, Drop, Serde)] attributes. For a model to be recognized, we must include Model. This signals to the Dojo compiler that this struct should be treated as a model.

+

Our Moves model houses a player field. At the same time, we have the #[key] attribute, it informs Dojo that this model is indexed by the player field. If this is unfamiliar to you, we'll clarify its importance later in the chapter. Essentially, it implies that you can query this model using the player field. Our Moves model also contains the remaining and last_direction fields

+

Open the src/models/position.cairo file to continue.

+
#[derive(Model, Copy, Drop, Serde)]
+struct Position {
+    #[key]
+    player: ContractAddress,
+    vec: Vec2,
+}
+ 
+#[derive(Copy, Drop, Serde, Introspect)]
+struct Vec2 {
+    x: u32,
+    y: u32
+}
+...rest of code
+

In a similar vein, we have a Position model that have a Vec2 data structure. Vec holds x and y values. Once again, this model is indexed by the player field.

+

Now, let's examine the src/systems/actions.cairo file:

+
// define the interface
+#[starknet::interface]
+trait IActions<TContractState> {
+    fn spawn(self: @TContractState);
+    fn move(self: @TContractState, direction: dojo_starter::models::moves::Direction);
+}
+ 
+// dojo decorator
+#[dojo::contract]
+mod actions {
+    use super::IActions;
+ 
+    use starknet::{ContractAddress, get_caller_address};
+    use dojo_starter::models::{position::{Position, Vec2}, moves::{Moves, Direction}};
+ 
+    // declaring custom event struct
+    #[event]
+    #[derive(Drop, starknet::Event)]
+    enum Event {
+        Moved: Moved,
+    }
+ 
+    // declaring custom event struct
+    #[derive(Drop, starknet::Event)]
+    struct Moved {
+        player: ContractAddress,
+        direction: Direction
+    }
+ 
+    // define functions in your contracts like this:
+    fn next_position(mut position: Position, direction: Direction) -> Position {
+        match direction {
+            Direction::None => { return position; },
+            Direction::Left => { position.vec.x -= 1; },
+            Direction::Right => { position.vec.x += 1; },
+            Direction::Up => { position.vec.y -= 1; },
+            Direction::Down => { position.vec.y += 1; },
+        };
+        position
+    }
+ 
+ 
+    // impl: implement functions specified in trait
+    #[abi(embed_v0)]
+    impl ActionsImpl of IActions<ContractState> {
+        // ContractState is defined by system decorator expansion
+        fn spawn(self: @ContractState) {
+            // Access the world dispatcher for reading.
+            let world = self.world_dispatcher.read();
+ 
+            // Get the address of the current caller, possibly the player's address.
+            let player = get_caller_address();
+ 
+            // Retrieve the player's current position from the world.
+            let position = get!(world, player, (Position));
+ 
+            // Retrieve the player's move data, e.g., how many moves they have left.
+            let moves = get!(world, player, (Moves));
+ 
+            // Update the world state with the new data.
+            // 1. Set players moves to 10
+            // 2. Move the player's position 100 units in both the x and y direction.
+            set!(
+                world,
+                (
+                    Moves { player, remaining: 100, last_direction: Direction::None },
+                    Position { player, vec: Vec2 { x: 10, y: 10 } },
+                )
+            );
+        }
+ 
+        // Implementation of the move function for the ContractState struct.
+        fn move(self: @ContractState, direction: Direction) {
+            // Access the world dispatcher for reading.
+            let world = self.world_dispatcher.read();
+ 
+            // Get the address of the current caller, possibly the player's address.
+            let player = get_caller_address();
+ 
+            // Retrieve the player's current position and moves data from the world.
+            let (mut position, mut moves) = get!(world, player, (Position, Moves));
+ 
+            // Deduct one from the player's remaining moves.
+            moves.remaining -= 1;
+ 
+            // Update the last direction the player moved in.
+            moves.last_direction = direction;
+ 
+            // Calculate the player's next position based on the provided direction.
+            let next = next_position(position, direction);
+ 
+            // Update the world state with the new moves data and position.
+            set!(world, (moves, next));
+ 
+            // Emit an event to the world to notify about the player's move.
+            emit!(world, Moved { player, direction });
+        }
+    }
+}
+

Breaking it down

+

System is a function in a contract

+

As you can see a System is like a regular function of a dojo(starknet) contract. It imports the Models we defined earlier and exposes two functions spawn and move. These functions are called when a player spawns into the world and when they move respectively.

+
// Retrieve the player's current position from the world.
+let position = get!(world, player, (Position));
+ 
+// Retrieve the player's move data, e.g., how many moves they have left.
+let moves = get!(world, player, (Moves));
+

Here we use get! command to retrieve the Position and Moves model for the player entity, which is the address of the caller.

+

Now the next line:

+
// Update the world state with the new data.
+// 1. Increase the player's remaining moves by 10.
+// 2. Move the player's position 10 units in both the x and y direction.
+set!(
+    world,
+    (
+        Moves {
+            player, remaining: moves.remaining + 10, last_direction: Direction::None
+        },
+        Position {
+            player, vec: Vec2 { x: position.vec.x + 10, y: position.vec.y + 10}
+        },
+    )
+);
+

Here we use the set! command to set the Moves and Position models for the player entity.

+

We covered a lot here in a short time. Let's recap:

+
    +
  • Explained the anatomy of a Dojo project
  • +
  • Explained the importance of the #[derive(Model)]attribute
  • +
  • Explained the spawn and move functions
  • +
  • Explained the Moves and Position struct
  • +
  • Touched on the get! and set! commands
  • +
+

Run it locally!

+

Now that we've covered some theory, let's build the Dojo project! In your primary terminal:

+
sozo build
+

That compiled the models and system into an artifact that can be deployed! Simple as that!

+

Now, let's deploy it to Katana! First, we need to get Katana running. Open a second terminal and execute:

+
katana --disable-fee
+

Success! Katana should now be running locally on your machine. Now, let's deploy! In your primary terminal, execute:

+
sozo migrate
+

This will deploy the artifact to Katana. You should see terminal output similar to this:

+
 
+Migration account: 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
+ 
+World name: dojo_examples
+ 
+[1] 🌎 Building World state....
+  > No remote World found
+[2] 🧰 Evaluating Worlds diff....
+  > Total diffs found: 5
+[3] 📦 Preparing for migration....
+  > Total items to be migrated (5): New 5 Update 0
+ 
+# Executor
+  > Contract address: 0x59f31686991d7cac25a7d4844225b9647c89e3e1e2d03460dbc61e3fbfafc59
+# Base Contract
+  > Class Hash: 0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f
+# World
+  > Contract address: 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138
+# Models (2)
+Moves
+  > Class hash: 0x509a65bd8cc5516176a694a3b3c809011f1f0680959c567b3189e60ddab7ce1
+Position
+  > Class hash: 0x52a1da1853c194683ca5d6d154452d0654d23f2eacd4267c555ff2338e144d6
+  > Registered at: 0x82d996aab290f086314745685c6f05bd69730d46589339763202de5264b1b6
+# Contracts (1)
+actions
+  > Contract address: 0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd
+ 
+🎉 Successfully migrated World at address 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138
+ 
+ Updating manifest.json...
+ 
+ Done.
+ 
+

Your 🌎 is now deployed at 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138!

+

This establishes the world address for your project.

+

Let's discuss the Scarb.toml file in the project. This file contains environment variables that make running CLI commands in your project a breeze (read more about it here). Make sure your file specifies the version of Dojo you have installed! In this case version 0.4.4.

+
[dependencies]
+dojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.4" }
+

Indexing

+

With your local world address established, let's delve into indexing. You can index the entire world. To accomplish this we have to copy your world address from the output of sozo migrate. Now Open a new terminal and input this simple command that includes your own world address:

+
torii --world 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138
+

Running the command mentioned above starts a Torii server on your local machine. This server uses SQLite as its database and is accessible at http://0.0.0.0:8080/graphql. Torii will automatically organize your data into tables, making it easy for you to perform queries using GraphQL. When you run the command, you'll see terminal output that looks something like this:

+
2023-10-18T06:49:48.184233Z  INFO torii::server: 🚀 Torii listening at http://0.0.0.0:8080
+2023-10-18T06:49:48.184244Z  INFO torii::server: Graphql playground: http://0.0.0.0:8080/graphql
+ 
+2023-10-18T06:49:48.185648Z  INFO torii_core::engine: processed block: 0
+2023-10-18T06:49:48.186129Z  INFO torii_core::engine: processed block: 1
+2023-10-18T06:49:48.186720Z  INFO torii_core::engine: processed block: 2
+2023-10-18T06:49:48.187202Z  INFO torii_core::engine: processed block: 3
+2023-10-18T06:49:48.187674Z  INFO torii_core::engine: processed block: 4
+2023-10-18T06:49:48.188215Z  INFO torii_core::engine: processed block: 5
+2023-10-18T06:49:48.188611Z  INFO torii_core::engine: processed block: 6
+2023-10-18T06:49:48.188985Z  INFO torii_core::engine: processed block: 7
+2023-10-18T06:49:48.199592Z  INFO torii_core::processors::register_model: Registered model: Moves
+2023-10-18T06:49:48.210032Z  INFO torii_core::processors::register_model: Registered model: Position
+2023-10-18T06:49:48.210571Z  INFO torii_core::engine: processed block: 8
+2023-10-18T06:49:48.211678Z  INFO torii_core::engine: processed block: 9
+2023-10-18T06:49:48.212335Z  INFO torii_core::engine: processed block: 10
+ 
+

You can observe that our Moves and Position models have been successfully registered. +Next, let's use the GraphiQL IDE to retrieve data from the Moves model. In your web browser, navigate to http://0.0.0.0:8080/graphql, and enter the following query:

+
query {
+  model(id: "Moves") {
+    id
+    name
+    classHash
+    transactionHash
+    createdAt
+  }
+}
+

After you run the query, you will receive an output like this:

+
{
+  "data": {
+    "model": {
+      "id": "Moves",
+      "name": "Moves",
+      "classHash": "0x64495ca6dc1dc328972697b30468cea364bcb7452bbb6e4aaad3e4b3f190147",
+      "transactionHash": "",
+      "createdAt": "2023-12-15 18:07:22"
+    }
+  }
+}
+

Awesome, now let's work with subscriptions to get real-time updates. Let's clean up your workspace on the GraphiQL IDE and input the following subscription:

+
subscription {
+  entityUpdated {
+    id
+    keys
+    eventId
+    createdAt
+    updatedAt
+  }
+}
+

Once you execute the subscription, you will receive notifications whenever new entities are updated or created. For now, don't make any changes to it and proceed to create a new entity.

+

To accomplish this, we have to go back to our primary terminal and check the contracts section.

+
# Contracts (1)
+actions
+  > Contract address: 0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd
+

We have to use actions contract address to start to create entities. In your main local terminal, run the following command:

+
sozo execute 0x31571485922572446df9e3198a891e10d3a48e544544317dbcbb667e15848cd spawn
+

By running this command, you've activated the spawn system, resulting in the creation of a new entity. This action establishes a local world that you can interact with.

+

Now, go back to your GraphiQL IDE, and you will notice that you have received the subscription's results, which should look something like this:

+
{
+  "data": {
+    "entityUpdated": {
+      "id": "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",
+      "keys": [
+        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
+      ],
+      "eventId": "0x000000000000000000000000000000000000000000000000000000000000000e:0x0000:0x0000",
+      "createdAt": "2023-12-15 18:07:22",
+      "updatedAt": "2023-12-15 18:10:56"
+    }
+  }
+}
+--------------------------------------------------------------------------------------------------------
+{
+  "data": {
+    "entityUpdated": {
+      "id": "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",
+      "keys": [
+        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
+      ],
+      "eventId": "0x000000000000000000000000000000000000000000000000000000000000000e:0x0000:0x0001",
+      "createdAt": "2023-12-15 18:07:22",
+      "updatedAt": "2023-12-15 18:10:56"
+    }
+  }
+}
+

In the GraphiQL IDE, by clicking the DOCS-button on the right, you can open the API documentation. This documentation is auto-generated based on our schema definition and displays all API operations and data types of our schema.. In order to know more about query and subscription, you can jump to GraphQL section. +We've covered quite a bit! Here's a recap:

+
    +
  • Built a Dojo world
  • +
  • Deployed the project to Katana
  • +
  • Indexed the world with Torii
  • +
  • Ran the spawn system locally
  • +
  • Interacted with GraphQL
  • +
+

Next Steps

+

This overview provides a rapid end-to-end glimpse into Dojo. However, the potential of these worlds is vast! Designed to manage hundreds of systems and components, Dojo is equipped for expansive creativity. So, what will you craft next?

+ + diff --git a/dojo-book/docs/dist/cairo/metadata/index.html b/dojo-book/docs/dist/cairo/metadata/index.html new file mode 100644 index 00000000..f4acdf47 --- /dev/null +++ b/dojo-book/docs/dist/cairo/metadata/index.html @@ -0,0 +1,36 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Metadata

+

Dojo supports associating offchain metadata with the world contract and other deployed contracts. This can provide additional context about the world, such as it's name, description, social links and other media. Enabling external services to easily index and distribute worlds and experiences built on them.

+

World Metadata

+

During migration, sozo will automatically manage the worlds metadata for you, uploading it to ipfs and setting it in the world contract. It does so by parsing the metadata defined in the projects Scarb.toml.

+

To set a worlds metadata, create the following section in your Scarb.toml:

+
[tool.dojo.world]
+name = "example"
+description = "example world"
+icon_uri = "file://assets/icon.png"
+cover_uri = "file://assets/cover.png"
+website = "https://dojoengine.org"
+socials.x = "https://twitter.com/dojostarknet"
+

The toolchain supports the name, description, icon_uri, cover_uri, website and socials attributes by default. _uri attributes can point to a asset in the repo using the file:// schema or to remote resouces using either ipfs:// or https://. Arbitrary social links can be set by setting a key value on the socials attribute. For example, we could add a socials.github = "...".

+

During migration, sozo will upload any local assets to ipfs, replace the corresponding uris, upload the metadata json to ipfs, and set the metadata_uri for the world (resource 0).

+

Contract Metadata

+

It is possible for contract owners to set a metadata_uri for any contract. However, this specification has not yet been defined and it is not supported by the toolchain at this time.

+ + diff --git a/dojo-book/docs/dist/cairo/migration/0/index.html b/dojo-book/docs/dist/cairo/migration/0/index.html new file mode 100644 index 00000000..b46a5e34 --- /dev/null +++ b/dojo-book/docs/dist/cairo/migration/0/index.html @@ -0,0 +1,182 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Migration Guide to 0.3.0

+

0.3.0 introduced some breaking changes to Systems and Models which requires reworking of your worlds.

+ +

Components to Models

+

In version 0.3.0, "components" have been renamed to "models". This has been done due to Cairo introducing the concept of Components natively.

+

You must:

+
    +
  • Replace #[component] with #[model].
  • +
  • Update #[derive(Component)] to #[derive(Model)] throughout your code.
  • +
+

Note: Ensure all related files and imports are updated accordingly.

+

Changes in Model Implementation

+

The trait SerdeLen is no longer implemented for models. If you relied on this previously, you should now use SchemaIntrospection.

+

Schema Introduction

+

For models containing complex types, it's crucial to implement the SchemaIntrospection trait.

+

Consider the model below:

+
struct Card {
+ 
+    #[key]
+    token_id: u256,
+    /// The card's designated role.
+    role: Roles,
+}
+

For complex types, like Roles in the above example, you need to implement SchemaIntrospection. Here's how:

+
impl RolesSchemaIntrospectionImpl of SchemaIntrospection<Roles> {
+    #[inline(always)]
+    fn size() -> usize {
+        1 // Represents the byte size of the enum.
+    }
+ 
+    #[inline(always)]
+    fn layout(ref layout: Array<u8>) {
+        layout.append(8); // Specifies the layout byte size;
+    }
+ 
+    #[inline(always)]
+    fn ty() -> Ty {
+        Ty::Enum(
+            Enum {
+                name: 'Roles',
+                attrs: array![].span(),
+                children: array![
+                    ('Goalkeeper', serialize_member_type(@Ty::Tuple(array![].span()))),
+                    ('Defender', serialize_member_type(@Ty::Tuple(array![].span()))),
+                    ('Midfielder', serialize_member_type(@Ty::Tuple(array![].span()))),
+                    ('Attacker', serialize_member_type(@Ty::Tuple(array![].span()))),
+                ]
+                .span()
+            }
+        )
+    }
+}
+

Key Takeaways from custom types:

+
    +
  • size: Defines the byte size of the type.
  • +
  • layout: Outlines the byte structure/layout for the type. Validate and adjust as necessary.
  • +
  • ty: Details the specific type, attributes, and subcomponents. For enums, like Roles, you need to specify each member and its type.
  • +
+

Systems Update

+

Systems in 0.3.0 are very similar now to Cairo Contracts. You can write your systems just like regular contracts, and each dojo contract can contain mulitple systems.

+

Important high level changes:

+
    +
  • Systems are now starknet contracts
  • +
  • Define Interfaces for each system contract
  • +
  • New optional #[dojo::contract] decorator defining systems
  • +
  • Multiple systems per dojo contract, rather than singular
  • +
  • execute is no longer required system selector name
  • +
+

Interface Creation

+

System management has been revamped. Start by defining an interface for each system, which specifies its implementation:

+
#[starknet::interface]
+trait ICreateCard<TContractState> {
+    fn create_card(
+        self: @TContractState,
+        world: IWorldDispatcher,
+        token_id: u256,
+        dribble: u8,
+        defense: u8,
+        cost: u8,
+        role: Roles,
+        is_captain: bool
+    );
+}
+

Ensure the trait is typed with TContractState.

+

Note: Earlier versions required functions within the system to be named execute. This is no longer the case.

+

Interface Implementation

+

To implement the interface:

+
    +
  1. Add #[abi(embed_v0)] before each method.
  2. +
  3. Ensure to reference the created interface in the module with use super::ICreateCard;.
  4. +
+
#[abi(embed_v0)]
+impl CreateCardImpl of ICreateCard<ContractState> {
+    fn create_card(
+        self: @ContractState,
+        world: IWorldDispatcher,
+        token_id: u256,
+        dribble: u8,
+        defense: u8,
+        cost: u8,
+        role: Roles,
+        is_captain: bool
+    ) {
+        // your logic here
+    }
+}
+

This then allows the create_card to be called just like a regular starknet function.

+

#[dojo::contract] decorator

+

0.3.0 introduces a new optional decorator #[dojo::contract] which indicates to the compiler to inject imports and the world dispatcher. This allows for minimal boilerplate.

+
#[dojo::contract]
+mod move {
+....code TODO
+}
+

Events

+

Events should now reside within the models. Here's an example of how to migrate your events:

+

Previous Format:

+
#[derive(Drop, starknet::Event, Copy)]
+struct DeckCreated {
+    player: ContractAddress,
+    token_list: Span<u256>,
+}
+

New Format:

+
#[event]
+#[derive(Drop, starknet::Event)]
+enum Event {
+    DeckCreated: DeckCreated
+}
+ 
+#[derive(Drop, starknet::Event)]
+struct DeckCreated {
+    player: ContractAddress,
+    token_list: Span<u256>,
+}
+

Testing Changes

+

Setup

+

Testing has seen significant changes with the change to systems as Contracts. Instead of using world.execute, use the dispatcher.

+
    +
  1. Import necessary modules and traits:
  2. +
+
use dojo::test_utils::deploy_contract;
+use tsubasa::systems::{ICreateCardDispatcher, ICreateCardDispatcherTrait};
+
    +
  1. Deploy the contract and instantiate the dispatcher:
  2. +
+
let contract_create_card = deploy_contract(
+    create_card_system::TEST_CLASS_HASH, array![].span()
+);
+let create_card_system = ICreateCardDispatcher { contract_address: contract_create_card };
+

Function Testing

+

With the contract deployed and the dispatcher instantiated, proceed to test your functions:

+
// ... (previous setup code)
+ 
+let result = create_card_system.create_card(
+    // ... provide necessary parameters here
+);
+ 
+// Assert or validate the 'result' as per your test conditions
+ + diff --git a/dojo-book/docs/dist/cairo/migration/index.html b/dojo-book/docs/dist/cairo/migration/index.html new file mode 100644 index 00000000..25d4fb00 --- /dev/null +++ b/dojo-book/docs/dist/cairo/migration/index.html @@ -0,0 +1,23 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content
+ + diff --git a/dojo-book/docs/dist/cairo/models/index.html b/dojo-book/docs/dist/cairo/models/index.html new file mode 100644 index 00000000..b0927eff --- /dev/null +++ b/dojo-book/docs/dist/cairo/models/index.html @@ -0,0 +1,256 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Models

+
+

Models = Data

+
+TL;DR +
    +
  • Models store structured data in your world.
  • +
  • Models are Cairo structs with additional features.
  • +
  • Models can implement traits.
  • +
  • Use the #[derive(Model)] decorator to define them.
  • +
  • Custom enums and types are supported.
  • +
  • Define the primary key using the #[key] attribute.
  • +
+

Models are Structs

+

Models are structs annotated with the #[derive(Model)] attribute. Consider these models as a key-value store, where the #[key] attribute is utilized to define the primary key. While models can contain any number of fields, adhering to best practices in Entity-Component-System (ECS) design involves maintaining small, isolated models.

+

This approach fosters modularity and composability, enabling you to reuse models across various entity types.

+
#[derive(Model, Copy, Drop, Serde)]
+struct Moves {
+    #[key]
+    player: ContractAddress,
+    remaining: u8,
+}
+

The #[key] attribute

+

The #[key] attribute indicates to Dojo that this model is indexed by the player field. A field that is identified as a #[key] is not stored. It is used by the dojo database system to uniquely identify the storage location that contains your model.

+

You need to define at least one key for each model, as this is how you query the model. However, you can create composite keys by defining multiple fields as keys. If you define multiple keys, they must all be provided to query the model.

+
#[derive(Model, Copy, Drop, Serde)]
+struct Resource {
+    #[key]
+    player: ContractAddress,
+    #[key]
+    location: ContractAddress,
+    balance: u8,
+}
+

In this case you then would set the model with both the player and location fields:

+
set!(
+    world,
+    (
+        Resource {
+            player: caller,
+            location: 12,
+            balance: 10
+        },
+    )
+);
+

To retrieve a model with a composite key using the get! command, you must provide a value for each key as follow:

+
let player = get_caller_address();
+let location = 0x1234;
+ 
+let resource = get!(world, (player, location), (Resource));
+

Implementing Traits

+

Models can implement traits. This is useful for defining common functionality across models. For example, you may want to define a Position model that implements a PositionTrait trait. This trait could define functions such as is_zero and is_equal which could be used when accessing the model.

+
trait PositionTrait {
+    fn is_zero(self: Position) -> bool;
+    fn is_equal(self: Position, b: Position) -> bool;
+}
+ 
+impl PositionImpl of PositionTrait {
+    fn is_zero(self: Position) -> bool {
+        if self.x - self.y == 0 {
+            return true;
+        }
+        false
+    }
+ 
+    fn is_equal(self: Position, b: Position) -> bool {
+        self.x == b.x && self.y == b.y
+    }
+}
+

Custom Setting models

+

Suppose we need a place to keep a global value with the flexibility to modify it in the future. Take, for instance, a global combat_cool_down parameter that defines the duration required for an entity to be primed for another attack. To achieve this, we can craft a model dedicated to storing this value, while also allowing for its modification via a decentralized governance model.

+

To establish these models, you'd follow the usual creation method. However, when initializing them, employ a constant identifier, such as GAME_SETTINGS_ID.

+
const GAME_SETTINGS_ID: u32 = 9999999999999;
+ 
+#[derive(model, Copy, Drop, Serde)]
+struct GameSettings {
+    #[key]
+    game_settings_id: u32,
+    combat_cool_down: u32,
+}
+

Types

+

Support model types:

+
    +
  • u8
  • +
  • u16
  • +
  • u32
  • +
  • u64
  • +
  • u128
  • +
  • u256
  • +
  • ContractAddress
  • +
  • Enums
  • +
  • Custom Types
  • +
+

It is currently not possible to use Arrays.

+

Custom Types + Enums

+

For models containing complex types, it's crucial to implement the SchemaIntrospection trait.

+

Consider the model below:

+
struct Card {
+    #[key]
+    token_id: u256,
+    /// The card's designated role.
+    role: Roles,
+}
+

For complex types, like Roles in the above example, you need to implement SchemaIntrospection. Here's how:

+
impl RolesSchemaIntrospectionImpl for SchemaIntrospection<Roles> {
+    #[inline(always)]
+    fn size() -> usize {
+        1 // Represents the byte size of the enum.
+    }
+ 
+    #[inline(always)]
+    fn layout(ref layout: Array<u8>) {
+        layout.append(8); // Specifies the layout byte size;
+    }
+ 
+    #[inline(always)]
+    fn ty() -> Ty {
+        Ty::Enum(
+            Enum {
+                name: 'Roles',
+                attrs: array![].span(),
+                children: array![
+                    ('Goalkeeper', serialize_member_type(@Ty::Tuple(array![].span()))),
+                    ('Defender', serialize_member_type(@Ty::Tuple(array![].span()))),
+                    ('Midfielder', serialize_member_type(@Ty::Tuple(array![].span()))),
+                    ('Attacker', serialize_member_type(@Ty::Tuple(array![].span()))),
+                ]
+                .span()
+            }
+        )
+    }
+}
+

In practice with modularity in mind

+

Consider a tangible analogy: Humans and Goblins. While they possess intrinsic differences, they share common traits, such as having a position and health. However, humans possess an additional model. Furthermore, we introduce a Counter model, a distinct feature that tallies the numbers of humans and goblins.

+
#[derive(Model, Copy, Drop, Serde)]
+struct Potions {
+    #[key]
+    entity_id: u32,
+    quantity: u8,
+}
+ 
+#[derive(Model, Copy, Drop, Serde)]
+struct Health {
+    #[key]
+    entity_id: u32,
+    health: u8,
+}
+ 
+#[derive(Model, Copy, Drop, Serde)]
+struct Position {
+    #[key]
+    entity_id: u32,
+    x: u32,
+    y: u32
+}
+ 
+// Special counter model
+#[derive(Model, Copy, Drop, Serde)]
+struct Counter {
+    #[key]
+    counter: u32,
+    goblin_count: u32,
+    human_count: u32,
+}
+

So the Human will have a Potions, Health and Position model, and the Goblin will have a Health and Position model. By doing we save having to create Health and Position models for each entity type.

+

So then a contract would look like this:

+
#[dojo::contract]
+mod spawnHuman {
+    use array::ArrayTrait;
+    use box::BoxTrait;
+    use traits::Into;
+    use dojo::world::Context;
+ 
+    use dojo_examples::models::Position;
+    use dojo_examples::models::Health;
+    use dojo_examples::models::Potions;
+    use dojo_examples::models::Counter;
+ 
+    // we can set the counter value as a const, then query it easily! This pattern is useful for settings.
+    const COUNTER_ID: u32 = 9999999999999;
+ 
+    // impl: implement functions specified in trait
+    #[abi(embed_v0)]
+    impl GoblinActionsImpl of IGoblinActions<ContractState> {
+        fn goblin_actions(self: @ContractState, entity_id: u32) {
+            let world = self.world_dispatcher.read();
+ 
+            let counter = get!(world, COUNTER_ID, (Counter));
+ 
+            let human_count = counter.human_count + 1;
+            let goblin_count = counter.goblin_count + 1;
+ 
+            // spawn a human
+            set!(
+                world,
+                (
+                    Health {
+                        entity_id: human_count, health: 100
+                        },
+                    Position {
+                        entity_id: human_count, x: position.x + 10, y: position.y + 10,
+                        },
+                    Potions {
+                        entity_id: human_count, quantity: 10
+ 
+                    },
+                )
+            );
+ 
+            // spawn a goblin
+            set!(
+                world,
+                (
+                    Health {
+                        entity_id: goblin_count, health: 100
+                        },
+                    Position {
+                        entity_id: goblin_count, x: position.x + 10, y: position.y + 10,
+                        },
+                )
+            );
+ 
+            // increment the counter
+            set!(
+                world,
+                (
+                    Counter {
+                        counter: COUNTER_ID, human_count: human_count, goblin_count: goblin_count
+                    },
+                )
+            );
+        }
+    }
+}
+
+

A complete example can be found in the Dojo Starter

+
+ + diff --git a/dojo-book/docs/dist/cairo/origami/index.html b/dojo-book/docs/dist/cairo/origami/index.html new file mode 100644 index 00000000..aac41f09 --- /dev/null +++ b/dojo-book/docs/dist/cairo/origami/index.html @@ -0,0 +1,36 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

origami

+
+

The magic of origami is in seeing a single piece of cairo evolve into a masterpiece through careful folds.

+
+

What is Origami?

+

Origami is the native dojo collection of primitives that can be imported into your game.

+

It contains:

+
    +
  • algebra
  • +
  • defi
  • +
  • hex map
  • +
  • random
  • +
  • security
  • +
  • erc tokens
  • +
+

Find the Origami repo

+ + diff --git a/dojo-book/docs/dist/cairo/overview/index.html b/dojo-book/docs/dist/cairo/overview/index.html new file mode 100644 index 00000000..6f0eb4dd --- /dev/null +++ b/dojo-book/docs/dist/cairo/overview/index.html @@ -0,0 +1,93 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content
+

You should have a good understanding of Cairo before proceeding. If you're unfamiliar with Cairo, we recommend you read the Cairo documentation first.

+
+

A New Approach to Onchain Game Development

+

Dojo provides an advanced abstraction layer over Cairo, mirroring React's relationship with JavaScript. Its specialized architecture simplifies game design and development.

+

By leveraging Dojo, developers can use succinct commands that transform into comprehensive queries at compile time.

+

Delving into the Architecture

+

Dojo efficiently encapsulates boilerplate contracts within the compiler, letting developers concentrate on the distinct aspects of their game or app.

+

Consider this as the most basic Dojo world setup:

+
- src
+  - main.cairo
+  - lib.cairo
+- Scarb.toml
+

While seemingly simple, behind the scenes Dojo compiler generates foundational contracts, setting the stage for you to focus purely on data and logic.

+

Lets take a look at the main.cairo:

+
use starknet::ContractAddress;
+ 
+// dojo data models
+#[derive(Model, Copy, Drop, Serde)]
+struct Position {
+    #[key] // primary key
+    player: ContractAddress,
+    vec: Vec2,
+}
+ 
+// regular cairo struct
+#[derive(Copy, Drop, Serde, Introspect)]
+struct Vec2 {
+    x: u32,
+    y: u32
+}
+ 
+// interface
+#[starknet::interface]
+trait IPlayerActions<TContractState> {
+    fn spawn(self: @TContractState);
+}
+ 
+// contract
+#[dojo::contract]
+mod player_actions {
+    use starknet::{ContractAddress, get_caller_address};
+    use super::{Position, Vec2};
+    use super::IPlayerActions;
+ 
+    #[abi(embed_v0)]
+    impl PlayerActionsImpl of IPlayerActions<ContractState> {
+        //
+        // This is how we interact with the world contract.
+        //
+        fn spawn(self: @ContractState) {
+            // Access the world dispatcher for reading.
+            let world = self.world_dispatcher.read();
+ 
+            // get player address
+            let player = get_caller_address();
+ 
+            // dojo command - get player position
+            let position = get!(world, player, (Position));
+ 
+            // dojo command - set player position
+            set!(world, (Position { player, vec: Vec2 { x: 10, y: 10 } }));
+        }
+    }
+}
+

Breakdown

+

Dojo contract is just a regular Cairo contract, with some dojo specifics.

+

Position struct - the dojo model

+

In a Dojo world, state is defined using models. These are structs marked with the #[derive(Model)] attribute, functioning similarly to a key-pair store. The primary key for a model is indicated using the #[key] attribute; for instance, the player field serves as the primary key in this context.

+

Read more about models here.

+

spawn function - a dojo system

+

In the spawn function, we just call self.world_dispatcher. This provides a gateway to the world contract. This facilitates the effortless utilization of the get! and set! commands, allowing seamless interaction with the world contract.

+

Commands, a significant innovation in Dojo, are further explored here.

+ + diff --git a/dojo-book/docs/dist/cairo/systems/index.html b/dojo-book/docs/dist/cairo/systems/index.html new file mode 100644 index 00000000..0fa2d7e6 --- /dev/null +++ b/dojo-book/docs/dist/cairo/systems/index.html @@ -0,0 +1,156 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Systems

+
+

IMPORTANT: Before defining your systems, prioritize permissions. Plan carefully to ensure proper access and security.

+
+TL;DR +
    +
  • Systems function as contract methods.
  • +
  • Contracts containing Systems gain permissions to write to models.
  • +
  • Systems pass a world address as their first parameter unless utilizing the #[dojo::contract] decorator.
  • +
  • Systems engage the world contract to alter models' state.
  • +
  • The world contract is invoked through systems.
  • +
  • Systems ought to be concise and specific.
  • +
  • In most scenarios, systems are stateless.
  • +
+

What are Systems?

+

Within dojo we define systems as functions within a Dojo Contract that act on the world.

+

Systems play a pivotal role in your world's logic, directly mutating its component states. It's important to understand that to enact these mutations, a system needs explicit permission from the models owner.

+

System Permissions

+

Since the whole contract is given write access to the model, it is important to be careful when defining systems. A simple way to think about it is:

+

System Permissions

+

System Structure

+

Every system function starts with a world address as its initial parameter. This design permits these functions to alter the world's state. Notably, this structure also makes systems adaptable and reusable across multiple worlds!

+

Let's look at the simplest possible system which mutates the state of the Moves component.

+
+

NOTE: This is not using the #[dojo::contract] attribute meaning it was to accept the world as a parameter.

+
+
#[starknet::contract]
+mod player_actions {
+    use starknet::{ContractAddress, get_caller_address};
+    use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
+    use dojo_examples::components::{Position, Moves, Direction, Vec2};
+    use dojo_examples::utils::next_position;
+    use super::IPlayerActions;
+ 
+    // no storage
+    #[storage]
+    struct Storage {}
+ 
+    // implementation of the PlayerActions interface
+    #[abi(embed_v0)]
+    impl PlayerActionsImpl of IPlayerActions<ContractState> {
+        fn spawn(self: @ContractState, world: IWorldDispatcher) {
+            let player = get_caller_address();
+            let position = get!(world, player, (Position));
+            set!(
+                world,
+                (
+                    Moves {
+                        player,
+                        remaining: 10,
+                        last_direction: Direction::None(())
+                    }
+                )
+            );
+        }
+    }
+}
+

Breaking it down

+

System is a function in a contract

+

As you can see a System is like a regular function of a Starknet contract. This contract can include storage, and it can implement interfaces.

+

Spawn function

+

The spawn function is currently the only system that exists in this contract. It is called when a player spawns into the world. It is responsible for setting up the player's initial state.

+

The #[dojo::contract] Decorator

+

All Starknet contracts are defined using the #[starknet::contract] decorator, ensuring accurate compilation. In this context, Dojo introduces the #[dojo::contract] decorator, which aims to minimize boilerplate in contract writing.

+

The #[dojo::contract] decorator allows developers to omit including world: IWorldDispatcher as a parameter. Behind the scenes, it injects the world into the contract and eliminates some imports, thereby streamlining the development process.

+
#[dojo::contract]
+mod player_actions {
+    use starknet::{ContractAddress, get_caller_address};
+    use dojo_examples::models::{Position, Moves, Direction, Vec2};
+    use dojo_examples::utils::next_position;
+    use super::IPlayerActions;
+ 
+    #[event]
+    #[derive(Drop, starknet::Event)]
+    enum Event {
+        Moved: Moved,
+    }
+ 
+    #[derive(Drop, starknet::Event)]
+    struct Moved {
+        player: ContractAddress,
+        direction: Direction
+    }
+ 
+    // impl: implement functions specified in trait
+    #[abi(embed_v0)]
+    impl PlayerActionsImpl of IPlayerActions<ContractState> {
+        // ContractState is defined by system decorator expansion
+        fn spawn(self: @ContractState) {
+            // world dispatcher
+            let world = self.world_dispatcher.read();
+ 
+            // player
+            let player = get_caller_address();
+ 
+            // get the position
+            let position = get!(world, player, (Position));
+ 
+            // set the position
+            set!(
+                world,
+                (
+                    Moves { player, remaining: 10, last_direction: Direction::None(()) },
+                    Position { player, vec: Vec2 { x: 10, y: 10 } },
+                )
+            );
+        }
+ 
+        fn move(self: @ContractState, direction: Direction) {
+            // world dispatcher
+            let world = self.world_dispatcher.read();
+ 
+            // player
+            let player = get_caller_address();
+ 
+            // get the position and moves
+            let (mut position, mut moves) = get!(world, player, (Position, Moves));
+ 
+            // adjust
+            moves.remaining -= 1;
+            moves.last_direction = direction;
+ 
+            // get next direction
+            let next = next_position(position, direction);
+ 
+            // set models
+            set!(world, (moves, next));
+ 
+            // emit custom event
+            emit!(world, Moved { player, direction });
+        }
+    }
+}
+
+

To interact with Systems read more in the sozo docs.

+
+ + diff --git a/dojo-book/docs/dist/cairo/testing/index.html b/dojo-book/docs/dist/cairo/testing/index.html new file mode 100644 index 00000000..db6ced83 --- /dev/null +++ b/dojo-book/docs/dist/cairo/testing/index.html @@ -0,0 +1,109 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Testing

+

Testing is a crucial part of any software development process. Dojo provides a testing framework that allows you to write tests for your smart contracts. Since Dojo uses a custom compiler, you need to use sozo to test your contracts.

+

From your project directory, simply:

+
sozo test
+

This will search for all tests within your project and run them.

+

Writing Unit Tests

+

It is best practise to include unit tests in the same file as the Model/System you are writing.

+

Lets show a model test example from the dojo-starter:

+

models.cairo

+
 
+...//rest of code
+ 
+#[cfg(test)]
+mod tests {
+    use super::{Position, Vec2, Vec2Trait};
+ 
+    #[test]
+    #[available_gas(100000)]
+    fn test_vec_is_zero() {
+        assert(Vec2Trait::is_zero(Vec2 { x: 0, y: 0 }), 'not zero');
+    }
+ 
+    #[test]
+    #[available_gas(100000)]
+    fn test_vec_is_equal() {
+        let position = Vec2 { x: 420, y: 0 };
+        assert(position.is_equal(Vec2 { x: 420, y: 0 }), 'not equal');
+    }
+}
+

In this test we are testing the is_zero and is_equal functions of the Position model. It is good practise to test all functions of your models.

+

Writing Integration Tests

+

Integration tests are e2e tests that test the entire system. You can write integration tests for your world by creating a tests directory in your project root. Then create a file for each integration test you want to write.

+

This is the example from the dojo-starter:

+

move.cairo

+
#[cfg(test)]
+mod tests {
+    use dojo::world::{IWorldDispatcherTrait, IWorldDispatcher};
+    use dojo::test_utils::{spawn_test_world, deploy_contract};
+    use dojo_examples::models::{position, moves};
+    use dojo_examples::models::{Position, Moves, Direction};
+ 
+    use super::{actions, IActionsDispatcher, IActionsDispatcherTrait};
+ 
+    // helper setup function
+    // reusable function for tests
+    fn setup_world() -> IActionsDispatcher {
+        // components
+        let mut models = array![position::TEST_CLASS_HASH, moves::TEST_CLASS_HASH];
+ 
+         // deploy world with models
+        let world = spawn_test_world(models);
+ 
+        // deploy systems contract
+        let contract_address = world
+            .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());
+        let actions_system = IActionsDispatcher { contract_address };
+ 
+        actions_system
+    }
+ 
+ 
+    #[test]
+    #[available_gas(30000000)]
+    fn test_move() {
+        // caller
+        let caller = starknet::contract_address_const::<0x0>();
+ 
+        let actions_system = setup_world();
+ 
+         // System calls
+        actions_system.spawn();
+        actions_system.move(Direction::Right(()));
+ 
+        // check moves
+        let moves = get!(world, caller, (Moves));
+        assert(moves.remaining == 99, 'moves is wrong');
+ 
+        // get new_position
+        let new_position = get!(world, caller, Position);
+ 
+        // check new position x
+        assert(new_position.vec.x == 11, 'position x is wrong');
+ 
+        // check new position y
+        assert(new_position.vec.y == 10, 'position y is wrong');
+    }
+}
+

Useful Dojo Test Functions

+

spawn_test_world(models) - This function will create a test world with the models and systems you pass in. It will also deploy the world and register the models and systems.

+ + diff --git a/dojo-book/docs/dist/cairo/world/index.html b/dojo-book/docs/dist/cairo/world/index.html new file mode 100644 index 00000000..b700e32d --- /dev/null +++ b/dojo-book/docs/dist/cairo/world/index.html @@ -0,0 +1,80 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content
+

To think about: Consider Autonomous Worlds as sovereign blockchains residing within another blockchain - a nested blockchain, so to speak. Just as you can deploy contracts onto Ethereum to enhance its functionality, you can similarly introduce systems into the World contract to enrich its features. While anyone can contribute to the World, akin to Ethereum, authorization is required to interact with model state. There is a dedicated topic to Authorisation.

+
+

overview

+

The World Contract

+

The world contract functions as a central store for the world models and systems. Every contract that interacts with the world, must use the world contract address as the first parameter. This is how the world contract is able to manage the state of the world.

+

Although we suggest strongly to structure your world around an ECS pattern you are not required to do so. You can simply use the dojo-models as a keypair store along with the supporting infrastructure.

+
+

NOTE: Dojo core abstracts the world contract away, you do not write it and it is not meant to be altered when building a world. However, it's important to understand how it works and how it interacts with the rest of the system.

+
+

Events

+

The world contract emits all model events via the StoreSetRecord event. This enables block explorers to reconstruct everything in the world by listening to one contract.

+

Full World API

+

The world exposes an interface which can be interacted with by any client. It is worth noting here that as a developer you don't deploy this world, it is deployed when you migrate the world.

+
// World interface
+#[starknet::interface]
+trait IWorld<T> {
+    fn metadata_uri(self: @T, resource: felt252) -> Span<felt252>;
+    fn set_metadata_uri(ref self: T, resource: felt252, uri: Span<felt252>);
+    fn model(self: @T, name: felt252) -> ClassHash;
+    fn register_model(ref self: T, class_hash: ClassHash);
+    fn deploy_contract(ref self: T, salt: felt252, class_hash: ClassHash) -> ContractAddress;
+    fn upgrade_contract(ref self: T, address: ContractAddress, class_hash: ClassHash) -> ClassHash;
+    fn uuid(ref self: T) -> usize;
+    fn emit(self: @T, keys: Array<felt252>, values: Span<felt252>);
+    fn entity(
+        self: @T, model: felt252, keys: Span<felt252>, offset: u8, length: usize, layout: Span<u8>
+    ) -> Span<felt252>;
+    fn set_entity(
+        ref self: T,
+        model: felt252,
+        keys: Span<felt252>,
+        offset: u8,
+        values: Span<felt252>,
+        layout: Span<u8>
+    );
+    fn entities(
+        self: @T,
+        model: felt252,
+        index: Option<felt252>,
+        values: Span<felt252>,
+        values_length: usize,
+        values_layout: Span<u8>
+    ) -> (Span<felt252>, Span<Span<felt252>>);
+    fn entity_ids(self: @T, model: felt252) -> Span<felt252>;
+    fn set_executor(ref self: T, contract_address: ContractAddress);
+    fn executor(self: @T) -> ContractAddress;
+    fn base(self: @T) -> ClassHash;
+    fn delete_entity(ref self: T, model: felt252, keys: Span<felt252>, layout: Span<u8>);
+    fn is_owner(self: @T, address: ContractAddress, resource: felt252) -> bool;
+    fn grant_owner(ref self: T, address: ContractAddress, resource: felt252);
+    fn revoke_owner(ref self: T, address: ContractAddress, resource: felt252);
+    fn is_writer(self: @T, model: felt252, system: ContractAddress) -> bool;
+    fn grant_writer(ref self: T, model: felt252, system: ContractAddress);
+    fn revoke_writer(ref self: T, model: felt252, system: ContractAddress);
+}
+

uuid()

+

It is often useful to generate unique IDs for entities. The uuid() fn can be used to generate a unique ID.

+

Use it like this:

+
let game_id = world.uuid();
+ + diff --git a/dojo-book/docs/dist/client/dojojs/index.html b/dojo-book/docs/dist/client/dojojs/index.html new file mode 100644 index 00000000..36d4b95f --- /dev/null +++ b/dojo-book/docs/dist/client/dojojs/index.html @@ -0,0 +1,48 @@ + + + + + + + + Dojo.js – Dojo Book + + + + + + + + + + +
Skip to content

Dojo.js

+
+

Javascript is a great way to get started with Dojo. It's easy to use, and you can get started in minutes.

+
+

@dojoengine/core

+

This is the lowest level library, and is used by all other downstream libraries. It contains the core functionality of Dojo and exposes the contract interfaces. Use it if you want to build your own library on top of Dojo.

+

Repository

+
bun add @dojoengine/core
+

@dojoengine/create-burner

+

Create burner is a simple way to incorporate burner wallets into your Dojo app.

+

Repository

+
bun add @dojoengine/create-burner
+

@dojoengine/utils

+

These are utils for helping with interfacing dojo.

+

Repository

+
bun add @dojoengine/utils
+

@dojoengine/react

+

React hooks for dojo.

+

Repository

+
bun add @dojoengine/react
+

@dojoengine/torii-client

+

The wasm client to access torii via grpc.

+

Repository

+
bun add @dojoengine/torii-client
+

@dojoengine/torii-wasm

+

Torii client for wasm bindings.

+

Repository

+
bun add @dojoengine/torii-wasm
+ + diff --git a/dojo-book/docs/dist/client/overview/index.html b/dojo-book/docs/dist/client/overview/index.html new file mode 100644 index 00000000..cc582657 --- /dev/null +++ b/dojo-book/docs/dist/client/overview/index.html @@ -0,0 +1,29 @@ + + + + + + + + Overview – Dojo Book + + + + + + + + + + +
Skip to content

Overview

+

Dojo is BYO client, meaning that you can use any client you want to connect to the Dojo network.

+ +
+

Dojo is always looking to expand these clients, if you would like to contribute reach out into the Discord

+
+ + diff --git a/dojo-book/docs/dist/client/sdk/c/index.html b/dojo-book/docs/dist/client/sdk/c/index.html new file mode 100644 index 00000000..9d27b2af --- /dev/null +++ b/dojo-book/docs/dist/client/sdk/c/index.html @@ -0,0 +1,22 @@ + + + + + + + + Dojo c – Dojo Book + + + + + + + + + + +
Skip to content
+ + diff --git a/dojo-book/docs/dist/client/sdk/dojojs/index.html b/dojo-book/docs/dist/client/sdk/dojojs/index.html new file mode 100644 index 00000000..89a9539a --- /dev/null +++ b/dojo-book/docs/dist/client/sdk/dojojs/index.html @@ -0,0 +1,21 @@ + + + + + + + + dojo.js – Dojo Book + + + + + + + + + + +
Skip to content
+ + diff --git a/dojo-book/docs/dist/client/sdk/unity/index.html b/dojo-book/docs/dist/client/sdk/unity/index.html new file mode 100644 index 00000000..66683127 --- /dev/null +++ b/dojo-book/docs/dist/client/sdk/unity/index.html @@ -0,0 +1,110 @@ + + + + + + + + dojo.unity – Dojo Book + + + + + + + + + + +
Skip to content

dojo.unity

+

Prerequisites

+

Before getting started, there are a few steps you must follow in order to get the project up and running.

+

Dojo

+

Ensure that you're using the latest supported Dojo version.

+

Binaries

+

If you are using Windows or Linux, you will need to build dojo.c yourself. Make sure that you're using the latest supported version

+
git clone https://github.com/dojoengine/dojo.c
+cargo build --release
+

This will generate a .dll or .so binary in the target/release directory, depending on your platform. You will need to copy it to the following location Packages/Dojo/Libraries

+
+

Watch video

+ +

Dojo Unity Concepts

+

Building on-chain games and worlds with Unity involves understanding several key concepts and components. Let's go over them to give you a clearer picture:

+

World Manager

+

world-manager

+
    +
  • Function: The World Manager acts as the central hub for your Dojo world within Unity. It's the starting point where all entities from your Dojo world will be managed.
  • +
  • Implementation: In your Unity scene, you'll find a WorldManager game object. Under this object, all entities from your Dojo world will be instantiated.
  • +
  • Customization: The WorldManager script component comes with default values, but you have the option to modify these. Specifically, you can update the URLs for your Katana and Torii instances and set your own world address.
  • +
+

Synchronization Master

+

world-manager

+
    +
  • Role: This component is crucial for managing the synchronization of entities between your Dojo world and the Unity world.
  • +
  • Features: In the SynchronizationMaster, you can specify the maximum number of entities you want to synchronize. It also handles the synchronization of your models' components.
  • +
  • Models Component: +
      +
    • Purpose: These are the components that will be synchronized between the two worlds.
    • +
    • Management: You have the flexibility to add as many models as needed. However, it's important to ensure that the models you add here are also present in your Dojo world for proper synchronization.
    • +
    +
  • +
+

Models

+

models

+

You should have a deep understanding of models in dojo if not checkout out models here before continuing.

+

What are Models in Dojo?

+
    +
  1. +

    Definition: In Dojo, models are essential state that represent various parts of entities within your game. They are the building blocks that make up the content of your game world. Read about ECS.

    +
  2. +
  3. +

    Synchronization Role:

    +
      +
    • Models act as the key elements that are synchronized between the onchain Dojo world and the Unity world (your game's visual and interactive representation).
    • +
    • This synchronization ensures that changes or interactions happening within the Unity environment are accurately reflected in the Dojo world, and vice versa.
    • +
    +
  4. +
  5. +

    Flexibility in Adding Models:

    +
      +
    • You have the freedom to add as many models as needed for your game's design and functionality.
    • +
    • It's vital, however, to ensure that these models are consistent across both the Dojo and Unity. This means that for every model you have in Unity, there should be a corresponding model in your Dojo world.
    • +
    +
  6. +
  7. +

    Future Developments:

    +
      +
    • An important aspect to note is that in future versions of the Dojo-Unity integration, the process of adding and synchronizing models will be further streamlined.
    • +
    • The plan is to have these models auto-generated, which would significantly simplify the development process and reduce the manual effort required for synchronization.
    • +
    +
  8. +
  9. +

    Importance of Understanding Models:

    +
      +
    • Before diving into game development with Dojo in Unity, it’s recommended to have a solid understanding of how models work in the Dojo environment.
    • +
    • This knowledge is crucial for effectively designing and implementing game elements that interact seamlessly between the blockchain and the game's user interface.
    • +
    +
  10. +
+

In summary, models are the bridge between the onchain (Dojo) and off-chain (Unity) aspects of your game.

+

Adding Models

+

The process to add models is:

+
    +
  1. Define in your dojo cairo contracts
  2. +
  3. Define in your Unity world making sure they accurately reflect
  4. +
+

Adding Systems

+

[insert]

+

Entities

+

Via toriiClient models are synced to Unity and are comprised of the models that you defined.

+

Starter Project

+

Get started by:

+
    +
  1. Prerequisites
  2. +
  3. Cloning the dojo.unity
  4. +
  5. Open project within Unity
  6. +
  7. Run the dojo-starter project and make sure to have Katana and Torii running.
  8. +
+ + diff --git a/dojo-book/docs/dist/client/torii/index.html b/dojo-book/docs/dist/client/torii/index.html new file mode 100644 index 00000000..5c6c2f65 --- /dev/null +++ b/dojo-book/docs/dist/client/torii/index.html @@ -0,0 +1,25 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Torii Client

+

Torii client is a rust client for interacting with Dojo worlds. It can be compiled to wasm to be used in JS clients, or can used directly in Rust clients or other lower level languages with bindings.

+

Usage in Rust projects

+@kairy +

Usage in JS Clients

+ + diff --git a/dojo-book/docs/dist/community/get-started/index.html b/dojo-book/docs/dist/community/get-started/index.html new file mode 100644 index 00000000..4dc70d1d --- /dev/null +++ b/dojo-book/docs/dist/community/get-started/index.html @@ -0,0 +1,72 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Get Started

+

Dojo is a thriving community of builders, artists, and deep thinkers, pushing the frontier of what is possible.

+ +

Ecosystem & Studios powered by Dojo

+

dojo

+

Realms World

+ +

Briq World

+ +

Cartridge

+ +

zKorp

+ +

Templates & Libraries

+

Templates, libraries or utilities that use Dojo.

+ +

Awesome Projects

+
    +
  • Beer Baron - An dojo onchain simulation masked as a beer brewing game. It is designed to work with 10 - 10,000 players.
  • +
  • Chess Dojo - A chess game built on Dojo.
  • +
  • Dope Wars: Roll Your Own - An onchain adaptation of the classic Drug Wars game developed by the Cartridge team.
  • +
  • Drive AI - An onchain driving simulator controlled by a neural network developed by the Cartridge team.
  • +
  • Emoji Man - Pac-man inspired onchain game using dojo and phaser.
  • +
  • Loot Underworld - Excavating the dangerous, endless mysteries of the subterranean in the dark depths of the Realms Autonomous (Under)World.
  • +
  • PixeLAW - A pixel grid-based Autonomous World with coexisting games (i.e. Paint, Snake, Rock-Paper-Scissors).
  • +
  • Realms Autonomous World - The Realms Autonomous World
  • +
  • Stark Lander - Land on the Moon!
  • +
  • StarkLand - Full On-chain Multiplayer Online Simulation Game (FOMOSLG) built on Starknet.
  • +
  • Underdark: Lair of the Slenderduck - An unhinged on-chain generative dungeon skin crawler. Beware the Slenderduck!
  • +
  • zDefender - An onchain tower defense.
  • +
  • zKnight - An onchain strategy game
  • +
+ + diff --git a/dojo-book/docs/dist/deployment/locally/index.html b/dojo-book/docs/dist/deployment/locally/index.html new file mode 100644 index 00000000..7a6ec088 --- /dev/null +++ b/dojo-book/docs/dist/deployment/locally/index.html @@ -0,0 +1,46 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Local Deployment with Katana

+

Experience the power of rapid development with Dojo, featuring the ultra-fast local development sequencer, Katana. Katana acts as an on-device Starknet, enabling thorough testing of your dojo world in a controlled environment before migrating them to the remote testnet.

+

Easy Katana Deployments

+

Deploying to Katana is straightforward and efficient.

+
+

Pre-requisite: Ensure you've completed the Quick Start guide and have your project set up.

+
+

To initiate Katana from your project directory, execute:

+
katana --disable-fee
+

This command launches a local instance of Katana, setting the stage for your deployment.

+

Step-by-Step Guide to Deploy on Katana

+

Deploying your project to Katana involves a few simple steps.\

+
    +
  1. +Compile Your Contracts: +

    If you haven't compiled your contracts yet, run:

    +
    sozo build
    +

    Compiling ensures that your contracts are ready for deployment.

    +
  2. +
  3. +Migrate your Project: +

    To migrate, run:

    +
    sozo migrate
    +
  4. +
+

Success! You have now migrated your world. You will be able to interact with the world using sozo.

+ + diff --git a/dojo-book/docs/dist/deployment/remote/index.html b/dojo-book/docs/dist/deployment/remote/index.html new file mode 100644 index 00000000..c8636f2b --- /dev/null +++ b/dojo-book/docs/dist/deployment/remote/index.html @@ -0,0 +1,61 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Deployment to Remote Network

+
+

IMPORTANT: Dojo is unaudited. Use at your own risk.

+
+

Dojo makes it easy to deploy to remote networks, you just need to have a valid account and network endpoint.

+

Scarb.toml

+
[package]
+name = "ohayoo"
+version = "0.1.0"
+cairo-version = "0.3.15"
+ 
+[cairo]
+sierra-replace-ids = true
+ 
+[dependencies]
+dojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.15" }
+ 
+# KATANA on slot
+# rpc_url = "https://api.cartridge.gg/x/example/katana"
+# account_address = "0x2d5260ba1d62ed0ea7c598f1460d27528b27afdf3bb43524a1ba3617e8279b2"
+# private_key = "0x6768b97b44cfbfa9f776a3c00ebe33c228058bf8716bb0515a1363049da2a11"
+# world = "0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f"
+ 
+# ENDPOINT
+rpc_url = "https://api.cartridge.gg/x/shinai/madara"
+account_address = "0x2"
+private_key = "0xc1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d"
+world_address = "0x5b328933afdbbfd44901fd69a2764a254edbb6e992ae87cf958c70493f2d201"
+ 
+# GOERLI
+# rpc_url = "https://starknet-goerli.g.alchemy.com/v2/<API KEY>"
+# account_address = "0x2d5260ba1d62ed0ea7c598f1460d27528b27afdf3bb43524a1ba3617e8279b2"
+# private_key = "0x6768b97b44cfbfa9f776a3c00ebe33c228058bf8716bb0515a1363049da2a11"
+# world = "0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f"
+

Deploy to public Starknet

+

If you credentials are correct in the Scarb.toml then a simple migrate will deploy the world to Starknet.

+

Deploy to Remote Katana

+

Katanas are able to be hosted and run as remote testnets, however this is not recommended for production use.

+

Deploy to remote katana with slot here

+

Deploy to Remote Madara

+

Madara is a blazingly fast Starknet sequencer.

+ + diff --git a/dojo-book/docs/dist/dojo-auth.png b/dojo-book/docs/dist/dojo-auth.png new file mode 100644 index 00000000..46cf7ec5 Binary files /dev/null and b/dojo-book/docs/dist/dojo-auth.png differ diff --git a/dojo-book/docs/dist/dojo-mark-full-dark.svg b/dojo-book/docs/dist/dojo-mark-full-dark.svg new file mode 100644 index 00000000..5bc5b839 --- /dev/null +++ b/dojo-book/docs/dist/dojo-mark-full-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/dojo-book/docs/dist/dojo-sozo-workflow.jpg b/dojo-book/docs/dist/dojo-sozo-workflow.jpg new file mode 100644 index 00000000..7a6ecb5e Binary files /dev/null and b/dojo-book/docs/dist/dojo-sozo-workflow.jpg differ diff --git a/dojo-book/docs/dist/dojo.unity_demo.mp4 b/dojo-book/docs/dist/dojo.unity_demo.mp4 new file mode 100644 index 00000000..e1b9c99d Binary files /dev/null and b/dojo-book/docs/dist/dojo.unity_demo.mp4 differ diff --git a/dojo-book/docs/dist/example/index.html b/dojo-book/docs/dist/example/index.html new file mode 100644 index 00000000..b6b08670 --- /dev/null +++ b/dojo-book/docs/dist/example/index.html @@ -0,0 +1,22 @@ + + + + + + + + Example – Dojo Book + + + + + + + + + + +
Skip to content

Example

+

This is an example page.

+ + diff --git a/dojo-book/docs/dist/getting-started/contributing/index.html b/dojo-book/docs/dist/getting-started/contributing/index.html new file mode 100644 index 00000000..2d4751be --- /dev/null +++ b/dojo-book/docs/dist/getting-started/contributing/index.html @@ -0,0 +1,24 @@ + + + + + + + + Contributing to the Core – Dojo Book + + + + + + + + + + +
Skip to content

Contributing to the Core

+

Dojo is an open-source project, currently in its early development phase, and warmly welcomes contributors.

+

How to Contribute

+

Head to the Github for open issues, if you see an issue that is unassigned, please request in the comments to be assigned to it. If you have an idea for a new feature, please create an issue with the enhancement tag.

+ + diff --git a/dojo-book/docs/dist/getting-started/from-source/index.html b/dojo-book/docs/dist/getting-started/from-source/index.html new file mode 100644 index 00000000..9cd95c50 --- /dev/null +++ b/dojo-book/docs/dist/getting-started/from-source/index.html @@ -0,0 +1,45 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Building from source

+
+

If you are just wanting to play with the toolchain, we strongly suggest following the Quick Start guide.

+
+

Prerequisites

+

You will need the Rust compiler and Cargo, the Rust package manager. +The easiest way to install both is with rustup.rs.

+

On Windows, you will also need a recent version of Visual Studio, +installed with the "Desktop Development With C++" Workloads option.

+

Building

+

You can either use the different Dojoup flags:

+
dojoup --branch master
+dojoup --path path/to/dojo
+

Or, by using a single Cargo command:

+
cargo install --git https://github.com/dojoengine/dojo --force sozo katana torii
+

Or, by manually building from a local copy of the Dojo repository:

+
# clone the repository
+git clone https://github.com/dojoengine/dojo.git
+cd dojo
+# install Sozo
+cargo install --path ./crates/sozo --force
+# install Katana
+cargo install --path ./crates/katana --force
+# install Torii
+cargo run -—bin torii
+ + diff --git a/dojo-book/docs/dist/getting-started/index.html b/dojo-book/docs/dist/getting-started/index.html new file mode 100644 index 00000000..6fcc5293 --- /dev/null +++ b/dojo-book/docs/dist/getting-started/index.html @@ -0,0 +1,36 @@ + + + + + + + + Dojo The Provable Game Engine – Dojo Book + + + + + + + + + + +
Skip to content

Dojo The Provable Game Engine

+

Dojo is a provable game engine built using Cairo. It establishes a standard for game development via smart contracts, blending best practices with streamlined development and deployment tools. With Dojo by your side, you can evolve from initial concept to a fully realized game in days, not weeks.

+

This book is dedicated to familiarizing you with the Dojo engine and the potential of Provable games. A special section on the Theory elucidates this emergent concept of autonomous worlds and Provable games.

+ +
+

Dojo is an open-source onchain gaming project currently in its early development phase, and warmly welcomes contributors. For additional resources, join the community on Discord and check out the contribution guide.

+
+
+

Organizational Structure

+

Dojo is an open-source initiative, licensed under Apache 2.0, dedicated to promoting and advancing the concept of Autonomous Worlds (AWs). It is spearheaded by Cartridge, Realms & BibliothecaDAO, briq and many more contributors.

+

How do I get involved?

+

Check out our Github, our Twitter, Discord and contribution guide

+ + diff --git a/dojo-book/docs/dist/getting-started/quick-start/index.html b/dojo-book/docs/dist/getting-started/quick-start/index.html new file mode 100644 index 00000000..5e47cb1e --- /dev/null +++ b/dojo-book/docs/dist/getting-started/quick-start/index.html @@ -0,0 +1,35 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Quick Start

+
+

It is worth reading theory to familiarize yourself with the concept of Autonomous Worlds (AWs) and the Cairo ecosystem before diving into the code.

+
+

Install Dojoup

+

Dojo is built around a set of development tools - Katana, Torii and Sozo. Install them all easily with Dojoup. You can find detailed information about Dojoup here.

+
curl -L https://install.dojoengine.org | bash
+

This will install Dojoup, then simply follow the instructions on-screen, +which will make the dojoup command available in your CLI.

+
dojoup
+

For full dojoup reference and debugging see Dojoup.

+

Next steps

+
+

Head to Hello Dojo to get create your first Dojo world.

+
+ + diff --git a/dojo-book/docs/dist/getting-started/setup/index.html b/dojo-book/docs/dist/getting-started/setup/index.html new file mode 100644 index 00000000..661ef42a --- /dev/null +++ b/dojo-book/docs/dist/getting-started/setup/index.html @@ -0,0 +1,49 @@ + + + + + + + + Development Setup – Dojo Book + + + + + + + + + + +
Skip to content

Development Setup

+
+

This is a guide to setting up a development environment for Dojo. It is not suggested to follow this guide if you are just wanting to play with the toolchain. We strongly suggest following the Quick Start guide.

+
+

Prerequisites

+ +

Guide

+

Clone

+
git clone https://github.com/dojoengine/dojo.git
+

Linux & Mac

+

1. Install Rust and Dependencies

+

Start by installing Rust and running the test suite to confirm your setup:

+
rustup override set stable && rustup update && cargo test
+
+

Note: Depending on your Linux distribution, you may need to install additional dependencies. Make sure to install any suggested or missing dependencies that arise during the setup process.

+
+

2. Install Scarb Package Manager

+

Next, install the Scarb package manager by running:

+
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh
+

3. Add the Cairo 1.0 VSCode Extension

+

Install the Cairo 1.0 extension for Visual Studio Code.

+

Windows

+

Coming soon

+

Container

+

Coming soon

+ + diff --git a/dojo-book/docs/dist/images/Built with/index.html b/dojo-book/docs/dist/images/Built with/index.html new file mode 100644 index 00000000..71e79a81 --- /dev/null +++ b/dojo-book/docs/dist/images/Built with/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/Dojo - Contracts/index.html b/dojo-book/docs/dist/images/Dojo - Contracts/index.html new file mode 100644 index 00000000..02de3231 --- /dev/null +++ b/dojo-book/docs/dist/images/Dojo - Contracts/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/ECS/index.html b/dojo-book/docs/dist/images/ECS/index.html new file mode 100644 index 00000000..d8e3502a --- /dev/null +++ b/dojo-book/docs/dist/images/ECS/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/board/index.html b/dojo-book/docs/dist/images/board/index.html new file mode 100644 index 00000000..6cf42d36 --- /dev/null +++ b/dojo-book/docs/dist/images/board/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/dojo-auth/index.html b/dojo-book/docs/dist/images/dojo-auth/index.html new file mode 100644 index 00000000..9ec12140 --- /dev/null +++ b/dojo-book/docs/dist/images/dojo-auth/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/dojo-mark-full-dark/index.html b/dojo-book/docs/dist/images/dojo-mark-full-dark/index.html new file mode 100644 index 00000000..dbcf340b --- /dev/null +++ b/dojo-book/docs/dist/images/dojo-mark-full-dark/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/dojo-sozo-workflow/index.html b/dojo-book/docs/dist/images/dojo-sozo-workflow/index.html new file mode 100644 index 00000000..b66aabf4 --- /dev/null +++ b/dojo-book/docs/dist/images/dojo-sozo-workflow/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/dojo/index.html b/dojo-book/docs/dist/images/dojo/index.html new file mode 100644 index 00000000..bcf7fd77 --- /dev/null +++ b/dojo-book/docs/dist/images/dojo/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/favicon/index.html b/dojo-book/docs/dist/images/favicon/index.html new file mode 100644 index 00000000..64f1ad32 --- /dev/null +++ b/dojo-book/docs/dist/images/favicon/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/katana-icon-word/index.html b/dojo-book/docs/dist/images/katana-icon-word/index.html new file mode 100644 index 00000000..28658ad5 --- /dev/null +++ b/dojo-book/docs/dist/images/katana-icon-word/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/katana-icon/index.html b/dojo-book/docs/dist/images/katana-icon/index.html new file mode 100644 index 00000000..42dd7eb6 --- /dev/null +++ b/dojo-book/docs/dist/images/katana-icon/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/katana/index.html b/dojo-book/docs/dist/images/katana/index.html new file mode 100644 index 00000000..421ad3ab --- /dev/null +++ b/dojo-book/docs/dist/images/katana/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/origami-icon-word/index.html b/dojo-book/docs/dist/images/origami-icon-word/index.html new file mode 100644 index 00000000..c0267742 --- /dev/null +++ b/dojo-book/docs/dist/images/origami-icon-word/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/origami-icon/index.html b/dojo-book/docs/dist/images/origami-icon/index.html new file mode 100644 index 00000000..6ee57cc1 --- /dev/null +++ b/dojo-book/docs/dist/images/origami-icon/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/origami/index.html b/dojo-book/docs/dist/images/origami/index.html new file mode 100644 index 00000000..68bd08c1 --- /dev/null +++ b/dojo-book/docs/dist/images/origami/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/permissions/index.html b/dojo-book/docs/dist/images/permissions/index.html new file mode 100644 index 00000000..77bb0441 --- /dev/null +++ b/dojo-book/docs/dist/images/permissions/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/slot-icon-word/index.html b/dojo-book/docs/dist/images/slot-icon-word/index.html new file mode 100644 index 00000000..ab89f12f --- /dev/null +++ b/dojo-book/docs/dist/images/slot-icon-word/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/slot-icon/index.html b/dojo-book/docs/dist/images/slot-icon/index.html new file mode 100644 index 00000000..9194d655 --- /dev/null +++ b/dojo-book/docs/dist/images/slot-icon/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/sozo-icon-word/index.html b/dojo-book/docs/dist/images/sozo-icon-word/index.html new file mode 100644 index 00000000..e4c9cc50 --- /dev/null +++ b/dojo-book/docs/dist/images/sozo-icon-word/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/sozo-icon/index.html b/dojo-book/docs/dist/images/sozo-icon/index.html new file mode 100644 index 00000000..34863289 --- /dev/null +++ b/dojo-book/docs/dist/images/sozo-icon/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/torii-icon-word/index.html b/dojo-book/docs/dist/images/torii-icon-word/index.html new file mode 100644 index 00000000..13f118e1 --- /dev/null +++ b/dojo-book/docs/dist/images/torii-icon-word/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/torii-icon/index.html b/dojo-book/docs/dist/images/torii-icon/index.html new file mode 100644 index 00000000..e0d536da --- /dev/null +++ b/dojo-book/docs/dist/images/torii-icon/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/unity-screen-grab/index.html b/dojo-book/docs/dist/images/unity-screen-grab/index.html new file mode 100644 index 00000000..c199cc91 --- /dev/null +++ b/dojo-book/docs/dist/images/unity-screen-grab/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/unity/models/index.html b/dojo-book/docs/dist/images/unity/models/index.html new file mode 100644 index 00000000..b5c0e07c --- /dev/null +++ b/dojo-book/docs/dist/images/unity/models/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/unity/sync-master/index.html b/dojo-book/docs/dist/images/unity/sync-master/index.html new file mode 100644 index 00000000..66e80b60 --- /dev/null +++ b/dojo-book/docs/dist/images/unity/sync-master/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/unity/world-manager/index.html b/dojo-book/docs/dist/images/unity/world-manager/index.html new file mode 100644 index 00000000..682096d9 --- /dev/null +++ b/dojo-book/docs/dist/images/unity/world-manager/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/world-map/index.html b/dojo-book/docs/dist/images/world-map/index.html new file mode 100644 index 00000000..47e0d93d --- /dev/null +++ b/dojo-book/docs/dist/images/world-map/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/world_flow/index.html b/dojo-book/docs/dist/images/world_flow/index.html new file mode 100644 index 00000000..f0e1ee4c --- /dev/null +++ b/dojo-book/docs/dist/images/world_flow/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/worlds-dev-icon-word/index.html b/dojo-book/docs/dist/images/worlds-dev-icon-word/index.html new file mode 100644 index 00000000..700f8659 --- /dev/null +++ b/dojo-book/docs/dist/images/worlds-dev-icon-word/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/images/worlds-dev-icon/index.html b/dojo-book/docs/dist/images/worlds-dev-icon/index.html new file mode 100644 index 00000000..13337196 --- /dev/null +++ b/dojo-book/docs/dist/images/worlds-dev-icon/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Page Not Found


The page you were looking for could not be found.

Go to Home Page
+ + diff --git a/dojo-book/docs/dist/index.html b/dojo-book/docs/dist/index.html new file mode 100644 index 00000000..2f22668f --- /dev/null +++ b/dojo-book/docs/dist/index.html @@ -0,0 +1,21 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Dojo Book

Dojo is a community driven open-source, Provable Game Engine, providing a comprehensive toolkit for building verifiable games and autonomous worlds.

+ + diff --git a/dojo-book/docs/dist/initializeTheme.iife.js b/dojo-book/docs/dist/initializeTheme.iife.js new file mode 100644 index 00000000..6330285a --- /dev/null +++ b/dojo-book/docs/dist/initializeTheme.iife.js @@ -0,0 +1 @@ +(function(){"use strict";const e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("vocs.theme");(t||(e.matches?"dark":"light"))==="dark"&&document.documentElement.classList.add("dark"),t||e.addEventListener("change",({matches:d})=>{d?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")})})(); diff --git a/dojo-book/docs/dist/katana-icon-word.png b/dojo-book/docs/dist/katana-icon-word.png new file mode 100644 index 00000000..cc71e76e Binary files /dev/null and b/dojo-book/docs/dist/katana-icon-word.png differ diff --git a/dojo-book/docs/dist/katana-icon.png b/dojo-book/docs/dist/katana-icon.png new file mode 100644 index 00000000..79c978b7 Binary files /dev/null and b/dojo-book/docs/dist/katana-icon.png differ diff --git a/dojo-book/docs/dist/katana.png b/dojo-book/docs/dist/katana.png new file mode 100644 index 00000000..25077302 Binary files /dev/null and b/dojo-book/docs/dist/katana.png differ diff --git a/dojo-book/docs/dist/misc/contributors/index.html b/dojo-book/docs/dist/misc/contributors/index.html new file mode 100644 index 00000000..c1d712bd --- /dev/null +++ b/dojo-book/docs/dist/misc/contributors/index.html @@ -0,0 +1,47 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Contributing to Dojo Book

+

As the Dojo engine progresses and develops, it is essential for the Dojo book to keep pace with these advancements. Updating and refining the book ensures that it remains a relevant and valuable resource for those interested in understanding and utilizing the latest Dojo engine features and capabilities. All help is welcome!

+

The purpose of the book

+

The Dojo book is designed to be a comprehensive resource that caters to users at various levels of experience. It aims to serve as both an introductory guide for those new to Dojo and its ancillary packages, as well as a reference for more experienced users seeking to deepen their understanding of the engine's features and capabilities.

+

The book is split into some major chapters:

+
    +
  • Framework Theory
  • +
  • Getting Started
  • +
  • Building a World
  • +
+

Code of Conduct

+

The book follows the Rust Code of Conduct.

+

Ways to contribute

+

Issues

+

If you think that some content is missing or out-of-date, feel free to open an issue. If you find multiple pieces of content lacking, please open up a separate issue for each.

+

The issues will then be labeled so other contributors can find chunks of work they are interested in more easily.

+

The issue should contain what is missing, or what could be improved, in as much detail as you deem necessary.

+

Pull requests

+

Feel free to contribute changes to the book by opening a pull request - anything is welcome, from reformulating a sentence, fixing a typo, to adding new sections or chapters.

+

When your pull request is open, other contributors will take a look and may request changes. Do not be discouraged!

+

Writing style

+

This section documents a few standards for writing used throughout the book.

+

Chapters start with a second level heading

+

We use:

+
## Some Page
+

We do not use:

+
# Some Page
+ + diff --git a/dojo-book/docs/dist/origami-icon-word.png b/dojo-book/docs/dist/origami-icon-word.png new file mode 100644 index 00000000..ccac1432 Binary files /dev/null and b/dojo-book/docs/dist/origami-icon-word.png differ diff --git a/dojo-book/docs/dist/origami-icon.png b/dojo-book/docs/dist/origami-icon.png new file mode 100644 index 00000000..f4ed595a Binary files /dev/null and b/dojo-book/docs/dist/origami-icon.png differ diff --git a/dojo-book/docs/dist/origami.png b/dojo-book/docs/dist/origami.png new file mode 100644 index 00000000..f1eba0d0 Binary files /dev/null and b/dojo-book/docs/dist/origami.png differ diff --git a/dojo-book/docs/dist/permissions.png b/dojo-book/docs/dist/permissions.png new file mode 100644 index 00000000..1fca70d8 Binary files /dev/null and b/dojo-book/docs/dist/permissions.png differ diff --git a/dojo-book/docs/dist/slot-icon-word.png b/dojo-book/docs/dist/slot-icon-word.png new file mode 100644 index 00000000..b424160f Binary files /dev/null and b/dojo-book/docs/dist/slot-icon-word.png differ diff --git a/dojo-book/docs/dist/slot-icon.png b/dojo-book/docs/dist/slot-icon.png new file mode 100644 index 00000000..28090367 Binary files /dev/null and b/dojo-book/docs/dist/slot-icon.png differ diff --git a/dojo-book/docs/dist/sozo-icon-word.png b/dojo-book/docs/dist/sozo-icon-word.png new file mode 100644 index 00000000..d8c85888 Binary files /dev/null and b/dojo-book/docs/dist/sozo-icon-word.png differ diff --git a/dojo-book/docs/dist/sozo-icon.png b/dojo-book/docs/dist/sozo-icon.png new file mode 100644 index 00000000..0b96151b Binary files /dev/null and b/dojo-book/docs/dist/sozo-icon.png differ diff --git a/dojo-book/docs/dist/theory/autonomous-worlds/index.html b/dojo-book/docs/dist/theory/autonomous-worlds/index.html new file mode 100644 index 00000000..f11e5f5c --- /dev/null +++ b/dojo-book/docs/dist/theory/autonomous-worlds/index.html @@ -0,0 +1,46 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Autonomous Worlds

+
+

"Autonomous worlds represent persistent, permissionless, and decentralized open environments that users can freely interact with and contribute to."

+
+

The precise definition of Autonomous Worlds (AWs) remains somewhat elusive, as it is more of an abstract concept that has yet to be fully crystallized. Lattice first introduced the terminology in 2022, but the notion of open worlds operating on the blockchain has been around for a while. The abstraction introduced by MUD served as a catalyst for the market to recognize the potential of these worlds.

+

Autonomous Worlds share notable similarities with blockchains in their fundamental nature. Once established, they persist, maintaining their state throughout the lifespan of the chain. Players can join or leave, and developers can expand these worlds by deploying features in a permissionless manner, much like how contracts are added to a chain. While there is no universally accepted definition for an Autonomous World, we believe that a game must possess at least the following two essential features to be considered as such:

+
    +
  1. +

    Decentralized data availability layer: While the state execution may reside on a centralized layer, it is crucial that the state can be reconstructed if the execution layer ceases to exist. Rollups offer a solution, providing increased capacity execution layers while ensuring data is permanently settled on Ethereum. This guarantees the world's perpetual persistence.

    +
  2. +
  3. +

    Permissionless entry point for expanding the world: The World contract must be capable of accepting new systems and components without requiring permission. While this doesn't imply that every component and system will be utilized, they must adhere to this pattern, ensuring open and unrestricted access for potential enhancements.

    +
  4. +
+

We're firm believers in the potential for Autonomous Worlds to catalyze the exploration of novel forms in the medium provided by zk proofs and blockchain technology. This is not only about games, but also about new forms of artwork, coordination, fun, emerging from tinkering and radical innovation, eventually questioning the very notion of "play" in this brave new decentralized and trustless world.

+

Homework

+
+ + diff --git a/dojo-book/docs/dist/theory/cairo/index.html b/dojo-book/docs/dist/theory/cairo/index.html new file mode 100644 index 00000000..1c3ca81f --- /dev/null +++ b/dojo-book/docs/dist/theory/cairo/index.html @@ -0,0 +1,42 @@ + + + + + + + + Provable games – Dojo Book + + + + + + + + + + +
Skip to content

Provable games

+

Provable games demand zero-knowledge properties for efficient scaling and verification of computations. Cairo addresses this need by providing a generalized language, eliminating the complexity of creating circuits to incorporate SNARKs.

+

You can simply program in Cairo and your applications become automatically provable.

+

Moreover, you can deploy your programs on the Cairo Virtual Machine (CVM), which is compatible with Starknet's Layer 2, Starknet appchains, and even in-browser through WebAssembly (WASM)! Dojo aims to supply straightforward ZK primitives to fuel your game development.

+

For more information about Starknet, Cairo and its tech stack, check out the Starknet & Cairo book.

+

Cairo

+

Cairo is an open-source, Turing-complete smart contract language developed by Starkware, designed to power the Validity Rollup Starknet. The language enables highly expressive and verifiable computation, making it well-suited for building scalable and secure applications, including decentralized finance (DeFi) projects.

+

Dojo builds on Cairo to create a robust framework for developing Autonomous Worlds (AWs). By leveraging the capabilities of Cairo, Dojo aims to streamline the development process, improve maintainability, and enhance the performance of AWs.

+

A key feature of the Dojo framework is its use of commands. Commands are a design pattern that helps to reduce boilerplate code, resulting in cleaner and more maintainable applications. They achieve this by encapsulating specific actions or operations within self-contained, reusable units.

+

Developers can write commands freely within Systems, and the Cairo compiler takes care of inlining the appropriate functions.

+

Essential Reading

+ +

Starknet as an L2

+

Starknet is a Validity Rollup Layer 2 (L2) solution designed to scale Ethereum. It operates by offering high transaction throughput and low gas costs while maintaining the same level of security as Ethereum Layer 1 (L1). The strategy it uses is akin to solving a sudoku puzzle: verifying a solution is easier than finding the solution from scratch. Similarly, Starknet replaces heavy and costly L1 computation with cheaper L1 verification through the use of STARK proofs computed off-chain.

+

In more technical terms, Starknet is a permissionless Validity-Rollup (also known as a "ZK-Rollup") that supports general computation and currently runs as an L2 network over Ethereum. The network's L1 security is guaranteed by its utilization of the STARK cryptographic proof system, which is considered one of the safest and most scalable.

+

Starknet as an Appchain

+

Cairo is an isomorphic, general-purpose language, optimized for Zero-Knowledge (ZK) proofs. It's the driving force behind Starknet, Starkex, and appchains. Remarkably, you can also run it in WebAssembly (WASM) to generate proofs on the client-side! Within the dojo toolchain exists Katana which is a gaming specific sequencer, which is perfectly suited to run a Dojo appchain.

+

The Dojo team is also working closely with the Madara team to enable Starknet appchains to seamlessly run Dojo worlds.

+ + diff --git a/dojo-book/docs/dist/theory/faqs/index.html b/dojo-book/docs/dist/theory/faqs/index.html new file mode 100644 index 00000000..ad87a8c2 --- /dev/null +++ b/dojo-book/docs/dist/theory/faqs/index.html @@ -0,0 +1,40 @@ + + + + + + + + FAQs – Dojo Book + + + + + + + + + + +
Skip to content

FAQs

+

Who owns Dojo?

+

Dojo is strictly open-source and uses the Apache 2.0 license. Anyone can use Dojo for free, and anyone can contribute to the project.

+

Why Dojo?

+

Dojo was created to solve problems the founders faced when building onchain games. It standardizes the process of building such games and provides a suite of tools to make it easier.

+

What is the Dojo roadmap?

+

Dojo is rapidly evolving. You can find open issues on the Dojo Github and join the Discord to get involved. If you have ideas for the project, please open an issue.

+

What is an onchain game?

+

Onchain games are games that exist entirely on a public blockchain network; all states and logic are onchain. Clients (like web browsers) do not exist on the chain but exist purely to interact with and interpret the onchain state.

+

What is an autonomous world?

+

An autonomous world is one that exists entirely onchain. It's not controlled by any single entity but is instead governed by the rules set within that world. Dive deeper into the topic here: Autonomous Worlds.

+

What is Cairo?

+

Cairo is an opensource programming language invented by Starkware. It's a Turing-complete language meant for general-purpose computation. It's a low-level language designed to compile to the Cairo Virtual Machine. Learn more about it here: Cairo.

+

What is a provable game?

+

Thanks to the magic of zero-knowledge proofs, we can ensure a game is fair by verifying a zk proof created off-chain. But what does that entail? Consider a game of chess. We aim for an experience where players trust each other's moves. In a straightforward approach — and given the simple rules of chess — if this were in a blockchain environment, every move would be a transaction on the blockchain. This is costly. We just want to know the winner, not every move.

+

With zk proofs and client communications, players can establish a state channel, sharing moves off-chain and ensuring their validity. At the end, a zk proof can be submitted to the blockchain to confirm the game's fairness. This constitutes a provable game.

+

Can dojo implement client side proofs?

+

The ability to execute Dojo programs in the browser is entirely plausible and is on our roadmap. Expect q1/q2 in 2024, or if you are a specalist in this jump into the code and help out!

+

Can I deploy dojo on Starknet?

+

Yes! Dojo can run on any StarknetVM including the public blockchains. Within the dojo toolchain exists Katana which is a gaming specific sequencer, which is perfectly suited to Dojo games.

+ + diff --git a/dojo-book/docs/dist/theory/what-is-dojo/index.html b/dojo-book/docs/dist/theory/what-is-dojo/index.html new file mode 100644 index 00000000..3216e3e3 --- /dev/null +++ b/dojo-book/docs/dist/theory/what-is-dojo/index.html @@ -0,0 +1,42 @@ + + + + + + + + What is Dojo? – Dojo Book + + + + + + + + + + +
Skip to content

dojo

+

What is Dojo?

+

Dojo is the culmination of lessons learned from attempts at building onchain games, an emerging sector in the gaming industry. Any developer who has endeavored to build an on-chain game recognizes the inherent engineering hurdles - a realization that drove us to create Dojo. Just as you wouldn't recreate Unity every time you develop a new game, the same principle applies here. Dojo is designed to handle the complex infrastructure, allowing developers to focus on the unique aspects of their games.

+

Dojo aspires to be the go-to tool for building provable games. It is radically open-source, and all contributions are welcome.

+
+

Stop building infrastructure; start building games

+

Dojo's suite of tools takes the infrastructure complexity out of building on-chain games. It includes:

+

Entity Component System (ECS)

+

Dojo offers a standardized approach to building games on smart contracts. Recognizing the intricacies of game design, Dojo simplifies the development process, allowing creators to focus on gameplay logic. This standardization paves the way for an interconnected network of worlds, streamlining developer expertise and promoting game integration.

+

Utilizing the ECS (Entity Component System) as its core architecture, Dojo effectively manages the state and behavior of Autonomous Worlds (AWs). This model revolves around systems acting on entities, which are collections of pure data components. Systems efficiently determine which entities to process based on persistent queries over these components.

+

Read detailed information about the Dojo ECS.

+

Torii - Starknet Indexer

+

Building on-chain games often involves grappling with the challenge of indexing on-chain state. However, Dojo standardizes contract states to mirror traditional relational databases. This setup enables the Torii Indexer to auto-index all contract states, ensuring efficient and streamlined queries. Torii then exposes these states via a GraphQL API or gRPC, allowing developers to easily query and retrieve data.

+

Using Torii drastically reduces the time and effort required to build on-chain games. It also eliminates the need to manually create indexers, which can be a tedious and error-prone process.

+

Katana - Blazingly fast development network

+

Katana is a customizable Starknet development network. It is blazingly fast and allows you to iterate on your game logic swiftly.

+

Sozo CLI - CLI Management Tool

+

Dojo worlds are poised to become some of the largest contracts. Sozo is a CLI tool that assists you in managing your worlds. It enables you to create, build, test, and deploy your worlds. Additionally, you can craft new components and systems and register them with your world.

+

What Dojo doesn't give you

+
    +
  1. Visual graphics - While Dojo provides networking and contracts, it doesn't offer graphical engines. You can bring your graphics of choice! Integrate your Dojo world with Unreal, Godot, or Unity.
  2. +
+ + diff --git a/dojo-book/docs/dist/toolchain/dojoup/index.html b/dojo-book/docs/dist/toolchain/dojoup/index.html new file mode 100644 index 00000000..3fd0f893 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/dojoup/index.html @@ -0,0 +1,61 @@ + + + + + + + + dojoup – Dojo Book + + + + + + + + + + +
Skip to content

dojoup

+

Update or revert to a specific Dojo branch with ease.

+

Installing

+
curl -L https://install.dojoengine.org | bash
+

Usage

+

To install latest stable version:

+
dojoup
+
+

Note: You may have to install jq to use dojoup. You can do so with the following commands:

+
+
# Debian
+sudo apt-get install jq
+ 
+# Mac
+brew install jq
+

To install a specific version (in this case the nightly version):

+
dojoup --version nightly
+

To install a specific branch (in this case the release/0.1.0 branch's latest commit):

+
dojoup --branch release/0.1.0
+

To install a fork's main branch (in this case tarrencev/dojo's main branch):

+
dojoup --repo tarrencev/dojo
+

To install a specific branch in a fork (in this case the patch-10 branch's latest commit in tarrencev/dojo):

+
dojoup --repo tarrencev/dojo --branch patch-10
+

To install from a specific Pull Request:

+
dojoup --pr 1071
+

To install from a specific commit:

+
dojoup -c 94bfdb2
+

To install a local directory or repository (e.g. one located at ~/git/dojo, assuming you're in the home directory)

+
Note: --branch, --repo, and --version flags are ignored during local installations.
+
dojoup --path ./git/dojo
+
+

Tip: All flags have a single character shorthand equivalent! You can use -v instead of --version, etc.

+
+

Precompiled binaries

+

Precompiled binaries are available from the GitHub releases page. +These are better managed by using Dojoup.

+
+

ℹ️ Note

+

If you're on Windows, you will need to install and use Git BASH or WSL, +as your terminal, since Dojoup currently does not support Powershell or Cmd.

+
+ + diff --git a/dojo-book/docs/dist/toolchain/katana/development/index.html b/dojo-book/docs/dist/toolchain/katana/development/index.html new file mode 100644 index 00000000..4f16abdf --- /dev/null +++ b/dojo-book/docs/dist/toolchain/katana/development/index.html @@ -0,0 +1,21 @@ + + + + + + + + Development – Dojo Book + + + + + + + + + + +
Skip to content

Development

+ + diff --git a/dojo-book/docs/dist/toolchain/katana/overview/index.html b/dojo-book/docs/dist/toolchain/katana/overview/index.html new file mode 100644 index 00000000..2fcda855 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/katana/overview/index.html @@ -0,0 +1,74 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

katana

+

Katana is a blazingly fast sequencer, designed to support both local development as well as production deployments.

+

In development mode, Katana provides the tool necessary for rapid iteration, including custom development RPCs for manipulating the execution context.

+

In produciton mode, Katana provides a high performance sequencer optimized for gaming workloads, with support for settlment and cross layer communication.

+

Features

+
    +
  • Starknet JSON-RPC v0.3.0 support
  • +
  • Cross layer communication (L1 <> L2, LN <> LN+1)
  • +
  • Custom methods for manipulating the blockchain states
  • +
+

Installation

+

katana binary is available via dojoup.

+

Installing from source

+
git clone https://github.com/dojoengine/dojo
+cd dojo
+cargo install --path ./crates/katana --locked --force
+

Usage

+
katana
+
 
+ 
+██╗  ██╗ █████╗ ████████╗ █████╗ ███╗   ██╗ █████╗
+██║ ██╔╝██╔══██╗╚══██╔══╝██╔══██╗████╗  ██║██╔══██╗
+█████╔╝ ███████║   ██║   ███████║██╔██╗ ██║███████║
+██╔═██╗ ██╔══██║   ██║   ██╔══██║██║╚██╗██║██╔══██║
+██║  ██╗██║  ██║   ██║   ██║  ██║██║ ╚████║██║  ██║
+╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═══╝╚═╝  ╚═╝
+ 
+ 
+ 
+PREFUNDED ACCOUNTS
+==================
+ 
+| Account address |  0x3ee9e18edc71a6df30ac3aca2e0b02a198fbce19b7480a63a0d71cbd76652e0
+| Private key     |  0x300001800000000300000180000000000030000000000003006001800006600
+| Public key      |  0x1b7b37a580d91bc3ad4f9933ed61f3a395e0e51c9dd5553323b8ca3942bb44e
+ 
+| Account address |  0x33c627a3e5213790e246a917770ce23d7e562baa5b4d2917c23b1be6d91961c
+| Private key     |  0x333803103001800039980190300d206608b0070db0012135bd1fb5f6282170b
+| Public key      |  0x4486e2308ef3513531042acb8ead377b887af16bd4cdd8149812dfef1ba924d
+ 
+ 
+ACCOUNTS SEED
+=============
+0
+ 
+ 
+🚀 JSON-RPC server started: http://0.0.0.0:5050
+ 
+ 
+

To enable development features, run using the --dev flag.

+
+

📚 Reference

+

See the katana Reference for an in depth reference and documentation on Katana.

+
+ + diff --git a/dojo-book/docs/dist/toolchain/katana/reference/index.html b/dojo-book/docs/dist/toolchain/katana/reference/index.html new file mode 100644 index 00000000..86daf32b --- /dev/null +++ b/dojo-book/docs/dist/toolchain/katana/reference/index.html @@ -0,0 +1,228 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

katana reference

+

NAME

+

katana - Create a local testnet node for deploying and testing Starknet smart contracts.

+

USAGE

+
katana [OPTIONS]
+

DESCRIPTION

+

Create a local testnet node for deploying and testing Starknet smart contracts. Katana supports deployment and execution of the new as well as the legacy (Cairo 0) Cairo contracts.

+

This section covers an extensive list of information about Mining Modes, Supported RPC Methods, Katana flags and their usages. You can run multiple flags at the same time.

+

Mining Modes

+

In Katana, mining modes determine how frequent blocks are mined. By default, a new block is automatically mined as soon as a transaction is submitted.

+

You can switch from the default mining behaviour to interval mining, where a new block is created at a fixed time interval selected by the user. To enable this mode of mining, use the --block-time <MILLISECONDS> flag, as demonstrated in the following example.

+
# Produces a new block every 10 seconds
+katana --block-time 10000
+

Forking

+

Katana supports forking from a Starknet RPC provider. You can configure your node to enable the forking feature by providing a valid RPC provider using the --rpc-url <URL> flag., which would initiate Katana to fork the latest block of the provided network. If you would like to fork from a specific block, you can do so using --fork-block-number <BLOCK_NUMBER>.

+

NOTE: This does not allow fetching of historical blocks but only blocks that are mined by Katana. However, support for fetching historical blocks will be added in the future.

+
# Forks the network at block 1200
+katana --rpc-url http://your-rpc-provider.com --fork-block-number 1200
+

Messaging

+

Katana also allows users to perform L1 <-> L2 integration using the messaging feature. There are two types of messaging service supported by Katana:

+
    +
  1. Ethereum
  2. +
  3. Starknet (experimental)
  4. +
+

If configured to Ethereum messaging, Katana will listen/send messages on an Ethereum chain. This type of messaging behaves similar to the canonical Starknet sequencer with the exception that messages from L2 -> L1 will be sent directly to the settlement chain for consumption, instead of having to wait for the corresponding blocks of the messages to be proven on the settlement chain (which in reality would be a very time consuming process).

+

The Starknet messaging, however, is an experimental feature that allows Katana to listen/send messages on a Starknet chain. It attempts to replicate the behaviour of Ethereum messaging but with a Starknet chain as the settlement layer. This is achieved by having Katana listen to the Starknet chain for new blocks and then sending the messages to the settlement chain for consumption. This is an experimental and opinionated feature, and is not recommended for production use.

+
katana --messaging path/to/messaging/config.json
+

The messaging config file is a JSON file that contains the following fields:

+
{
+  /// The type of messaging service to use. Can be either "ethereum" or "starknet".
+  "chain": "ethereum",
+  /// The RPC-URL of the settlement chain.
+  "rpc_url": "http://127.0.0.1:8545",
+  /// The messaging-contract address on the settlement chain.
+  "contract_address": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
+  /// The address to use for settling messages. It should be a valid address that
+  /// can be used to send a transaction on the settlement chain.
+  "sender_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
+  /// The private key associated to `sender_address`.
+  "private_key": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
+  /// The interval, in seconds, at which the messaging service will fetch and settle messages
+  /// from/to the settlement chain.
+  "interval": 2,
+  /// The block on settlement chain from where Katana will start fetching messages.
+  "from_block": 0
+}
+

Supported Transport Layers

+

Only HTTP connection is supported at the moment. The server listens on port 5050 by default, but it can be changed by running the following command:

+
katana --port <PORT>
+

Starknet Feature Compatibility

+
Supported Transaction Type
+
TypeVersion
INVOKE1
DECLARE1, 2
DEPLOY_ACCOUNT
+

Supported RPC Methods

+
Starknet Methods
+

Katana supports version v0.3.0 of the Starknet JSON-RPC specifications. The standard methods are based on this reference.

+
    +
  • +

    starknet_blockNumber

    +
  • +
  • +

    starknet_blockHashAndNumber

    +
  • +
  • +

    starknet_getBlockWithTxs

    +
  • +
  • +

    starknet_getBlockWithTxHashes

    +
  • +
  • +

    starknet_getBlockTransactionCount

    +
  • +
  • +

    starknet_getTransactionByHash

    +
  • +
  • +

    starknet_getTransactionByBlockIdAndIndex

    +
  • +
  • +

    starknet_getTransactionReceipt

    +
  • +
  • +

    starknet_pendingTransactions

    +
  • +
  • +

    starknet_getStateUpdate

    +
  • +
  • +

    starknet_call

    +
  • +
  • +

    starknet_estimateFee

    +
  • +
  • +

    starknet_chainId

    +
  • +
  • +

    starknet_getNonce

    +
  • +
  • +

    starknet_getEvents

    +
  • +
  • +

    starknet_getStorageAt

    +
  • +
  • +

    starknet_getClassHashAt

    +
  • +
  • +

    starknet_getClass

    +
  • +
  • +starknet_getClassAt +
  • +
  • +

    starknet_addInvokeTransaction

    +
  • +
  • +

    starknet_addDeclareTransaction

    +
  • +
  • +

    starknet_addDeployAccountTransaction

    +
  • +
+
Custom Methods
+

Katana provides a convenient set of custom RPC methods to quickly and easily configure the node to suit your testing environment.

+

katana_generateBlock
+Mine a new block which includes all currently pending transactions.

+

katana_nextBlockTimestamp
+Get the time for the next block.

+

katana_increaseNextBlockTimestamp
+Increase the time for the block by a given amount of time, in seconds.

+

katana_setNextBlockTimestamp
+Similar to katana_increaseNextBlockTimestamp but takes the exact timestamp that you want in the next block.

+

katana_predeployedAccounts
+Get the info for all of the predeployed accounts.

+

katana_setStorageAt
+Set an exact value of a contract's storage slot.

+

OPTIONS

+

General Options

+

--silent
+     Don't print anything on startup.

+

--no-mining
+     Disable auto and interval mining, and mine on demand instead.

+

-b, --block-time <MILLISECONDS>
+     Block time in milliseconds for interval mining.

+

--dump-state <PATH>
+     Dump the state of chain on exit to the given file.
+     If the value is a directory, the state will be written to <PATH>/state.bin.

+

--rpc-url <URL>
+     The Starknet RPC provider to fork the network from.

+

--json-log
+     Output logs in JSON format.

+

--fork-block-number <BLOCK_NUMBER>
+     Fork the network at a specific block.

+

--messaging <PATH>
+     Configure the messaging service to allow Katana to listen/send messages on a settlement chain that can be either Ethereum or another Starknet sequencer (experimental).

+

-h, --help
+     Print help (see a summary with '-h').

+

-V, --version
+     Print version information.

+

Server Options

+

-p, --port <PORT>
+     Port number to listen on. [default: 5050]

+

--host <HOST>
+     The IP address the server will listen on.

+

Starknet Options

+

--seed <SEED>
+     Specify the seed for randomness of accounts to be predeployed.

+

--accounts <NUM>
+     Number of pre-funded accounts to generate. [default: 10]

+

--disable-fee
+     Disable charging fee for transactions.

+

Environment Options

+

--chain-id <CHAIN_ID>
+     The chain ID. [default: KATANA]

+

--gas-price <GAS_PRICE>
+     The gas price.

+

--validate-max-steps <VALIDATE_MAX_STEPS>
+     The maximum number of steps available for the account validation logic.

+

--invoke-max-steps <INVOKE_MAX_STEPS>
+     The maximum number of steps available for the account execution logic.

+

Shell Completions

+

katana completions shell

+

Generates a shell completions script for the given shell.

+

Supported shells are:

+
    +
  • bash
  • +
  • elvish
  • +
  • fish
  • +
  • powershell
  • +
  • zsh
  • +
+

EXAMPLES

+

Generate shell completions script for bash and appends it to a .bashrc file:

+
katana completions bash >> ~/.bashrc
+

EXAMPLES

+
    +
  1. Create 15 dev accounts and disable transaction fee mechanism
  2. +
+
katana --accounts 15 --disable-fee
+
    +
  1. Set the chain id to SN_GOERLI and run the server on port 8545
  2. +
+
katana --chain-id SN_GOERLI --port 8545
+
    +
  1. Load previously stored state and dump the state of this session to a file on shutdown
  2. +
+
katana --load-state ./dump-state.bin --dump-state ./dump-state.bin
+ + diff --git a/dojo-book/docs/dist/toolchain/slot/deployments-commands/deployments/index.html b/dojo-book/docs/dist/toolchain/slot/deployments-commands/deployments/index.html new file mode 100644 index 00000000..229f039c --- /dev/null +++ b/dojo-book/docs/dist/toolchain/slot/deployments-commands/deployments/index.html @@ -0,0 +1,37 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

slot deployments

+

It allows you the manage your slot deployments.

+

Commands

+

create +    Create a new deployment.

+

delete +    Delete a deployment.

+

update +    Update a deployment.

+

describe +    Describe a deployment's configuration.

+

list +    List all deployments.

+

logs +    Fetch logs for a deployment.

+

help +    Print this message or the help of the given subcommand(s)

+ + diff --git a/dojo-book/docs/dist/toolchain/slot/overview/index.html b/dojo-book/docs/dist/toolchain/slot/overview/index.html new file mode 100644 index 00000000..54d22299 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/slot/overview/index.html @@ -0,0 +1,32 @@ + + + + + + + + Slot – Dojo Book + + + + + + + + + + +
Skip to content

Slot

+

Slot is a toolchain developed by Cartrige.gg for rapidly spinning up Katana and Torii instances. Play test your game in seconds.

+

Installation

+

Run the following command to install slot:

+
curl -L https://slot.cartridge.sh | bash
+

Once finished, run slotup to manage slot installations and follow the outputted directions.

+

Deploy using Slot

+

To deploy your projects using slot, check out the tutorial Deploy using Slot.

+
+

📚 Reference

+

See the slot Reference for a complete overview of all the available subcommands.

+
+ + diff --git a/dojo-book/docs/dist/toolchain/slot/reference/index.html b/dojo-book/docs/dist/toolchain/slot/reference/index.html new file mode 100644 index 00000000..bf65d0c9 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/slot/reference/index.html @@ -0,0 +1,32 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

slot reference

+

Name

+

slot - a toolchain developed for rapidly spinning up Katana and Torii instances.

+

Usage

+
slot [COMMANDS] [OPTIONS]
+

Commands

+

auth
+     Manage auth credentials for the Slot CLI.

+

deployments

+

     Manage Slot deployments.

+

help
+     Print this message or the help of the given subcommand(s)

+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/common-options/offline/index.html b/dojo-book/docs/dist/toolchain/sozo/common-options/offline/index.html new file mode 100644 index 00000000..fce8a5e5 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/common-options/offline/index.html @@ -0,0 +1,29 @@ + + + + + + + + offline – Dojo Book + + + + + + + + + + +
Skip to content

offline

+

use sozo offline

+

--offline
+    Run without accessing the network.
+    [env: SOZO_OFFLINE=]

+

USAGE

+
sozo --offline [COMMAND]
+

For example

+
sozo --offline build
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/common-options/profile/index.html b/dojo-book/docs/dist/toolchain/sozo/common-options/profile/index.html new file mode 100644 index 00000000..3881d185 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/common-options/profile/index.html @@ -0,0 +1,43 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

use sozo profiles

+

Profiles can be convenient when dealing with multiple environments (dev, staging, prod)

+

--profile
+    Specify profile to use by name.

+

--dev
+    Use dev profile.

+

--release
+    Use release profile.

+

USAGE

+

Multiple profiles can be defined in Scarb.toml

+
[profile.dev.tool.dojo.env]
+rpc_url = "http://localhost:5050"
+account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
+private_key = "0x1800000000300000180000000000030000000000003006001800006600"
+ 
+[profile.staging.tool.dojo.env]
+rpc_url = "https://api.cartridge.gg/x/mydojoproject/katana"
+account_address = "0x5686a647a9cdd63ade617e0baf3b364856b813b508f03903eb58a7e622d5855"
+private_key = "0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b"
+

Then used with sozo commands

+
sozo --profile dev migrate
+

is equivalent to

+
sozo migrate --rpc-url http://localhost:5050 --account-address 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973 --private-key 0x1800000000300000180000000000030000000000003006001800006600
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/common/account-options/index.html b/dojo-book/docs/dist/toolchain/sozo/common/account-options/index.html new file mode 100644 index 00000000..7b1b0b5a --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/common/account-options/index.html @@ -0,0 +1,23 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

--account-address ACCOUNT_ADDRESS
+    The Starknet account address.
+    ENV: DOJO_ACCOUNT_ADDRESS

+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/common/signer-options-keystore/index.html b/dojo-book/docs/dist/toolchain/sozo/common/signer-options-keystore/index.html new file mode 100644 index 00000000..240ddc15 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/common/signer-options-keystore/index.html @@ -0,0 +1,25 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

--keystore PATH
+    Use the keystore in the given folder or file.

+

--password PASSWORD
+    The keystore password. Used with --keystore.
+    ENV: DOJO_KEYSTORE_PASSWORD

+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/common/signer-options-raw/index.html b/dojo-book/docs/dist/toolchain/sozo/common/signer-options-raw/index.html new file mode 100644 index 00000000..022c55db --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/common/signer-options-raw/index.html @@ -0,0 +1,23 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

--private-key PRIVATE_KEY
+    The raw private key associated with the account contract.
+    ENV: DOJO_PRIVATE_KEY

+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/common/starknet-options/index.html b/dojo-book/docs/dist/toolchain/sozo/common/starknet-options/index.html new file mode 100644 index 00000000..b5e0fbfc --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/common/starknet-options/index.html @@ -0,0 +1,23 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

--rpc-url URL
+    The Starknet RPC endpoint. [default: http://localhost:5050]
+    ENV: STARKNET_RPC_URL

+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/common/world-options/index.html b/dojo-book/docs/dist/toolchain/sozo/common/world-options/index.html new file mode 100644 index 00000000..be52a5b6 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/common/world-options/index.html @@ -0,0 +1,23 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

--world WORLD_ADDRESS
+    The address of the World contract.
+    ENV: DOJO_WORLD_ADDRESS

+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/development/index.html b/dojo-book/docs/dist/toolchain/sozo/development/index.html new file mode 100644 index 00000000..a0f70ed3 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/development/index.html @@ -0,0 +1,21 @@ + + + + + + + + Development – Dojo Book + + + + + + + + + + +
Skip to content

Development

+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/overview/index.html b/dojo-book/docs/dist/toolchain/sozo/overview/index.html new file mode 100644 index 00000000..88cd5835 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/overview/index.html @@ -0,0 +1,38 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

katana

+

Sozo

+

sozo is a powerful all-in-one tool for managing your Dojo projects. It helps with everything from scaffolding a new project, all the way to deploying and interacting with your Dojo Worlds. It includes a migration planning tool, designed to streamline the updating and deployment of AWs. It provides a robust command-line interface (CLI) that simplifies World management tasks, enabling you to focus on the creative aspects of World-building. In the future, it may include a GUI.

+

Features

+
    +
  • Binary CLI: Sozo provides an intuitive binary CLI, ensuring easy management of your Worlds, whether you're updating existing ones or deploying new ones.
  • +
+

Installation

+

sozo binary can be installed via dojoup, our dedicated installation package manager.

+

Installing from Source

+
git clone https://github.com/dojoengine/dojo
+cd dojo
+cargo install --path ./crates/sozo --locked --force
+

This will install Sozo and the required dependencies on your local system.

+
+

📚 Reference

+

See the sozo Reference for a complete overview of all the available subcommands.

+
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/project-commands/build/index.html b/dojo-book/docs/dist/toolchain/sozo/project-commands/build/index.html new file mode 100644 index 00000000..4c4512a8 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/project-commands/build/index.html @@ -0,0 +1,23 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

sozo build

+

build is used to compile the cairo contracts, generating the necessary artifacts for deployment.

+
sozo build
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/project-commands/init/index.html b/dojo-book/docs/dist/toolchain/sozo/project-commands/init/index.html new file mode 100644 index 00000000..41eb6089 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/project-commands/init/index.html @@ -0,0 +1,23 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

sozo init

+

init is used to initialize a new project. It will initialize a new project in the current directory by cloning the dojo-starter.

+
sozo init
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/project-commands/migrate/index.html b/dojo-book/docs/dist/toolchain/sozo/project-commands/migrate/index.html new file mode 100644 index 00000000..d96b1fba --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/project-commands/migrate/index.html @@ -0,0 +1,52 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

sozo migrate

+

migrate is used to perform the migration (deployment) process, declaring and deploying contracts as necessary to deploy or update the World.

+

Changes made to the local World after the initial deployment, can easily be pushed to the remote counterpart by running sozo migrate --world <WORLD_ADDRESS> with WORLD_ADDRESS being the address of the remote World. In the background, migrate will compute the diffs of the local and remote World, then, start constructing a migration strategy to determine, if any, which part of the local World needs to be pushed upstream.

+

USAGE

+
sozo migrate [OPTIONS]
+

OPTIONS

+

General Options

+

--name NAME
+    Name of the World. At the moment, the only usage for this option is to be used as a salt when deploying the World contract to avoid address conflicts. This option is required when performing the initial migration of the World.

+

World Options

+

{{#include ../common/world-options.md}}

+

Starknet Options

+

{{#include ../common/starknet-options.md}}

+

Account Options

+

{{#include ../common/account-options.md}}

+

Signer Options - Raw

+

{{#include ../common/signer-options-raw.md}}

+

Signer Options - Keystore

+

{{#include ../common/signer-options-keystore.md}}

+

EXAMPLES

+
    +
  1. Deploying your World for the first time to a local Katana node
  2. +
+
sozo migrate --name ohayo --rpc-url http://localhost:5050
+
    +
  1. Updating a remote World after making some changes
  2. +
+
sozo migrate --world 0x123456
+
    +
  1. Deploying your World using profile options
  2. +
+
sozo --profile dev migrate
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/project-commands/test/index.html b/dojo-book/docs/dist/toolchain/sozo/project-commands/test/index.html new file mode 100644 index 00000000..71593d2c --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/project-commands/test/index.html @@ -0,0 +1,23 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

sozo test

+

test is used to test the project's cairo contracts. It will run all tests found within the project.

+
sozo test
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/reference/index.html b/dojo-book/docs/dist/toolchain/sozo/reference/index.html new file mode 100644 index 00000000..f5965767 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/reference/index.html @@ -0,0 +1,42 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/world-commands/auth/index.html b/dojo-book/docs/dist/toolchain/sozo/world-commands/auth/index.html new file mode 100644 index 00000000..d0d5fac2 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/world-commands/auth/index.html @@ -0,0 +1,29 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

sozo auth

+

auth is used to manage world authorization.

+
sozo auth [OPTIONS] <COMMAND> --world <WORLD_ADDRESS>
+
Commands:
+  writer  Auth a system with the given calldata.
+  help    Print this message or the help of the given subcommand(s)
+
# example: writer - auth a system with the given calldata
+# This will auth the spawn system with the writer role for Position component
+sozo auth writer Moves <CONTRACT_ADDRESS> --world <WORLD_ADDRESS>
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/world-commands/events/index.html b/dojo-book/docs/dist/toolchain/sozo/world-commands/events/index.html new file mode 100644 index 00000000..2e55daec --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/world-commands/events/index.html @@ -0,0 +1,23 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

sozo events

+

events is used to queries world events.

+
sozo events
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/world-commands/execute/index.html b/dojo-book/docs/dist/toolchain/sozo/world-commands/execute/index.html new file mode 100644 index 00000000..f0fd88a8 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/world-commands/execute/index.html @@ -0,0 +1,46 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

sozo execute

+

execute is used to execute a World's system.

+

Performing a system execution requires sending a transaction, therefore, execute expects an account address as well as its respective private key in order to sign the transaction before sending it.

+

USAGE

+
# you can use the name or address of the contract
+sozo execute <CONTRACT> <ENTRYPOINT>
+

OPTIONS

+

General Options

+

--calldata CALLDATA
+    The calldata to be passed to the system that you want to execute.
+    Comma separated values e.g., 0x12345,0x69420.

+

World Options

+

{{#include ../common/world-options.md}}

+

Starknet Options

+

{{#include ../common/starknet-options.md}}

+

Account Options

+

{{#include ../common/account-options.md}}

+

Signer Options - Raw

+

{{#include ../common/signer-options-raw.md}}

+

Signer Options - Keystore

+

{{#include ../common/signer-options-keystore.md}}

+

EXAMPLES

+
    +
  1. Executing the position system which takes two values (x: 0x77 and y: 0x44)
  2. +
+
sozo execute moving_contract position --calldata 0x77,0x44
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/world-commands/model/index.html b/dojo-book/docs/dist/toolchain/sozo/world-commands/model/index.html new file mode 100644 index 00000000..42d696ba --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/world-commands/model/index.html @@ -0,0 +1,64 @@ + + + + + + + + models – Dojo Book + + + + + + + + + + +
Skip to content

models

+

sozo model

+

model is used to interact with a World's models. It is useful for querying about a model's information, or a model value of an entity.

+

USAGE

+
sozo model <COMMAND>
+ 
+Commands:
+  class-hash  Get the class hash of a model
+  schema      Retrieve the schema for a model
+  get         Get the model value for an entity
+

SUBCOMMANDS

+

Note: Before to execute the following subcommands, ensure you have added your world address to your Scarb.toml file.

+
[tool.dojo.env]
+rpc_url = "http://localhost:5050/"
+# Default account for katana with seed = 0
+account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
+private_key = "0x1800000000300000180000000000030000000000003006001800006600"
+world_address = "0x28f5999ae62fec17c09c52a800e244961dba05251f5aaf923afabd9c9804d1a"
+

class-hash

+

Get the class hash of a model

+
sozo model class-hash <NAME>
+
Arguments
+

NAME
+    The name of the model

+

schema

+

Retrieve the schema for a model

+
sozo model schema <NAME>
+
Arguments
+

NAME
+    The name of the model

+

get

+

Get the model value for an entity

+
sozo model get <NAME> [KEYS]...
+
Arguments
+

NAME
+    The name of the model

+

KEYS
+    The keys of the entity that you want to query.
+    Comma separated values e.g., 0x12345,0x69420,...

+

OPTIONS

+

World Options

+

{{#include ../common/world-options.md}}

+

Starknet Options

+

{{#include ../common/starknet-options.md}}

+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/world-commands/register/index.html b/dojo-book/docs/dist/toolchain/sozo/world-commands/register/index.html new file mode 100644 index 00000000..1c5056c2 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/world-commands/register/index.html @@ -0,0 +1,34 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

sozo register

+

register is used to register new systems and components.

+
sozo register [OPTIONS] <COMMAND>
+
Commands:
+  component  Register a component to a world.
+  system     Register a system to a world.
+  help       Print this message or the help of the given subcommand(s)
+
# example: component - register a component to a world
+# this will register the Moves component to the world
+sozo register component Moves
+ 
+# example: system - register a system to a world
+# this will register the spawn system to the world
+sozo register system spawn
+ + diff --git a/dojo-book/docs/dist/toolchain/sozo/world-commands/system/index.html b/dojo-book/docs/dist/toolchain/sozo/world-commands/system/index.html new file mode 100644 index 00000000..9197c4df --- /dev/null +++ b/dojo-book/docs/dist/toolchain/sozo/world-commands/system/index.html @@ -0,0 +1,55 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

sozo system

+

system is used to interact with a World's systems. It is useful for querying about a system's information.

+

USAGE

+
sozo system <COMMAND>
+ 
+Commands:
+  get         Get the class hash of a system.
+  dependency  Retrieve the component dependencies of a system.
+

SUBCOMMANDS

+

get

+

Get the class hash of a system

+
sozo system get <NAME>
+
Arguments
+

NAME
+    The name of the system

+

dependency

+

Retrieve the component dependencies of a system

+
sozo system dependency <NAME>
+
Arguments
+

NAME
+    The name of the system

+

OPTIONS

+

World Options

+

{{#include ../common/world-options.md}}

+

Starknet Options

+

{{#include ../common/starknet-options.md}}

+

EXAMPLES

+
    +
  1. Get the class hash of the spawn system
  2. +
+
sozo system get spawn
+
    +
  1. Get the component dependencies of the spawn system
  2. +
+
sozo system dependency spawn
+ + diff --git a/dojo-book/docs/dist/toolchain/torii/graphql/index.html b/dojo-book/docs/dist/toolchain/torii/graphql/index.html new file mode 100644 index 00000000..05e8e50d --- /dev/null +++ b/dojo-book/docs/dist/toolchain/torii/graphql/index.html @@ -0,0 +1,334 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

Torii - GraphQL

+

Name

+

In Dojo, you have access to custom queries and subscriptions that are specifically designed to work with the caller for client applications. GraphQL is the technology that makes this possible.

+

GraphQL is the rising star of backend technologies. It replaces REST as an API design paradigm and is becoming the new standard for exposing the data and functionality of a web server. It allows you to specify exactly what data you want to retrieve, and it delivers that data in a structured JSON format. This flexibility in data retrieval ensures that you get the information you need efficiently and in a format that's easy to work with.

+

GraphQL Playground

+

GraphQL Playground is a GraphQL IDE that allows you to interactively explore the functionality of a GraphQL API by sending queries and mutations to it. It’s somewhat similar to Postman which offers comparable functionality for REST APIs.

+

USAGE

+

Pre-requisites

+

Make sure torii is running in your local terminal.

+
torii --world <WORLD_ADDRESS>
+

It starts GraphQL server at http://0.0.0.0:8080/graphql

+

After the torii server starts on your local machine, you're ready to make query and subscription operations.

+

Schema and query defintions

+

Torii generates both the schema and queries at runtime specific to your world. There are mainly two groups of queries, predefined queries and dynamically generated custom queries.

+

Predefined queries like entities provide a generic entry point to the entities data of the world. Custom queries on the other hand are built according to the models of the world. Each model has a correpsonding {name}Models query and retrieves the associated model data. For example: positionModels.

+

The benefit of custom queries becomes apparent when filtering and sorting is needed. They allow much more finer control of the returned dataset.

+

Query operation

+

In hello-dojo we fetched some data from the Moves model. This time let's fetch only id, name, classHash fields from Position model .

+
query {
+  model(id: "Position") {
+    id
+    name
+    classHash
+  }
+}
+

After you run the query, you will receive an output like this:

+
{
+  "data": {
+    "model": {
+      "id": "Position",
+      "name": "Position",
+      "classHash": "0x6ffc643cbc4b2fb9c424242b18175a5e142269b45f4463d1cd4dddb7a2e5095"
+    }
+  }
+}
+

Great! If you're wondering about the number of fields a Model has or the details of a Entities, you can find all the information about the schema definition in the Documentation Explorer section of the GraphQL IDE. It's your go-to place for exploring the rest of the documentation.

+

Now lets retrieve more data from Moves model.

+
query {
+  movesModels {
+    edges {
+      node {
+        player
+        remaining
+        last_direction
+      }
+    }
+  }
+}
+

After you run the query, you will receive an output like this:

+
{
+  "data": {
+    "movesModels": {
+      "edges": [
+        {
+          "node": {
+            "player": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",
+            "remaining": 10,
+            "last_direction": "None"
+          }
+        }
+      ]
+    }
+  }
+}
+

Transactions

+

GraphQL additionally offers an API to fetch transactions emitted from your world. Presently, you can retrieve transaction data with the potential for future support of transaction receipt. Current API includes pagination support, although filtering is not yet supported. Let's explore an example.

+
query{
+  transactions{
+    edges{
+      node{
+        id
+        transactionHash
+        senderAddress
+        calldata
+      }
+    }
+    totalCount
+  }
+}
+

If you execute this query after you applied sozo migrate in your hello-dojo example. You will get an output similar to this.

+
{
+  "data": {
+    "transactions": {
+      "edges": [
+        {
+          "node": {
+            "id": "0x000000000000000000000000000000000000000000000000000000000000000a:0x0000",
+            "transactionHash": "0x2da3d65e223362c72906f97663a4e7dc81ab0bbd04bbde5532a230c1e97d93e",
+            "senderAddress": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",
+            "calldata": [
+              "0x1",
+              "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",
+              "0x2730079d734ee55315f4f141eaed376bddd8c2133523d223a344c5604e0f7f8",
+              "0x0",
+              "0x2",
+              "0x2",
+              "0x35ec9fd22092dc0c8fc9341e94d5f361924d921c128fa46a0648f2dac519ce4",
+              "0x2ffecbe8de6c7c10c785a6eb964ee6489f8dcf139000adbe2c0f12d249be7d8"
+            ]
+          }
+        },
+        {
+          "node": {
+            "id": "0x0000000000000000000000000000000000000000000000000000000000000008:0x0000",
+            "transactionHash": "0x2aa02de0e3fa582b3cb6cf9e4371051f44ae2e0d6c94f5c936338ffc8c2ac12",
+            "senderAddress": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",
+            "calldata": [
+              "0x2",
+              "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",
+              "0x1e7875674bcb09daaf984cbf77264ac98120cb39e6d17522520defcdc347476",
+              "0x0",
+              "0x1",
+              "0x405a3c5421ca7e23052abce78057e27384ba9db5e4feff7b4041a74e769a98a",
+              "0x1e7875674bcb09daaf984cbf77264ac98120cb39e6d17522520defcdc347476",
+              "0x1",
+              "0x1",
+              "0x2",
+              "0x2e5174b54aef0b99d4685827ffa51488447e1f5607908293d5c715d6bd22433",
+              "0x6a11b5b3003a3aa0ae7f8f443e48314cc0bc51eaea7c3ed1c19beb909f5dda3"
+            ]
+          }
+        },
+        {
+          "node": {
+            "id": "0x0000000000000000000000000000000000000000000000000000000000000005:0x0000",
+            "transactionHash": "0x1f03fa7dc5a673f96d53b728785a98d6ff089c182a7bb32735b150e91817e5b",
+            "senderAddress": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",
+            "calldata": [
+              "0x1",
+              "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf",
+              "0x1987cbd17808b9a23693d4de7e246a443cfe37e6e7fbaeabd7d7e6532b07c3d",
+              "0x0",
+              "0x6",
+              "0x6",
+              "0xb3e374b8087dca92601afbb9881fed855ac0d568e3bf878a876fca5ffcb479",
+              "0x41d7f42bf7a362f0420aaae66d7a91df981100a039ac116a1d9cb632c74ad27",
+              "0x0",
+              "0x2",
+              "0x59f31686991d7cac25a7d4844225b9647c89e3e1e2d03460dbc61e3fbfafc59",
+              "0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f"
+            ]
+          }
+        }
+      ],
+      "totalCount": 3
+    }
+  }
+}
+

Now feel free to play around with the query by removing any fields from the selection set and observe the responses sent by the server. It is your turn to create any kind of query for entities and models!

+

Pagination

+

As the entities in your world grows, fetching all of that data at once can become inefficient and slow.

+

Torii provides two methods to address this - cursor or offset/limit based pagination. To keep the return type consistent, both methods will return a Connection type.

+

You can read more about graphql pagination here.

+
Cursor
+

Cursor based pagination is the most efficient, allowing us to query a subset or slice of the entire set of data. Both forward and backward pagination are supported using a combination of first, last, before, after input arguments.

+

Forward pagination uses first/after and backward pagination uses last/before. first/last are integers representing the number of items to return. after/before are the cursors to paginate from.

+

Query for first page of 2 entities

+
query {
+  entities (first: 2) {
+    totalCount
+    edges {
+      cursor
+      node {
+        ...
+      }
+    }
+  }
+}
+

Result shows there are 5 entities and returns the first two

+
{
+  "entities" {
+    "totalCount": 5,
+    "edges" [
+      {
+        "cursor": "Y3Vyc29yX29uZQ==",
+        "node" : { }
+      },
+      {
+        "cursor": "Y3Vyc29yX3R3bw==",
+        "node" : { }
+      },
+    ]
+  }
+}
+

Query 3 entities after the second node (last 3)

+
query {
+  entities (first: 3, after: "Y3Vyc29yX3R3bw==") {
+    ...
+  }
+}
+
Offset/limit
+

Offset/limit based pagination can be more intuitive and easier to use. However, for very, very large datasets they can be inefficient.

+
# essentially the same as the last query in cursor example
+query {
+  entities (offset: 2, limit 3) {
+    ...
+  }
+}
+

Subscription operations

+

Subscriptions are a GraphQL feature that allows a server to send data to its clients when a specific event happens. Subscriptions are usually implemented with WebSockets. In that setup, the server maintains a steady connection to its subscribed client. This also breaks the “Request-Response-Cycle” that is used for with REST APIs.

+

Instead, the client initially opens up a long-lived connection to the server by sending a subscription query that specifies which event it is interested in. Every time this particular event happens, the server uses the connection to push the event data to the subscribed client(s).

+

In this example, you can listen when an Model is registered by executing this subscription

+
subscription modelRegistered {
+  modelRegistered {
+    id
+    name
+  }
+}
+

Graphql also supports subscription to a targeted entity or model, for this we have to pass its id as an argument

+

In this example, our server provides a entityUpdated subscription, which should notify clients whenever an entity with id 0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20 is updated. On the same subscription we can get the model(components) values of the updated entity . A client can execute a subscription that looks like this:

+
subscription {
+  entityUpdated(
+    id: "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20"
+  ) {
+    id
+    keys
+    eventId
+    createdAt
+    updatedAt
+    models {
+      __typename
+      ... on Moves {
+        remaining
+        player
+      }
+      ... on Position {
+        vec {
+          x
+          y
+        }
+      }
+    }
+  }
+}
+

According to your input, you will receive an output like this:

+
{
+  "data": {
+    "entityUpdated": {
+      "id": "0x28cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20",
+      "keys": [
+        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
+      ],
+      "eventId": "0x0000000000000000000000000000000000000000000000000000000000000013:0x0000:0x0000",
+      "createdAt": "2023-10-17 11:39:42",
+      "updatedAt": "2023-10-17 11:52:48",
+      "models": [
+        {
+          "__typename": "Moves",
+          "remaining": 10,
+          "player": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
+        },
+        {
+          "__typename": "Position",
+          "vec": {
+            "x": 10,
+            "y": 10
+          }
+        }
+      ]
+    }
+  }
+}
+

Susbcription to events

+

A valuable approach for harnessing the power of GraphQL is by actively monitoring the events emitted throughout your game. This allows you to extract essential information such as key values, data, and transaction hashes. These events are customizable and can be filtered based on keys, much like entities query, and they seamlessly support pagination. In the subsequent example, we will demonstrate how to listen for any event emitted within your program.

+
subscription {
+  eventEmitted {
+    id
+    keys
+    data
+    transactionHash
+  }
+}
+

If you execute this suscription after you applied sozo execute <ACTION_CONTRACT_ADDRESS> spawn in your hello-dojo example. You will get an output similar to this.

+
{
+  "data": {
+    "eventEmitted": {
+      "id": "0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0000",
+      "keys": [
+        "0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d"
+      ],
+      "data": [
+        "0x4d6f766573",
+        "0x1",
+        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",
+        "0x0",
+        "0x2",
+        "0x64",
+        "0x0"
+      ],
+      "transactionHash": "0x3b7b034a087355c996abb52e363932c1135f8dd49587bc9a05902d3cf0650b"
+    }
+  }
+}
+-----------------------------------------------------------------------------------------------
+{
+  "data": {
+    "eventEmitted": {
+      "id": "0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0001",
+      "keys": [
+        "0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d"
+      ],
+      "data": [
+        "0x506f736974696f6e",
+        "0x1",
+        "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",
+        "0x0",
+        "0x2",
+        "0xa",
+        "0xa"
+      ],
+      "transactionHash": "0x3b7b034a087355c996abb52e363932c1135f8dd49587bc9a05902d3cf0650b"
+    }
+  }
+}
+ + diff --git a/dojo-book/docs/dist/toolchain/torii/grpc/index.html b/dojo-book/docs/dist/toolchain/torii/grpc/index.html new file mode 100644 index 00000000..e075bbc7 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/torii/grpc/index.html @@ -0,0 +1,28 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

gRPC

+

TL;DR

+
    +
  • gRPC is an efficient way to fetch your data
  • +
  • You can subscribe to entity and model events via the gRPC
  • +
  • Read more - gRPC
  • +
+

You can use the gRPC directly or you can use it through a developed client. A great way to use it is via dojo.js torii-client package.

+ + diff --git a/dojo-book/docs/dist/toolchain/torii/overview/index.html b/dojo-book/docs/dist/toolchain/torii/overview/index.html new file mode 100644 index 00000000..236d9c41 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/torii/overview/index.html @@ -0,0 +1,46 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

katana

+

Torii

+

Torii is an automatic indexer and client for dojo worlds. Built in rust to be blazingly fast and exceptionally scalable. Torii provides a fully typed, dynamically generated GraphqQL interface and a high performance gRPC api for binding clients to the world state. There are two parts to torii, the client and the server.

+

Torii Server

+

The torii server comprises of the rust backend that exposes the graphql and gRPC endpoints.

+

Torii Client

+

Torii client interfaces with the server to provide an easy to use api for your clients:

+ +

Usage

+

Torii leverages world introspection to bootstrap directly from an onchain deployment. Simply run:

+
torii --world <World Address>
+

You'll have a GraphQL API running at http://localhost:8080/graphql and a gRPC api at http://localhost:8080

+

Installation

+

The torii binary can be installed via dojoup, our dedicated installation package manager.

+

Installing from Source

+

If you prefer to install from the source code:

+
cargo install --path ./crates/torii --profile local --force
+

This will install Torii and the required dependencies on your local system.

+
+

📚 Reference

+

See the torii Reference for a complete reference.

+
+ + diff --git a/dojo-book/docs/dist/toolchain/torii/reference/index.html b/dojo-book/docs/dist/toolchain/torii/reference/index.html new file mode 100644 index 00000000..3438fd69 --- /dev/null +++ b/dojo-book/docs/dist/toolchain/torii/reference/index.html @@ -0,0 +1,55 @@ + + + + + + + + Dojo Book + + + + + + + + + + +
Skip to content

torii reference

+

Name

+

torii - An automatic indexer and networking layer for a world contract.

+

USAGE

+
torii [OPTIONS]
+

DESCRIPTION

+

torii starts the indexer and exposes GraphQL/gRPC API endpoints. The indexer queries the specified Starknet RPC endpoint for transaction blocks and listens for transactions related to the world contract. These transactions can include component/system registrations, entity state updates, system calls, and events. The parsed data is then stored in a local SQLite database.

+

The GraphQL and gRPC API endpoints run in tandem with the indexer, providing custom queries specific to the world contract for client applications.

+

Database URL

+

torii uses a sqlite database to store indexed data. The database can be stored either in-memory or persistently on the filesystem.

+
    +
  • The in-memory database is ephemeral and only lasts as long as the indexer is running. This is a fast and simple option to start the indexer for development/testing.
  • +
  • Persistent storage should be used in production. It relies on the local filesystem for storage.
  • +
+

Note: If using in-memory db, the memory will be garbage collected after a period of inactivity, causing queries to result in errors. Workaround is to use a persistent database.

+
# Persistent database storage using file indexer.db
+torii --database indexer.db
+

OPTIONS

+

General Options

+

-w, --world
+     Address of the world contract to index

+

--rpc
+     Starknet RPC endpoint to use [default: http//localhost:5050]

+

-d, --database <DATABASE>
+     Database filepath (ex: indexer.db) [default: :memory:]

+

-s, --start-block <START_BLOCK>
+     Specify a block to start indexing from, ignored if stored head exists [default: 0]

+

--allowed-origins <ALLOWED_ORIGINS>
+     Specify allowed origins for api endpoints (comma-separated list of allowed origins, or "*" for all) [default: *]

+

--external-url <EXTERNAL_URL>
+     The external url of the server, used for configuring the GraphQL Playground in a hosted environment

+

-h, --help +     Print help

+

-V, --version +     Print version

+ + diff --git a/dojo-book/docs/dist/torii-icon-word.png b/dojo-book/docs/dist/torii-icon-word.png new file mode 100644 index 00000000..120efbc9 Binary files /dev/null and b/dojo-book/docs/dist/torii-icon-word.png differ diff --git a/dojo-book/docs/dist/torii-icon.png b/dojo-book/docs/dist/torii-icon.png new file mode 100644 index 00000000..3e1e9b28 Binary files /dev/null and b/dojo-book/docs/dist/torii-icon.png differ diff --git a/dojo-book/docs/dist/tutorial/deploy-using-slot/main/index.html b/dojo-book/docs/dist/tutorial/deploy-using-slot/main/index.html new file mode 100644 index 00000000..891153a6 --- /dev/null +++ b/dojo-book/docs/dist/tutorial/deploy-using-slot/main/index.html @@ -0,0 +1,62 @@ + + + + + + + + Deploy your game using Slot – Dojo Book + + + + + + + + + + +
Skip to content

Deploy your game using Slot

+

Welcome to this tutorial where we'll guide you through deploying a project using the Slot.

+
+

Before we start, make sure you are using the latest dojo version. Run dojoup to have the latest version installed.

+

Now, let's create a new folder and initialize it with sozo.

+
mkdir dojo-starter && cd dojo-starter
+sozo init
+

First, we need to set up our configuration, starting by authenticating with Cartridge. To do this, run the following command, which will then prompt a new screen where you will need to go through the authentication process.

+
slot auth login
+ 
+# Slot Auth debug (if old auth credentials):
+rm ~/Library/Application\ Support/slot/credentials.json
+

Once successful, you can create a new deployment with a unique DEPLOYMENT_NAME. To do this, run the following command:

+
slot deployments create DEPLOYMENT_NAME katana
+

After that, you should receive the RPC endpoint for the katana slot. Now, you can use that and update your Scarb.toml file with the new RPC endpoint as follows:

+
[tool.dojo.env]
+rpc_url = "YOUR_NEW_RPC_URL"
+

Now, you can stream katana in a new terminal. Open a new terminal and run the following command:

+
slot deployments logs DEPLOYMENT_NAME katana -f
+

Then, copy the account address and the private key from the first account into the Scarb.toml file and replace the existing ones as follows:

+
account_address = "YOUR_NEW_ACCOUNT_ADDRESS"
+private_key = "YOUR_NEW_PRIVATE_KEY"
+

Note: For each new Katana slot, a different account seed is used, making all the accounts unique!

+
+

Once finished with the new configurations, we are ready to build and migrate the project. To build the project, run the following command:

+
sozo build
+

Now, let's migrate the project to our new katana slot:

+
sozo migrate --name YOUR_PROJECT_NAME
+

If the migrations have been successful, you will receive the WORLD_ADDRESS, which then you can use to interact with your world.

+
🎉 Successfully migrated World at address WORLD_ADDRESS
+ 
+ Updating manifest.json...
+ 
+ Done.
+ 
+

Congratulations! You have successfully deployed your project with a Katana slot.

+

Torii

+

To initiate a Torri indexer slot, execute the following command:

+
slot deployments create DEPLOYMENT_NAME torii --world YOUR_WORLD_ADDRESS --rpc YOUR_NEW_RPC_URL --start-block 1
+

Once deployment is successful, you should receive the endpoints for GraphQL and gRPC.

+

If you wish to stream the logs, you can run the following command in a new terminal:

+
slot deployments logs DEPLOYMENT_NAME torii -f
+ + diff --git a/dojo-book/docs/dist/tutorial/onchain-chess/0-setup/index.html b/dojo-book/docs/dist/tutorial/onchain-chess/0-setup/index.html new file mode 100644 index 00000000..b1d9f17c --- /dev/null +++ b/dojo-book/docs/dist/tutorial/onchain-chess/0-setup/index.html @@ -0,0 +1,276 @@ + + + + + + + + 0. Setup – Dojo Book + + + + + + + + + + +
Skip to content

0. Setup

+

Before starting recommend following the hello-dojo chapter to gain a basic understanding of the Dojo game.

+

Initializing the Project

+

Create a new Dojo project folder. You can name your project what you want.

+
mkdir chess
+

Open the project folder.

+
cd chess
+

And initialize the project using sozo init.

+
sozo init
+

Cleaning Up the Boilerplate

+

The project comes with a lot of boilerplate codes. Clear it all. Make sure your directory looks like this

+
├── README.md
+├── Scarb.toml
+└── src
+    ├── actions.cairo
+    ├── lib.cairo
+    ├── models
+   ├── game.cairo
+   ├── piece.cairo
+   └── player.cairo
+    ├── models.cairo
+    ├── tests
+   ├── integration.cairo
+   └── units.cairo
+    └── tests.cairo
+

Remodel your lib.cairo, to look like this :

+
mod actions;
+mod models;
+mod tests;
+

Remodel your models.cairo, to look like this :

+
mod game;
+mod piece;
+mod player;
+

Remodel your tests.cairo, to look like this :

+
mod integration;
+mod units;
+

Make sure your Scarb.toml looks like this:

+
[package]
+cairo-version = "2.4.0"
+name = "chess"
+version = "0.4.0"
+ 
+[cairo]
+sierra-replace-ids = true
+ 
+[dependencies]
+dojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.2" }
+ 
+[[target.dojo]]
+ 
+[tool.dojo]
+initializer_class_hash = "0xbeef"
+ 
+[tool.dojo.env]
+rpc_url = "http://localhost:5050/"
+# Default account for katana with seed = 0
+account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
+private_key = "0x1800000000300000180000000000030000000000003006001800006600"
+ 
+

Compile your project with:

+
sozo build
+

Basic Models

+

While there are many ways to design a chess game using the ECS model, we'll follow this approach:

+
+

Every square of the chess board (e.g., A1) will be treated as an entity. If a piece exists on a square position, that position will hold that piece.

+
+

First, add this basic player model to models/player.cairo file. If you are not familar with model syntax in Dojo engine, go back to this chapter.

+
use starknet::ContractAddress;
+ 
+#[derive(Model, Drop, Serde)]
+struct Player {
+    #[key]
+    game_id: u32,
+    #[key]
+    address: ContractAddress,
+    color: Color
+}
+ 
+#[derive(Serde, Drop, Copy, PartialEq, Introspect)]
+enum Color {
+    White,
+    Black,
+    None,
+}
+

Second, we do the same for game model. Edit your models/player.cairo file and add this content.

+
use chess::models::player::Color;
+use starknet::ContractAddress;
+ 
+#[derive(Model, Drop, Serde)]
+struct Game {
+    #[key]
+    game_id: u32,
+    winner: Color,
+    white: ContractAddress,
+    black: ContractAddress
+}
+ 
+#[derive(Model, Drop, Serde)]
+struct GameTurn {
+    #[key]
+    game_id: u32,
+    player_color: Color
+}
+

Lastly we create piece model in our models/player.cairo file.

+
use chess::models::player::Color;
+use starknet::ContractAddress;
+ 
+#[derive(Model, Drop, Serde)]
+struct Piece {
+    #[key]
+    game_id: u32,
+    #[key]
+    position: Vec2,
+    color: Color,
+    piece_type: PieceType,
+}
+ 
+#[derive(Copy, Drop, Serde, Introspect)]
+struct Vec2 {
+    x: u32,
+    y: u32
+}
+ 
+#[derive(Serde, Drop, Copy, PartialEq, Introspect)]
+enum PieceType {
+    Pawn,
+    Knight,
+    Bishop,
+    Rook,
+    Queen,
+    King,
+    None,
+}
+

Basic systems

+

Starting from the next chapter, you will implement the actions.cairo file. This is where our game logic/contract will reside.

+

For now, actions.cairo should look like this:

+
#[dojo::contract]
+mod actions {
+}
+

It should be noted that Systems function are contract methods, by implication, rather than implementing the game logic in systems, we are implementing it in a contract.

+

Compile your project

+

Now try sozo build to build.

+

Complied? Great! then let's move on. If not fix the issues, so that you can run the sozo build command successfully.

+

Implement Traits for models

+

Before you move on, implement traits for models so we can use them in the next chapter when creating the action contract.

+

Requirements

+

Firt we have to define the following traits for Game, Player, Piece models respectively.

+
trait GameTurnTrait {
+    fn next_turn(self: @GameTurn) -> Color;
+}
+ 
+trait PlayerTrait {
+fn is_not_my_piece(self: @Player, piece_color: Color) -> bool;
+}
+ 
+trait PieceTrait {
+fn is_out_of_board(next_position: Vec2) -> bool;
+fn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool;
+}
+

Try to implement this code by yourself, Otherwise

+ +
// code for player.cairo file
+trait PlayerTrait {
+    fn is_not_my_piece(self: @Player, piece_color: Color) -> bool;
+}
+ 
+impl PalyerImpl of PlayerTrait {
+    fn is_not_my_piece(self: @Player, piece_color: Color) -> bool {
+        *self.color != piece_color
+    }
+}
+ 
+// code for game.cairo file
+trait GameTurnTrait {
+    fn next_turn(self: @GameTurn) -> Color;
+}
+impl GameTurnImpl of GameTurnTrait {
+    fn next_turn(self: @GameTurn) -> Color {
+        match self.player_color {
+            Color::White => Color::Black,
+            Color::Black => Color::White,
+            Color::None => panic(array!['Illegal turn'])
+        }
+    }
+}
+ 
+// code for piece.cairo file
+trait PieceTrait {
+    fn is_out_of_board(next_position: Vec2) -> bool;
+    fn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool;
+}
+ 
+impl PieceImpl of PieceTrait {
+    fn is_out_of_board(next_position: Vec2) -> bool {
+        next_position.x > 7 || next_position.y > 7
+    }
+ 
+    fn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool {
+        let n_x = next_position.x;
+        let n_y = next_position.y;
+        assert(!(n_x == *self.position.x && n_y == *self.position.y), 'Cannot move same position');
+        match self.piece_type {
+            PieceType::Pawn => {
+                match self.color {
+                    Color::White => {
+                        (n_x == *self.position.x && n_y == *self.position.y + 1)
+                            || (n_x == *self.position.x && n_y == *self.position.y + 2)
+                            || (n_x == *self.position.x + 1 && n_y == *self.position.y + 1)
+                            || (n_x == *self.position.x - 1 && n_y == *self.position.y + 1)
+                    },
+                    Color::Black => {
+                        (n_x == *self.position.x && n_y == *self.position.y - 1)
+                            || (n_x == *self.position.x && n_y == *self.position.y - 2)
+                            || (n_x == *self.position.x + 1 && n_y == *self.position.y - 1)
+                            || (n_x == *self.position.x - 1 && n_y == *self.position.y - 1)
+                    },
+                    Color::None => panic(array!['Should not move empty piece']),
+                }
+            },
+            PieceType::Knight => { n_x == *self.position.x + 2 && n_y == *self.position.y + 1 },
+            PieceType::Bishop => {
+                (n_x <= *self.position.x && n_y <= *self.position.y && *self.position.y
+                    - n_y == *self.position.x
+                    - n_x)
+                    || (n_x <= *self.position.x && n_y >= *self.position.y && *self.position.y
+                        - n_y == *self.position.x
+                        - n_x)
+                    || (n_x >= *self.position.x && n_y <= *self.position.y && *self.position.y
+                        - n_y == *self.position.x
+                        - n_x)
+                    || (n_x >= *self.position.x && n_y >= *self.position.y && *self.position.y
+                        - n_y == *self.position.x
+                        - n_x)
+            },
+            PieceType::Rook => {
+                (n_x == *self.position.x || n_y != *self.position.y)
+                    || (n_x != *self.position.x || n_y == *self.position.y)
+            },
+            PieceType::Queen => {
+                (n_x == *self.position.x || n_y != *self.position.y)
+                    || (n_x != *self.position.x || n_y == *self.position.y)
+                    || (n_x != *self.position.x || n_y != *self.position.y)
+            },
+            PieceType::King => {
+                (n_x <= *self.position.x + 1 && n_y <= *self.position.y + 1)
+                    || (n_x <= *self.position.x + 1 && n_y <= *self.position.y - 1)
+                    || (n_x <= *self.position.x - 1 && n_y <= *self.position.y + 1)
+                    || (n_x <= *self.position.x - 1 && n_y <= *self.position.y - 1)
+            },
+            PieceType::None => panic(array!['Should not move empty piece']),
+        }
+    }
+}
+ +

This tutorial is extracted from here

+

Congratulations! You've completed the basic setup for building an on-chain chess game 🎉

+ + diff --git a/dojo-book/docs/dist/tutorial/onchain-chess/1-action/index.html b/dojo-book/docs/dist/tutorial/onchain-chess/1-action/index.html new file mode 100644 index 00000000..1a8a0260 --- /dev/null +++ b/dojo-book/docs/dist/tutorial/onchain-chess/1-action/index.html @@ -0,0 +1,166 @@ + + + + + + + + 1. Actions – Dojo Book + + + + + + + + + + +
Skip to content

1. Actions

+

This chapter will address implementing actions.cairo, which spawns the game & squares containing pieces and also allow players to move pieces.

+

What is actions contract?

+

To play chess, you need, to start game, spawn the pieces, and move around the board. The actions contract has two dominant functions spawn function which spawns the game entity, places each piece in its proper position on the board and returns the game_id, and the move funtion which allows pieces to be moved around the board.

+ +

Requirements

+
    +
  1. Write an interface for the actions contract on top of your code. In this case, move and spawn
  2. +
+
    use starknet::ContractAddress;
+    use chess::models::piece::Vec2;
+    #[starknet::interface]
+    trait IActions<ContractState> {
+        fn move(
+            self: @ContractState,
+            curr_position: Vec2,
+            next_position: Vec2,
+            caller: ContractAddress, //player
+            game_id: u32
+        );
+        fn spawn(
+            self: @ContractState, white_address: ContractAddress, black_address: ContractAddress
+        ) -> u32;
+    }
+
    +
  1. Bring in required imports into the contract like this :
  2. +
+
    #[dojo::contract]
+    mod actions {
+        use chess::models::player::{Player, Color, PlayerTrait};
+        use chess::models::piece::{Piece, PieceType, PieceTrait};
+        use chess::models::game::{Game, GameTurn, GameTurnTrait};
+        use super::{ContractAddress, IActions, Vec2};
+    }
+

Should be noted that actions is the contract name.

+
    +
  1. Write a spawn function that accepts the white address, and black address as input and set necessary states using set!(...). Implement the player entity from player model. Implement the game entity, comprised of the Game model and GameTurn model we created in the game.cairo and implement the piece entities from a1 to h8 containing the correct PieceType in the spawn fn.
  2. +
+
    #[abi(embed_v0)]
+    impl IActionsImpl of IActions<ContractState> {
+        fn spawn(
+            self: @ContractState, white_address: ContractAddress, black_address: ContractAddress
+        ) -> u32 {
+            let world = self.world_dispatcher.read();
+            let game_id = world.uuid();
+ 
+            // set Players
+            set!(
+                world,
+                (
+                    Player { game_id, address: black_address, color: Color::Black },
+                    Player { game_id, address: white_address, color: Color::White },
+                )
+            );
+ 
+            // set Game and GameTurn
+            set!(
+                world,
+                (
+                    Game {
+                        game_id, winner: Color::None, white: white_address, black: black_address
+                    },
+                    GameTurn { game_id, player_color: Color::White },
+                )
+            );
+ 
+            // set Pieces
+            set!(
+                world,
+                (Piece {
+                    game_id,
+                    color: Color::White,
+                    position: Vec2 { x: 0, y: 0 },
+                    piece_type: PieceType::Rook
+                })
+            );
+            set!(
+                world,
+                (Piece {
+                    game_id,
+                    color: Color::White,
+                    position: Vec2 { x: 0, y: 1 },
+                    piece_type: PieceType::Pawn
+                })
+            );
+            set!(
+                world,
+                (Piece {
+                    game_id,
+                    color: Color::Black,
+                    position: Vec2 { x: 1, y: 6 },
+                    piece_type: PieceType::Pawn
+                })
+            );
+            set!(
+                world,
+                (Piece {
+                    game_id,
+                    color: Color::White,
+                    position: Vec2 { x: 1, y: 0 },
+                    piece_type: PieceType::Knight
+                })
+            );
+            set!(
+                world,
+                (Piece {
+                    game_id,
+                    color: Color::None,
+                    position: Vec2 { x: 0, y: 2 },
+                    piece_type: PieceType::None
+                })
+            );
+ 
+            set!(
+                world,
+                (Piece {
+                    game_id,
+                    color: Color::None,
+                    position: Vec2 { x: 0, y: 3 },
+                    piece_type: PieceType::None
+                })
+            );
+            set!(
+                world,
+                (Piece {
+                    game_id,
+                    color: Color::None,
+                    position: Vec2 { x: 1, y: 4 },
+                    piece_type: PieceType::None
+                })
+            );
+ 
+            //the rest of the positions on the board goes here....
+ 
+            game_id
+        }
+        fn move(
+            self: @ContractState,
+            curr_position: Vec2,
+            next_position: Vec2,
+            caller: ContractAddress, //player
+            game_id: u32
+        )  {
+            // Upcoming code
+        }
+    }
+ + diff --git a/dojo-book/docs/dist/tutorial/onchain-chess/2-move/index.html b/dojo-book/docs/dist/tutorial/onchain-chess/2-move/index.html new file mode 100644 index 00000000..5014c14c --- /dev/null +++ b/dojo-book/docs/dist/tutorial/onchain-chess/2-move/index.html @@ -0,0 +1,219 @@ + + + + + + + + 2 Move function – Dojo Book + + + + + + + + + + +
Skip to content

2 Move function

+
    +
  1. Write a move function that accepts the current position, next position, caller address, and game_id. The move function should look like this:
  2. +
+
    #[abi(embed_v0)]
+    impl PlayerActionsImpl of IActions<ContractState> {
+        fn spawn(
+            self: @ContractState, white_address: ContractAddress, black_address: ContractAddress
+        ) -> u32 {
+            // Rest of code
+        }
+        fn move(
+            self: @ContractState,
+            curr_position: Vec2,
+            next_position: Vec2,
+            caller: ContractAddress, //player
+            game_id: u32
+        ) {
+            let world = self.world_dispatcher.read();
+            let mut current_piece = get!(world, (game_id, curr_position), (Piece));
+            // check if next_position is out of board or not
+            assert(!PieceTrait::is_out_of_board(next_position), 'Should be inside board');
+ 
+            // check if this is the right move for this piece type
+            assert(
+                current_piece.is_right_piece_move(next_position), 'Illegal move for type of piece'
+            );
+            // Get piece data from to next_position in the board
+            let mut next_position_piece = get!(world, (game_id, next_position), (Piece));
+ 
+            let player = get!(world, (game_id, caller), (Player));
+            // check if there is already a piece in next_position
+            assert(
+                next_position_piece.piece_type == PieceType::None
+                    || player.is_not_my_piece(next_position_piece.color),
+                'Already same color piece exist'
+            );
+ 
+            next_position_piece.piece_type = current_piece.piece_type;
+            next_position_piece.color = player.color;
+            // make current_piece piece none
+            current_piece.piece_type = PieceType::None;
+            current_piece.color = Color::None;
+            set!(world, (next_position_piece));
+            set!(world, (current_piece));
+ 
+            // change turn
+            let mut game_turn = get!(world, game_id, (GameTurn));
+            game_turn.player_color = game_turn.next_turn();
+            set!(world, (game_turn));
+        }
+    }
+
    +
  1. +

    Run sozo build to compile the code.

    +

    Great, Now we can start testing our functions

    +
  2. +
+

Test Flow

+
    +
  • Spawn the test world (spawn_test_world) that imports the models in testing.
  • +
  • Deploy actions contract
  • +
  • Interact with spawn function in the actions contract by providing white and black player's wallet addresses as inputs.
  • +
  • Retrieve the game entity and piece entity created in actions contract.
  • +
  • Ensure the game has been correctly created.
  • +
  • Verify that each Piece is located in the correct position.
  • +
+

Unit Tests

+
    +
  • Copy the test below and add it to your tests/units.cairo file.
  • +
+
#[cfg(test)]
+mod tests {
+    use starknet::ContractAddress;
+    use dojo::test_utils::{spawn_test_world, deploy_contract};
+    use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
+    use chess::models::player::{Player, Color, player};
+    use chess::models::piece::{Piece, PieceType, Vec2, piece};
+    use chess::models::game::{Game, GameTurn, game, game_turn};
+    use chess::actions::{actions, IActionsDispatcher, IActionsDispatcherTrait};
+ 
+    // helper setup function
+    fn setup_world() -> (IWorldDispatcher, IActionsDispatcher) {
+        // models
+        let mut models = array![
+            game::TEST_CLASS_HASH,
+            player::TEST_CLASS_HASH,
+            game_turn::TEST_CLASS_HASH,
+            piece::TEST_CLASS_HASH
+        ];
+        // deploy world with models
+        let world = spawn_test_world(models);
+ 
+        // deploy systems contract
+        let contract_address = world
+            .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());
+        let actions_system = IActionsDispatcher { contract_address };
+ 
+        (world, actions_system)
+    }
+ 
+    #[test]
+    #[available_gas(3000000000000000)]
+    fn test_spawn() {
+        let white = starknet::contract_address_const::<0x01>();
+        let black = starknet::contract_address_const::<0x02>();
+        let (world, actions_system) = setup_world();
+ 
+        //system calls
+        let game_id = actions_system.spawn(white, black);
+ 
+        //get game
+        let game = get!(world, game_id, (Game));
+        let game_turn = get!(world, game_id, (GameTurn));
+        assert(game_turn.player_color == Color::White, 'should be white turn');
+        assert(game.white == white, 'white address is incorrect');
+        assert(game.black == black, 'black address is incorrect');
+ 
+        //get a1 piece
+        let curr_pos = Vec2 { x: 0, y: 0 };
+        let a1 = get!(world, (game_id, curr_pos), (Piece));
+        assert(a1.piece_type == PieceType::Rook, 'should be Rook');
+        assert(a1.color == Color::White, 'should be white color');
+        assert(a1.piece_type != PieceType::None, 'should have piece');
+    }
+ 
+    #[test]
+    #[available_gas(3000000000000000)]
+    fn test_move() {
+        let white = starknet::contract_address_const::<0x01>();
+        let black = starknet::contract_address_const::<0x02>();
+ 
+        let (world, actions_system) = setup_world();
+        let game_id = actions_system.spawn(white, black);
+        let curr_pos = Vec2 { x: 0, y: 1 };
+        let a2 = get!(world, (game_id, curr_pos), (Piece));
+        assert(a2.piece_type == PieceType::Pawn, 'should be Pawn');
+        assert(a2.color == Color::White, 'should be white color piece 1');
+        assert(a2.piece_type != PieceType::None, 'should have piece');
+ 
+        let next_pos = Vec2 { x: 0, y: 2 };
+        let game_turn = get!(world, game_id, (GameTurn));
+        assert(game_turn.player_color == Color::White, 'should be white player turn');
+        actions_system.move(curr_pos, next_pos, white.into(), game_id);
+ 
+        let curr_pos = next_pos;
+        let c3 = get!(world, (game_id, curr_pos), (Piece));
+        assert(c3.piece_type == PieceType::Pawn, 'should be Pawn');
+        assert(c3.color == Color::White, 'should be white color piece 2');
+        assert(c3.piece_type != PieceType::None, 'should have piece');
+ 
+        let game_turn = get!(world, game_id, (GameTurn));
+        assert(game_turn.player_color == Color::Black, 'should be black player turn');
+    }
+}
+

Diving into the Code

+

setup_world

+

We should list all models with each having CLASS_HASH as elements and then we deploy world to models with spawn_test_world

+
    //models
+    let mut models = array![
+            game::TEST_CLASS_HASH,
+            player::TEST_CLASS_HASH,
+            game_turn::TEST_CLASS_HASH,
+            piece::TEST_CLASS_HASH
+        ];
+    // deploy world with models
+    let world = spawn_test_world(models);
+

After that, we deploy our system contracts, then we return our world and actions_systems dispatchers.

+
    let contract_address = world
+        .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());
+    let actions_system = IActionsDispatcher { contract_address };
+ 
+    (world, actions_system)
+

test_spawn

+

First, we'll set up the players address and their colors.

+
    let white = starknet::contract_address_const::<0x01>();
+    let black = starknet::contract_address_const::<0x02>();
+

We use spawn function in actions.cairo to put our pieces on the board. Each square position holds a piece. The system's spawn function needs some input i.e the addresses of the players.

+
    // spawn
+    let game_id = actions_system.spawn(white, black);
+

Then we check if the players got their setup address. After that we check if a White rook is at (0,0). Remember, to get a piece that exists on the position, you need to use the keys of the Piece model, which are game_id, and curr_pos.

+
    //get a1 square
+    let curr_pos = Vec2 { x: 0, y: 0 };
+    let a1 = get!(world, (game_id, curr_pos), (Piece));
+    assert(a1.piece_type == PieceType::Rook, 'should be Rook');
+    assert(a1.color == Color::White, 'should be white color');
+    assert(a1.piece_type != PieceType::None, 'should have piece');
+

test_move

+

Here, after setting up the board, we use move function in the contract to make moves. Provide the current position, the next position, the player's address, and the game id.

+
    //Move White Pawn to (0,2)
+    actions_system.move(curr_pos, next_pos, white.into(), game_id);
+

Then we check if a White Pawn is at the new position.

+
    let curr_pos = next_pos;
+    let c3 = get!(world, (game_id, curr_pos), (Piece));
+    assert(c3.piece_type == PieceType::Pawn, 'should be Pawn');
+    assert(c3.color == Color::White, 'should be white color piece 2');
+    assert(c3.piece_type != PieceType::None, 'should have piece');
+

Need help?

+

If you're stuck, don't hesitate to ask questions at the Dojo community!

+ + diff --git a/dojo-book/docs/dist/tutorial/onchain-chess/3-test/index.html b/dojo-book/docs/dist/tutorial/onchain-chess/3-test/index.html new file mode 100644 index 00000000..4b7b9298 --- /dev/null +++ b/dojo-book/docs/dist/tutorial/onchain-chess/3-test/index.html @@ -0,0 +1,109 @@ + + + + + + + + 3 Test Contract – Dojo Book + + + + + + + + + + +
Skip to content

3 Test Contract

+

In this chapter, we'll use everything we've learned to run a full chess game scenario.

+

Here's what we'll do in our test:

+
    +
  1. Call spawn to setup white_pawn to (0,1) and black_pawn to (1,6)
  2. +
  3. Move white_pawn to (0,3)
  4. +
  5. Move black_pawn to (1,4)
  6. +
  7. Move white_pawn to (1,4)
  8. +
  9. Capture black_pawn
  10. +
+

To place the pieces, use our spawn function in our actions contract. For moving them, use the move contract. Remember to check if a piece can be captured when using move.

+

Before we get to the code, set up your integration test like this:

+
    +
  • Copy the test below and add it to your tests/integration.cairo file.
  • +
+

Full Code

+
mod tests {
+    use chess::models::piece::{Piece, PieceType, Vec2};
+    use dojo::world::IWorldDispatcherTrait;
+    use chess::tests::units::tests::setup_world;
+    use chess::actions::{IActionsDispatcher, IActionsDispatcherTrait};
+    use chess::models::player::{Color};
+ 
+    #[test]
+    #[available_gas(3000000000000000)]
+    fn integration() {
+        let white = starknet::contract_address_const::<0x01>();
+        let black = starknet::contract_address_const::<0x02>();
+ 
+        let (world, actions_system) = setup_world();
+ 
+        //system calls
+        let game_id = actions_system.spawn(white, black);
+ 
+        //White pawn is setup in (0,1)
+        let wp_curr_pos = Vec2 { x: 0, y: 1 };
+        let a2 = get!(world, (game_id, wp_curr_pos), (Piece));
+        assert(a2.piece_type == PieceType::Pawn, 'should be Pawn in (0,1)');
+        assert(a2.color == Color::White, 'should be white color');
+        assert(a2.piece_type != PieceType::None, 'should have piece in (0,1)');
+ 
+        //Black pawn is setup in (1,6)
+        let bp_curr_pos = Vec2 { x: 1, y: 6 };
+        let b7 = get!(world, (game_id, bp_curr_pos), (Piece));
+        assert(b7.piece_type == PieceType::Pawn, 'should be Pawn in (1,6)');
+        assert(b7.color == Color::Black, 'should be black color');
+        assert(b7.piece_type != PieceType::None, 'should have piece in (1,6)');
+ 
+        //Move White Pawn to (0,3)
+        let wp_next_pos = Vec2 { x: 0, y: 3 };
+        actions_system.move(wp_curr_pos, wp_next_pos, white.into(), game_id);
+ 
+        //White pawn is now in (0,3)
+        let wp_curr_pos = wp_next_pos;
+        let a4 = get!(world, (game_id, wp_curr_pos), (Piece));
+        assert(a4.piece_type == PieceType::Pawn, 'should be Pawn in (0,3)');
+        assert(a4.color == Color::White, 'should be white color');
+        assert(a4.piece_type != PieceType::None, 'should have piece in (0,3)');
+ 
+        //Move black Pawn to (1,4)
+        let bp_next_pos = Vec2 { x: 1, y: 4 };
+        actions_system.move(bp_curr_pos, bp_next_pos, black.into(), game_id);
+ 
+        //Black pawn is now in (1,4)
+        let bp_curr_pos = bp_next_pos;
+        let b5 = get!(world, (game_id, bp_curr_pos), (Piece));
+        assert(b5.piece_type == PieceType::Pawn, 'should be Pawn in (1,4)');
+        assert(b5.color == Color::Black, 'should be black color');
+        assert(b5.piece_type != PieceType::None, 'should have piece in (1,4)');
+ 
+        // Move White Pawn to (1,4) and capture black pawn
+        actions_system.move(wp_curr_pos, bp_curr_pos, white.into(), game_id);
+ 
+        let wp_curr_pos = bp_curr_pos;
+        let b5 = get!(world, (game_id, wp_curr_pos), (Piece));
+        assert(b5.piece_type == PieceType::Pawn, 'should be Pawn in (1,4)');
+        assert(b5.color == Color::White, 'should be white color');
+        assert(b5.piece_type != PieceType::None, 'should have piece in (1,4)');
+    }
+}
+

Keep moving pieces and checking if they're in the right places.

+

Congratulations!

+

You've made the basic contracts for a chess game using the Dojo engine! This tutorial was just the beginning. There are many ways to make the game better, like optimizing parts, adding checks, or considering special cases. If you want to do more with this chess game, try these challenges:

+
    +
  • Add a checkmate feature. Our game doesn't end now, so decide when it should!
  • +
  • Include special moves like castling, En Passant Capture, or Pawn Promotion.
  • +
  • Make your own chess rules! You could even create your own version of the immortal game
  • +
+

Lastly, share your project with others in the Dojo community!

+ + diff --git a/dojo-book/docs/dist/tutorial/onchain-chess/README/index.html b/dojo-book/docs/dist/tutorial/onchain-chess/README/index.html new file mode 100644 index 00000000..333145ab --- /dev/null +++ b/dojo-book/docs/dist/tutorial/onchain-chess/README/index.html @@ -0,0 +1,38 @@ + + + + + + + + Building a Chess Game – Dojo Book + + + + + + + + + + +
Skip to content

Building a Chess Game

+

"I just finished reading The Dojo Book. What should I do next?"

+

The answers to this question are always "Make something!", sometimes followed by a list of cool projects. This is a great answer for some people, but others might be looking for a little more direction.

+

This guide is intended to fill the gap between heavily directed beginner tutorials and working on your projects. The primary goal here is to get you to write code. The secondary goal is to get you reading documentation.

+

If you haven't read the Dojo Book yet, it is highly encouraged for you to do so before starting this project.

+

What are we building?

+

We're building an on-chain chess game contract that lets you start a new game and play chess. This guide does not cover every rules of the chess game. You will build step by step as follows:

+
    +
  1. A system contract to spawn all the chess pieces
  2. +
  3. A system contract to make pieces move
  4. +
  5. Add some functions to check a legal move
  6. +
  7. Play chess ♟♙ - integration test!
  8. +
+

The full code of tutorial is based on this repo.

+

If this seems too hard, don't worry! This guide is for beginners. If you know some basics about Cairo and Dojo, you're good. We won't make a full chess game with all the rules. We're keeping it simple.

+

What after this guide?

+

We're making another guide to help design the frontend. This will make our chess game complete.

+

After you finish all the four chapters, we can move on to the frontend guide.

+ + diff --git a/dojo-book/docs/dist/unity-screen-grab.png b/dojo-book/docs/dist/unity-screen-grab.png new file mode 100644 index 00000000..fa9834bd Binary files /dev/null and b/dojo-book/docs/dist/unity-screen-grab.png differ diff --git a/dojo-book/docs/dist/unity/models.png b/dojo-book/docs/dist/unity/models.png new file mode 100644 index 00000000..0c608585 Binary files /dev/null and b/dojo-book/docs/dist/unity/models.png differ diff --git a/dojo-book/docs/dist/unity/sync-master.png b/dojo-book/docs/dist/unity/sync-master.png new file mode 100644 index 00000000..e4a25a6f Binary files /dev/null and b/dojo-book/docs/dist/unity/sync-master.png differ diff --git a/dojo-book/docs/dist/unity/world-manager.png b/dojo-book/docs/dist/unity/world-manager.png new file mode 100644 index 00000000..0979a2de Binary files /dev/null and b/dojo-book/docs/dist/unity/world-manager.png differ diff --git a/dojo-book/docs/dist/world-map.png b/dojo-book/docs/dist/world-map.png new file mode 100644 index 00000000..4fc2664f Binary files /dev/null and b/dojo-book/docs/dist/world-map.png differ diff --git a/dojo-book/docs/dist/world_flow.png b/dojo-book/docs/dist/world_flow.png new file mode 100644 index 00000000..6812f3e8 Binary files /dev/null and b/dojo-book/docs/dist/world_flow.png differ diff --git a/dojo-book/docs/dist/worlds-dev-icon-word.png b/dojo-book/docs/dist/worlds-dev-icon-word.png new file mode 100644 index 00000000..3e50b09a Binary files /dev/null and b/dojo-book/docs/dist/worlds-dev-icon-word.png differ diff --git a/dojo-book/docs/dist/worlds-dev-icon.png b/dojo-book/docs/dist/worlds-dev-icon.png new file mode 100644 index 00000000..d8327a52 Binary files /dev/null and b/dojo-book/docs/dist/worlds-dev-icon.png differ diff --git a/dojo-book/docs/pages/client/overview.md b/dojo-book/docs/pages/client/overview.md index f24feeb0..e0127833 100644 --- a/dojo-book/docs/pages/client/overview.md +++ b/dojo-book/docs/pages/client/overview.md @@ -2,7 +2,7 @@ Dojo is BYO client, meaning that you can use any client you want to connect to the Dojo network. -- [npm](./npm.md) +- [npm](./dojojs.md) - [torii](torii.md) > Dojo is always looking to expand these clients, if you would like to contribute reach out into the [Discord](https://discord.gg/KG9w9BmDrV) diff --git a/dojo-book/docs/pages/client/sdk/unity.md b/dojo-book/docs/pages/client/sdk/unity.md index 313f837e..c6713e87 100644 --- a/dojo-book/docs/pages/client/sdk/unity.md +++ b/dojo-book/docs/pages/client/sdk/unity.md @@ -23,7 +23,7 @@ This will generate a `.dll` or `.so` binary in the `target/release` directory, d ### Watch video -[![Watch the video](/unity-screen-grab.png)](/dojo.unity_demo.mp4) + ## Dojo Unity Concepts diff --git a/dojo-book/docs/pages/theory/what-is-dojo.md b/dojo-book/docs/pages/theory/what-is-dojo.md index b659ba4c..eca90b7c 100644 --- a/dojo-book/docs/pages/theory/what-is-dojo.md +++ b/dojo-book/docs/pages/theory/what-is-dojo.md @@ -26,11 +26,11 @@ Building on-chain games often involves grappling with the challenge of indexing Using Torii drastically reduces the time and effort required to build on-chain games. It also eliminates the need to manually create indexers, which can be a tedious and error-prone process. -### [Katana](/crates/katana/README.md) - Blazingly fast development network +### [Katana](/toolchain/katana/overview.md) - Blazingly fast development network Katana is a customizable Starknet development network. It is blazingly fast and allows you to iterate on your game logic swiftly. -### [Sozo CLI](/crates/sozo/README.md) - CLI Management Tool +### [Sozo CLI](/toolchain/sozo/overview.md) - CLI Management Tool Dojo worlds are poised to become some of the largest contracts. Sozo is a CLI tool that assists you in managing your worlds. It enables you to create, build, test, and deploy your worlds. Additionally, you can craft new components and systems and register them with your world. diff --git a/dojo-book/docs/pages/toolchain/torii/overview.md b/dojo-book/docs/pages/toolchain/torii/overview.md index 1b48431e..a794c33e 100644 --- a/dojo-book/docs/pages/toolchain/torii/overview.md +++ b/dojo-book/docs/pages/toolchain/torii/overview.md @@ -13,8 +13,8 @@ The torii server comprises of the rust backend that exposes the graphql and gRPC Torii client interfaces with the server to provide an easy to use api for your clients: - [wasm](/client/dojojs.md#dojoenginetorii-wasm) -- [unity](/client/torii/unity.md) -- [c](/client/torii/unity.md) +- [unity](/client/sdk/unity.md) +- [c](/client/sdk/unity.md) ### Usage