diff --git a/README.md b/README.md index 36552da..16b9c4b 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Program setup, - Modify the options in `app/mmConfig.js`, including, - EXCHANGE_URL, point to tokenlon exchange server - PROVIDER_URL, point to ethereum node, like your infura endpoint + - PERMIT_TYPE, approve tokens to `RFQv2` contract directly or approve tokens to `AllowanceTarget` contract. - WALLET_ADDRESS, as your signer wallet address - WALLET_PRIVATE_KEY, private key of above wallet, or use WALLET_KEYSTORE - WALLET_TYPE, a market maker's wallet smart contract. @@ -26,10 +27,10 @@ Program setup, - types.WalletType.ERC1271 - types.WalletType.EOA - SIGNING_URL, If you wanna sign orders in your own service instead of the mmsk, - please set the SIGNING_URL to your service endpoint. the mmsk would post every unsigned RFQ orders to your service. Remember to set the WALLET_ADDRESS as well. An example request is shown below: + please set the SIGNING_URL to your service endpoint. the mmsk would post every unsigned PMM/RFQV1/RFQV2 orders to your service. Remember to set the WALLET_ADDRESS as well. An example RFQV1 request is shown below: ``` { - rfqOrer: { + rfqOrder: { takerAddr: '0x87fca7135c1c54876a62dc4922da3ce45f38debf', makerAddr: '0x86B9F429C3Ef44c599EB560Eb531A0E3f2E36f64', takerAssetAddr: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', @@ -55,7 +56,7 @@ Program setup, - HTTP_SERVER_ENDPOINT, your backend http quoting server - CHAIN_ID, 1 for mainnet, 5 for testnet(Goerli) - Testing with `node app/check.js` -- Register contract address & signer address & MMSK server url to Tokenlon team +- Register contract address, signer address and MMSK server url to Tokenlon team ## Version Release diff --git a/package.json b/package.json index b1deb95..2e96bdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@consenlabs/tokenlon-mmsk", - "version": "5.2.10", + "version": "5.3.0", "description": "Tokenlon market maker server kit", "author": "imToken PTE. LTD.", "license": "MIT", diff --git a/src/handler/version.ts b/src/handler/version.ts index 2699552..d299a81 100644 --- a/src/handler/version.ts +++ b/src/handler/version.ts @@ -1,4 +1,4 @@ -export const VERSION = '5.2.10' +export const VERSION = '5.3.0' export const version = (ctx) => { ctx.body = { diff --git a/src/signer/rfqv1.ts b/src/signer/rfqv1.ts index de2d084..39d13da 100644 --- a/src/signer/rfqv1.ts +++ b/src/signer/rfqv1.ts @@ -149,11 +149,11 @@ export const buildSignedOrder = async ( const signingUrl = options ? options.signingUrl : undefined order.salt = generateSaltWithFeeFactor(feeFactor, salt) - const rfqOrer = toRFQOrder(order) + const rfqOrder = toRFQOrder(order) - const orderHash = getOrderHash(rfqOrer) + const orderHash = getOrderHash(rfqOrder) console.log(`orderHash: ${orderHash}`) - const orderSignDigest = getOrderSignDigest(rfqOrer, chainId, rfqAddr) + const orderSignDigest = getOrderSignDigest(rfqOrder, chainId, rfqAddr) console.log(`orderSignDigest: ${orderSignDigest}`) let makerWalletSignature if (!signingUrl) { @@ -161,9 +161,9 @@ export const buildSignedOrder = async ( makerWalletSignature = await signRFQOrder( chainId, rfqAddr, - rfqOrer, + rfqOrder, signer, - rfqOrer.feeFactor, + rfqOrder.feeFactor, SignatureType.EIP712 ) } else if (walletType === WalletType.ERC1271_EIP712) { @@ -171,9 +171,9 @@ export const buildSignedOrder = async ( makerWalletSignature = await signRFQOrder( chainId, rfqAddr, - rfqOrer, + rfqOrder, signer, - rfqOrer.feeFactor, + rfqOrder.feeFactor, SignatureType.WalletBytes32 ) } else { @@ -188,7 +188,7 @@ export const buildSignedOrder = async ( } } else { makerWalletSignature = await forwardUnsignedOrder(signingUrl, { - rfqOrer: rfqOrer, + rfqOrder: rfqOrder, userAddr: userAddr, signer: signer.address, chainId: chainId,