@zkproofport-app/sdk 0.4.2 → 0.4.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/README.md +2 -0
- package/dist/index.esm.js +7 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -477,6 +477,8 @@ const relay = await sdk.createRelayRequest('coinbase_attestation', {
|
|
|
477
477
|
|
|
478
478
|
Every field of the third argument is optional: `message`, `dappName` and `dappIcon` are shown to the user in the ZKProofport app, `nonce` is a value of your own choosing that the relay refuses to accept twice, and `returnScheme` is described next.
|
|
479
479
|
|
|
480
|
+
The relay never reads your circuit inputs. So that ZKProofport can count requests per app, the SDK also sends `scope` alongside them, unchanged. The proof itself uses the scope in your inputs.
|
|
481
|
+
|
|
480
482
|
#### Switching back: `returnScheme`
|
|
481
483
|
|
|
482
484
|
When ZKProofport finishes a proof, the user is sitting in the ZKProofport app. `returnScheme` answers one question: **which app should come back to the foreground?**
|
package/dist/index.esm.js
CHANGED
|
@@ -5989,6 +5989,13 @@ class ProofportSDK {
|
|
|
5989
5989
|
inputs,
|
|
5990
5990
|
challenge,
|
|
5991
5991
|
};
|
|
5992
|
+
// The relay never reads `inputs`, so the scope is also sent on the envelope,
|
|
5993
|
+
// where the relay counts requests per scope. The app proves the scope inside
|
|
5994
|
+
// `inputs` and uses the envelope copy only when `inputs` has none; both are
|
|
5995
|
+
// the same string here.
|
|
5996
|
+
const scope = inputs.scope;
|
|
5997
|
+
if (typeof scope === 'string' && scope.length > 0)
|
|
5998
|
+
body.scope = scope;
|
|
5992
5999
|
// Sign challenge for circuits that require wallet signature
|
|
5993
6000
|
if (needsSignature && this.signer) {
|
|
5994
6001
|
body.signature = await this.signer.signMessage(challenge);
|