{"id":19369220,"url":"https://github.com/joystream/joystream-api-examples","last_synced_at":"2025-04-23T15:31:26.100Z","repository":{"id":42351423,"uuid":"187115574","full_name":"Joystream/joystream-api-examples","owner":"Joystream","description":"API examples","archived":false,"fork":false,"pushed_at":"2022-07-07T05:12:48.000Z","size":206,"stargazers_count":3,"open_issues_count":6,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-04-10T20:07:24.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Joystream.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-16T23:42:16.000Z","updated_at":"2021-09-05T16:37:00.000Z","dependencies_parsed_at":"2022-09-08T21:10:16.937Z","dependency_job_id":null,"html_url":"https://github.com/Joystream/joystream-api-examples","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fjoystream-api-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fjoystream-api-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fjoystream-api-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fjoystream-api-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joystream","download_url":"https://codeload.github.com/Joystream/joystream-api-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223926874,"owners_count":17226455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T08:10:05.588Z","updated_at":"2024-11-10T08:10:06.223Z","avatar_url":"https://github.com/Joystream.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Joystream API Examples\n\nRepo with examples on how to use the @joystream/types package along with @polkadot/api to communicate with a joystream full node.\n\n\n## Examples\n\n```\nyarn \u0026\u0026 yarn build\nyarn run status\n```\n\n## Example code\n\n```javascript\nimport { registerJoystreamTypes } from '@joystream/types';\nimport { ApiPromise, WsProvider } from '@polkadot/api';\n\nasync function main () {\n  // Initialise the provider to connect to the local node\n  const provider = new WsProvider('ws://127.0.0.1:9944');\n\n  // Register types before creating the API\n  registerJoystreamTypes();\n\n  // Create the API and wait until ready\n  const api = await ApiPromise.create({ provider });\n\n  // Retrieve the chain \u0026 node information information via rpc calls\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    api.rpc.system.chain(),\n    api.rpc.system.name(),\n    api.rpc.system.version()\n  ]);\n\n  console.log(`Chain ${chain} using ${nodeName} v${nodeVersion}`);\n}\n\nmain();\n```\n\n### Scripts\n\nYou can run scripts that are found in the [./scripts/](./scripts) folder:\n\n```sh\nyarn script example\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoystream%2Fjoystream-api-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoystream%2Fjoystream-api-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoystream%2Fjoystream-api-examples/lists"}