Skip to content

Feat/wasm version bump#26

Merged
h33p merged 16 commits intomainfrom
feat/wasm-version-bump
Mar 5, 2026
Merged

Feat/wasm version bump#26
h33p merged 16 commits intomainfrom
feat/wasm-version-bump

Conversation

@h33p
Copy link
Contributor

@h33p h33p commented Mar 4, 2026

No description provided.

Copy link
Contributor Author

@h33p h33p left a comment

Choose a reason for hiding this comment

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

Implement nockbox/iris-sdk#3

* @deprecated Remove when all dApps use iris-wasm 0.2.x
*/
export function toRawTx(rawTx: unknown): wasm.RawTx {
const asProtobuf =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

guard.isRawTx()

return Number.isFinite(parsed) ? parsed : null;
}

function protobufSpendConditionToNative(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

nockbox/iris-rs#18 should be in here

export function toNote(note: unknown): wasm.Note {
if (note && typeof note === 'object' && ('version' in note || 'inner' in note)) {
return note as wasm.Note;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use the guard

Copy link
Contributor

Choose a reason for hiding this comment

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

should be resolved

package.json Outdated
"@fontsource/inter": "^5.2.8",
"@fontsource/lora": "^5.2.8",
"@nockbox/iris-sdk": "github:nockbox/iris-sdk#main",
"@nockbox/iris-sdk": "github:nockbox/iris-sdk#feat/sdk-v0-and-bridge-APIs",
Copy link
Contributor

Choose a reason for hiding this comment

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

note to change before submitting the new extension

}

// Calculate network fee
// Calculate network fee. Logic based on iris-sdk/vendor/iris-wasm/iris_wasm.d.ts:
Copy link
Contributor

Choose a reason for hiding this comment

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

@h33p Is this the correct way to do these calculations? Since we're supporting 'native' signrawTX I noticed we should change how the display fee is calculated. Should probably double check

Copy link
Contributor

Choose a reason for hiding this comment

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

also will remove the comment before the merge

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, please convert protobuf to native format at the RPC boundary, or just use protobuf for now. Don't mix types in the extension.

return spendCondition;
}
if (guard.isPbCom2SpendCondition(spendCondition)) {
return wasm.spendConditionFromProtobuf(spendCondition);
Copy link
Contributor

Choose a reason for hiding this comment

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

Added this to the WASM module

const outputs = await vault.computeOutputs(rawTxParams.rawTx);

// Create sign raw tx approval request
// Create sign raw tx approval request (payload validated as all-native or all-protobuf)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Payload is all protobuf, convert it to all native here.

}

/** Validates all-native or all-protobuf. */
function isSignRawTxPayload(obj: unknown): obj is SignRawTxRequest {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be in SDK.

There should be an individual one for legacy and native.

error: string;
};

function parseNicksParam(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is overly complicated. RPC should accept one type, and one type only.

Unless it was initially a number and we want to allow string int.

But also, unless I'm totally wrong, RPC boundary will never contain bigints. It's should all be JSON

sendResponse({ error: ERROR_CODES.BAD_ADDRESS });
return;
}
const parsedSignAmount = parseNicksParam(signAmount, 'amount');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Internal methods should use an always consistent type.

I would use Nicks, which is a string.

return [{ Pkh: { m: 1, hashes: [senderPKH] } }];
}

function createPkhCoinbaseCondition(senderPKH: string): SpendConditionLike {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is duplicated.

Gohlub and others added 5 commits March 4, 2026 22:42
@h33p h33p force-pushed the feat/wasm-version-bump branch from 5ad8e71 to fb05d29 Compare March 5, 2026 14:17
h33p and others added 2 commits March 5, 2026 14:26
* don't collect incoming transactions

* rehydrate state after service worker restart but have a custom lock time
@h33p h33p merged commit c3777f8 into main Mar 5, 2026
1 check failed
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