Skip to content

Commit 28b2988

Browse files
authored
Merge pull request #612 from Concordium/sponsored-tx/transaction-api
Sponsored tx/transaction api
2 parents eeeeb81 + e4aeae0 commit 28b2988

38 files changed

+2300
-895
lines changed

examples/nodejs/common/bakerAdd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c
8484
finalizationRewardCommission: 100000,
8585
};
8686

87-
const transaction = Transaction.configureValidator(configureBakerPayload).addMetadata(header);
87+
const transaction = Transaction.configureValidator(configureBakerPayload).addMetadata(header).build();
8888
const signed = await Transaction.signAndFinalize(transaction, signer);
8989
const transactionHash = await client.sendTransaction(signed);
9090

examples/nodejs/common/bakerRemove.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c
6666
stake: CcdAmount.zero(),
6767
};
6868

69-
const transaction = Transaction.configureValidator(configureBakerPayload).addMetadata(header);
69+
const transaction = Transaction.configureValidator(configureBakerPayload).addMetadata(header).build();
7070
const signed = await Transaction.signAndFinalize(transaction, signer);
7171
const transactionHash = await client.sendTransaction(signed);
7272

examples/nodejs/common/delegationAdd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c
8484
restakeEarnings: cli.flags.restake,
8585
};
8686

87-
const transaction = Transaction.configureDelegation(configureDelegationPayload).addMetadata(header);
87+
const transaction = Transaction.configureDelegation(configureDelegationPayload).addMetadata(header).build();
8888
const signed = await Transaction.signAndFinalize(transaction, signer);
8989
const transactionHash = await client.sendTransaction(signed);
9090

examples/nodejs/common/delegationRemove.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c
6666
};
6767
const signer = buildAccountSigner(wallet);
6868

69-
const transaction = Transaction.configureDelegation(configureDelegationPayload).addMetadata(header);
69+
const transaction = Transaction.configureDelegation(configureDelegationPayload).addMetadata(header).build();
7070
const signed = await Transaction.signAndFinalize(transaction, signer);
7171
const transactionHash = await client.sendTransaction(signed);
7272

examples/nodejs/common/deployModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c
7070
sender,
7171
};
7272

73-
const deployModuleTransaction = Transaction.deployModule(deployModule).addMetadata(header);
73+
const deployModuleTransaction = Transaction.deployModule(deployModule).addMetadata(header).build();
7474

7575
// Sign transaction
7676
const signer = buildAccountSigner(wallet);

examples/nodejs/common/simpleTransfer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c
8787
const payload: SimpleTransferPayload | SimpleTransferWithMemoPayload = cli.flags.memo
8888
? { memo: new DataBlob(Buffer.from(cli.flags.memo, 'hex')), amount, toAddress }
8989
: { toAddress, amount };
90-
const transaction = Transaction.transfer(payload).addMetadata(header);
90+
const transaction = Transaction.transfer(payload).addMetadata(header).build();
9191

9292
// #region documentation-snippet-sign-transaction
9393
const signer = buildAccountSigner(walletExport);

examples/nodejs/composed-examples/initAndUpdateContract.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c
9999
param: initParams,
100100
});
101101

102-
const initTransaction = Transaction.initContract(initPayload, maxCost).addMetadata(initHeader);
102+
const initTransaction = Transaction.initContract(initPayload, maxCost).addMetadata(initHeader).build();
103103

104104
// Sign transaction
105105
const signedInit = await Transaction.signAndFinalize(initTransaction, signer);
@@ -150,7 +150,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c
150150
message: updateParams,
151151
});
152152

153-
const updateTransaction = Transaction.updateContract(updatePayload, maxCost).addMetadata(updateHeader);
153+
const updateTransaction = Transaction.updateContract(updatePayload, maxCost).addMetadata(updateHeader).build();
154154

155155
// Sign transaction
156156
const signedUpdate = await Transaction.signAndFinalize(updateTransaction, signer);

examples/wallet/src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ async function createSimpleTransferTransaction(
356356
sender: senderAddress,
357357
};
358358

359-
return Transaction.transfer(payload).addMetadata(header);
359+
return Transaction.transfer(payload).addMetadata(header).build();
360360
}
361361

362362
export async function sendTransferTransaction(

packages/rust-bindings/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sdk/src/GenericContract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ class ContractBase<E extends string = string, V extends string = string> {
413413
sender: senderAddress,
414414
};
415415

416-
const transaction = Transaction.updateContract(payload, energy).addMetadata(header);
416+
const transaction = Transaction.updateContract(payload, energy).addMetadata(header).build();
417417
const signed = await Transaction.signAndFinalize(transaction, signer);
418418
return this.grpcClient.sendTransaction(signed);
419419
}

0 commit comments

Comments
 (0)