{"id":22165588,"url":"https://github.com/textileio/near-api-go","last_synced_at":"2025-07-26T11:32:09.945Z","repository":{"id":46457132,"uuid":"395812498","full_name":"textileio/near-api-go","owner":"textileio","description":"NEAR client written in Go","archived":false,"fork":false,"pushed_at":"2022-12-09T12:41:15.000Z","size":56,"stargazers_count":21,"open_issues_count":5,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-06-18T21:46:24.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/textileio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-13T22:16:54.000Z","updated_at":"2024-02-18T06:45:46.000Z","dependencies_parsed_at":"2023-01-25T21:30:26.139Z","dependency_job_id":null,"html_url":"https://github.com/textileio/near-api-go","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textileio%2Fnear-api-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textileio%2Fnear-api-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textileio%2Fnear-api-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textileio%2Fnear-api-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/textileio","download_url":"https://codeload.github.com/textileio/near-api-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227673973,"owners_count":17802303,"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-12-02T05:15:37.789Z","updated_at":"2024-12-02T05:15:38.665Z","avatar_url":"https://github.com/textileio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# near-api-go\n\n[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n\nA NEAR client written in Go\n\nThe goal of this project is to provide a fully featured NEAR cleint in Go. There is support for most NEAR RPC requests, including those that use signed transactions. Of course, there is room for improvement, especially with integration testing and a fully featured `KeyStore`, so please give it a spin and feel free to open a PR to help us improve the library. \n\nWe're currently relying on [our fork of go-ethereum's JSON RPC client](https://github.com/textileio/go-ethereum) that adds support for named RPC parameters. That work is [pending PR](https://github.com/ethereum/go-ethereum/pull/22656) merge into their master branch.\n\n## Table of Contents\n\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Maintainers](#maintainers)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\n```\ngo get github.com/textileio/near-api-go\n```\n\n## Usage\n\nImport the required modules.\n\n```golang\nimport (\n  api \"github.com/textileio/near-api-go\"\n  \"github.com/textileio/near-api-go/keys\"\n  \"github.com/textileio/near-api-go/transaction\"\n  \"github.com/textileio/near-api-go/types\"\n  \"github.com/ethereum/go-ethereum/rpc\"\n)\n\n```\n\nConfigure and create an API client.\n\n```golang\nrpcClient, err := rpc.DialContext(ctx, \"https://rpc.testnet.near.org\")\n\nkeyPair, err := keys.NewKeyPairFromString(\n  \"ed25519:...\",\n)\n\nconfig := \u0026types.Config{\n  RPCClient: rpcClient,\n  Signer:    keyPair, // Currently we use a key pair directly as a signer.\n  NetworkID: \"testnet\",\n}\n\nclient, err := api.NewClient(config)\n```\n\nInteract with top level functions like `CallFunction`, for example. It can be used for calling non-signed \"view\" functions.\n\n```golang\nres, err := client.CallFunction(\n  ctx,\n  \"\u003caccount id\u003e\",\n  \"myFunction\",\n  api.CallFunctionWithFinality(\"final\"),\n)\n```\n\nMost other functionality is provided by the `Account` sub module. For example, you can call state-modifying functions that are sent as signed transactions, and even include a deposit while you're at it.\n\n```golang\ndeposit, ok := (\u0026big.Int{}).SetString(\"1000000000000000000000000\", 10)\nres, err := client.Account(\"\u003cclient account id\u003e\").FunctionCall(\n  ctx,\n  \u003ccontract account id\u003e,\n  \"myTxnFunction\",\n  transaction.FunctionCallWithArgs(map[string]interface{}{\n    \"arg1\": value1, \n    \"arg2\": value2\n  }),\n  transaction.FunctionCallWithDeposit(*deposit),\n)\n```\n\nCheck out the [API docs](https://pkg.go.dev/github.com/textileio/near-api-go) to see all that is possible.\n\n## API\n\n[https://pkg.go.dev/github.com/textileio/near-api-go](https://pkg.go.dev/github.com/textileio/near-api-go)\n\n## Maintainers\n\n[@asutula](https://github.com/asutula)\n\n## Contributing\n\nPRs accepted.\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nMIT © 2021 Textile\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextileio%2Fnear-api-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftextileio%2Fnear-api-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextileio%2Fnear-api-go/lists"}