node_modules/@velas/solana-web3/lib/index.browser.esm.js
/**
   * Generate an Initialize instruction to add to a Stake Create transaction
   */
Generate an Initialize instruction to add to a Stake Create transaction
Generate an Initialize instruction to add to a Stake Create transaction
static initialize(params) {
    const {
      stakePubkey,
      authorized,
      lockup
    } = params;
    const type = STAKE_INSTRUCTION_LAYOUTS.Initialize;
    const data = encodeData(type, {
      authorized: {
        staker: authorized.staker.toBuffer(),
        withdrawer: authorized.withdrawer.toBuffer()
      },
      lockup: {
        unixTimestamp: lockup.unixTimestamp,
        epoch: lockup.epoch,
        custodian: lockup.custodian.toBuffer()
      }
    });
    const instructionData = {
      keys: [{
        pubkey: stakePubkey,
        isSigner: false,
        isWritable: true
      }, {
        pubkey: SYSVAR_RENT_PUBKEY,
        isSigner: false,
        isWritable: false
      }],
      programId: this.programId,
      data
    };
    return new TransactionInstruction(instructionData);
  }
static initialize ( params ) { const { stakePubkey , authorized , lockup } = params ; const type = STAKE_INSTRUCTION_LAYOUTS . Initialize ; const data = encodeData ( type , { authorized : { staker : authorized . staker . toBuffer ( ) , withdrawer : authorized . withdrawer . toBuffer ( ) } , lockup : { unixTimestamp : lockup . unixTimestamp , epoch : lockup . epoch , custodian : lockup . custodian . toBuffer ( ) } } ) ; const instructionData = { keys : [ { pubkey : stakePubkey , isSigner : false , isWritable : true } , { pubkey : SYSVAR_RENT_PUBKEY , isSigner : false , isWritable : false } ] , programId : this . programId , data } ; return new TransactionInstruction ( instructionData ) ; }
Generate an Initialize instruction to add to a Stake Create transaction
Generate an Initialize instruction to add to a Stake Create transaction