Skip to content

Latest commit

 

History

History
302 lines (192 loc) · 8.85 KB

AddressesAPI.md

File metadata and controls

302 lines (192 loc) · 8.85 KB

\AddressesAPI

All URIs are relative to https://your_deployment.multibaas.com/api/v0

Method HTTP request Description
DeleteAddress Delete /chains/{chain}/addresses/{address-or-label} Delete address
GetAddress Get /chains/{chain}/addresses/{address-or-label} Get address
ListAddresses Get /chains/{chain}/addresses List addresses
SetAddress Post /chains/{chain}/addresses Create or update address

DeleteAddress

BaseResponse DeleteAddress(ctx, chain, addressOrLabel).Execute()

Delete address

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/curvegrid/multibaas-sdk-go"
)

func main() {
	chain := openapiclient.ChainName("ethereum") // ChainName | The blockchain chain label.
	addressOrLabel := "addressOrLabel_example" // string | An address or the label of an address.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AddressesAPI.DeleteAddress(context.Background(), chain, addressOrLabel).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AddressesAPI.DeleteAddress``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `DeleteAddress`: BaseResponse
	fmt.Fprintf(os.Stdout, "Response from `AddressesAPI.DeleteAddress`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chain ChainName The blockchain chain label.
addressOrLabel string An address or the label of an address.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteAddressRequest struct via the builder pattern

Name Type Description Notes

Return type

BaseResponse

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAddress

SetAddress201Response GetAddress(ctx, chain, addressOrLabel).Include(include).Execute()

Get address

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/curvegrid/multibaas-sdk-go"
)

func main() {
	chain := openapiclient.ChainName("ethereum") // ChainName | The blockchain chain label.
	addressOrLabel := "addressOrLabel_example" // string | An address or the label of an address.
	include := []string{"Include_example"} // []string | Optional data to fetch from the blockchain: - `balance` to get the balance of this address. - `code` to get the code at this address. - `nonce` to get the next available transaction nonce for this address. - `contractLookup` to get the contract(s) details for this address.  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AddressesAPI.GetAddress(context.Background(), chain, addressOrLabel).Include(include).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AddressesAPI.GetAddress``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAddress`: SetAddress201Response
	fmt.Fprintf(os.Stdout, "Response from `AddressesAPI.GetAddress`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chain ChainName The blockchain chain label.
addressOrLabel string An address or the label of an address.

Other Parameters

Other parameters are passed through a pointer to a apiGetAddressRequest struct via the builder pattern

Name Type Description Notes

include | []string | Optional data to fetch from the blockchain: - `balance` to get the balance of this address. - `code` to get the code at this address. - `nonce` to get the next available transaction nonce for this address. - `contractLookup` to get the contract(s) details for this address. |

Return type

SetAddress201Response

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListAddresses

ListAddresses200Response ListAddresses(ctx, chain).Execute()

List addresses

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/curvegrid/multibaas-sdk-go"
)

func main() {
	chain := openapiclient.ChainName("ethereum") // ChainName | The blockchain chain label.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AddressesAPI.ListAddresses(context.Background(), chain).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AddressesAPI.ListAddresses``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListAddresses`: ListAddresses200Response
	fmt.Fprintf(os.Stdout, "Response from `AddressesAPI.ListAddresses`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chain ChainName The blockchain chain label.

Other Parameters

Other parameters are passed through a pointer to a apiListAddressesRequest struct via the builder pattern

Name Type Description Notes

Return type

ListAddresses200Response

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SetAddress

SetAddress201Response SetAddress(ctx, chain).AddressLabel(addressLabel).Execute()

Create or update address

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/curvegrid/multibaas-sdk-go"
)

func main() {
	chain := openapiclient.ChainName("ethereum") // ChainName | The blockchain chain label.
	addressLabel := *openapiclient.NewAddressLabel("Label_example", "Address_example") // AddressLabel | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AddressesAPI.SetAddress(context.Background(), chain).AddressLabel(addressLabel).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AddressesAPI.SetAddress``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SetAddress`: SetAddress201Response
	fmt.Fprintf(os.Stdout, "Response from `AddressesAPI.SetAddress`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chain ChainName The blockchain chain label.

Other Parameters

Other parameters are passed through a pointer to a apiSetAddressRequest struct via the builder pattern

Name Type Description Notes

addressLabel | AddressLabel | |

Return type

SetAddress201Response

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]