Skip to content

Commit

Permalink
add FLOW proposal keys - fix broadcast param
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Sramko committed Oct 12, 2021
1 parent 9ccfbb8 commit a1858c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tatumio/tatum",
"version": "1.28.0",
"version": "1.28.1",
"description": "Tatum API client allows browsers and Node.js clients to interact with Tatum API.",
"main": "dist/src/index.js",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
3 changes: 2 additions & 1 deletion src/blockchain/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export const flowGetSignKey = async (isPayer: boolean): Promise<{ keyId: number,
*/
export const flowGetCurrentBlock = async (): Promise<number> => get(`/v3/flow/block/current`);

export const flowBroadcastTx = async (txData: string, proposalKey?: number) => post('/v3/flow/broadcast', {txData, proposalKey});
export const flowBroadcastTx = async (txData: string, signatureId?: string, proposalKey?: number) => post('/v3/flow/broadcast',
{txData, signatureId, proposalKey});

/**
* For more details, see <a href="https://tatum.io/apidoc#operation/FlowGetBlock" target="_blank">Tatum API documentation</a>
Expand Down
4 changes: 2 additions & 2 deletions src/transaction/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const sendTransaction = async (testnet: boolean, {
} catch (e) {
try {
if (keyHash) {
await flowBroadcastTx('', keyHash ? parseInt((process.env[keyHash] || '0') as string) : undefined);
await flowBroadcastTx('', undefined, keyHash ? parseInt((process.env[keyHash] || '0') as string) : undefined);
delete process.env[keyHash];
}
// eslint-disable-next-line no-empty
Expand All @@ -182,7 +182,7 @@ const sendTransaction = async (testnet: boolean, {
} finally {
try {
if (keyHash) {
await flowBroadcastTx(transactionId, keyHash ? parseInt((process.env[keyHash] || '0') as string) : undefined);
await flowBroadcastTx(transactionId, undefined, keyHash ? parseInt((process.env[keyHash] || '0') as string) : undefined);
delete process.env[keyHash];
}
// eslint-disable-next-line no-empty
Expand Down

0 comments on commit a1858c1

Please sign in to comment.