Skip to content

Commit

Permalink
feat: Update transfer bnb to gnfd template
Browse files Browse the repository at this point in the history
  • Loading branch information
ybgbob committed Jan 23, 2025
1 parent 9575341 commit 5adfcb5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
9 changes: 6 additions & 3 deletions packages/plugin-bnb/src/actions/gnfd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export const greenfieldAction = {
break;
}

case "transfer": {
case "transferBNBToGreenfield": {
const hash = await action.bnbTransferToGnfd(content.content, runtime)
result = `transfer bnb to greenfield successfully, hash: ${hash}`;
break;
Expand Down Expand Up @@ -329,8 +329,11 @@ export const greenfieldAction = {
{
user: "user",
content: {
text: "for create account on greenfield, transfer ${amount} BNB to myself",
text: "Transfer 0.00001 BNB to myself greenfield for create account",
action: "GREENFIELD_ACTION",
content: {
amount: "0.00001"
}
},
},
],
Expand All @@ -340,7 +343,7 @@ export const greenfieldAction = {
"CREATE_BUCKET",
"UPLOAD_OBJECT",
"DELETE_BUCKET",
"BNB_TRANSFER_TO_GREENFIELD",
"TRANSFER_BNB_TO_GREENFIELD",
],
};

Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-bnb/src/actions/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ export const transferAction = {
{
user: "{{user1}}",
content: {
text: "Transfer 1 BNB to 0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
text: "Transfer 1 BNB to wallet 0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
},
},
{
user: "{{agent}}",
content: {
text: "I'll help you transfer 1 BNB to 0x742d35Cc6634C0532925a3b844Bc454e4438f44e on BSC",
text: "I'll help you transfer 1 BNB to wallet 0x742d35Cc6634C0532925a3b844Bc454e4438f44e on BSC",
action: "TRANSFER",
content: {
chain: "bsc",
Expand All @@ -243,13 +243,13 @@ export const transferAction = {
{
user: "{{user1}}",
content: {
text: "Transfer 1 token of 0x1234 to 0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
text: "Transfer 1 token of 0x1234 to wallet 0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
},
},
{
user: "{{agent}}",
content: {
text: "I'll help you transfer 1 token of 0x1234 to 0x742d35Cc6634C0532925a3b844Bc454e4438f44e on BSC",
text: "I'll help you transfer 1 token of 0x1234 to wallet 0x742d35Cc6634C0532925a3b844Bc454e4438f44e on BSC",
action: "TRANSFER",
content: {
chain: "bsc",
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-bnb/src/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ Respond with a JSON markdown block containing only the extracted values. Use nul
\`\`\`
`;

export const greenfieldTemplate = `Given the recent messages and wallet information below:
export const greenfieldTemplate = `Given the recent messages and wallet information below(only including 'Greenfield' keyword):
{{recentMessages}}
{{walletInfo}}
Extract the following details for Greenfield operations:
- **actionType** (string): The type of operation to perform (e.g., "createBucket", "uploadObject", "deleteObject", "transfer")
- **actionType** (string): The type of operation to perform (e.g., "createBucket", "uploadObject", "deleteObject", "transferBNBToGreenfield")
- **bucketName** (string, optional): The name of the bucket to operate
- **objectName** (string, optional): The name of the object for upload operations
- **visibility** (string, optional): Bucket visibility setting ("private" or "public")
Expand All @@ -199,7 +199,7 @@ Extract the following details for Greenfield operations:
Required response format:
\`\`\`json
{
"actionType": "createBucket" | "uploadObject" | "deleteObject" | "transfer",
"actionType": "createBucket" | "uploadObject" | "deleteObject" | "transferBNBToGreenfield",
"bucketName": string,
"objectName": string,
"visibility": "private" | "public",
Expand Down

0 comments on commit 5adfcb5

Please sign in to comment.