@chipi-stack/backend 14.9.0 → 14.10.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 +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -2542,7 +2542,7 @@ var ChipiSessions = class {
|
|
|
2542
2542
|
* Set a spending policy for a session key + token pair.
|
|
2543
2543
|
*
|
|
2544
2544
|
* This executes a sponsored transaction (using owner signature) to call
|
|
2545
|
-
* `set_spending_policy` on the CHIPI
|
|
2545
|
+
* `set_spending_policy` on the wallet contract (CHIPI v29 or SHHH V8.4).
|
|
2546
2546
|
*
|
|
2547
2547
|
* The contract enforces these limits automatically during `__execute__()` on
|
|
2548
2548
|
* ERC-20 operations (transfer, approve, increase_allowance) made by the session.
|
|
@@ -2570,9 +2570,9 @@ var ChipiSessions = class {
|
|
|
2570
2570
|
async setSpendingPolicy(params, bearerToken) {
|
|
2571
2571
|
const { encryptKey, wallet, spendingPolicyConfig } = params;
|
|
2572
2572
|
const { sessionPublicKey, token, maxPerCall, maxPerWindow, windowSeconds } = spendingPolicyConfig;
|
|
2573
|
-
if (wallet.walletType && wallet.walletType !== "CHIPI") {
|
|
2573
|
+
if (wallet.walletType && wallet.walletType !== "CHIPI" && wallet.walletType !== "SHHH") {
|
|
2574
2574
|
throw new ChipiSessionError(
|
|
2575
|
-
`Spending policies
|
|
2575
|
+
`Spending policies require CHIPI or SHHH wallet type. Got: ${wallet.walletType}`,
|
|
2576
2576
|
SESSION_ERRORS.INVALID_WALLET_TYPE_FOR_SESSION
|
|
2577
2577
|
);
|
|
2578
2578
|
}
|
|
@@ -2631,7 +2631,7 @@ var ChipiSessions = class {
|
|
|
2631
2631
|
const txHash = await executePaymasterTransaction({
|
|
2632
2632
|
params: {
|
|
2633
2633
|
encryptKey,
|
|
2634
|
-
wallet
|
|
2634
|
+
wallet,
|
|
2635
2635
|
calls: [
|
|
2636
2636
|
{
|
|
2637
2637
|
contractAddress: wallet.publicKey,
|
|
@@ -2767,7 +2767,7 @@ var ChipiSessions = class {
|
|
|
2767
2767
|
* Remove a spending policy for a session key + token pair.
|
|
2768
2768
|
*
|
|
2769
2769
|
* This executes a sponsored transaction (using owner signature) to call
|
|
2770
|
-
* `remove_spending_policy` on the CHIPI
|
|
2770
|
+
* `remove_spending_policy` on the wallet contract (CHIPI v29 or SHHH V8.4).
|
|
2771
2771
|
*
|
|
2772
2772
|
* After removal, the session key has no spending limits for this token.
|
|
2773
2773
|
*
|
|
@@ -2787,9 +2787,9 @@ var ChipiSessions = class {
|
|
|
2787
2787
|
*/
|
|
2788
2788
|
async removeSpendingPolicy(params, bearerToken) {
|
|
2789
2789
|
const { encryptKey, wallet, sessionPublicKey, token } = params;
|
|
2790
|
-
if (wallet.walletType && wallet.walletType !== "CHIPI") {
|
|
2790
|
+
if (wallet.walletType && wallet.walletType !== "CHIPI" && wallet.walletType !== "SHHH") {
|
|
2791
2791
|
throw new ChipiSessionError(
|
|
2792
|
-
`Spending policies
|
|
2792
|
+
`Spending policies require CHIPI or SHHH wallet type. Got: ${wallet.walletType}`,
|
|
2793
2793
|
SESSION_ERRORS.INVALID_WALLET_TYPE_FOR_SESSION
|
|
2794
2794
|
);
|
|
2795
2795
|
}
|
|
@@ -2809,7 +2809,7 @@ var ChipiSessions = class {
|
|
|
2809
2809
|
const txHash = await executePaymasterTransaction({
|
|
2810
2810
|
params: {
|
|
2811
2811
|
encryptKey,
|
|
2812
|
-
wallet
|
|
2812
|
+
wallet,
|
|
2813
2813
|
calls: [
|
|
2814
2814
|
{
|
|
2815
2815
|
contractAddress: wallet.publicKey,
|