{"id":20841331,"url":"https://github.com/iotexproject/iotex-antenna-go","last_synced_at":"2025-05-08T22:10:30.768Z","repository":{"id":41274767,"uuid":"173380571","full_name":"iotexproject/iotex-antenna-go","owner":"iotexproject","description":"Golang SDK for IoTeX bloclchain","archived":false,"fork":false,"pushed_at":"2023-09-07T15:49:04.000Z","size":13376,"stargazers_count":12,"open_issues_count":8,"forks_count":17,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-06-19T19:34:35.938Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iotexproject.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-01T23:19:26.000Z","updated_at":"2024-05-26T17:53:03.000Z","dependencies_parsed_at":"2024-06-18T18:39:25.243Z","dependency_job_id":"8ea35400-49cc-4d13-9955-a0aba1d06d9e","html_url":"https://github.com/iotexproject/iotex-antenna-go","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotexproject%2Fiotex-antenna-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotexproject%2Fiotex-antenna-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotexproject%2Fiotex-antenna-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotexproject%2Fiotex-antenna-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iotexproject","download_url":"https://codeload.github.com/iotexproject/iotex-antenna-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225110645,"owners_count":17422457,"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-18T01:19:40.786Z","updated_at":"2024-11-18T01:19:41.517Z","avatar_url":"https://github.com/iotexproject.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iotex-antenna-go\n\n[![CircleCI](https://circleci.com/gh/iotexproject/iotex-antenna-go.svg?style=svg)](https://circleci.com/gh/iotexproject/iotex-antenna-go)\n[![Go version](https://img.shields.io/badge/go-1.11.5-blue.svg)](https://github.com/moovweb/gvm)\n[![LICENSE](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\nThis is the the official Go implementation of IoTeX SDK! Please refer to IoTeX [whitepaper](https://iotex.io/research) and the [protocol](https://github.com/iotexproject/iotex-core) for details.\n\n## Get Started\n\n### Minimum Requirements\n\n| Components | Version | Description |\n|----------|-------------|-------------|\n| [Golang](https://golang.org) | \u0026ge; 1.11.5 | Go programming language |\n\n### Add Dependency\n\n```\n// go mod\ngo get github.com/iotexproject/iotex-antenna-go/v2\n```\n\n### Code It Up\nThe below example code shows the 4 easy steps to send a transaction to IoTeX blockchain\n1. connect to the chain's RPC endpoint\n2. create an account by importing a private key\n3. create a client and generate an action sender\n4. send the transaction to the chain\n\n```\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/iotexproject/iotex-address/address\"\n\t\"github.com/iotexproject/iotex-antenna-go/v2/account\"\n\t\"github.com/iotexproject/iotex-antenna-go/v2/iotex\"\n\t\"github.com/iotexproject/iotex-proto/golang/iotexapi\"\n)\n\nconst (\n\tmainnetRPC     = \"api.iotex.one:443\"\n\ttestnetRPC     = \"api.testnet.iotex.one:443\"\n\tmainnetChainID = 1\n\ttestnetChainID = 2\n)\n\nfunc main() {\n\t// Create grpc connection\n\tconn, err := iotex.NewDefaultGRPCConn(testnetRPC)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer conn.Close()\n\n\t// Add account by private key\n\tacc, err := account.HexStringToAccount(\"...\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// create client\n\tc := iotex.NewAuthedClient(iotexapi.NewAPIServiceClient(conn), testnetChainID, acc)\n\t\n\t// send the transfer to chain\n\tto, err := address.FromString(\"io1zq5g9c5c3hqw9559ks4anptkpumxgsjfn2e4ke\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\thash, err := c.Transfer(to, big.NewInt(10)).SetGasPrice(big.NewInt(100000000000)).SetGasLimit(20000).Call(context.Background())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(\"transaction hash = %x\\n\", hash)\n}\n```\n\n### More Examples\nThere are three examples demostrating the use of this SDK on Testnet. You can `make examples` to build and try:\n- `./examples/chaininfo` shows **how to use the SDK to pull chain, block, action and delegates info**\n- `./examples/openoracle` shows **how to deploy and invoke [Open Oracle Contracts](https://github.com/compound-finance/open-oracle)**\n- `./examples/xrc20tokens` shows **how to deploy and invoke XRC20 tokens**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotexproject%2Fiotex-antenna-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiotexproject%2Fiotex-antenna-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotexproject%2Fiotex-antenna-go/lists"}