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 ¶
- func DefaultAuthScopes() []string
- type AddDeviceOperation
- func (op *AddDeviceOperation) Done() bool
- func (op *AddDeviceOperation) Metadata() (*mpc_keyspb.AddDeviceMetadata, error)
- func (op *AddDeviceOperation) Name() string
- func (op *AddDeviceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
- func (op *AddDeviceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
- type AddressIterator
- type AssetIterator
- type BalanceDetailIterator
- type BalanceIterator
- type BlockchainCallOptions
- type BlockchainClient
- func (c *BlockchainClient) BatchGetAssets(ctx context.Context, req *blockchainpb.BatchGetAssetsRequest, ...) (*blockchainpb.BatchGetAssetsResponse, error)
- func (c *BlockchainClient) Close() error
- func (c *BlockchainClient) Connection() *grpc.ClientConndeprecated
- func (c *BlockchainClient) GetAsset(ctx context.Context, req *blockchainpb.GetAssetRequest, opts ...gax.CallOption) (*blockchainpb.Asset, error)
- func (c *BlockchainClient) GetNetwork(ctx context.Context, req *blockchainpb.GetNetworkRequest, ...) (*blockchainpb.Network, error)
- func (c *BlockchainClient) ListAssets(ctx context.Context, req *blockchainpb.ListAssetsRequest, ...) *AssetIterator
- func (c *BlockchainClient) ListNetworks(ctx context.Context, req *blockchainpb.ListNetworksRequest, ...) *NetworkIterator
- type CreateDeviceGroupOperation
- func (op *CreateDeviceGroupOperation) Done() bool
- func (op *CreateDeviceGroupOperation) Metadata() (*mpc_keyspb.CreateDeviceGroupMetadata, error)
- func (op *CreateDeviceGroupOperation) Name() string
- func (op *CreateDeviceGroupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
- func (op *CreateDeviceGroupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
- type CreateMPCTransactionOperation
- func (op *CreateMPCTransactionOperation) Done() bool
- func (op *CreateMPCTransactionOperation) Metadata() (*mpc_transactionspb.CreateMPCTransactionMetadata, error)
- func (op *CreateMPCTransactionOperation) Name() string
- func (op *CreateMPCTransactionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_transactionspb.MPCTransaction, error)
- func (op *CreateMPCTransactionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_transactionspb.MPCTransaction, error)
- type CreateMPCWalletOperation
- func (op *CreateMPCWalletOperation) Done() bool
- func (op *CreateMPCWalletOperation) Metadata() (*mpc_walletspb.CreateMPCWalletMetadata, error)
- func (op *CreateMPCWalletOperation) Name() string
- func (op *CreateMPCWalletOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_walletspb.MPCWallet, error)
- func (op *CreateMPCWalletOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_walletspb.MPCWallet, error)
- type CreateSignatureOperation
- func (op *CreateSignatureOperation) Done() bool
- func (op *CreateSignatureOperation) Metadata() (*mpc_keyspb.CreateSignatureMetadata, error)
- func (op *CreateSignatureOperation) Name() string
- func (op *CreateSignatureOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.Signature, error)
- func (op *CreateSignatureOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.Signature, error)
- type MPCKeyCallOptions
- type MPCKeyClient
- func (c *MPCKeyClient) AddDevice(ctx context.Context, req *mpc_keyspb.AddDeviceRequest, opts ...gax.CallOption) (*AddDeviceOperation, error)
- func (c *MPCKeyClient) AddDeviceOperation(name string) *AddDeviceOperation
- func (c *MPCKeyClient) Close() error
- func (c *MPCKeyClient) Connection() *grpc.ClientConndeprecated
- func (c *MPCKeyClient) CreateDeviceGroup(ctx context.Context, req *mpc_keyspb.CreateDeviceGroupRequest, ...) (*CreateDeviceGroupOperation, error)
- func (c *MPCKeyClient) CreateDeviceGroupOperation(name string) *CreateDeviceGroupOperation
- func (c *MPCKeyClient) CreateMPCKey(ctx context.Context, req *mpc_keyspb.CreateMPCKeyRequest, ...) (*mpc_keyspb.MPCKey, error)
- func (c *MPCKeyClient) CreateSignature(ctx context.Context, req *mpc_keyspb.CreateSignatureRequest, ...) (*CreateSignatureOperation, error)
- func (c *MPCKeyClient) CreateSignatureOperation(name string) *CreateSignatureOperation
- func (c *MPCKeyClient) GetDevice(ctx context.Context, req *mpc_keyspb.GetDeviceRequest, opts ...gax.CallOption) (*mpc_keyspb.Device, error)
- func (c *MPCKeyClient) GetDeviceGroup(ctx context.Context, req *mpc_keyspb.GetDeviceGroupRequest, ...) (*mpc_keyspb.DeviceGroup, error)
- func (c *MPCKeyClient) GetMPCKey(ctx context.Context, req *mpc_keyspb.GetMPCKeyRequest, opts ...gax.CallOption) (*mpc_keyspb.MPCKey, error)
- func (c *MPCKeyClient) ListMPCOperations(ctx context.Context, req *mpc_keyspb.ListMPCOperationsRequest, ...) (*mpc_keyspb.ListMPCOperationsResponse, error)
- func (c *MPCKeyClient) PrepareDeviceArchive(ctx context.Context, req *mpc_keyspb.PrepareDeviceArchiveRequest, ...) (*PrepareDeviceArchiveOperation, error)
- func (c *MPCKeyClient) PrepareDeviceArchiveOperation(name string) *PrepareDeviceArchiveOperation
- func (c *MPCKeyClient) PrepareDeviceBackup(ctx context.Context, req *mpc_keyspb.PrepareDeviceBackupRequest, ...) (*PrepareDeviceBackupOperation, error)
- func (c *MPCKeyClient) PrepareDeviceBackupOperation(name string) *PrepareDeviceBackupOperation
- func (c *MPCKeyClient) RegisterDevice(ctx context.Context, req *mpc_keyspb.RegisterDeviceRequest, ...) (*mpc_keyspb.Device, error)
- func (c *MPCKeyClient) RevokeDevice(ctx context.Context, req *mpc_keyspb.RevokeDeviceRequest, ...) error
- type MPCTransactionCallOptions
- type MPCTransactionClient
- func (c *MPCTransactionClient) Close() error
- func (c *MPCTransactionClient) Connection() *grpc.ClientConndeprecated
- func (c *MPCTransactionClient) CreateMPCTransaction(ctx context.Context, req *mpc_transactionspb.CreateMPCTransactionRequest, ...) (*CreateMPCTransactionOperation, error)
- func (c *MPCTransactionClient) CreateMPCTransactionOperation(name string) *CreateMPCTransactionOperation
- func (c *MPCTransactionClient) GetMPCTransaction(ctx context.Context, req *mpc_transactionspb.GetMPCTransactionRequest, ...) (*mpc_transactionspb.MPCTransaction, error)
- func (c *MPCTransactionClient) ListMPCTransactions(ctx context.Context, req *mpc_transactionspb.ListMPCTransactionsRequest, ...) *MPCTransactionIterator
- type MPCTransactionIterator
- type MPCWalletCallOptions
- type MPCWalletClient
- func (c *MPCWalletClient) Close() error
- func (c *MPCWalletClient) Connection() *grpc.ClientConndeprecated
- func (c *MPCWalletClient) CreateMPCWallet(ctx context.Context, req *mpc_walletspb.CreateMPCWalletRequest, ...) (*CreateMPCWalletOperation, error)
- func (c *MPCWalletClient) CreateMPCWalletOperation(name string) *CreateMPCWalletOperation
- func (c *MPCWalletClient) GenerateAddress(ctx context.Context, req *mpc_walletspb.GenerateAddressRequest, ...) (*mpc_walletspb.Address, error)
- func (c *MPCWalletClient) GetAddress(ctx context.Context, req *mpc_walletspb.GetAddressRequest, ...) (*mpc_walletspb.Address, error)
- func (c *MPCWalletClient) GetMPCWallet(ctx context.Context, req *mpc_walletspb.GetMPCWalletRequest, ...) (*mpc_walletspb.MPCWallet, error)
- func (c *MPCWalletClient) ListAddresses(ctx context.Context, req *mpc_walletspb.ListAddressesRequest, ...) *AddressIterator
- func (c *MPCWalletClient) ListBalanceDetails(ctx context.Context, req *mpc_walletspb.ListBalanceDetailsRequest, ...) *BalanceDetailIterator
- func (c *MPCWalletClient) ListBalances(ctx context.Context, req *mpc_walletspb.ListBalancesRequest, ...) *BalanceIterator
- func (c *MPCWalletClient) ListMPCWallets(ctx context.Context, req *mpc_walletspb.ListMPCWalletsRequest, ...) *MPCWalletIterator
- type MPCWalletIterator
- type NetworkIterator
- type PoolCallOptions
- type PoolClient
- func (c *PoolClient) Close() error
- func (c *PoolClient) Connection() *grpc.ClientConndeprecated
- func (c *PoolClient) CreatePool(ctx context.Context, req *poolspb.CreatePoolRequest, opts ...gax.CallOption) (*poolspb.Pool, error)
- func (c *PoolClient) GetPool(ctx context.Context, req *poolspb.GetPoolRequest, opts ...gax.CallOption) (*poolspb.Pool, error)
- func (c *PoolClient) ListPools(ctx context.Context, req *poolspb.ListPoolsRequest, opts ...gax.CallOption) *PoolIterator
- type PoolIterator
- type PrepareDeviceArchiveOperation
- func (op *PrepareDeviceArchiveOperation) Done() bool
- func (op *PrepareDeviceArchiveOperation) Metadata() (*mpc_keyspb.PrepareDeviceArchiveMetadata, error)
- func (op *PrepareDeviceArchiveOperation) Name() string
- func (op *PrepareDeviceArchiveOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
- func (op *PrepareDeviceArchiveOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
- type PrepareDeviceBackupOperation
- func (op *PrepareDeviceBackupOperation) Done() bool
- func (op *PrepareDeviceBackupOperation) Metadata() (*mpc_keyspb.PrepareDeviceBackupMetadata, error)
- func (op *PrepareDeviceBackupOperation) Name() string
- func (op *PrepareDeviceBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
- func (op *PrepareDeviceBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
- type ProtocolCallOptions
- type ProtocolClient
- func (c *ProtocolClient) BroadcastTransaction(ctx context.Context, req *protocolspb.BroadcastTransactionRequest, ...) (*typespb.Transaction, error)
- func (c *ProtocolClient) Close() error
- func (c *ProtocolClient) Connection() *grpc.ClientConndeprecated
- func (c *ProtocolClient) ConstructTransaction(ctx context.Context, req *protocolspb.ConstructTransactionRequest, ...) (*typespb.Transaction, error)
- func (c *ProtocolClient) ConstructTransferTransaction(ctx context.Context, req *protocolspb.ConstructTransferTransactionRequest, ...) (*typespb.Transaction, error)
- func (c *ProtocolClient) EstimateFee(ctx context.Context, req *protocolspb.EstimateFeeRequest, ...) (*protocolspb.EstimateFeeResponse, error)
Examples ¶
- BlockchainClient.BatchGetAssets
- BlockchainClient.GetAsset
- BlockchainClient.GetNetwork
- BlockchainClient.ListAssets
- BlockchainClient.ListNetworks
- MPCKeyClient.AddDevice
- MPCKeyClient.CreateDeviceGroup
- MPCKeyClient.CreateMPCKey
- MPCKeyClient.CreateSignature
- MPCKeyClient.GetDevice
- MPCKeyClient.GetDeviceGroup
- MPCKeyClient.GetMPCKey
- MPCKeyClient.ListMPCOperations
- MPCKeyClient.PrepareDeviceArchive
- MPCKeyClient.PrepareDeviceBackup
- MPCKeyClient.RegisterDevice
- MPCKeyClient.RevokeDevice
- MPCTransactionClient.CreateMPCTransaction
- MPCTransactionClient.GetMPCTransaction
- MPCTransactionClient.ListMPCTransactions
- MPCWalletClient.CreateMPCWallet
- MPCWalletClient.GenerateAddress
- MPCWalletClient.GetAddress
- MPCWalletClient.GetMPCWallet
- MPCWalletClient.ListAddresses
- MPCWalletClient.ListBalanceDetails
- MPCWalletClient.ListBalances
- MPCWalletClient.ListMPCWallets
- NewBlockchainClient
- NewBlockchainRESTClient
- NewMPCKeyClient
- NewMPCKeyRESTClient
- NewMPCTransactionClient
- NewMPCTransactionRESTClient
- NewMPCWalletClient
- NewMPCWalletRESTClient
- NewPoolClient
- NewPoolRESTClient
- NewProtocolClient
- NewProtocolRESTClient
- PoolClient.CreatePool
- PoolClient.GetPool
- PoolClient.ListPools
- ProtocolClient.BroadcastTransaction
- ProtocolClient.ConstructTransaction
- ProtocolClient.ConstructTransferTransaction
- ProtocolClient.EstimateFee
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 ¶
func (op *AddDeviceOperation) Metadata() (*mpc_keyspb.AddDeviceMetadata, error)
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 ¶
func (op *AddDeviceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
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 ¶
func (op *AddDeviceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
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 ¶
func (it *BalanceDetailIterator) Next() (*mpc_walletspb.BalanceDetail, 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 (*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 ¶
func (c *BlockchainClient) BatchGetAssets(ctx context.Context, req *blockchainpb.BatchGetAssetsRequest, opts ...gax.CallOption) (*blockchainpb.BatchGetAssetsResponse, error)
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 ¶
func (c *BlockchainClient) GetAsset(ctx context.Context, req *blockchainpb.GetAssetRequest, opts ...gax.CallOption) (*blockchainpb.Asset, error)
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 ¶
func (c *BlockchainClient) GetNetwork(ctx context.Context, req *blockchainpb.GetNetworkRequest, opts ...gax.CallOption) (*blockchainpb.Network, error)
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 ¶
func (c *BlockchainClient) ListAssets(ctx context.Context, req *blockchainpb.ListAssetsRequest, opts ...gax.CallOption) *AssetIterator
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 ¶
func (c *BlockchainClient) ListNetworks(ctx context.Context, req *blockchainpb.ListNetworksRequest, opts ...gax.CallOption) *NetworkIterator
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 ¶
func (op *CreateDeviceGroupOperation) Metadata() (*mpc_keyspb.CreateDeviceGroupMetadata, error)
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 ¶
func (op *CreateDeviceGroupOperation) 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 (*CreateDeviceGroupOperation) Poll ¶
func (op *CreateDeviceGroupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
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 ¶
func (op *CreateDeviceGroupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
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 ¶
func (op *CreateMPCTransactionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateMPCTransactionOperation) Metadata ¶
func (op *CreateMPCTransactionOperation) Metadata() (*mpc_transactionspb.CreateMPCTransactionMetadata, error)
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 ¶
func (op *CreateMPCTransactionOperation) 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 (*CreateMPCTransactionOperation) Poll ¶
func (op *CreateMPCTransactionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_transactionspb.MPCTransaction, error)
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 ¶
func (op *CreateMPCTransactionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_transactionspb.MPCTransaction, error)
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 ¶
func (op *CreateMPCWalletOperation) Metadata() (*mpc_walletspb.CreateMPCWalletMetadata, error)
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 ¶
func (op *CreateMPCWalletOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_walletspb.MPCWallet, error)
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 ¶
func (op *CreateMPCWalletOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_walletspb.MPCWallet, error)
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 ¶
func (op *CreateSignatureOperation) Metadata() (*mpc_keyspb.CreateSignatureMetadata, error)
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 ¶
func (op *CreateSignatureOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.Signature, error)
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 ¶
func (op *CreateSignatureOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.Signature, error)
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 ¶
func (c *MPCKeyClient) AddDevice(ctx context.Context, req *mpc_keyspb.AddDeviceRequest, opts ...gax.CallOption) (*AddDeviceOperation, error)
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 ¶
func (c *MPCKeyClient) CreateDeviceGroup(ctx context.Context, req *mpc_keyspb.CreateDeviceGroupRequest, opts ...gax.CallOption) (*CreateDeviceGroupOperation, error)
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 ¶
func (c *MPCKeyClient) CreateMPCKey(ctx context.Context, req *mpc_keyspb.CreateMPCKeyRequest, opts ...gax.CallOption) (*mpc_keyspb.MPCKey, error)
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 ¶
func (c *MPCKeyClient) CreateSignature(ctx context.Context, req *mpc_keyspb.CreateSignatureRequest, opts ...gax.CallOption) (*CreateSignatureOperation, error)
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 ¶
func (c *MPCKeyClient) GetDevice(ctx context.Context, req *mpc_keyspb.GetDeviceRequest, opts ...gax.CallOption) (*mpc_keyspb.Device, error)
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 ¶
func (c *MPCKeyClient) GetDeviceGroup(ctx context.Context, req *mpc_keyspb.GetDeviceGroupRequest, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
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 ¶
func (c *MPCKeyClient) GetMPCKey(ctx context.Context, req *mpc_keyspb.GetMPCKeyRequest, opts ...gax.CallOption) (*mpc_keyspb.MPCKey, error)
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 ¶
func (c *MPCKeyClient) ListMPCOperations(ctx context.Context, req *mpc_keyspb.ListMPCOperationsRequest, opts ...gax.CallOption) (*mpc_keyspb.ListMPCOperationsResponse, error)
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 ¶
func (c *MPCKeyClient) PrepareDeviceArchive(ctx context.Context, req *mpc_keyspb.PrepareDeviceArchiveRequest, opts ...gax.CallOption) (*PrepareDeviceArchiveOperation, error)
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 ¶
func (c *MPCKeyClient) PrepareDeviceBackup(ctx context.Context, req *mpc_keyspb.PrepareDeviceBackupRequest, opts ...gax.CallOption) (*PrepareDeviceBackupOperation, error)
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 ¶
func (c *MPCKeyClient) RegisterDevice(ctx context.Context, req *mpc_keyspb.RegisterDeviceRequest, opts ...gax.CallOption) (*mpc_keyspb.Device, error)
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 ¶
func (c *MPCTransactionClient) CreateMPCTransaction(ctx context.Context, req *mpc_transactionspb.CreateMPCTransactionRequest, opts ...gax.CallOption) (*CreateMPCTransactionOperation, error)
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 ¶
func (c *MPCTransactionClient) GetMPCTransaction(ctx context.Context, req *mpc_transactionspb.GetMPCTransactionRequest, opts ...gax.CallOption) (*mpc_transactionspb.MPCTransaction, error)
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 ¶
func (c *MPCTransactionClient) ListMPCTransactions(ctx context.Context, req *mpc_transactionspb.ListMPCTransactionsRequest, opts ...gax.CallOption) *MPCTransactionIterator
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 ¶
func (it *MPCTransactionIterator) Next() (*mpc_transactionspb.MPCTransaction, 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 (*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 ¶
func (c *MPCWalletClient) CreateMPCWallet(ctx context.Context, req *mpc_walletspb.CreateMPCWalletRequest, opts ...gax.CallOption) (*CreateMPCWalletOperation, error)
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 ¶
func (c *MPCWalletClient) GenerateAddress(ctx context.Context, req *mpc_walletspb.GenerateAddressRequest, opts ...gax.CallOption) (*mpc_walletspb.Address, error)
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 ¶
func (c *MPCWalletClient) GetAddress(ctx context.Context, req *mpc_walletspb.GetAddressRequest, opts ...gax.CallOption) (*mpc_walletspb.Address, error)
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 ¶
func (c *MPCWalletClient) GetMPCWallet(ctx context.Context, req *mpc_walletspb.GetMPCWalletRequest, opts ...gax.CallOption) (*mpc_walletspb.MPCWallet, error)
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 ¶
func (c *MPCWalletClient) ListAddresses(ctx context.Context, req *mpc_walletspb.ListAddressesRequest, opts ...gax.CallOption) *AddressIterator
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 ¶
func (c *MPCWalletClient) ListBalanceDetails(ctx context.Context, req *mpc_walletspb.ListBalanceDetailsRequest, opts ...gax.CallOption) *BalanceDetailIterator
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 ¶
func (c *MPCWalletClient) ListBalances(ctx context.Context, req *mpc_walletspb.ListBalancesRequest, opts ...gax.CallOption) *BalanceIterator
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 ¶
func (c *MPCWalletClient) ListMPCWallets(ctx context.Context, req *mpc_walletspb.ListMPCWalletsRequest, opts ...gax.CallOption) *MPCWalletIterator
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 ¶
func (it *MPCWalletIterator) Next() (*mpc_walletspb.MPCWallet, 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 (*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 ¶
func (op *PrepareDeviceArchiveOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*PrepareDeviceArchiveOperation) Metadata ¶
func (op *PrepareDeviceArchiveOperation) Metadata() (*mpc_keyspb.PrepareDeviceArchiveMetadata, error)
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 ¶
func (op *PrepareDeviceArchiveOperation) 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 (*PrepareDeviceArchiveOperation) Poll ¶
func (op *PrepareDeviceArchiveOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
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 ¶
func (op *PrepareDeviceArchiveOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
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 ¶
func (op *PrepareDeviceBackupOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*PrepareDeviceBackupOperation) Metadata ¶
func (op *PrepareDeviceBackupOperation) Metadata() (*mpc_keyspb.PrepareDeviceBackupMetadata, error)
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 ¶
func (op *PrepareDeviceBackupOperation) 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 (*PrepareDeviceBackupOperation) Poll ¶
func (op *PrepareDeviceBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
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 ¶
func (op *PrepareDeviceBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*mpc_keyspb.DeviceGroup, error)
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 ¶
func (c *ProtocolClient) BroadcastTransaction(ctx context.Context, req *protocolspb.BroadcastTransactionRequest, opts ...gax.CallOption) (*typespb.Transaction, error)
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 ¶
func (c *ProtocolClient) ConstructTransaction(ctx context.Context, req *protocolspb.ConstructTransactionRequest, opts ...gax.CallOption) (*typespb.Transaction, error)
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 ¶
func (c *ProtocolClient) EstimateFee(ctx context.Context, req *protocolspb.EstimateFeeRequest, opts ...gax.CallOption) (*protocolspb.EstimateFeeResponse, error)
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: