// automatically generated by the FlatBuffers compiler, do not modify

import * as flatbuffers from 'flatbuffers';

export class WalletBuyRequest {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):WalletBuyRequest {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsWalletBuyRequest(bb:flatbuffers.ByteBuffer, obj?:WalletBuyRequest):WalletBuyRequest {
  return (obj || new WalletBuyRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsWalletBuyRequest(bb:flatbuffers.ByteBuffer, obj?:WalletBuyRequest):WalletBuyRequest {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new WalletBuyRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

productId():string|null
productId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
productId(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

static startWalletBuyRequest(builder:flatbuffers.Builder) {
  builder.startObject(1);
}

static addProductId(builder:flatbuffers.Builder, productIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, productIdOffset, 0);
}

static endWalletBuyRequest(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createWalletBuyRequest(builder:flatbuffers.Builder, productIdOffset:flatbuffers.Offset):flatbuffers.Offset {
  WalletBuyRequest.startWalletBuyRequest(builder);
  WalletBuyRequest.addProductId(builder, productIdOffset);
  return WalletBuyRequest.endWalletBuyRequest(builder);
}
}
