Skip to content

Commit

Permalink
Support swapping via okx (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: mrlotfi <[email protected]>
  • Loading branch information
mrlotfi and mrlotfi authored Dec 4, 2024
1 parent a410666 commit 5bea6ce
Show file tree
Hide file tree
Showing 12 changed files with 1,100 additions and 128 deletions.
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ SOLANA_PRIVATE_KEY=""
EVM_PRIVATE_KEY=""
SOLANA_PRIORITY_FEE=10000
ONE_INCH_API_KEY=""
OKX_API_KEY=""
OKX_SECRET_KEY=""
OKX_PASSPHRASE=""
JUP_API_KEY=""
WORMHOLE_GUARDIAN_RPCS="https://wormhole-v2-mainnet-api.mcf.rocks,https://wormhole-v2-mainnet-api.chainlayer.network,https://wormhole-v2-mainnet-api.staking.fund,https://wormhole-v2-mainnet-api.chainlayer.network"

Expand Down
147 changes: 147 additions & 0 deletions src/abis/okx-helper.abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
export const abi = [
{
inputs: [
{
internalType: 'address',
name: '_guardian',
type: 'address',
},
{
internalType: 'address[]',
name: '_swapProtocols',
type: 'address[]',
},
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{
inputs: [],
name: 'UnsupportedProtocol',
type: 'error',
},
{
inputs: [
{
internalType: 'address',
name: 'tokenIn',
type: 'address',
},
{
internalType: 'uint256',
name: 'amountIn',
type: 'uint256',
},
{
internalType: 'address',
name: 'tokenContract',
type: 'address',
},
{
internalType: 'address',
name: 'swapProtocol',
type: 'address',
},
{
internalType: 'bytes',
name: 'swapData',
type: 'bytes',
},
],
name: 'approveAndForward',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [],
name: 'guardian',
outputs: [
{
internalType: 'address',
name: '',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'uint256',
name: 'amount',
type: 'uint256',
},
{
internalType: 'address payable',
name: 'to',
type: 'address',
},
],
name: 'rescueEth',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'token',
type: 'address',
},
{
internalType: 'uint256',
name: 'amount',
type: 'uint256',
},
{
internalType: 'address',
name: 'to',
type: 'address',
},
],
name: 'rescueToken',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'swapProtocol',
type: 'address',
},
{
internalType: 'bool',
name: 'enabled',
type: 'bool',
},
],
name: 'setSwapProtocol',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: '',
type: 'address',
},
],
name: 'swapProtocols',
outputs: [
{
internalType: 'bool',
name: '',
type: 'bool',
},
],
stateMutability: 'view',
type: 'function',
},
];
Loading

0 comments on commit 5bea6ce

Please sign in to comment.