# automatically generated by the FlatBuffers compiler, do not modify

# namespace: xbr

import flatbuffers

class Transaction(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsTransaction(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = Transaction()
        x.Init(buf, n + offset)
        return x

    # Transaction
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

# /// Transaction ID.
    # Transaction
    def TransactionId(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = o + self._tab.Pos
            from ..oid_t import oid_t
            obj = oid_t()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

# /// Transaction time (epoc time in ns)
    # Transaction
    def Timestamp(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

# /// Data (item) public key (Ed25519) - 32 bytes.
    # Transaction
    def DataPubkey(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def DataPubkeyAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def DataPubkeyLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Transaction limit (XBR)
    # Transaction
    def Limit(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

# /// Transaction amount (XBR)
    # Transaction
    def Amount(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

# /// Buyer (data consumer) WAMP session ID
    # Transaction
    def BuyerSession(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

# /// Buyer (data consumer) WAMP authentication ID
    # Transaction
    def BuyerAuthid(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Buyer (data consumer) WAMP authentication role
    # Transaction
    def BuyerAuthrole(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Buyer (data consumer) wallet address (least significant 20 bytes of Keccac256 hash of ECDSA-secp256k1 public key)
    # Transaction
    def BuyerAddress(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def BuyerAddressAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def BuyerAddressLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Buyer (data consumer) transaction signature (V-value)
    # Transaction
    def BuyerSignatureV(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

# /// Buyer (data consumer) transaction signature (R-value) - 32 bytes.
    # Transaction
    def BuyerSignatureR(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def BuyerSignatureRAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def BuyerSignatureRLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Buyer (data consumer) transaction signature (S-value) - 32 bytes.
    # Transaction
    def BuyerSignatureS(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def BuyerSignatureSAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def BuyerSignatureSLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Buyer (data consumer) balance (in state channel with market maker) after transaction
    # Transaction
    def BuyerBalance(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

# /// Seller (data provider) WAMP session ID
    # Transaction
    def SellerSession(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

# /// Seller (data provider) WAMP authentication ID
    # Transaction
    def SellerAuthid(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Seller (data provider) WAMP authentication role
    # Transaction
    def SellerAuthrole(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Seller (data provider) wallet address (least significant 20 bytes of Keccac256 hash of ECDSA-secp256k1 public key)
    # Transaction
    def SellerAddress(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def SellerAddressAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def SellerAddressLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Seller (data provider) transaction signature (V-value)
    # Transaction
    def SellerSignatureV(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

# /// Seller (data provider) transaction signature (R-value) - 32 bytes.
    # Transaction
    def SellerSignatureR(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def SellerSignatureRAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def SellerSignatureRLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Seller (data provider) transaction signature (S-value)  - 32 bytes.
    # Transaction
    def SellerSignatureS(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(42))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def SellerSignatureSAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(42))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def SellerSignatureSLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(42))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Seller (data provider) balance (in state channel with market maker) after transaction
    # Transaction
    def SellerBalance(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(44))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

# /// Market maker WAMP session ID
    # Transaction
    def MmSession(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(46))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

# /// Market maker WAMP authentication ID
    # Transaction
    def MmAuthid(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(48))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Market maker WAMP authentication role
    # Transaction
    def MmAuthrole(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(50))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Market maker wallet address (least significant 20 bytes of Keccac256 hash of ECDSA-secp256k1 public key)
    # Transaction
    def MmAddress(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(52))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def MmAddressAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(52))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def MmAddressLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(52))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Market Maker transaction signature (V-value)
    # Transaction
    def MmSignatureV(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(54))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

# /// Market Maker transaction signature (R-value) - 32 bytes.
    # Transaction
    def MmSignatureR(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(56))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def MmSignatureRAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(56))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def MmSignatureRLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(56))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Market Maker transaction signature (S-value) - 32 bytes.
    # Transaction
    def MmSignatureS(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(58))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Transaction
    def MmSignatureSAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(58))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Transaction
    def MmSignatureSLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(58))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

# /// Data plane management domain
    # Transaction
    def DplnDomain(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(60))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Data plane management realm
    # Transaction
    def DplnMrealm(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(62))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Data plane application realm
    # Transaction
    def DataRealm(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(64))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Data plane node
    # Transaction
    def DplnNode(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(66))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

# /// Data plane (routing) worker
    # Transaction
    def DplnWorker(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(68))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def TransactionStart(builder): builder.StartObject(33)
def TransactionAddTransactionId(builder, transactionId): builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(transactionId), 0)
def TransactionAddTimestamp(builder, timestamp): builder.PrependUint64Slot(1, timestamp, 0)
def TransactionAddDataPubkey(builder, dataPubkey): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(dataPubkey), 0)
def TransactionStartDataPubkeyVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddLimit(builder, limit): builder.PrependUint64Slot(3, limit, 0)
def TransactionAddAmount(builder, amount): builder.PrependUint64Slot(4, amount, 0)
def TransactionAddBuyerSession(builder, buyerSession): builder.PrependUint64Slot(5, buyerSession, 0)
def TransactionAddBuyerAuthid(builder, buyerAuthid): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(buyerAuthid), 0)
def TransactionAddBuyerAuthrole(builder, buyerAuthrole): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(buyerAuthrole), 0)
def TransactionAddBuyerAddress(builder, buyerAddress): builder.PrependUOffsetTRelativeSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(buyerAddress), 0)
def TransactionStartBuyerAddressVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddBuyerSignatureV(builder, buyerSignatureV): builder.PrependUint32Slot(9, buyerSignatureV, 0)
def TransactionAddBuyerSignatureR(builder, buyerSignatureR): builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(buyerSignatureR), 0)
def TransactionStartBuyerSignatureRVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddBuyerSignatureS(builder, buyerSignatureS): builder.PrependUOffsetTRelativeSlot(11, flatbuffers.number_types.UOffsetTFlags.py_type(buyerSignatureS), 0)
def TransactionStartBuyerSignatureSVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddBuyerBalance(builder, buyerBalance): builder.PrependUint64Slot(12, buyerBalance, 0)
def TransactionAddSellerSession(builder, sellerSession): builder.PrependUint64Slot(13, sellerSession, 0)
def TransactionAddSellerAuthid(builder, sellerAuthid): builder.PrependUOffsetTRelativeSlot(14, flatbuffers.number_types.UOffsetTFlags.py_type(sellerAuthid), 0)
def TransactionAddSellerAuthrole(builder, sellerAuthrole): builder.PrependUOffsetTRelativeSlot(15, flatbuffers.number_types.UOffsetTFlags.py_type(sellerAuthrole), 0)
def TransactionAddSellerAddress(builder, sellerAddress): builder.PrependUOffsetTRelativeSlot(16, flatbuffers.number_types.UOffsetTFlags.py_type(sellerAddress), 0)
def TransactionStartSellerAddressVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddSellerSignatureV(builder, sellerSignatureV): builder.PrependUint32Slot(17, sellerSignatureV, 0)
def TransactionAddSellerSignatureR(builder, sellerSignatureR): builder.PrependUOffsetTRelativeSlot(18, flatbuffers.number_types.UOffsetTFlags.py_type(sellerSignatureR), 0)
def TransactionStartSellerSignatureRVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddSellerSignatureS(builder, sellerSignatureS): builder.PrependUOffsetTRelativeSlot(19, flatbuffers.number_types.UOffsetTFlags.py_type(sellerSignatureS), 0)
def TransactionStartSellerSignatureSVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddSellerBalance(builder, sellerBalance): builder.PrependUint64Slot(20, sellerBalance, 0)
def TransactionAddMmSession(builder, mmSession): builder.PrependUint64Slot(21, mmSession, 0)
def TransactionAddMmAuthid(builder, mmAuthid): builder.PrependUOffsetTRelativeSlot(22, flatbuffers.number_types.UOffsetTFlags.py_type(mmAuthid), 0)
def TransactionAddMmAuthrole(builder, mmAuthrole): builder.PrependUOffsetTRelativeSlot(23, flatbuffers.number_types.UOffsetTFlags.py_type(mmAuthrole), 0)
def TransactionAddMmAddress(builder, mmAddress): builder.PrependUOffsetTRelativeSlot(24, flatbuffers.number_types.UOffsetTFlags.py_type(mmAddress), 0)
def TransactionStartMmAddressVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddMmSignatureV(builder, mmSignatureV): builder.PrependUint32Slot(25, mmSignatureV, 0)
def TransactionAddMmSignatureR(builder, mmSignatureR): builder.PrependUOffsetTRelativeSlot(26, flatbuffers.number_types.UOffsetTFlags.py_type(mmSignatureR), 0)
def TransactionStartMmSignatureRVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddMmSignatureS(builder, mmSignatureS): builder.PrependUOffsetTRelativeSlot(27, flatbuffers.number_types.UOffsetTFlags.py_type(mmSignatureS), 0)
def TransactionStartMmSignatureSVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def TransactionAddDplnDomain(builder, dplnDomain): builder.PrependUOffsetTRelativeSlot(28, flatbuffers.number_types.UOffsetTFlags.py_type(dplnDomain), 0)
def TransactionAddDplnMrealm(builder, dplnMrealm): builder.PrependUOffsetTRelativeSlot(29, flatbuffers.number_types.UOffsetTFlags.py_type(dplnMrealm), 0)
def TransactionAddDataRealm(builder, dataRealm): builder.PrependUOffsetTRelativeSlot(30, flatbuffers.number_types.UOffsetTFlags.py_type(dataRealm), 0)
def TransactionAddDplnNode(builder, dplnNode): builder.PrependUOffsetTRelativeSlot(31, flatbuffers.number_types.UOffsetTFlags.py_type(dplnNode), 0)
def TransactionAddDplnWorker(builder, dplnWorker): builder.PrependUOffsetTRelativeSlot(32, flatbuffers.number_types.UOffsetTFlags.py_type(dplnWorker), 0)
def TransactionEnd(builder): return builder.EndObject()
