@owney/sdk 0.2.14 → 0.2.16
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.cjs +1 -6
- package/dist/index.js +1 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -421,7 +421,6 @@ var ZyfaiAgent = class {
|
|
|
421
421
|
try {
|
|
422
422
|
await this.connectAuth(state, chainId);
|
|
423
423
|
} catch (error) {
|
|
424
|
-
await this.disconnect();
|
|
425
424
|
throw error;
|
|
426
425
|
}
|
|
427
426
|
}
|
|
@@ -447,10 +446,8 @@ var ZyfaiAgent = class {
|
|
|
447
446
|
validChainId,
|
|
448
447
|
amount
|
|
449
448
|
);
|
|
450
|
-
console.log("zyf deposit raw", raw);
|
|
451
449
|
return mapDeposit(raw);
|
|
452
450
|
} catch (error) {
|
|
453
|
-
await this.disconnect();
|
|
454
451
|
throw error;
|
|
455
452
|
}
|
|
456
453
|
}
|
|
@@ -464,7 +461,6 @@ var ZyfaiAgent = class {
|
|
|
464
461
|
amount,
|
|
465
462
|
token
|
|
466
463
|
);
|
|
467
|
-
console.log("zyf withdraw raw", raw);
|
|
468
464
|
if (!raw.success) {
|
|
469
465
|
throw new OwneyError(
|
|
470
466
|
"WITHDRAW_FAILED",
|
|
@@ -479,7 +475,6 @@ var ZyfaiAgent = class {
|
|
|
479
475
|
async getBalances(state, chainId) {
|
|
480
476
|
const { smartWallet, chainId: validChainId } = await this.resolveSmartWallet(state, chainId);
|
|
481
477
|
const raw = await this.sdk.getPortfolio(this.getAddress());
|
|
482
|
-
console.log("zyf balance raw", raw);
|
|
483
478
|
return mapBalances(raw, validChainId, smartWallet);
|
|
484
479
|
}
|
|
485
480
|
async getEarnings(state, chainId) {
|
|
@@ -987,7 +982,7 @@ var OwneySDK = class {
|
|
|
987
982
|
const balances = eligibleAgents.map((agent) => {
|
|
988
983
|
const agentBalance = aggregated.agentBalances[agent.id];
|
|
989
984
|
const tokenBalance = agentBalance?.tokens.find(
|
|
990
|
-
(t) => t.chainId === chainId && t.asset === asset
|
|
985
|
+
(t) => t.chainId === chainId && t.asset.toUpperCase() === asset.toUpperCase()
|
|
991
986
|
);
|
|
992
987
|
if (!tokenBalance)
|
|
993
988
|
return { agent, balance: 0n };
|
package/dist/index.js
CHANGED
|
@@ -391,7 +391,6 @@ var ZyfaiAgent = class {
|
|
|
391
391
|
try {
|
|
392
392
|
await this.connectAuth(state, chainId);
|
|
393
393
|
} catch (error) {
|
|
394
|
-
await this.disconnect();
|
|
395
394
|
throw error;
|
|
396
395
|
}
|
|
397
396
|
}
|
|
@@ -417,10 +416,8 @@ var ZyfaiAgent = class {
|
|
|
417
416
|
validChainId,
|
|
418
417
|
amount
|
|
419
418
|
);
|
|
420
|
-
console.log("zyf deposit raw", raw);
|
|
421
419
|
return mapDeposit(raw);
|
|
422
420
|
} catch (error) {
|
|
423
|
-
await this.disconnect();
|
|
424
421
|
throw error;
|
|
425
422
|
}
|
|
426
423
|
}
|
|
@@ -434,7 +431,6 @@ var ZyfaiAgent = class {
|
|
|
434
431
|
amount,
|
|
435
432
|
token
|
|
436
433
|
);
|
|
437
|
-
console.log("zyf withdraw raw", raw);
|
|
438
434
|
if (!raw.success) {
|
|
439
435
|
throw new OwneyError(
|
|
440
436
|
"WITHDRAW_FAILED",
|
|
@@ -449,7 +445,6 @@ var ZyfaiAgent = class {
|
|
|
449
445
|
async getBalances(state, chainId) {
|
|
450
446
|
const { smartWallet, chainId: validChainId } = await this.resolveSmartWallet(state, chainId);
|
|
451
447
|
const raw = await this.sdk.getPortfolio(this.getAddress());
|
|
452
|
-
console.log("zyf balance raw", raw);
|
|
453
448
|
return mapBalances(raw, validChainId, smartWallet);
|
|
454
449
|
}
|
|
455
450
|
async getEarnings(state, chainId) {
|
|
@@ -957,7 +952,7 @@ var OwneySDK = class {
|
|
|
957
952
|
const balances = eligibleAgents.map((agent) => {
|
|
958
953
|
const agentBalance = aggregated.agentBalances[agent.id];
|
|
959
954
|
const tokenBalance = agentBalance?.tokens.find(
|
|
960
|
-
(t) => t.chainId === chainId && t.asset === asset
|
|
955
|
+
(t) => t.chainId === chainId && t.asset.toUpperCase() === asset.toUpperCase()
|
|
961
956
|
);
|
|
962
957
|
if (!tokenBalance)
|
|
963
958
|
return { agent, balance: 0n };
|