-
Notifications
You must be signed in to change notification settings - Fork 41
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
[PSDK-117] Implement Transfer Class #11
Conversation
ee98266
to
20f82fe
Compare
@@ -66,6 +66,7 @@ | |||
"text" | |||
], | |||
"verbose": true, | |||
"testRegex": ".test.ts$" | |||
"testRegex": ".test.ts$", | |||
"maxWorkers": 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed for BigInt
support in Jest
20f82fe
to
ea89618
Compare
src/coinbase/transfer.ts
Outdated
const startTime = Date.now(); | ||
while (Date.now() - startTime < timeoutSeconds * 1000) { | ||
const status = await this.getStatus(); | ||
if (status === TransferStatus.COMPLETE || status === TransferStatus.FAILED) { | ||
return this; | ||
} | ||
await new Promise(resolve => setTimeout(resolve, intervalSeconds * 1000)); | ||
} | ||
throw new Error("Transfer timed out"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can create a function for this since we will use it in other classes too.
async function delay(seconds: number) {
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
}
Also, we may want to consider to move wait
function under utils folder.
ea89618
to
e0b9bf3
Compare
e0b9bf3
to
d538a1f
Compare
What changed? Why?
Transfer
classTransferApiClient
typeTransferApiClient
toApiClients
Fast-Follow
ListTransfers
Address.transfer
Wallet.transfer
Qualified Impact