v1

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

General documentation

For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.

Example usage

To get started with this package, create a client.

ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := v1.NewBlockchainClient(ctx)
if err != nil {
	// TODO: Handle error.
}
defer c.Close()

The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.

Using the Client

The following is an example of making an API call with the newly created client.

ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := v1.NewBlockchainClient(ctx)
if err != nil {
	// TODO: Handle error.
}
defer c.Close()

req := &blockchainpb.GetNetworkRequest{
	// TODO: Fill request struct fields.
	// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1#GetNetworkRequest.
}
resp, err := c.GetNetwork(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp

Use of Context

The ctx passed to NewBlockchainClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

Types

type AddDeviceOperation

type AddDeviceOperation struct {
	// contains filtered or unexported fields
}

AddDeviceOperation manages a long-running operation from AddDevice.

func (*AddDeviceOperation) Done

func (op *AddDeviceOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*AddDeviceOperation) Metadata

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*AddDeviceOperation) Name

func (op *AddDeviceOperation) Name() string

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*AddDeviceOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*AddDeviceOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type AddressIterator

type AddressIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*mpc_walletspb.Address, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AddressIterator manages a stream of *mpc_walletspb.Address.

func (*AddressIterator) Next

func (it *AddressIterator) Next() (*mpc_walletspb.Address, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*AddressIterator) PageInfo

func (it *AddressIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type AssetIterator

type AssetIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*blockchainpb.Asset, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AssetIterator manages a stream of *blockchainpb.Asset.

func (*AssetIterator) Next

func (it *AssetIterator) Next() (*blockchainpb.Asset, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*AssetIterator) PageInfo

func (it *AssetIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type BalanceDetailIterator

type BalanceDetailIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*mpc_walletspb.BalanceDetail, nextPageToken string, err error)
	// contains filtered or unexported fields
}

BalanceDetailIterator manages a stream of *mpc_walletspb.BalanceDetail.

func (*BalanceDetailIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*BalanceDetailIterator) PageInfo

func (it *BalanceDetailIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type BalanceIterator

type BalanceIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*mpc_walletspb.Balance, nextPageToken string, err error)
	// contains filtered or unexported fields
}

BalanceIterator manages a stream of *mpc_walletspb.Balance.

func (*BalanceIterator) Next

func (it *BalanceIterator) Next() (*mpc_walletspb.Balance, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*BalanceIterator) PageInfo

func (it *BalanceIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type BlockchainCallOptions

type BlockchainCallOptions struct {
	GetNetwork     []gax.CallOption
	ListNetworks   []gax.CallOption
	GetAsset       []gax.CallOption
	ListAssets     []gax.CallOption
	BatchGetAssets []gax.CallOption
}

BlockchainCallOptions contains the retry settings for each method of BlockchainClient.

type BlockchainClient

type BlockchainClient struct {

	// The call options for this service.
	CallOptions *BlockchainCallOptions
	// contains filtered or unexported fields
}

BlockchainClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service providing a set of read-only APIs for information about the blockchain networks that WaaS supports. Users can query BlockchainService to figure out the Networks and Assets that can be transacted with using WaaS APIs.

func NewBlockchainClient

func NewBlockchainClient(ctx context.Context, opts ...option.ClientOption) (*BlockchainClient, error)

NewBlockchainClient creates a new blockchain service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

A service providing a set of read-only APIs for information about the blockchain networks that WaaS supports. Users can query BlockchainService to figure out the Networks and Assets that can be transacted with using WaaS APIs.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewBlockchainClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func NewBlockchainRESTClient

func NewBlockchainRESTClient(ctx context.Context, opts ...option.ClientOption) (*BlockchainClient, error)

NewBlockchainRESTClient creates a new blockchain service rest client.

A service providing a set of read-only APIs for information about the blockchain networks that WaaS supports. Users can query BlockchainService to figure out the Networks and Assets that can be transacted with using WaaS APIs.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewBlockchainRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func (*BlockchainClient) BatchGetAssets

BatchGetAssets returns the list of Assets indicated by the given request.

Example
package main

import (
	"context"

	blockchainpb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1"
	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewBlockchainClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &blockchainpb.BatchGetAssetsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1#BatchGetAssetsRequest.
	}
	resp, err := c.BatchGetAssets(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*BlockchainClient) Close

func (c *BlockchainClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*BlockchainClient) Connection deprecated

func (c *BlockchainClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*BlockchainClient) GetAsset

GetAsset retrieves an Asset by resource name.

Example
package main

import (
	"context"

	blockchainpb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1"
	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewBlockchainClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &blockchainpb.GetAssetRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1#GetAssetRequest.
	}
	resp, err := c.GetAsset(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*BlockchainClient) GetNetwork

GetNetwork retrieves a Network by resource name.

Example
package main

import (
	"context"

	blockchainpb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1"
	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewBlockchainClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &blockchainpb.GetNetworkRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1#GetNetworkRequest.
	}
	resp, err := c.GetNetwork(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*BlockchainClient) ListAssets

ListAssets returns a list of Assets available on a given Network.

Example
package main

import (
	"context"

	blockchainpb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1"
	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewBlockchainClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &blockchainpb.ListAssetsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1#ListAssetsRequest.
	}
	it := c.ListAssets(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*BlockchainClient) ListNetworks

ListNetworks returns the list of Networks available for use.

Example
package main

import (
	"context"

	blockchainpb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1"
	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewBlockchainClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &blockchainpb.ListNetworksRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/blockchain/v1#ListNetworksRequest.
	}
	it := c.ListNetworks(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

type CreateDeviceGroupOperation

type CreateDeviceGroupOperation struct {
	// contains filtered or unexported fields
}

CreateDeviceGroupOperation manages a long-running operation from CreateDeviceGroup.

func (*CreateDeviceGroupOperation) Done

func (op *CreateDeviceGroupOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*CreateDeviceGroupOperation) Metadata

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*CreateDeviceGroupOperation) Name

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*CreateDeviceGroupOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*CreateDeviceGroupOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type CreateMPCTransactionOperation

type CreateMPCTransactionOperation struct {
	// contains filtered or unexported fields
}

CreateMPCTransactionOperation manages a long-running operation from CreateMPCTransaction.

func (*CreateMPCTransactionOperation) Done

Done reports whether the long-running operation has completed.

func (*CreateMPCTransactionOperation) Metadata

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*CreateMPCTransactionOperation) Name

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*CreateMPCTransactionOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*CreateMPCTransactionOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type CreateMPCWalletOperation

type CreateMPCWalletOperation struct {
	// contains filtered or unexported fields
}

CreateMPCWalletOperation manages a long-running operation from CreateMPCWallet.

func (*CreateMPCWalletOperation) Done

func (op *CreateMPCWalletOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*CreateMPCWalletOperation) Metadata

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*CreateMPCWalletOperation) Name

func (op *CreateMPCWalletOperation) Name() string

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*CreateMPCWalletOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*CreateMPCWalletOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type CreateSignatureOperation

type CreateSignatureOperation struct {
	// contains filtered or unexported fields
}

CreateSignatureOperation manages a long-running operation from CreateSignature.

func (*CreateSignatureOperation) Done

func (op *CreateSignatureOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*CreateSignatureOperation) Metadata

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*CreateSignatureOperation) Name

func (op *CreateSignatureOperation) Name() string

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*CreateSignatureOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*CreateSignatureOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type MPCKeyCallOptions

type MPCKeyCallOptions struct {
	RegisterDevice       []gax.CallOption
	GetDevice            []gax.CallOption
	CreateDeviceGroup    []gax.CallOption
	GetDeviceGroup       []gax.CallOption
	ListMPCOperations    []gax.CallOption
	CreateMPCKey         []gax.CallOption
	GetMPCKey            []gax.CallOption
	CreateSignature      []gax.CallOption
	PrepareDeviceArchive []gax.CallOption
	PrepareDeviceBackup  []gax.CallOption
	AddDevice            []gax.CallOption
	RevokeDevice         []gax.CallOption
}

MPCKeyCallOptions contains the retry settings for each method of MPCKeyClient.

type MPCKeyClient

type MPCKeyClient struct {

	// The call options for this service.
	CallOptions *MPCKeyCallOptions

	// LROClient is used internally to handle long-running operations.
	// It is exposed so that its CallOptions can be modified if required.
	// Users should not Close this client.
	LROClient *lroauto.OperationsClient
	// contains filtered or unexported fields
}

MPCKeyClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

MPCKeyService provides APIs for participating in cryptographic operations through multi-party computation (MPC). It should be be used in conjunction with the client-side WaaS SDK. The cryptographic Keys are created using an underlying hierarchically deterministic (HD) Tree, following the conventions of BIP-32 and BIP-44.

The general flow is as follows:

Call RegisterDevice to enroll the mobile Device.

Call CreateDeviceGroup with the registered Device as its sole member and at least one HardenedChild set on the Seed.

Poll for the pending DeviceGroup with ListMPCOperations and compute the MPCOperation using the WaaS SDK.

Call CreateMPCKey, specifying the created DeviceGroup and desired derivation path.

Call CreateSignature, specifying the created MPCKey and payload.

Poll for the pending Signature with ListMPCOperations and compute the MPCOperation using the SDK.

func NewMPCKeyClient

func NewMPCKeyClient(ctx context.Context, opts ...option.ClientOption) (*MPCKeyClient, error)

NewMPCKeyClient creates a new mpc key service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

MPCKeyService provides APIs for participating in cryptographic operations through multi-party computation (MPC). It should be be used in conjunction with the client-side WaaS SDK. The cryptographic Keys are created using an underlying hierarchically deterministic (HD) Tree, following the conventions of BIP-32 and BIP-44.

The general flow is as follows:

Call RegisterDevice to enroll the mobile Device.

Call CreateDeviceGroup with the registered Device as its sole member and at least one HardenedChild set on the Seed.

Poll for the pending DeviceGroup with ListMPCOperations and compute the MPCOperation using the WaaS SDK.

Call CreateMPCKey, specifying the created DeviceGroup and desired derivation path.

Call CreateSignature, specifying the created MPCKey and payload.

Poll for the pending Signature with ListMPCOperations and compute the MPCOperation using the SDK.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func NewMPCKeyRESTClient

func NewMPCKeyRESTClient(ctx context.Context, opts ...option.ClientOption) (*MPCKeyClient, error)

NewMPCKeyRESTClient creates a new mpc key service rest client.

MPCKeyService provides APIs for participating in cryptographic operations through multi-party computation (MPC). It should be be used in conjunction with the client-side WaaS SDK. The cryptographic Keys are created using an underlying hierarchically deterministic (HD) Tree, following the conventions of BIP-32 and BIP-44.

The general flow is as follows:

Call RegisterDevice to enroll the mobile Device.

Call CreateDeviceGroup with the registered Device as its sole member and at least one HardenedChild set on the Seed.

Poll for the pending DeviceGroup with ListMPCOperations and compute the MPCOperation using the WaaS SDK.

Call CreateMPCKey, specifying the created DeviceGroup and desired derivation path.

Call CreateSignature, specifying the created MPCKey and payload.

Poll for the pending Signature with ListMPCOperations and compute the MPCOperation using the SDK.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func (*MPCKeyClient) AddDevice

AddDevice adds a Device to an existing DeviceGroup. Prior to this API being called, the Device must be registered using RegisterDevice RPC. The Device must have access to the backup created with PrepareDeviceBackup RPC to compute this operation. After calling this RPC, use ListMPCOperations to poll for the pending AddDevice operation, and use the WaaS SDK’s ComputeAddDeviceMPCOperation to complete the operation. After the operation is computed on WaaS SDK, the Device will have access to cryptographic materials required to process MPCOperations for this DeviceGroup. Once the operation completes on MPCKeyService, the Device will be added to the given DeviceGroup as a new member and all existing Devices in the DeviceGroup will stay functional. Use the RevokeDevice RPC to remove any of the existing Devices from the DeviceGroup. Note: because the creation of MPC operations is asynchronous, ListMPCOperations may return a NOT_FOUND error immediately after calling this. To complete the operation, continue polling ListMPCOperations even after it returns a NOT_FOUND error.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.AddDeviceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#AddDeviceRequest.
	}
	op, err := c.AddDevice(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) AddDeviceOperation

func (c *MPCKeyClient) AddDeviceOperation(name string) *AddDeviceOperation

AddDeviceOperation returns a new AddDeviceOperation from a given name. The name must be that of a previously created AddDeviceOperation, possibly from a different process.

func (*MPCKeyClient) Close

func (c *MPCKeyClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*MPCKeyClient) Connection deprecated

func (c *MPCKeyClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*MPCKeyClient) CreateDeviceGroup

CreateDeviceGroup creates a DeviceGroup. The DeviceGroup must contain exactly one registered Device, and the Seed in the DeviceGroup must have at least one HardenedChild. After calling this, use ListMPCOperations to poll for the pending CreateDeviceGroup operation, and use the WaaS SDK’s ComputeMPCOperation to complete the operation. Note: because the creation of MPC operations is asynchronous, ListMPCOperations may return a NOT_FOUND error immediately after calling this. To complete the operation, continue polling ListMPCOperations even after it returns a NOT_FOUND error.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.CreateDeviceGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#CreateDeviceGroupRequest.
	}
	op, err := c.CreateDeviceGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) CreateDeviceGroupOperation

func (c *MPCKeyClient) CreateDeviceGroupOperation(name string) *CreateDeviceGroupOperation

CreateDeviceGroupOperation returns a new CreateDeviceGroupOperation from a given name. The name must be that of a previously created CreateDeviceGroupOperation, possibly from a different process.

func (*MPCKeyClient) CreateMPCKey

CreateMPCKey creates an MPCKey. There must be a HardenedChild in the Seed of the parent DeviceGroup which is a prefix of the derivation path provided in the MPCKey.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.CreateMPCKeyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#CreateMPCKeyRequest.
	}
	resp, err := c.CreateMPCKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) CreateSignature

CreateSignature creates a Signature using an MPCKey. After calling this, use ListMPCOperations to poll for the pending CreateSignature operation, and use the WaaS SDK’s computeMPCOperation to complete the operation. Note: because the creation of MPC operations is asynchronous, ListMPCOperations may return a NOT_FOUND error immediately after calling this. To complete the operation, continue polling ListMPCOperations even after it returns a NOT_FOUND error.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.CreateSignatureRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#CreateSignatureRequest.
	}
	op, err := c.CreateSignature(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) CreateSignatureOperation

func (c *MPCKeyClient) CreateSignatureOperation(name string) *CreateSignatureOperation

CreateSignatureOperation returns a new CreateSignatureOperation from a given name. The name must be that of a previously created CreateSignatureOperation, possibly from a different process.

func (*MPCKeyClient) GetDevice

GetDevice retrieves a Device by resource name.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.GetDeviceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#GetDeviceRequest.
	}
	resp, err := c.GetDevice(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) GetDeviceGroup

GetDeviceGroup retrieves a DeviceGroup by resource name.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.GetDeviceGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#GetDeviceGroupRequest.
	}
	resp, err := c.GetDeviceGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) GetMPCKey

GetMPCKey retrieves an MPCKey by resource name.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.GetMPCKeyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#GetMPCKeyRequest.
	}
	resp, err := c.GetMPCKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) ListMPCOperations

ListMPCOperations lists the pending MPCOperations awaiting computation associated with the given parent DeviceGroup. Use this API in combination with the WaaS SDK’s computeMPCOperation method to complete the operation.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.ListMPCOperationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#ListMPCOperationsRequest.
	}
	resp, err := c.ListMPCOperations(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) PrepareDeviceArchive

PrepareDeviceArchive prepares an archive in the local storage of the given Device. The archive contains cryptographic materials that can be used to export MPCKeys, which have the given DeviceGroup as their parent. The Device specified in the request must be a member of this DeviceGroup and must participate in the associated MPC operation for the archive to be prepared. After calling this, use ListMPCOperations to poll for the pending PrepareDeviceArchive operation, and use the WaaS SDK’s ComputeMPCOperation to complete the operation. Once the operation completes, the Device can utilize the WaaS SDK to export the private keys corresponding to each of the MPCKeys under this DeviceGroup. Note: because the creation of MPC operations is asynchronous, ListMPCOperations may return a NOT_FOUND error immediately after calling this. To complete the operation, continue polling ListMPCOperations even after it returns a NOT_FOUND error.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.PrepareDeviceArchiveRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#PrepareDeviceArchiveRequest.
	}
	op, err := c.PrepareDeviceArchive(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) PrepareDeviceArchiveOperation

func (c *MPCKeyClient) PrepareDeviceArchiveOperation(name string) *PrepareDeviceArchiveOperation

PrepareDeviceArchiveOperation returns a new PrepareDeviceArchiveOperation from a given name. The name must be that of a previously created PrepareDeviceArchiveOperation, possibly from a different process.

func (*MPCKeyClient) PrepareDeviceBackup

PrepareDeviceBackup prepares a backup in the given Device. The backup contains certain cryptographic materials that can be used to restore MPCKeys, which have the given DeviceGroup as their parent, on a new Device. The Device specified in the request must be a member of this DeviceGroup and must participate in the associated MPC operation for the backup to be prepared. After calling this RPC, use ListMPCOperations to poll for the pending PrepareDeviceBackup operation, and use the WaaS SDK’s ComputeMPCOperation to complete the operation. Once the operation completes, the Device can utilize WaaS SDK to download the backup bundle. We recommend storing this backup bundle securely in a storage provider of your choice. If the user loses access to their existing Device and wants to recover MPCKeys in the given DeviceGroup on a new Device, use AddDevice RPC on the MPCKeyService. Note: because the creation of MPC operations is asynchronous, ListMPCOperations may return a NOT_FOUND error immediately after calling this. To complete the operation, continue polling ListMPCOperations even after it returns a NOT_FOUND error.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.PrepareDeviceBackupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#PrepareDeviceBackupRequest.
	}
	op, err := c.PrepareDeviceBackup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) PrepareDeviceBackupOperation

func (c *MPCKeyClient) PrepareDeviceBackupOperation(name string) *PrepareDeviceBackupOperation

PrepareDeviceBackupOperation returns a new PrepareDeviceBackupOperation from a given name. The name must be that of a previously created PrepareDeviceBackupOperation, possibly from a different process.

func (*MPCKeyClient) RegisterDevice

RegisterDevice registers a new Device. A Device must be registered before it can be added to a DeviceGroup.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.RegisterDeviceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#RegisterDeviceRequest.
	}
	resp, err := c.RegisterDevice(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCKeyClient) RevokeDevice

