Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TransactionStellarUri

The tx operation represents a request to sign a specific XDR Transaction.

see

https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0007.md#operation-tx

Hierarchy

Index

Constructors

constructor

Properties

Protected uri

uri: URL

Accessors

callback

  • get callback(): undefined | string
  • set callback(callback: undefined | string): void
  • Gets the callback for this URI.

    Note: This returns the callback without the 'url:' prefix that may be present in the callback.

    Optional.

    Returns undefined | string

  • Sets the callback for this URI.

    Note: You may set it with or without the 'url:' prefix. If the prefix is not present it will added in the final URI string.

    Optional.

    Parameters

    • callback: undefined | string

    Returns void

isPublicNetwork

  • get isPublicNetwork(): boolean
  • Returns whether or not the network_passphase for this URI indicates that it is on the public network.

    This is true if network_passphrase is not set or if it's set to the public network's passphrase.

    Returns boolean

isTestNetwork

  • get isTestNetwork(): boolean

msg

  • get msg(): undefined | string
  • set msg(msg: undefined | string): void

networkPassphrase

  • get networkPassphrase(): undefined | string
  • set networkPassphrase(networkPassphrase: undefined | string): void
  • Gets the network passphrase of the Stellar network to use for this request.

    If this is not set, the Stellar public network should be assumed.

    Optional.

    Returns undefined | string

  • Sets the network passphrase of the Stellar network to use for this request.

    Optional.

    Parameters

    • networkPassphrase: undefined | string

    Returns void

operation

originDomain

  • get originDomain(): undefined | string
  • set originDomain(originDomain: undefined | string): void
  • Gets the fully qualified domain name that specifies the originating domain of the URI request.

    Wallets must validate the URI request against the included signature before they display the origin_domain to the user.

    Returns undefined | string

  • Sets the fully qualified domain name that specifies the originating domain of the URI request.

    Wallets must validate the URI request against the included signature before they display the origin_domain to the user.

    Parameters

    • originDomain: undefined | string

    Returns void

pubkey

  • get pubkey(): undefined | string
  • set pubkey(pubkey: undefined | string): void

signature

  • get signature(): undefined | string

xdr

  • get xdr(): string
  • set xdr(xdr: string): void

Methods

addReplacement

addSignature

  • addSignature(keypair: Keypair): string
  • Signs the URI with the given keypair. This should be the last step done before generating the URI string, otherwise the signature will be invalid for the URI.

    Parameters

    • keypair: Keypair

      The keypair (including secret key), used to sign the request. This should be the keypair found in the URI_REQUEST_SIGNING_KEY field of the origin domains' stellar.toml.

    Returns string

clone

Protected getParam

  • getParam(key: string): string | undefined

getReplacements

  • getReplacements(): object[]

getTransaction

  • getTransaction(): Transaction

removeReplacement

  • removeReplacement(id: string): void

replace

Protected setParam

  • setParam(key: string, value?: undefined | string): void

setReplacements

toString

  • toString(): string

usePublicNetwork

  • usePublicNetwork(): void

useTestNetwork

  • useTestNetwork(): void

verifySignature

  • verifySignature(): Promise<boolean>
  • Verifies a that the signature added to the URI is valid.

    Returns true if the signature is valid for the current URI and origin domain, or if there is no origin domain and signature. Returns false if signature verification fails, or if there is a problem looking up the stellar.toml associated with the origin domain.

    Returns Promise<boolean>

Static forTransaction

Generated using TypeDoc