Skip to content

Commit

Permalink
fix: Merge branch 'main' into deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammeds1992 committed Sep 29, 2023
2 parents ccdabb8 + 23fa1bc commit f9bb113
Show file tree
Hide file tree
Showing 17 changed files with 128 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ const NETWORK_MAPPING: NwMappingType = {
10: 'OPTIMISM_MAINNET',
1442: 'POLYGON_ZK_EVM_TESTNET',
1101: 'POLYGON_ZK_EVM_MAINNET',
421613: "ARBITRUM_TESTNET",
42161: "ARBITRUMONE_MAINNET"
};

const injected = new InjectedConnector({
supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101],
supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161],
});

const ConnectWrapper = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/sdk-frontend-react/src/app/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Constants = {
},
DEFAULT_CHAIN_ID: 5,
DEV_CHAIN_ID: 99999,
NON_ETH_CHAINS: [137, 80001, 56, 97, 10, 420, 1442, 1101],
NON_ETH_CHAINS: [137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161],
ETH_CHAINS: [1, 5],
};

Expand Down
2 changes: 1 addition & 1 deletion packages/reactnative/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,5 @@ where
| cta | string | Call To Action Link (given during notification creation) |
| image | string | Any media link (given during notification creation) |
| appbot | string | is the notification is from EPNS bot the value is "1" else "0" |
| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_GOERLI", "POLYGON_MAINNET", "POLYGON_TEST_MUMBAI", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "THE_GRAPH" |
| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_GOERLI", "POLYGON_MAINNET", "POLYGON_TEST_MUMBAI", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "ARBITRUM_TESTNET", "ARBITRUMONE_MAINNET", "THE_GRAPH" |
| youTubeAPIKey | string | Your generated Youtube API key |
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import * as React from 'react';
import { SVGProps } from 'react';

const ArbitrumSvgComponent = (props: SVGProps<SVGSVGElement>) => (
<svg
id="Layer_1"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
x="0px"
y="0px"
viewBox="0 0 1080 1218.5"
xmlSpace="preserve"
{...props}
>
<style type="text/css">{'\n\t.st0{fill:#1B4ADD;}\n'}</style>
<g>
<path
className="st0"
d="M541.8,76.4c2.9,0,5.8,0.8,8.4,2.3l446.1,259.5c5.2,3,8.4,8.6,8.3,14.5l-1.7,516.1c0,6-3.2,11.5-8.4,14.5 l-447.8,256.6c-2.5,1.5-5.5,2.2-8.4,2.2c-2.9,0-5.8-0.8-8.4-2.3L83.8,880.3c-5.2-3-8.4-8.6-8.3-14.5l1.7-516.1 c0-6,3.2-11.5,8.4-14.5L533.4,78.6C535.9,77.1,538.8,76.4,541.8,76.4 M542,1c-15.9-0.1-31.8,4-46.1,12.2L48.1,269.7 c-28.6,16.4-46.2,46.7-46.4,79.7L0,865.5c-0.1,32.9,17.4,63.4,45.8,80L491.9,1205c14.2,8.3,30.1,12.4,46.1,12.5 c15.9,0.1,31.8-4,46.1-12.2l447.8-256.6c28.6-16.4,46.2-46.7,46.4-79.7L1080,353c0.1-32.9-17.4-63.4-45.8-80L588.1,13.5 C573.8,5.2,557.9,1,542,1L542,1z"
/>
<path
className="st0"
d="M632.4,282.3H567c-4.9,0-9.3,3.1-11,7.7L345.8,866.4c-1.4,3.8,1.4,7.8,5.5,7.8h65.4c4.9,0,9.3-3.1,11-7.7 l210.3-576.5C639.2,286.3,636.4,282.3,632.4,282.3z M518,282.3h-65.4c-4.9,0-9.3,3.1-11,7.7L231.4,866.4c-1.4,3.8,1.4,7.8,5.5,7.8 h65.4c4.9,0,9.3-3.1,11-7.7l210.3-576.5C524.9,286.3,522.1,282.3,518,282.3z M602.7,505.8c-1.9-5.1-9.1-5.1-11,0l-34,93.2 c-0.9,2.6-0.9,5.4,0,8l94.7,259.6c1.7,4.6,6.1,7.7,11,7.7h65.4c4.1,0,6.9-4,5.5-7.8L602.7,505.8z M848.6,866.4L659.9,349.1 c-1.9-5.1-9.1-5.1-11,0l-34,93.2c-0.9,2.6-0.9,5.4,0,8l151.9,416.3c1.7,4.6,6.1,7.7,11,7.7h65.4C847.1,874.2,850,870.2,848.6,866.4 z"
/>
</g>
</svg>
);

