node_modules/@velas/solana-web3/lib/index.browser.esm.js
/**
   * Deserialize ValidatorInfo from the config account data. Exactly two config
   * keys are required in the data.
   *
   * @param buffer config account data
   * @return null if info was not found
   */
Deserialize ValidatorInfo from the config account data. Exactly two config
keys are required in the data.

@param buffer config account data
@return null if info was not found
Deserialize ValidatorInfo from the config account data . Exactly two config keys are required in the data . @param buffer config account data @return null if info was not found
static fromConfigData(buffer$1) {
    const PUBKEY_LENGTH = 32;
    let byteArray = [...buffer$1];
    const configKeyCount = decodeLength(byteArray);
    if (configKeyCount !== 2) return null;
    const configKeys = [];
    for (let i = 0; i < 2; i++) {
      const publicKey = new PublicKey(byteArray.slice(0, PUBKEY_LENGTH));
      byteArray = byteArray.slice(PUBKEY_LENGTH);
      const isSigner = byteArray.slice(0, 1)[0] === 1;
      byteArray = byteArray.slice(1);
      configKeys.push({
        publicKey,
        isSigner
      });
    }
    if (configKeys[0].publicKey.equals(VALIDATOR_INFO_KEY)) {
      if (configKeys[1].isSigner) {
        const rawInfo = rustString().decode(buffer.Buffer.from(byteArray));
        const info = JSON.parse(rawInfo);
        assert$3(info, InfoString);
        return new ValidatorInfo(configKeys[1].publicKey, info);
      }
    }
    return null;
  }
static fromConfigData ( buffer$1 ) { const PUBKEY_LENGTH = 32 ; let byteArray = [ ... buffer$1 ] ; const configKeyCount = decodeLength ( byteArray ) ; if ( configKeyCount !== 2 ) return null ; const configKeys = [ ] ; for ( let i = 0 ; i < 2 ; i ++ ) { const publicKey = new PublicKey ( byteArray . slice ( 0 , PUBKEY_LENGTH ) ) ; byteArray = byteArray . slice ( PUBKEY_LENGTH ) ; const isSigner = byteArray . slice ( 0 , 1 ) [ 0 ] === 1 ; byteArray = byteArray . slice ( 1 ) ; configKeys . push ( { publicKey , isSigner } ) ; } if ( configKeys [ 0 ] . publicKey . equals ( VALIDATOR_INFO_KEY ) ) { if ( configKeys [ 1 ] . isSigner ) { const rawInfo = rustString ( ) . decode ( buffer . Buffer . from ( byteArray ) ) ; const info = JSON . parse ( rawInfo ) ; assert$3 ( info , InfoString ) ; return new ValidatorInfo ( configKeys [ 1 ] . publicKey , info ) ; } } return null ; }
Deserialize ValidatorInfo from the config account data.
Deserialize ValidatorInfo from the config account data .