Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin): implement erc20 plugin support #76

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
958dfeb
add erc20 function and read and transfer function test
ale-sain Feb 18, 2025
4866254
conflict with main resolved
ale-sain Feb 19, 2025
90f3879
unit-test erc20 key fonction on devnet ok
ale-sain Feb 19, 2025
12d3768
tools for key function ok
ale-sain Feb 19, 2025
b197a67
signature erc20 tools for writing blockchain ok
ale-sain Feb 19, 2025
6120a30
fix/convert symbol uppercase each time
ale-sain Feb 19, 2025
11b7a63
add 2 functions for allowance of user
ale-sain Feb 19, 2025
d9c47e0
improve param schemas and js doc
ale-sain Feb 19, 2025
4515042
remove batch transaction for signed function
ale-sain Feb 19, 2025
764acc9
improve test
ale-sain Feb 20, 2025
e8c9d71
add validateandformatparse and resolve bug signature function without…
ale-sain Feb 20, 2025
29f149a
remove comment and console log
ale-sain Feb 20, 2025
4f9166c
types interface in good files
ale-sain Feb 20, 2025
5bf2b23
prettier fix
ale-sain Feb 20, 2025
0a54bcc
setenvvar like before
ale-sain Feb 20, 2025
5233739
remove balancesignature, clean core/token, improve tools signature de…
ale-sain Feb 20, 2025
01b8d0a
change tool cases
ale-sain Feb 20, 2025
b57b697
prettier fix
ale-sain Feb 20, 2025
f35c27c
fix avnu and fibrous abi/erc20abi
ale-sain Feb 20, 2025
c05ac12
fix opus error
ale-sain Feb 20, 2025
5103cc7
remove limit config and all dep and fix transferFrom test
ale-sain Feb 20, 2025
c2ce640
limit fix
ale-sain Feb 20, 2025
433c091
modify tx data send from signature function to starknetagent.tsx to s…
ale-sain Feb 20, 2025
b656622
forgot include cliet modif
ale-sain Feb 20, 2025
c4eba31
fix additional_data and type
ale-sain Feb 20, 2025
b9d2599
prettier fix
ale-sain Feb 20, 2025
6db5249
transactions improved to v3
ale-sain Feb 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions client/src/components/StarknetAgent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,23 @@ const StarknetAgent = () => {

let tx;
if (result.transaction_type === 'INVOKE') {
const info = result.results[0].additional_data;
tx = handleInvokeTransactions(result as TransactionResponse);
if (!tx) {
throw new Error(
'The Invoke transaction is in the wrong format. Check the API Response'
);
}
const transaction_hash = await Wallet.execute(tx);
typeResponse({
const res = {
...newResponse,
text: JSON.stringify(JSON.stringify({ tx, transaction_hash })),
});
text: JSON.stringify({
tx,
transaction_hash: transaction_hash,
additional_data: info ? info : undefined,
}),
};
typeResponse(res);
} else if (result.transaction_type === 'READ') {
typeResponse({
...newResponse,
Expand Down
11 changes: 11 additions & 0 deletions client/src/interfaces/starknetagents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ export interface WalletApiResponse {
/** Call data */
calldata: string[];
};
/** Additional data */
additional_data?: {
/** Asset symbol */
assetSymbol: string;
/** Asset amount */
amount: string;
/** Recipient address */
recipientAddress?: string;
/** Spender address */
spenderAddress?: string;
};
}
12 changes: 0 additions & 12 deletions config/agents/config-limit.json

This file was deleted.

12 changes: 0 additions & 12 deletions config/limit/config-limit.json

This file was deleted.

1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export * from './lib/agent/autonomousAgents';
export * from './lib/agent/plugins/core/account/types/accounts';
export * from './lib/agent/plugins/core/account/types/deployAccountTypes';
export * from './lib/agent/plugins/core/contract/types/contract';
export * from './lib/agent/plugins/core/token/types/balance';
export * from './lib/agent/plugins/core/transaction/types/estimate';
export * from './lib/agent/plugins/core/transaction/types/simulateTransactionTypes';

Expand Down
29 changes: 0 additions & 29 deletions src/lib/agent/limit.ts

This file was deleted.

Loading