export default ArbitrumSvgComponent;
16 changes: 13 additions & 3 deletions packages/reactnative/src/lib/components/chainDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ import PolygonSvg from "./polygonSVG";
import GraphSvg from "./thegraphSVG";
import BscSvg from "./bscSVG";
import OptimismSvg from "./optimismSVG"
import PolygonZKEVMSvg from "./polygonZKEVMSVG";
import PolygonZKEVMSvg from "./polygonZkEVMSVG";
import ArbitrumSvgComponent from "./arbitrumSVG";

export default {
type Network = {
label: string;
Icon: any;
};

const networks: Record<string, Network> = {
ETH_TEST_GOERLI: { label: "ETHEREUM GOERLI", Icon: EthereumSvg },
ETH_MAINNET: { label: "ETHEREUM MAINNET", Icon: EthereumSvg },
POLYGON_TEST_MUMBAI: { label: "POLYGON MUMBAI", Icon: PolygonSvg },
Expand All @@ -16,5 +22,9 @@ export default {
OPTIMISM_MAINNET: { label: "OPTIMISM MAINNET", Icon: OptimismSvg },
POLYGON_ZK_EVM_TESTNET: {label:"POLYGON_ZK_EVM_TESTNET",Icon: PolygonZKEVMSvg},
POLYGON_ZK_EVM_MAINNET: {label:"POLYGON_ZK_EVM_MAINNET",Icon: PolygonZKEVMSvg},
ARBITRUM_TESTNET: {label:"ARBITRUM_TESTNET",Icon: ArbitrumSvgComponent},
ARBITRUMONE_MAINNET: {label: "ARBITRUMONE_MAINNET", Icon: ArbitrumSvgComponent},
THE_GRAPH: { label: "THE GRAPH", Icon: GraphSvg },
};
};

export default networks
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ImageDownloadWithIndicator, VideoDownloadWithIndicator } from '../load


// ================= Define types
export type chainNameType = "ETH_TEST_GOERLI" | "POLYGON_TEST_MUMBAI" | "ETH_MAINNET" | "POLYGON_MAINNET" | "BSC_MAINNET" | "BSC_TESTNET" | "OPTIMISM_MAINNET" | "OPTIMISM_TESTNET" | "POLYGON_ZK_EVM_TESTNET" | "POLYGON_ZK_EVM_MAINNET" | "THE_GRAPH" | undefined;
export type chainNameType = "ETH_TEST_GOERLI" | "POLYGON_TEST_MUMBAI" | "ETH_MAINNET" | "POLYGON_MAINNET" | "BSC_MAINNET" | "BSC_TESTNET" | "OPTIMISM_MAINNET" | "OPTIMISM_TESTNET" | "POLYGON_ZK_EVM_TESTNET" | "POLYGON_ZK_EVM_MAINNET" | "ARBITRUMONE_MAINNET" | "ARBITRUM_TESTNET" | "THE_GRAPH" | undefined;

const botImageLocalPath = '../../assets/epnsbot.png';

