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

Added CRC Adapter #1

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Added CRC Adapter #1

wants to merge 6 commits into from

Conversation

onmax
Copy link
Member

@onmax onmax commented Jun 3, 2024

The adapter is just a exact copy from EURAssetAdapter.ts

@onmax onmax requested a review from sisou June 3, 2024 15:31
src/ColonesAssetAdapter.ts Outdated Show resolved Hide resolved
src/ColonesAssetAdapter.ts Outdated Show resolved Hide resolved
@onmax onmax force-pushed the crc-adapter branch 2 times, most recently from 327e08c to 7c44fe9 Compare June 5, 2024 08:58
src/IAssetAdapter.ts Outdated Show resolved Hide resolved
src/IAssetAdapter.ts Outdated Show resolved Hide resolved
@onmax
Copy link
Member Author

onmax commented Jun 5, 2024

@sisou quick question.

The last arg in awaitHtlcFunding in does not match:

The error was not being triggered before, but now with the new class definition I get it:

export class FiatAssetAdapter<Asset extends FiatSwapAsset> implements AssetAdapter<Asset> {

@sisou
Copy link
Member

sisou commented Jun 5, 2024

Hmm. It technically is correct though, because Transaction<Asset.EUR> = HtlcDetails. It's probably because TS doesn't work via the FiatSwapAsset union...

@sisou
Copy link
Member

sisou commented Jun 5, 2024

For now, can you try changing the implementation from htlc: HtlcDetails to htlc: Transaction<Asset.EUR | Asset.CRC>?

@onmax
Copy link
Member Author

onmax commented Jun 5, 2024

For now, can you try changing the implementation from htlc: HtlcDetails to htlc: Transaction<Asset.EUR | Asset.CRC>?

I found another solution where Typescript does not complaint and it is the minimum amount of changed lines.

@onmax onmax force-pushed the crc-adapter branch 2 times, most recently from a8b3bde to 8eb50e7 Compare June 5, 2024 18:02
@sisou sisou force-pushed the crc-adapter branch 2 times, most recently from cd6428e to 6f4fb69 Compare June 14, 2024 09:55
package.json Outdated
@@ -27,7 +27,7 @@
"dependencies": {
"@nimiq/core-web": "^1.5.8",
"@nimiq/electrum-client": "https://github.com/nimiq/electrum-client#build",
"@nimiq/oasis-api": "^1.0.1",
"@nimiq/oasis-api": "github:nimiq/oasis-api-js#dbfcdf4707c8a030022b3474126f4596bacbc1c1",
Copy link
Member

@sisou sisou Jul 26, 2024

Choose a reason for hiding this comment

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

TODO: Update to released package version once nimiq/oasis-api-js#1 is merged

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