Skip to content

added APIs for v0 to v1 migration and swap (bridge) to be consumed by the extension#2

Open
Gohlub wants to merge 11 commits intofeat/wasm-module-version-bumpfrom
feat/sdk-v0-and-bridge-APIs
Open

added APIs for v0 to v1 migration and swap (bridge) to be consumed by the extension#2
Gohlub wants to merge 11 commits intofeat/wasm-module-version-bumpfrom
feat/sdk-v0-and-bridge-APIs

Conversation

@Gohlub
Copy link
Collaborator

@Gohlub Gohlub commented Feb 26, 2026

This PR includes v0 to v1 migration and bridge logic that will be consumed. It's dependent on #1 to be merged beforehand.

@Gohlub Gohlub force-pushed the feat/sdk-v0-and-bridge-APIs branch 3 times, most recently from 2060aa5 to e1458d8 Compare March 9, 2026 15:32
@Gohlub Gohlub force-pushed the feat/sdk-v0-and-bridge-APIs branch from e1458d8 to c0101ac Compare March 10, 2026 17:19
@Gohlub Gohlub requested a review from h33p March 16, 2026 15:42
import { base58 } from '@scure/base';
import * as wasm from './wasm.js';

function buildSinglePkhSpendCondition(pkh: string): SpendCondition {
Copy link

Choose a reason for hiding this comment

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

Actual types from iris-wasm should be used, because pkh is a base58 encoded thing.

In alpha.9, I'm changing the types to not transparently cast from primitives.


const txSettings = defaultTxEngineSettings();
const targetSpendCondition = buildSinglePkhSpendCondition(targetV1Pkh);
const refundLock = wasm.locky(targetSpendCondition);
Copy link

Choose a reason for hiding this comment

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

use lockHash

const feeNicks = builder.curFee();
const transaction = builder.build();
const allNotes = builder.allNotes();
const rawTx: RawTxV1 = {
Copy link

Choose a reason for hiding this comment

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

should use nockchainTxToRaw (there might be V1 somewhere in the name)

};
}

function defaultTxEngineSettings(): TxEngineSettings {
Copy link

Choose a reason for hiding this comment

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

This should query things from the extension, but we don't have this information yet. So fine for now.

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