Circular SDK
  • Getting Started
    • Circular APIs
      • Setting Up a Wallet
      • Get you NAG Access Key
      • Select a Programming Language
  • API Docs
    • APIs
      • Check Wallet Existence
      • Get Wallet Content
      • Get Wallet Balance
      • Get Wallet Nonce
      • Call a Smart Contract Function
      • Get a Domain
      • Get the Asset List
      • Get Asset
      • Get the Asset Supply
      • Get a range of Blocks
      • Get a Block
      • Get the number of Blocks
      • Get the Blockchain Analytics
      • Get the available blockchains
      • Get a Transaction by its TxID
      • Get transactions processed by a node
      • Get a transaction by an involved address
      • Get transactions by a range of dates
      • Submit a new Transaction
      • Registering a New Wallet
      • Transferring an Asset
    • Node.js
      • Mainnet Integration
      • checkWallet()
      • getWallet()
      • getWalletBalance()
      • getWalletNonce()
      • callContract()
      • testContract()
      • registerWallet()
      • getDomain()
      • getAssetList()
      • getAsset()
      • getAssetSupply()
      • getBlockRange()
      • getBlock()
      • getBlockCount()
      • getAnalytics()
      • getBlockchains()
      • getTransactionbyID()
      • getTransactionbyNode()
      • getTransactionbyAddress()
      • getTransactionbyDate()
      • getTransactionOutcome()
      • getPendingTransaction()
      • sendTransaction()
      • signMessage()
      • verifySignature()
      • getPublicKey()
      • stringToHex()
      • hexToString()
      • hexFix()
      • setNAGKey()
      • setNAGURL()
      • getFormattedTimestamp()
    • Javascript
      • Mainnet Integration
      • checkWallet()
      • getWallet()
      • getWalletBalance()
      • getWalletNonce()
      • callContract()
      • testContract()
      • registerWallet()
      • getDomain()
      • getAssetList()
      • getAsset()
      • getAssetSupply()
      • getBlockRange()
      • getBlock()
      • getBlockCount()
      • getAnalytics()
      • getBlockchains()
      • getTransactionbyID()
      • getTransactionbyNode()
      • getTransactionbyAddress()
      • getTransactionbyDate()
      • getTransactionOutcome()
      • getPendingTransaction()
      • sendTransaction()
      • signMessage()
      • verifySignature()
      • getPublicKey()
      • stringToHex()
      • hexToString()
      • hexFix()
      • setNAGKey()
      • setNAGURL()
      • getFormattedTimestamp()
    • Typescript
      • Including TypeScript Library
      • SetNAGKey & SetNAGURL
      • GetWallet
      • RegisterWallet
      • GetAsset
      • GetAssetSupply
      • GetBlock
      • SendTransaction
      • SignMessage
      • getFormattedTimestamp
      • Transferring an Asset
    • Python
      • Mainnet Integration
      • checkWallet()
      • getWallet()
      • getWalletBalance()
      • getWalletNonce()
      • callContract()
      • registerWallet()
      • getDomain()
      • getAssetList()
      • getAsset()
      • getAssetSupply()
      • getBlockRange()
      • getBlock()
      • getBlockCount()
      • getAnalytics()
      • getBlockchains()
      • getTransactionByID()
      • getTransactionByNode()
      • getTransactionByAddress()
      • getTransactionByDate()
      • getTransactionOutcome()
      • sendTransaction()
    • Dart
      • checkWallet()
      • getWallet()
      • getWalletBalance()
      • getWalletNonce()
      • callContract()
      • callContractWithPlainConsoleOutput()
      • registerWallet()
      • getDomain()
      • getAssetList()
      • getAsset()
      • getAssetSupply()
      • getBlockRange()
      • getBlock()
      • getBlockCount()
      • getAnalytics()
      • getBlockchains()
      • getTransactionByID()
      • getTransactionByNode()
      • getTransactionByAddress()
      • getTransactionByDate()
      • sendTransaction()
      • signMessage()
      • verifySignature()
      • getPublicKey()
      • getKeysFromString()
      • getKeysFromListOfStrings()
    • Go
      • Mainnet Integration
      • CheckWallet()
      • GetWallet()
      • GetWalletBalance()
      • GetWalletNonce()
      • CallContract()
      • RegisterWallet()
      • GetDomain()
      • GetAssetList()
      • GetAsset()
      • GetAssetSupply()
      • GetBlockRange()
      • GetBlock()
      • GetBlockCount()
      • GetAnalytics()
      • GetBlockchains()
      • GetTransactionByID()
      • GetTransactionByNode()
      • GetTransactionByAddress()
      • GetTransactionByDate()
      • GetTransactionOutcome()
      • SendTransaction()
      • SignMessage()
      • VerifySignature()
      • GetPublicKey()
      • GetKeysFromString()
    • PHP
      • Mainnet Integration
      • checkWallet()
      • getWallet()
      • getWalletBalance()
      • getWalletNonce()
      • callContract()
      • registerWallet()
      • getDomain()
      • getAssetList()
      • getAsset()
      • getAssetSupply()
      • getBlockRange()
      • getBlock()
      • getBlockCount()
      • getAnalytics()
      • getBlockchains()
      • getTransactionByID()
      • getTransactionByNode()
      • getTransactionByAddress()
      • getTransactionByDate()
      • getTransactionOutcome()
      • sendTransaction()
      • signMessage()
      • verifySignature()
      • getPublicKey()
      • stringToHex()
      • hexToString()
      • hexFix()
      • setNAGKey()
      • setNAGURL()
      • getFormattedTimestamp()
    • C++
    • C#
    • Rust
    • Arduino
