-
-
Notifications
You must be signed in to change notification settings - Fork 5
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: better getUnspent #143
Conversation
required arg can't go after the optional one
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.
Looks good.
Maybe we should have deprecation warning for getUnspentAll
(by wrapper similar to https://github.com/leapdao/leap-core/blob/master/lib/helpers.js#L114), but not so important IMO
index.d.ts
Outdated
@@ -327,8 +327,8 @@ declare module "leap-core" { | |||
}; | |||
|
|||
class ExtendedWeb3 extends Web3 { | |||
public getUnspent(address: string, color: number, cb?: Callback<Array<Unspent>>): Promise<Array<Unspent>>; | |||
public getUnspent(address: string, cb?: Callback<Array<Unspent>>): Promise<Array<Unspent>>; | |||
public getUnspent(address: string | undefined, color: number, cb?: Callback<Array<Unspent>>): Promise<Array<Unspent>>; |
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.
What about token address instead of color?
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.
address: string | undefined | null
will be better (you use it with null
in docs)
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.
both are great points!
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.
🎉
getUnspent(null, 1)
getUnspent: makeaddress
param to be optional #137