@palindromepay/sdk 2.0.2 → 2.0.4

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@palindromepay/sdk.svg)](https://www.npmjs.com/package/@palindromepay/sdk)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![Documentation](https://img.shields.io/badge/docs-sdk.palindromefinance.com-blue)](https://sdk.palindromefinance.com)
5
+ [![Documentation](https://img.shields.io/badge/docs-sdk.palindromepay.com-blue)](https://sdk.palindromepay.com)
6
6
 
7
7
  A TypeScript/Node SDK for interacting with the PalindromePay escrow smart contract and subgraph, including signature flows, event utilities, token helpers, and robust error handling.
8
8
 
@@ -10,7 +10,7 @@ A TypeScript/Node SDK for interacting with the PalindromePay escrow smart contra
10
10
 
11
11
  ## 📚 Documentation
12
12
 
13
- **Full documentation available at: [sdk.palindromefinance.com](https://sdk.palindromefinance.com)**
13
+ **Full documentation available at: [palindromepay.com/sdk](https://www.palindromepay.com/sdk)**
14
14
 
15
15
  ---
16
16
 
@@ -81,5 +81,5 @@ Contributions are welcome! Please feel free to submit a Pull Request.
81
81
 
82
82
  ## 📞 Support
83
83
 
84
- - GitHub Issues: https://github.com/palindrome-finance/escrow-sdk/issues
85
- - Documentation: https://github.com/palindrome-finance/escrow-sdk#readme
84
+ - GitHub Issues: https://github.com/palindromepay/SDKPalindromePay/issues
85
+ - Documentation: https://www.palindromepay.com/sdk
@@ -911,9 +911,14 @@ export declare class PalindromePaySDK {
911
911
  tokenDecimalsCacheSize: number;
912
912
  };
913
913
  /**
914
- * Clear all caches
914
+ * Clear the Apollo cache. Call this when switching wallets to prevent
915
+ * "Store error: database unavailable" errors.
915
916
  */
916
- clearAllCaches(): void;
917
+ clearApolloCache(): Promise<void>;
918
+ /**
919
+ * Clear all caches including Apollo cache. Call when switching wallets.
920
+ */
921
+ clearAllCaches(): Promise<void>;
917
922
  /**
918
923
  * Clear escrow cache only
919
924
  */
@@ -2169,15 +2169,29 @@ class PalindromePaySDK {
2169
2169
  };
2170
2170
  }
2171
2171
  /**
2172
- * Clear all caches
2172
+ * Clear the Apollo cache. Call this when switching wallets to prevent
2173
+ * "Store error: database unavailable" errors.
2173
2174
  */
2174
- clearAllCaches() {
2175
+ async clearApolloCache() {
2176
+ try {
2177
+ await this.apollo.clearStore();
2178
+ }
2179
+ catch (error) {
2180
+ // If clearStore fails, reset the client entirely
2181
+ this.apollo.stop();
2182
+ await this.apollo.resetStore();
2183
+ }
2184
+ }
2185
+ /**
2186
+ * Clear all caches including Apollo cache. Call when switching wallets.
2187
+ */
2188
+ async clearAllCaches() {
2175
2189
  this.escrowCache.clear();
2176
2190
  this.tokenDecimalsCache.clear();
2177
2191
  this.feeReceiverCache = null;
2178
2192
  this.cachedFeeBps = null;
2179
2193
  this.multicallSupported = null;
2180
- // Note: walletBytecodeHashCache is immutable and never needs clearing
2194
+ await this.clearApolloCache();
2181
2195
  }
2182
2196
  /**
2183
2197
  * Clear escrow cache only
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palindromepay/sdk",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "TypeScript SDK for PalindromeCryptoEscrow - Secure blockchain escrow with buyer/seller protection",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,12 +29,12 @@
29
29
  "license": "MIT",
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "https://github.com/palindrome-finance/escrow-sdk.git"
32
+ "url": "https://github.com/palindromepay/SDKPalindromePay.git"
33
33
  },
34
34
  "bugs": {
35
- "url": "https://github.com/palindrome-finance/escrow-sdk/issues"
35
+ "url": "https://github.com/palindromepay/SDKPalindromePay/issues"
36
36
  },
37
- "homepage": "https://github.com/palindrome-finance/escrow-sdk#readme",
37
+ "homepage": "https://www.palindromepay.com/sdk",
38
38
  "files": [
39
39
  "dist",
40
40
  "README.md",