node_modules/@velas/solana-web3/lib/index.browser.esm.js
/**
   * Generate a transaction instruction that transfers lamports from one account to another
   */
Generate a transaction instruction that transfers lamports from one account to another
Generate a transaction instruction that transfers lamports from one account to another
static transfer(params) {
    let data;
    let keys;
    if ('basePubkey' in params) {
      const type = SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed;
      data = encodeData(type, {
        lamports: params.lamports,
        seed: params.seed,
        programId: params.programId.toBuffer()
      });
      keys = [{
        pubkey: params.fromPubkey,
        isSigner: false,
        isWritable: true
      }, {
        pubkey: params.basePubkey,
        isSigner: true,
        isWritable: false
      }, {
        pubkey: params.toPubkey,
        isSigner: false,
        isWritable: true
      }];
    } else {
      const type = SYSTEM_INSTRUCTION_LAYOUTS.Transfer;
      data = encodeData(type, {
        lamports: params.lamports
      });
      keys = [{
        pubkey: params.fromPubkey,
        isSigner: true,
        isWritable: true
      }, {
        pubkey: params.toPubkey,
        isSigner: false,
        isWritable: true
      }];
    }
    return new TransactionInstruction({
      keys,
      programId: this.programId,
      data
    });
  }
static transfer ( params ) { let data ; let keys ; if ( 'basePubkey' in params ) { const type = SYSTEM_INSTRUCTION_LAYOUTS . TransferWithSeed ; data = encodeData ( type , { lamports : params . lamports , seed : params . seed , programId : params . programId . toBuffer ( ) } ) ; keys = [ { pubkey : params . fromPubkey , isSigner : false , isWritable : true } , { pubkey : params . basePubkey , isSigner : true , isWritable : false } , { pubkey : params . toPubkey , isSigner : false , isWritable : true } ] ; } else { const type = SYSTEM_INSTRUCTION_LAYOUTS . Transfer ; data = encodeData ( type , { lamports : params . lamports } ) ; keys = [ { pubkey : params . fromPubkey , isSigner : true , isWritable : true } , { pubkey : params . toPubkey , isSigner : false , isWritable : true } ] ; } return new TransactionInstruction ( { keys , programId : this . programId , data } ) ; }
Generate a transaction instruction that transfers lamports from one account to another
Generate a transaction instruction that transfers lamports from one account to another