@agether/sdk 1.0.0 → 1.2.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 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +16 -2
- package/dist/index.mjs +15 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -927,6 +927,7 @@ declare const REPUTATION_CREDIT_ABI: string[];
|
|
|
927
927
|
declare const LP_VAULT_ABI: string[];
|
|
928
928
|
declare const AGENT_REPUTATION_ABI: string[];
|
|
929
929
|
declare const VALIDATION_REGISTRY_ABI: string[];
|
|
930
|
+
declare const MORPHO_CREDIT_ABI: string[];
|
|
930
931
|
declare const ERC20_ABI: string[];
|
|
931
932
|
|
|
932
|
-
export { ACCOUNT_FACTORY_ABI, AGENT_ACCOUNT_ABI, AGENT_REPUTATION_ABI, AgentIdentityClient, type AgentIdentityClientOptions, type AgentReputation, AgetherClient, type AgetherClientOptions, type AgetherConfig, AgetherError, type BayesianScore, CREDIT_PROVIDER_ABI, ChainId, type ContractAddresses, type CreditApplication, type CreditAppliedEvent, type CreditApprovedEvent, type CreditDrawnEvent, type CreditInfo, type CreditLine, CreditNotActiveError, type CreditRejectedEvent, type CreditRepaidEvent, CreditStatus, type DrawRequest, ERC20_ABI, type GraduationStatus, IDENTITY_REGISTRY_ABI, InsufficientCreditError, type LPPosition, LP_VAULT_ABI, type LoanPosition, type MorphoMarketParams, type PaymentProof, type PaymentRequirements, type ProviderStatus, REPUTATION_CREDIT_ABI, type RepayRequest, type RiskCheckResponse, type RiskFactor, type ScoreExplanation, type ScoredLimitPreview, ScoringClient, type ScoringContext, ScoringRejectedError, type ScoringRequest, type ScoringResult, type TransactionResult, VALIDATION_REGISTRY_ABI, VaultClient, type VaultClientOptions, type VaultStats, WalletClient, type WalletClientConfig, type WalletInfo, X402Client, type X402Config, type X402PaymentRequest, type X402PaymentResult, type X402Response, bpsToRate, createConfig, formatAPR, formatAddress, formatHealthFactor, formatPercent, formatTimestamp, formatUSD, formatUnits, getDefaultConfig, getUSDCAddress, parseUnits, rateToBps };
|
|
933
|
+
export { ACCOUNT_FACTORY_ABI, AGENT_ACCOUNT_ABI, AGENT_REPUTATION_ABI, AgentIdentityClient, type AgentIdentityClientOptions, type AgentReputation, AgetherClient, type AgetherClientOptions, type AgetherConfig, AgetherError, type BayesianScore, CREDIT_PROVIDER_ABI, ChainId, type ContractAddresses, type CreditApplication, type CreditAppliedEvent, type CreditApprovedEvent, type CreditDrawnEvent, type CreditInfo, type CreditLine, CreditNotActiveError, type CreditRejectedEvent, type CreditRepaidEvent, CreditStatus, type DrawRequest, ERC20_ABI, type GraduationStatus, IDENTITY_REGISTRY_ABI, InsufficientCreditError, type LPPosition, LP_VAULT_ABI, type LoanPosition, MORPHO_CREDIT_ABI, type MorphoMarketParams, type PaymentProof, type PaymentRequirements, type ProviderStatus, REPUTATION_CREDIT_ABI, type RepayRequest, type RiskCheckResponse, type RiskFactor, type ScoreExplanation, type ScoredLimitPreview, ScoringClient, type ScoringContext, ScoringRejectedError, type ScoringRequest, type ScoringResult, type TransactionResult, VALIDATION_REGISTRY_ABI, VaultClient, type VaultClientOptions, type VaultStats, WalletClient, type WalletClientConfig, type WalletInfo, X402Client, type X402Config, type X402PaymentRequest, type X402PaymentResult, type X402Response, bpsToRate, createConfig, formatAPR, formatAddress, formatHealthFactor, formatPercent, formatTimestamp, formatUSD, formatUnits, getDefaultConfig, getUSDCAddress, parseUnits, rateToBps };
|
package/dist/index.d.ts
CHANGED
|
@@ -927,6 +927,7 @@ declare const REPUTATION_CREDIT_ABI: string[];
|
|
|
927
927
|
declare const LP_VAULT_ABI: string[];
|
|
928
928
|
declare const AGENT_REPUTATION_ABI: string[];
|
|
929
929
|
declare const VALIDATION_REGISTRY_ABI: string[];
|
|
930
|
+
declare const MORPHO_CREDIT_ABI: string[];
|
|
930
931
|
declare const ERC20_ABI: string[];
|
|
931
932
|
|
|
932
|
-
export { ACCOUNT_FACTORY_ABI, AGENT_ACCOUNT_ABI, AGENT_REPUTATION_ABI, AgentIdentityClient, type AgentIdentityClientOptions, type AgentReputation, AgetherClient, type AgetherClientOptions, type AgetherConfig, AgetherError, type BayesianScore, CREDIT_PROVIDER_ABI, ChainId, type ContractAddresses, type CreditApplication, type CreditAppliedEvent, type CreditApprovedEvent, type CreditDrawnEvent, type CreditInfo, type CreditLine, CreditNotActiveError, type CreditRejectedEvent, type CreditRepaidEvent, CreditStatus, type DrawRequest, ERC20_ABI, type GraduationStatus, IDENTITY_REGISTRY_ABI, InsufficientCreditError, type LPPosition, LP_VAULT_ABI, type LoanPosition, type MorphoMarketParams, type PaymentProof, type PaymentRequirements, type ProviderStatus, REPUTATION_CREDIT_ABI, type RepayRequest, type RiskCheckResponse, type RiskFactor, type ScoreExplanation, type ScoredLimitPreview, ScoringClient, type ScoringContext, ScoringRejectedError, type ScoringRequest, type ScoringResult, type TransactionResult, VALIDATION_REGISTRY_ABI, VaultClient, type VaultClientOptions, type VaultStats, WalletClient, type WalletClientConfig, type WalletInfo, X402Client, type X402Config, type X402PaymentRequest, type X402PaymentResult, type X402Response, bpsToRate, createConfig, formatAPR, formatAddress, formatHealthFactor, formatPercent, formatTimestamp, formatUSD, formatUnits, getDefaultConfig, getUSDCAddress, parseUnits, rateToBps };
|
|
933
|
+
export { ACCOUNT_FACTORY_ABI, AGENT_ACCOUNT_ABI, AGENT_REPUTATION_ABI, AgentIdentityClient, type AgentIdentityClientOptions, type AgentReputation, AgetherClient, type AgetherClientOptions, type AgetherConfig, AgetherError, type BayesianScore, CREDIT_PROVIDER_ABI, ChainId, type ContractAddresses, type CreditApplication, type CreditAppliedEvent, type CreditApprovedEvent, type CreditDrawnEvent, type CreditInfo, type CreditLine, CreditNotActiveError, type CreditRejectedEvent, type CreditRepaidEvent, CreditStatus, type DrawRequest, ERC20_ABI, type GraduationStatus, IDENTITY_REGISTRY_ABI, InsufficientCreditError, type LPPosition, LP_VAULT_ABI, type LoanPosition, MORPHO_CREDIT_ABI, type MorphoMarketParams, type PaymentProof, type PaymentRequirements, type ProviderStatus, REPUTATION_CREDIT_ABI, type RepayRequest, type RiskCheckResponse, type RiskFactor, type ScoreExplanation, type ScoredLimitPreview, ScoringClient, type ScoringContext, ScoringRejectedError, type ScoringRequest, type ScoringResult, type TransactionResult, VALIDATION_REGISTRY_ABI, VaultClient, type VaultClientOptions, type VaultStats, WalletClient, type WalletClientConfig, type WalletInfo, X402Client, type X402Config, type X402PaymentRequest, type X402PaymentResult, type X402Response, bpsToRate, createConfig, formatAPR, formatAddress, formatHealthFactor, formatPercent, formatTimestamp, formatUSD, formatUnits, getDefaultConfig, getUSDCAddress, parseUnits, rateToBps };
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
IDENTITY_REGISTRY_ABI: () => IDENTITY_REGISTRY_ABI,
|
|
45
45
|
InsufficientCreditError: () => InsufficientCreditError,
|
|
46
46
|
LP_VAULT_ABI: () => LP_VAULT_ABI,
|
|
47
|
+
MORPHO_CREDIT_ABI: () => MORPHO_CREDIT_ABI,
|
|
47
48
|
REPUTATION_CREDIT_ABI: () => REPUTATION_CREDIT_ABI,
|
|
48
49
|
ScoringClient: () => ScoringClient,
|
|
49
50
|
ScoringRejectedError: () => ScoringRejectedError,
|
|
@@ -151,7 +152,8 @@ var AGENT_ACCOUNT_ABI = [
|
|
|
151
152
|
"function drawCredit(address creditProvider, uint256 amount)",
|
|
152
153
|
"function repayCredit(address creditProvider, uint256 amount)",
|
|
153
154
|
"function fund(address token, uint256 amount)",
|
|
154
|
-
"function withdraw(address token, uint256 amount, address to)"
|
|
155
|
+
"function withdraw(address token, uint256 amount, address to)",
|
|
156
|
+
"function approveCreditProvider(address creditProvider)"
|
|
155
157
|
];
|
|
156
158
|
var CREDIT_PROVIDER_ABI = [
|
|
157
159
|
"function asset() view returns (address)",
|
|
@@ -230,6 +232,17 @@ var VALIDATION_REGISTRY_ABI = [
|
|
|
230
232
|
"function isAgentCodeApprovedForTag(uint256 agentId, string tag) view returns (bool)",
|
|
231
233
|
"function getAgentValidations(uint256 agentId) view returns (bytes32[])"
|
|
232
234
|
];
|
|
235
|
+
var MORPHO_CREDIT_ABI = [
|
|
236
|
+
...CREDIT_PROVIDER_ABI,
|
|
237
|
+
"function depositCollateral(address collateralToken, uint256 amount)",
|
|
238
|
+
"function depositCollateralFor(address onBehalf, address collateralToken, uint256 amount)",
|
|
239
|
+
"function withdrawCollateral(address collateralToken, uint256 amount)",
|
|
240
|
+
"function drawWithCollateral(address collateralToken, uint256 amount)",
|
|
241
|
+
"function repayWithCollateral(address collateralToken, uint256 amount)",
|
|
242
|
+
"function getPosition(address account, address collateralToken) view returns (tuple(uint256 collateralAmount, uint256 borrowedAmount, uint256 borrowShares, bool isActive))",
|
|
243
|
+
"function getSupportedCollaterals() view returns (address[])",
|
|
244
|
+
"function markets(address collateralToken) view returns (tuple(tuple(address loanToken, address collateralToken, address oracle, address irm, uint256 lltv) params, bytes32 marketId, uint256 maxLtvBps, bool active))"
|
|
245
|
+
];
|
|
233
246
|
var ERC20_ABI = [
|
|
234
247
|
"function balanceOf(address account) view returns (uint256)",
|
|
235
248
|
"function allowance(address owner, address spender) view returns (uint256)",
|
|
@@ -878,7 +891,7 @@ var AgentIdentityClient = class {
|
|
|
878
891
|
this.config = options.config;
|
|
879
892
|
this.signer = options.signer;
|
|
880
893
|
const identityAddr = options.config.contracts?.identityRegistry || ERC8004_SEPOLIA.identityRegistry;
|
|
881
|
-
const reputationAddr = ERC8004_SEPOLIA.reputationRegistry;
|
|
894
|
+
const reputationAddr = options.config.contracts?.reputationRegistry || ERC8004_SEPOLIA.reputationRegistry;
|
|
882
895
|
this.identityRegistry = new import_ethers3.ethers.Contract(identityAddr, ERC8004_IDENTITY_ABI, this.signer);
|
|
883
896
|
this.reputationRegistry = new import_ethers3.ethers.Contract(reputationAddr, ERC8004_REPUTATION_ABI, this.signer);
|
|
884
897
|
}
|
|
@@ -1657,6 +1670,7 @@ function rateToBps(rate) {
|
|
|
1657
1670
|
IDENTITY_REGISTRY_ABI,
|
|
1658
1671
|
InsufficientCreditError,
|
|
1659
1672
|
LP_VAULT_ABI,
|
|
1673
|
+
MORPHO_CREDIT_ABI,
|
|
1660
1674
|
REPUTATION_CREDIT_ABI,
|
|
1661
1675
|
ScoringClient,
|
|
1662
1676
|
ScoringRejectedError,
|
package/dist/index.mjs
CHANGED
|
@@ -82,7 +82,8 @@ var AGENT_ACCOUNT_ABI = [
|
|
|
82
82
|
"function drawCredit(address creditProvider, uint256 amount)",
|
|
83
83
|
"function repayCredit(address creditProvider, uint256 amount)",
|
|
84
84
|
"function fund(address token, uint256 amount)",
|
|
85
|
-
"function withdraw(address token, uint256 amount, address to)"
|
|
85
|
+
"function withdraw(address token, uint256 amount, address to)",
|
|
86
|
+
"function approveCreditProvider(address creditProvider)"
|
|
86
87
|
];
|
|
87
88
|
var CREDIT_PROVIDER_ABI = [
|
|
88
89
|
"function asset() view returns (address)",
|
|
@@ -161,6 +162,17 @@ var VALIDATION_REGISTRY_ABI = [
|
|
|
161
162
|
"function isAgentCodeApprovedForTag(uint256 agentId, string tag) view returns (bool)",
|
|
162
163
|
"function getAgentValidations(uint256 agentId) view returns (bytes32[])"
|
|
163
164
|
];
|
|
165
|
+
var MORPHO_CREDIT_ABI = [
|
|
166
|
+
...CREDIT_PROVIDER_ABI,
|
|
167
|
+
"function depositCollateral(address collateralToken, uint256 amount)",
|
|
168
|
+
"function depositCollateralFor(address onBehalf, address collateralToken, uint256 amount)",
|
|
169
|
+
"function withdrawCollateral(address collateralToken, uint256 amount)",
|
|
170
|
+
"function drawWithCollateral(address collateralToken, uint256 amount)",
|
|
171
|
+
"function repayWithCollateral(address collateralToken, uint256 amount)",
|
|
172
|
+
"function getPosition(address account, address collateralToken) view returns (tuple(uint256 collateralAmount, uint256 borrowedAmount, uint256 borrowShares, bool isActive))",
|
|
173
|
+
"function getSupportedCollaterals() view returns (address[])",
|
|
174
|
+
"function markets(address collateralToken) view returns (tuple(tuple(address loanToken, address collateralToken, address oracle, address irm, uint256 lltv) params, bytes32 marketId, uint256 maxLtvBps, bool active))"
|
|
175
|
+
];
|
|
164
176
|
var ERC20_ABI = [
|
|
165
177
|
"function balanceOf(address account) view returns (uint256)",
|
|
166
178
|
"function allowance(address owner, address spender) view returns (uint256)",
|
|
@@ -809,7 +821,7 @@ var AgentIdentityClient = class {
|
|
|
809
821
|
this.config = options.config;
|
|
810
822
|
this.signer = options.signer;
|
|
811
823
|
const identityAddr = options.config.contracts?.identityRegistry || ERC8004_SEPOLIA.identityRegistry;
|
|
812
|
-
const reputationAddr = ERC8004_SEPOLIA.reputationRegistry;
|
|
824
|
+
const reputationAddr = options.config.contracts?.reputationRegistry || ERC8004_SEPOLIA.reputationRegistry;
|
|
813
825
|
this.identityRegistry = new ethers2.Contract(identityAddr, ERC8004_IDENTITY_ABI, this.signer);
|
|
814
826
|
this.reputationRegistry = new ethers2.Contract(reputationAddr, ERC8004_REPUTATION_ABI, this.signer);
|
|
815
827
|
}
|
|
@@ -1587,6 +1599,7 @@ export {
|
|
|
1587
1599
|
IDENTITY_REGISTRY_ABI,
|
|
1588
1600
|
InsufficientCreditError,
|
|
1589
1601
|
LP_VAULT_ABI,
|
|
1602
|
+
MORPHO_CREDIT_ABI,
|
|
1590
1603
|
REPUTATION_CREDIT_ABI,
|
|
1591
1604
|
ScoringClient,
|
|
1592
1605
|
ScoringRejectedError,
|