Skip to content
This repository was archived by the owner on Aug 12, 2023. It is now read-only.

Commit 763e9ad

Browse files
authored
Add Metamask and DeFi Saver to relayers (#464)
1 parent 1f0939a commit 763e9ad

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

src/relayers/__snapshots__/get-all-relayers.test.js.snap

+18
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ Object {
4848
],
4949
"url": "https://ddex.io",
5050
},
51+
"defiSaver": Object {
52+
"feeRecipients": Array [],
53+
"id": "defiSaver",
54+
"imageUrl": "https://resources.0xtracker.com/logos/defi-saver.png",
55+
"lookupId": 37,
56+
"name": "DeFi Saver",
57+
"slug": "defi-saver",
58+
"url": "https://defisaver.com/",
59+
},
5160
"deversifi": Object {
5261
"feeRecipients": Array [
5362
"0x61b9898c9b60a159fc91ae8026563cd226b7a0c1",
@@ -189,6 +198,15 @@ Object {
189198
"slug": "merchcoins-exchange",
190199
"url": "https://merchcoins.com/",
191200
},
201+
"metamask": Object {
202+
"feeRecipients": Array [],
203+
"id": "metamask",
204+
"imageUrl": "https://resources.0xtracker.com/logos/metamask.png",
205+
"lookupId": 36,
206+
"name": "MetaMask",
207+
"slug": "metamask",
208+
"url": "https://metamask.io/",
209+
},
192210
"oc2Dex": Object {
193211
"feeRecipients": Array [
194212
"0x1af29de80f743be444aa195e2cae38ee9bc74c4c",

src/relayers/relayer-registry.js

+16
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,20 @@ module.exports = {
312312
feeRecipients: ['0x86003b044f70dac0abc80ac8957305b6370893ed'],
313313
url: 'https://matcha.xyz',
314314
},
315+
metamask: {
316+
imageUrl: 'https://resources.0xtracker.com/logos/metamask.png',
317+
lookupId: 36,
318+
name: 'MetaMask',
319+
slug: 'metamask',
320+
feeRecipients: [],
321+
url: 'https://metamask.io/',
322+
},
323+
defiSaver: {
324+
imageUrl: 'https://resources.0xtracker.com/logos/defi-saver.png',
325+
lookupId: 37,
326+
name: 'DeFi Saver',
327+
slug: 'defi-saver',
328+
feeRecipients: [],
329+
url: 'https://defisaver.com/',
330+
},
315331
};

src/relayers/resolve-relayer.js

+20
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,26 @@ const resolveRelayer = metadata => {
3737
return relayers.radarRelay;
3838
}
3939

40+
// TODO: Remove this temporary hack once apps feature is in place
41+
if (
42+
(affiliateAddress === '0xfee5f86a8737ff816ba3f6adb5fc6027c1cb3f75' && // MetaMask
43+
feeRecipient === '0x1000000000000000000000000000000000000011') || // 0x API
44+
(affiliateAddress === '0xfee5f86a8737ff816ba3f6adb5fc6027c1cb3f75' && // MetaMask
45+
matchingRelayer === undefined)
46+
) {
47+
return relayers.metamask;
48+
}
49+
50+
// TODO: Remove this temporary hack once apps feature is in place
51+
if (
52+
(affiliateAddress === '0x322d58b9e75a6918f7e7849aee0ff09369977e08' && // DeFi Saver
53+
feeRecipient === '0x1000000000000000000000000000000000000011') || // 0x API
54+
(affiliateAddress === '0x322d58b9e75a6918f7e7849aee0ff09369977e08' && // DeFi Saver
55+
matchingRelayer === undefined)
56+
) {
57+
return relayers.defiSaver;
58+
}
59+
4060
return matchingRelayer || null;
4161
};
4262

0 commit comments

Comments
 (0)