Expand Down
2 changes: 2 additions & 0 deletions packages/restapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ Binance Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Binance Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Optimism Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Optimism Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Arbitrum Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Arbitrum One Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
```

# SDK Features
Expand Down
26 changes: 25 additions & 1 deletion packages/restapi/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ const BLOCKCHAIN_NETWORK = {
OPTIMISM_MAINNET: 'eip155:10',
POLYGON_ZK_EVM_TESTNET: 'eip155:1442',
POLYGON_ZK_EVM_MAINNET: 'eip155:1101',
ARBITRUM_TESTNET: 'eip155:421613',
ARBITRUMONE_MAINNET: "eip155:42161"
};

export type ALIAS_CHAIN = 'POLYGON' | 'BSC' | 'OPTIMISM' | 'POLYGONZKEVM';
export type ALIAS_CHAIN = 'POLYGON' | 'BSC' | 'OPTIMISM' | 'POLYGONZKEVM' | "ARBITRUMONE";

export const ALIAS_CHAIN_ID = {
POLYGON: {
Expand All @@ -54,6 +56,12 @@ export const ALIAS_CHAIN_ID = {
[ENV.DEV]: 1442,
[ENV.LOCAL]: 420,
},
ARBITRUMONE: {
[ENV.PROD]: 42161,
[ENV.STAGING]: 421613,
[ENV.DEV]: 421613,
[ENV.LOCAL]: 421613,
}
};

export interface ConfigType {
Expand Down Expand Up @@ -83,6 +91,10 @@ const CONFIG = {
API_BASE_URL: API_BASE_URL[ENV.PROD],
EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa',
},
[BLOCKCHAIN_NETWORK.ARBITRUMONE_MAINNET]: {
API_BASE_URL: API_BASE_URL[ENV.PROD],
EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa',
},
},
[ENV.STAGING]: {
[BLOCKCHAIN_NETWORK.ETH_GOERLI]: {
Expand All @@ -105,6 +117,10 @@ const CONFIG = {
API_BASE_URL: API_BASE_URL[ENV.STAGING],
EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa',
},
[BLOCKCHAIN_NETWORK.ARBITRUM_TESTNET]: {
API_BASE_URL: API_BASE_URL[ENV.STAGING],
EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa',
},
},
[ENV.DEV]: {
[BLOCKCHAIN_NETWORK.ETH_GOERLI]: {
Expand All @@ -127,6 +143,10 @@ const CONFIG = {
API_BASE_URL: API_BASE_URL[ENV.DEV],
EPNS_COMMUNICATOR_CONTRACT: '0x630b152e4185c63D7177c656b56b26f878C61572',
},
[BLOCKCHAIN_NETWORK.ARBITRUM_TESTNET]: {
API_BASE_URL: API_BASE_URL[ENV.STAGING],
EPNS_COMMUNICATOR_CONTRACT: '0x2f6aE0907116A2c50D712e78b48D874fadeB6850',
},
},
[ENV.LOCAL]: {
[BLOCKCHAIN_NETWORK.ETH_GOERLI]: {
Expand All @@ -149,6 +169,10 @@ const CONFIG = {
API_BASE_URL: API_BASE_URL[ENV.DEV],
EPNS_COMMUNICATOR_CONTRACT: '0x630b152e4185c63D7177c656b56b26f878C61572',
},
[BLOCKCHAIN_NETWORK.ARBITRUM_TESTNET]: {
API_BASE_URL: API_BASE_URL[ENV.STAGING],
EPNS_COMMUNICATOR_CONTRACT: '0x2f6aE0907116A2c50D712e78b48D874fadeB6850',
},
},
};

Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Constants = {
},
DEFAULT_CHAIN_ID: 5,
DEV_CHAIN_ID: 99999,
NON_ETH_CHAINS: [137, 80001, 56, 97, 10, 420, 1442, 1101],
NON_ETH_CHAINS: [137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161],
ETH_CHAINS: [1, 5],
ENC_TYPE_V1: 'x25519-xsalsa20-poly1305',
ENC_TYPE_V2: 'aes256GcmHkdfSha256',
Expand Down
4 changes: 4 additions & 0 deletions packages/restapi/src/lib/payloads/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const CHAIN_ID_TO_SOURCE: ChainIdToSourceType = {
420: 'OPTIMISM_TESTNET',
1442: 'POLYGON_ZK_EVM_TESTNET',
1101: 'POLYGON_ZK_EVM_MAINNET',
421613: "ARBITRUM_TESTNET",
42161: "ARBITRUMONE_MAINNET"
};

export const SOURCE_TYPES = {
Expand All @@ -26,6 +28,8 @@ export const SOURCE_TYPES = {
OPTIMISM_TESTNET: 'OPTIMISM_TESTNET',
POLYGON_ZK_EVM_TESTNET: 'POLYGON_ZK_EVM_TESTNET',
POLYGON_ZK_EVM_MAINNET: 'POLYGON_ZK_EVM_MAINNET',
ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
ARBITRUMONE_MAINNET: "ARBITRUMONE_MAINNET",
THE_GRAPH: 'THE_GRAPH',
PUSH_VIDEO: 'PUSH_VIDEO',
};
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/payloads/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export function getSource(

export function getCAIPFormat(chainId: number, address: string) {
// EVM based chains
if ([1, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101].includes(chainId)) {
if ([1, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161].includes(chainId)) {
return `eip155:${chainId}:${address}`;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/uiweb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ where
| cta | string | Call To Action Link (given during notification creation) |
| image | string | Any media link (given during notification creation) |
| url | string | Channel Link (given during channel setup) |
| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_GOERLI", "POLYGON_MAINNET", "POLYGON_TEST_MUMBAI", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "THE_GRAPH" |
| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_GOERLI", "POLYGON_MAINNET", "POLYGON_TEST_MUMBAI", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "ARBITRUM_TESTNET", "ARBITRUMONE_MAINNET", "THE_GRAPH" |
| theme | string | 'light' or 'dark' (customization to be given by the dApp) |
| customTheme | INotificationItemTheme | custom theme object for the component |
| isSpam | boolean | whether a spam notification or not |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ const NETWORK_MAPPING: NwMappingType = {
10: 'OPTIMISM_MAINNET',
1442: 'POLYGON_ZK_EVM_TESTNET',
1101: 'POLYGON_ZK_EVM_MAINNET',
421613: "ARBITRUM_TESTNET",
42161: "ARBITRUMONE_MAINNET"
};

const injected = new InjectedConnector({
supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101],
supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161],
});

const ConnectWrapper = styled.div`
Expand Down
11 changes: 10 additions & 1 deletion packages/uiweb/src/lib/components/notification/chainDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { BSCSvg } from "../../icons/BSCSvg";
import { OptimismSvg } from "../../icons/OptimismSvg";
import { PolygonzkevmSvg } from "../../icons/PolygonzkevmSvg";
import { TheGraphSvg } from "../../icons/TheGraphSvg";
import { ReactElement } from "react";
import { ArbitrumSvg } from "../../icons/ArbitrumSvg"

