Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R21 bc 245 #26

Open
wants to merge 127 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
9a0a796
Added DownloadPaymentTransaction
Cempl Dec 16, 2021
c6465b2
Implemented following transactions: DriveClosure, FinishDownload, Sto…
Cempl Dec 17, 2021
9bffe21
Added ser/des, correct types
Cempl Dec 17, 2021
c933e12
Fixed types
Cempl Dec 17, 2021
3dfa29b
Reworked download transaction to v3
Cempl Jan 11, 2022
f166330
Fixed tabulation
Cempl Jan 11, 2022
f995501
Fixed tabulation
Cempl Jan 11, 2022
fccb3e1
Implemented ReplicatorOffboardingTransaction, formatting
Cempl Jan 13, 2022
6adf33f
Added missed field "listOfPublicKeys" related to DownloadTransaction
Cempl Jan 14, 2022
3ba9cb8
Fix transactions related to storage v3
Cempl Jan 14, 2022
50350a7
Merge remote-tracking branch 'origin/R21BC-245' into R21BC-245
Cempl Jan 14, 2022
a037b54
Fix DownloadTransaction
Cempl Jan 14, 2022
0876eb4
Fix DownloadTransaction
Cempl Jan 17, 2022
e730dcf
Added comment
Cempl Jan 17, 2022
9c42fb6
Added storage service.
otsybizov Jan 18, 2022
f3fe993
example
Cempl Jan 18, 2022
188ade4
Merge remote-tracking branch 'origin/R21BC-245' into R21BC-245
Cempl Jan 18, 2022
50cccf7
Updated data_modification_approval_transaction
Cempl Jan 24, 2022
01a65d8
aligned storage (drive) routes to last API
Cempl Jan 25, 2022
dc960df
Implemented entities: replicator, download channel, pages
Cempl Jan 25, 2022
15002c1
Implemented new routes: replicators, download_channels
Cempl Jan 25, 2022
27e34c6
Parsed error message from server
Cempl Jan 26, 2022
31ff79d
Fixed type of replicatorCount from uint32 to uin16
Cempl Jan 26, 2022
d7931ff
renamed field state to modificationState
Cempl Jan 27, 2022
ef46e5c
renamed back field modificationState to state
Cempl Jan 27, 2022
2da297d
Fix payment field type
Cempl Jan 27, 2022
5bf2f87
Fixed the issue with double call of async_write (websocket).
Cempl Feb 8, 2022
91288d9
Fixed bug with disconnect() func
Cempl Feb 11, 2022
a4c5889
Implemented common notifier
Cempl Feb 11, 2022
5214e82
Removed repeated code, implemented lock-free approach for notificatio…
Cempl Feb 11, 2022
7d31a53
Fixed bug with empty address
Cempl Feb 11, 2022
c81e072
Implemented independent callbacks(success, error) related to websocket
Cempl Feb 14, 2022
e6d88d9
Fix deserialization issues, headers.
Cempl Feb 16, 2022
aea64bc
Remove some fields, fix type of presentOpinions
Cempl Feb 17, 2022
d40c519
Fixed tests according new Notifier behaviour
Cempl Feb 21, 2022
ee14578
Renamed field errorCode to httpErrorCode, removed unnecessary field "…
Cempl Feb 22, 2022
a753549
Added example for aggregate bonded transaction
Cempl Feb 23, 2022
64e466e
Fix Aggregate_Tx_Payload_Start
Cempl Mar 7, 2022
72b91a2
Rename some fields
Cempl Mar 21, 2022
37b55a6
Added downloadShard, dataModificationShard, other fixes
Cempl Mar 21, 2022
9e2381f
Fix fields: presentOpinions, uploadSize, ownerUpload
Cempl Apr 6, 2022
338f199
Added LP transaction base classes
Cempl Apr 12, 2022
ccf724a
Added LP transactions ser/des logic
Cempl Apr 12, 2022
ac95e1a
Merge remote-tracking branch 'origin/R21BC-245' into R21BC-245
Cempl Apr 12, 2022
2d8b6c5
added example liquidity_provider_transactions.cpp
Cempl Apr 12, 2022
500cb93
Added func sendTransferTransactionAsync
Cempl Apr 13, 2022
05837e8
Added example manualRateChangeTransaction
Cempl Apr 13, 2022
b091fa9
Implemented liquidity provider service
Cempl Apr 15, 2022
57d8583
update `downloadChannelInfo` schema
Cempl Apr 28, 2022
221cdf1
Improved notifier
Cempl May 4, 2022
793fb7d
update `Verification` and `Drive` models
ynewmann May 10, 2022
ab16d60
made 'verification' field optional
Cempl May 12, 2022
f495fc1
temporary fix for field 'verification'
Cempl May 13, 2022
d3d36ae
Removed Levy_Mutable flag, fix value of flag 'All'
Cempl May 16, 2022
e2bd4e9
Merge remote-tracking branch 'origin/R21BC-245' into R21BC-245
Cempl May 16, 2022
fff7641
Fix ser/des of mosaic_definition_transaction. Add field mosaicSupply
Cempl May 24, 2022
53ae104
Fixed bugs and build for windows, and updated readme instructions
abdelrahman46 Jun 8, 2022
8cd54dd
Removed filed 'mosaicSupply' from Mosaic definition transaction
Cempl Jun 20, 2022
d0d2a6c
readme file formatting
abdelrahman46 Jun 20, 2022
d252309
Merge pull request #28 from proximax-storage/build-cpp-xpx-chain-sdk-…
Cempl Jul 1, 2022
be35303
Downgrade boost version from 1.79 to 1.71
Cempl Jul 5, 2022
0384bfd
add submodules and conan steps to README
ynewmann Jul 7, 2022
684264c
Updated LP types
Cempl Jul 25, 2022
11b19bd
Updated structures: replicator, storage accordingly to the latest ver…
Cempl Aug 16, 2022
ead462e
changed CmakeList.txt for mac
Alex-Tsarenko Aug 26, 2022
244d5b7
Updated transactions json schema
Cempl Sep 23, 2022
f73e132
Added rapidjson as submodule
Cempl Oct 10, 2022
4a770b1
Removed conan usage
Cempl Oct 10, 2022
2033ef9
Fix build for mac os
Cempl Oct 11, 2022
8c4193a
Fix boost
Cempl Oct 11, 2022
50f1ebf
Add missed network identifiers
Cempl Oct 12, 2022
ccbf403
Added method getConfig
Cempl Oct 13, 2022
f9693d9
Disabled tests by default
Cempl Oct 24, 2022
9c0b297
Fix "std::function bad call"
Cempl Nov 4, 2022
435c1a9
Fix crash
Cempl Nov 16, 2022
ef4e368
Add missed options for some storage routes
Cempl Nov 18, 2022
6d3ac9b
Used const reference instead of shared_ptr
Cempl Nov 23, 2022
b271e33
Added modificationStatus, success fields
Cempl Nov 29, 2022
c47dfd4
Added missed field 'modificationStatus'
Cempl Dec 20, 2022
0df234a
Fix build for linux
Cempl Jan 18, 2023
640e5cf
add some sc_v2 transactions models
ynewmann Mar 28, 2023
31a744e
full support 3 SC_v2 transactions
ynewmann Mar 28, 2023
d845d45
define sc_v2 entry models
ynewmann Mar 28, 2023
9115e13
add ability to read some sc_v2 transaction
ynewmann Mar 30, 2023
0eedc8a
fix endBatch transactions json dtos
ynewmann Mar 31, 2023
a28885f
add supercontract_v2 service
ynewmann Apr 3, 2023
088e5fa
Merge remote-tracking branch 'origin/R21BC-245' into feat/sc_v2
ynewmann Apr 7, 2023
c82a7b1
delete repeated CreateReplicatorOnboardingTransactionImpl
ynewmann Apr 7, 2023
a77d20d
Merge pull request #29 from proximax-storage/feat/sc_v2
ynewmann Apr 27, 2023
f174939
fix SCv2 structs and parsing that was breaking build
ynewmann Apr 28, 2023
9a6dc9f
change `servicePayments` type to Mosaic form MosaicId
ynewmann Jun 8, 2023
7855824
Add missing include
cyrillicw Jun 8, 2023
71e7cd3
fix `servicePayments` de/serialization
ynewmann Jun 8, 2023
3c8721e
Merge remote-tracking branch 'origin/R21BC-245' into R21BC-245
ynewmann Jun 8, 2023
b27c426
Improved notifications service
Cempl Jun 13, 2023
2b308be
Merge remote-tracking branch 'origin/R21BC-245' into R21BC-245
Cempl Jun 13, 2023
f5edee0
Fixed bug related to disconnection
Cempl Jun 23, 2023
68a3ec2
Fixed build for Windows
Cempl Jun 27, 2023
56327b3
Fixed CMakeLists.txt for windows
Cempl Jun 27, 2023
8bf9567
Merge remote-tracking branch 'origin/R21BC-245' into R21BC-245
Cempl Jun 27, 2023
a4dfc37
Implemented streaming transactions
Cempl Jul 11, 2023
118e8b2
Added flag "isStream"
Cempl Jul 12, 2023
721e278
Check boost version
Cempl Jul 19, 2023
27aee0d
Used common callback for websocket connection
Cempl Aug 2, 2023
11bf2d8
Update git ignore
Cempl Aug 22, 2023
3f753d9
Fix crash related to websocket(mac os)
Cempl Aug 30, 2023
7a198a1
Added timeouts for websocket connection
Cempl Nov 6, 2023
cc27ff0
Improved README.md, fix .gitmodules
Cempl Nov 20, 2023
96defa9
support json AddDbrbProcess transaction
ynewmann Dec 19, 2023
58d5a9f
Merge pull request #30 from proximax-storage/feat/dbrb
ynewmann Jan 4, 2024
833737e
submodule
Alex-Tsarenko Feb 13, 2024
1a6fe6c
Merge branch 'develop' into R21BC-245
otsybizov Apr 26, 2024
ef9622c
Add missed ctx stop
Cempl May 27, 2024
7929810
Fix config.h
Cempl Jul 24, 2024
0cbd687
added emscript websocket
Aug 9, 2024
7ad92d0
fixes for Boost 1.86
AlinaYezhkova Sep 20, 2024
31c94d1
Fix build for gcc-14
Cempl Nov 21, 2024
9b7aa24
Suppress errors from rapidjson for gcc-14
Cempl Nov 21, 2024
4eb3c51
Submodules, suppress errors
Cempl Nov 21, 2024
1a18e58
Submodules, suppress errors
Cempl Nov 21, 2024
6d6c66c
Submodules, add compile flags
Cempl Nov 21, 2024
2dc3e3f
Added compile flags
Cempl Nov 21, 2024
f3f8647
Added compile flags
Cempl Nov 21, 2024
d8ba064
Added compile flags
Cempl Nov 21, 2024
96d9c00
Removed compile flags
Cempl Nov 21, 2024
98e736e
Added patch for rapidjson(gcc 14)
Cempl Nov 21, 2024
82d42ea
Fix cmake warnings
Cempl Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace xpx_chain_sdk {
const Key& driveKey,
const Hash256& dataModificationId,
TArgs&&... args):
TBase(TransactionType::Data_Modification_Approval, std::forward<TArgs>(args)...),
TBase(TransactionType::Data_Modification_Cancel, std::forward<TArgs>(args)...),
driveKey_(driveKey),
dataModificationId_(dataModificationId)
{ }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
*** 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.
**/
#pragma once

#include <xpxchaincpp/utils/buffer.h>
#include <xpxchaincpp/model/transaction/transaction.h>
#include <xpxchaincpp/model/transaction/embedded_transaction.h>

#include <memory>
#include <optional>
#include <string>
#include <utility>

namespace xpx_chain_sdk {

/// Download payment transaction base class.
template<typename TBase>
class TDownloadPaymentTransaction: public TBase {
public:
/// Creates download payment transaction.
template<typename... TArgs>
explicit TDownloadPaymentTransaction(
const Hash256& downloadChannelId,
uint64_t downloadSize,
const Amount& feedbackFeeAmount,
TArgs&&... args):
TBase(TransactionType::Download_Payment, std::forward<TArgs>(args)...),
downloadChannelId_(downloadChannelId),
downloadSize_(downloadSize),
feedbackFeeAmount_(feedbackFeeAmount)
{ }

/// Returns identifier of the download channel.
const Hash256& downloadChannelId() const;

/// Returns download size to add to the prepaid size of the download channel.
uint64_t downloadSize() const;

/// Returns amount of XPXs to transfer to the download channel.
const Amount& feedbackFeeAmount() const;

private:
Hash256 downloadChannelId_;
uint64_t downloadSize_;
Amount feedbackFeeAmount_;
};

extern template class TDownloadPaymentTransaction<Transaction>;
extern template class TDownloadPaymentTransaction<EmbeddedTransaction>;

using DownloadPaymentTransaction = TDownloadPaymentTransaction<Transaction>;
using EmbeddedDownloadPaymentTransaction = TDownloadPaymentTransaction<EmbeddedTransaction>;

/// Creates download payment transaction.
/// \note Throws \c transaction_error if mosaics or message have invalid size.
/// \note Optional transaction parameters are initialized using \c Config if not set explicitly.
std::unique_ptr<DownloadPaymentTransaction>
CreateDownloadPaymentTransaction(const Hash256& downloadChannelId,
uint64_t downloadSize,
const Amount& feedbackFeeAmount,
std::optional<Amount> maxFee = std::nullopt,
std::optional<NetworkDuration> deadline = std::nullopt,
std::optional<NetworkIdentifier> networkId = std::nullopt);


/// Creates download payment transaction.
/// \note Throws \c transaction_error if mosaics or message have invalid size.
/// \note Optional transaction parameters are initialized using \c Config if not set explicitly.
std::unique_ptr<EmbeddedDownloadPaymentTransaction>
CreateEmbeddedDownloadPaymentTransaction(const Hash256& downloadChannelId,
uint64_t downloadSize,
const Amount& feedbackFeeAmount,
const Key& signer,
std::optional<NetworkIdentifier> networkId = std::nullopt);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace xpx_chain_sdk {
uint64_t downloadSize,
const Amount& transactionFee,
TArgs&&... args):
TBase(TransactionType::Data_Modification, std::forward<TArgs>(args)...),
TBase(TransactionType::Download, std::forward<TArgs>(args)...),
driveKey_(driveKey),
downloadSize_(downloadSize),
transactionFee_(transactionFee)
Expand Down
62 changes: 62 additions & 0 deletions include/xpxchaincpp/model/transaction/drive_closure_transaction.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
*** 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.
**/
#pragma once

#include <xpxchaincpp/utils/buffer.h>
#include <xpxchaincpp/model/transaction/transaction.h>
#include <xpxchaincpp/model/transaction/embedded_transaction.h>

#include <memory>
#include <optional>
#include <string>
#include <utility>

namespace xpx_chain_sdk {

/// Drive closure transaction base class.
template<typename TBase>
class TDriveClosureTransaction: public TBase {
public:
/// Creates drive closure transaction.
template<typename... TArgs>
explicit TDriveClosureTransaction(
const Key& driveKey,
TArgs&&... args):
TBase(TransactionType::Drive_Closure, std::forward<TArgs>(args)...),
driveKey_(driveKey)
{ }

/// Returns identifier of the drive.
const Hash256& driveKey() const;

private:
Key driveKey_;
};

extern template class TDriveClosureTransaction<Transaction>;
extern template class TDriveClosureTransaction<EmbeddedTransaction>;

using DriveClosureTransaction = TDriveClosureTransaction<Transaction>;
using EmbeddedDriveClosureTransaction = TDriveClosureTransaction<EmbeddedTransaction>;

/// Creates drive closure transaction.
/// \note Throws \c transaction_error if mosaics or message have invalid size.
/// \note Optional transaction parameters are initialized using \c Config if not set explicitly.
std::unique_ptr<DriveClosureTransaction>
CreateDriveClosureTransaction(const Key& driveKey,
std::optional<Amount> maxFee = std::nullopt,
std::optional<NetworkDuration> deadline = std::nullopt,
std::optional<NetworkIdentifier> networkId = std::nullopt);


/// Creates drive closure transaction.
/// \note Throws \c transaction_error if mosaics or message have invalid size.
/// \note Optional transaction parameters are initialized using \c Config if not set explicitly.
std::unique_ptr<EmbeddedDriveClosureTransaction>
CreateEmbeddedDriveClosureTransaction(const Key& driveKey,
const Key& signer,
std::optional<NetworkIdentifier> networkId = std::nullopt);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
*** 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.
**/
#pragma once

#include <xpxchaincpp/utils/buffer.h>
#include <xpxchaincpp/model/transaction/transaction.h>
#include <xpxchaincpp/model/transaction/embedded_transaction.h>

#include <memory>
#include <optional>
#include <string>
#include <utility>

namespace xpx_chain_sdk {

/// Finish download transaction base class.
template<typename TBase>
class TFinishDownloadTransaction: public TBase {
public:
/// Creates finish download transaction.
template<typename... TArgs>
explicit TFinishDownloadTransaction(
const Hash256& downloadChannelId,
const Amount& feedbackFeeAmount,
TArgs&&... args):
TBase(TransactionType::Finish_Download, std::forward<TArgs>(args)...),
downloadChannelId_(downloadChannelId),
feedbackFeeAmount_(feedbackFeeAmount)
{ }

/// Returns identifier of the download channel.
const Hash256& downloadChannelId() const;

/// Returns amount of XPXs to transfer to the download channel.
const Amount& feedbackFeeAmount() const;

private:
Hash256 downloadChannelId_;
Amount feedbackFeeAmount_;
};

extern template class TFinishDownloadTransaction<Transaction>;
extern template class TFinishDownloadTransaction<EmbeddedTransaction>;

using FinishDownloadTransaction = TFinishDownloadTransaction<Transaction>;
using EmbeddedFinishDownloadTransaction = TFinishDownloadTransaction<EmbeddedTransaction>;

/// Creates finish download transaction.
/// \note Throws \c transaction_error if mosaics or message have invalid size.
/// \note Optional transaction parameters are initialized using \c Config if not set explicitly.
std::unique_ptr<FinishDownloadTransaction>
CreateFinishDownloadTransaction(const Hash256& downloadChannelId,
const Amount& feedbackFeeAmount,
std::optional<Amount> maxFee = std::nullopt,
std::optional<NetworkDuration> deadline = std::nullopt,
std::optional<NetworkIdentifier> networkId = std::nullopt);


/// Creates finish download transaction.
/// \note Throws \c transaction_error if mosaics or message have invalid size.
/// \note Optional transaction parameters are initialized using \c Config if not set explicitly.
std::unique_ptr<EmbeddedFinishDownloadTransaction>
CreateEmbeddedFinishDownloadTransaction(const Hash256& downloadChannelId,
const Amount& feedbackFeeAmount,
const Key& signer,
std::optional<NetworkIdentifier> networkId = std::nullopt);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace xpx_chain_sdk {
explicit TReplicatorOnboardingTransaction(
const Amount& capacity,
TArgs&&... args):
TBase(TransactionType::Data_Modification, std::forward<TArgs>(args)...),
TBase(TransactionType::Replicator_Onboarding, std::forward<TArgs>(args)...),
capacity_(capacity)
{ }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
*** 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.
**/
#pragma once

#include <xpxchaincpp/utils/buffer.h>
#include <xpxchaincpp/model/transaction/transaction.h>
#include <xpxchaincpp/model/transaction/embedded_transaction.h>

#include <memory>
#include <optional>
#include <string>
#include <utility>

namespace xpx_chain_sdk {

/// Storage payment transaction base class.
template<typename TBase>
class TStoragePaymentTransaction: public TBase {
public:
/// Creates storage payment transaction.
template<typename... TArgs>
explicit TStoragePaymentTransaction(
const Key& driveKey,
const Amount& storageUnits,
TArgs&&... args):
TBase(TransactionType::Storage_Payment, std::forward<TArgs>(args)...),
driveKey_(driveKey),
storageUnits_(storageUnits)
{ }

/// Returns identifier of the drive.
const Key& driveKey() const;

/// Returns amount of storage units to transfer to the drive.
const Amount& storageUnitsAmount() const;

private:
Key driveKey_;
Amount storageUnits_;
};

extern template class TStoragePaymentTransaction<Transaction>;
extern template class TStoragePaymentTransaction<EmbeddedTransaction>;

using StoragePaymentTransaction = TStoragePaymentTransaction<Transaction>;
using EmbeddedStoragePaymentTransaction = TStoragePaymentTransaction<EmbeddedTransaction>;

/// Creates storage payment transaction.
/// \note Throws \c transaction_error if mosaics or message have invalid size.
/// \note Optional transaction parameters are initialized using \c Config if not set explicitly.
std::unique_ptr<StoragePaymentTransaction>
CreateStoragePaymentTransaction(const Key& driveKey,
const Amount& storageUnits,
std::optional<Amount> maxFee = std::nullopt,
std::optional<NetworkDuration> deadline = std::nullopt,
std::optional<NetworkIdentifier> networkId = std::nullopt);


/// Creates storage payment transaction.
/// \note Throws \c transaction_error if mosaics or message have invalid size.
/// \note Optional transaction parameters are initialized using \c Config if not set explicitly.
std::unique_ptr<EmbeddedStoragePaymentTransaction>
CreateEmbeddedStoragePaymentTransaction(const Key& driveKey,
const Amount& storageUnits,
const Key& signer,
std::optional<NetworkIdentifier> networkId = std::nullopt);
}
4 changes: 4 additions & 0 deletions include/xpxchaincpp/model/transaction/transaction_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ namespace xpx_chain_sdk {
Transaction_Property = 0x4350,
Secret_Lock = 0x4152,
Secret_Proof = 0x4252,
Storage_Payment = 0x4a62,
Account_Link = 0x414C,
Prepare_Bc_Drive = 0x4162,
Data_Modification = 0x4262,
Download = 0x4362,
Download_Payment = 0x4962,
Drive_Closure = 0x4e62,
Cempl marked this conversation as resolved.
Show resolved Hide resolved
Data_Modification_Approval = 0x4462,
Data_Modification_Cancel = 0x4562,
Finish_Download = 0x4862,
Replicator_Onboarding = 0x4662,
};

Expand Down
Loading