@ic402/client 2.8.0 → 2.9.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/LICENSE +1 -1
- package/dist/voucher.d.ts +5 -1
- package/dist/voucher.d.ts.map +1 -1
- package/dist/voucher.js +5 -1
- package/dist/voucher.js.map +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
|
|
176
176
|
END OF TERMS AND CONDITIONS
|
|
177
177
|
|
|
178
|
-
Copyright 2026 ic402 contributors
|
|
178
|
+
Copyright 2026 Vaughn Hew and the ic402 contributors
|
|
179
179
|
|
|
180
180
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
181
|
you may not use this file except in compliance with the License.
|
package/dist/voucher.d.ts
CHANGED
|
@@ -15,7 +15,11 @@ export interface VoucherSigner {
|
|
|
15
15
|
/**
|
|
16
16
|
* Sign a cumulative voucher for a session.
|
|
17
17
|
*
|
|
18
|
-
* @param signer -
|
|
18
|
+
* @param signer - A VoucherSigner. NB: an @icp-sdk Ed25519KeyIdentity does NOT satisfy the
|
|
19
|
+
* interface directly (its getPublicKey() returns a PublicKey object, not raw bytes) — wrap
|
|
20
|
+
* it: `{ sign: (p) => identity.sign(p), getPublicKey: async () => identity.getPublicKey().toRaw() }`.
|
|
21
|
+
* Passing a non-raw public key would register the session under a garbage key and every
|
|
22
|
+
* voucher would be rejected with #invalidSignature.
|
|
19
23
|
* @param canisterId - The verifying canister's principal text (replay binding)
|
|
20
24
|
* @param sessionId - The session to sign for
|
|
21
25
|
* @param cumulativeAmount - Total amount consumed so far
|
package/dist/voucher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voucher.d.ts","sourceRoot":"","sources":["../src/voucher.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,iBAAS,oBAAoB,CAC3B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,GACf,UAAU,CAEZ;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/C,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CACrC;AAED
|
|
1
|
+
{"version":3,"file":"voucher.d.ts","sourceRoot":"","sources":["../src/voucher.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,iBAAS,oBAAoB,CAC3B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,GACf,UAAU,CAEZ;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/C,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CACrC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,CAGrB;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/voucher.js
CHANGED
|
@@ -16,7 +16,11 @@ function encodeVoucherPayload(canisterId, sessionId, cumulativeAmount, sequence)
|
|
|
16
16
|
/**
|
|
17
17
|
* Sign a cumulative voucher for a session.
|
|
18
18
|
*
|
|
19
|
-
* @param signer -
|
|
19
|
+
* @param signer - A VoucherSigner. NB: an @icp-sdk Ed25519KeyIdentity does NOT satisfy the
|
|
20
|
+
* interface directly (its getPublicKey() returns a PublicKey object, not raw bytes) — wrap
|
|
21
|
+
* it: `{ sign: (p) => identity.sign(p), getPublicKey: async () => identity.getPublicKey().toRaw() }`.
|
|
22
|
+
* Passing a non-raw public key would register the session under a garbage key and every
|
|
23
|
+
* voucher would be rejected with #invalidSignature.
|
|
20
24
|
* @param canisterId - The verifying canister's principal text (replay binding)
|
|
21
25
|
* @param sessionId - The session to sign for
|
|
22
26
|
* @param cumulativeAmount - Total amount consumed so far
|
package/dist/voucher.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voucher.js","sourceRoot":"","sources":["../src/voucher.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,oDAAoD;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAC3B,UAAkB,EAClB,SAAiB,EACjB,gBAAwB,EACxB,QAAgB;IAEhB,OAAO,MAAM,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrE,CAAC;AAOD
|
|
1
|
+
{"version":3,"file":"voucher.js","sourceRoot":"","sources":["../src/voucher.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,oDAAoD;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAC3B,UAAkB,EAClB,SAAiB,EACjB,gBAAwB,EACxB,QAAgB;IAEhB,OAAO,MAAM,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrE,CAAC;AAOD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAqB,EACrB,UAAkB,EAClB,SAAiB,EACjB,gBAAwB,EACxB,QAAgB;IAEhB,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IACxF,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ic402/client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "TypeScript client SDK for ic402-enabled ICP canisters",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"author": "
|
|
6
|
+
"author": "Vaughn Hew",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/vhew/ic402.git",
|