mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-14 07:26:46 +00:00
chore: update contribution docs, unify squads tools, add actions (#191)
# Pull Request Description ## Changes Made This PR adds the following changes: <!-- List the key changes made in this PR --> - Update contribution docs on how to add your own tool - Update docs - Unify squads tools - Add actions for squads tools - Add other missing actions - Cleanup code ## Transaction executed by agent <!-- If applicable, provide example usage, transactions, or screenshots --> Example transaction: ## Prompt Used <!-- If relevant, include the prompt or configuration used --> ``` ``` ## Additional Notes <!-- Any additional information that reviewers should know --> ## Checklist - [x] I have tested these changes locally - [x] I have updated the documentation - [ ] I have added a transaction link - [ ] I have added the prompt used to test it
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>executeAction | solana-agent-kit</title><meta name="description" content="Documentation for solana-agent-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">solana-agent-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">solana-agent-kit</a></li><li><a href="executeAction.html">executeAction</a></li></ul><h1>Function executeAction</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="executeaction" class="tsd-anchor"></a><span class="tsd-kind-call-signature">executeAction</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">action</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Action</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">agent</span><span class="tsd-signature-symbol">:</span> <a href="../classes/SolanaAgentKit.html" class="tsd-signature-type tsd-kind-class">SolanaAgentKit</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">input</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#executeaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Execute an action with the given input</p>
|
||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">action</span>: <span class="tsd-signature-type">Action</span></span></li><li><span><span class="tsd-kind-parameter">agent</span>: <a href="../classes/SolanaAgentKit.html" class="tsd-signature-type tsd-kind-class">SolanaAgentKit</a></span></li><li><span><span class="tsd-kind-parameter">input</span>: <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/utils/actionExecutor.ts#L20">utils/actionExecutor.ts:20</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">solana-agent-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">action</span>: <span class="tsd-signature-type">Action</span></span></li><li><span><span class="tsd-kind-parameter">agent</span>: <a href="../classes/SolanaAgentKit.html" class="tsd-signature-type tsd-kind-class">SolanaAgentKit</a></span></li><li><span><span class="tsd-kind-parameter">input</span>: <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/utils/actionExecutor.ts#L20">utils/actionExecutor.ts:20</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">solana-agent-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>findAction | solana-agent-kit</title><meta name="description" content="Documentation for solana-agent-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">solana-agent-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">solana-agent-kit</a></li><li><a href="findAction.html">findAction</a></li></ul><h1>Function findAction</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="findaction" class="tsd-anchor"></a><span class="tsd-kind-call-signature">findAction</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Action</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span><a href="#findaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Find an action by its name or one of its similes</p>
|
||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">query</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Action</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/utils/actionExecutor.ts#L8">utils/actionExecutor.ts:8</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">solana-agent-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">query</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Action</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/utils/actionExecutor.ts#L8">utils/actionExecutor.ts:8</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">solana-agent-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>getActionExamples | solana-agent-kit</title><meta name="description" content="Documentation for solana-agent-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">solana-agent-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">solana-agent-kit</a></li><li><a href="getActionExamples.html">getActionExamples</a></li></ul><h1>Function getActionExamples</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getactionexamples" class="tsd-anchor"></a><span class="tsd-kind-call-signature">getActionExamples</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">action</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Action</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><a href="#getactionexamples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Get examples for an action</p>
|
||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">action</span>: <span class="tsd-signature-type">Action</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/utils/actionExecutor.ts#L58">utils/actionExecutor.ts:58</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">solana-agent-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">action</span>: <span class="tsd-signature-type">Action</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/utils/actionExecutor.ts#L58">utils/actionExecutor.ts:58</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">solana-agent-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Action | solana-agent-kit</title><meta name="description" content="Documentation for solana-agent-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">solana-agent-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">solana-agent-kit</a></li><li><a href="Action.html">Action</a></li></ul><h1>Interface Action</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Main Action interface inspired by ELIZA
|
||||
This interface makes it easier to implement actions across different frameworks</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Action</span> <span class="tsd-signature-symbol">{</span><br/> <a class="tsd-kind-property" href="Action.html#description">description</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#examples">examples</a><span class="tsd-signature-symbol">:</span> <a href="ActionExample.html" class="tsd-signature-type tsd-kind-interface">ActionExample</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#handler">handler</a><span class="tsd-signature-symbol">:</span> <a href="../types/Handler.html" class="tsd-signature-type tsd-kind-type-alias">Handler</a><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#schema">schema</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ZodType</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#similes">similes</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/types/index.ts#L126">types/index.ts:126</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="Action.html#description" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>description</span></a>
|
||||
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Action</span> <span class="tsd-signature-symbol">{</span><br/> <a class="tsd-kind-property" href="Action.html#description">description</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#examples">examples</a><span class="tsd-signature-symbol">:</span> <a href="ActionExample.html" class="tsd-signature-type tsd-kind-interface">ActionExample</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#handler">handler</a><span class="tsd-signature-symbol">:</span> <a href="../types/Handler.html" class="tsd-signature-type tsd-kind-type-alias">Handler</a><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#schema">schema</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ZodType</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="Action.html#similes">similes</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/types/index.ts#L126">types/index.ts:126</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="Action.html#description" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>description</span></a>
|
||||
<a href="Action.html#examples" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>examples</span></a>
|
||||
<a href="Action.html#handler" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>handler</span></a>
|
||||
<a href="Action.html#name" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name</span></a>
|
||||
<a href="Action.html#schema" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>schema</span></a>
|
||||
<a href="Action.html#similes" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>similes</span></a>
|
||||
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="description" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>description</span><a href="#description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">description</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Detailed description of what the action does</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/types/index.ts#L140">types/index.ts:140</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="examples" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>examples</span><a href="#examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">examples</span><span class="tsd-signature-symbol">:</span> <a href="ActionExample.html" class="tsd-signature-type tsd-kind-interface">ActionExample</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Array of example inputs and outputs for the action
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/types/index.ts#L140">types/index.ts:140</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="examples" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>examples</span><a href="#examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">examples</span><span class="tsd-signature-symbol">:</span> <a href="ActionExample.html" class="tsd-signature-type tsd-kind-interface">ActionExample</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Array of example inputs and outputs for the action
|
||||
Each inner array represents a group of related examples</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/types/index.ts#L146">types/index.ts:146</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="handler" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>handler</span><a href="#handler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">handler</span><span class="tsd-signature-symbol">:</span> <a href="../types/Handler.html" class="tsd-signature-type tsd-kind-type-alias">Handler</a></div><div class="tsd-comment tsd-typography"><p>Function that executes the action</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/types/index.ts#L156">types/index.ts:156</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="name" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>name</span><a href="#name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Unique name of the action</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/types/index.ts#L130">types/index.ts:130</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="schema" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>schema</span><a href="#schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">schema</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ZodType</span></div><div class="tsd-comment tsd-typography"><p>Zod schema for input validation</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/types/index.ts#L151">types/index.ts:151</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="similes" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>similes</span><a href="#similes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">similes</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Alternative names/phrases that can trigger this action</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sendaifun/solana-agent-kit/blob/88023dfe2d6afb3cdfc4b4be784ca3333faa6263/src/types/index.ts#L135">types/index.ts:135</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#description" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>description</span></a><a href="#examples" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>examples</span></a><a href="#handler" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>handler</span></a><a href="#name" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name</span></a><a href="#schema" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>schema</span></a><a href="#similes" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>similes</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">solana-agent-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/types/index.ts#L146">types/index.ts:146</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="handler" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>handler</span><a href="#handler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">handler</span><span class="tsd-signature-symbol">:</span> <a href="../types/Handler.html" class="tsd-signature-type tsd-kind-type-alias">Handler</a></div><div class="tsd-comment tsd-typography"><p>Function that executes the action</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/types/index.ts#L156">types/index.ts:156</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="name" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>name</span><a href="#name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Unique name of the action</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/types/index.ts#L130">types/index.ts:130</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="schema" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>schema</span><a href="#schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">schema</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ZodType</span></div><div class="tsd-comment tsd-typography"><p>Zod schema for input validation</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/types/index.ts#L151">types/index.ts:151</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="similes" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>similes</span><a href="#similes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">similes</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Alternative names/phrases that can trigger this action</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/arihantbansal/solana-agent-kit/blob/ba9f6a94238db596d7ba0e42da952a07284ddf6d/src/types/index.ts#L135">types/index.ts:135</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#description" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>description</span></a><a href="#examples" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>examples</span></a><a href="#handler" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>handler</span></a><a href="#name" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name</span></a><a href="#schema" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>schema</span></a><a href="#similes" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>similes</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">solana-agent-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,11 +5,13 @@ Extending the **Solana Agent Kit** with custom tools allows you to add specializ
|
||||
## Overview
|
||||
|
||||
1. Create a new tool file
|
||||
2. Implement the tool class
|
||||
3. Implement supporting functions in SolanaAgentKit
|
||||
4. Export the new tool
|
||||
5. Integrate the tool into the agent
|
||||
6. Use the custom tool
|
||||
2. Export the new tool
|
||||
3. Add supporting functions in SolanaAgentKit
|
||||
4. Implement the Langchain tool class
|
||||
5. Export the Langchain tool
|
||||
6. Define Action class for given tool
|
||||
7. Export Action
|
||||
8. Use the custom tool
|
||||
|
||||
## Implementation Guide
|
||||
|
||||
@@ -17,7 +19,29 @@ Extending the **Solana Agent Kit** with custom tools allows you to add specializ
|
||||
|
||||
Create a new TypeScript file in the `src/tools/` directory for your tool (e.g., `custom_tool.ts`).
|
||||
|
||||
### 2. Implement the Tool Class
|
||||
|
||||
### 2. Export the Tool
|
||||
> `src/tools/index.ts`
|
||||
```typescript:src/tools/index.ts
|
||||
export * from "./request_faucet_funds";
|
||||
export * from "./deploy_token";
|
||||
export * from "./custom_tool"; // Add your new tool
|
||||
```
|
||||
|
||||
### 3. Add Supporting Functions to SolanaAgentKit
|
||||
> `src/agent/index.ts`
|
||||
```typescript:src/agent/index.ts
|
||||
export class SolanaAgentKit {
|
||||
// ... existing code ...
|
||||
|
||||
async customFunction(input: string): Promise<string> {
|
||||
// Implement your custom functionality
|
||||
return `Processed input: ${input}`;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 4. Implement the Langchain Tool Class
|
||||
> `src/langchain/index.ts`
|
||||
```typescript:src/langchain/index.ts
|
||||
import { Tool } from "langchain/tools";
|
||||
@@ -50,31 +74,10 @@ export class CustomTool extends Tool {
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Add Supporting Functions to SolanaAgentKit
|
||||
> `src/agent/index.ts`
|
||||
```typescript:src/agent/index.ts
|
||||
export class SolanaAgentKit {
|
||||
// ... existing code ...
|
||||
|
||||
async customFunction(input: string): Promise<string> {
|
||||
// Implement your custom functionality
|
||||
return `Processed input: ${input}`;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 4. Export the Tool
|
||||
> `src/tools/index.ts`
|
||||
```typescript:src/tools/index.ts
|
||||
export * from "./request_faucet_funds";
|
||||
export * from "./deploy_token";
|
||||
export * from "./custom_tool"; // Add your new tool
|
||||
```
|
||||
|
||||
### 5. Integrate with Agent
|
||||
### 5. Export Langchain Tool
|
||||
> `src/langchain/index.ts`
|
||||
```typescript:src/langchain/index.ts
|
||||
import { CustomTool } from "../tools/custom_tool";
|
||||
import { CustomTool } from "../tools";
|
||||
|
||||
export function createSolanaTools(agent: SolanaAgentKit) {
|
||||
return [
|
||||
@@ -84,7 +87,53 @@ export function createSolanaTools(agent: SolanaAgentKit) {
|
||||
}
|
||||
```
|
||||
|
||||
### 6. Usage Example
|
||||
### 6. Define Action class for given tool
|
||||
|
||||
> `src/actions/custom_action.ts`
|
||||
```typescript:src/actions/custom_action.ts
|
||||
import { Action } from "../types/action";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import { z } from "zod";
|
||||
import { custom_tool } from "../tools";
|
||||
|
||||
const customAction: Action = {
|
||||
name: "CUSTOM_ACTION",
|
||||
similes: ["custom tool"],
|
||||
description: "Description of what the custom tool does.",
|
||||
examples: [
|
||||
{
|
||||
input: {},
|
||||
output: {
|
||||
status: "success",
|
||||
message: "Custom tool executed successfully",
|
||||
data: result,
|
||||
},
|
||||
explanation: "Custom tool executed successfully",
|
||||
},
|
||||
],
|
||||
schema: z.object({
|
||||
input: z.string(),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const result = await agent.customFunction(input);
|
||||
return result;
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### 7. Export Action
|
||||
> `src/actions/index.ts`
|
||||
```typescript:src/actions/index.ts
|
||||
export * from "./balance";
|
||||
export * from "./custom_action";
|
||||
|
||||
export const ACTIONS = {
|
||||
// ... existing actions ...
|
||||
CUSTOM_ACTION: customAction,
|
||||
}
|
||||
```
|
||||
|
||||
### 8. Usage Example
|
||||
|
||||
Add a code example in the `README.md` file.
|
||||
|
||||
@@ -106,7 +155,7 @@ if (customTool) {
|
||||
}
|
||||
|
||||
// or alternatively
|
||||
const result = await agent.customFunction("your-input"); // assuming you have a `customFunction` method in SolanaAgentKit
|
||||
const result = await agent.customFunction("your-input"); // assuming you have implemented `customFunction` method in SolanaAgentKit
|
||||
console.log(result);
|
||||
```
|
||||
|
||||
@@ -174,6 +223,43 @@ export class SolanaAgentKit {
|
||||
}
|
||||
```
|
||||
|
||||
Add Action for given tool:
|
||||
> `src/actions/fetch_token_price.ts`
|
||||
```typescript:src/actions/fetch_token_price.ts
|
||||
import { Action } from "../types/action";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import { z } from "zod";
|
||||
import { fetch_token_price } from "../tools";
|
||||
|
||||
const fetchTokenPriceAction: Action = {
|
||||
name: "FETCH_TOKEN_PRICE",
|
||||
similes: ["fetch token price"],
|
||||
description: "Fetches the current price of a specified token.",
|
||||
examples: [
|
||||
{
|
||||
input: { tokenSymbol: "SOL" },
|
||||
output: {
|
||||
status: "success",
|
||||
message: "Price fetched successfully for SOL.",
|
||||
price: 150,
|
||||
},
|
||||
explanation: "Fetch the current price of SOL token in USDC",
|
||||
},
|
||||
],
|
||||
schema: z.object({
|
||||
tokenSymbol: z.string().describe("The symbol of the token to fetch the price for"),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const price = await agent.getTokenPrice(input.tokenSymbol);
|
||||
return {
|
||||
status: "success",
|
||||
price,
|
||||
message: `Price fetched successfully for ${input.tokenSymbol}.`,
|
||||
};
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
Then it can be used as such:
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -30,6 +30,13 @@ import launchPumpfunTokenAction from "./pumpfun/launchPumpfunToken";
|
||||
import getWalletAddressAction from "./agent/getWalletAddress";
|
||||
import flashOpenTradeAction from "./flash/flashOpenTrade";
|
||||
import flashCloseTradeAction from "./flash/flashCloseTrade";
|
||||
import createMultisigAction from "./squads/createMultisig";
|
||||
import approveMultisigProposalAction from "./squads/approveMultisigProposal";
|
||||
import createMultisigProposalAction from "./squads/createMultisigProposal";
|
||||
import depositToMultisigAction from "./squads/depositToMultisigTreasury";
|
||||
import executeMultisigProposalAction from "./squads/executeMultisigProposal";
|
||||
import rejectMultisigProposalAction from "./squads/rejectMultisigProposal";
|
||||
import transferFromMultisigAction from "./squads/transferFromMultisigTreasury";
|
||||
|
||||
export const ACTIONS = {
|
||||
WALLET_ADDRESS_ACTION: getWalletAddressAction,
|
||||
@@ -65,6 +72,13 @@ export const ACTIONS = {
|
||||
LAUNCH_PUMPFUN_TOKEN_ACTION: launchPumpfunTokenAction,
|
||||
FLASH_OPEN_TRADE_ACTION: flashOpenTradeAction,
|
||||
FLASH_CLOSE_TRADE_ACTION: flashCloseTradeAction,
|
||||
CREATE_MULTISIG_ACTION: createMultisigAction,
|
||||
DEPOSIT_TO_MULTISIG_ACTION: depositToMultisigAction,
|
||||
TRANSFER_FROM_MULTISIG_ACTION: transferFromMultisigAction,
|
||||
CREATE_MULTISIG_PROPOSAL_ACTION: createMultisigProposalAction,
|
||||
APPROVE_MULTISIG_PROPOSAL_ACTION: approveMultisigProposalAction,
|
||||
REJECT_MULTISIG_PROPOSAL_ACTION: rejectMultisigProposalAction,
|
||||
EXECUTE_MULTISIG_PROPOSAL_ACTION: executeMultisigProposalAction,
|
||||
};
|
||||
|
||||
export type { Action, ActionExample, Handler } from "../types/action";
|
||||
|
||||
50
src/actions/squads/approveMultisigProposal.ts
Normal file
50
src/actions/squads/approveMultisigProposal.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { Action } from "../../types/action";
|
||||
import { SolanaAgentKit } from "../../agent";
|
||||
import { z } from "zod";
|
||||
import { multisig_approve_proposal } from "../../tools";
|
||||
|
||||
const approveMultisigProposalAction: Action = {
|
||||
name: "APPROVE_MULTISIG_PROPOSAL_ACTION",
|
||||
similes: [
|
||||
"approve proposal",
|
||||
"approve proposal to transfer funds",
|
||||
"approve proposal to transfer funds from 2-of-2 multisig",
|
||||
"approve proposal to transfer funds from 2-of-2 multisig account",
|
||||
"approve proposal to transfer funds from 2-of-2 multisig account on Solana",
|
||||
],
|
||||
description: `Approve a proposal to transfer funds from a 2-of-2 multisig account on Solana with the user and the agent, where both approvals will be required to run the transactions.
|
||||
|
||||
Note: For one AI agent, only one 2-by-2 multisig can be created as it is pair-wise.`,
|
||||
examples: [
|
||||
[
|
||||
{
|
||||
input: {
|
||||
transactionIndex: 0,
|
||||
},
|
||||
output: {
|
||||
status: "success",
|
||||
message: "Proposal approved successfully",
|
||||
transaction: "4xKpN2...",
|
||||
transactionIndex: "0",
|
||||
},
|
||||
explanation:
|
||||
"Approve a proposal to transfer 1 SOL from 2-of-2 multisig account on Solana",
|
||||
},
|
||||
],
|
||||
],
|
||||
schema: z.object({
|
||||
transactionIndex: z.number().optional(),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const tx = await multisig_approve_proposal(agent, input.transactionIndex);
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
message: "Proposal approved successfully",
|
||||
transaction: tx,
|
||||
transactionIndex: input.transactionIndex.toString(),
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default approveMultisigProposalAction;
|
||||
52
src/actions/squads/createMultisig.ts
Normal file
52
src/actions/squads/createMultisig.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { Action } from "../../types/action";
|
||||
import { SolanaAgentKit } from "../../agent";
|
||||
import { z } from "zod";
|
||||
import { create_squads_multisig } from "../../tools";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
|
||||
const createMultisigAction: Action = {
|
||||
name: "CREATE_MULTISIG_ACTION",
|
||||
similes: [
|
||||
"create multisig",
|
||||
"create squads multisig",
|
||||
"create 2-by-2 multisig",
|
||||
"create 2-of-2 multisig",
|
||||
"create 2-of-2 multisig account",
|
||||
"create 2-of-2 multisig account on Solana",
|
||||
],
|
||||
description: `Create a 2-of-2 multisig account on Solana using Squads with the user and the agent, where both approvals will be required to run the transactions.
|
||||
|
||||
Note: For one AI agent, only one 2-by-2 multisig can be created as it is pair-wise.`,
|
||||
examples: [
|
||||
[
|
||||
{
|
||||
input: {
|
||||
creator: "7nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkN",
|
||||
},
|
||||
output: {
|
||||
status: "success",
|
||||
message: "2-by-2 multisig account created successfully",
|
||||
signature: "4xKpN2...",
|
||||
},
|
||||
explanation: "Create a 2-of-2 multisig account on Solana",
|
||||
},
|
||||
],
|
||||
],
|
||||
schema: z.object({
|
||||
creator: z.string(),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const multisig = await create_squads_multisig(
|
||||
agent,
|
||||
new PublicKey(input.creator as string),
|
||||
);
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
message: "2-by-2 multisig account created successfully",
|
||||
signature: multisig,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default createMultisigAction;
|
||||
55
src/actions/squads/createMultisigProposal.ts
Normal file
55
src/actions/squads/createMultisigProposal.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { Action } from "../../types/action";
|
||||
import { SolanaAgentKit } from "../../agent";
|
||||
import { z } from "zod";
|
||||
import { multisig_create_proposal } from "../../tools";
|
||||
|
||||
const createMultisigProposalAction: Action = {
|
||||
name: "CREATE_MULTISIG_PROPOSAL_ACTION",
|
||||
similes: [
|
||||
"create proposal",
|
||||
"create proposal to transfer funds",
|
||||
"create proposal to transfer funds from 2-of-2 multisig",
|
||||
"create proposal to transfer funds from 2-of-2 multisig account",
|
||||
"create proposal to transfer funds from 2-of-2 multisig account on Solana",
|
||||
],
|
||||
description: `Create a proposal to transfer funds from a 2-of-2 multisig account on Solana with the user and the agent, where both approvals will be required to run the transactions.
|
||||
|
||||
If transactionIndex is not provided, the latest index will automatically be fetched and used.`,
|
||||
examples: [
|
||||
[
|
||||
{
|
||||
input: {
|
||||
transactionIndex: 0,
|
||||
},
|
||||
output: {
|
||||
status: "success",
|
||||
message: "Proposal created successfully",
|
||||
transaction: "4xKpN2...",
|
||||
transactionIndex: "0",
|
||||
},
|
||||
explanation:
|
||||
"Create a proposal to transfer 1 SOL from 2-of-2 multisig account on Solana",
|
||||
},
|
||||
],
|
||||
],
|
||||
schema: z.object({
|
||||
transactionIndex: z.number().optional(),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const transactionIndex =
|
||||
input.transactionIndex !== undefined
|
||||
? Number(input.transactionIndex)
|
||||
: undefined;
|
||||
|
||||
const multisig = await multisig_create_proposal(agent, transactionIndex);
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
message: "Proposal created successfully",
|
||||
transaction: multisig,
|
||||
transactionIndex: transactionIndex,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default createMultisigProposalAction;
|
||||
49
src/actions/squads/depositToMultisigTreasury.ts
Normal file
49
src/actions/squads/depositToMultisigTreasury.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Action } from "../../types/action";
|
||||
import { SolanaAgentKit } from "../../agent";
|
||||
import { z } from "zod";
|
||||
import { multisig_deposit_to_treasury } from "../../tools";
|
||||
|
||||
const depositToMultisigAction: Action = {
|
||||
name: "DEPOSIT_TO_MULTISIG_ACTION",
|
||||
similes: [
|
||||
"deposit to multisig",
|
||||
"deposit to squads multisig",
|
||||
"deposit to 2-of-2 multisig account",
|
||||
"deposit to 2-of-2 multisig account on Solana",
|
||||
"deposit SOL to 2-of-2 multisig",
|
||||
"deposit SPL tokens to 2-of-2 multisig",
|
||||
],
|
||||
description: `Deposit funds to a 2-of-2 multisig account on Solana with the user and the agent, where both approvals will be required to run the transactions.`,
|
||||
examples: [
|
||||
[
|
||||
{
|
||||
input: {
|
||||
amount: 1,
|
||||
},
|
||||
output: {
|
||||
status: "success",
|
||||
message: "Funds deposited to 2-by-2 multisig account successfully",
|
||||
signature: "4xKpN2...",
|
||||
},
|
||||
explanation: "Deposit 1 SOL to 2-of-2 multisig account on Solana",
|
||||
},
|
||||
],
|
||||
],
|
||||
schema: z.object({
|
||||
amount: z.number().min(0, "Amount must be greater than 0"),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const multisig = await multisig_deposit_to_treasury(
|
||||
agent,
|
||||
input.amount as number,
|
||||
);
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
message: "Funds deposited to 2-by-2 multisig account successfully",
|
||||
signature: multisig,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default depositToMultisigAction;
|
||||
53
src/actions/squads/executeMultisigProposal.ts
Normal file
53
src/actions/squads/executeMultisigProposal.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { Action } from "../../types/action";
|
||||
import { SolanaAgentKit } from "../../agent";
|
||||
import { z } from "zod";
|
||||
import { multisig_execute_proposal } from "../../tools";
|
||||
|
||||
const executeMultisigProposalAction: Action = {
|
||||
name: "EXECUTE_MULTISIG_PROPOSAL_ACTION",
|
||||
similes: [
|
||||
"execute proposal",
|
||||
"execute proposal to transfer funds",
|
||||
"execute proposal to transfer funds from 2-of-2 multisig",
|
||||
"execute proposal to transfer funds from 2-of-2 multisig account",
|
||||
"execute proposal to transfer funds from 2-of-2 multisig account on Solana",
|
||||
],
|
||||
description: `Execute a proposal to transfer funds from a 2-of-2 multisig account on Solana with the user and the agent, where both approvals will be required to run the transactions.`,
|
||||
examples: [
|
||||
[
|
||||
{
|
||||
input: {
|
||||
proposalIndex: 0,
|
||||
},
|
||||
output: {
|
||||
status: "success",
|
||||
message: "Proposal executed successfully",
|
||||
transaction: "4xKpN2...",
|
||||
proposalIndex: "0",
|
||||
},
|
||||
explanation:
|
||||
"Execute a proposal to transfer 1 SOL from 2-of-2 multisig account on Solana",
|
||||
},
|
||||
],
|
||||
],
|
||||
schema: z.object({
|
||||
proposalIndex: z.number().optional(),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const proposalIndex =
|
||||
input.proposalIndex !== undefined
|
||||
? Number(input.proposalIndex)
|
||||
: undefined;
|
||||
|
||||
const multisig = await multisig_execute_proposal(agent, proposalIndex);
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
message: "Proposal executed successfully",
|
||||
transaction: multisig,
|
||||
proposalIndex,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default executeMultisigProposalAction;
|
||||
53
src/actions/squads/rejectMultisigProposal.ts
Normal file
53
src/actions/squads/rejectMultisigProposal.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { Action } from "../../types/action";
|
||||
import { SolanaAgentKit } from "../../agent";
|
||||
import { z } from "zod";
|
||||
import { multisig_reject_proposal } from "../../tools";
|
||||
|
||||
const rejectMultisigProposalAction: Action = {
|
||||
name: "REJECT_MULTISIG_PROPOSAL_ACTION",
|
||||
similes: [
|
||||
"reject proposal",
|
||||
"reject proposal to transfer funds",
|
||||
"reject proposal to transfer funds from 2-of-2 multisig",
|
||||
"reject proposal to transfer funds from 2-of-2 multisig account",
|
||||
"reject proposal to transfer funds from 2-of-2 multisig account on Solana",
|
||||
],
|
||||
description: `Reject a proposal to transfer funds from a 2-of-2 multisig account on Solana with the user and the agent, where both approvals will be required to run the transactions.`,
|
||||
examples: [
|
||||
[
|
||||
{
|
||||
input: {
|
||||
proposalIndex: 0,
|
||||
},
|
||||
output: {
|
||||
status: "success",
|
||||
message: "Proposal rejected successfully",
|
||||
transaction: "4xKpN2...",
|
||||
proposalIndex: "0",
|
||||
},
|
||||
explanation:
|
||||
"Reject a proposal to transfer 1 SOL from 2-of-2 multisig account on Solana",
|
||||
},
|
||||
],
|
||||
],
|
||||
schema: z.object({
|
||||
proposalIndex: z.number().optional(),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const proposalIndex =
|
||||
input.proposalIndex !== undefined
|
||||
? Number(input.proposalIndex)
|
||||
: undefined;
|
||||
|
||||
const tx = await multisig_reject_proposal(agent, proposalIndex);
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
message: "Proposal rejected successfully",
|
||||
transaction: tx,
|
||||
proposalIndex,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default rejectMultisigProposalAction;
|
||||
56
src/actions/squads/transferFromMultisigTreasury.ts
Normal file
56
src/actions/squads/transferFromMultisigTreasury.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { Action } from "../../types/action";
|
||||
import { SolanaAgentKit } from "../../agent";
|
||||
import { z } from "zod";
|
||||
import { multisig_transfer_from_treasury } from "../../tools";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
|
||||
const transferFromMultisigAction: Action = {
|
||||
name: "TRANSFER_FROM_MULTISIG_ACTION",
|
||||
similes: [
|
||||
"transfer from multisig",
|
||||
"transfer from squads multisig",
|
||||
"transfer SOL from 2-by-2 multisig",
|
||||
"transfer from 2-of-2 multisig account",
|
||||
"transfer from 2-of-2 multisig account on Solana",
|
||||
],
|
||||
description: `Create a transaction to transfer funds from a 2-of-2 multisig account on Solana using Squads with the user and the agent, where both approvals will be required to run the transactions.`,
|
||||
examples: [
|
||||
[
|
||||
{
|
||||
input: {
|
||||
amount: 1,
|
||||
recipient: "7nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkN",
|
||||
},
|
||||
output: {
|
||||
status: "success",
|
||||
message: "Transaction added to 2-by-2 multisig account successfully",
|
||||
transaction: "4xKpN2...",
|
||||
amount: "1",
|
||||
recipient: "7nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkN",
|
||||
},
|
||||
explanation: "Transfer 1 SOL from 2-of-2 multisig account on Solana",
|
||||
},
|
||||
],
|
||||
],
|
||||
schema: z.object({
|
||||
amount: z.number().min(0, "Amount must be greater than 0"),
|
||||
recipient: z.string(),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const multisig = await multisig_transfer_from_treasury(
|
||||
agent,
|
||||
input.amount as number,
|
||||
new PublicKey(input.recipient as string),
|
||||
);
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
message: "Transaction added to 2-by-2 multisig account successfully",
|
||||
transaction: multisig,
|
||||
amount: input.amount,
|
||||
recipient: input.recipient,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default transferFromMultisigAction;
|
||||
@@ -2,8 +2,12 @@ import { Connection, Keypair, PublicKey } from "@solana/web3.js";
|
||||
import { BN } from "@coral-xyz/anchor";
|
||||
import bs58 from "bs58";
|
||||
import Decimal from "decimal.js";
|
||||
import {
|
||||
CreateCollectionOptions,
|
||||
CreateSingleOptions,
|
||||
StoreInitOptions,
|
||||
} from "@3land/listings-sdk/dist/types/implementation/implementationTypes";
|
||||
import { DEFAULT_OPTIONS } from "../constants";
|
||||
import { Config, TokenCheck } from "../types";
|
||||
import {
|
||||
deploy_collection,
|
||||
deploy_token,
|
||||
@@ -63,8 +67,19 @@ import {
|
||||
fetchPythPriceFeedID,
|
||||
flashOpenTrade,
|
||||
flashCloseTrade,
|
||||
} from "../tools/";
|
||||
createCollection,
|
||||
createSingle,
|
||||
multisig_transfer_from_treasury,
|
||||
create_squads_multisig,
|
||||
multisig_create_proposal,
|
||||
multisig_deposit_to_treasury,
|
||||
multisig_reject_proposal,
|
||||
multisig_approve_proposal,
|
||||
multisig_execute_proposal,
|
||||
} from "../tools";
|
||||
import {
|
||||
Config,
|
||||
TokenCheck,
|
||||
CollectionDeployment,
|
||||
CollectionOptions,
|
||||
GibworkCreateTaskReponse,
|
||||
@@ -76,22 +91,6 @@ import {
|
||||
FlashTradeParams,
|
||||
FlashCloseTradeParams,
|
||||
} from "../types";
|
||||
import {
|
||||
createCollection,
|
||||
createSingle,
|
||||
} from "../tools/3land/create_3land_collectible";
|
||||
import {
|
||||
CreateCollectionOptions,
|
||||
CreateSingleOptions,
|
||||
StoreInitOptions,
|
||||
} from "@3land/listings-sdk/dist/types/implementation/implementationTypes";
|
||||
import { create_squads_multisig } from "../tools/squads_multisig/create_multisig";
|
||||
import { deposit_to_multisig } from "../tools/squads_multisig/deposit_to_multisig";
|
||||
import { transfer_from_multisig } from "../tools/squads_multisig/transfer_from_multisig";
|
||||
import { create_proposal } from "../tools/squads_multisig/create_proposal";
|
||||
import { approve_proposal } from "../tools/squads_multisig/approve_proposal";
|
||||
import { execute_transaction } from "../tools/squads_multisig/execute_proposal";
|
||||
import { reject_proposal } from "../tools/squads_multisig/reject_proposal";
|
||||
|
||||
/**
|
||||
* Main class for interacting with Solana blockchain
|
||||
@@ -620,7 +619,7 @@ export class SolanaAgentKit {
|
||||
vaultIndex: number = 0,
|
||||
mint?: PublicKey,
|
||||
): Promise<string> {
|
||||
return deposit_to_multisig(this, amount, vaultIndex, mint);
|
||||
return multisig_deposit_to_treasury(this, amount, vaultIndex, mint);
|
||||
}
|
||||
|
||||
async transferFromMultisig(
|
||||
@@ -629,30 +628,30 @@ export class SolanaAgentKit {
|
||||
vaultIndex: number = 0,
|
||||
mint?: PublicKey,
|
||||
): Promise<string> {
|
||||
return transfer_from_multisig(this, amount, to, vaultIndex, mint);
|
||||
return multisig_transfer_from_treasury(this, amount, to, vaultIndex, mint);
|
||||
}
|
||||
|
||||
async createMultisigProposal(
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
return create_proposal(this, transactionIndex);
|
||||
return multisig_create_proposal(this, transactionIndex);
|
||||
}
|
||||
|
||||
async approveMultisigProposal(
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
return approve_proposal(this, transactionIndex);
|
||||
return multisig_approve_proposal(this, transactionIndex);
|
||||
}
|
||||
|
||||
async rejectMultisigProposal(
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
return reject_proposal(this, transactionIndex);
|
||||
return multisig_reject_proposal(this, transactionIndex);
|
||||
}
|
||||
|
||||
async executeMultisigTransaction(
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
return execute_transaction(this, transactionIndex);
|
||||
return multisig_execute_proposal(this, transactionIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ export * from "./3land";
|
||||
export * from "./tiplink";
|
||||
export * from "./sns";
|
||||
export * from "./lightprotocol";
|
||||
export * from "./squads";
|
||||
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import {
|
||||
@@ -83,6 +84,13 @@ import {
|
||||
SolanaPerpCloseTradeTool,
|
||||
SolanaFlashOpenTrade,
|
||||
SolanaFlashCloseTrade,
|
||||
SolanaCreate2by2Multisig,
|
||||
SolanaDepositTo2by2Multisig,
|
||||
SolanaTransferFrom2by2Multisig,
|
||||
SolanaCreateProposal2by2Multisig,
|
||||
SolanaApproveProposal2by2Multisig,
|
||||
SolanaExecuteProposal2by2Multisig,
|
||||
SolanaRejectProposal2by2Multisig,
|
||||
} from "./index";
|
||||
|
||||
export function createSolanaTools(solanaKit: SolanaAgentKit) {
|
||||
@@ -144,5 +152,12 @@ export function createSolanaTools(solanaKit: SolanaAgentKit) {
|
||||
new SolanaPerpCloseTradeTool(solanaKit),
|
||||
new SolanaFlashOpenTrade(solanaKit),
|
||||
new SolanaFlashCloseTrade(solanaKit),
|
||||
new SolanaCreate2by2Multisig(solanaKit),
|
||||
new SolanaCreateProposal2by2Multisig(solanaKit),
|
||||
new SolanaApproveProposal2by2Multisig(solanaKit),
|
||||
new SolanaRejectProposal2by2Multisig(solanaKit),
|
||||
new SolanaExecuteProposal2by2Multisig(solanaKit),
|
||||
new SolanaDepositTo2by2Multisig(solanaKit),
|
||||
new SolanaTransferFrom2by2Multisig(solanaKit),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -55,15 +55,3 @@ export async function createSingle(
|
||||
throw new Error(`Single edition creation failed: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Buy a single edition on 3Land
|
||||
* @param
|
||||
* @returns
|
||||
*/
|
||||
// export async function buySingle() {
|
||||
// try {
|
||||
// } catch (error: any) {
|
||||
// throw new Error(`Buying single edition failed: ${error.message}`);
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -22,4 +22,4 @@ export * from "./tensor";
|
||||
export * from "./3land";
|
||||
export * from "./tiplink";
|
||||
export * from "./lightprotocol";
|
||||
export * from "./squads_multisig";
|
||||
export * from "./squads";
|
||||
|
||||
@@ -10,7 +10,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @returns {Promise<string>} - A promise that resolves to the transaction ID of the approved proposal.
|
||||
* @throws {Error} - Throws an error if the approval process fails.
|
||||
*/
|
||||
export async function approve_proposal(
|
||||
export async function multisig_approve_proposal(
|
||||
agent: SolanaAgentKit,
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
@@ -10,7 +10,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @returns {Promise<string>} - The transaction ID of the created proposal.
|
||||
* @throws {Error} - Throws an error if the proposal creation fails.
|
||||
*/
|
||||
export async function create_proposal(
|
||||
export async function multisig_create_proposal(
|
||||
agent: SolanaAgentKit,
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
@@ -17,7 +17,7 @@ import * as multisig from "@sqds/multisig";
|
||||
* @param mint Optional mint address for SPL tokens
|
||||
* @returns Transaction signature
|
||||
*/
|
||||
export async function deposit_to_multisig(
|
||||
export async function multisig_deposit_to_treasury(
|
||||
agent: SolanaAgentKit,
|
||||
amount: number,
|
||||
vaultIndex?: number,
|
||||
@@ -10,7 +10,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @returns {Promise<string>} - A promise that resolves to the transaction signature string.
|
||||
* @throws {Error} - Throws an error if the transaction execution fails.
|
||||
*/
|
||||
export async function execute_transaction(
|
||||
export async function multisig_execute_proposal(
|
||||
agent: SolanaAgentKit,
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
@@ -1,7 +1,7 @@
|
||||
export * from "./approve_proposal";
|
||||
export * from "./create_multisig";
|
||||
export * from "./create_proposal";
|
||||
export * from "./deposit_to_multisig";
|
||||
export * from "./approve_proposal";
|
||||
export * from "./deposit_to_treasury";
|
||||
export * from "./execute_proposal";
|
||||
export * from "./reject_proposal";
|
||||
export * from "./transfer_from_multisig";
|
||||
export * from "./transfer_from_treasury";
|
||||
@@ -10,7 +10,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @returns A promise that resolves to the transaction ID of the rejection transaction.
|
||||
* @throws Will throw an error if the transaction fails.
|
||||
*/
|
||||
export async function reject_proposal(
|
||||
export async function multisig_reject_proposal(
|
||||
agent: SolanaAgentKit,
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
@@ -23,7 +23,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @param mint - Optional mint address for SPL tokens.
|
||||
* @returns Transaction signature.
|
||||
*/
|
||||
export async function transfer_from_multisig(
|
||||
export async function multisig_transfer_from_treasury(
|
||||
agent: SolanaAgentKit,
|
||||
amount: number,
|
||||
to: PublicKey,
|
||||
Reference in New Issue
Block a user