node_modules/@velas/solana-web3/lib/index.browser.esm.js
/**
   * Decode a stake instruction and retrieve the instruction type.
   */
Decode a stake instruction and retrieve the instruction type.
Decode a stake instruction and retrieve the instruction type .
static decodeInstructionType(instruction) {
    this.checkProgramId(instruction.programId);
    const instructionTypeLayout = u32('instruction');
    const typeIndex = instructionTypeLayout.decode(instruction.data);
    let type;
    for (const [ixType, layout] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) {
      if (layout.index == typeIndex) {
        type = ixType;
        break;
      }
    }
    if (!type) {
      throw new Error('Instruction type incorrect; not a StakeInstruction');
    }
    return type;
  }
static decodeInstructionType ( instruction ) { this . checkProgramId ( instruction . programId ) ; const instructionTypeLayout = u32 ( 'instruction' ) ; const typeIndex = instructionTypeLayout . decode ( instruction . data ) ; let type ; for ( const [ ixType , layout ] of Object . entries ( STAKE_INSTRUCTION_LAYOUTS ) ) { if ( layout . index == typeIndex ) { type = ixType ; break ; } } if ( ! type ) { throw new Error ( 'Instruction type incorrect; not a StakeInstruction' ) ; } return type ; }
Decode a stake instruction and retrieve the instruction type.
Decode a stake instruction and retrieve the instruction type .