v1

package
v1.0.8 Latest Latest
Warning

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

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

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	MPCTransaction_State_name = map[int32]string{
		0: "STATE_UNSPECIFIED",
		1: "CREATED",
		2: "SIGNING",
		3: "SIGNED",
		4: "CONFIRMING",
		5: "CONFIRMED",
		6: "FAILED",
		7: "CANCELLED",
	}
	MPCTransaction_State_value = map[string]int32{
		"STATE_UNSPECIFIED": 0,
		"CREATED":           1,
		"SIGNING":           2,
		"SIGNED":            3,
		"CONFIRMING":        4,
		"CONFIRMED":         5,
		"FAILED":            6,
		"CANCELLED":         7,
	}
)

Enum value maps for MPCTransaction_State.

View Source
var File_coinbase_cloud_mpc_transactions_v1_mpc_transactions_proto protoreflect.FileDescriptor
View Source
var MPCTransactionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "coinbase.cloud.mpc_transactions.v1.MPCTransactionService",
	HandlerType: (*MPCTransactionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateMPCTransaction",
			Handler:    _MPCTransactionService_CreateMPCTransaction_Handler,
		},
		{
			MethodName: "GetMPCTransaction",
			Handler:    _MPCTransactionService_GetMPCTransaction_Handler,
		},
		{
			MethodName: "ListMPCTransactions",
			Handler:    _MPCTransactionService_ListMPCTransactions_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "coinbase/cloud/mpc_transactions/v1/mpc_transactions.proto",
}

MPCTransactionService_ServiceDesc is the grpc.ServiceDesc for MPCTransactionService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterMPCTransactionServiceHandler

func RegisterMPCTransactionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMPCTransactionServiceHandler registers the http handlers for service MPCTransactionService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMPCTransactionServiceHandlerClient

func RegisterMPCTransactionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MPCTransactionServiceClient) error

RegisterMPCTransactionServiceHandlerClient registers the http handlers for service MPCTransactionService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MPCTransactionServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MPCTransactionServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MPCTransactionServiceClient" to call the correct interceptors.

func RegisterMPCTransactionServiceHandlerFromEndpoint

func RegisterMPCTransactionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMPCTransactionServiceHandlerFromEndpoint is same as RegisterMPCTransactionServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMPCTransactionServiceHandlerServer

func RegisterMPCTransactionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MPCTransactionServiceServer) error

RegisterMPCTransactionServiceHandlerServer registers the http handlers for service MPCTransactionService to "mux". UnaryRPC :call MPCTransactionServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMPCTransactionServiceHandlerFromEndpoint instead.

func RegisterMPCTransactionServiceServer

func RegisterMPCTransactionServiceServer(s grpc.ServiceRegistrar, srv MPCTransactionServiceServer)

Types

type CreateMPCTransactionMetadata

