-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: add okx bitcoin connector #3408
Conversation
🦋 Changeset detectedLatest commit: 85f3ce7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Coverage Report
File Coverage
|
if (bitcoinPSBTUtils.isP2MS(output)) { | ||
return bitcoin.payments.p2ms({ output, network }) | ||
} else if (bitcoinPSBTUtils.isP2PK(output)) { | ||
return bitcoin.payments.p2pk({ output, network }) | ||
} else if (bitcoinPSBTUtils.isP2PKH(output)) { | ||
return bitcoin.payments.p2pkh({ output, network }) | ||
} else if (bitcoinPSBTUtils.isP2WPKH(output)) { | ||
return bitcoin.payments.p2wpkh({ output, network }) | ||
} else if (bitcoinPSBTUtils.isP2WSHScript(output)) { | ||
return bitcoin.payments.p2wsh({ output, network }) | ||
} else if (bitcoinPSBTUtils.isP2SHScript(output)) { | ||
return bitcoin.payments.p2sh({ output, network }) | ||
} else if (bitcoinPSBTUtils.isP2TR(output)) { | ||
return bitcoin.payments.p2tr({ output, network }) |
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.
maybe nit: can we do a switch or even an object mapping for this?
eg
switch {
case(bitcoinPSBTUtils.isP2MS(output)):
...
}
Not sure this works in js but wall of if looks ugly
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.
As far as I know this is not possible syntax wise, switch
expects a value to match the value in each case
. As we need to check through functions I don't think it is possible to use switch
in this case.
@@ -32,6 +32,7 @@ | |||
"@wallet-standard/app": "1.0.1", | |||
"@wallet-standard/base": "1.0.1", | |||
"@walletconnect/universal-provider": "2.17.0", | |||
"bitcoinjs-lib": "7.0.0-rc.0", |
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.
do we need the rc version for this?
public readonly chain = 'bip122' | ||
public readonly type = 'ANNOUNCED' | ||
public readonly imageUrl = | ||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII=' |
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.
do we have a proper image from design?
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.
Pushed a change to get the icon from the extension
const value = (Number(params.amount) / 10 ** network.nativeCurrency.decimals).toString() | ||
|
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.
I think this is a bit succeptible to breaking. can we do a utils to parse the value?
something like ethers does with parseUnit
Description
Adds Bitcoin OKX Wallet connector.
Type of change
Associated Issues
For Linear issues: Closes APKT-1687
Showcase (Optional)
If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.
Checklist