@waiaas/wallet-sdk 2.9.0-rc.2 → 2.9.0-rc.3
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/channels/index.d.ts +1 -0
- package/dist/channels/index.d.ts.map +1 -1
- package/dist/channels/index.js +1 -0
- package/dist/channels/index.js.map +1 -1
- package/dist/channels/relay.d.ts +22 -0
- package/dist/channels/relay.d.ts.map +1 -0
- package/dist/channels/relay.js +37 -0
- package/dist/channels/relay.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/channels/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/channels/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Push Relay channel function for the WAIaaS Signing Protocol.
|
|
3
|
+
*
|
|
4
|
+
* Sends a SignResponse via the Push Relay server, which forwards it to ntfy.
|
|
5
|
+
* This allows wallet apps to only know the Push Relay URL, without needing
|
|
6
|
+
* direct access to the ntfy server.
|
|
7
|
+
*
|
|
8
|
+
* @see internal/design/73-signing-protocol-v1.md Section 7.4
|
|
9
|
+
*/
|
|
10
|
+
import type { SignResponse } from '@waiaas/core';
|
|
11
|
+
/**
|
|
12
|
+
* Send a SignResponse via Push Relay.
|
|
13
|
+
*
|
|
14
|
+
* Posts the response to the Push Relay's `/v1/sign-response` endpoint,
|
|
15
|
+
* which relays it to the ntfy response topic for the daemon to receive.
|
|
16
|
+
*
|
|
17
|
+
* @param response - Validated SignResponse object
|
|
18
|
+
* @param responseTopic - ntfy response topic name (from SignRequest.responseChannel.responseTopic)
|
|
19
|
+
* @param pushRelayUrl - Push Relay server URL (e.g., "https://push-relay.example.com")
|
|
20
|
+
*/
|
|
21
|
+
export declare function sendViaRelay(response: SignResponse, responseTopic: string, pushRelayUrl: string): Promise<void>;
|
|
22
|
+
//# sourceMappingURL=relay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay.d.ts","sourceRoot":"","sources":["../../src/channels/relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Push Relay channel function for the WAIaaS Signing Protocol.
|
|
3
|
+
*
|
|
4
|
+
* Sends a SignResponse via the Push Relay server, which forwards it to ntfy.
|
|
5
|
+
* This allows wallet apps to only know the Push Relay URL, without needing
|
|
6
|
+
* direct access to the ntfy server.
|
|
7
|
+
*
|
|
8
|
+
* @see internal/design/73-signing-protocol-v1.md Section 7.4
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Send a SignResponse via Push Relay.
|
|
12
|
+
*
|
|
13
|
+
* Posts the response to the Push Relay's `/v1/sign-response` endpoint,
|
|
14
|
+
* which relays it to the ntfy response topic for the daemon to receive.
|
|
15
|
+
*
|
|
16
|
+
* @param response - Validated SignResponse object
|
|
17
|
+
* @param responseTopic - ntfy response topic name (from SignRequest.responseChannel.responseTopic)
|
|
18
|
+
* @param pushRelayUrl - Push Relay server URL (e.g., "https://push-relay.example.com")
|
|
19
|
+
*/
|
|
20
|
+
export async function sendViaRelay(response, responseTopic, pushRelayUrl) {
|
|
21
|
+
const url = `${pushRelayUrl.replace(/\/$/, '')}/v1/sign-response`;
|
|
22
|
+
const res = await fetch(url, {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
headers: { 'Content-Type': 'application/json' },
|
|
25
|
+
body: JSON.stringify({
|
|
26
|
+
requestId: response.requestId,
|
|
27
|
+
action: response.action,
|
|
28
|
+
...(response.signature !== undefined ? { signature: response.signature } : {}),
|
|
29
|
+
signerAddress: response.signerAddress,
|
|
30
|
+
responseTopic,
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
if (!res.ok) {
|
|
34
|
+
throw new Error(`Failed to send response via Push Relay: HTTP ${String(res.status)}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=relay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay.js","sourceRoot":"","sources":["../../src/channels/relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,QAAsB,EACtB,aAAqB,EACrB,YAAoB;IAEpB,MAAM,GAAG,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC;IAElE,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,GAAG,CAAC,QAAQ,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,aAAa;SACd,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,gDAAgD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CACrE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* - buildSignResponse(requestId, action, signature?, signerAddress) - Create SignResponse
|
|
9
9
|
* - formatDisplayMessage(request) - Human-readable transaction summary
|
|
10
10
|
* - sendViaNtfy(response, topic, serverUrl?) - Publish to ntfy response topic
|
|
11
|
+
* - sendViaRelay(response, topic, pushRelayUrl) - Send via Push Relay server
|
|
11
12
|
* - sendViaTelegram(response, botUsername) - Generate Telegram deeplink URL
|
|
12
13
|
* - subscribeToRequests(topic, callback, serverUrl?) - SSE subscription for sign requests
|
|
13
14
|
* - subscribeToNotifications(topic, callback, serverUrl?) - SSE subscription for notifications
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
export { parseSignRequest } from './parse-request.js';
|
|
20
21
|
export { buildSignResponse } from './build-response.js';
|
|
21
22
|
export { formatDisplayMessage } from './display.js';
|
|
22
|
-
export { sendViaNtfy, subscribeToRequests, sendViaTelegram, subscribeToNotifications, parseNotification, } from './channels/index.js';
|
|
23
|
+
export { sendViaNtfy, subscribeToRequests, sendViaTelegram, sendViaRelay, subscribeToNotifications, parseNotification, } from './channels/index.js';
|
|
23
24
|
export { InvalidSignRequestUrlError, SignRequestExpiredError, SignRequestValidationError, } from './errors.js';
|
|
24
25
|
export type { SignRequest, SignResponse, WalletLinkConfig, NotificationMessage, } from '@waiaas/core';
|
|
25
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* - buildSignResponse(requestId, action, signature?, signerAddress) - Create SignResponse
|
|
9
9
|
* - formatDisplayMessage(request) - Human-readable transaction summary
|
|
10
10
|
* - sendViaNtfy(response, topic, serverUrl?) - Publish to ntfy response topic
|
|
11
|
+
* - sendViaRelay(response, topic, pushRelayUrl) - Send via Push Relay server
|
|
11
12
|
* - sendViaTelegram(response, botUsername) - Generate Telegram deeplink URL
|
|
12
13
|
* - subscribeToRequests(topic, callback, serverUrl?) - SSE subscription for sign requests
|
|
13
14
|
* - subscribeToNotifications(topic, callback, serverUrl?) - SSE subscription for notifications
|
|
@@ -21,7 +22,7 @@ export { parseSignRequest } from './parse-request.js';
|
|
|
21
22
|
export { buildSignResponse } from './build-response.js';
|
|
22
23
|
export { formatDisplayMessage } from './display.js';
|
|
23
24
|
// Channel functions
|
|
24
|
-
export { sendViaNtfy, subscribeToRequests, sendViaTelegram, subscribeToNotifications, parseNotification, } from './channels/index.js';
|
|
25
|
+
export { sendViaNtfy, subscribeToRequests, sendViaTelegram, sendViaRelay, subscribeToNotifications, parseNotification, } from './channels/index.js';
|
|
25
26
|
// Error classes
|
|
26
27
|
export { InvalidSignRequestUrlError, SignRequestExpiredError, SignRequestValidationError, } from './errors.js';
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,iBAAiB;AACjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,oBAAoB;AACpB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,gBAAgB;AAChB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waiaas/wallet-sdk",
|
|
3
|
-
"version": "2.9.0-rc.
|
|
3
|
+
"version": "2.9.0-rc.3",
|
|
4
4
|
"description": "WAIaaS Wallet Signing SDK - integrate wallet apps with WAIaaS signing protocol",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"zod": "^3.24.0",
|
|
36
|
-
"@waiaas/core": "2.9.0-rc.
|
|
36
|
+
"@waiaas/core": "2.9.0-rc.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^25.2.3",
|