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

fix: fix types related to transactions #96

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ehamery
Copy link

@ehamery ehamery commented Jun 4, 2022

Update interfaces:

  • InternalWalletAsset
  • CreateTransactionResponse
  • TransactionResponse

Update comments of functions throwing:

  • getVaultAccountsWithPageInfo
  • getTransactionById

Pull Request Description

Some interfaces did not match what the API returns, therefore I fixed them.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore / Documentation

How Has This Been Tested?

  • Locally tested against Fireblocks API

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added corresponding labels to the PR -> needs permission

src/types.ts Outdated
@@ -280,7 +281,7 @@ export interface TransactionResponse {
status: TransactionStatus;
txHash: string;
numOfConfirmations?: number;
subStatus?: string;
subStatus?: TransactionStatus;
Copy link
Contributor

@yarinvak yarinvak Jun 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is incorrect, subStatus is not of type TransactionStatus

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

customerRefId?: string;
amountInfo?: AmountInfo;
feeInfo?: FeeInfo;
signedMessages?: SignedMessageResponse[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signedMessages is an optional field

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment.

extraParameters?: any;
externalTxId?: string;
destinations?: TransactionResponseDestination[];
destinations: TransactionResponseDestination[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

destination is an optional field

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An array is always returned, so it is always defined.
It is likely done this way because that makes the end-user work easier, you can just look through it whether it is empty or not.

Copy link
Contributor

@yarinvak yarinvak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of the types are incorrect

Update interfaces:
- InternalWalletAsset
- CreateTransactionResponse
- TransactionResponse

Update comments of functions throwing:
- getVaultAccountsWithPageInfo
- getTransactionById
- validateAddress
@ehamery ehamery force-pushed the fix/transaction-types branch from 7bbe935 to a77c80b Compare June 12, 2022 05:28
@ehamery ehamery force-pushed the fix/transaction-types branch from 5ed9213 to 07d434b Compare June 23, 2022 03:07
@ehamery ehamery force-pushed the fix/transaction-types branch from 07d434b to 5fa77bc Compare June 23, 2022 04:06
@ehamery ehamery requested a review from yarinvak June 24, 2022 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants