Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SPLT

Hierarchy

  • Tx
    • SPLT

Index

Constructors

constructor

  • new SPLT(spltProgramAddress?: string, splataProgramAddress?: string, nodeUrl: string): SPLT
  • Parameters

    • spltProgramAddress: string = ...
    • splataProgramAddress: string = ...
    • nodeUrl: string

    Returns SPLT

Properties

connection

connection: Connection

nodeUrl

nodeUrl: string

splataProgramId

splataProgramId: PublicKey

spltProgramId

spltProgramId: PublicKey

Static AuthorityType

AuthorityType: { get AccountOwner(): number; get CloseAccount(): number; get FreezeAccount(): number; get MintTokens(): number } = ...

Type declaration

  • get AccountOwner(): number
  • get CloseAccount(): number
  • get FreezeAccount(): number
  • get MintTokens(): number

Methods

approve

  • approve(amount: bigint, srcAddress: string, delegateAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Authorize a person can use your token

    Parameters

    • amount: bigint

      The decimalized amount

    • srcAddress: string

      The source address

    • delegateAddress: string

      The delegate address

    • wallet: WalletInterface

    Returns Promise<{ txId: string }>

burn

  • burn(amount: bigint, srcAddress: string, mintAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Burn tokens

    Parameters

    • amount: bigint

      The decimalized amount

    • srcAddress: string

      The token source address to burn

    • mintAddress: string

      The mint address

    • wallet: WalletInterface

    Returns Promise<{ txId: string }>

closeAccount

  • closeAccount(targetAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Close an account

    Parameters

    Returns Promise<{ txId: string }>

deriveAssociatedAddress

  • deriveAssociatedAddress(walletAddress: string, mintAddress: string): Promise<string>
  • Derive associated account of wallet address for a mint address

    Parameters

    • walletAddress: string
    • mintAddress: string

    Returns Promise<string>

    An associated address

freezeAccount

  • freezeAccount(targetAddress: string, mintAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Freeze an account

    Parameters

    • targetAddress: string

      The target account address

    • mintAddress: string

      The mint address

    • wallet: WalletInterface

    Returns Promise<{ txId: string }>

getAccountData

  • getAccountData(accountAddress: string): Promise<AccountData>

getMintData

  • getMintData(mintAddress: string): Promise<MintData>
  • Get mint data

    Parameters

    • mintAddress: string

    Returns Promise<MintData>

getMultiSigData

  • getMultiSigData(multiSigAddress: string): Promise<MultisigData>

initializeAccount

  • initializeAccount(mintAddress: string, ownerAddress: string, wallet: WalletInterface): Promise<{ accountAddress: string; txId: string }>
  • Initilize an new account of a token

    Parameters

    Returns Promise<{ accountAddress: string; txId: string }>

    The new account address and transaction id

initializeMint

  • initializeMint(decimals: number, mintAuthorityAddress: string, freezeAuthorityAddress: null | string, mint: Keypair, wallet: WalletInterface): Promise<{ txId: string }>
  • Initiliza a new token

    Parameters

    • decimals: number
    • mintAuthorityAddress: string
    • freezeAuthorityAddress: null | string

      (optional) the one who can freeze accounts

    • mint: Keypair
    • wallet: WalletInterface

    Returns Promise<{ txId: string }>

    Transaction id

initializeMultiSig

  • initializeMultiSig(minimumSig: number, signerAddresses: string[], multiSig: Keypair, wallet: WalletInterface): Promise<{ txId: string }>
  • Initialize a multisig account (No testing yet)

    Parameters

    • minimumSig: number

      The minimum signers for a consensus

    • signerAddresses: string[]

      List of signers

    • multiSig: Keypair

      Multisign account

    • wallet: WalletInterface

    Returns Promise<{ txId: string }>

    Transaction id

mintTo

  • mintTo(amount: bigint, mintAddress: string, dstAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Mint more tokens

    Parameters

    • amount: bigint

      The decimalized minted amount

    • mintAddress: string

      The mint address

    • dstAddress: string
    • wallet: WalletInterface

    Returns Promise<{ txId: string }>

parseAccountData

parseMintData

parseMultiSigData

revoke

  • revoke(srcAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Revoke an authorization of token usage

    Parameters

    Returns Promise<{ txId: string }>

setAuthority

  • setAuthority(authorityType: number, newAuthorityAddress: string, targetAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Set authority (onwing, closing) to an account

    Parameters

    • authorityType: number

      2 for Owning Authority, 3 for Closing Authority

    • newAuthorityAddress: string

      The new authority address

    • targetAddress: string

      The target account address

    • wallet: WalletInterface

    Returns Promise<{ txId: string }>

thawAccount

  • thawAccount(targetAddress: string, mintAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Thaw an account

    Parameters

    • targetAddress: string

      The target account address

    • mintAddress: string

      The mint address

    • wallet: WalletInterface

    Returns Promise<{ txId: string }>

transfer

  • transfer(amount: bigint, srcAddress: string, dstAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Send tokens

    Parameters

    • amount: bigint

      The decimalized amount

    • srcAddress: string

      The sender address

    • dstAddress: string

      The receiver address

    • wallet: WalletInterface

    Returns Promise<{ txId: string }>

    Transaction id

unwatch

  • unwatch(watchId: number): Promise<void>
  • Unwatch a watcher by watch id

    Parameters

    • watchId: number

    Returns Promise<void>

unwrap

watch

wrap

  • wrap(lamports: number | bigint, ownerAddress: string, wallet: WalletInterface): Promise<{ accountAddress: string; txId: string }>
  • Wrap SOL

    Parameters

    • lamports: number | bigint

      The amount of wrapped lamports

    • ownerAddress: string

      The owner for the wrapped lamports

    • wallet: WalletInterface

    Returns Promise<{ accountAddress: string; txId: string }>

Generated using TypeDoc