forked from elizaOS/eliza
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'conflux-plugin' of https://github.com/conflux-fans/eliza …
…into HEAD
- Loading branch information
Showing
19 changed files
with
2,772 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# @ai16z/plugin-conflux | ||
|
||
This plugin provides actions and providers for interacting with the [Conflux network](https://www.confluxdocs.com/docs/general). | ||
|
||
## Actions | ||
|
||
### ConfiPump | ||
|
||
Buy and sell tokens on Conflux's implementation of pump.fun (ConfiPump). | ||
|
||
### Transfer | ||
|
||
Transfer tokens from one address to another within Conflux core space. | ||
|
||
### Bridge Transfer | ||
|
||
Transfer tokens from one address to Conflux eSpace. | ||
|
||
### Sponsor (TBD) | ||
|
||
Provide gas for Conflux core space contracts so they can be called without the need to have Conflux in user's wallet. | ||
|
||
### Swap (TBD) | ||
|
||
Swap tokens on Conflux DEXs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "@ai16z/plugin-conflux", | ||
"version": "0.0.1", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"types": "dist/index.d.ts", | ||
"dependencies": { | ||
"cive": "^0.7.1", | ||
"@ai16z/eliza": "workspace:*" | ||
}, | ||
"scripts": { | ||
"build": "tsup --format esm --dts", | ||
"dev": "tsup --watch" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
const CrossSpaceCallAbi = [ | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ | ||
indexed: true, | ||
internalType: "bytes20", | ||
name: "sender", | ||
type: "bytes20", | ||
}, | ||
{ | ||
indexed: true, | ||
internalType: "bytes20", | ||
name: "receiver", | ||
type: "bytes20", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "uint256", | ||
name: "value", | ||
type: "uint256", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "uint256", | ||
name: "nonce", | ||
type: "uint256", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "bytes", | ||
name: "data", | ||
type: "bytes", | ||
}, | ||
], | ||
name: "Call", | ||
type: "event", | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ | ||
indexed: true, | ||
internalType: "bytes20", | ||
name: "sender", | ||
type: "bytes20", | ||
}, | ||
{ | ||
indexed: true, | ||
internalType: "bytes20", | ||
name: "contract_address", | ||
type: "bytes20", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "uint256", | ||
name: "value", | ||
type: "uint256", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "uint256", | ||
name: "nonce", | ||
type: "uint256", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "bytes", | ||
name: "init", | ||
type: "bytes", | ||
}, | ||
], | ||
name: "Create", | ||
type: "event", | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ | ||
indexed: false, | ||
internalType: "bool", | ||
name: "success", | ||
type: "bool", | ||
}, | ||
], | ||
name: "Outcome", | ||
type: "event", | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ | ||
indexed: true, | ||
internalType: "bytes20", | ||
name: "sender", | ||
type: "bytes20", | ||
}, | ||
{ | ||
indexed: true, | ||
internalType: "address", | ||
name: "receiver", | ||
type: "address", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "uint256", | ||
name: "value", | ||
type: "uint256", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "uint256", | ||
name: "nonce", | ||
type: "uint256", | ||
}, | ||
], | ||
name: "Withdraw", | ||
type: "event", | ||
}, | ||
{ | ||
inputs: [{ internalType: "bytes", name: "init", type: "bytes" }], | ||
name: "createEVM", | ||
outputs: [{ internalType: "bytes20", name: "", type: "bytes20" }], | ||
stateMutability: "payable", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [{ internalType: "bytes20", name: "to", type: "bytes20" }], | ||
name: "transferEVM", | ||
outputs: [{ internalType: "bytes", name: "output", type: "bytes" }], | ||
stateMutability: "payable", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [ | ||
{ internalType: "bytes20", name: "to", type: "bytes20" }, | ||
{ internalType: "bytes", name: "data", type: "bytes" }, | ||
], | ||
name: "callEVM", | ||
outputs: [{ internalType: "bytes", name: "output", type: "bytes" }], | ||
stateMutability: "payable", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [ | ||
{ internalType: "bytes20", name: "to", type: "bytes20" }, | ||
{ internalType: "bytes", name: "data", type: "bytes" }, | ||
], | ||
name: "staticCallEVM", | ||
outputs: [{ internalType: "bytes", name: "output", type: "bytes" }], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [], | ||
name: "deployEip1820", | ||
outputs: [], | ||
stateMutability: "nonpayable", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [{ internalType: "uint256", name: "value", type: "uint256" }], | ||
name: "withdrawFromMapped", | ||
outputs: [], | ||
stateMutability: "nonpayable", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [{ internalType: "address", name: "addr", type: "address" }], | ||
name: "mappedBalance", | ||
outputs: [{ internalType: "uint256", name: "", type: "uint256" }], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [{ internalType: "address", name: "addr", type: "address" }], | ||
name: "mappedNonce", | ||
outputs: [{ internalType: "uint256", name: "", type: "uint256" }], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
]; | ||
|
||
export default CrossSpaceCallAbi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
const ERC20ABI = [ | ||
{ | ||
constant: true, | ||
inputs: [], | ||
name: 'name', | ||
outputs: [{ name: '', type: 'string' }], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
constant: false, | ||
inputs: [ | ||
{ name: '_spender', type: 'address' }, | ||
{ name: '_value', type: 'uint256' }, | ||
], | ||
name: 'approve', | ||
outputs: [{ name: '', type: 'bool' }], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [], | ||
name: 'totalSupply', | ||
outputs: [{ name: '', type: 'uint256' }], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
constant: false, | ||
inputs: [ | ||
{ name: '_from', type: 'address' }, | ||
{ name: '_to', type: 'address' }, | ||
{ name: '_value', type: 'uint256' }, | ||
], | ||
name: 'transferFrom', | ||
outputs: [{ name: '', type: 'bool' }], | ||
payable: false, | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [], | ||
name: 'decimals', | ||
outputs: [{ name: '', type: 'uint8' }], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [{ name: '_owner', type: 'address' }], | ||
name: 'balanceOf', | ||
outputs: [{ name: 'balance', type: 'uint256' }], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [], | ||
name: 'symbol', | ||
outputs: [{ name: '', type: 'string' }], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
constant: false, | ||
inputs: [ | ||
{ name: '_to', type: 'address' }, | ||
{ name: '_value', type: 'uint256' }, | ||
], | ||
name: 'transfer', | ||
outputs: [{ name: '', type: 'bool' }], | ||
payable: false, | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [ | ||
{ name: '_owner', type: 'address' }, | ||
{ name: '_spender', type: 'address' }, | ||
], | ||
name: 'allowance', | ||
outputs: [{ name: '', type: 'uint256' }], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ payable: true, stateMutability: 'payable', type: 'fallback' }, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ indexed: true, name: 'owner', type: 'address' }, | ||
{ indexed: true, name: 'spender', type: 'address' }, | ||
{ indexed: false, name: 'value', type: 'uint256' }, | ||
], | ||
name: 'Approval', | ||
type: 'event', | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ indexed: true, name: 'from', type: 'address' }, | ||
{ indexed: true, name: 'to', type: 'address' }, | ||
{ indexed: false, name: 'value', type: 'uint256' }, | ||
], | ||
name: 'Transfer', | ||
type: 'event', | ||
}, | ||
] as const; | ||
|
||
export default ERC20ABI; |
Oops, something went wrong.