const createSVGIcon = (element:any, chainName: string) => {
return (
Expand Down Expand Up @@ -58,5 +58,14 @@ export default {
label: 'POLYGON ZK EVM MAINNET',
icon: createSVGIcon(<PolygonzkevmSvg/>, 'Polygon ZK EVM Mainnet'),
},

ARBITRUMONE_MAINNET: {
label: 'ARBITRUMONE MAINNET',
icon: createSVGIcon(<ArbitrumSvg/>, 'Arbitrum Mainnet'),
},
ARBITRUM_TESTNET: {
label: 'ARBITRUMONE MAINNET',
icon: createSVGIcon(<ArbitrumSvg/>, 'Arbitrum Testnet'),
},
THE_GRAPH: { label: 'THE GRAPH', icon: createSVGIcon(<TheGraphSvg/>, 'The Graph') },
};
2 changes: 2 additions & 0 deletions packages/uiweb/src/lib/components/notification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export type chainNameType =
| 'OPTIMISM_TESTNET'
| 'POLYGON_ZK_EVM_TESTNET'
| 'POLYGON_ZK_EVM_MAINNET'
| 'ARBITRUMONE_MAINNET'
| 'ARBITRUM_TESTNET'
| 'THE_GRAPH'
| undefined;

Expand Down
12 changes: 8 additions & 4 deletions packages/uiweb/src/lib/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,29 @@ export const allowedNetworks = {
1, //for ethereum mainnet
137, //for polygon mainnet
56, // for bnb mainnet
// 10 // for optimism mainnet
10, // for optimism mainnet
42161 // for arbitrum mainnet
],
'dev' : [
5, // for eth goerli
80001, //for mumbai polygon
97, // bnb testnet
420 // optimism goerli testnet
420, // optimism goerli testnet
421613 // for arbitrum testnet
],
'staging' : [
// 42, //for kovan
5, // for goerli
80001, //for mumbai polygon
97 // bnb testnet
97, // bnb testnet
421613 // for arbitrum testnet
],
'local' :[
5, // for eth goerli
80001, //for mumbai polygon
97, // bnb testnet
420 // optimism goerli testnet
420, // optimism goerli testnet
421613 // for arbitrum testnet
]
}

