diff --git a/README.md b/README.md index 16b9c4b..a180a64 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Program setup, 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: ``` { + protocol: 'RFQV1', rfqOrder: { takerAddr: '0x87fca7135c1c54876a62dc4922da3ce45f38debf', makerAddr: '0x86B9F429C3Ef44c599EB560Eb531A0E3f2E36f64', @@ -42,7 +43,6 @@ Program setup, salt: '54987026777386128963216107663301166813737035846370728350988439404382800511006' }, userAddr: '0x87fca7135c1c54876a62dc4922da3ce45f38debf', - signer: '0xb5419119e04498C3eC43A9468D6480aF0DAE3A0c', chainId: 1, rfqAddr: '0xfD6C2d2499b1331101726A8AC68CCc9Da3fAB54F' } diff --git a/package.json b/package.json index 2e96bdd..2bde119 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@consenlabs/tokenlon-mmsk", - "version": "5.3.0", + "version": "5.3.1", "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 d299a81..24bc157 100644 --- a/src/handler/version.ts +++ b/src/handler/version.ts @@ -1,4 +1,4 @@ -export const VERSION = '5.3.0' +export const VERSION = '5.3.1' export const version = (ctx) => { ctx.body = { diff --git a/src/signer/pmmv5.ts b/src/signer/pmmv5.ts index 9a713ff..2adaa82 100644 --- a/src/signer/pmmv5.ts +++ b/src/signer/pmmv5.ts @@ -10,6 +10,7 @@ import * as ethUtils from 'ethereumjs-util' import { utils, Wallet } from 'ethers' import axios from 'axios' import { BigNumber, orderBNToString } from '../utils' +import { Protocol } from '../types' const EIP712_ORDER_SCHEMA = { name: 'Order', @@ -160,12 +161,12 @@ export const buildSignedOrder = async ( : await signByMMPSigner(orderSignDigest, userAddr, feeFactor, signer) } else { makerWalletSignature = await forwardUnsignedOrder(signingUrl, { + protocol: Protocol.PMMV5, pmmOrder: o, feeFactor: feeFactor, orderHash: orderHash, orderSignDigest: orderSignDigest, userAddr: userAddr, - signer: signer.address, chainId: chainId, pmmAddr: pmm, }) diff --git a/src/signer/rfqv1.ts b/src/signer/rfqv1.ts index 39d13da..bfa6b10 100644 --- a/src/signer/rfqv1.ts +++ b/src/signer/rfqv1.ts @@ -6,6 +6,7 @@ import { RFQOrder, WalletType } from './types' import * as ethUtils from 'ethereumjs-util' import { SignatureType } from './types' import axios from 'axios' +import { Protocol } from '../types' // spec of RFQV1 // - taker address point to userAddr @@ -188,9 +189,9 @@ export const buildSignedOrder = async ( } } else { makerWalletSignature = await forwardUnsignedOrder(signingUrl, { + protocol: Protocol.RFQV1, rfqOrder: rfqOrder, userAddr: userAddr, - signer: signer.address, chainId: chainId, rfqAddr: rfqAddr, }) diff --git a/src/signer/rfqv2.ts b/src/signer/rfqv2.ts index fbd0b5e..b13db77 100644 --- a/src/signer/rfqv2.ts +++ b/src/signer/rfqv2.ts @@ -6,6 +6,7 @@ import * as ethUtils from 'ethereumjs-util' import axios from 'axios' import { generatePseudoRandomSalt } from '0x-v2-order-utils' import { signWithUserAndFee } from './pmmv5' +import { Protocol } from '../types' // spec of RFQV2 // - taker address point to userAddr @@ -175,9 +176,9 @@ export const buildSignedOrder = async ( } } else { makerWalletSignature = await forwardUnsignedOrder(signingUrl, { + protocol: Protocol.RFQV2, rfqOrder: rfqOrder, userAddr: userAddr, - signer: signer.address, chainId: chainId, rfqAddr: rfqAddr, })