Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Socean

Index

Constructors

  • new Socean(clusterType?: ClusterType, connectionOption?: string | Connection): Socean
  • Instantiates a Socean client

    Parameters

    • clusterType: ClusterType = "testnet"

      The cluster, for eg. mainnet-beta, to connect to

    • Optional connectionOption: string | Connection

      Accepts either a Connection or a rpcEndpoint string

    Returns Socean

Properties

config: SoceanConfig

Methods

  • Signs, sends and confirms the transactions required to deposit SOL into the Socean stake pool

    throws

    RpcError

    throws

    AccountDoesNotExistError if stake pool does not exist

    throws

    WalletPublicKeyUnavailableError

    Parameters

    • walletAdapter: WalletAdapter

      SOL wallet to deposit SOL from

    • amountLamports: Numberu64

      amount to deposit in lamports

    • Optional referrerPoolTokenAccount: PublicKey

      PublicKey of a scnSOL token account of the referrer for this deposit

    • confirmOptions: ConfirmOptions = TRANSACTION_SEQUENCE_DEFAULT_CONFIRM_OPTIONS

      transaction confirm options for each transaction

    Returns Promise<TransactionSequenceSignatures>

    the transaction signatures of the transactions sent and confirmed

  • depositSolTransactions(walletPubkey: PublicKey, amountLamports: Numberu64, referrerPoolTokenAccount?: PublicKey): Promise<TransactionSequence>
  • Creates a TransactionSequence that deposits SOL into Socean stake pool Each inner TransactionWithSigners array must be executed and confirmed before going to the next one. This is a lower-level API for compatibility, recommend using depositSol() instead if possible.

    throws

    RpcError

    throws

    AccountDoesNotExistError if stake pool does not exist

    Parameters

    • walletPubkey: PublicKey

      SOL wallet to deposit SOL from

    • amountLamports: Numberu64

      amount to deposit in lamports

    • Optional referrerPoolTokenAccount: PublicKey

      PublicKey of a scnSOL token account of the referrer for this deposit

    Returns Promise<TransactionSequence>

    the deposit transaction sequence

  • Signs, sends and confirms the transactions required to deposit a stake account into the Socean stake pool

    throws

    RpcError

    throws

    AccountDoesNotExistError if stake pool or main validator stake account for stakeAccount's validator does not exist

    throws

    WalletPublicKeyUnavailableError

    throws

    StakeAccountToDepositInvalidError if stake account to deposit does not meet deposit requirements

    Parameters

    • walletAdapter: WalletAdapter

      SOL wallet to deposit SOL from

    • stakeAccount: PublicKey

      The stake account to deposit. Must be active and delegated to a validator in the stake pool. The entire stake account is deposited. To deposit only a portion of it, prefix this instruction with a stake split instruction and deposit the stake account that's split off instead.

    • Optional referrerPoolTokenAccount: PublicKey

      PublicKey of a scnSOL token account of the referrer for this deposit

    • confirmOptions: ConfirmOptions = TRANSACTION_SEQUENCE_DEFAULT_CONFIRM_OPTIONS

      transaction confirm options for each transaction

    Returns Promise<TransactionSequenceSignatures>

    the transaction signatures of the transactions sent and confirmed

  • depositStakeTransactions(walletPubkey: PublicKey, stakeAccount: PublicKey, referrerPoolTokenAccount?: PublicKey): Promise<TransactionSequence>
  • Creates a TransactionSequence that deposits an active stake account currently staked with one of the Socean stake pool's validators into Socean stake pool Each inner TransactionWithSigners array must be executed and confirmed before going to the next one. This is a lower-level API for compatibility, recommend using depositStake() instead if possible.

    throws

    RpcError

    throws

    AccountDoesNotExistError if stake pool or main validator stake account for stakeAccount's validator does not exist

    throws

    StakeAccountToDepositInvalidError if stake account to deposit does not meet deposit requirements

    Parameters

    • walletPubkey: PublicKey

      SOL wallet to deposit SOL from

    • stakeAccount: PublicKey

      The stake account to deposit. Must be active and delegated to a validator in the stake pool. The entire stake account is deposited. To deposit only a portion of it, prefix this instruction with a stake split instruction and deposit the stake account that's split off instead.

    • Optional referrerPoolTokenAccount: PublicKey

      PublicKey of a scnSOL token account of the referrer for this deposit

    Returns Promise<TransactionSequence>

    the deposit transaction sequence

  • getCurrentEpoch(): Promise<number>
  • Returns Promise<number>

  • Retrieves and deserializes a StakePool account

    throws

    RpcError

    throws

    AccountDoesNotExistError if stake pool does not exist

    Returns Promise<StakePoolAccount>

    The deserialized StakePoolAccount

  • Returns both the validator stake account and transient stake account given the validator's vote account

    Parameters

    • voteAccount: PublicKey

    Returns Promise<ValidatorAllStakeAccounts>

  • Retrieves and deserializes a ValidatorList account

    throws

    RpcError

    throws

    AccountDoesNotExistError if validator list does not exist

    Parameters

    • validatorListPubkey: PublicKey

    Returns Promise<ValidatorListAccount>

    The deserialized ValidatorListAccount

  • transientStakeAccount(voteAccount: PublicKey): Promise<PublicKey>
  • Returns the transient stake account given the validator's vote account

    Parameters

    • voteAccount: PublicKey

    Returns Promise<PublicKey>

  • validatorStakeAccount(voteAccount: PublicKey): Promise<PublicKey>
  • Returns the validator stake account given the validator's vote account

    Parameters

    • voteAccount: PublicKey

    Returns Promise<PublicKey>

  • withdrawStake(walletAdapter: WalletAdapter, amountDroplets: Numberu64, confirmOptions?: ConfirmOptions): Promise<WithdrawStakeReturn>
  • Signs, sends and confirms the transactions required to withdraw stake from the Socean stake pool

    throws

    RpcError

    throws

    AccountDoesNotExistError if stake pool does not exist

    throws

    WalletPublicKeyUnavailableError

    Parameters

    • walletAdapter: WalletAdapter

      the SOL wallet to withdraw stake to. scnSOL is deducted from this wallet's associated token account.

    • amountDroplets: Numberu64

      amount of scnSOL to withdraw in droplets (1 scnSOL = 10^9 droplets)

    • confirmOptions: ConfirmOptions = TRANSACTION_SEQUENCE_DEFAULT_CONFIRM_OPTIONS

      transaction confirm options for each transaction

    Returns Promise<WithdrawStakeReturn>

    the transaction signatures of the transactions sent and confirmed and the newly created stake accounts to receive the withdrawn stake

  • withdrawStakeTransactions(walletPubkey: PublicKey, amountDroplets: Numberu64): Promise<WithdrawStakeTransactionsReturn>
  • Creates a set of transactions and signer keypairs for withdrawing stake from the Socean stake pool, and the new stake accounts to receive the withdrawn stake Each inner TransactionWithSigners array of transactionSequence must be executed and confirmed before going to the next one. This is a lower-level API for compatibility, recommend using withdrawStake() instead if possible.

    throws

    RpcError

    throws

    AccountDoesNotExistError if stake pool or validator list does not exist

    throws

    WithdrawalUnserviceableError if a suitable withdraw procedure is not found

    Parameters

    • walletPubkey: PublicKey

      the SOL wallet to withdraw stake to. scnSOL is deducted from this wallet's associated token account.

    • amountDroplets: Numberu64

      amount of scnSOL to withdraw in droplets (1 scnSOL = 10^9 droplets)

    Returns Promise<WithdrawStakeTransactionsReturn>

    {transactionSequence, stakeAccounts}, where transactionSequence is the TransactionSequence that needs to be sent in order, and stakeAccounts is the array of Keypairs for the newly created stake accounts to receive the withdrawn stake

Generated using TypeDoc