{"_id":"@0xtemple/client","_rev":"2-ad855304267a16cd13721d06ae499d8a","name":"@0xtemple/client","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@0xtemple/client","version":"0.0.1","description":"Tookit for interacting with vara eps framework","keywords":["vara","temples labs","blockchain"],"author":{"name":"team@temples.build"},"homepage":"https://github.com/0xtempl/temples-engine/tree/main/packages/client#readme","bugs":{"url":"https://github.com/0xtempl/temples-engine/issues"},"repository":{"type":"git","url":"git+https://github.com/0xtempl/temples-engine.git"},"license":"Apache-2.0","publishConfig":{"access":"public"},"engines":{"node":">=18"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"source":"./src/index.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"dependencies":{"@gear-js/api":"^0.36.5","@noble/curves":"^1.2.0","@noble/hashes":"^1.3.2","@polkadot/api":"^10.11.2","@polkadot/api-contract":"^10.11.2","@polkadot/keyring":"^12.3.1","@polkadot/types":"^10.11.2","@polkadot/util":"^12.6.2","@polkadot/util-crypto":"^12.6.2","@scure/bip39":"^1.2.1","assert":"^2.1.0","colorts":"^0.1.63","husky":"^8.0.3","keccak256":"^1.0.6","process":"^0.11.10","rxjs":"^7.8.1","superstruct":"^1.0.3","tmp":"^0.2.1","ts-retry-promise":"^0.7.1","tweetnacl":"^1.0.3"},"peerDependencies":{"@gear-js/api":"^0.36.5"},"devDependencies":{"@commitlint/cli":"^18.0.0","@commitlint/config-conventional":"^18.0.0","@commitlint/prompt-cli":"^18.0.0","@types/node":"^20.8.7","@types/tmp":"^0.2.5","@typescript-eslint/eslint-plugin":"^6.8.0","@typescript-eslint/parser":"^6.8.0","dotenv":"^16.3.1","eslint":"^8.52.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.1","lint-staged":"^15.0.2","prettier":"^2.8.8","ts-node":"^10.9.1","tsconfig-paths":"^4.2.0","tsup":"^7.1.0","typedoc":"^0.25.2","typescript":"^5.0.4"},"lint-staged":{"**/*.ts":["pnpm run format:fix","pnpm run lint:fix"],"**/*.json|md":["pnpm run format:fix"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"prettier":{"trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true,"useTabs":false,"quoteProps":"as-needed","bracketSpacing":true,"arrowParens":"always","endOfLine":"lf"},"eslintConfig":{"root":true,"env":{"browser":true,"node":true,"es2022":true},"extends":["eslint:recommended","plugin:@typescript-eslint/eslint-recommended","plugin:prettier/recommended"],"plugins":["@typescript-eslint","prettier"],"parser":"@typescript-eslint/parser","rules":{"prettier/prettier":"warn","@typescript-eslint/no-explicit-any":"off","no-unused-vars":"off","@typescript-eslint/no-unused-vars":["error",{"argsIgnorePattern":"^_","varsIgnorePattern":"^_","caughtErrorsIgnorePattern":"^_"}]}},"scripts":{"clean":"rm -rf tsconfig.tsbuildinfo ./dist","build":"npm run build:types && npm run build:tsup","build:tsup":"tsup ./src/index.ts --format esm,cjs --sourcemap","build:types":"tsc --build","watch:tsup":"tsup ./src/index.ts --format esm,cjs --clean --splitting --watch","watch:types":"tsc --watch","watch":"pnpm run clean & pnpm run watch:types & pnpm run watch:tsup","test":"pnpm test:typecheck && pnpm test:unit","test:typecheck":"tsc -p ./test","format:fix":"prettier --ignore-path 'dist/* docs/*' --write '**/*.{ts,json,md}'","lint:fix":"eslint . --ignore-pattern dist --ext .ts --fix","commit":"commit","doc":"typedoc --out docs src/index.ts","chalk":"^5.0.1","prettier":"^2.8.4","prettier-plugin-rust":"^0.1.9"},"_id":"@0xtemple/client@0.0.1","_integrity":"sha512-GH3nicYY2j2y/9VJyE0PMaT2peQsElUZBIY1z+Isjja8zXOdmsGc+wAjamM6luUQzlcG4jQMKpGcsLkbUrDguQ==","_resolved":"/private/var/folders/pm/td9f8vln6ld62q2lhqqg_98r0000gn/T/cdf5ac7417945ea6f4525bc4eda1b17f/0xtemple-client-0.0.1.tgz","_from":"file:0xtemple-client-0.0.1.tgz","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-GH3nicYY2j2y/9VJyE0PMaT2peQsElUZBIY1z+Isjja8zXOdmsGc+wAjamM6luUQzlcG4jQMKpGcsLkbUrDguQ==","shasum":"01c9c41a44dd85274dbe520f6a7a4e0a5f73c93e","tarball":"https://registry.npmjs.org/@0xtemple/client/-/client-0.0.1.tgz","fileCount":34,"unpackedSize":272461,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFYRnVnuZSXxvWyaqYtM7qVxQBytkYoflwUInybl6dW6AiAydFmBbbzHkZLXtrPz21hoQ9w7Jgx52el6u9UTvrcf9A=="}]},"_npmUser":{"name":"vladilenaksana","email":"vladilenaksana@163.com"},"directories":{},"maintainers":[{"name":"vladilenaksana","email":"vladilenaksana@163.com"},{"name":"web3henry","email":"zombiesliu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/client_0.0.1_1709301427924_0.30902021974523564"},"_hasShrinkwrap":false},"0.0.2":{"name":"@0xtemple/client","version":"0.0.2","description":"Tookit for interacting with vara eps framework","keywords":["vara","temples labs","blockchain"],"author":{"name":"team@temples.build"},"homepage":"https://github.com/0xtempl/temples-engine/tree/main/packages/client#readme","bugs":{"url":"https://github.com/0xtempl/temples-engine/issues"},"repository":{"type":"git","url":"git+https://github.com/0xtempl/temples-engine.git"},"license":"Apache-2.0","publishConfig":{"access":"public"},"engines":{"node":">=18"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"source":"./src/index.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"dependencies":{"@gear-js/api":"^0.36.5","@noble/curves":"^1.2.0","@noble/hashes":"^1.3.2","@polkadot/api":"^10.11.2","@polkadot/api-contract":"^10.11.2","@polkadot/keyring":"^12.3.1","@polkadot/types":"^10.11.2","@polkadot/util":"^12.6.2","@polkadot/util-crypto":"^12.6.2","@scure/bip39":"^1.2.1","assert":"^2.1.0","colorts":"^0.1.63","husky":"^8.0.3","keccak256":"^1.0.6","process":"^0.11.10","rxjs":"^7.8.1","superstruct":"^1.0.3","tmp":"^0.2.1","ts-retry-promise":"^0.7.1","tweetnacl":"^1.0.3"},"peerDependencies":{"@gear-js/api":"^0.36.5"},"devDependencies":{"@commitlint/cli":"^18.0.0","@commitlint/config-conventional":"^18.0.0","@commitlint/prompt-cli":"^18.0.0","@types/node":"^20.8.7","@types/tmp":"^0.2.5","@typescript-eslint/eslint-plugin":"^6.8.0","@typescript-eslint/parser":"^6.8.0","dotenv":"^16.3.1","eslint":"^8.52.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.1","lint-staged":"^15.0.2","prettier":"^2.8.8","ts-node":"^10.9.1","tsconfig-paths":"^4.2.0","tsup":"^7.1.0","typedoc":"^0.25.2","typescript":"^5.0.4"},"lint-staged":{"**/*.ts":["pnpm run format:fix","pnpm run lint:fix"],"**/*.json|md":["pnpm run format:fix"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"prettier":{"trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true,"useTabs":false,"quoteProps":"as-needed","bracketSpacing":true,"arrowParens":"always","endOfLine":"lf"},"eslintConfig":{"root":true,"env":{"browser":true,"node":true,"es2022":true},"extends":["eslint:recommended","plugin:@typescript-eslint/eslint-recommended","plugin:prettier/recommended"],"plugins":["@typescript-eslint","prettier"],"parser":"@typescript-eslint/parser","rules":{"prettier/prettier":"warn","@typescript-eslint/no-explicit-any":"off","no-unused-vars":"off","@typescript-eslint/no-unused-vars":["error",{"argsIgnorePattern":"^_","varsIgnorePattern":"^_","caughtErrorsIgnorePattern":"^_"}]}},"scripts":{"clean":"rm -rf tsconfig.tsbuildinfo ./dist","build":"npm run build:types && npm run build:tsup","build:tsup":"tsup ./src/index.ts --format esm,cjs --sourcemap","build:types":"tsc --build","watch:tsup":"tsup ./src/index.ts --format esm,cjs --clean --splitting --watch","watch:types":"tsc --watch","watch":"pnpm run clean & pnpm run watch:types & pnpm run watch:tsup","test":"pnpm test:typecheck && pnpm test:unit","test:typecheck":"tsc -p ./test","format:fix":"prettier --ignore-path 'dist/* docs/*' --write '**/*.{ts,json,md}'","lint:fix":"eslint . --ignore-pattern dist --ext .ts --fix","commit":"commit","doc":"typedoc --out docs src/index.ts","chalk":"^5.0.1","prettier":"^2.8.4","prettier-plugin-rust":"^0.1.9"},"_id":"@0xtemple/client@0.0.2","_integrity":"sha512-rnoY2Hhc0ODLQNNAMRhdl2GBQkqC/AoSnF4BLRwqsu/qSF4wSmjmEJzgGf5R4ENw7Lym4ZgJ/qWTqN9ACLWtkw==","_resolved":"/private/var/folders/pm/td9f8vln6ld62q2lhqqg_98r0000gn/T/3a8387e124c438ee4b5d32cb068ed3cc/0xtemple-client-0.0.2.tgz","_from":"file:0xtemple-client-0.0.2.tgz","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-rnoY2Hhc0ODLQNNAMRhdl2GBQkqC/AoSnF4BLRwqsu/qSF4wSmjmEJzgGf5R4ENw7Lym4ZgJ/qWTqN9ACLWtkw==","shasum":"729b954691e569cd8050156c62a9315ecbdc9741","tarball":"https://registry.npmjs.org/@0xtemple/client/-/client-0.0.2.tgz","fileCount":34,"unpackedSize":272377,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6687bOE/ev2Jpz3PGFd4yXg+fx/aPxVwj3RzAIIOfVgIgF/Y2uSo2pUfRvnezwDirJJ7/PDRGSXSBj+hrrZ13k2U="}]},"_npmUser":{"name":"vladilenaksana","email":"vladilenaksana@163.com"},"directories":{},"maintainers":[{"name":"vladilenaksana","email":"vladilenaksana@163.com"},{"name":"web3henry","email":"zombiesliu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/client_0.0.2_1709306600224_0.6221949387750265"},"_hasShrinkwrap":false},"0.0.3":{"name":"@0xtemple/client","version":"0.0.3","description":"Tookit for interacting with vara eps framework","keywords":["vara","temples labs","blockchain"],"author":{"name":"team@temples.build"},"homepage":"https://github.com/0xtempl/temples-engine/tree/main/packages/client#readme","bugs":{"url":"https://github.com/0xtempl/temples-engine/issues"},"repository":{"type":"git","url":"git+https://github.com/0xtempl/temples-engine.git"},"license":"Apache-2.0","publishConfig":{"access":"public"},"engines":{"node":">=18"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"source":"./src/index.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"dependencies":{"@gear-js/api":"^0.36.5","@noble/curves":"^1.2.0","@noble/hashes":"^1.3.2","@polkadot/api":"^10.11.2","@polkadot/api-contract":"^10.11.2","@polkadot/keyring":"^12.3.1","@polkadot/types":"^10.11.2","@polkadot/util":"^12.6.2","@polkadot/util-crypto":"^12.6.2","@scure/bip39":"^1.2.1","assert":"^2.1.0","colorts":"^0.1.63","husky":"^8.0.3","keccak256":"^1.0.6","process":"^0.11.10","rxjs":"^7.8.1","superstruct":"^1.0.3","tmp":"^0.2.1","ts-retry-promise":"^0.7.1","tweetnacl":"^1.0.3"},"peerDependencies":{"@gear-js/api":"^0.36.5"},"devDependencies":{"@commitlint/cli":"^18.0.0","@commitlint/config-conventional":"^18.0.0","@commitlint/prompt-cli":"^18.0.0","@types/node":"^20.8.7","@types/tmp":"^0.2.5","@typescript-eslint/eslint-plugin":"^6.8.0","@typescript-eslint/parser":"^6.8.0","dotenv":"^16.3.1","eslint":"^8.52.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.1","lint-staged":"^15.0.2","prettier":"^2.8.8","ts-node":"^10.9.1","tsconfig-paths":"^4.2.0","tsup":"^7.1.0","typedoc":"^0.25.2","typescript":"^5.0.4"},"lint-staged":{"**/*.ts":["pnpm run format:fix","pnpm run lint:fix"],"**/*.json|md":["pnpm run format:fix"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"prettier":{"trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true,"useTabs":false,"quoteProps":"as-needed","bracketSpacing":true,"arrowParens":"always","endOfLine":"lf"},"eslintConfig":{"root":true,"env":{"browser":true,"node":true,"es2022":true},"extends":["eslint:recommended","plugin:@typescript-eslint/eslint-recommended","plugin:prettier/recommended"],"plugins":["@typescript-eslint","prettier"],"parser":"@typescript-eslint/parser","rules":{"prettier/prettier":"warn","@typescript-eslint/no-explicit-any":"off","no-unused-vars":"off","@typescript-eslint/no-unused-vars":["error",{"argsIgnorePattern":"^_","varsIgnorePattern":"^_","caughtErrorsIgnorePattern":"^_"}]}},"scripts":{"clean":"rm -rf tsconfig.tsbuildinfo ./dist","build":"npm run build:types && npm run build:tsup","build:tsup":"tsup ./src/index.ts --format esm,cjs --sourcemap","build:types":"tsc --build","watch:tsup":"tsup ./src/index.ts --format esm,cjs --clean --splitting --watch","watch:types":"tsc --watch","watch":"pnpm run clean & pnpm run watch:types & pnpm run watch:tsup","test":"pnpm test:typecheck && pnpm test:unit","test:typecheck":"tsc -p ./test","format:fix":"prettier --ignore-path 'dist/* docs/*' --write '**/*.{ts,json,md}'","lint:fix":"eslint . --ignore-pattern dist --ext .ts --fix","commit":"commit","doc":"typedoc --out docs src/index.ts","chalk":"^5.0.1","prettier":"^2.8.4","prettier-plugin-rust":"^0.1.9"},"_id":"@0xtemple/client@0.0.3","_integrity":"sha512-ZASLNw5w3T4E4b2RA8bPm02gjN3YkQgkgHwMPQp+04cnNV49Xcq82R1+QuW1dQxP9yxzzkZpSGWYwf8ahSwtQQ==","_resolved":"/private/var/folders/pm/td9f8vln6ld62q2lhqqg_98r0000gn/T/391951bb6c04b5fc95c9927b2dbebcc6/0xtemple-client-0.0.3.tgz","_from":"file:0xtemple-client-0.0.3.tgz","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-ZASLNw5w3T4E4b2RA8bPm02gjN3YkQgkgHwMPQp+04cnNV49Xcq82R1+QuW1dQxP9yxzzkZpSGWYwf8ahSwtQQ==","shasum":"76192ec2254bf60f3f031bcece0935e48ef0795f","tarball":"https://registry.npmjs.org/@0xtemple/client/-/client-0.0.3.tgz","fileCount":34,"unpackedSize":272395,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBa9lPuPrFOYzR4Dvcg9JIJyOHbXlGLiu1LenvijZZORAiEA5Ix3kTEA25EzABHRaCJMHY8XBor7DWVHKGvGYs/eedg="}]},"_npmUser":{"name":"vladilenaksana","email":"vladilenaksana@163.com"},"directories":{},"maintainers":[{"name":"vladilenaksana","email":"vladilenaksana@163.com"},{"name":"web3henry","email":"zombiesliu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/client_0.0.3_1709306799497_0.014063730901448857"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-01T13:57:07.844Z","0.0.1":"2024-03-01T13:57:08.165Z","modified":"2024-03-01T15:26:40.385Z","0.0.2":"2024-03-01T15:23:20.409Z","0.0.3":"2024-03-01T15:26:39.708Z"},"maintainers":[{"name":"vladilenaksana","email":"vladilenaksana@163.com"},{"name":"web3henry","email":"zombiesliu@gmail.com"}],"description":"Tookit for interacting with vara eps framework","homepage":"https://github.com/0xtempl/temples-engine/tree/main/packages/client#readme","keywords":["vara","temples labs","blockchain"],"repository":{"type":"git","url":"git+https://github.com/0xtempl/temples-engine.git"},"author":{"name":"team@temples.build"},"bugs":{"url":"https://github.com/0xtempl/temples-engine/issues"},"license":"Apache-2.0","readme":"# Temples Client SDK\n\nTemples is client agnostic: any client -- a browser, a game engine, or an ios/android app -- can implement the synchronization protocol and a client-side cache to replicate Store tables, along with the necessary infrastructure to send transactions to the World.\n\nCurrently we only support browsers, Node and the COCOS game engine.\n\n## Getting Started\n\nBefore proceeding with the next steps, make sure you have deployed your own world contract via cli.\n\nWhen the world contract is deployed successfully, it will return a PackageId (the contract's ObjectId) and a WorldId (the World Store's ObjectId).\n\n### Data preparation\n\nWe create a Project called Counter and declare sigleton schema called counter, which is of type `u64` and has an initial value of `0`.\n\n\n```typescript\nimport { TempleConfig } from '@0xtemple/common';\n\nexport const obeliskConfig = {\n  name: 'counter',\n  description: 'counter',\n  systems: ['counter_system'],\n  schemas: {\n    counter: {\n      valueType: 'u64',\n      defaultValue: 0,\n    },\n  },\n  sample_schema: 'u64',\n} as TempleConfig;\n```\n\nThrough the CLI, we will generate the corresponding contract based on temples.config.ts At this point we need to write the system logic.\n\n```bash\ntemples schemagen temples.config.ts\n```\n\nThe next step is simply to write the system file method.\n\n```rust\n// contracts/counter/system/counter_system.move\nmodule counter::counter_system {\n    use counter::world::World;\n    use counter::counter_schema;\n\n    public entry fun inc(world: &mut World){\n        let value = counter_schema::get(world) + 1;\n        counter_schema::set(world,value);\n    }\n}\n```\n\nFinally we deploy the complete contract to devnet\n\n\n```bash\ntemples publish --network devnet --configPath temples.config.ts\n```\n\nWe'll get the `packageId` and `worldId` on the command line.\n\n### Init Temples Client\n\n```typescript\nimport { getMetadata, Temples, NetworkType } from \"@0xtemple/client\";\n\nconst network = \"devnet\" as NetworkType\nconst packageId = \"0x804578b9eed47d461bba52c393cf148302819e2ba0a0f558356cc419b3e941ed\"\n\nconst metadata = await getMetadata(network, packageId);\n\nconst temples = new Temples({\n    networkType: network,\n    packageId: packageId,\n    metadata: metadata,\n    secretKey: privkey\n});\n```\n\n### World Tx\n\nIf you need to call a method in the system, you can do so using the `temples.tx.moudleName.funcName()` form.\n\n```typescript\nimport { getMetadata, Temples, TransactionBlock } from \"@0xtemple/client\";\n\nconst metadata = await getMetadata(network, packageId);\n\nconst temples = new Temples({\n    networkType: network,\n    packageId: packageId,\n    metadata: metadata,\n    secretKey: privkey\n});\n\n// Initiate transactions through the account set up by temples\nconst tx = new TransactionBlock()\n\nconst world = tx.pure(WORLD_ID)\nconst params = [\n    world,\n]\n\nconst res_tx = await temples.tx.counter_system.inc(tx, params)\n\n// If you want to encapsulate the TransactionBlock\nconst tx = new TransactionBlock()\nconst world = tx.pure(WORLD_ID)\nconst params = [\n    world,\n]\n// By isolating the signature from the transactionBlock construction in this way,\n// the front-end wallet plugin can signAndSend() directly to the transactionBlock,\n// facilitating front-end interaction.\nconst new_tx = await temples.tx.counter_system.inc(tx, params, undefined, true) as TransactionBlock;\n\nconst response = await temples.signAndSendTxn(\n    new_tx\n)\n```\n\n### World Query\n\n#### Query public contract view func\n\nIf your system method provides a method with no modification status and a return, then you can query it via `temples.query.moudleName.funcName()`.\n\n```typescript\nconst metadata = await getMetadata(NETWORK, PACKAGE_ID);\nconst temples = new Temples({\n    networkType: NETWORK,\n    packageId: PACKAGE_ID,\n    metadata: metadata,\n});\n\nconst tx = new TransactionBlock()\nconst world = tx.pure(WORLD_ID)\nconst params = [\n    world,\n]\nconst query_value = await temples.query.counter_system.get(tx, params);\n```\n\n#### Get world\n\nQueries the Object information of worldId.\n\n```typescript\n    const metadata = await getMetadata(NETWORK, PACKAGE_ID);\n    const temples = new Temples({\n        networkType: NETWORK,\n        packageId: PACKAGE_ID,\n        metadata: metadata,\n    });\n    const world_value = await temples.getWorld(WORLD_ID)\n```\n\n\n#### List schema names\n\nList all schema name in the world store.\n\n```typescript\nconst metadata = await getMetadata(NETWORK, PACKAGE_ID);\nconst temples = new Temples({\n    networkType: NETWORK,\n    packageId: PACKAGE_ID,\n    metadata: metadata,\n});\nconst schemaNames = await temples.listSchemaNames(\n  '0x1541f3a2e7ac48e3e68e60bb97a7cee94e16316cc3f9043a9c0f5e6790ea3af0'\n);\n```\n\n\n#### Get entity\n\nGet the entity's data based on schema name and entity id(option).\n\n```typescript\nconst metadata = await getMetadata(NETWORK, PACKAGE_ID);\nconst temples = new Temples({\n    networkType: NETWORK,\n    packageId: PACKAGE_ID,\n    metadata: metadata,\n});\n\nconst worldId = \"0x1541f3a2e7ac48e3e68e60bb97a7cee94e16316cc3f9043a9c0f5e6790ea3af0\";\n\n// get schema entity data\nconst schemaName = \"simple_schema\"\nconst entityId = \"0x00000000000000000000000000000000000000000000000000000000000003ed\"\nconst entities = await temples.getEntity(\n    worldId,\n    schemaName,\n    entityId\n);\n\n// get singleton schema entity data\nconst singletonSchemaName = \"counter\"\nconst entities = await temples.getEntity(\n    worldId,\n    singletonSchemaName\n);\n\n```\n\n\n#### Contain entity\n\nDetermine if the entity exists\n\n```typescript\nconst metadata = await getMetadata(NETWORK, PACKAGE_ID);\nconst temples = new Temples({\n    networkType: NETWORK,\n    packageId: PACKAGE_ID,\n    metadata: metadata,\n});\n\nconst worldId = \"0x1541f3a2e7ac48e3e68e60bb97a7cee94e16316cc3f9043a9c0f5e6790ea3af0\";\n\n// get schema entity data\nconst schemaName = \"simple_schema\"\nconst entityId = \"0x00000000000000000000000000000000000000000000000000000000000003ed\"\nconst entities = await temples.containEntity(\n    worldId,\n    schemaName,\n    entityId\n);\n\n// get singleton schema entity data\nconst singletonSchemaName = \"counter\"\nconst entities = await temples.containEntity(\n    worldId,\n    singletonSchemaName\n);\n\n```\n\n#### Get owned objects\n\nQuery all the objects under the current worldId that are owned by a certain address.\n\n```typescript\nconst metadata = await getMetadata(NETWORK, PACKAGE_ID);\nconst temples = new Temples({\n    networkType: NETWORK,\n    packageId: PACKAGE_ID,\n    metadata: metadata,\n});\n\nconst owner = \"0xfa99b5b0463fcfb7d0203c701a76da5eda21a96190eb1368ab36a437cc89195e\";\nconst owned_objects_value = await temples.getOwnedObjects(owner);\n```\n\n### About entity key\n\nYou can customize how the key is generated in the system, but I recommend that you generate the entity key using the user's address or objectId as the associative data, as this will help you associate the generated entity with address/objectId. This will help you associate the generated entity with the user's address, and then you can quickly determine the creator of the entity by the user's address or objectId.\n\nWe provide three ways to convert entity keys, and of course you are welcome to contribute more entity key specifications.\n\n\n```typescript\n// Create key based on objectId.\n// You can use the user's address as the entity key, \n// or you can use the Id of an object as the entity key.\n//\n// For example: using the objectId of the NFT as the key, \n// you can set the owner of the nft as the owner of the accessed entity.\nlet objectAddress = await temples.entity_key_from_object(\n    '0x1541f3a2e7ac48e3e68e60bb97a7cee94e16316cc3f9043a9c0f5e6790ea3af0'\n);\n\n// hexAddress(keccak256(inputStringData))\nlet bytesAddress = await temples.entity_key_from_bytes('hello');\n\n// hexAddress(inputNumberData)\nlet numberAddress = await temples.entity_key_from_u256(123);\n```\n\n","readmeFilename":"README.md"}