@dodoex/dodo-contract-request 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cache/contract-info/BuyoutModel.json +1 -0
- package/.cache/contract-info/CP.json +1 -0
- package/.cache/contract-info/CloneFactory.json +1 -0
- package/.cache/contract-info/CrowdPoolingFactory.json +1 -0
- package/.cache/contract-info/CustomERC20.json +1 -0
- package/.cache/contract-info/CustomMintableERC20.json +1 -0
- package/.cache/contract-info/D3Proxy.json +1 -0
- package/.cache/contract-info/D3Vault.json +1 -0
- package/.cache/contract-info/DODOApprove.json +1 -0
- package/.cache/contract-info/DODOApproveProxy.json +1 -0
- package/.cache/contract-info/DODOCalleeHelper.json +1 -0
- package/.cache/contract-info/DODOCirculationHelper.json +1 -0
- package/.cache/contract-info/DODOCpProxy.json +148 -0
- package/.cache/contract-info/DODOCpProxyWithoutGlobalQuota.json +1 -0
- package/.cache/contract-info/DODODppProxy.json +1 -0
- package/.cache/contract-info/DODODspProxy.json +1 -0
- package/.cache/contract-info/DODODspProxyWithoutGSP.json +1 -0
- package/.cache/contract-info/DODOIncentive.json +1 -0
- package/.cache/contract-info/DODOMineV2Factory.json +1 -0
- package/.cache/contract-info/DODOMineV3Proxy.json +373 -0
- package/.cache/contract-info/DODOMineV3ProxyWithoutPlatform.json +1 -0
- package/.cache/contract-info/DODOMineV3Registry.json +1 -0
- package/.cache/contract-info/DODONFT.json +1 -0
- package/.cache/contract-info/DODONFT1155.json +1 -0
- package/.cache/contract-info/DODONFTApprove.json +1 -0
- package/.cache/contract-info/DODONFTPoolProxy.json +1 -0
- package/.cache/contract-info/DODONFTProxy.json +1 -0
- package/.cache/contract-info/DODONFTRegistry.json +1 -0
- package/.cache/contract-info/DODONFTRouteHelper.json +1 -0
- package/.cache/contract-info/DODOSellHelper.json +1 -0
- package/.cache/contract-info/DODOStarterProxy.json +1 -0
- package/.cache/contract-info/DODOV1.json +1 -0
- package/.cache/contract-info/DODOV1Adapter.json +1 -0
- package/.cache/contract-info/DODOV1PmmHelper.json +88 -0
- package/.cache/contract-info/DODOV1Proxy.json +1 -0
- package/.cache/contract-info/DODOV2Proxy02.json +1 -0
- package/.cache/contract-info/DODOV2RouteHelper.json +1 -0
- package/.cache/contract-info/DPPAdvanced.json +1 -0
- package/.cache/contract-info/DPPAdvancedAdmin.json +1 -0
- package/.cache/contract-info/DPPFactory.json +1 -0
- package/.cache/contract-info/DSP.json +1 -0
- package/.cache/contract-info/DSPFactory.json +1 -0
- package/.cache/contract-info/DVM.json +1 -0
- package/.cache/contract-info/DVMFactory.json +1 -0
- package/.cache/contract-info/ERC20.json +1 -0
- package/.cache/contract-info/ERC20Helper.json +1 -0
- package/.cache/contract-info/ERC20MineV3.json +1 -0
- package/.cache/contract-info/ERC20V3Factory.json +1 -0
- package/.cache/contract-info/FeeRateDIP3Impl.json +1 -0
- package/.cache/contract-info/FeeRateModel.json +1 -0
- package/.cache/contract-info/GSP.json +1 -0
- package/.cache/contract-info/GSPFactory.json +1 -0
- package/.cache/contract-info/InitializableERC20.json +1 -0
- package/.cache/contract-info/LimitOrder.json +1 -0
- package/.cache/contract-info/LimitOrderBot.json +1 -0
- package/.cache/contract-info/MulticallWithValid.json +1 -0
- package/.cache/contract-info/PermissionManager.json +1 -0
- package/.cache/contract-info/dodoTeam.json +1 -0
- package/.cache/contract-info/vDODOToken.json +1 -0
- package/.env.sample +1 -0
- package/.releaserc.json +31 -0
- package/CHANGELOG.md +16 -0
- package/README.md +75 -0
- package/babel.config.js +6 -0
- package/contract-config/arbitrum.json +85 -0
- package/contract-config/aurora.json +84 -0
- package/contract-config/avalanche.json +84 -0
- package/contract-config/base.json +84 -0
- package/contract-config/berachain-testnet.json +65 -0
- package/contract-config/bitlayer.json +84 -0
- package/contract-config/bsc.json +85 -0
- package/contract-config/conflux.json +84 -0
- package/contract-config/eth.json +90 -0
- package/contract-config/linea.json +84 -0
- package/contract-config/manta.json +84 -0
- package/contract-config/mantle.json +85 -0
- package/contract-config/morph.json +65 -0
- package/contract-config/optimism.json +84 -0
- package/contract-config/polygon.json +84 -0
- package/contract-config/scroll.json +84 -0
- package/contract-config/sepolia.json +85 -0
- package/contract-config/taiko.json +65 -0
- package/contract-config/x-layer.json +84 -0
- package/contract-config/zero-mainnet.json +65 -0
- package/contract-config/zircuit-mainnet.json +84 -0
- package/dist/config.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/config/arbitrum.d.ts +40 -0
- package/dist/types/config/aurora.d.ts +25 -0
- package/dist/types/config/avalanche.d.ts +27 -0
- package/dist/types/config/base.d.ts +23 -0
- package/dist/types/config/berachain-testnet.d.ts +30 -0
- package/dist/types/config/bitlayer.d.ts +24 -0
- package/dist/types/config/bsc.d.ts +40 -0
- package/dist/types/config/conflux.d.ts +23 -0
- package/dist/types/config/ethereum.d.ts +45 -0
- package/dist/types/config/index.d.ts +179 -0
- package/dist/types/config/linea.d.ts +24 -0
- package/dist/types/config/manta.d.ts +24 -0
- package/dist/types/config/mantle.d.ts +24 -0
- package/dist/types/config/morph.d.ts +30 -0
- package/dist/types/config/optimism.d.ts +26 -0
- package/dist/types/config/polygon.d.ts +38 -0
- package/dist/types/config/scroll.d.ts +24 -0
- package/dist/types/config/sepolia.d.ts +27 -0
- package/dist/types/config/taiko.d.ts +30 -0
- package/dist/types/config/x-layer.d.ts +25 -0
- package/dist/types/config/zero-mainnet.d.ts +30 -0
- package/dist/types/config/zircuit-mainnet.d.ts +24 -0
- package/dist/types/contract/BuyoutModel.d.ts +83 -0
- package/dist/types/contract/CP.d.ts +317 -0
- package/dist/types/contract/CloneFactory.d.ts +6 -0
- package/dist/types/contract/CrowdPoolingFactory.d.ts +207 -0
- package/dist/types/contract/CustomERC20.d.ts +145 -0
- package/dist/types/contract/CustomMintableERC20.d.ts +158 -0
- package/dist/types/contract/D3Proxy.d.ts +104 -0
- package/dist/types/contract/D3Vault.d.ts +639 -0
- package/dist/types/contract/DODOApprove.d.ts +89 -0
- package/dist/types/contract/DODOApproveProxy.d.ts +103 -0
- package/dist/types/contract/DODOCalleeHelper.d.ts +42 -0
- package/dist/types/contract/DODOCirculationHelper.d.ts +74 -0
- package/dist/types/contract/DODOCpProxy.d.ts +40 -0
- package/dist/types/contract/DODOCpProxyWithoutGlobalQuota.d.ts +40 -0
- package/dist/types/contract/DODODppProxy.d.ts +45 -0
- package/dist/types/contract/DODODspProxy.d.ts +67 -0
- package/dist/types/contract/DODODspProxyWithoutGSP.d.ts +45 -0
- package/dist/types/contract/DODOIncentive.d.ts +137 -0
- package/dist/types/contract/DODOMineV2Factory.d.ts +99 -0
- package/dist/types/contract/DODOMineV3Proxy.d.ts +88 -0
- package/dist/types/contract/DODOMineV3ProxyWithoutPlatform.d.ts +88 -0
- package/dist/types/contract/DODOMineV3Registry.d.ts +89 -0
- package/dist/types/contract/DODONFT.d.ts +172 -0
- package/dist/types/contract/DODONFT1155.d.ts +117 -0
- package/dist/types/contract/DODONFTApprove.d.ts +117 -0
- package/dist/types/contract/DODONFTPoolProxy.d.ts +181 -0
- package/dist/types/contract/DODONFTProxy.d.ts +152 -0
- package/dist/types/contract/DODONFTRegistry.d.ts +101 -0
- package/dist/types/contract/DODONFTRouteHelper.d.ts +16 -0
- package/dist/types/contract/DODOSellHelper.d.ts +17 -0
- package/dist/types/contract/DODOStarterProxy.d.ts +22 -0
- package/dist/types/contract/DODOV1.d.ts +514 -0
- package/dist/types/contract/DODOV1Adapter.d.ts +23 -0
- package/dist/types/contract/DODOV1PmmHelper.d.ts +8 -0
- package/dist/types/contract/DODOV1Proxy.d.ts +55 -0
- package/dist/types/contract/DODOV2Proxy02.d.ts +280 -0
- package/dist/types/contract/DODOV2RouteHelper.d.ts +28 -0
- package/dist/types/contract/DPPAdvanced.d.ts +320 -0
- package/dist/types/contract/DPPAdvancedAdmin.d.ts +115 -0
- package/dist/types/contract/DPPFactory.d.ts +194 -0
- package/dist/types/contract/DSP.d.ts +392 -0
- package/dist/types/contract/DSPFactory.d.ts +134 -0
- package/dist/types/contract/DVM.d.ts +363 -0
- package/dist/types/contract/DVMFactory.d.ts +134 -0
- package/dist/types/contract/ERC20.d.ts +79 -0
- package/dist/types/contract/ERC20Helper.d.ts +67 -0
- package/dist/types/contract/ERC20MineV3.d.ts +204 -0
- package/dist/types/contract/ERC20V3Factory.d.ts +161 -0
- package/dist/types/contract/FeeRateDIP3Impl.d.ts +158 -0
- package/dist/types/contract/FeeRateModel.d.ts +53 -0
- package/dist/types/contract/GSP.d.ts +488 -0
- package/dist/types/contract/GSPFactory.d.ts +137 -0
- package/dist/types/contract/InitializableERC20.d.ts +84 -0
- package/dist/types/contract/LimitOrder.d.ts +164 -0
- package/dist/types/contract/LimitOrderBot.d.ts +102 -0
- package/dist/types/contract/MulticallWithValid.d.ts +51 -0
- package/dist/types/contract/PermissionManager.d.ts +83 -0
- package/dist/types/contract/dodoTeam.d.ts +244 -0
- package/dist/types/contract/vDODOToken.d.ts +309 -0
- package/dist/types/contractRequests.d.ts +3 -0
- package/dist/types/index.d.ts +60 -0
- package/package.json +41 -0
- package/rollup.config.mjs +51 -0
- package/scripts/contract-generate.ts +192 -0
- package/src/config/arbitrum.ts +4 -0
- package/src/config/aurora.ts +4 -0
- package/src/config/avalanche.ts +4 -0
- package/src/config/base.ts +4 -0
- package/src/config/berachain-testnet.ts +4 -0
- package/src/config/bitlayer.ts +4 -0
- package/src/config/bsc.ts +4 -0
- package/src/config/conflux.ts +4 -0
- package/src/config/ethereum.ts +4 -0
- package/src/config/index.ts +95 -0
- package/src/config/linea.ts +4 -0
- package/src/config/manta.ts +4 -0
- package/src/config/mantle.ts +4 -0
- package/src/config/morph.ts +4 -0
- package/src/config/optimism.ts +4 -0
- package/src/config/polygon.ts +4 -0
- package/src/config/scroll.ts +4 -0
- package/src/config/sepolia.ts +4 -0
- package/src/config/taiko.ts +4 -0
- package/src/config/x-layer.ts +4 -0
- package/src/config/zero-mainnet.ts +4 -0
- package/src/config/zircuit-mainnet.ts +4 -0
- package/src/contract/BuyoutModel.ts +158 -0
- package/src/contract/CP.ts +532 -0
- package/src/contract/CloneFactory.ts +15 -0
- package/src/contract/CrowdPoolingFactory.ts +397 -0
- package/src/contract/CustomERC20.ts +241 -0
- package/src/contract/CustomMintableERC20.ts +262 -0
- package/src/contract/D3Proxy.ts +177 -0
- package/src/contract/D3Vault.ts +1124 -0
- package/src/contract/DODOApprove.ts +172 -0
- package/src/contract/DODOApproveProxy.ts +197 -0
- package/src/contract/DODOCalleeHelper.ts +74 -0
- package/src/contract/DODOCirculationHelper.ts +152 -0
- package/src/contract/DODOCpProxy.ts +78 -0
- package/src/contract/DODOCpProxyWithoutGlobalQuota.ts +78 -0
- package/src/contract/DODODppProxy.ts +83 -0
- package/src/contract/DODODspProxy.ts +116 -0
- package/src/contract/DODODspProxyWithoutGSP.ts +83 -0
- package/src/contract/DODOIncentive.ts +259 -0
- package/src/contract/DODOMineV2Factory.ts +189 -0
- package/src/contract/DODOMineV3Proxy.ts +167 -0
- package/src/contract/DODOMineV3ProxyWithoutPlatform.ts +167 -0
- package/src/contract/DODOMineV3Registry.ts +168 -0
- package/src/contract/DODONFT.ts +323 -0
- package/src/contract/DODONFT1155.ts +214 -0
- package/src/contract/DODONFTApprove.ts +212 -0
- package/src/contract/DODONFTPoolProxy.ts +316 -0
- package/src/contract/DODONFTProxy.ts +293 -0
- package/src/contract/DODONFTRegistry.ts +187 -0
- package/src/contract/DODONFTRouteHelper.ts +39 -0
- package/src/contract/DODOSellHelper.ts +40 -0
- package/src/contract/DODOStarterProxy.ts +49 -0
- package/src/contract/DODOV1.ts +854 -0
- package/src/contract/DODOV1Adapter.ts +47 -0
- package/src/contract/DODOV1PmmHelper.ts +24 -0
- package/src/contract/DODOV1Proxy.ts +99 -0
- package/src/contract/DODOV2Proxy02.ts +456 -0
- package/src/contract/DODOV2RouteHelper.ts +65 -0
- package/src/contract/DPPAdvanced.ts +492 -0
- package/src/contract/DPPAdvancedAdmin.ts +191 -0
- package/src/contract/DPPFactory.ts +353 -0
- package/src/contract/DSP.ts +608 -0
- package/src/contract/DSPFactory.ts +248 -0
- package/src/contract/DVM.ts +564 -0
- package/src/contract/DVMFactory.ts +248 -0
- package/src/contract/ERC20.ts +134 -0
- package/src/contract/ERC20Helper.ts +104 -0
- package/src/contract/ERC20MineV3.ts +326 -0
- package/src/contract/ERC20V3Factory.ts +291 -0
- package/src/contract/FeeRateDIP3Impl.ts +281 -0
- package/src/contract/FeeRateModel.ts +94 -0
- package/src/contract/GSP.ts +766 -0
- package/src/contract/GSPFactory.ts +248 -0
- package/src/contract/InitializableERC20.ts +140 -0
- package/src/contract/LimitOrder.ts +267 -0
- package/src/contract/LimitOrderBot.ts +189 -0
- package/src/contract/MulticallWithValid.ts +113 -0
- package/src/contract/PermissionManager.ts +144 -0
- package/src/contract/dodoTeam.ts +415 -0
- package/src/contract/vDODOToken.ts +592 -0
- package/src/contractRequests.ts +10 -0
- package/src/index.ts +61 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getGSPFactoryContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x710409D2121B7C8EA4aCAdd6803FDE2D85DF6473","196":"0x5e132c0ABB9e4E5f1471eF6d1C9740c276Fe520e","2818":"0x2235bB894b7600F1a370fc595Ee5477999A30441","80084":"0x9Ac82EAD1945dF394867df6A053f7375634710fb","167000":"0x2235bB894b7600F1a370fc595Ee5477999A30441","543210":"0x1E080d9c6133e98A955F6020711AFAf73265A7F6"};
|
|
7
|
+
const result = contractAddressObject[String(chainId) as keyof typeof contractAddressObject];
|
|
8
|
+
if (!result) throw new Error(`Not support ChainId: ${chainId}.`)
|
|
9
|
+
return result
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* fetch _CLONE_FACTORY_
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - address
|
|
16
|
+
*/
|
|
17
|
+
export function fetchGSPFactory_CLONE_FACTORY_(chainId: number) {
|
|
18
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0xeb774d05', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* fetch _DEFAULT_MAINTAINER_
|
|
27
|
+
* @param {number} chainId - number
|
|
28
|
+
* @returns {string} __output0 - address
|
|
29
|
+
*/
|
|
30
|
+
export function fetchGSPFactory_DEFAULT_MAINTAINER_(chainId: number) {
|
|
31
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
32
|
+
|
|
33
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
34
|
+
const __data = hexlify(concat(['0x81ab4d0a', __encodeData]));
|
|
35
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* fetch _GSP_TEMPLATE_
|
|
40
|
+
* @param {number} chainId - number
|
|
41
|
+
* @returns {string} __output0 - address
|
|
42
|
+
*/
|
|
43
|
+
export function fetchGSPFactory_GSP_TEMPLATE_(chainId: number) {
|
|
44
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
45
|
+
|
|
46
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
47
|
+
const __data = hexlify(concat(['0x8483a1c9', __encodeData]));
|
|
48
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* fetch _NEW_OWNER_
|
|
53
|
+
* @param {number} chainId - number
|
|
54
|
+
* @returns {string} __output0 - address
|
|
55
|
+
*/
|
|
56
|
+
export function fetchGSPFactory_NEW_OWNER_(chainId: number) {
|
|
57
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
58
|
+
|
|
59
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
60
|
+
const __data = hexlify(concat(['0x8456db15', __encodeData]));
|
|
61
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* fetch _OWNER_
|
|
66
|
+
* @param {number} chainId - number
|
|
67
|
+
* @returns {string} __output0 - address
|
|
68
|
+
*/
|
|
69
|
+
export function fetchGSPFactory_OWNER_(chainId: number) {
|
|
70
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
71
|
+
|
|
72
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
73
|
+
const __data = hexlify(concat(['0x16048bc4', __encodeData]));
|
|
74
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* fetch _REGISTRY_
|
|
79
|
+
* @param {number} chainId - number
|
|
80
|
+
* @param {string} __input1 - address
|
|
81
|
+
* @param {string} __input2 - address
|
|
82
|
+
* @param {number} __input3 - uint256
|
|
83
|
+
* @returns {string} __output0 - address
|
|
84
|
+
*/
|
|
85
|
+
export function fetchGSPFactory_REGISTRY_(chainId: number, __input1: string, __input2: string, __input3: number) {
|
|
86
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
87
|
+
|
|
88
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256"], [__input1,__input2,__input3]);
|
|
89
|
+
const __data = hexlify(concat(['0xbdeb0a91', __encodeData]));
|
|
90
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* fetch _USER_REGISTRY_
|
|
95
|
+
* @param {number} chainId - number
|
|
96
|
+
* @param {string} __input1 - address
|
|
97
|
+
* @param {number} __input2 - uint256
|
|
98
|
+
* @returns {string} __output0 - address
|
|
99
|
+
*/
|
|
100
|
+
export function fetchGSPFactory_USER_REGISTRY_(chainId: number, __input1: string, __input2: number) {
|
|
101
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
102
|
+
|
|
103
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [__input1,__input2]);
|
|
104
|
+
const __data = hexlify(concat(['0xa58888db', __encodeData]));
|
|
105
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* fetch getDODOPool
|
|
110
|
+
* @param {number} chainId - number
|
|
111
|
+
* @param {string} baseToken - address
|
|
112
|
+
* @param {string} quoteToken - address
|
|
113
|
+
* @returns {Array<string>} machines - address[]
|
|
114
|
+
*/
|
|
115
|
+
export function fetchGSPFactoryGetDODOPool(chainId: number, baseToken: string, quoteToken: string) {
|
|
116
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
117
|
+
|
|
118
|
+
const __encodeData = defaultAbiCoder.encode(["address","address"], [baseToken,quoteToken]);
|
|
119
|
+
const __data = hexlify(concat(['0x57a281dc', __encodeData]));
|
|
120
|
+
return contractRequests.batchCall<Array<string>>(chainId, __to, __data, ["address[]"])
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* fetch getDODOPoolBidirection
|
|
125
|
+
* @param {number} chainId - number
|
|
126
|
+
* @param {string} token0 - address
|
|
127
|
+
* @param {string} token1 - address
|
|
128
|
+
* @returns {Array<string>} baseToken0Machines - address[]
|
|
129
|
+
* @returns {Array<string>} baseToken1Machines - address[]
|
|
130
|
+
*/
|
|
131
|
+
export function fetchGSPFactoryGetDODOPoolBidirection(chainId: number, token0: string, token1: string) {
|
|
132
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
133
|
+
|
|
134
|
+
const __encodeData = defaultAbiCoder.encode(["address","address"], [token0,token1]);
|
|
135
|
+
const __data = hexlify(concat(['0x794e5538', __encodeData]));
|
|
136
|
+
return contractRequests.batchCall<{
|
|
137
|
+
baseToken0Machines: Array<string>;
|
|
138
|
+
baseToken1Machines: Array<string>;
|
|
139
|
+
}>(chainId, __to, __data, ["address[]","address[]"])
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* fetch getDODOPoolByUser
|
|
144
|
+
* @param {number} chainId - number
|
|
145
|
+
* @param {string} user - address
|
|
146
|
+
* @returns {Array<string>} machines - address[]
|
|
147
|
+
*/
|
|
148
|
+
export function fetchGSPFactoryGetDODOPoolByUser(chainId: number, user: string) {
|
|
149
|
+
const __to = getGSPFactoryContractAddressByChainId(chainId);
|
|
150
|
+
|
|
151
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [user]);
|
|
152
|
+
const __data = hexlify(concat(['0xe65f7029', __encodeData]));
|
|
153
|
+
return contractRequests.batchCall<Array<string>>(chainId, __to, __data, ["address[]"])
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* encode addPoolByAdmin
|
|
158
|
+
* @param {string} creator - address
|
|
159
|
+
* @param {string} baseToken - address
|
|
160
|
+
* @param {string} quoteToken - address
|
|
161
|
+
* @param {string} pool - address
|
|
162
|
+
* @returns {string} encode data
|
|
163
|
+
*/
|
|
164
|
+
export function encodeGSPFactoryAddPoolByAdmin(creator: string, baseToken: string, quoteToken: string, pool: string) {
|
|
165
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","address","address"], [creator,baseToken,quoteToken,pool]);
|
|
166
|
+
return hexlify(concat(['0x39d00ef9', __encodeData]));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* encode claimOwnership
|
|
171
|
+
|
|
172
|
+
* @returns {string} encode data
|
|
173
|
+
*/
|
|
174
|
+
export function encodeGSPFactoryClaimOwnership() {
|
|
175
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
176
|
+
return hexlify(concat(['0x4e71e0c8', __encodeData]));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* encode createDODOGasSavingPool
|
|
181
|
+
* @param {string} admin - address
|
|
182
|
+
* @param {string} baseToken - address
|
|
183
|
+
* @param {string} quoteToken - address
|
|
184
|
+
* @param {number} lpFeeRate - uint256
|
|
185
|
+
* @param {number} mtFeeRate - uint256
|
|
186
|
+
* @param {number} i - uint256
|
|
187
|
+
* @param {number} k - uint256
|
|
188
|
+
* @param {number} priceLimit - uint256
|
|
189
|
+
* @param {boolean} isOpenTWAP - bool
|
|
190
|
+
* @returns {string} encode data
|
|
191
|
+
*/
|
|
192
|
+
export function encodeGSPFactoryCreateDODOGasSavingPool(admin: string, baseToken: string, quoteToken: string, lpFeeRate: number, mtFeeRate: number, i: number, k: number, priceLimit: number, isOpenTWAP: boolean) {
|
|
193
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","address","uint256","uint256","uint256","uint256","uint256","bool"], [admin,baseToken,quoteToken,lpFeeRate,mtFeeRate,i,k,priceLimit,isOpenTWAP]);
|
|
194
|
+
return hexlify(concat(['0x9f575593', __encodeData]));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* encode initOwner
|
|
199
|
+
* @param {string} newOwner - address
|
|
200
|
+
* @returns {string} encode data
|
|
201
|
+
*/
|
|
202
|
+
export function encodeGSPFactoryInitOwner(newOwner: string) {
|
|
203
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
204
|
+
return hexlify(concat(['0x0d009297', __encodeData]));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* encode removePoolByAdmin
|
|
209
|
+
* @param {string} creator - address
|
|
210
|
+
* @param {string} baseToken - address
|
|
211
|
+
* @param {string} quoteToken - address
|
|
212
|
+
* @param {string} pool - address
|
|
213
|
+
* @returns {string} encode data
|
|
214
|
+
*/
|
|
215
|
+
export function encodeGSPFactoryRemovePoolByAdmin(creator: string, baseToken: string, quoteToken: string, pool: string) {
|
|
216
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","address","address"], [creator,baseToken,quoteToken,pool]);
|
|
217
|
+
return hexlify(concat(['0x43274b82', __encodeData]));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* encode transferOwnership
|
|
222
|
+
* @param {string} newOwner - address
|
|
223
|
+
* @returns {string} encode data
|
|
224
|
+
*/
|
|
225
|
+
export function encodeGSPFactoryTransferOwnership(newOwner: string) {
|
|
226
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
227
|
+
return hexlify(concat(['0xf2fde38b', __encodeData]));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* encode updateDefaultMaintainer
|
|
232
|
+
* @param {string} _newMaintainer - address
|
|
233
|
+
* @returns {string} encode data
|
|
234
|
+
*/
|
|
235
|
+
export function encodeGSPFactoryUpdateDefaultMaintainer(_newMaintainer: string) {
|
|
236
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [_newMaintainer]);
|
|
237
|
+
return hexlify(concat(['0x9e988ee3', __encodeData]));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* encode updateGSPTemplate
|
|
242
|
+
* @param {string} _newGSPTemplate - address
|
|
243
|
+
* @returns {string} encode data
|
|
244
|
+
*/
|
|
245
|
+
export function encodeGSPFactoryUpdateGSPTemplate(_newGSPTemplate: string) {
|
|
246
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [_newGSPTemplate]);
|
|
247
|
+
return hexlify(concat(['0xe56b6a9b', __encodeData]));
|
|
248
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* fetch allowance
|
|
9
|
+
* @param {number} chainId - number
|
|
10
|
+
* @param {string} __to - string
|
|
11
|
+
* @param {string} owner - address
|
|
12
|
+
* @param {string} spender - address
|
|
13
|
+
* @returns {bigint} __output0 - uint256
|
|
14
|
+
*/
|
|
15
|
+
export function fetchInitializableERC20Allowance(chainId: number, __to: string, owner: string, spender: string) {
|
|
16
|
+
const __encodeData = defaultAbiCoder.encode(["address","address"], [owner,spender]);
|
|
17
|
+
const __data = hexlify(concat(['0xdd62ed3e', __encodeData]));
|
|
18
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* fetch balanceOf
|
|
23
|
+
* @param {number} chainId - number
|
|
24
|
+
* @param {string} __to - string
|
|
25
|
+
* @param {string} owner - address
|
|
26
|
+
* @returns {bigint} balance - uint256
|
|
27
|
+
*/
|
|
28
|
+
export function fetchInitializableERC20BalanceOf(chainId: number, __to: string, owner: string) {
|
|
29
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [owner]);
|
|
30
|
+
const __data = hexlify(concat(['0x70a08231', __encodeData]));
|
|
31
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* fetch decimals
|
|
36
|
+
* @param {number} chainId - number
|
|
37
|
+
* @param {string} __to - string
|
|
38
|
+
* @returns {bigint} __output0 - uint8
|
|
39
|
+
*/
|
|
40
|
+
export function fetchInitializableERC20Decimals(chainId: number, __to: string) {
|
|
41
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
42
|
+
const __data = hexlify(concat(['0x313ce567', __encodeData]));
|
|
43
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint8"])
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* fetch initialized
|
|
48
|
+
* @param {number} chainId - number
|
|
49
|
+
* @param {string} __to - string
|
|
50
|
+
* @returns {boolean} __output0 - bool
|
|
51
|
+
*/
|
|
52
|
+
export function fetchInitializableERC20Initialized(chainId: number, __to: string) {
|
|
53
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
54
|
+
const __data = hexlify(concat(['0x158ef93e', __encodeData]));
|
|
55
|
+
return contractRequests.batchCall<boolean>(chainId, __to, __data, ["bool"])
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* fetch name
|
|
60
|
+
* @param {number} chainId - number
|
|
61
|
+
* @param {string} __to - string
|
|
62
|
+
* @returns {string} __output0 - string
|
|
63
|
+
*/
|
|
64
|
+
export function fetchInitializableERC20Name(chainId: number, __to: string) {
|
|
65
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
66
|
+
const __data = hexlify(concat(['0x06fdde03', __encodeData]));
|
|
67
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["string"])
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* fetch symbol
|
|
72
|
+
* @param {number} chainId - number
|
|
73
|
+
* @param {string} __to - string
|
|
74
|
+
* @returns {string} __output0 - string
|
|
75
|
+
*/
|
|
76
|
+
export function fetchInitializableERC20Symbol(chainId: number, __to: string) {
|
|
77
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
78
|
+
const __data = hexlify(concat(['0x95d89b41', __encodeData]));
|
|
79
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["string"])
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* fetch totalSupply
|
|
84
|
+
* @param {number} chainId - number
|
|
85
|
+
* @param {string} __to - string
|
|
86
|
+
* @returns {bigint} __output0 - uint256
|
|
87
|
+
*/
|
|
88
|
+
export function fetchInitializableERC20TotalSupply(chainId: number, __to: string) {
|
|
89
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
90
|
+
const __data = hexlify(concat(['0x18160ddd', __encodeData]));
|
|
91
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* encode approve
|
|
96
|
+
* @param {string} spender - address
|
|
97
|
+
* @param {number} amount - uint256
|
|
98
|
+
* @returns {string} encode data
|
|
99
|
+
*/
|
|
100
|
+
export function encodeInitializableERC20Approve(spender: string, amount: number) {
|
|
101
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [spender,amount]);
|
|
102
|
+
return hexlify(concat(['0x095ea7b3', __encodeData]));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* encode init
|
|
107
|
+
* @param {string} _creator - address
|
|
108
|
+
* @param {number} _totalSupply - uint256
|
|
109
|
+
* @param {string} _name - string
|
|
110
|
+
* @param {string} _symbol - string
|
|
111
|
+
* @param {number} _decimals - uint8
|
|
112
|
+
* @returns {string} encode data
|
|
113
|
+
*/
|
|
114
|
+
export function encodeInitializableERC20Init(_creator: string, _totalSupply: number, _name: string, _symbol: string, _decimals: number) {
|
|
115
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","string","string","uint8"], [_creator,_totalSupply,_name,_symbol,_decimals]);
|
|
116
|
+
return hexlify(concat(['0xfc90ef18', __encodeData]));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* encode transfer
|
|
121
|
+
* @param {string} to - address
|
|
122
|
+
* @param {number} amount - uint256
|
|
123
|
+
* @returns {string} encode data
|
|
124
|
+
*/
|
|
125
|
+
export function encodeInitializableERC20Transfer(to: string, amount: number) {
|
|
126
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [to,amount]);
|
|
127
|
+
return hexlify(concat(['0xa9059cbb', __encodeData]));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* encode transferFrom
|
|
132
|
+
* @param {string} from - address
|
|
133
|
+
* @param {string} to - address
|
|
134
|
+
* @param {number} amount - uint256
|
|
135
|
+
* @returns {string} encode data
|
|
136
|
+
*/
|
|
137
|
+
export function encodeInitializableERC20TransferFrom(from: string, to: string, amount: number) {
|
|
138
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256"], [from,to,amount]);
|
|
139
|
+
return hexlify(concat(['0x23b872dd', __encodeData]));
|
|
140
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getLimitOrderContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x093b68BFe0859D3C857Fc3529952897C30dD17EB","56":"0xdc5E86654e768d21f7D298690687eA02db7b2a04","137":"0x5F43046eAD98012044CfC1C3427A1bcEf921d3f3","42161":"0x91FbD0C9dbA8C42B7Fa636CC60344c72E7D065c9"};
|
|
7
|
+
const result = contractAddressObject[String(chainId) as keyof typeof contractAddressObject];
|
|
8
|
+
if (!result) throw new Error(`Not support ChainId: ${chainId}.`)
|
|
9
|
+
return result
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* fetch ORDER_TYPEHASH
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - bytes32
|
|
16
|
+
*/
|
|
17
|
+
export function fetchLimitOrderORDER_TYPEHASH(chainId: number) {
|
|
18
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0xf973a209', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["bytes32"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* fetch RFQ_ORDER_TYPEHASH
|
|
27
|
+
* @param {number} chainId - number
|
|
28
|
+
* @returns {string} __output0 - bytes32
|
|
29
|
+
*/
|
|
30
|
+
export function fetchLimitOrderRFQ_ORDER_TYPEHASH(chainId: number) {
|
|
31
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
32
|
+
|
|
33
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
34
|
+
const __data = hexlify(concat(['0x3f45e230', __encodeData]));
|
|
35
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["bytes32"])
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* fetch _DODO_APPROVE_PROXY_
|
|
40
|
+
* @param {number} chainId - number
|
|
41
|
+
* @returns {string} __output0 - address
|
|
42
|
+
*/
|
|
43
|
+
export function fetchLimitOrder_DODO_APPROVE_PROXY_(chainId: number) {
|
|
44
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
45
|
+
|
|
46
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
47
|
+
const __data = hexlify(concat(['0xeb99be12', __encodeData]));
|
|
48
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* fetch _FEE_RECEIVER_
|
|
53
|
+
* @param {number} chainId - number
|
|
54
|
+
* @returns {string} __output0 - address
|
|
55
|
+
*/
|
|
56
|
+
export function fetchLimitOrder_FEE_RECEIVER_(chainId: number) {
|
|
57
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
58
|
+
|
|
59
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
60
|
+
const __data = hexlify(concat(['0x7161e0f2', __encodeData]));
|
|
61
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* fetch _FILLED_TAKER_AMOUNT_
|
|
66
|
+
* @param {number} chainId - number
|
|
67
|
+
* @param {string} __input1 - bytes32
|
|
68
|
+
* @returns {bigint} __output0 - uint256
|
|
69
|
+
*/
|
|
70
|
+
export function fetchLimitOrder_FILLED_TAKER_AMOUNT_(chainId: number, __input1: string) {
|
|
71
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
72
|
+
|
|
73
|
+
const __encodeData = defaultAbiCoder.encode(["bytes32"], [__input1]);
|
|
74
|
+
const __data = hexlify(concat(['0x1068705b', __encodeData]));
|
|
75
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* fetch _NEW_OWNER_
|
|
80
|
+
* @param {number} chainId - number
|
|
81
|
+
* @returns {string} __output0 - address
|
|
82
|
+
*/
|
|
83
|
+
export function fetchLimitOrder_NEW_OWNER_(chainId: number) {
|
|
84
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
85
|
+
|
|
86
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
87
|
+
const __data = hexlify(concat(['0x8456db15', __encodeData]));
|
|
88
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* fetch _OWNER_
|
|
93
|
+
* @param {number} chainId - number
|
|
94
|
+
* @returns {string} __output0 - address
|
|
95
|
+
*/
|
|
96
|
+
export function fetchLimitOrder_OWNER_(chainId: number) {
|
|
97
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
98
|
+
|
|
99
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
100
|
+
const __data = hexlify(concat(['0x16048bc4', __encodeData]));
|
|
101
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* fetch _RFQ_FILLED_TAKER_AMOUNT_
|
|
106
|
+
* @param {number} chainId - number
|
|
107
|
+
* @param {string} __input1 - address
|
|
108
|
+
* @param {number} __input2 - uint256
|
|
109
|
+
* @returns {bigint} __output0 - uint256
|
|
110
|
+
*/
|
|
111
|
+
export function fetchLimitOrder_RFQ_FILLED_TAKER_AMOUNT_(chainId: number, __input1: string, __input2: number) {
|
|
112
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
113
|
+
|
|
114
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [__input1,__input2]);
|
|
115
|
+
const __data = hexlify(concat(['0x3b11fffa', __encodeData]));
|
|
116
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* fetch isAdminListed
|
|
121
|
+
* @param {number} chainId - number
|
|
122
|
+
* @param {string} __input1 - address
|
|
123
|
+
* @returns {boolean} __output0 - bool
|
|
124
|
+
*/
|
|
125
|
+
export function fetchLimitOrderIsAdminListed(chainId: number, __input1: string) {
|
|
126
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
127
|
+
|
|
128
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [__input1]);
|
|
129
|
+
const __data = hexlify(concat(['0x1822c0c0', __encodeData]));
|
|
130
|
+
return contractRequests.batchCall<boolean>(chainId, __to, __data, ["bool"])
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* fetch isWhiteListed
|
|
135
|
+
* @param {number} chainId - number
|
|
136
|
+
* @param {string} __input1 - address
|
|
137
|
+
* @returns {boolean} __output0 - bool
|
|
138
|
+
*/
|
|
139
|
+
export function fetchLimitOrderIsWhiteListed(chainId: number, __input1: string) {
|
|
140
|
+
const __to = getLimitOrderContractAddressByChainId(chainId);
|
|
141
|
+
|
|
142
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [__input1]);
|
|
143
|
+
const __data = hexlify(concat(['0x6f9170f6', __encodeData]));
|
|
144
|
+
return contractRequests.batchCall<boolean>(chainId, __to, __data, ["bool"])
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* encode addAdminList
|
|
149
|
+
* @param {string} userAddr - address
|
|
150
|
+
* @returns {string} encode data
|
|
151
|
+
*/
|
|
152
|
+
export function encodeLimitOrderAddAdminList(userAddr: string) {
|
|
153
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [userAddr]);
|
|
154
|
+
return hexlify(concat(['0xae52aae7', __encodeData]));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* encode addWhiteList
|
|
159
|
+
* @param {string} contractAddr - address
|
|
160
|
+
* @returns {string} encode data
|
|
161
|
+
*/
|
|
162
|
+
export function encodeLimitOrderAddWhiteList(contractAddr: string) {
|
|
163
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [contractAddr]);
|
|
164
|
+
return hexlify(concat(['0xe7cd4a04', __encodeData]));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* encode changeFeeReceiver
|
|
169
|
+
* @param {string} newFeeReceiver - address
|
|
170
|
+
* @returns {string} encode data
|
|
171
|
+
*/
|
|
172
|
+
export function encodeLimitOrderChangeFeeReceiver(newFeeReceiver: string) {
|
|
173
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newFeeReceiver]);
|
|
174
|
+
return hexlify(concat(['0x7c08b964', __encodeData]));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* encode claimOwnership
|
|
179
|
+
|
|
180
|
+
* @returns {string} encode data
|
|
181
|
+
*/
|
|
182
|
+
export function encodeLimitOrderClaimOwnership() {
|
|
183
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
184
|
+
return hexlify(concat(['0x4e71e0c8', __encodeData]));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* encode fillLimitOrder
|
|
189
|
+
* @param {{makerToken: string; takerToken: string; makerAmount: number; takerAmount: number; maker: string; taker: string; expiration: number; salt: number}} order - tuple
|
|
190
|
+
* @param {string} signature - bytes
|
|
191
|
+
* @param {number} takerFillAmount - uint256
|
|
192
|
+
* @param {number} thresholdTakerAmount - uint256
|
|
193
|
+
* @param {string} takerInteraction - bytes
|
|
194
|
+
* @returns {string} encode data
|
|
195
|
+
*/
|
|
196
|
+
export function encodeLimitOrderFillLimitOrder(order: {makerToken: string; takerToken: string; makerAmount: number; takerAmount: number; maker: string; taker: string; expiration: number; salt: number}, signature: string, takerFillAmount: number, thresholdTakerAmount: number, takerInteraction: string) {
|
|
197
|
+
const __encodeData = defaultAbiCoder.encode(["tuple(address, address, uint256, uint256, address, address, uint256, uint256)","bytes","uint256","uint256","bytes"], [order,signature,takerFillAmount,thresholdTakerAmount,takerInteraction]);
|
|
198
|
+
return hexlify(concat(['0x1dd76cc3', __encodeData]));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* encode init
|
|
203
|
+
* @param {string} owner - address
|
|
204
|
+
* @param {string} dodoApproveProxy - address
|
|
205
|
+
* @param {string} feeReciver - address
|
|
206
|
+
* @returns {string} encode data
|
|
207
|
+
*/
|
|
208
|
+
export function encodeLimitOrderInit(owner: string, dodoApproveProxy: string, feeReciver: string) {
|
|
209
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","address"], [owner,dodoApproveProxy,feeReciver]);
|
|
210
|
+
return hexlify(concat(['0x184b9559', __encodeData]));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* encode initOwner
|
|
215
|
+
* @param {string} newOwner - address
|
|
216
|
+
* @returns {string} encode data
|
|
217
|
+
*/
|
|
218
|
+
export function encodeLimitOrderInitOwner(newOwner: string) {
|
|
219
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
220
|
+
return hexlify(concat(['0x0d009297', __encodeData]));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* encode matchingRFQByPlatform
|
|
225
|
+
* @param {{makerToken: string; takerToken: string; makerAmount: number; takerAmount: number; makerTokenFeeAmount: number; takerFillAmount: number; maker: string; taker: string; expiration: number; slot: number}} order - tuple
|
|
226
|
+
* @param {string} makerSignature - bytes
|
|
227
|
+
* @param {string} takerSignature - bytes
|
|
228
|
+
* @param {number} takerFillAmount - uint256
|
|
229
|
+
* @param {number} thresholdMakerAmount - uint256
|
|
230
|
+
* @param {number} makerTokenFeeAmount - uint256
|
|
231
|
+
* @param {string} taker - address
|
|
232
|
+
* @returns {string} encode data
|
|
233
|
+
*/
|
|
234
|
+
export function encodeLimitOrderMatchingRFQByPlatform(order: {makerToken: string; takerToken: string; makerAmount: number; takerAmount: number; makerTokenFeeAmount: number; takerFillAmount: number; maker: string; taker: string; expiration: number; slot: number}, makerSignature: string, takerSignature: string, takerFillAmount: number, thresholdMakerAmount: number, makerTokenFeeAmount: number, taker: string) {
|
|
235
|
+
const __encodeData = defaultAbiCoder.encode(["tuple(address, address, uint256, uint256, uint256, uint256, address, address, uint256, uint256)","bytes","bytes","uint256","uint256","uint256","address"], [order,makerSignature,takerSignature,takerFillAmount,thresholdMakerAmount,makerTokenFeeAmount,taker]);
|
|
236
|
+
return hexlify(concat(['0x18c8f2ae', __encodeData]));
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* encode removeAdminList
|
|
241
|
+
* @param {string} userAddr - address
|
|
242
|
+
* @returns {string} encode data
|
|
243
|
+
*/
|
|
244
|
+
export function encodeLimitOrderRemoveAdminList(userAddr: string) {
|
|
245
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [userAddr]);
|
|
246
|
+
return hexlify(concat(['0xfd8bd849', __encodeData]));
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* encode removeWhiteList
|
|
251
|
+
* @param {string} contractAddr - address
|
|
252
|
+
* @returns {string} encode data
|
|
253
|
+
*/
|
|
254
|
+
export function encodeLimitOrderRemoveWhiteList(contractAddr: string) {
|
|
255
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [contractAddr]);
|
|
256
|
+
return hexlify(concat(['0x2042e5c2', __encodeData]));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* encode transferOwnership
|
|
261
|
+
* @param {string} newOwner - address
|
|
262
|
+
* @returns {string} encode data
|
|
263
|
+
*/
|
|
264
|
+
export function encodeLimitOrderTransferOwnership(newOwner: string) {
|
|
265
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
266
|
+
return hexlify(concat(['0xf2fde38b', __encodeData]));
|
|
267
|
+
}
|