Skip to content

feat(prompt + core): chain-specific connection #22

@chungquantin

Description

@chungquantin

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"). 

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' }
  ]
});

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions