Options
All
  • Public
  • Public/Protected
  • All
Menu

@stellarguard/multisig-utils

Index

Type aliases

Weight

Weight: number

Functions

getAccountThresholdWeight

getAccountsThatNeedAdditionalSignatures

getMultisigServerEndpoint

  • getMultisigServerEndpoint(account: AccountResponse): Promise<string | undefined>
  • Checks whether the account has a multisig server defined in its data. If so, it loads the stellar.toml associated with that server and returns the MULTISIG_SERVER key.

    Parameters

    • account: AccountResponse

      The account to get the multisig server endpoint for.

    Returns Promise<string | undefined>

getRequiredWeights

  • getRequiredWeights(sourceAccounts: AccountResponse[], sourceThresholdCatgories: Map<string, ThresholdCategory>): Map<AccountResponse, Weight>

getSignatureWeights

  • Gets a list of accounts and current weights that have currently been signed on the transaction.

    Parameters

    • transaction: Transaction

      The transaction.

    • sourceAccounts: AccountResponse[]

      An array of source accounts for this transaction.

    Returns AccountSignatureWeight[]

getSigners

  • getSigners(transaction: Transaction, server: Server, accounts?: AccountResponse[]): Promise<string[]>
  • Returns a list of public keys that have signed the transaction.

    Parameters

    • transaction: Transaction

      The transaction to check.

    • server: Server

      The server to use to look up source accounts.

    • Default value accounts: AccountResponse[] = []

      A list of accounts to use instead of looking them up on horizon;

    Returns Promise<string[]>

getSourceAccounts

  • getSourceAccounts(transaction: Transaction, server: Server, accounts?: AccountResponse[]): Promise<AccountResponse[]>
  • Gets a list of source accounts for the given transaction.

    Parameters

    • transaction: Transaction

      The transaction

    • server: Server

      The Horizon server to use to look up account details

    • Default value accounts: AccountResponse[] = []

      A list of accounts to use instead of looking them up on horizon;

    Returns Promise<AccountResponse[]>

getThresholdCategory

  • Returns the threshold category (low, med, high) for a given operation.

    Parameters

    • operation: Operation

      The operation for which to get the threshold category.

    Returns ThresholdCategory

getTransactionSourceThresholdCategories

  • getTransactionSourceThresholdCategories(transaction: Transaction): Map<string, ThresholdCategory>

hasAccountSignedTransaction

  • hasAccountSignedTransaction(account: string, transaction: Transaction): boolean
  • Returns true if the account has signed the given transaction. False otherwise.

    Parameters

    • account: string

      The account to check.

    • transaction: Transaction

      The transaction to check.

    Returns boolean

needsMoreSignatures

  • needsMoreSignatures(transaction: Transaction, server: Server, ...accounts: AccountResponse[]): Promise<NeedsSignatures[] | false>
  • Checks whether an account needs more signatures to satisfy the source account weights. Returns false if the transaction is fully satisfied, or an array of objects containing the account that needs more signatures as well as the required weight and the current weight that is satisfied.

    Parameters

    • transaction: Transaction

      The transaction to check.

    • server: Server

      A horizon server that is used to look up accounts.

    • Rest ...accounts: AccountResponse[]

      A list of accounts to use instead of looking them up with the server.

    Returns Promise<NeedsSignatures[] | false>

submitToMultisigServer

Generated using TypeDoc