diff --git a/sdk/sdk.go b/sdk/sdk.go index f558a30b..a2b0914e 100644 --- a/sdk/sdk.go +++ b/sdk/sdk.go @@ -169,6 +169,7 @@ type Client struct { Contract *ContractService Metadata *MetadataService MetadataNem *MetadataNemService + StreamingV2 *StreamingV2Service } type service struct { @@ -213,6 +214,7 @@ func NewClient(httpClient *http.Client, conf *Config) *Client { c.Contract = (*ContractService)(&c.common) c.Metadata = (*MetadataService)(&c.common) c.MetadataNem = (*MetadataNemService)(&c.common) + c.StreamingV2 = (*StreamingV2Service)(&c.common) return c } @@ -925,3 +927,30 @@ func (c *Client) NewMosaicRemoveLevyTransaction(deadline *Deadline, mosaicId *Mo return tx, err } + +func (c *Client) NewStreamStartTransaction(deadline *Deadline, driveKey string, expectedUploadSize StorageSize, folder string, feedbackFeeAmount Amount) (*StreamStartTransaction, error) { + tx, err := NewStreamStartTransaction(deadline, driveKey, expectedUploadSize, folder, feedbackFeeAmount, c.config.NetworkType) + if tx != nil { + c.modifyTransaction(tx) + } + + return tx, err +} + +func (c *Client) NewStreamFinishTransaction(deadline *Deadline, driveKey string, streamId string, actualUploadSize StorageSize, streamStructureCdi string) (*StreamFinishTransaction, error) { + tx, err := NewStreamFinishTransaction(deadline, driveKey, streamId, actualUploadSize, streamStructureCdi, c.config.NetworkType) + if tx != nil { + c.modifyTransaction(tx) + } + + return tx, err +} + +func (c *Client) NewStreamPaymentTransaction(deadline *Deadline, driveKey string, streamId string, additionalUploadSize StorageSize) (*StreamPaymentTransaction, error) { + tx, err := NewStreamPaymentTransaction(deadline, driveKey, streamId, additionalUploadSize, c.config.NetworkType) + if tx != nil { + c.modifyTransaction(tx) + } + + return tx, err +} diff --git a/sdk/sdk_schema.go b/sdk/sdk_schema.go index 725fb16b..eeadc5f2 100644 --- a/sdk/sdk_schema.go +++ b/sdk/sdk_schema.go @@ -170,4 +170,5 @@ const ( ByteSize VarSize = 1 ShortSize VarSize = 2 IntSize VarSize = 4 + LongSize VarSize = 8 ) diff --git a/sdk/storagev2_internal.go b/sdk/storagev2_internal.go index 6a8a3cd8..a859e413 100644 --- a/sdk/storagev2_internal.go +++ b/sdk/storagev2_internal.go @@ -9,10 +9,12 @@ import ( ) type activeDataModificationDTO struct { - Id hashDto `json:"id"` - Owner string `json:"owner"` - DownloadDataCdi hashDto `json:"downloadDataCdi"` - UploadSize uint64DTO `json:"uploadSize"` + Id hashDto `json:"id"` + Owner string `json:"owner"` + DownloadDataCdi hashDto `json:"downloadDataCdi"` + ExpectedUploadSize uint64DTO `json:"ExpectedUploadSize"` + ActualUploadSize uint64DTO `json:"ActualUploadSize"` + FolderName string `json:"FolderName"` } func (ref *activeDataModificationDTO) toStruct(networkType NetworkType) (*ActiveDataModification, error) { @@ -32,10 +34,12 @@ func (ref *activeDataModificationDTO) toStruct(networkType NetworkType) (*Active } return &ActiveDataModification{ - Id: id, - Owner: owner, - DownloadDataCdi: downloadDataCdi, - UploadSize: ref.UploadSize.toStruct(), + Id: id, + Owner: owner, + DownloadDataCdi: downloadDataCdi, + ExpectedUploadSize: ref.ExpectedUploadSize.toStruct(), + ActualUploadSize: ref.ActualUploadSize.toStruct(), + FolderName: ref.FolderName, }, nil } diff --git a/sdk/storagev2_model.go b/sdk/storagev2_model.go index 91c60cd4..b7d51538 100644 --- a/sdk/storagev2_model.go +++ b/sdk/storagev2_model.go @@ -16,10 +16,13 @@ const ( ) type ActiveDataModification struct { - Id *Hash - Owner *PublicAccount - DownloadDataCdi *Hash - UploadSize StorageSize + Id *Hash + Owner *PublicAccount + DownloadDataCdi *Hash + ExpectedUploadSize StorageSize + ActualUploadSize StorageSize + FolderName string + ReadyForApproval bool } func (active *ActiveDataModification) String() string { @@ -28,12 +31,18 @@ func (active *ActiveDataModification) String() string { "Id": %s, "Owner": %s, "DownloadDataCdi": %s, - "UploadSize": %d, + "ExpectedUploadSize": %d, + "ActualUploadSize": %d, + "FolderName": %s, + "ReadyForApproval": %v `, active.Id.String(), active.Owner.String(), active.DownloadDataCdi.String(), - active.UploadSize, + active.ExpectedUploadSize, + active.ActualUploadSize, + active.FolderName, + active.ReadyForApproval, ) } @@ -171,4 +180,4 @@ type DriveClosureTransaction struct { // Replicator Offboarding Transaction type ReplicatorOffboardingTransaction struct { AbstractTransaction -} \ No newline at end of file +} diff --git a/sdk/storagev2_model_test.go b/sdk/storagev2_model_test.go index ae557f6f..336c2702 100644 --- a/sdk/storagev2_model_test.go +++ b/sdk/storagev2_model_test.go @@ -7,12 +7,11 @@ import ( "github.com/stretchr/testify/assert" ) - -var testActiveDataModification = &ActiveDataModification{&Hash{1}, testDriveAccount, &Hash{2}, 12} +var testActiveDataModification = &ActiveDataModification{&Hash{1}, testDriveAccount, &Hash{2}, 12, 11, "foo/bar", true} var testCompletedDataModification = CompletedDataModification{testActiveDataModification, Succeeded} var testBcDrive = BcDrive{testDriveAccount, testDriveOwnerAccount, &Hash{3}, 12, 13, 14, 3, []*ActiveDataModification{testActiveDataModification}, []*CompletedDataModification{&testCompletedDataModification}} var testDriveInfov2 = &DriveInfo{&Hash{4}, false, 1, 1} -var driveInfoMap = map[string]*DriveInfo{"CFC31B3080B36BC3D59DF4AB936AC72F4DC15CE3C3E1B1EC5EA41415A4C33FEE" : testDriveInfov2} +var driveInfoMap = map[string]*DriveInfo{"CFC31B3080B36BC3D59DF4AB936AC72F4DC15CE3C3E1B1EC5EA41415A4C33FEE": testDriveInfov2} var testReplicator = Replicator{testReplicatorAccount, 2, Amount(10), "blskeys", driveInfoMap} func TestActiveDataModificationString(t *testing.T) { @@ -21,26 +20,32 @@ func TestActiveDataModificationString(t *testing.T) { "Id": 0100000000000000000000000000000000000000000000000000000000000000, "Owner": Address: [Type=168, Address=VBEHMADGUUHQ6ZMCBUYARJ44647BANFFMRKLLUPF], PublicKey: "415C7C61822B063F62A4876A6F6BA2DAAE114AB298D7AC7FC56FDBA95872C309", "DownloadDataCdi": 0200000000000000000000000000000000000000000000000000000000000000, - "UploadSize": 12, + "ExpectedUploadSize": 12, + "ActualUploadSize": 11, + "FolderName": foo/bar, + "ReadyForApproval": true `) assert.Equal(t, expectedResult, testActiveDataModification.String()) } -func TestCompletedDataModificationString(t *testing.T){ +func TestCompletedDataModificationString(t *testing.T) { expectedResult := fmt.Sprintf( ` "ActiveDataModification": "Id": 0100000000000000000000000000000000000000000000000000000000000000, "Owner": Address: [Type=168, Address=VBEHMADGUUHQ6ZMCBUYARJ44647BANFFMRKLLUPF], PublicKey: "415C7C61822B063F62A4876A6F6BA2DAAE114AB298D7AC7FC56FDBA95872C309", "DownloadDataCdi": 0200000000000000000000000000000000000000000000000000000000000000, - "UploadSize": 12, + "ExpectedUploadSize": 12, + "ActualUploadSize": 11, + "FolderName": foo/bar, + "ReadyForApproval": true , "State:" 0, `) assert.Equal(t, expectedResult, testCompletedDataModification.String()) } -func TestBcDriveString(t *testing.T){ +func TestBcDriveString(t *testing.T) { expectedResult := fmt.Sprintf( ` "BcDriveAccount": Address: [Type=168, Address=VBEHMADGUUHQ6ZMCBUYARJ44647BANFFMRKLLUPF], PublicKey: "415C7C61822B063F62A4876A6F6BA2DAAE114AB298D7AC7FC56FDBA95872C309", @@ -54,14 +59,20 @@ func TestBcDriveString(t *testing.T){ "Id": 0100000000000000000000000000000000000000000000000000000000000000, "Owner": Address: [Type=168, Address=VBEHMADGUUHQ6ZMCBUYARJ44647BANFFMRKLLUPF], PublicKey: "415C7C61822B063F62A4876A6F6BA2DAAE114AB298D7AC7FC56FDBA95872C309", "DownloadDataCdi": 0200000000000000000000000000000000000000000000000000000000000000, - "UploadSize": 12, + "ExpectedUploadSize": 12, + "ActualUploadSize": 11, + "FolderName": foo/bar, + "ReadyForApproval": true ], "CompletedDataModifications": [ "ActiveDataModification": "Id": 0100000000000000000000000000000000000000000000000000000000000000, "Owner": Address: [Type=168, Address=VBEHMADGUUHQ6ZMCBUYARJ44647BANFFMRKLLUPF], PublicKey: "415C7C61822B063F62A4876A6F6BA2DAAE114AB298D7AC7FC56FDBA95872C309", "DownloadDataCdi": 0200000000000000000000000000000000000000000000000000000000000000, - "UploadSize": 12, + "ExpectedUploadSize": 12, + "ActualUploadSize": 11, + "FolderName": foo/bar, + "ReadyForApproval": true , "State:" 0, ], @@ -69,7 +80,7 @@ func TestBcDriveString(t *testing.T){ assert.Equal(t, expectedResult, testBcDrive.String()) } -func TestDriveInfoString(t *testing.T){ +func TestDriveInfoString(t *testing.T) { expectedResult := fmt.Sprintf( ` "LastApprovedDataModificationId": 0400000000000000000000000000000000000000000000000000000000000000, @@ -80,7 +91,7 @@ func TestDriveInfoString(t *testing.T){ assert.Equal(t, expectedResult, testDriveInfov2.String()) } -func TestReplicatorString(t *testing.T){ +func TestReplicatorString(t *testing.T) { expectedResult := fmt.Sprintf( ` ReplicatorAccount: Address: [Type=168, Address=VDQPWCXBJRL5JW4VAWVWGWXDCLREERSI24PBUSUL], PublicKey: "36E7F50C8B8BC9A4FC6325B2359E0E5DB50C75A914B5292AD726FD5AE3992691", @@ -95,4 +106,4 @@ func TestReplicatorString(t *testing.T){ ], `) assert.Equal(t, expectedResult, testReplicator.String()) -} \ No newline at end of file +} diff --git a/sdk/storagev2_schema.go b/sdk/storagev2_schema.go index 018189b5..318e3684 100644 --- a/sdk/storagev2_schema.go +++ b/sdk/storagev2_schema.go @@ -62,6 +62,21 @@ func replicatorOffboardingTransactionSchema() *schema { newScalarAttribute("type", ShortSize), newArrayAttribute("maxFee", IntSize), newArrayAttribute("deadline", IntSize), + newArrayAttribute("recipient", ByteSize), + newScalarAttribute("messageSize", ShortSize), + newScalarAttribute("numMosaics", ByteSize), + newTableAttribute("message", schema{ + []schemaAttribute{ + newScalarAttribute("type", ByteSize), + newArrayAttribute("payload", ByteSize), + }, + }.schemaDefinition), + newTableArrayAttribute("mosaics", schema{ + []schemaAttribute{ + newArrayAttribute("id", IntSize), + newArrayAttribute("amount", IntSize), + }, + }.schemaDefinition), }, } -} \ No newline at end of file +} diff --git a/sdk/streamingv2.go b/sdk/streamingv2.go new file mode 100644 index 00000000..d6549f14 --- /dev/null +++ b/sdk/streamingv2.go @@ -0,0 +1,7 @@ +// Copyright 2021 ProximaX Limited. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package sdk + +type StreamingV2Service service diff --git a/sdk/streamingv2_model.go b/sdk/streamingv2_model.go new file mode 100644 index 00000000..bb69d04b --- /dev/null +++ b/sdk/streamingv2_model.go @@ -0,0 +1,28 @@ +// Copyright 2021 ProximaX Limited. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package sdk + +type StreamStartTransaction struct { + AbstractTransaction + DriveKey string + ExpectedUploadSize StorageSize + FolderName string + FeedbackFeeAmount Amount +} + +type StreamFinishTransaction struct { + AbstractTransaction + DriveKey string + StreamId string + ActualUploadSize StorageSize + StreamStructureCdi string +} + +type StreamPaymentTransaction struct { + AbstractTransaction + DriveKey string + StreamId string + AdditionalUploadSize StorageSize +} diff --git a/sdk/streamingv2_schema.go b/sdk/streamingv2_schema.go new file mode 100644 index 00000000..669ed5b1 --- /dev/null +++ b/sdk/streamingv2_schema.go @@ -0,0 +1,59 @@ +// Copyright 2021 ProximaX Limited. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package sdk + +func streamStartTransactionSchema() *schema { + return &schema{ + []schemaAttribute{ + newScalarAttribute("size", IntSize), + newArrayAttribute("signature", ByteSize), + newArrayAttribute("signer", ByteSize), + newScalarAttribute("version", IntSize), + newScalarAttribute("type", ShortSize), + newArrayAttribute("maxFee", IntSize), + newArrayAttribute("deadline", IntSize), + newArrayAttribute("driveKey", ByteSize), + newArrayAttribute("expectedUploadSize", IntSize), + newScalarAttribute("folderNameSize", ShortSize), + newArrayAttribute("feedbackFeeAmount", IntSize), + newArrayAttribute("folderName", ByteSize), + }, + } +} + +func streamFinishTransactionSchema() *schema { + return &schema{ + []schemaAttribute{ + newScalarAttribute("size", IntSize), + newArrayAttribute("signature", ByteSize), + newArrayAttribute("signer", ByteSize), + newScalarAttribute("version", IntSize), + newScalarAttribute("type", ShortSize), + newArrayAttribute("maxFee", IntSize), + newArrayAttribute("deadline", IntSize), + newArrayAttribute("driveKey", ByteSize), + newArrayAttribute("streamId", ByteSize), + newArrayAttribute("actualUploadSize", IntSize), + newArrayAttribute("streamStructureCdi", ByteSize), + }, + } +} + +func streamPaymentTransactionSchema() *schema { + return &schema{ + []schemaAttribute{ + newScalarAttribute("size", IntSize), + newArrayAttribute("signature", ByteSize), + newArrayAttribute("signer", ByteSize), + newScalarAttribute("version", IntSize), + newScalarAttribute("type", ShortSize), + newArrayAttribute("maxFee", IntSize), + newArrayAttribute("deadline", IntSize), + newArrayAttribute("driveKey", ByteSize), + newArrayAttribute("streamId", ByteSize), + newArrayAttribute("additionalUploadSize", IntSize), + }, + } +} diff --git a/sdk/streamingv2_transaction.go b/sdk/streamingv2_transaction.go new file mode 100644 index 00000000..530d1d52 --- /dev/null +++ b/sdk/streamingv2_transaction.go @@ -0,0 +1,370 @@ +// Copyright 2021 ProximaX Limited. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package sdk + +import ( + "encoding/hex" + "fmt" + flatbuffers "github.com/google/flatbuffers/go" + "github.com/proximax-storage/go-xpx-chain-sdk/transactions" +) + +func NewStreamStartTransaction( + deadline *Deadline, + driveKey string, + expectedUploadSize StorageSize, + folderName string, + feedbackFeeAmount Amount, + networkType NetworkType, +) (*StreamStartTransaction, error) { + + tx := StreamStartTransaction{ + AbstractTransaction: AbstractTransaction{ + Deadline: deadline, + Version: StreamStartVersion, + Type: StreamStart, + NetworkType: networkType, + }, + DriveKey: driveKey, + ExpectedUploadSize: expectedUploadSize, + FolderName: folderName, + FeedbackFeeAmount: feedbackFeeAmount, + } + + return &tx, nil +} + +func (tx *StreamStartTransaction) GetAbstractTransaction() *AbstractTransaction { + return &tx.AbstractTransaction +} + +func (tx *StreamStartTransaction) String() string { + return fmt.Sprintf( + ` + "AbstractTransaction": %s, + "DriveKey": %s, + "ExpectedUploadSize": %d, + "FolderName": %s, + "FeedbackFeeAmount", %v, + `, + tx.AbstractTransaction.String(), + tx.DriveKey, + tx.ExpectedUploadSize, + tx.FolderName, + tx.FeedbackFeeAmount, + ) +} + +func (tx *StreamStartTransaction) Bytes() ([]byte, error) { + builder := flatbuffers.NewBuilder(0) + + bytes := []byte(tx.FolderName) + fp := transactions.TransactionBufferCreateByteVector(builder, bytes) + + v, signatureV, signerV, deadlineV, fV, err := tx.AbstractTransaction.generateVectors(builder) + if err != nil { + return nil, err + } + + driveKeyB, err := hex.DecodeString(tx.DriveKey) + if err != nil { + return nil, err + } + + driveKeyV := transactions.TransactionBufferCreateByteVector(builder, driveKeyB) + expectedUploadSizeV := transactions.TransactionBufferCreateUint32Vector(builder, tx.ExpectedUploadSize.toArray()) + feedbackFeeAmountV := transactions.TransactionBufferCreateUint32Vector(builder, tx.FeedbackFeeAmount.toArray()) + + transactions.StreamStartTransactionBufferStart(builder) + transactions.TransactionBufferAddSize(builder, tx.Size()) + tx.AbstractTransaction.buildVectors(builder, v, signatureV, signerV, deadlineV, fV) + + transactions.StreamStartTransactionBufferAddDriveKey(builder, driveKeyV) + transactions.StreamStartTransactionBufferAddExpectedUploadSize(builder, expectedUploadSizeV) + transactions.StreamStartTransactionBufferAddFolderNameSize(builder, uint16(tx.FolderNameSize())) + + transactions.StreamStartTransactionBufferAddFolderName(builder, fp) + + transactions.StreamStartTransactionBufferAddFeedbackFeeAmount(builder, feedbackFeeAmountV) + + t := transactions.StreamStartTransactionBufferEnd(builder) + builder.Finish(t) + + return streamStartTransactionSchema().serialize(builder.FinishedBytes()), nil +} + +func (tx *StreamStartTransaction) Size() int { + return StreamStartHeaderSize + tx.FolderNameSize() +} + +func (tx *StreamStartTransaction) FolderNameSize() int { + return len(tx.FolderName) +} + +type streamStartTransactionDTO struct { + Tx struct { + abstractTransactionDTO + DriveKey string `json:"driveKey"` + ExpectedUploadSize uint64DTO `json:"expectedUploadSize"` + FolderName string `json:"folderName"` + FeedbackFeeAmount uint64DTO `json:"feedbackFeeAmount"` + } `json:"transaction"` + TDto transactionInfoDTO `json:"meta"` +} + +func (dto *streamStartTransactionDTO) toStruct(*Hash) (Transaction, error) { + info, err := dto.TDto.toStruct() + if err != nil { + return nil, err + } + + atx, err := dto.Tx.abstractTransactionDTO.toStruct(info) + if err != nil { + return nil, err + } + + return &StreamStartTransaction{ + *atx, + dto.Tx.DriveKey, + dto.Tx.ExpectedUploadSize.toStruct(), + dto.Tx.FolderName, + dto.Tx.FeedbackFeeAmount.toStruct(), + }, nil +} + +func NewStreamFinishTransaction( + deadline *Deadline, + driveKey string, + streamId string, + actualUploadSize StorageSize, + streamStructureCdi string, + networkType NetworkType, +) (*StreamFinishTransaction, error) { + + tx := StreamFinishTransaction{ + AbstractTransaction: AbstractTransaction{ + Deadline: deadline, + Version: StreamFinishVersion, + Type: StreamFinish, + NetworkType: networkType, + }, + DriveKey: driveKey, + StreamId: streamId, + ActualUploadSize: actualUploadSize, + StreamStructureCdi: streamStructureCdi, + } + + return &tx, nil +} + +func (tx *StreamFinishTransaction) GetAbstractTransaction() *AbstractTransaction { + return &tx.AbstractTransaction +} + +func (tx *StreamFinishTransaction) String() string { + return fmt.Sprintf( + ` + "AbstractTransaction": %s, + "DriveKey": %s, + "StreamId": %s + "ActualUploadSize": %d, + "StreamStructureCdi": %s, + `, + tx.AbstractTransaction.String(), + tx.DriveKey, + tx.StreamId, + tx.ActualUploadSize, + tx.StreamStructureCdi, + ) +} + +func (tx *StreamFinishTransaction) Bytes() ([]byte, error) { + builder := flatbuffers.NewBuilder(0) + + v, signatureV, signerV, deadlineV, fV, err := tx.AbstractTransaction.generateVectors(builder) + if err != nil { + return nil, err + } + + driveKeyB, err := hex.DecodeString(tx.DriveKey) + if err != nil { + return nil, err + } + + streamIdB, err := hex.DecodeString(tx.StreamId) + if err != nil { + return nil, err + } + + streamStructureCdi, err := hex.DecodeString(tx.StreamStructureCdi) + if err != nil { + return nil, err + } + + driveKeyV := transactions.TransactionBufferCreateByteVector(builder, driveKeyB) + streamIdV := transactions.TransactionBufferCreateByteVector(builder, streamIdB) + actualUploadSizeV := transactions.TransactionBufferCreateUint32Vector(builder, tx.ActualUploadSize.toArray()) + streamStructureCdiV := transactions.TransactionBufferCreateByteVector(builder, streamStructureCdi) + + transactions.StreamFinishTransactionBufferStart(builder) + transactions.TransactionBufferAddSize(builder, tx.Size()) + tx.AbstractTransaction.buildVectors(builder, v, signatureV, signerV, deadlineV, fV) + + transactions.StreamFinishTransactionBufferAddDriveKey(builder, driveKeyV) + transactions.StreamFinishTransactionBufferAddStreamId(builder, streamIdV) + transactions.StreamFinishTransactionBufferAddActualUploadSize(builder, actualUploadSizeV) + transactions.StreamFinishTransactionBufferAddStreamStructureCdi(builder, streamStructureCdiV) + + t := transactions.StreamFinishTransactionBufferEnd(builder) + builder.Finish(t) + + return streamFinishTransactionSchema().serialize(builder.FinishedBytes()), nil +} + +func (tx *StreamFinishTransaction) Size() int { + return StreamFinishHeaderSize +} + +type streamFinishTransactionDTO struct { + Tx struct { + abstractTransactionDTO + DriveKey string `json:"driveKey"` + StreamId string `json:"streamId"` + ActualUploadSize uint64DTO `json:"actualUploadSize"` + StreamStructureCdi string `json:"streamStructureCdi"` + } `json:"transaction"` + TDto transactionInfoDTO `json:"meta"` +} + +func (dto *streamFinishTransactionDTO) toStruct(*Hash) (Transaction, error) { + info, err := dto.TDto.toStruct() + if err != nil { + return nil, err + } + + atx, err := dto.Tx.abstractTransactionDTO.toStruct(info) + if err != nil { + return nil, err + } + + return &StreamFinishTransaction{ + *atx, + dto.Tx.DriveKey, + dto.Tx.StreamId, + dto.Tx.ActualUploadSize.toStruct(), + dto.Tx.StreamStructureCdi, + }, nil +} + +func NewStreamPaymentTransaction( + deadline *Deadline, + driveKey string, + streamId string, + additionalUploadSize StorageSize, + networkType NetworkType, +) (*StreamPaymentTransaction, error) { + + tx := StreamPaymentTransaction{ + AbstractTransaction: AbstractTransaction{ + Deadline: deadline, + Version: StreamPaymentVersion, + Type: StreamPayment, + NetworkType: networkType, + }, + DriveKey: driveKey, + StreamId: streamId, + AdditionalUploadSize: additionalUploadSize, + } + + return &tx, nil +} + +func (tx *StreamPaymentTransaction) GetAbstractTransaction() *AbstractTransaction { + return &tx.AbstractTransaction +} + +func (tx *StreamPaymentTransaction) String() string { + return fmt.Sprintf( + ` + "AbstractTransaction": %s, + "DriveKey": %s, + "StreamId": %s + "AdditionalUploadSize": %d, + `, + tx.AbstractTransaction.String(), + tx.DriveKey, + tx.StreamId, + tx.AdditionalUploadSize, + ) +} + +func (tx *StreamPaymentTransaction) Bytes() ([]byte, error) { + builder := flatbuffers.NewBuilder(0) + + v, signatureV, signerV, deadlineV, fV, err := tx.AbstractTransaction.generateVectors(builder) + if err != nil { + return nil, err + } + + driveKeyB, err := hex.DecodeString(tx.DriveKey) + if err != nil { + return nil, err + } + + streamIdB, err := hex.DecodeString(tx.StreamId) + if err != nil { + return nil, err + } + + driveKeyV := transactions.TransactionBufferCreateByteVector(builder, driveKeyB) + streamIdV := transactions.TransactionBufferCreateByteVector(builder, streamIdB) + additionalUploadSizeV := transactions.TransactionBufferCreateUint32Vector(builder, tx.AdditionalUploadSize.toArray()) + + transactions.StreamPaymentTransactionBufferStart(builder) + transactions.TransactionBufferAddSize(builder, tx.Size()) + tx.AbstractTransaction.buildVectors(builder, v, signatureV, signerV, deadlineV, fV) + + transactions.StreamPaymentTransactionBufferAddDriveKey(builder, driveKeyV) + transactions.StreamPaymentTransactionBufferAddStreamId(builder, streamIdV) + transactions.StreamPaymentTransactionBufferAddAdditionalUploadSize(builder, additionalUploadSizeV) + + t := transactions.StreamPaymentTransactionBufferEnd(builder) + builder.Finish(t) + + return streamPaymentTransactionSchema().serialize(builder.FinishedBytes()), nil +} + +func (tx *StreamPaymentTransaction) Size() int { + return StreamPaymentHeaderSize +} + +type streamPaymentTransactionDTO struct { + Tx struct { + abstractTransactionDTO + DriveKey string `json:"driveKey"` + StreamId string `json:"streamId"` + AdditionalUploadSize uint64DTO `json:"additionalUploadSize"` + } `json:"transaction"` + TDto transactionInfoDTO `json:"meta"` +} + +func (dto *streamPaymentTransactionDTO) toStruct(*Hash) (Transaction, error) { + info, err := dto.TDto.toStruct() + if err != nil { + return nil, err + } + + atx, err := dto.Tx.abstractTransactionDTO.toStruct(info) + if err != nil { + return nil, err + } + + return &StreamPaymentTransaction{ + *atx, + dto.Tx.DriveKey, + dto.Tx.StreamId, + dto.Tx.AdditionalUploadSize.toStruct(), + }, nil +} diff --git a/sdk/transaction_model.go b/sdk/transaction_model.go index 039ea45d..143f5493 100644 --- a/sdk/transaction_model.go +++ b/sdk/transaction_model.go @@ -2787,6 +2787,9 @@ const ( ReplicatorOnboardingHeaderSize = TransactionHeaderSize + AmountSize + BlsKeySize PrepareBcDriveHeaderSize = TransactionHeaderSize + StorageSizeSize + AmountSize + 2 DriveClosureHeaderSize = TransactionHeaderSize + KeySize + StreamStartHeaderSize = TransactionHeaderSize + KeySize + StorageSizeSize + MessageSizeSize + AmountSize + StreamFinishHeaderSize = TransactionHeaderSize + KeySize + Hash256 + StorageSizeSize + Hash256 + StreamPaymentHeaderSize = TransactionHeaderSize + KeySize + Hash256 + StorageSizeSize ) type EntityType uint16 @@ -2852,6 +2855,9 @@ const ( DataModificationCancel EntityType = 0x4562 ReplicatorOnboarding EntityType = 0x4662 DriveClosure EntityType = 0x4E62 + StreamStart EntityType = 0x4167 + StreamFinish EntityType = 0x4267 + StreamPayment EntityType = 0x4367 ) func (t EntityType) String() string { @@ -2918,6 +2924,9 @@ const ( DataModificationCancelVersion EntityVersion = 1 DownloadVersion EntityVersion = 1 DriveClosureVersion EntityVersion = 1 + StreamStartVersion EntityVersion = 1 + StreamFinishVersion EntityVersion = 1 + StreamPaymentVersion EntityVersion = 1 ) type AccountLinkAction uint8 @@ -3189,6 +3198,12 @@ func MapTransaction(b *bytes.Buffer, generationHash *Hash) (Transaction, error) dto = &driveClosureTransactionDTO{} case ReplicatorOffboarding: dto = &replicatorOffboardingTransactionDTO{} + case StreamStart: + dto = &streamStartTransactionDTO{} + case StreamFinish: + dto = &streamFinishTransactionDTO{} + case StreamPayment: + dto = &streamPaymentTransactionDTO{} } return dtoToTransaction(b, dto, generationHash) diff --git a/transactions/schemas/schema_streamingv2_transaction.fbs b/transactions/schemas/schema_streamingv2_transaction.fbs new file mode 100644 index 00000000..7f1e5f1a --- /dev/null +++ b/transactions/schemas/schema_streamingv2_transaction.fbs @@ -0,0 +1,47 @@ +namespace Catapult.Buffers; + +table StreamStartTransactionBuffer { + size: uint; + signature: [ubyte]; + signer: [ubyte]; + version: uint; + type: ushort; + maxFee: [uint]; + deadline: [uint]; + driveKey: [ubyte]; + expectedUploadSize: [uint]; + folderNameSize: ushort; + feedbackFeeAmount: [uint]; + folderName: [ubyte]; +} + +table StreamFinishTransactionBuffer { + size: uint; + signature: [ubyte]; + signer: [ubyte]; + version: uint; + type: ushort; + maxFee: [uint]; + deadline: [uint]; + driveKey: [ubyte]; + streamId: [ubyte]; + actualUploadSize: [uint]; + streamStructureCdi: [ubyte]; +} + +table StreamPaymentTransactionBuffer { + size: uint; + signature: [ubyte]; + signer: [ubyte]; + version: uint; + type: ushort; + maxFee: [uint]; + deadline: [uint]; + driveKey: [ubyte]; + streamId: [ubyte]; + additionalUploadSize: [uint]; +} + +root_type StreamStartTransactionBuffer; +root_type StreamFinishTransactionBuffer; +root_type StreamPaymentTransactionBuffer; \ No newline at end of file diff --git a/transactions/streamingv2_transaction_buffer.go b/transactions/streamingv2_transaction_buffer.go new file mode 100644 index 00000000..5758f5b4 --- /dev/null +++ b/transactions/streamingv2_transaction_buffer.go @@ -0,0 +1,1099 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package transactions + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type StreamStartTransactionBuffer struct { + _tab flatbuffers.Table +} + +func GetRootAsStreamStartTransactionBuffer(buf []byte, offset flatbuffers.UOffsetT) *StreamStartTransactionBuffer { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &StreamStartTransactionBuffer{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsStreamStartTransactionBuffer(buf []byte, offset flatbuffers.UOffsetT) *StreamStartTransactionBuffer { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &StreamStartTransactionBuffer{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *StreamStartTransactionBuffer) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *StreamStartTransactionBuffer) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *StreamStartTransactionBuffer) Size() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) MutateSize(n uint32) bool { + return rcv._tab.MutateUint32Slot(4, n) +} + +func (rcv *StreamStartTransactionBuffer) Signature(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) SignatureLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) SignatureBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamStartTransactionBuffer) MutateSignature(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamStartTransactionBuffer) Signer(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) SignerLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) SignerBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamStartTransactionBuffer) MutateSigner(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamStartTransactionBuffer) Version() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) MutateVersion(n uint32) bool { + return rcv._tab.MutateUint32Slot(10, n) +} + +func (rcv *StreamStartTransactionBuffer) Type() uint16 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return rcv._tab.GetUint16(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) MutateType(n uint16) bool { + return rcv._tab.MutateUint16Slot(12, n) +} + +func (rcv *StreamStartTransactionBuffer) MaxFee(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) MaxFeeLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) MutateMaxFee(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func (rcv *StreamStartTransactionBuffer) Deadline(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) DeadlineLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) MutateDeadline(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func (rcv *StreamStartTransactionBuffer) DriveKey(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) DriveKeyLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) DriveKeyBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamStartTransactionBuffer) MutateDriveKey(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamStartTransactionBuffer) ExpectedUploadSize(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) ExpectedUploadSizeLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) MutateExpectedUploadSize(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func (rcv *StreamStartTransactionBuffer) FolderNameSize() uint16 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + return rcv._tab.GetUint16(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) MutateFolderNameSize(n uint16) bool { + return rcv._tab.MutateUint16Slot(22, n) +} + +func (rcv *StreamStartTransactionBuffer) FeedbackFeeAmount(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) FeedbackFeeAmountLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) MutateFeedbackFeeAmount(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func (rcv *StreamStartTransactionBuffer) FolderName(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(26)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) FolderNameLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(26)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamStartTransactionBuffer) FolderNameBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(26)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamStartTransactionBuffer) MutateFolderName(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(26)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func StreamStartTransactionBufferStart(builder *flatbuffers.Builder) { + builder.StartObject(12) +} +func StreamStartTransactionBufferAddSize(builder *flatbuffers.Builder, size uint32) { + builder.PrependUint32Slot(0, size, 0) +} +func StreamStartTransactionBufferAddSignature(builder *flatbuffers.Builder, signature flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(signature), 0) +} +func StreamStartTransactionBufferStartSignatureVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamStartTransactionBufferAddSigner(builder *flatbuffers.Builder, signer flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(signer), 0) +} +func StreamStartTransactionBufferStartSignerVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamStartTransactionBufferAddVersion(builder *flatbuffers.Builder, version uint32) { + builder.PrependUint32Slot(3, version, 0) +} +func StreamStartTransactionBufferAddType(builder *flatbuffers.Builder, type_ uint16) { + builder.PrependUint16Slot(4, type_, 0) +} +func StreamStartTransactionBufferAddMaxFee(builder *flatbuffers.Builder, maxFee flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(maxFee), 0) +} +func StreamStartTransactionBufferStartMaxFeeVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamStartTransactionBufferAddDeadline(builder *flatbuffers.Builder, deadline flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(deadline), 0) +} +func StreamStartTransactionBufferStartDeadlineVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamStartTransactionBufferAddDriveKey(builder *flatbuffers.Builder, driveKey flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(7, flatbuffers.UOffsetT(driveKey), 0) +} +func StreamStartTransactionBufferStartDriveKeyVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamStartTransactionBufferAddExpectedUploadSize(builder *flatbuffers.Builder, expectedUploadSize flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(8, flatbuffers.UOffsetT(expectedUploadSize), 0) +} +func StreamStartTransactionBufferStartExpectedUploadSizeVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamStartTransactionBufferAddFolderNameSize(builder *flatbuffers.Builder, folderNameSize uint16) { + builder.PrependUint16Slot(9, folderNameSize, 0) +} +func StreamStartTransactionBufferAddFeedbackFeeAmount(builder *flatbuffers.Builder, feedbackFeeAmount flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(10, flatbuffers.UOffsetT(feedbackFeeAmount), 0) +} +func StreamStartTransactionBufferStartFeedbackFeeAmountVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamStartTransactionBufferAddFolderName(builder *flatbuffers.Builder, folderName flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(11, flatbuffers.UOffsetT(folderName), 0) +} +func StreamStartTransactionBufferStartFolderNameVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamStartTransactionBufferEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} + +type StreamFinishTransactionBuffer struct { + _tab flatbuffers.Table +} + +func GetRootAsStreamFinishTransactionBuffer(buf []byte, offset flatbuffers.UOffsetT) *StreamFinishTransactionBuffer { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &StreamFinishTransactionBuffer{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsStreamFinishTransactionBuffer(buf []byte, offset flatbuffers.UOffsetT) *StreamFinishTransactionBuffer { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &StreamFinishTransactionBuffer{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *StreamFinishTransactionBuffer) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *StreamFinishTransactionBuffer) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *StreamFinishTransactionBuffer) Size() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) MutateSize(n uint32) bool { + return rcv._tab.MutateUint32Slot(4, n) +} + +func (rcv *StreamFinishTransactionBuffer) Signature(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) SignatureLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) SignatureBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamFinishTransactionBuffer) MutateSignature(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamFinishTransactionBuffer) Signer(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) SignerLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) SignerBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamFinishTransactionBuffer) MutateSigner(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamFinishTransactionBuffer) Version() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) MutateVersion(n uint32) bool { + return rcv._tab.MutateUint32Slot(10, n) +} + +func (rcv *StreamFinishTransactionBuffer) Type() uint16 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return rcv._tab.GetUint16(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) MutateType(n uint16) bool { + return rcv._tab.MutateUint16Slot(12, n) +} + +func (rcv *StreamFinishTransactionBuffer) MaxFee(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) MaxFeeLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) MutateMaxFee(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func (rcv *StreamFinishTransactionBuffer) Deadline(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) DeadlineLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) MutateDeadline(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func (rcv *StreamFinishTransactionBuffer) DriveKey(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) DriveKeyLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) DriveKeyBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamFinishTransactionBuffer) MutateDriveKey(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamFinishTransactionBuffer) StreamId(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) StreamIdLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) StreamIdBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamFinishTransactionBuffer) MutateStreamId(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamFinishTransactionBuffer) ActualUploadSize(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) ActualUploadSizeLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) MutateActualUploadSize(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func (rcv *StreamFinishTransactionBuffer) StreamStructureCdi(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) StreamStructureCdiLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamFinishTransactionBuffer) StreamStructureCdiBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamFinishTransactionBuffer) MutateStreamStructureCdi(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func StreamFinishTransactionBufferStart(builder *flatbuffers.Builder) { + builder.StartObject(11) +} +func StreamFinishTransactionBufferAddSize(builder *flatbuffers.Builder, size uint32) { + builder.PrependUint32Slot(0, size, 0) +} +func StreamFinishTransactionBufferAddSignature(builder *flatbuffers.Builder, signature flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(signature), 0) +} +func StreamFinishTransactionBufferStartSignatureVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamFinishTransactionBufferAddSigner(builder *flatbuffers.Builder, signer flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(signer), 0) +} +func StreamFinishTransactionBufferStartSignerVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamFinishTransactionBufferAddVersion(builder *flatbuffers.Builder, version uint32) { + builder.PrependUint32Slot(3, version, 0) +} +func StreamFinishTransactionBufferAddType(builder *flatbuffers.Builder, type_ uint16) { + builder.PrependUint16Slot(4, type_, 0) +} +func StreamFinishTransactionBufferAddMaxFee(builder *flatbuffers.Builder, maxFee flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(maxFee), 0) +} +func StreamFinishTransactionBufferStartMaxFeeVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamFinishTransactionBufferAddDeadline(builder *flatbuffers.Builder, deadline flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(deadline), 0) +} +func StreamFinishTransactionBufferStartDeadlineVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamFinishTransactionBufferAddDriveKey(builder *flatbuffers.Builder, driveKey flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(7, flatbuffers.UOffsetT(driveKey), 0) +} +func StreamFinishTransactionBufferStartDriveKeyVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamFinishTransactionBufferAddStreamId(builder *flatbuffers.Builder, streamId flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(8, flatbuffers.UOffsetT(streamId), 0) +} +func StreamFinishTransactionBufferStartStreamIdVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamFinishTransactionBufferAddActualUploadSize(builder *flatbuffers.Builder, actualUploadSize flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(9, flatbuffers.UOffsetT(actualUploadSize), 0) +} +func StreamFinishTransactionBufferStartActualUploadSizeVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamFinishTransactionBufferAddStreamStructureCdi(builder *flatbuffers.Builder, streamStructureCdi flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(10, flatbuffers.UOffsetT(streamStructureCdi), 0) +} +func StreamFinishTransactionBufferStartStreamStructureCdiVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamFinishTransactionBufferEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} + +type StreamPaymentTransactionBuffer struct { + _tab flatbuffers.Table +} + +func GetRootAsStreamPaymentTransactionBuffer(buf []byte, offset flatbuffers.UOffsetT) *StreamPaymentTransactionBuffer { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &StreamPaymentTransactionBuffer{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsStreamPaymentTransactionBuffer(buf []byte, offset flatbuffers.UOffsetT) *StreamPaymentTransactionBuffer { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &StreamPaymentTransactionBuffer{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *StreamPaymentTransactionBuffer) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *StreamPaymentTransactionBuffer) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *StreamPaymentTransactionBuffer) Size() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) MutateSize(n uint32) bool { + return rcv._tab.MutateUint32Slot(4, n) +} + +func (rcv *StreamPaymentTransactionBuffer) Signature(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) SignatureLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) SignatureBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamPaymentTransactionBuffer) MutateSignature(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamPaymentTransactionBuffer) Signer(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) SignerLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) SignerBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamPaymentTransactionBuffer) MutateSigner(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamPaymentTransactionBuffer) Version() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) MutateVersion(n uint32) bool { + return rcv._tab.MutateUint32Slot(10, n) +} + +func (rcv *StreamPaymentTransactionBuffer) Type() uint16 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return rcv._tab.GetUint16(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) MutateType(n uint16) bool { + return rcv._tab.MutateUint16Slot(12, n) +} + +func (rcv *StreamPaymentTransactionBuffer) MaxFee(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) MaxFeeLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) MutateMaxFee(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func (rcv *StreamPaymentTransactionBuffer) Deadline(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) DeadlineLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) MutateDeadline(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func (rcv *StreamPaymentTransactionBuffer) DriveKey(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) DriveKeyLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) DriveKeyBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamPaymentTransactionBuffer) MutateDriveKey(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamPaymentTransactionBuffer) StreamId(j int) byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) StreamIdLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) StreamIdBytes() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *StreamPaymentTransactionBuffer) MutateStreamId(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + +func (rcv *StreamPaymentTransactionBuffer) AdditionalUploadSize(j int) uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetUint32(a + flatbuffers.UOffsetT(j*4)) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) AdditionalUploadSizeLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *StreamPaymentTransactionBuffer) MutateAdditionalUploadSize(j int, n uint32) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateUint32(a+flatbuffers.UOffsetT(j*4), n) + } + return false +} + +func StreamPaymentTransactionBufferStart(builder *flatbuffers.Builder) { + builder.StartObject(10) +} +func StreamPaymentTransactionBufferAddSize(builder *flatbuffers.Builder, size uint32) { + builder.PrependUint32Slot(0, size, 0) +} +func StreamPaymentTransactionBufferAddSignature(builder *flatbuffers.Builder, signature flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(signature), 0) +} +func StreamPaymentTransactionBufferStartSignatureVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamPaymentTransactionBufferAddSigner(builder *flatbuffers.Builder, signer flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(signer), 0) +} +func StreamPaymentTransactionBufferStartSignerVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamPaymentTransactionBufferAddVersion(builder *flatbuffers.Builder, version uint32) { + builder.PrependUint32Slot(3, version, 0) +} +func StreamPaymentTransactionBufferAddType(builder *flatbuffers.Builder, type_ uint16) { + builder.PrependUint16Slot(4, type_, 0) +} +func StreamPaymentTransactionBufferAddMaxFee(builder *flatbuffers.Builder, maxFee flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(maxFee), 0) +} +func StreamPaymentTransactionBufferStartMaxFeeVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamPaymentTransactionBufferAddDeadline(builder *flatbuffers.Builder, deadline flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(deadline), 0) +} +func StreamPaymentTransactionBufferStartDeadlineVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamPaymentTransactionBufferAddDriveKey(builder *flatbuffers.Builder, driveKey flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(7, flatbuffers.UOffsetT(driveKey), 0) +} +func StreamPaymentTransactionBufferStartDriveKeyVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamPaymentTransactionBufferAddStreamId(builder *flatbuffers.Builder, streamId flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(8, flatbuffers.UOffsetT(streamId), 0) +} +func StreamPaymentTransactionBufferStartStreamIdVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func StreamPaymentTransactionBufferAddAdditionalUploadSize(builder *flatbuffers.Builder, additionalUploadSize flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(9, flatbuffers.UOffsetT(additionalUploadSize), 0) +} +func StreamPaymentTransactionBufferStartAdditionalUploadSizeVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func StreamPaymentTransactionBufferEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +}