@@ -26,7 +26,6 @@ This project is still under development. This page will get more content as the
2626``` cpp
2727// Default Configuration is Devnet
2828const auto transaction = builder::Transfer()
29- .type(0 )
3029 .nonce(1 )
3130 .senderPublicKey(fixtures::PublicKeyBytes.data())
3231 .vendorField(" this is a devnet transaction" )
@@ -41,20 +40,19 @@ const auto transaction = builder::Transfer()
4140### Mainnet
4241
4342``` cpp
44- // Use the Configuration Class to create a Mainnet Transaction
45- const Configuration mainnetCfg (Mainnet);
43+ // Also pass the Network as a builder constructor argument
4644
47- const auto transaction = builder::Transfer()
48- .type(0)
45+ #include " networks/mainnet.hpp"
46+
47+ const auto transaction = builder::Transfer(Mainnet)
4948 .nonce(1 )
50- .senderPublicKey(fixtures::PublicKeyBytes.data())
5149 .vendorField(" this is a devnet transaction" )
5250 .amount(100000000ULL )
5351 .expiration(0 )
5452 .recipientId(" D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib" )
5553 .sign(" this is a top secret passphrase" )
5654 .secondSign(" this is a top secret passphrase too" )
57- .build(mainnetCfg );
55+ .build();
5856```
5957
6058### BridgeChain Transaction
@@ -77,17 +75,15 @@ const uint8_t radiansRecipient[] = {
7775 65, 29, 252, 105, 181, 76, 127, 233, 1, 233, 29,
7876 90, 154, 183, 131, 136, 100, 94, 36, 39, 234 };
7977
80- auto transaction = builder::Transfer()
81- .type(0)
78+ auto transaction = builder::Transfer(radiansCfg)
8279 .nonce(1)
83- .senderPublicKey(senderPublicKeyBytes.data())
8480 .vendorField("this is a Radians transaction")
8581 .amount(100000000ULL)
8682 .expiration(0)
8783 .recipientId(radiansRecipient)
8884 .sign("this is a top secret passphrase")
8985 .secondSign("this is a top secret passphrase too")
90- .build(radiansCfg );
86+ .build();
9187```
9288
9389### With custom Fees
@@ -106,17 +102,15 @@ const FeePolicy customFees = {
106102
107103const Configuration customCfg(Radians, MyCustomFees);
108104
109- auto transaction = builder::Transfer()
110- .type(0)
105+ auto transaction = builder::Transfer(customCfg)
111106 .nonce(1)
112- .senderPublicKey(senderPublicKeyBytes.data())
113107 .vendorField("this is a Radians transaction")
114108 .amount(100000000ULL)
115109 .expiration(0)
116110 .recipientId(radiansRecipient)
117111 .sign("this is a top secret passphrase")
118112 .secondSign("this is a top secret passphrase too")
119- .build(customCfg );
113+ .build();
120114```
121115
122116### Sign a Transactions
@@ -539,12 +533,12 @@ void createBridgechainTransaction() {
539533 const Configuration cfg(BridgechainNetwork);
540534
541535 // Use the Transaction Builder to make a transaction.
542- const auto bridgechainTransaction = builder::Transfer()
536+ const auto bridgechainTransaction = builder::Transfer(cfg )
543537 .recipientId("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib")
544538 .vendorField("this is a custom bridgechain transaction")
545539 .sign(Passphrase)
546540 .secondSign(SecondPassphrase)
547- .build(cfg );
541+ .build();
548542
549543 // Create and Print the Json representation of the Transaction.
550544 const auto transactionJson = bridgechainTransaction.toJson();
0 commit comments