From c05dc06535075aa7090db2c3cc2c2f65b6a55ead Mon Sep 17 00:00:00 2001 From: Samarendra Gouda Date: Tue, 10 Sep 2024 10:29:48 +0530 Subject: [PATCH 1/2] feat: add OKX connectors --- package.json | 2 +- src/abi/connectors/v2/OKX-A.ts | 40 ++++++++++++++++++++++ src/abi/connectors/v2/index.ts | 4 ++- src/addresses/arbitrum/connectorsV2_M1.ts | 3 +- src/addresses/avalanche/connectorsV2_M1.ts | 1 + src/addresses/base/connectorsV2_M1.ts | 1 + src/addresses/mainnet/connectorsV2_M1.ts | 3 +- src/addresses/optimism/connectorsV2_M1.ts | 3 +- src/addresses/polygon/connectorsV2_M1.ts | 1 + 9 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 src/abi/connectors/v2/OKX-A.ts diff --git a/package.json b/package.json index bc49378a..33b1da21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsa-connect", - "version": "0.6.99", + "version": "0.7.0", "description": "DSA connect", "main": "dist/index.js", "module": "dist/index.es.js", diff --git a/src/abi/connectors/v2/OKX-A.ts b/src/abi/connectors/v2/OKX-A.ts new file mode 100644 index 00000000..dc263936 --- /dev/null +++ b/src/abi/connectors/v2/OKX-A.ts @@ -0,0 +1,40 @@ +import { AbiItem } from 'web3-utils' + +export const OKX_A: AbiItem[] = [ + { + anonymous: false, + inputs: [ + { indexed: false, internalType: 'address', name: 'buyToken', type: 'address' }, + { indexed: false, internalType: 'address', name: 'sellToken', type: 'address' }, + { indexed: false, internalType: 'uint256', name: 'buyAmt', type: 'uint256' }, + { indexed: false, internalType: 'uint256', name: 'sellAmt', type: 'uint256' }, + { indexed: false, internalType: 'uint256', name: 'setId', type: 'uint256' } + ], + name: 'LogSwap', + type: 'event' + }, + { + inputs: [], + name: 'name', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { internalType: 'address', name: 'buyAddr', type: 'address' }, + { internalType: 'address', name: 'sellAddr', type: 'address' }, + { internalType: 'uint256', name: 'sellAmt', type: 'uint256' }, + { internalType: 'uint256', name: 'unitAmt', type: 'uint256' }, + { internalType: 'bytes', name: 'callData', type: 'bytes' }, + { internalType: 'uint256', name: 'setId', type: 'uint256' } + ], + name: 'swap', + outputs: [ + { internalType: 'string', name: '_eventName', type: 'string' }, + { internalType: 'bytes', name: '_eventParam', type: 'bytes' } + ], + stateMutability: 'payable', + type: 'function' + } +] diff --git a/src/abi/connectors/v2/index.ts b/src/abi/connectors/v2/index.ts index 03081dfa..dc3878bb 100644 --- a/src/abi/connectors/v2/index.ts +++ b/src/abi/connectors/v2/index.ts @@ -136,6 +136,7 @@ import { SPARK_CLAIM_A } from "./SPARK-CLAIM-A" import { FLUID_ARB_CLAIM_A } from "./FLUID-ARB-CLAIM-A" import { WEETHS_A } from "./WEETHS-A" import { ODOS_V2_A } from "./ODOS-V2-A" +import { OKX_A } from "./OKX-A" export const connectorsV2_M1 = { 'MORPHO-REWARDS-A': MORPHO_REWARDS_A, @@ -270,5 +271,6 @@ export const connectorsV2_M1 = { 'SPARK-CLAIM-A': SPARK_CLAIM_A, 'FLUID-ARB-CLAIM-A': FLUID_ARB_CLAIM_A, 'WEETHS-A': WEETHS_A, - 'ODOS-V2-A': ODOS_V2_A + 'ODOS-V2-A': ODOS_V2_A, + 'OKX-A': OKX_A, } diff --git a/src/addresses/arbitrum/connectorsV2_M1.ts b/src/addresses/arbitrum/connectorsV2_M1.ts index 9cd72f1a..d47dd930 100644 --- a/src/addresses/arbitrum/connectorsV2_M1.ts +++ b/src/addresses/arbitrum/connectorsV2_M1.ts @@ -42,5 +42,6 @@ export const connectorsV2_M1 = { 'BASIC-D-V2': '0x389657de20592A0F5aD9eb4De44fE8293616B751', 'INSTAPOOL-D': '0x65f244005B002ecD701Eb44F042d64CCE1bb8D1b', 'FLUID-ARB-CLAIM-A': '0x95596f9C4477861C313B1dD5e20aCd1f3DFBc092', - 'ODOS-V2-A': '0xf52AE7868e01074EaAd587060d75e996baed9aEF' + 'ODOS-V2-A': '0xf52AE7868e01074EaAd587060d75e996baed9aEF', + 'OKX-A': '0x28Fb3469E5650B4A979A9F3A54040407eB412Eed' } diff --git a/src/addresses/avalanche/connectorsV2_M1.ts b/src/addresses/avalanche/connectorsV2_M1.ts index f2e33466..cf00ec16 100644 --- a/src/addresses/avalanche/connectorsV2_M1.ts +++ b/src/addresses/avalanche/connectorsV2_M1.ts @@ -39,4 +39,5 @@ export const connectorsV2_M1 = { 'AVO-APPROVE-MULTISIG-STAGING-A': '0x832925F26de92062fca39262aC90939Ed508325b', 'PARASWAP-V6-A': '0x8b69e301EC529A96898a4b386E094D60F241a608', 'INSTAPOOL-D': '0xCFB46DbF4535F6C72BdFaf9FB8e7130fA03e24BC', + 'OKX-A': '0xE761304F14FeeE3dB4491738DA175891Db430468' } diff --git a/src/addresses/base/connectorsV2_M1.ts b/src/addresses/base/connectorsV2_M1.ts index 31f22b20..e79377a9 100644 --- a/src/addresses/base/connectorsV2_M1.ts +++ b/src/addresses/base/connectorsV2_M1.ts @@ -28,4 +28,5 @@ export const connectorsV2_M1 = { 'FLUID-A': '0x671E98Cd55587CFf8bA192489fFd968D804757D7', 'BASIC-D-V2': '0x748Fbb99DE5a89a506AB1DDF15839368402bEb4F', 'MORPHO-BLUE-A': '0x38cB414DA0620F2D7Ec3A9A1f185D519270F9538', + 'OKX-A': '0x0cAF0705a21Be560690A14e4e6D61A3A167fB026' } diff --git a/src/addresses/mainnet/connectorsV2_M1.ts b/src/addresses/mainnet/connectorsV2_M1.ts index bf80c052..373a5588 100644 --- a/src/addresses/mainnet/connectorsV2_M1.ts +++ b/src/addresses/mainnet/connectorsV2_M1.ts @@ -113,5 +113,6 @@ export const connectorsV2_M1 = { 'PARASWAP-V6-A': '0x6e5484d041aF87CD6C95cd95bd5bE7eA786098D3', 'MERKLE-CLAIM-A': '0xee85F567efc35621145dCf62f341d095D94b9F65', 'SPARK-CLAIM-A': '0xC36a19FFA9D050EEe5D53Fa15095Dc1228767EcF', - 'WEETHS-A': '0x8714DDa838b9fd0CF426545D319721c086833d59' + 'WEETHS-A': '0x8714DDa838b9fd0CF426545D319721c086833d59', + 'OKX-A': '0x69107F54d58400b38E4e7fE8037bff5C35EE222f' } diff --git a/src/addresses/optimism/connectorsV2_M1.ts b/src/addresses/optimism/connectorsV2_M1.ts index ac3d83af..31a258b9 100644 --- a/src/addresses/optimism/connectorsV2_M1.ts +++ b/src/addresses/optimism/connectorsV2_M1.ts @@ -35,5 +35,6 @@ export const connectorsV2_M1 = { 'PARASWAP-V6-A': '0xcDAb2C496A96B6Df19f3f305933088eE2d74C5bA', 'INSTAPOOL-D': '0x43416B914a9F66C46FF0dD9Ca05Bc297989f8F7E', 'COMPOUND-V3-A': ' 0xDb08a687bC3Cf7127F7933146D08d1De2a73ef87', - 'COMPOUND-V3-REWARDS-A': '0x389657de20592A0F5aD9eb4De44fE8293616B751' + 'COMPOUND-V3-REWARDS-A': '0x389657de20592A0F5aD9eb4De44fE8293616B751', + 'OKX-A': '0xF61617C863C58f864083377A446E051668DbDc51' } diff --git a/src/addresses/polygon/connectorsV2_M1.ts b/src/addresses/polygon/connectorsV2_M1.ts index b5c24147..23c16790 100644 --- a/src/addresses/polygon/connectorsV2_M1.ts +++ b/src/addresses/polygon/connectorsV2_M1.ts @@ -60,4 +60,5 @@ export const connectorsV2_M1 = { 'FLUID-STAKING-A': '0xFF93C10FB34f7069071D0679c45ed77A98f37f21', 'PARASWAP-V6-A': '0xc6639CE123d779fE6eA545B70CbDc1dCA421740d', 'INSTAPOOL-D': '0xf2Ab6FF3707752557a8410e2cFc7F48B4E248Fa0', + 'OKX-A': '0x06feaa505193e987B12f161F1dB73b1D4d604001', } From e97c9bb9c3fdddef9c3710c6cca3de67c7551091 Mon Sep 17 00:00:00 2001 From: Thrilok kumar Date: Tue, 10 Sep 2024 14:57:10 +0530 Subject: [PATCH 2/2] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 33b1da21..7aeaf9c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsa-connect", - "version": "0.7.0", + "version": "0.6.100", "description": "DSA connect", "main": "dist/index.js", "module": "dist/index.es.js",