@nibgate/sdk 0.2.12 → 0.2.14
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/nibgate.js +35 -2
- package/dist/nibgate.js.map +3 -3
- package/dist/nibgate.min.js +33 -33
- package/dist/nibgate.min.js.map +3 -3
- package/package.json +1 -1
- package/src/browser/gateway.js +10 -1
package/package.json
CHANGED
package/src/browser/gateway.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BatchEvmScheme } from './schemes/batch-scheme.js';
|
|
2
1
|
import { stringifyJson } from './json.js';
|
|
3
2
|
|
|
4
3
|
function encodeBase64(value) {
|
|
@@ -18,6 +17,16 @@ export async function createCircleGatewayBrowserAdapter(options = {}) {
|
|
|
18
17
|
throw new Error('Circle Gateway browser adapter requires an EVM signer with address and signTypedData.');
|
|
19
18
|
}
|
|
20
19
|
|
|
20
|
+
let BatchEvmScheme;
|
|
21
|
+
try {
|
|
22
|
+
const circle = await import('@circle-fin/x402-batching/client');
|
|
23
|
+
BatchEvmScheme = circle.BatchEvmScheme;
|
|
24
|
+
} catch (err) {
|
|
25
|
+
console.warn('[nibgate] Failed to import @circle-fin/x402-batching/client:', err.message);
|
|
26
|
+
console.warn('[nibgate] Falling back to custom BatchEvmScheme');
|
|
27
|
+
const local = await import('./schemes/batch-scheme.js');
|
|
28
|
+
BatchEvmScheme = local.BatchEvmScheme;
|
|
29
|
+
}
|
|
21
30
|
const scheme = options.clientModule?.BatchEvmScheme
|
|
22
31
|
? new options.clientModule.BatchEvmScheme(signer)
|
|
23
32
|
: new BatchEvmScheme(signer);
|