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

swap Dao action initital #196

Merged
merged 11 commits into from
Nov 5, 2024
Prev Previous commit
Next Next commit
fix
Signed-off-by: MarcoMandar <malicemandar@gmail.com>
  • Loading branch information
MarcoMandar committed Nov 4, 2024
commit 7e85609c07a7c5c6c96a224b455d658f30ae76a8
1 change: 1 addition & 0 deletions core/src/actions/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ async function getTokensInWallet(runtime: IAgentRuntime) {
new Connection("https://api.mainnet-beta.solana.com"),
new PublicKey(runtime.getSetting("WALLET_PUBLIC_KEY"))
);

const walletInfo = await walletProvider.fetchPortfolioValue(runtime);
const items = walletInfo.items;
return items;
Expand Down
3 changes: 2 additions & 1 deletion core/src/providers/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const PROVIDER_CONFIG = {

interface Item {
name: string;
address: string;
symbol: string;
decimals: number;
balance: string;
Expand Down Expand Up @@ -48,7 +49,7 @@ interface Prices {
ethereum: { usd: string };
}

class WalletProvider {
export class WalletProvider {
constructor(
private connection: Connection,
private walletPublicKey: PublicKey
Expand Down