@zendfi/sdk 0.8.0 → 0.8.1
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.js +3 -19
- package/dist/index.mjs +3 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2279,9 +2279,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
2279
2279
|
let keypair;
|
|
2280
2280
|
if (this.isCached()) {
|
|
2281
2281
|
keypair = this.cachedKeypair;
|
|
2282
|
-
if (typeof console !== "undefined") {
|
|
2283
|
-
console.log("\u{1F680} Using cached keypair - instant signing (no PIN required)");
|
|
2284
|
-
}
|
|
2285
2282
|
} else {
|
|
2286
2283
|
if (!pin) {
|
|
2287
2284
|
throw new Error("PIN required: no cached keypair available");
|
|
@@ -2294,9 +2291,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
2294
2291
|
if (cacheKeypair) {
|
|
2295
2292
|
const ttl = cacheTTL || this.DEFAULT_CACHE_TTL_MS;
|
|
2296
2293
|
this.cacheKeypair(keypair, ttl);
|
|
2297
|
-
if (typeof console !== "undefined") {
|
|
2298
|
-
console.log(`\u2705 Keypair decrypted and cached for ${ttl / 1e3 / 60} minutes`);
|
|
2299
|
-
}
|
|
2300
2294
|
}
|
|
2301
2295
|
}
|
|
2302
2296
|
transaction.partialSign(keypair);
|
|
@@ -2342,9 +2336,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
2342
2336
|
clearCache() {
|
|
2343
2337
|
this.cachedKeypair = null;
|
|
2344
2338
|
this.cacheExpiry = null;
|
|
2345
|
-
if (typeof console !== "undefined") {
|
|
2346
|
-
console.log("\u{1F9F9} Keypair cache cleared");
|
|
2347
|
-
}
|
|
2348
2339
|
}
|
|
2349
2340
|
/**
|
|
2350
2341
|
* Decrypt and cache keypair without signing a transaction
|
|
@@ -2371,9 +2362,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
2371
2362
|
);
|
|
2372
2363
|
const ttl = cacheTTL || this.DEFAULT_CACHE_TTL_MS;
|
|
2373
2364
|
this.cacheKeypair(keypair, ttl);
|
|
2374
|
-
if (typeof console !== "undefined") {
|
|
2375
|
-
console.log(`\u{1F513} Session key unlocked and cached for ${ttl / 1e3 / 60} minutes`);
|
|
2376
|
-
}
|
|
2377
2365
|
}
|
|
2378
2366
|
/**
|
|
2379
2367
|
* Get time remaining until cache expires (in milliseconds)
|
|
@@ -2402,10 +2390,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
2402
2390
|
throw new Error("Cannot extend cache: no cached keypair");
|
|
2403
2391
|
}
|
|
2404
2392
|
this.cacheExpiry += additionalTTL;
|
|
2405
|
-
if (typeof console !== "undefined") {
|
|
2406
|
-
const remainingMinutes = this.getCacheTimeRemaining() / 1e3 / 60;
|
|
2407
|
-
console.log(`\u23F0 Cache extended - ${remainingMinutes.toFixed(1)} minutes remaining`);
|
|
2408
|
-
}
|
|
2409
2393
|
}
|
|
2410
2394
|
/**
|
|
2411
2395
|
* Set session key ID after backend creation
|
|
@@ -2446,10 +2430,10 @@ async function encryptKeypairWithLit(keypair, options) {
|
|
|
2446
2430
|
// USDC on Ethereum
|
|
2447
2431
|
standardContractType: "ERC20",
|
|
2448
2432
|
chain: "ethereum",
|
|
2449
|
-
method: "
|
|
2450
|
-
parameters: [],
|
|
2433
|
+
method: "balanceOf",
|
|
2434
|
+
parameters: [":userAddress"],
|
|
2451
2435
|
returnValueTest: {
|
|
2452
|
-
comparator: "
|
|
2436
|
+
comparator: ">=",
|
|
2453
2437
|
value: "0"
|
|
2454
2438
|
}
|
|
2455
2439
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1812,9 +1812,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
1812
1812
|
let keypair;
|
|
1813
1813
|
if (this.isCached()) {
|
|
1814
1814
|
keypair = this.cachedKeypair;
|
|
1815
|
-
if (typeof console !== "undefined") {
|
|
1816
|
-
console.log("\u{1F680} Using cached keypair - instant signing (no PIN required)");
|
|
1817
|
-
}
|
|
1818
1815
|
} else {
|
|
1819
1816
|
if (!pin) {
|
|
1820
1817
|
throw new Error("PIN required: no cached keypair available");
|
|
@@ -1827,9 +1824,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
1827
1824
|
if (cacheKeypair) {
|
|
1828
1825
|
const ttl = cacheTTL || this.DEFAULT_CACHE_TTL_MS;
|
|
1829
1826
|
this.cacheKeypair(keypair, ttl);
|
|
1830
|
-
if (typeof console !== "undefined") {
|
|
1831
|
-
console.log(`\u2705 Keypair decrypted and cached for ${ttl / 1e3 / 60} minutes`);
|
|
1832
|
-
}
|
|
1833
1827
|
}
|
|
1834
1828
|
}
|
|
1835
1829
|
transaction.partialSign(keypair);
|
|
@@ -1875,9 +1869,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
1875
1869
|
clearCache() {
|
|
1876
1870
|
this.cachedKeypair = null;
|
|
1877
1871
|
this.cacheExpiry = null;
|
|
1878
|
-
if (typeof console !== "undefined") {
|
|
1879
|
-
console.log("\u{1F9F9} Keypair cache cleared");
|
|
1880
|
-
}
|
|
1881
1872
|
}
|
|
1882
1873
|
/**
|
|
1883
1874
|
* Decrypt and cache keypair without signing a transaction
|
|
@@ -1904,9 +1895,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
1904
1895
|
);
|
|
1905
1896
|
const ttl = cacheTTL || this.DEFAULT_CACHE_TTL_MS;
|
|
1906
1897
|
this.cacheKeypair(keypair, ttl);
|
|
1907
|
-
if (typeof console !== "undefined") {
|
|
1908
|
-
console.log(`\u{1F513} Session key unlocked and cached for ${ttl / 1e3 / 60} minutes`);
|
|
1909
|
-
}
|
|
1910
1898
|
}
|
|
1911
1899
|
/**
|
|
1912
1900
|
* Get time remaining until cache expires (in milliseconds)
|
|
@@ -1935,10 +1923,6 @@ var DeviceBoundSessionKey = class _DeviceBoundSessionKey {
|
|
|
1935
1923
|
throw new Error("Cannot extend cache: no cached keypair");
|
|
1936
1924
|
}
|
|
1937
1925
|
this.cacheExpiry += additionalTTL;
|
|
1938
|
-
if (typeof console !== "undefined") {
|
|
1939
|
-
const remainingMinutes = this.getCacheTimeRemaining() / 1e3 / 60;
|
|
1940
|
-
console.log(`\u23F0 Cache extended - ${remainingMinutes.toFixed(1)} minutes remaining`);
|
|
1941
|
-
}
|
|
1942
1926
|
}
|
|
1943
1927
|
/**
|
|
1944
1928
|
* Set session key ID after backend creation
|
|
@@ -1979,10 +1963,10 @@ async function encryptKeypairWithLit(keypair, options) {
|
|
|
1979
1963
|
// USDC on Ethereum
|
|
1980
1964
|
standardContractType: "ERC20",
|
|
1981
1965
|
chain: "ethereum",
|
|
1982
|
-
method: "
|
|
1983
|
-
parameters: [],
|
|
1966
|
+
method: "balanceOf",
|
|
1967
|
+
parameters: [":userAddress"],
|
|
1984
1968
|
returnValueTest: {
|
|
1985
|
-
comparator: "
|
|
1969
|
+
comparator: ">=",
|
|
1986
1970
|
value: "0"
|
|
1987
1971
|
}
|
|
1988
1972
|
}
|