Skip to content

Commit

Permalink
- fix: rename aave
Browse files Browse the repository at this point in the history
  • Loading branch information
agallardol committed Aug 21, 2024
1 parent 3017f44 commit 9ae0379
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 23 deletions.
6 changes: 6 additions & 0 deletions apps/shinkai-tool-aave-loan-requester/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable */
export default {
displayName: '@shinkai_protocol/shinkai-tool-aave-loan-requester',
preset: '../../jest.preset.js',
coverageDirectory: '../../coverage/apps/shinkai-tool-aave-loan-requester',
};
4 changes: 4 additions & 0 deletions apps/shinkai-tool-aave-loan-requester/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@shinkai_protocol/shinkai-tool-aave-loan-requester",
"type": "commonjs"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shinkai_protocol/shinkai-tool-aave",
"name": "@shinkai_protocol/shinkai-tool-aave-loan-requester",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/shinkai-tool-aave/src",
"sourceRoot": "apps/shinkai-tool-aave-loan-requester/src",
"projectType": "library",
"tags": ["tool"],
"targets": {
Expand All @@ -13,8 +13,8 @@
"defaultConfiguration": "production",
"options": {
"commands": [
"npx ts-node apps/shinkai-tool-aave/generate-shinkai-viem-export.ts",
"npx ts-node scripts/tool-bundler.ts --entry ./apps/shinkai-tool-aave/src/index.ts --outputFolder ./dist/apps/shinkai-tool-aave"
"npx ts-node apps/shinkai-tool-aave-loan-requester/generate-shinkai-viem-export.ts",
"npx ts-node scripts/tool-bundler.ts --entry ./apps/shinkai-tool-aave-loan-requester/src/index.ts --outputFolder ./dist/apps/shinkai-tool-aave-loan-requester"
],
"parallel": false
},
Expand All @@ -29,8 +29,8 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/shinkai-tool-aave/**/*.ts",
"apps/shinkai-tool-aave/package.json"
"apps/shinkai-tool-aave-loan-requester/**/*.ts",
"apps/shinkai-tool-aave-loan-requester/package.json"
]
}
}
Expand Down

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@
var version2;
var init_version2 = __esm({
"node_modules/viem/_esm/errors/version.js"() {
version2 = "2.19.7";
version2 = "2.19.8";
}
});

Expand Down Expand Up @@ -44955,7 +44955,13 @@ zurdo`.split("\n");
if (address !== this.selectedAddress) {
throw new Error("Address mismatch");
}
return this.client.signTypedData({ account: address, typedData });
return this.client.signTypedData({
account: address,
domain: typedData.domain,
types: typedData.types,
message: typedData.message,
primaryType: typedData.primaryType
});
}
async getChainId() {
const chainId = await this.client.getChainId();
Expand Down
6 changes: 0 additions & 6 deletions apps/shinkai-tool-aave/jest.config.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/shinkai-tool-aave/package.json

This file was deleted.

2 changes: 0 additions & 2 deletions apps/shinkai-tool-aave/src/bundled-resources/shinkai-viem.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class Tool extends BaseTool<Config, Params, Result> {
async run(params: Params): Promise<RunResult<Result>> {
const DEFILLAMA_URL = 'https://defillama.com/protocols/lending';
const browser = await playwright['chromium'].launch({
executablePath: this.config?.chromePath || chromePaths.chrome,
executablePath: this.config?.chromePath || chromePaths.chrome
});
const context = await browser.newContext();
const page = await context.newPage();
Expand Down
2 changes: 1 addition & 1 deletion libs/shinkai-tools-runner/src/built_in_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ lazy_static! {
)),
);
m.insert(
"shinkai-tool-aave",
"shinkai-tool-aave-loan-requester",
&*Box::leak(Box::new(
serde_json::from_str::<ToolDefinition>(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
Expand Down
38 changes: 37 additions & 1 deletion libs/shinkai-tools-runner/src/lib.test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,43 @@ async fn shinkai_tool_playwright_example() {
.await;
assert!(run_result.is_ok());
assert_eq!(
run_result.unwrap().data["title"].as_str().unwrap().to_string(),
run_result.unwrap().data["title"]
.as_str()
.unwrap()
.to_string(),
"Shinkai | Fully Local AI (Models, Files and Agents)".to_string()
);
}

#[tokio::test]
async fn shinkai_tool_defillama_lending_tvl_rankings() {
let tool_definition = get_tool("shinkai-tool-defillama-lending-tvl-rankings").unwrap();
let tool = Tool::new(
tool_definition.code.clone().unwrap(),
serde_json::Value::Null,
);
let run_result = tool
.run(
serde_json::json!({ "all": true }),
None,
)
.await;
assert!(run_result.is_ok());
assert_eq!(run_result.unwrap().data["rowsCount"], 405);
}

#[tokio::test]
async fn shinkai_tool_aave() {
let tool_definition = get_tool("shinkai-tool-aave-loan-requester").unwrap();
let tool = Tool::new(
tool_definition.code.clone().unwrap(),
serde_json::Value::Null,
);
let run_result = tool
.run(
serde_json::json!({ "inputValue": "0.005", "assetSymbol": "ETH" }),
None,
)
.await;
assert!(run_result.is_ok());
}

0 comments on commit 9ae0379

Please sign in to comment.