@partylayer/provider 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -255,14 +255,14 @@ interface BridgeableClient {
|
|
|
255
255
|
signTransaction(params: {
|
|
256
256
|
tx: unknown;
|
|
257
257
|
}): Promise<{
|
|
258
|
-
transactionHash
|
|
258
|
+
transactionHash?: unknown;
|
|
259
259
|
signedTx?: unknown;
|
|
260
260
|
partyId?: unknown;
|
|
261
261
|
}>;
|
|
262
262
|
submitTransaction(params: {
|
|
263
263
|
signedTx: unknown;
|
|
264
264
|
}): Promise<{
|
|
265
|
-
transactionHash
|
|
265
|
+
transactionHash?: unknown;
|
|
266
266
|
submittedAt?: number;
|
|
267
267
|
commandId?: string;
|
|
268
268
|
updateId?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -255,14 +255,14 @@ interface BridgeableClient {
|
|
|
255
255
|
signTransaction(params: {
|
|
256
256
|
tx: unknown;
|
|
257
257
|
}): Promise<{
|
|
258
|
-
transactionHash
|
|
258
|
+
transactionHash?: unknown;
|
|
259
259
|
signedTx?: unknown;
|
|
260
260
|
partyId?: unknown;
|
|
261
261
|
}>;
|
|
262
262
|
submitTransaction(params: {
|
|
263
263
|
signedTx: unknown;
|
|
264
264
|
}): Promise<{
|
|
265
|
-
transactionHash
|
|
265
|
+
transactionHash?: unknown;
|
|
266
266
|
submittedAt?: number;
|
|
267
267
|
commandId?: string;
|
|
268
268
|
updateId?: string;
|
package/dist/index.js
CHANGED
|
@@ -514,7 +514,7 @@ var PartyLayerProvider = class {
|
|
|
514
514
|
};
|
|
515
515
|
|
|
516
516
|
// src/bridge.ts
|
|
517
|
-
var PROVIDER_VERSION = "0.
|
|
517
|
+
var PROVIDER_VERSION = "0.6.0" ;
|
|
518
518
|
function createProviderBridge(client) {
|
|
519
519
|
const eventBus = new CIP0103EventBus();
|
|
520
520
|
const pendingEmitted = /* @__PURE__ */ new Set();
|
|
@@ -616,15 +616,17 @@ async function handleRequest(client, args, eventBus, pendingEmitted) {
|
|
|
616
616
|
const signResult = await client.signTransaction({ tx: p });
|
|
617
617
|
const session = await client.getActiveSession();
|
|
618
618
|
const partyId = String(signResult.partyId ?? session?.partyId ?? "unknown");
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
619
|
+
if (signResult.transactionHash !== void 0) {
|
|
620
|
+
eventBus.emit(core.CIP0103_EVENTS.TX_CHANGED, {
|
|
621
|
+
status: "signed",
|
|
622
|
+
commandId: cmdId,
|
|
623
|
+
payload: {
|
|
624
|
+
signature: String(signResult.transactionHash),
|
|
625
|
+
signedBy: partyId,
|
|
626
|
+
party: partyId
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
}
|
|
628
630
|
try {
|
|
629
631
|
const receipt = await client.submitTransaction({
|
|
630
632
|
signedTx: signResult.signedTx ?? signResult.transactionHash
|
|
@@ -634,7 +636,11 @@ async function handleRequest(client, args, eventBus, pendingEmitted) {
|
|
|
634
636
|
status: "executed",
|
|
635
637
|
commandId: cmdId,
|
|
636
638
|
payload: {
|
|
637
|
-
|
|
639
|
+
// All three are real identifiers — the receipt's update id, the
|
|
640
|
+
// wallet's command id, or the bridge's own command id for this
|
|
641
|
+
// operation. `String(receipt.transactionHash)` was the old tail
|
|
642
|
+
// and would now stringify `undefined`.
|
|
643
|
+
updateId: receipt.updateId ?? receipt.commandId ?? cmdId,
|
|
638
644
|
completionOffset: 0
|
|
639
645
|
}
|
|
640
646
|
});
|