Skip to content

Commit

Permalink
Fix: updating readme and bumping version
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminLu committed Aug 25, 2023
1 parent 3816098 commit 4aef6d6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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',
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/handler/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const VERSION = '5.2.10'
export const VERSION = '5.3.0'

export const version = (ctx) => {
ctx.body = {
Expand Down
16 changes: 8 additions & 8 deletions src/signer/rfqv1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,31 +149,31 @@ 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) {
if (signer.address.toLowerCase() == order.makerAddress.toLowerCase()) {
makerWalletSignature = await signRFQOrder(
chainId,
rfqAddr,
rfqOrer,
rfqOrder,
signer,
rfqOrer.feeFactor,
rfqOrder.feeFactor,
SignatureType.EIP712
)
} else if (walletType === WalletType.ERC1271_EIP712) {
// standard ERC1271 + ERC712 signature
makerWalletSignature = await signRFQOrder(
chainId,
rfqAddr,
rfqOrer,
rfqOrder,
signer,
rfqOrer.feeFactor,
rfqOrder.feeFactor,
SignatureType.WalletBytes32
)
} else {
Expand All @@ -188,7 +188,7 @@ export const buildSignedOrder = async (
}
} else {
makerWalletSignature = await forwardUnsignedOrder(signingUrl, {
rfqOrer: rfqOrer,
rfqOrder: rfqOrder,
userAddr: userAddr,
signer: signer.address,
chainId: chainId,
Expand Down

0 comments on commit 4aef6d6

Please sign in to comment.