{"id":13430236,"url":"https://github.com/coming-chat/go-sui-sdk","last_synced_at":"2025-04-05T23:12:40.088Z","repository":{"id":61623783,"uuid":"534564884","full_name":"coming-chat/go-sui-sdk","owner":"coming-chat","description":"Sui Golang SDK @mystenLabs","archived":false,"fork":false,"pushed_at":"2025-02-06T17:16:12.000Z","size":472,"stargazers_count":93,"open_issues_count":8,"forks_count":41,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-28T19:41:44.183Z","etag":null,"topics":["move","sui"],"latest_commit_sha":null,"homepage":"","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/coming-chat.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":"2022-09-09T08:39:26.000Z","updated_at":"2025-02-25T07:26:08.000Z","dependencies_parsed_at":"2024-05-28T17:35:24.352Z","dependency_job_id":"0bdd27e0-8e74-4d83-9232-d63a1349a3e1","html_url":"https://github.com/coming-chat/go-sui-sdk","commit_stats":null,"previous_names":["coming-chat/go-sui"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coming-chat%2Fgo-sui-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coming-chat%2Fgo-sui-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coming-chat%2Fgo-sui-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coming-chat%2Fgo-sui-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coming-chat","download_url":"https://codeload.github.com/coming-chat/go-sui-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411239,"owners_count":20934653,"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":["move","sui"],"created_at":"2024-07-31T02:00:51.321Z","updated_at":"2025-04-05T23:12:40.070Z","avatar_url":"https://github.com/coming-chat.png","language":"Go","funding_links":[],"categories":["SDKs"],"sub_categories":["Wallet Kits","Sui SDKs"],"readme":"# go-sui-sdk\nSui Golang SDK\n\n[![Documentation (master)](https://img.shields.io/badge/docs-master-59f)](https://github.com/coming-chat/go-sui-sdk)\n[![License](https://img.shields.io/badge/license-Apache-green.svg)](https://github.com/coming-chat/go-sui-sdk/blob/main/LICENSE)\n\nThe Sui Golang SDK for ComingChat. \nWe welcome other developers to participate in the development and testing of sui-sdk.\n\n## Install\n\n```sh\ngo get github.com/coming-chat/go-sui/v2\n```\n\n\n\n## Usage\n\n### Account\n\n```go\nimport \"github.com/coming-chat/go-sui/account\"\n\n// Import account with mnemonic\nacc, err := account.NewAccountWithMnemonic(mnemonic)\n\n// Import account with private key\nprivateKey, err := hex.DecodeString(\"4ec5a9eefc0bb86027a6f3ba718793c813505acc25ed09447caf6a069accdd4b\")\nacc, err := account.NewAccount(privateKey)\n\n// Get private key, public key, address\nfmt.Printf(\"privateKey = %x\\n\", acc.PrivateKey[:32])\nfmt.Printf(\" publicKey = %x\\n\", acc.PublicKey)\nfmt.Printf(\"   address = %v\\n\", acc.Address)\n\n// Sign data\nsignedData := acc.Sign(data)\n```\n\n\n\n### JSON RPC Client\n\nAll data interactions on the Sui chain are implemented through the rpc client.\n\n```go\nimport \"github.com/coming-chat/go-sui/client\"\nimport \"github.com/coming-chat/go-sui/types\"\n\ncli, err := client.Dial(rpcUrl)\n\n// call JSON RPC\nresponseObject := uint64(0) // if response is a uint64\nerr := cli.CallContext(ctx, \u0026responseObject, funcName, params...)\n\n// e.g. call get transaction\ndigest, err := types.NewBase64Data(\"/KXvTwNRHKKzAB+/Dz1O64LjVbISgIW4VUCmuuPyEfU=\")\nresp := types.TransactionResponse{}\nerr := cli.CallContext(ctx, \u0026resp, \"sui_getTransaction\", digest)\nprint(\"transaction status = \", resp.Effects.Status)\nprint(\"transaction timestamp = \", resp.TimestampMs)\n\n// And you can call some predefined methods\ndigest, err := types.NewBase64Data(\"/KXvTwNRHKKzAB+/Dz1O64LjVbISgIW4VUCmuuPyEfU=\")\nresp, err := cli.GetTransaction(ctx, digest)\nprint(\"transaction status = \", resp.Effects.Status)\nprint(\"transaction timestamp = \", resp.TimestampMs)\n\n```\n\nWe currently have some rpc methods built-in, [see here](https://github.com/coming-chat/go-sui-sdk/blob/main/client/client_call.go)\n\n\n\n### Build Transaction \u0026 Sign ( Transfer Sui )\n\n```go\nimport \"github.com/coming-chat/go-sui/client\"\nimport \"github.com/coming-chat/go-sui/types\"\nimport \"github.com/coming-chat/go-sui/account\"\n\nacc, err := account.NewAccountWithMnemonic(mnemonic)\nsigner, _ := types.NewAddressFromHex(acc.Address)\n\nrecipient, err := types.NewAddressFromHex(\"0x12345678.......\")\nsuiObjectId, err := types.NewHexData(\"0x36d3176a796e167ffcbd823c94718e7db56b955f\")\ntransferAmount := uint64(10000)\nmaxGasTransfer := 100\n\ncli, err := client.Dial(rpcUrl)\ntxnBytes, err := cli.TransferSui(ctx, *signer, *recipient, suiObjectId, transferAmount, maxGasTransfer)\n\n// Sign\nsignedTxn := txnBytes.SignWith(acc.PrivateKey)\n\n```\n\n\n\n### Send Signed Transaction\n\n```go\ntxnResponse, err := cli.ExecuteTransaction(ctx, signedTxn)\n\nprint(\"transaction digest = \", txnResponse.Certificate.TransactionDigest)\nprint(\"transaction status = \", txnResponse.Effects.Status)\nprint(\"transaction gasFee = \", txnResponse.Effects.GasFee())\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoming-chat%2Fgo-sui-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoming-chat%2Fgo-sui-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoming-chat%2Fgo-sui-sdk/lists"}