Expand Down
23 changes: 23 additions & 0 deletions packages/uiweb/src/lib/icons/ArbitrumSvg.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from 'react';

export const ArbitrumSvg = () => (
<svg
id="Layer_1"
xmlns="http://www.w3.org/2000/svg"
x={0}
y={0}
viewBox="0 0 1080 1218.5"
xmlSpace="preserve"
>
<style>{'.st0{fill:#1b4add}'}</style>
<path
className="st0"
d="M541.8 76.4c2.9 0 5.8.8 8.4 2.3l446.1 259.5c5.2 3 8.4 8.6 8.3 14.5l-1.7 516.1c0 6-3.2 11.5-8.4 14.5l-447.8 256.6c-2.5 1.5-5.5 2.2-8.4 2.2-2.9 0-5.8-.8-8.4-2.3L83.8 880.3c-5.2-3-8.4-8.6-8.3-14.5l1.7-516.1c0-6 3.2-11.5 8.4-14.5L533.4 78.6c2.5-1.5 5.4-2.2 8.4-2.2M542 1c-15.9-.1-31.8 4-46.1 12.2L48.1 269.7c-28.6 16.4-46.2 46.7-46.4 79.7L0 865.5c-.1 32.9 17.4 63.4 45.8 80L491.9 1205c14.2 8.3 30.1 12.4 46.1 12.5 15.9.1 31.8-4 46.1-12.2l447.8-256.6c28.6-16.4 46.2-46.7 46.4-79.7l1.7-516c.1-32.9-17.4-63.4-45.8-80L588.1 13.5C573.8 5.2 557.9 1 542 1z"
/>
<path
className="st0"
d="M632.4 282.3H567c-4.9 0-9.3 3.1-11 7.7L345.8 866.4c-1.4 3.8 1.4 7.8 5.5 7.8h65.4c4.9 0 9.3-3.1 11-7.7L638 290c1.2-3.7-1.6-7.7-5.6-7.7zm-114.4 0h-65.4c-4.9 0-9.3 3.1-11 7.7L231.4 866.4c-1.4 3.8 1.4 7.8 5.5 7.8h65.4c4.9 0 9.3-3.1 11-7.7L523.6 290c1.3-3.7-1.5-7.7-5.6-7.7zm84.7 223.5c-1.9-5.1-9.1-5.1-11 0l-34 93.2c-.9 2.6-.9 5.4 0 8l94.7 259.6c1.7 4.6 6.1 7.7 11 7.7h65.4c4.1 0 6.9-4 5.5-7.8L602.7 505.8zm245.9 360.6L659.9 349.1c-1.9-5.1-9.1-5.1-11 0l-34 93.2c-.9 2.6-.9 5.4 0 8l151.9 416.3c1.7 4.6 6.1 7.7 11 7.7h65.4c3.9-.1 6.8-4.1 5.4-7.9z"
/>
</svg>
);

0 comments on commit f9bb113

Please sign in to comment.