Files
sdk/docs/WalletAPI.md

16 KiB

\WalletAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
GetWallet Get /v1/wallet Returns the caller org's wallets, newest first, optionally NARROWED within the org by project, agent or account.
GetWalletAccounts Get /v1/wallet/accounts Returns the caller org's wallet accounts, newest first.
GetWalletById Get /v1/wallet/{id} Returns one of the caller org's wallets: its scope, custody kind, tier, chain and on-chain address.
PostWallet Post /v1/wallet Provisions a new signing identity under one of the caller org's accounts and answers the stored wallet including its on-chain address.
PostWalletAccounts Post /v1/wallet/accounts Opens a named wallet account for the caller's org.
PostWalletByIdKeys Post /v1/wallet/{id}/keys Rolls one wallet's signing material through its own custody backend and answers the wallet with whatever address that produced.
PostWalletByIdSign Post /v1/wallet/{id}/sign Produces a secp256k1 signature from one of the caller org's wallets over a 32-byte digest, through whichever custody backend that wallet uses.
PostWalletByIdTransactions Post /v1/wallet/{id}/transactions Composes a Safe transaction on the MPC ring and answers its EIP-712 hash together with the owner approval the ring's threshold signature produced.

GetWallet

WalletWalletList GetWallet(ctx).Project(project).Agent(agent).Account(account).Execute()

Returns the caller org's wallets, newest first, optionally NARROWED within the org by project, agent or account.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	project := "project_example" // string | Project narrows to wallets scoped to one project. Must be a url-safe segment. (optional)
	agent := "agent_example" // string | Agent narrows to wallets scoped to one agent. Must be a url-safe segment. (optional)
	account := "acct_9f8c1d" // string | Account narrows to wallets under one account id. Must be a url-safe segment. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.WalletAPI.GetWallet(context.Background()).Project(project).Agent(agent).Account(account).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `WalletAPI.GetWallet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetWallet`: WalletWalletList
	fmt.Fprintf(os.Stdout, "Response from `WalletAPI.GetWallet`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
project string Project narrows to wallets scoped to one project. Must be a url-safe segment.
agent string Agent narrows to wallets scoped to one agent. Must be a url-safe segment.
account string Account narrows to wallets under one account id. Must be a url-safe segment.

Return type

WalletWalletList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

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

GetWalletAccounts

WalletAccountList GetWalletAccounts(ctx).Execute()

Returns the caller org's wallet accounts, newest first.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

WalletAccountList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

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

GetWalletById

WalletWallet GetWalletById(ctx, id).Execute()

Returns one of the caller org's wallets: its scope, custody kind, tier, chain and on-chain address.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	id := "wal_4b1e77" // string | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

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

Name Type Description Notes

Return type

WalletWallet

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

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

PostWallet

WalletWallet PostWallet(ctx).WalletCreateWalletIn(walletCreateWalletIn).Execute()

Provisions a new signing identity under one of the caller org's accounts and answers the stored wallet including its on-chain address.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	walletCreateWalletIn := *openapiclient.NewWalletCreateWalletIn() // WalletCreateWalletIn | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
walletCreateWalletIn WalletCreateWalletIn

Return type

WalletWallet

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

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

PostWalletAccounts

WalletWalletAccount PostWalletAccounts(ctx).WalletCreateAccountIn(walletCreateAccountIn).Execute()

Opens a named wallet account for the caller's org.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	walletCreateAccountIn := *openapiclient.NewWalletCreateAccountIn() // WalletCreateAccountIn | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
walletCreateAccountIn WalletCreateAccountIn

Return type

WalletWalletAccount

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

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

PostWalletByIdKeys

WalletWallet PostWalletByIdKeys(ctx, id).Execute()

Rolls one wallet's signing material through its own custody backend and answers the wallet with whatever address that produced.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	id := "wal_4b1e77" // string | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

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

Name Type Description Notes

Return type

WalletWallet

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

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

PostWalletByIdSign

WalletSignature PostWalletByIdSign(ctx, id).WalletSignIn(walletSignIn).Execute()

Produces a secp256k1 signature from one of the caller org's wallets over a 32-byte digest, through whichever custody backend that wallet uses.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	id := "wal_4b1e77" // string | 
	walletSignIn := *openapiclient.NewWalletSignIn() // WalletSignIn | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

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

Name Type Description Notes

walletSignIn | WalletSignIn | |

Return type

WalletSignature

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

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

PostWalletByIdTransactions

WalletSafeProposal PostWalletByIdTransactions(ctx, id).WalletSafeTxIn(walletSafeTxIn).Execute()

Composes a Safe transaction on the MPC ring and answers its EIP-712 hash together with the owner approval the ring's threshold signature produced.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	id := "wal_4b1e77" // string | 
	walletSafeTxIn := *openapiclient.NewWalletSafeTxIn() // WalletSafeTxIn | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

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

Name Type Description Notes

walletSafeTxIn | WalletSafeTxIn | |

Return type

WalletSafeProposal

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

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