payload

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GETPAYLOADBYCUSTOMIDENDPOINT = "/platform/payload/ci/"
)
View Source
const (
	PAYLOADENDPOINT = "/platform/payload"
)
View Source
const (
	WEBSOCKETBASEURL = "wss://xumm.app/sign/"
)

Variables

This section is empty.

Functions

func GetPayload

func GetPayload(p *Payload, endpt string) (*models.XummPayload, error)

func WithWSBaseUrl added in v1.1.0

func WithWSBaseUrl(url string) func(p *Payload)

Types

type ConnectionError

type ConnectionError struct {
	UUID string
}

func (*ConnectionError) Error

func (e *ConnectionError) Error() string

type EmptyIdError

type EmptyIdError struct {
}

EmptyIdError is returned when an empty string is provided for the payload custom id.

func (*EmptyIdError) Error

func (e *EmptyIdError) Error() string

type EmptyUuidError

type EmptyUuidError struct {
}

EmptyUuidError is returned when an empty string is provided for the payload uuid.

func (*EmptyUuidError) Error

func (e *EmptyUuidError) Error() string

type Payload

type Payload struct {
	Cfg   *xumm.Config
	WSCfg WSCfg
}

func NewPayload added in v1.1.0

func NewPayload(cfg *xumm.Config, opts ...payloadOpt) *Payload

func (*Payload) CancelPayloadByUUID

func (p *Payload) CancelPayloadByUUID(uuid string) (*models.XummDeletePayloadResponse, error)

CancelPayloadByUUID cancels a payload, so a user cannot open it anymore. Takes a single argument of a payload uuid string.

func (*Payload) CreateAndSubscribe added in v1.1.0

func (p *Payload) CreateAndSubscribe(payloadBody models.XummPostPayload) (*models.XummPayload, error)

func (*Payload) GetPayloadByCustomId

func (p *Payload) GetPayloadByCustomId(customId string) (*models.XummPayload, error)

GetPayloadByCustomId returns the payload details or payload resolve status and result data by custom identifier. Takes a single argument of the payload custom id string.

func (*Payload) GetPayloadByUUID

func (p *Payload) GetPayloadByUUID(uuid string) (*models.XummPayload, error)

GetPayloadByUUID returns the payload details or payload resolve status and result data. Takes a single argument of a payload uuid string.

func (*Payload) PostPayload

func (p *Payload) PostPayload(body models.XummPostPayload) (*models.CreatedPayload, error)

PostPayload method submits a payload containing a sign request to the XUMM platform. Takes a single argument of a XummPostPayload which MUST have either TxJson or TxBlob field filled. If using TxJson, it must be formatted as per XRPL transaction format specification at xrpl.org.

func (*Payload) Subscribe

func (p *Payload) Subscribe(uuid string) (*models.XummPayload, error)

Subscribes to payload websocket to receive messages and returns payload if it is resolved

type PayloadExpiredError

type PayloadExpiredError struct {
	UUID string
}

func (*PayloadExpiredError) Error

func (e *PayloadExpiredError) Error() string

type PayloadInterface

type PayloadInterface interface {
	PostPayload(models.XummPostPayload) (*models.CreatedPayload, error)
	GetPayloadByUUID(uuid string) (*models.XummPayload, error)
	GetPayloadByCustomId(customId string) (*models.XummPayload, error)
	CancelPayloadByUUID(uuid string) (*models.XummDeletePayloadResponse, error)
	Subscribe(uuid string) (*models.XummPayload, error)
	CreateAndSubscribe(payloadBody models.XummPostPayload) (*models.XummPayload, error)
}

type PayloadUuidError

type PayloadUuidError struct {
	UUID string
}

func (*PayloadUuidError) Error

func (e *PayloadUuidError) Error() string

type TransactionType

type TransactionType uint32
const (
	SignIn TransactionType = 1 << iota
	Payment
	OfferCreate
	OfferCancel
	EscrowFinish
	EscrowCreate
	EscrowCancel
	DepositPreauth
	CheckCreate
	CheckCash
	CheckCancel
	AccountSet
	PaymentChannelCreate
	PaymentChannelFund
	SetRegularKey
	SignerListSet
	TrustSet
	EnableAmendment
	AccountDelete
	SetFee
)

func (*TransactionType) String

func (t *TransactionType) String() string

func (*TransactionType) UnmarshalJSON

func (t *TransactionType) UnmarshalJSON(data []byte) error

type TransactionTypeError

type TransactionTypeError struct {
}

TransactionTypeError is returned when an invalid transaction type is provided in the TxJson field of the XummPostPayload.

func (*TransactionTypeError) Error

func (e *TransactionTypeError) Error() string

type WSCfg

type WSCfg struct {
	BaseURL string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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