func (c *MPCKeyClient) RevokeDevice(ctx context.Context, req *mpc_keyspb.RevokeDeviceRequest, opts ...gax.CallOption) error

RevokeDevice revokes a registered Device. This operation removes the registered Device from all the DeviceGroups that it is a part of. Once the Device is revoked, cryptographic materials in your physical Device are invalidated, and the Device can no longer participate in any MPCOperations of the DeviceGroups it was a part of. Use this API in scenarios such as losing the existing Device, switching to a new physical Device, etc. Ensure that a new Device is successfully added to your DeviceGroups using the AddDevice RPC before invoking the RevokeDevice RPC.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_keyspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCKeyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_keyspb.RevokeDeviceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_keys/v1#RevokeDeviceRequest.
	}
	err = c.RevokeDevice(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

type MPCTransactionCallOptions

type MPCTransactionCallOptions struct {
	CreateMPCTransaction []gax.CallOption
	GetMPCTransaction    []gax.CallOption
	ListMPCTransactions  []gax.CallOption
}

MPCTransactionCallOptions contains the retry settings for each method of MPCTransactionClient.

type MPCTransactionClient

type MPCTransactionClient struct {

	// The call options for this service.
	CallOptions *MPCTransactionCallOptions

	// LROClient is used internally to handle long-running operations.
	// It is exposed so that its CallOptions can be modified if required.
	// Users should not Close this client.
	LROClient *lroauto.OperationsClient
	// contains filtered or unexported fields
}

MPCTransactionClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service that orchestrates on-chain transactions originating from MPCWallets. The service handles nonce management, transaction construction, signing, broadcasting, and confirmation detection including on-chain re-organizations.

func NewMPCTransactionClient

func NewMPCTransactionClient(ctx context.Context, opts ...option.ClientOption) (*MPCTransactionClient, error)

NewMPCTransactionClient creates a new mpc transaction service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

A service that orchestrates on-chain transactions originating from MPCWallets. The service handles nonce management, transaction construction, signing, broadcasting, and confirmation detection including on-chain re-organizations.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCTransactionClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func NewMPCTransactionRESTClient

func NewMPCTransactionRESTClient(ctx context.Context, opts ...option.ClientOption) (*MPCTransactionClient, error)

NewMPCTransactionRESTClient creates a new mpc transaction service rest client.

A service that orchestrates on-chain transactions originating from MPCWallets. The service handles nonce management, transaction construction, signing, broadcasting, and confirmation detection including on-chain re-organizations.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCTransactionRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func (*MPCTransactionClient) Close

func (c *MPCTransactionClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*MPCTransactionClient) Connection deprecated

func (c *MPCTransactionClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*MPCTransactionClient) CreateMPCTransaction

CreateMPCTransaction creates an MPCTransaction. The long-running operation returned from this API contains information about the state of the MPCTransaction that can be used to complete the operation. The LRO is considered Done once the MPCTransaction reaches a state of `CONFIRMING“ (i.e., broadcast on-chain). See the MPCTransaction documentation for its lifecycle. Note: because the creation of MPC operations is asynchronous, ListMPCOperations may return a NOT_FOUND error immediately after calling this. To complete the operation, continue polling ListMPCOperations even after it returns a NOT_FOUND error.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_transactionspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_transactions/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCTransactionClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_transactionspb.CreateMPCTransactionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_transactions/v1#CreateMPCTransactionRequest.
	}
	op, err := c.CreateMPCTransaction(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCTransactionClient) CreateMPCTransactionOperation

func (c *MPCTransactionClient) CreateMPCTransactionOperation(name string) *CreateMPCTransactionOperation

CreateMPCTransactionOperation returns a new CreateMPCTransactionOperation from a given name. The name must be that of a previously created CreateMPCTransactionOperation, possibly from a different process.

func (*MPCTransactionClient) GetMPCTransaction

GetMPCTransaction gets an MPCTransaction. There can be a delay between when CreateMPCTransaction is called and when this API returns an MPCTransaction in the CREATED state.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_transactionspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_transactions/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCTransactionClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_transactionspb.GetMPCTransactionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_transactions/v1#GetMPCTransactionRequest.
	}
	resp, err := c.GetMPCTransaction(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCTransactionClient) ListMPCTransactions

ListMPCTransactions returns a list of MPCTransactions in an MPCWallet.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_transactionspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_transactions/v1"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCTransactionClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_transactionspb.ListMPCTransactionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_transactions/v1#ListMPCTransactionsRequest.
	}
	it := c.ListMPCTransactions(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

type MPCTransactionIterator

type MPCTransactionIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*mpc_transactionspb.MPCTransaction, nextPageToken string, err error)
	// contains filtered or unexported fields
}

MPCTransactionIterator manages a stream of *mpc_transactionspb.MPCTransaction.

func (*MPCTransactionIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*MPCTransactionIterator) PageInfo

func (it *MPCTransactionIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type MPCWalletCallOptions

type MPCWalletCallOptions struct {
	CreateMPCWallet    []gax.CallOption
	GetMPCWallet       []gax.CallOption
	ListMPCWallets     []gax.CallOption
	GenerateAddress    []gax.CallOption
	GetAddress         []gax.CallOption
	ListAddresses      []gax.CallOption
	ListBalances       []gax.CallOption
	ListBalanceDetails []gax.CallOption
}

MPCWalletCallOptions contains the retry settings for each method of MPCWalletClient.

type MPCWalletClient

type MPCWalletClient struct {

	// The call options for this service.
	CallOptions *MPCWalletCallOptions

	// LROClient is used internally to handle long-running operations.
	// It is exposed so that its CallOptions can be modified if required.
	// Users should not Close this client.
	LROClient *lroauto.OperationsClient
	// contains filtered or unexported fields
}

MPCWalletClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service that manages BIP-32-based Hierarchically Deterministic (HD) collections of on-chain Addresses and their associated Asset balances. The Addresses are backed by the MPCKey resources of KeyService, and information about the Assets can be queried using BlockchainService. Because of the backing by MPC Keys, full functionality of these APIs requires use of the WaaS SDK.

func NewMPCWalletClient

func NewMPCWalletClient(ctx context.Context, opts ...option.ClientOption) (*MPCWalletClient, error)

NewMPCWalletClient creates a new mpc wallet service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

A service that manages BIP-32-based Hierarchically Deterministic (HD) collections of on-chain Addresses and their associated Asset balances. The Addresses are backed by the MPCKey resources of KeyService, and information about the Assets can be queried using BlockchainService. Because of the backing by MPC Keys, full functionality of these APIs requires use of the WaaS SDK.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func NewMPCWalletRESTClient

func NewMPCWalletRESTClient(ctx context.Context, opts ...option.ClientOption) (*MPCWalletClient, error)

NewMPCWalletRESTClient creates a new mpc wallet service rest client.

A service that manages BIP-32-based Hierarchically Deterministic (HD) collections of on-chain Addresses and their associated Asset balances. The Addresses are backed by the MPCKey resources of KeyService, and information about the Assets can be queried using BlockchainService. Because of the backing by MPC Keys, full functionality of these APIs requires use of the WaaS SDK.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func (*MPCWalletClient) Close

func (c *MPCWalletClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*MPCWalletClient) Connection deprecated

func (c *MPCWalletClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*MPCWalletClient) CreateMPCWallet

CreateMPCWallet creates an MPCWallet. The Device in the request must have been registered using MPCKeyService’s RegisterDevice before this method is called. Under the hood, this calls MPCKeyService’s CreateDeviceGroup with the appropriate parameters. After calling this, use MPCKeyService’s ListMPCOperations to poll for the pending CreateDeviceGroup operation, and use the WaaS SDK’s computeMPCOperation to complete the operation. Note: because the creation of MPC operations is asynchronous, ListMPCOperations may return a NOT_FOUND error immediately after calling this. To complete the operation, continue polling ListMPCOperations even after it returns a NOT_FOUND error.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_walletspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_walletspb.CreateMPCWalletRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1#CreateMPCWalletRequest.
	}
	op, err := c.CreateMPCWallet(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCWalletClient) CreateMPCWalletOperation

func (c *MPCWalletClient) CreateMPCWalletOperation(name string) *CreateMPCWalletOperation

CreateMPCWalletOperation returns a new CreateMPCWalletOperation from a given name. The name must be that of a previously created CreateMPCWalletOperation, possibly from a different process.

func (*MPCWalletClient) GenerateAddress

GenerateAddress generates an Address within an MPCWallet. The Address values generated are identical across Networks of the same protocol family (e.g. EVM). So, for example, calling GenerateAddress twice for networks/ethereum-mainnet, and then calling it twice more for networks/ethereum-goerli, will result in two pairs of identical addresses on Ethereum Mainnet and Goerli.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_walletspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_walletspb.GenerateAddressRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1#GenerateAddressRequest.
	}
	resp, err := c.GenerateAddress(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCWalletClient) GetAddress

GetAddress retrieves an Address by resource name.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_walletspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_walletspb.GetAddressRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1#GetAddressRequest.
	}
	resp, err := c.GetAddress(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCWalletClient) GetMPCWallet

GetMPCWallet retrieves an MPCWallet by resource name.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_walletspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_walletspb.GetMPCWalletRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1#GetMPCWalletRequest.
	}
	resp, err := c.GetMPCWallet(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MPCWalletClient) ListAddresses

ListAddresses returns a list of Addresses in an MPCWallet.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_walletspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_walletspb.ListAddressesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1#ListAddressesRequest.
	}
	it := c.ListAddresses(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*MPCWalletClient) ListBalanceDetails

ListBalanceDetails returns a list of BalanceDetails.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_walletspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_walletspb.ListBalanceDetailsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1#ListBalanceDetailsRequest.
	}
	it := c.ListBalanceDetails(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*MPCWalletClient) ListBalances

ListBalances returns a list of Balances.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_walletspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_walletspb.ListBalancesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1#ListBalancesRequest.
	}
	it := c.ListBalances(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*MPCWalletClient) ListMPCWallets

ListMPCWallets returns a list of MPCWallets in a Pool.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	mpc_walletspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewMPCWalletClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mpc_walletspb.ListMPCWalletsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/mpc_wallets/v1#ListMPCWalletsRequest.
	}
	it := c.ListMPCWallets(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

type MPCWalletIterator

type MPCWalletIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*mpc_walletspb.MPCWallet, nextPageToken string, err error)
	// contains filtered or unexported fields
}

MPCWalletIterator manages a stream of *mpc_walletspb.MPCWallet.

func (*MPCWalletIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*MPCWalletIterator) PageInfo

func (it *MPCWalletIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type NetworkIterator

type NetworkIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*blockchainpb.Network, nextPageToken string, err error)
	// contains filtered or unexported fields
}

NetworkIterator manages a stream of *blockchainpb.Network.

func (*NetworkIterator) Next

func (it *NetworkIterator) Next() (*blockchainpb.Network, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*NetworkIterator) PageInfo

func (it *NetworkIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type PoolCallOptions

type PoolCallOptions struct {
	CreatePool []gax.CallOption
	GetPool    []gax.CallOption
	ListPools  []gax.CallOption
}

PoolCallOptions contains the retry settings for each method of PoolClient.

type PoolClient

type PoolClient struct {

	// The call options for this service.
	CallOptions *PoolCallOptions
	// contains filtered or unexported fields
}

PoolClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service for managing the Pool resource. A Pool is a top-level container for segregating the resources under it via authorization checks. Pool-scoped resources require a Pool to be created before they themselves can be created.

func NewPoolClient

func NewPoolClient(ctx context.Context, opts ...option.ClientOption) (*PoolClient, error)

NewPoolClient creates a new pool service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

A service for managing the Pool resource. A Pool is a top-level container for segregating the resources under it via authorization checks. Pool-scoped resources require a Pool to be created before they themselves can be created.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewPoolClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func NewPoolRESTClient

func NewPoolRESTClient(ctx context.Context, opts ...option.ClientOption) (*PoolClient, error)

NewPoolRESTClient creates a new pool service rest client.

A service for managing the Pool resource. A Pool is a top-level container for segregating the resources under it via authorization checks. Pool-scoped resources require a Pool to be created before they themselves can be created.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewPoolRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func (*PoolClient) Close

func (c *PoolClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*PoolClient) Connection deprecated

func (c *PoolClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*PoolClient) CreatePool

func (c *PoolClient) CreatePool(ctx context.Context, req *poolspb.CreatePoolRequest, opts ...gax.CallOption) (*poolspb.Pool, error)

CreatePool creates a Pool. Invoke CreatePool before creating a Pool-scoped resource so that you can specify the Pool as the parent of the new resource.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	poolspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/pools/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewPoolClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &poolspb.CreatePoolRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/pools/v1#CreatePoolRequest.
	}
	resp, err := c.CreatePool(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*PoolClient) GetPool

func (c *PoolClient) GetPool(ctx context.Context, req *poolspb.GetPoolRequest, opts ...gax.CallOption) (*poolspb.Pool, error)

GetPool retrieves a Pool by resource name.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	poolspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/pools/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewPoolClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &poolspb.GetPoolRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/pools/v1#GetPoolRequest.
	}
	resp, err := c.GetPool(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*PoolClient) ListPools

func (c *PoolClient) ListPools(ctx context.Context, req *poolspb.ListPoolsRequest, opts ...gax.CallOption) *PoolIterator

ListPools returns a list of Pools.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	poolspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/pools/v1"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewPoolClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &poolspb.ListPoolsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/pools/v1#ListPoolsRequest.
	}
	it := c.ListPools(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

type PoolIterator

type PoolIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*poolspb.Pool, nextPageToken string, err error)
	// contains filtered or unexported fields
}

PoolIterator manages a stream of *poolspb.Pool.

func (*PoolIterator) Next

func (it *PoolIterator) Next() (*poolspb.Pool, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*PoolIterator) PageInfo

func (it *PoolIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type PrepareDeviceArchiveOperation

type PrepareDeviceArchiveOperation struct {
	// contains filtered or unexported fields
}

PrepareDeviceArchiveOperation manages a long-running operation from PrepareDeviceArchive.

func (*PrepareDeviceArchiveOperation) Done

Done reports whether the long-running operation has completed.

func (*PrepareDeviceArchiveOperation) Metadata

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*PrepareDeviceArchiveOperation) Name

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*PrepareDeviceArchiveOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*PrepareDeviceArchiveOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type PrepareDeviceBackupOperation

type PrepareDeviceBackupOperation struct {
	// contains filtered or unexported fields
}

PrepareDeviceBackupOperation manages a long-running operation from PrepareDeviceBackup.

func (*PrepareDeviceBackupOperation) Done

Done reports whether the long-running operation has completed.

func (*PrepareDeviceBackupOperation) Metadata

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*PrepareDeviceBackupOperation) Name

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*PrepareDeviceBackupOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*PrepareDeviceBackupOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type ProtocolCallOptions

type ProtocolCallOptions struct {
	ConstructTransaction         []gax.CallOption
	ConstructTransferTransaction []gax.CallOption
	BroadcastTransaction         []gax.CallOption
	EstimateFee                  []gax.CallOption
}

ProtocolCallOptions contains the retry settings for each method of ProtocolClient.

type ProtocolClient

type ProtocolClient struct {

	// The call options for this service.
	CallOptions *ProtocolCallOptions
	// contains filtered or unexported fields
}

ProtocolClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service providing a set of stateless APIs for constructing and broadcasting Network-specific transactions.

func NewProtocolClient

func NewProtocolClient(ctx context.Context, opts ...option.ClientOption) (*ProtocolClient, error)

NewProtocolClient creates a new protocol service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

A service providing a set of stateless APIs for constructing and broadcasting Network-specific transactions.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewProtocolClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func NewProtocolRESTClient

func NewProtocolRESTClient(ctx context.Context, opts ...option.ClientOption) (*ProtocolClient, error)

NewProtocolRESTClient creates a new protocol service rest client.

A service providing a set of stateless APIs for constructing and broadcasting Network-specific transactions.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewProtocolRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func (*ProtocolClient) BroadcastTransaction

BroadcastTransaction broadcasts a transaction to a node in the Network. There are two ways of invoking this API:

Set the raw_signed_transaction on the Transaction. This is equivalent to the payload used to broadcast transactions via block explorers such as Etherscan. In this case, the TransactionInput does not need to be set on the Transaction.

Set the signature(s) in the required_signatures of the Transaction. In this case, the TransactionInput must also be set on the Transaction. The Transaction returned will have the hash set on it.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	protocolspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/protocols/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewProtocolClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &protocolspb.BroadcastTransactionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/protocols/v1#BroadcastTransactionRequest.
	}
	resp, err := c.BroadcastTransaction(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*ProtocolClient) Close

func (c *ProtocolClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*ProtocolClient) Connection deprecated

func (c *ProtocolClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*ProtocolClient) ConstructTransaction

ConstructTransaction constructs an unsigned transaction. The payloads in the required_signatures of the returned Transaction must be signed before the Transaction is broadcast.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	protocolspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/protocols/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewProtocolClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &protocolspb.ConstructTransactionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/protocols/v1#ConstructTransactionRequest.
	}
	resp, err := c.ConstructTransaction(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*ProtocolClient) ConstructTransferTransaction

func (c *ProtocolClient) ConstructTransferTransaction(ctx context.Context, req *protocolspb.ConstructTransferTransactionRequest, opts ...gax.CallOption) (*typespb.Transaction, error)

ConstructTransferTransaction constructs an unsigned transfer transaction. A transfer transaction is a transaction that moves an Asset from one Address to another. The payloads in the required_signatures of the returned Transaction must be signed before the Transaction is broadcast.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	protocolspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/protocols/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewProtocolClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &protocolspb.ConstructTransferTransactionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/protocols/v1#ConstructTransferTransactionRequest.
	}
	resp, err := c.ConstructTransferTransaction(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*ProtocolClient) EstimateFee

EstimateFee estimates the current network fee for the specified Network. For EVM Networks, this corresponds to the gas_price, max_fee_per_gas, and max_priority_fee_per_gas.

Example
package main

import (
	"context"

	v1 "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/clients/v1"
	protocolspb "github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/protocols/v1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := v1.NewProtocolClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &protocolspb.EstimateFeeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/github.com/coinbase/waas-client-library-go/gen/go/coinbase/cloud/protocols/v1#EstimateFeeRequest.
	}
	resp, err := c.EstimateFee(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL