-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
Description
Current Implementation
await client.prompt("Transfer 10 DOT from Asset Hub to Coretime Chain")
await client.prompt("Transfer 20 USDT from Asset Hub to Coretime Chain")With this PR, this can be improved as:
await client.prompt("Work on Asset Hub")
await client.prompt("Transfer 20 USDT to Coretime Chain")
await client.prompt("Swap 20 USDT on Hydration and send back to account 0xABCDE")Description
Allows the developers to prompt the library to connect to a specific chain. For example:
await client.prompt("Right now, we will work on Paseo Asset Hub from now on"). - Using the endpoint list from
@polkadot/apps-config: https://github.com/polkadot-js/apps/tree/220c90b5c1f58db76fbde6ca705fbe2ed46a0c1b/packages/apps-config/src/endpoints - We can easily choose the endpoint to connect to. This feature is useful to provide a global context for the agent client instead of asking user to prompt or connect to the endpoint manually.
- Provide access to all endpoints by default and lazy initializing the connection on actions:
By default, the agent kit should have all the capabilities to access to all endpoints if we complete above tasks:
const agent = new PolkadotAgentKit({
privateKey: process.env.PRIVATE_KEY,
});If user want to limit the access of the agent kit, they can simply limit the endpoint access:
const agent = new PolkadotAgentKit({
privateKey: process.env.PRIVATE_KEY,
chains: [
{ name: 'westend', url: 'wss://westend-rpc.polkadot.io' }
]
});Reactions are currently unavailable