Powered by GitBook
On this page
  1. API Docs
  2. Go

GetWallet()

This method retrieves the wallet information from the specified blockchain.

Method Signature

func GetWallet(blockchain string, address string) map[string]interface{}

Parameters

Name
Type
Description

blockchain

String

Blockchain address in hex

address

String

Wallet address in hex

Example

package main

import (
	"fmt"

	"github.com/circular-protocol/circular-go/circular_protocol_api"
)

func main() {
	var blockchain = "0x8a20baa40c45dc5055aeb26197c203e576ef389d9acb171bd62da11dc5ad72b2"
	var test_addr = "0x8b1dd25076c04c5139acba458f86c69cd2d322c61d19bc28daa3bbd945083738"

	result := circular_protocol_api.GetWallet(blockchain, test_addr)
	fmt.Println(result)
}

Result

The result will be of type Map, but for easier readability, here is the equivalent in JSON.

{
    "Result": 200,
    "Response": {
        "Address": "8b1dd25076c04c5139acba458f86c69cd2d322c61d19bc28daa3bbd945083738",
        "Assets": [ // Owned assets on the specified blockchain
            {
                "Address": "",
                "Amount": "1989449.200000",
                "Description": "Circular Coin",
                "EnableSwap": 0,
                "Name": "CIRX",
                "Price": "1",
                "Royalties": "0",
                "Type": "C_TYPE_COIN",
                "URL": "",
                "URLType": ""
            }
        ],
        "ContractData": [],
        "Contracts": {
            "ContractData": [
                {
                    "Address": "2b71b51f05ea3233a14204e9645023fe5c5dea7bc0747485a5194b2e5c24b65e",
                    "Data": "7b2241646472657373223a22307838623164643235303736633034633531333961636261343538663836633639636432643332326336316431396263323864616133626264393435303833373338222c2254797065223a224d6f766544417070222c224e616d65223a224d6f766544417070222c2253796d626f6c223a224d4450222c224f776e6572223a22307838623164643235303736633034633531333961636261343538663836633639636432643332326336316431396263323864616133626264393435303833373338222c224e6f746573223a313733313830373633313030302c2242616c616e6365223a302c22416c6c6f77616e636573223a7b7d7d"
                },
                {
                    "Address": "67cdbc9ba3ec4ff2cb5af6b511e94eefd486d6cc831d220fa48a188880aeba54",
                    "Data": "7b2241646472657373223a22307838623164643235303736633034633531333961636261343538663836633639636432643332326336316431396263323864616133626264393435303833373338222c2254797065223a224d6f766544417070222c224e616d65223a224d6f766544417070222c2253796d626f6c223a224d4450222c224f776e6572223a22307838623164643235303736633034633531333961636261343538663836633639636432643332326336316431396263323864616133626264393435303833373338222c224e6f746573223a313733313831303138383030302c2242616c616e6365223a302c22416c6c6f77616e636573223a7b7d7d"
                },
            ]
        },
        "DateCreation": "2024:07:15-13:17:29", // Wallet creation date
        "LatestTransactions": [
            {
                "Amount": 1000000.0,
                "Asset": "CIRX",
                "BlockID": 1062,
                "ID": "2ac8078d535706118e17e99baff38dd485fc9281de8c23d7ccc13c374a7dd9b5",
                "Timestamp": "2024:07:15-19:10:07"
            },
            {
                "Amount": -1004.0,
                "Asset": "CIRX",
                "BlockID": 1083,
                "ID": "e99be1869fe1bd452c3c6950d11a674045f6f3a096f67f8cbcbd4bbd849c7697",
                "Timestamp": "2024:07:17-13:36:17"
            }
        ],
        "Nonce": 55,
        "PublicKey": "04b5aa6be8b2e3420fb5a8b22e80e64ace8271d88dc4c081436956b0848e7bcf4e864b35c59e218885ed3d839352b81f85872c9460732ca05b8c18dad29dbad00e",
        "Version": "1.0.1", // Wallet version
        "Vouchers": []
    },
    "Node": "7bb5bd50729d6857942701d5673ea70ca1625f883230d8543970a452d1abe1c4"
}

When the selected node for the response is not ready:

{
    "Result": 102,
    "Response": "Node Not Ready",
    "Node": "fc8fe5ee103dafe353c98ce90a1cb2956fd51a109512e074bd3d26a06d268e81"
}

When the blockchain address is not correct.

{
    "Result": 118,
    "Response": "Wrong Format",
    "Node": "fc8fe5ee103dafe353c98ce90a1cb2956fd51a109512e074bd3d26a06d268e81"
}

Last updated 7 months ago