type CreateMPCTransactionMetadata struct {

	// The resource name of the DeviceGroup to poll for using ListMPCOperations.
	// Format: pools/{pool_id}/deviceGroups/{device_group_id}
	DeviceGroup string `protobuf:"bytes,1,opt,name=device_group,json=deviceGroup,proto3" json:"device_group,omitempty"`
	// The current state of the MPCTransaction. Once this field is populated,
	// GetMPCTransaction can also be called using the name.
	State MPCTransaction_State `protobuf:"varint,2,opt,name=state,proto3,enum=coinbase.cloud.mpc_transactions.v1.MPCTransaction_State" json:"state,omitempty"`
	// The resource name of the MPCTransaction, if it has been created.
	// Format: pools/{pool_id}/mpcWallets/{mpc_wallet_id}/mpcTransactions/{mpc_transaction_id}
	MpcTransaction string `protobuf:"bytes,3,opt,name=mpc_transaction,json=mpcTransaction,proto3" json:"mpc_transaction,omitempty"`
	// A message describing the current state of the Broadcast and whether any
	// action needs to be taken.
	Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

Metadata associated with the CreateMPCTransaction long-running operation.

func (*CreateMPCTransactionMetadata) Descriptor deprecated

func (*CreateMPCTransactionMetadata) Descriptor() ([]byte, []int)

Deprecated: Use CreateMPCTransactionMetadata.ProtoReflect.Descriptor instead.

func (*CreateMPCTransactionMetadata) GetDeviceGroup

func (x *CreateMPCTransactionMetadata) GetDeviceGroup() string

func (*CreateMPCTransactionMetadata) GetMessage

func (x *CreateMPCTransactionMetadata) GetMessage() string

func (*CreateMPCTransactionMetadata) GetMpcTransaction

func (x *CreateMPCTransactionMetadata) GetMpcTransaction() string

func (*CreateMPCTransactionMetadata) GetState

func (*CreateMPCTransactionMetadata) ProtoMessage

func (*CreateMPCTransactionMetadata) ProtoMessage()

func (*CreateMPCTransactionMetadata) ProtoReflect

func (*CreateMPCTransactionMetadata) Reset

func (x *CreateMPCTransactionMetadata) Reset()

func (*CreateMPCTransactionMetadata) String

type CreateMPCTransactionRequest

type CreateMPCTransactionRequest struct {

	// The resource name of the parent MPCWallet.
	// Format: pools/{pool_id}/mpcWallets/{mpc_wallet_id}
	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	// The MPCTransaction to be created.
	MpcTransaction *MPCTransaction `protobuf:"bytes,2,opt,name=mpc_transaction,json=mpcTransaction,proto3" json:"mpc_transaction,omitempty"`
	// The transaction input.
	Input *v1.TransactionInput `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
	// Whether the nonce specified in the transaction input should be respected,
	// as opposed to assigned by the service. This is intended for the use case of
	// replacing transactions that fail to confirm on-chain due to too low of a transaction fee.
	// Setting this to true has the side effect of canceling any pending transactions from the
	// same address with nonce greater than or equal to the one provided. Use this
	// with caution.
	OverrideNonce bool `protobuf:"varint,4,opt,name=override_nonce,json=overrideNonce,proto3" json:"override_nonce,omitempty"`
	// A user-provided request ID to allow for idempotency. This should be a UUID.
	RequestId string `protobuf:"bytes,5,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

The request message for CreateMPCTransaction.

func (*CreateMPCTransactionRequest) Descriptor deprecated

func (*CreateMPCTransactionRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateMPCTransactionRequest.ProtoReflect.Descriptor instead.

func (*CreateMPCTransactionRequest) GetInput

func (*CreateMPCTransactionRequest) GetMpcTransaction

func (x *CreateMPCTransactionRequest) GetMpcTransaction() *MPCTransaction

func (*CreateMPCTransactionRequest) GetOverrideNonce

func (x *CreateMPCTransactionRequest) GetOverrideNonce() bool

func (*CreateMPCTransactionRequest) GetParent

func (x *CreateMPCTransactionRequest) GetParent() string

func (*CreateMPCTransactionRequest) GetRequestId

func (x *CreateMPCTransactionRequest) GetRequestId() string

func (*CreateMPCTransactionRequest) ProtoMessage

func (*CreateMPCTransactionRequest) ProtoMessage()

func (*CreateMPCTransactionRequest) ProtoReflect

func (*CreateMPCTransactionRequest) Reset

func (x *CreateMPCTransactionRequest) Reset()

func (*CreateMPCTransactionRequest) String

func (x *CreateMPCTransactionRequest) String() string

type GetMPCTransactionRequest

type GetMPCTransactionRequest struct {

	// The resource name of the MPCTransaction.
	// Format: pools/{pool_id}/mpcWallets/{mpc_wallet_id}/mpcTransactions/{mpc_transaction_id}
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

The request message for GetMPCTransaction.

func (*GetMPCTransactionRequest) Descriptor deprecated

func (*GetMPCTransactionRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetMPCTransactionRequest.ProtoReflect.Descriptor instead.

func (*GetMPCTransactionRequest) GetName

func (x *GetMPCTransactionRequest) GetName() string

func (*GetMPCTransactionRequest) ProtoMessage

func (*GetMPCTransactionRequest) ProtoMessage()

func (*GetMPCTransactionRequest) ProtoReflect

func (x *GetMPCTransactionRequest) ProtoReflect() protoreflect.Message

func (*GetMPCTransactionRequest) Reset

func (x *GetMPCTransactionRequest) Reset()

func (*GetMPCTransactionRequest) String

func (x *GetMPCTransactionRequest) String() string

type ListMPCTransactionsRequest

type ListMPCTransactionsRequest struct {

	// The resource name of the parent MPCWallet.
	// Format: pools/{pool_id}/mpcWallets/{mpc_wallet_id}
	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	// The maximum number of MPCTransactions to return. The default is 50.
	PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// A page token, received from a previous ListMPCTransactions call.
	// Provide this to retrieve the subsequent page.
	PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// contains filtered or unexported fields
}

The request message for ListMPCTransactions.

func (*ListMPCTransactionsRequest) Descriptor deprecated

func (*ListMPCTransactionsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListMPCTransactionsRequest.ProtoReflect.Descriptor instead.

func (*ListMPCTransactionsRequest) GetPageSize

func (x *ListMPCTransactionsRequest) GetPageSize() int32

func (*ListMPCTransactionsRequest) GetPageToken

func (x *ListMPCTransactionsRequest) GetPageToken() string

func (*ListMPCTransactionsRequest) GetParent

func (x *ListMPCTransactionsRequest) GetParent() string

func (*ListMPCTransactionsRequest) ProtoMessage

func (*ListMPCTransactionsRequest) ProtoMessage()

func (*ListMPCTransactionsRequest) ProtoReflect

func (*ListMPCTransactionsRequest) Reset

func (x *ListMPCTransactionsRequest) Reset()

func (*ListMPCTransactionsRequest) String

func (x *ListMPCTransactionsRequest) String() string

type ListMPCTransactionsResponse

type ListMPCTransactionsResponse struct {

	// The list of MPCTransactions.
	MpcTransactions []*MPCTransaction `protobuf:"bytes,1,rep,name=mpc_transactions,json=mpcTransactions,proto3" json:"mpc_transactions,omitempty"`
	// A token, which can be sent as page_token to retrieve the next page.
	// If this field is omitted, there are no subsequent pages.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

The response message for ListMPCTransactions.

func (*ListMPCTransactionsResponse) Descriptor deprecated

func (*ListMPCTransactionsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListMPCTransactionsResponse.ProtoReflect.Descriptor instead.

func (*ListMPCTransactionsResponse) GetMpcTransactions

func (x *ListMPCTransactionsResponse) GetMpcTransactions() []*MPCTransaction

func (*ListMPCTransactionsResponse) GetNextPageToken

func (x *ListMPCTransactionsResponse) GetNextPageToken() string

func (*ListMPCTransactionsResponse) ProtoMessage

func (*ListMPCTransactionsResponse) ProtoMessage()

func (*ListMPCTransactionsResponse) ProtoReflect

func (*ListMPCTransactionsResponse) Reset

func (x *ListMPCTransactionsResponse) Reset()

func (*ListMPCTransactionsResponse) String

func (x *ListMPCTransactionsResponse) String() string

type MPCTransaction

type MPCTransaction struct {

	// The resource name of the MPCTransaction.
	// Format: pools/{pool_id}/mpcWallets/{mpc_wallet_id}/mpcTransactions/{mpc_transaction_id}
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The resource name of the Network on which to broadcast the MPCTransaction.
	// Format: networks/{network_id}
	Network string `protobuf:"bytes,2,opt,name=network,proto3" json:"network,omitempty"`
	// The resource name of the Addresses from which to send the MPCTransaction.
	// For account-based Networks, only the first address is used.
	// Format: networks/{network_id}/addresses/{address_id}.
	FromAddresses []string `protobuf:"bytes,3,rep,name=from_addresses,json=fromAddresses,proto3" json:"from_addresses,omitempty"`
	// The current state of the MPCTransaction.
	State MPCTransaction_State `protobuf:"varint,4,opt,name=state,proto3,enum=coinbase.cloud.mpc_transactions.v1.MPCTransaction_State" json:"state,omitempty"`
	// The underlying transaction to be signed and broadcast. Fields in the transaction, such as the hash,
	// will become populated as the MPCTransaction goes through its lifecycle.
	Transaction *v1.Transaction `protobuf:"bytes,5,opt,name=transaction,proto3" json:"transaction,omitempty"`
	// contains filtered or unexported fields
}

The MPCTransaction resource, which represents a transaction that is in the process of being fulfilled. The lifecycle of a successful MPC transaction has five parts:

1. CREATED - The request has been received by the service. 2. SIGNING - The MPCTransaction is waiting to be signed. At this point, the WaaS SDK must poll for and process the CREATE_SIGNATURE MPCOperation of the DeviceGroup associated with the underlying Address. For any given Address, only one MPCTransaction can be in the SIGNING state at a given time - i.e., an MPCTransaction must be successfully signed before the the next one can be signed. 3. SIGNED - The MPCTransaction has been signed and is waiting to be broadcast on-chain. MPCTransactions are broadcast on a regular periodic schedule proportional to the block production speed of the Network. 4. CONFIRMING - The MPCTransaction has been successfully broadcast on-chain and is awaiting confirmation. 5. CONFIRMED - The MPCTransaction has been confirmed on-chain. It is possible for the MPCTransaction to revert to CONFIRMING if there is an on-chain reorganization.

func (*MPCTransaction) Descriptor deprecated

func (*MPCTransaction) Descriptor() ([]byte, []int)

Deprecated: Use MPCTransaction.ProtoReflect.Descriptor instead.

func (*MPCTransaction) GetFromAddresses

func (x *MPCTransaction) GetFromAddresses() []string

func (*MPCTransaction) GetName

func (x *MPCTransaction) GetName() string

func (*MPCTransaction) GetNetwork

func (x *MPCTransaction) GetNetwork() string

func (*MPCTransaction) GetState

func (x *MPCTransaction) GetState() MPCTransaction_State

func (*MPCTransaction) GetTransaction

func (x *MPCTransaction) GetTransaction() *v1.Transaction

func (*MPCTransaction) ProtoMessage

func (*MPCTransaction) ProtoMessage()

func (*MPCTransaction) ProtoReflect

func (x *MPCTransaction) ProtoReflect() protoreflect.Message

func (*MPCTransaction) Reset

func (x *MPCTransaction) Reset()

func (*MPCTransaction) String

func (x *MPCTransaction) String() string

type MPCTransactionResourceName

type MPCTransactionResourceName struct {
	PoolId           string
	MpcWalletId      string
	MpcTransactionId string
}

func (MPCTransactionResourceName) ContainsWildcard

func (n MPCTransactionResourceName) ContainsWildcard() bool

func (MPCTransactionResourceName) MarshalString

func (n MPCTransactionResourceName) MarshalString() (string, error)

func (MPCTransactionResourceName) String

func (*MPCTransactionResourceName) UnmarshalString

func (n *MPCTransactionResourceName) UnmarshalString(name string) error

func (MPCTransactionResourceName) Validate

func (n MPCTransactionResourceName) Validate() error

type MPCTransactionServiceClient

type MPCTransactionServiceClient interface {
	// 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.
	CreateMPCTransaction(ctx context.Context, in *CreateMPCTransactionRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
	// Gets an MPCTransaction. There can be a delay between when CreateMPCTransaction is called
	// and when this API returns an MPCTransaction in the CREATED state.
	GetMPCTransaction(ctx context.Context, in *GetMPCTransactionRequest, opts ...grpc.CallOption) (*MPCTransaction, error)
	// Returns a list of MPCTransactions in an MPCWallet.
	ListMPCTransactions(ctx context.Context, in *ListMPCTransactionsRequest, opts ...grpc.CallOption) (*ListMPCTransactionsResponse, error)
}

MPCTransactionServiceClient is the client API for MPCTransactionService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type MPCTransactionServiceServer

type MPCTransactionServiceServer interface {
	// 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.
	CreateMPCTransaction(context.Context, *CreateMPCTransactionRequest) (*longrunning.Operation, error)
	// Gets an MPCTransaction. There can be a delay between when CreateMPCTransaction is called
	// and when this API returns an MPCTransaction in the CREATED state.
	GetMPCTransaction(context.Context, *GetMPCTransactionRequest) (*MPCTransaction, error)
	// Returns a list of MPCTransactions in an MPCWallet.
	ListMPCTransactions(context.Context, *ListMPCTransactionsRequest) (*ListMPCTransactionsResponse, error)
	// contains filtered or unexported methods
}

MPCTransactionServiceServer is the server API for MPCTransactionService service. All implementations must embed UnimplementedMPCTransactionServiceServer for forward compatibility

type MPCTransaction_State

type MPCTransaction_State int32

The state of the MPCTransaction.

const (
	// The default unspecified state.
	MPCTransaction_STATE_UNSPECIFIED MPCTransaction_State = 0
	// The request to create the MPCTransaction has been received by the service.
	MPCTransaction_CREATED MPCTransaction_State = 1
	// The MPCTransaction is waiting to be signed by the WaaS SDK.
	// Only one MPCTransaction per Address can be in the SIGNING state.
	MPCTransaction_SIGNING MPCTransaction_State = 2
	// The MPCTransaction has been signed and is waiting to be broadcast on-chain.
	MPCTransaction_SIGNED MPCTransaction_State = 3
	// The MPCTransaction has been successfully broadcast on-chain and is awaiting confirmation.
	MPCTransaction_CONFIRMING MPCTransaction_State = 4
	// The MPCTransaction has been confirmed on-chain. It is possible for the MPCTransaction
	// to revert to CONFIRMING if there is an on-chain reorganization.
	MPCTransaction_CONFIRMED MPCTransaction_State = 5
	// The MPCTransaction was broadcast, but failed on-chain.
	MPCTransaction_FAILED MPCTransaction_State = 6
	// The MPCTransaction was cancelled by the service.
	MPCTransaction_CANCELLED MPCTransaction_State = 7
)

func (MPCTransaction_State) Descriptor

func (MPCTransaction_State) Enum

func (MPCTransaction_State) EnumDescriptor deprecated

func (MPCTransaction_State) EnumDescriptor() ([]byte, []int)

Deprecated: Use MPCTransaction_State.Descriptor instead.

func (MPCTransaction_State) Number

func (MPCTransaction_State) String

func (x MPCTransaction_State) String() string

func (MPCTransaction_State) Type

type UnimplementedMPCTransactionServiceServer

type UnimplementedMPCTransactionServiceServer struct {
}

UnimplementedMPCTransactionServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedMPCTransactionServiceServer) CreateMPCTransaction

func (UnimplementedMPCTransactionServiceServer) GetMPCTransaction

func (UnimplementedMPCTransactionServiceServer) ListMPCTransactions

type UnsafeMPCTransactionServiceServer

type UnsafeMPCTransactionServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeMPCTransactionServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MPCTransactionServiceServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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