@abtnode/blocklet-services 1.16.8-beta-0c0c5eb2 → 1.16.8-beta-b3039c78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/cache.js +32 -1
- package/api/emails/components/actions.js +23 -0
- package/api/emails/components/article.js +9 -0
- package/api/emails/components/asset.js +29 -0
- package/api/emails/components/attachments.js +55 -0
- package/api/emails/components/compose.js +27 -0
- package/api/emails/components/content.js +22 -0
- package/api/emails/components/copyright.js +14 -0
- package/api/emails/components/dapp.js +8 -0
- package/api/emails/components/footer.js +24 -0
- package/api/emails/components/header.js +20 -0
- package/api/emails/components/layout.js +15 -0
- package/api/emails/components/token.js +31 -0
- package/api/emails/components/transaction.js +16 -0
- package/api/emails/libs/config.js +256 -0
- package/api/emails/libs/constant.js +112 -0
- package/api/emails/libs/explorer-url.js +52 -0
- package/api/emails/libs/func.js +5 -0
- package/api/emails/libs/highlight.js +109 -0
- package/api/emails/libs/util.js +19 -0
- package/api/emails/pages/notification.js +26 -0
- package/api/emails/test.js +166 -0
- package/api/emails/types.js +2 -0
- package/api/index.js +1 -0
- package/api/libs/email.js +68 -0
- package/api/services/auth/connect/receive-transfer-app-owner.js +1 -1
- package/api/socket/channel/did.js +44 -26
- package/build/asset-manifest.json +11 -11
- package/build/index.html +1 -1
- package/build/static/css/{286.97b3dab6.chunk.css → 290.07ab3f1e.chunk.css} +1 -1
- package/build/static/js/{286.af946efa.chunk.js → 290.8692063d.chunk.js} +3 -3
- package/build/static/js/343.6fc2089d.chunk.js +2 -0
- package/build/static/js/460.df719a3e.chunk.js +2 -0
- package/build/static/js/main.94c49b7d.js +3 -0
- package/package.json +29 -22
- package/build/static/js/343.0b145b64.chunk.js +0 -2
- package/build/static/js/460.4763afe0.chunk.js +0 -2
- package/build/static/js/main.0006cb61.js +0 -3
- /package/build/static/js/{286.af946efa.chunk.js.LICENSE.txt → 290.8692063d.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.0006cb61.js.LICENSE.txt → main.94c49b7d.js.LICENSE.txt} +0 -0
package/api/cache.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const LRU = require('lru-cache');
|
|
2
|
+
const nodemailer = require('nodemailer');
|
|
2
3
|
const getBlockletInfo = require('@blocklet/meta/lib/info');
|
|
3
4
|
const md5 = require('@abtnode/util/lib/md5');
|
|
4
5
|
|
|
@@ -25,6 +26,9 @@ const keyFns = {
|
|
|
25
26
|
serviceConfig(ruleId, serviceName) {
|
|
26
27
|
return md5(`${ruleId}:${serviceName}`);
|
|
27
28
|
},
|
|
29
|
+
notificationConfig(did) {
|
|
30
|
+
return md5(`${did}:notificationConfig`);
|
|
31
|
+
},
|
|
28
32
|
};
|
|
29
33
|
|
|
30
34
|
cache.getNodeInfo = async ({ node }) => {
|
|
@@ -55,7 +59,7 @@ cache.getBlocklet = async ({ did, node, force, context }) => {
|
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
const blocklet = await node.getBlocklet({ did
|
|
62
|
+
const blocklet = await node.getBlocklet({ did }, context);
|
|
59
63
|
if (blocklet) {
|
|
60
64
|
cache.set(cacheKey, blocklet);
|
|
61
65
|
}
|
|
@@ -81,6 +85,33 @@ cache.getBlockletInfo = async ({ did, node, context }) => {
|
|
|
81
85
|
return blockletInfo;
|
|
82
86
|
};
|
|
83
87
|
|
|
88
|
+
cache.getTransport = ({ did, config, force }) => {
|
|
89
|
+
if (!did) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const cacheKey = cache.keyFns.notificationConfig(did);
|
|
94
|
+
|
|
95
|
+
if (!force) {
|
|
96
|
+
const exist = cache.get(cacheKey);
|
|
97
|
+
if (exist) {
|
|
98
|
+
return exist;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const transporter = nodemailer.createTransport({
|
|
103
|
+
host: config.host,
|
|
104
|
+
port: config.port,
|
|
105
|
+
secure: false,
|
|
106
|
+
auth: { user: config.user, pass: config.password },
|
|
107
|
+
});
|
|
108
|
+
if (transporter) {
|
|
109
|
+
cache.set(cacheKey, transporter);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return transporter;
|
|
113
|
+
};
|
|
114
|
+
|
|
84
115
|
cache.keyFns = keyFns;
|
|
85
116
|
|
|
86
117
|
module.exports = cache;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@react-email/components");
|
|
5
|
+
function Actions({ actions, }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Section, Object.assign({ style: actionsStye }, { children: actions.map((item) => ((0, jsx_runtime_1.jsx)(components_1.Button, Object.assign({ href: item.link, target: "_blank", pX: 12, pY: 6, style: actionStyle }, { children: item.title || item.name })))) })));
|
|
7
|
+
}
|
|
8
|
+
exports.default = Actions;
|
|
9
|
+
const actionsStye = {
|
|
10
|
+
margin: '20px -8px 0px',
|
|
11
|
+
};
|
|
12
|
+
const actionStyle = {
|
|
13
|
+
color: '#4598fa',
|
|
14
|
+
fontSize: 14,
|
|
15
|
+
border: '1px solid #4598fa',
|
|
16
|
+
display: 'inline-block',
|
|
17
|
+
borderRadius: '4px',
|
|
18
|
+
margin: '8px',
|
|
19
|
+
marginTop: '8px',
|
|
20
|
+
marginBottom: '8px',
|
|
21
|
+
marginLeft: '8px',
|
|
22
|
+
marginRight: '8px',
|
|
23
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@react-email/components");
|
|
5
|
+
function Article({ data, }) {
|
|
6
|
+
const host = new URL(data.url).host;
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: data.url, target: "_blank", style: { textDecoration: 'none', color: 'initial', margin: '1em 0' } }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ style: { color: '#a5a5a5', fontSize: '0.8em' } }, { children: host })), (0, jsx_runtime_1.jsx)(components_1.Text, Object.assign({ style: { margin: 0, color: '#4598fa' } }, { children: data.title })), data.description && (0, jsx_runtime_1.jsx)(components_1.Text, Object.assign({ style: { margin: 0 } }, { children: data.description })), data.image && ((0, jsx_runtime_1.jsx)(components_1.Img, { src: data.image, style: { width: '100%', height: '150px', objectFit: 'contain', objectPosition: 'left' } }))] })));
|
|
8
|
+
}
|
|
9
|
+
exports.default = Article;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@react-email/components");
|
|
5
|
+
function Asset({ locale, data, }) {
|
|
6
|
+
const title = { zh: '接收', en: 'Received' }[locale] || 'Received';
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Section, Object.assign({ style: assetStyle }, { children: [(0, jsx_runtime_1.jsxs)(components_1.Row, Object.assign({ style: titleStyle }, { children: [(0, jsx_runtime_1.jsx)(components_1.Column, { children: title }), (0, jsx_runtime_1.jsxs)(components_1.Column, Object.assign({ align: "right", style: summaryStyle }, { children: ["+", data.amount || 1, " Asset"] }))] })), (0, jsx_runtime_1.jsx)(components_1.Text, Object.assign({ style: remarkStyle }, { children: data.address }))] })));
|
|
8
|
+
}
|
|
9
|
+
exports.default = Asset;
|
|
10
|
+
const assetStyle = {
|
|
11
|
+
backgroundColor: '#f6f6f6',
|
|
12
|
+
borderRadius: '8px',
|
|
13
|
+
paddingLeft: '12px',
|
|
14
|
+
paddingRight: '12px',
|
|
15
|
+
paddingTop: '12px',
|
|
16
|
+
paddingBottom: '12px',
|
|
17
|
+
margin: '1em 0',
|
|
18
|
+
};
|
|
19
|
+
const remarkStyle = {
|
|
20
|
+
color: '#9397a1',
|
|
21
|
+
fontSize: '12px',
|
|
22
|
+
margin: 0,
|
|
23
|
+
};
|
|
24
|
+
const summaryStyle = {
|
|
25
|
+
color: '#49c3ad',
|
|
26
|
+
};
|
|
27
|
+
const titleStyle = {
|
|
28
|
+
marginBottom: '6px',
|
|
29
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const components_1 = require("@react-email/components");
|
|
8
|
+
const token_1 = __importDefault(require("./token"));
|
|
9
|
+
const asset_1 = __importDefault(require("./asset"));
|
|
10
|
+
const compose_1 = __importDefault(require("./compose"));
|
|
11
|
+
const transaction_1 = __importDefault(require("./transaction"));
|
|
12
|
+
const dapp_1 = __importDefault(require("./dapp"));
|
|
13
|
+
const article_1 = __importDefault(require("./article"));
|
|
14
|
+
function Attachments({ locale, severity = 'normal', attachments = [], }) {
|
|
15
|
+
const attachmentList = attachments.map((item) => {
|
|
16
|
+
switch (item.type) {
|
|
17
|
+
case 'text':
|
|
18
|
+
return item.data.type === 'plain' ? ((0, jsx_runtime_1.jsx)(components_1.Text, Object.assign({ style: {
|
|
19
|
+
color: item.data.color || 'initial',
|
|
20
|
+
fontSize: { small: '12px', normal: '14px', large: '16px' }[item.data.size || 'normal'],
|
|
21
|
+
} }, { children: item.data.text }))) : null;
|
|
22
|
+
case 'image':
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Img, { src: item.data.url, alt: item.data.alt, style: { width: '100%', height: '150px', objectFit: 'contain', objectPosition: 'left center' } }));
|
|
24
|
+
case 'token':
|
|
25
|
+
return (0, jsx_runtime_1.jsx)(token_1.default, { data: item.data, locale: locale });
|
|
26
|
+
case 'transaction':
|
|
27
|
+
return (0, jsx_runtime_1.jsx)(transaction_1.default, { data: item.data, locale: locale });
|
|
28
|
+
case 'dapp':
|
|
29
|
+
return (0, jsx_runtime_1.jsx)(dapp_1.default, { data: item.data });
|
|
30
|
+
case 'link':
|
|
31
|
+
return (0, jsx_runtime_1.jsx)(article_1.default, { data: item.data });
|
|
32
|
+
case 'divider':
|
|
33
|
+
return (0, jsx_runtime_1.jsx)(components_1.Hr, {});
|
|
34
|
+
// case 'vc':
|
|
35
|
+
case 'nft':
|
|
36
|
+
return (0, jsx_runtime_1.jsx)(asset_1.default, { data: { address: item.data.did }, locale: locale });
|
|
37
|
+
case 'section':
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(compose_1.default, { data: item.fileds });
|
|
39
|
+
default:
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return (0, jsx_runtime_1.jsx)(components_1.Section, Object.assign({ style: Object.assign(Object.assign({}, attachmentsStyle), { borderColor: map[severity] || map.normal }) }, { children: attachmentList }));
|
|
44
|
+
}
|
|
45
|
+
exports.default = Attachments;
|
|
46
|
+
const map = {
|
|
47
|
+
normal: '#C4C5CA',
|
|
48
|
+
success: '#25C99B',
|
|
49
|
+
error: '#F16E6E',
|
|
50
|
+
warning: '#DE9E37',
|
|
51
|
+
};
|
|
52
|
+
const attachmentsStyle = {
|
|
53
|
+
borderLeft: '2px solid transparent',
|
|
54
|
+
paddingLeft: '20px',
|
|
55
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@react-email/components");
|
|
5
|
+
function ComposeItem({ data, }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Text, Object.assign({ style: {
|
|
7
|
+
color: data.color || 'initial',
|
|
8
|
+
margin: 0,
|
|
9
|
+
} }, { children: data.text })));
|
|
10
|
+
}
|
|
11
|
+
function Compose({ data }) {
|
|
12
|
+
let i = 0;
|
|
13
|
+
let content = [];
|
|
14
|
+
while (i < (data === null || data === void 0 ? void 0 : data.length)) {
|
|
15
|
+
const firstCol = data[i];
|
|
16
|
+
const secondCol = data[i + 1];
|
|
17
|
+
if (firstCol && secondCol) {
|
|
18
|
+
content.push((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(ComposeItem, { data: firstCol.data }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(ComposeItem, { data: secondCol.data }) })] }));
|
|
19
|
+
}
|
|
20
|
+
else if (firstCol) {
|
|
21
|
+
content.push((0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(ComposeItem, { data: firstCol.data }) }) }));
|
|
22
|
+
}
|
|
23
|
+
i += 2;
|
|
24
|
+
}
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)("table", Object.assign({ style: { width: '100%', margin: '1em 0' } }, { children: (0, jsx_runtime_1.jsx)("tbody", { children: content }) })));
|
|
26
|
+
}
|
|
27
|
+
exports.default = Compose;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const components_1 = require("@react-email/components");
|
|
8
|
+
const attachments_1 = __importDefault(require("./attachments"));
|
|
9
|
+
const actions_1 = __importDefault(require("./actions"));
|
|
10
|
+
const highlight_1 = require("../libs/highlight");
|
|
11
|
+
function Content({ title, content, attachments = [], actions = [], style = {}, locale, }) {
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Section, Object.assign({ style: style }, { children: [(0, jsx_runtime_1.jsx)(components_1.Heading, Object.assign({ style: h1 }, { children: title })), content && (0, jsx_runtime_1.jsx)(components_1.Text, { className: "content", dangerouslySetInnerHTML: { __html: (0, highlight_1.toClickableSpan)(content) } }), (0, jsx_runtime_1.jsx)(attachments_1.default, { severity: "success", attachments: attachments, locale: locale }), (0, jsx_runtime_1.jsx)(actions_1.default, { actions: actions })] })));
|
|
13
|
+
}
|
|
14
|
+
exports.default = Content;
|
|
15
|
+
const h1 = {
|
|
16
|
+
color: '#333',
|
|
17
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
|
|
18
|
+
fontSize: '24px',
|
|
19
|
+
fontWeight: 'bold',
|
|
20
|
+
margin: '40px 0',
|
|
21
|
+
padding: '0',
|
|
22
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@react-email/components");
|
|
5
|
+
const startYear = 2017;
|
|
6
|
+
const endYear = new Date().getFullYear();
|
|
7
|
+
function Copyright() {
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Text, Object.assign({ style: {
|
|
9
|
+
textAlign: 'center',
|
|
10
|
+
color: '#898989',
|
|
11
|
+
fontSize: 12,
|
|
12
|
+
} }, { children: ["\u00A9 ", startYear, "-", endYear, " ArcBlock, Inc. All Rights Reserved."] })));
|
|
13
|
+
}
|
|
14
|
+
exports.default = Copyright;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@react-email/components");
|
|
5
|
+
function DAPP({ data, }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: data.url, target: "_blank", style: { display: 'flex', textDecoration: 'none', color: 'initial', margin: '1em 0' } }, { children: [(0, jsx_runtime_1.jsx)(components_1.Img, { src: data.logo, width: 50, height: 50 }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ style: { flex: 1, marginLeft: '10px' } }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ style: { marginBottom: '6px' } }, { children: data.title })), (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { color: '#a5a5a5', fontSize: '0.8em' } }, { children: data.appDID }))] }))] })));
|
|
7
|
+
}
|
|
8
|
+
exports.default = DAPP;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const components_1 = require("@react-email/components");
|
|
8
|
+
const copyright_1 = __importDefault(require("./copyright"));
|
|
9
|
+
function Footer({ showLogo = false, showCopyright = false, showBlocklet = true, appInfo, }) {
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Section, { children: [showLogo && (0, jsx_runtime_1.jsx)(components_1.Img, { src: appInfo.logo, width: "32", height: "32", alt: appInfo.title }), showBlocklet && ((0, jsx_runtime_1.jsxs)(components_1.Text, Object.assign({ style: footer }, { children: [(0, jsx_runtime_1.jsx)(components_1.Link, Object.assign({ href: appInfo.url, target: "_blank", style: Object.assign(Object.assign({}, link), { color: '#898989' }) }, { children: appInfo.title })), (0, jsx_runtime_1.jsx)("br", {}), appInfo.description] }))), showCopyright && (0, jsx_runtime_1.jsx)(copyright_1.default, {})] }));
|
|
11
|
+
}
|
|
12
|
+
exports.default = Footer;
|
|
13
|
+
const footer = {
|
|
14
|
+
color: '#898989',
|
|
15
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
|
|
16
|
+
fontSize: '12px',
|
|
17
|
+
lineHeight: '22px',
|
|
18
|
+
};
|
|
19
|
+
const link = {
|
|
20
|
+
color: '#2754C5',
|
|
21
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
|
|
22
|
+
fontSize: '14px',
|
|
23
|
+
textDecoration: 'underline',
|
|
24
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
+
const components_1 = require("@react-email/components");
|
|
16
|
+
function Header(_a) {
|
|
17
|
+
var { appInfo } = _a, props = __rest(_a, ["appInfo"]);
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Section, Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(components_1.Img, { src: appInfo.logo, height: "80", alt: appInfo.title }) })));
|
|
19
|
+
}
|
|
20
|
+
exports.default = Header;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@react-email/components");
|
|
5
|
+
function Layout({ children, mainStyle = {}, containerStyle = {}, }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Html, { children: [(0, jsx_runtime_1.jsx)(components_1.Head, { children: (0, jsx_runtime_1.jsx)("title", { children: "My email title" }) }), (0, jsx_runtime_1.jsx)(components_1.Body, Object.assign({ style: Object.assign(Object.assign({}, main), mainStyle) }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: Object.assign(Object.assign({}, main), mainStyle) }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { padding: '20px' } }, { children: (0, jsx_runtime_1.jsx)(components_1.Container, Object.assign({ style: Object.assign(Object.assign({}, container), containerStyle) }, { children: (0, jsx_runtime_1.jsx)("div", { children: children }) })) })) })) }))] }));
|
|
7
|
+
}
|
|
8
|
+
exports.default = Layout;
|
|
9
|
+
const main = {
|
|
10
|
+
backgroundColor: '#f2f2f2',
|
|
11
|
+
};
|
|
12
|
+
const container = {
|
|
13
|
+
margin: '0 auto',
|
|
14
|
+
maxWidth: '50em',
|
|
15
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@react-email/components");
|
|
5
|
+
function Token({ locale, data, }) {
|
|
6
|
+
const showAddress = data.address.slice(0, 4) + '...' + data.address.slice(-4);
|
|
7
|
+
const title = { zh: '接收', en: 'Received' }[locale] || 'Received';
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Section, Object.assign({ style: assetStyle }, { children: [(0, jsx_runtime_1.jsxs)(components_1.Row, Object.assign({ style: titleStyle }, { children: [(0, jsx_runtime_1.jsx)(components_1.Column, { children: title }), (0, jsx_runtime_1.jsxs)(components_1.Column, Object.assign({ align: "right", style: summaryStyle }, { children: ["+", data.amount, " ", data.symbol] }))] })), (0, jsx_runtime_1.jsxs)(components_1.Text, Object.assign({ style: remarkStyle }, { children: ["from ", showAddress] }))] })));
|
|
9
|
+
}
|
|
10
|
+
exports.default = Token;
|
|
11
|
+
const assetStyle = {
|
|
12
|
+
backgroundColor: '#f6f6f6',
|
|
13
|
+
borderRadius: '8px',
|
|
14
|
+
paddingLeft: '12px',
|
|
15
|
+
paddingRight: '12px',
|
|
16
|
+
paddingTop: '12px',
|
|
17
|
+
paddingBottom: '12px',
|
|
18
|
+
margin: '1em 0',
|
|
19
|
+
};
|
|
20
|
+
const remarkStyle = {
|
|
21
|
+
color: '#9397a1',
|
|
22
|
+
fontSize: '12px',
|
|
23
|
+
margin: 0,
|
|
24
|
+
};
|
|
25
|
+
const summaryStyle = {
|
|
26
|
+
color: '#49c3ad',
|
|
27
|
+
// float: 'right',
|
|
28
|
+
};
|
|
29
|
+
const titleStyle = {
|
|
30
|
+
marginBottom: '6px',
|
|
31
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
function Transaction({ locale, data, }) {
|
|
5
|
+
const chainMap = {
|
|
6
|
+
beta: 'beta.abtnetwork.io',
|
|
7
|
+
main: 'main.abtnetwork.io',
|
|
8
|
+
};
|
|
9
|
+
const host = 'explorer.arcblockio.cn';
|
|
10
|
+
const chianHost = chainMap[data.chainId] || host;
|
|
11
|
+
const url = `https://${chianHost}/explorer/txs/${data.hash}`;
|
|
12
|
+
const title = { zh: '交易详情', en: 'Transaction Details' }[locale] || 'Transaction Details';
|
|
13
|
+
const subTitle = { zh: '交易哈希', en: 'Transaction Hash' }[locale] || 'Transaction Hash';
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: url, target: "_blank", style: { margin: '1em 0', textDecoration: 'none', color: 'initial' } }, { children: [(0, jsx_runtime_1.jsx)("h6", Object.assign({ style: { color: '#a5a5a5', margin: 0 } }, { children: host })), (0, jsx_runtime_1.jsx)("p", Object.assign({ style: { color: '#4598fa', margin: '6px 0' } }, { children: title })), (0, jsx_runtime_1.jsxs)("div", { children: [subTitle, ": ", data.hash] })] })));
|
|
15
|
+
}
|
|
16
|
+
exports.default = Transaction;
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getConfigByChainId = exports.arcChainConfig = exports.evmConfig = exports.ETHEREUM_CLASSIC_MORDOR_CHAIN = exports.ETHEREUM_CLASSIC_CHAIN = exports.ARBITRUM_TEST_CHAIN = exports.ARBITRUM_CHAIN = exports.ETHEREUM_FAIR_CHAIN = exports.BINANCE_TEST_CHAIN = exports.BINANCE_CHAIN = exports.KOVAN_CHAIN = exports.GOERLI_CHAIN = exports.RINKEBY_CHAIN = exports.ROPSTEN_CHAIN = exports.ETHEREUM_CHAIN = exports.EVM_PREFIX = exports.CHAIN = void 0;
|
|
4
|
+
const constant_1 = require("./constant");
|
|
5
|
+
// import ABTIcon from 'cryptocurrency-icons/128/color/abt.png';
|
|
6
|
+
// const ETCIcon = 'https://s2.coinmarketcap.com/static/img/coins/128x128/1321.png';
|
|
7
|
+
function generateEVMChain({ chainId, chainName, symbol, decimal, defaultRPC, explorer, isTest, canRemove, networkName, icon = '', host, consensusVersion, endpoints = [], }) {
|
|
8
|
+
return {
|
|
9
|
+
chainId,
|
|
10
|
+
chainName,
|
|
11
|
+
symbol,
|
|
12
|
+
decimal,
|
|
13
|
+
defaultRPC,
|
|
14
|
+
explorer,
|
|
15
|
+
isTest,
|
|
16
|
+
canRemove,
|
|
17
|
+
networkName,
|
|
18
|
+
icon,
|
|
19
|
+
host,
|
|
20
|
+
consensusVersion,
|
|
21
|
+
endpoints: endpoints.length ? endpoints : [defaultRPC],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.CHAIN = {
|
|
25
|
+
EthereumMainnet: 'EthereumMainnet',
|
|
26
|
+
1: 'EthereumMainnet',
|
|
27
|
+
Ropsten: 'Ropsten',
|
|
28
|
+
3: 'Ropsten',
|
|
29
|
+
Rinkeby: 'Rinkeby',
|
|
30
|
+
4: 'Rinkeby',
|
|
31
|
+
Goerli: 'Goerli',
|
|
32
|
+
5: 'Goerli',
|
|
33
|
+
Kovan: 'Kovan',
|
|
34
|
+
42: 'Kovan',
|
|
35
|
+
BSC: 'BSC',
|
|
36
|
+
56: 'BSC',
|
|
37
|
+
BSCTestnet: 'BSCTestnet',
|
|
38
|
+
97: 'BSCTestnet',
|
|
39
|
+
EthereumClassic: 'EthereumClassic',
|
|
40
|
+
61: 'EthereumClassic',
|
|
41
|
+
EthereumClassicMordor: 'EthereumClassicMordor',
|
|
42
|
+
63: 'EthereumClassicMordor',
|
|
43
|
+
EthereumFair: 'EthereumFair',
|
|
44
|
+
513100: 'EthereumFair',
|
|
45
|
+
Arbitrum: 'Arbitrum',
|
|
46
|
+
42161: 'Arbitrum',
|
|
47
|
+
ArbitrumTestnet: 'ArbitrumTestnet',
|
|
48
|
+
421611: 'ArbitrumTestnet',
|
|
49
|
+
};
|
|
50
|
+
exports.EVM_PREFIX = 'evm-';
|
|
51
|
+
exports.ETHEREUM_CHAIN = `${exports.EVM_PREFIX}1`;
|
|
52
|
+
exports.ROPSTEN_CHAIN = `${exports.EVM_PREFIX}3`;
|
|
53
|
+
exports.RINKEBY_CHAIN = `${exports.EVM_PREFIX}4`;
|
|
54
|
+
exports.GOERLI_CHAIN = `${exports.EVM_PREFIX}5`;
|
|
55
|
+
exports.KOVAN_CHAIN = `${exports.EVM_PREFIX}42`;
|
|
56
|
+
exports.BINANCE_CHAIN = `${exports.EVM_PREFIX}56`;
|
|
57
|
+
exports.BINANCE_TEST_CHAIN = `${exports.EVM_PREFIX}97`;
|
|
58
|
+
exports.ETHEREUM_FAIR_CHAIN = `${exports.EVM_PREFIX}513100`;
|
|
59
|
+
exports.ARBITRUM_CHAIN = `${exports.EVM_PREFIX}42161`;
|
|
60
|
+
exports.ARBITRUM_TEST_CHAIN = `${exports.EVM_PREFIX}421611`;
|
|
61
|
+
exports.ETHEREUM_CLASSIC_CHAIN = `${exports.EVM_PREFIX}61`;
|
|
62
|
+
exports.ETHEREUM_CLASSIC_MORDOR_CHAIN = `${exports.EVM_PREFIX}63`;
|
|
63
|
+
const QUICK_NODE_KEY_TEST = '5e624de4f2e0d168d3b894131df06fb1b5cb288e';
|
|
64
|
+
const ARCHEMY_KEY_TEST = 'qalBfUm3aQWUb9CyJWy0AunAMkYWTQKN';
|
|
65
|
+
const QUICK_NODE_KEY_MAIN = '50adb12d647f7abc6ac7943ee97d33037a7ca65c';
|
|
66
|
+
const ARCHEMY_KEY_MAIN = '3iP2OU6Hnteu-UW4OX6U6Nb-6lxc3_Lk';
|
|
67
|
+
exports.evmConfig = {
|
|
68
|
+
[exports.CHAIN.EthereumMainnet]: generateEVMChain({
|
|
69
|
+
chainId: exports.ETHEREUM_CHAIN,
|
|
70
|
+
chainName: 'Ethereum Mainnet',
|
|
71
|
+
symbol: 'ETH',
|
|
72
|
+
decimal: 18,
|
|
73
|
+
defaultRPC: `https://mainnet.infura.io/v3/${constant_1.INFURA_PROJECT_ID}`,
|
|
74
|
+
explorer: 'https://etherscan.io',
|
|
75
|
+
isTest: false,
|
|
76
|
+
canRemove: false,
|
|
77
|
+
networkName: 'mainnet',
|
|
78
|
+
endpoints: [
|
|
79
|
+
`https://mainnet.infura.io/v3/${constant_1.INFURA_PROJECT_ID}`,
|
|
80
|
+
`https://eth-mainnet.g.alchemy.com/v2/${ARCHEMY_KEY_MAIN}`,
|
|
81
|
+
'https://eth-rpc.gateway.pokt.network/',
|
|
82
|
+
`https://old-wild-sound.discover.quiknode.pro/${QUICK_NODE_KEY_MAIN}/`,
|
|
83
|
+
],
|
|
84
|
+
}),
|
|
85
|
+
[exports.CHAIN.Goerli]: generateEVMChain({
|
|
86
|
+
chainId: exports.GOERLI_CHAIN,
|
|
87
|
+
chainName: 'Ethereum Goerli',
|
|
88
|
+
symbol: 'GOR',
|
|
89
|
+
decimal: 18,
|
|
90
|
+
defaultRPC: `https://goerli.infura.io/v3/${constant_1.INFURA_PROJECT_ID}`,
|
|
91
|
+
explorer: 'https://goerli.etherscan.io',
|
|
92
|
+
isTest: true,
|
|
93
|
+
canRemove: true,
|
|
94
|
+
networkName: 'goerli',
|
|
95
|
+
endpoints: [
|
|
96
|
+
`https://goerli.infura.io/v3/${constant_1.INFURA_PROJECT_ID}`,
|
|
97
|
+
'https://eth-goerli-rpc.gateway.pokt.network/',
|
|
98
|
+
`https://eth-goerli.g.alchemy.com/v2/${ARCHEMY_KEY_TEST}`,
|
|
99
|
+
`https://crimson-chaotic-asphalt.ethereum-goerli.discover.quiknode.pro/${QUICK_NODE_KEY_TEST}/`,
|
|
100
|
+
],
|
|
101
|
+
}),
|
|
102
|
+
[exports.CHAIN.Ropsten]: generateEVMChain({
|
|
103
|
+
chainId: exports.ROPSTEN_CHAIN,
|
|
104
|
+
chainName: 'Ethereum Ropsten',
|
|
105
|
+
symbol: 'ROP',
|
|
106
|
+
decimal: 18,
|
|
107
|
+
defaultRPC: `https://ropsten.infura.io/v3/${constant_1.INFURA_PROJECT_ID}`,
|
|
108
|
+
explorer: 'https://ropsten.etherscan.io',
|
|
109
|
+
isTest: true,
|
|
110
|
+
canRemove: true,
|
|
111
|
+
networkName: 'ropsten',
|
|
112
|
+
}),
|
|
113
|
+
[exports.CHAIN.Rinkeby]: generateEVMChain({
|
|
114
|
+
chainId: exports.RINKEBY_CHAIN,
|
|
115
|
+
chainName: 'Ethereum Rinkeby',
|
|
116
|
+
symbol: 'RIN',
|
|
117
|
+
decimal: 18,
|
|
118
|
+
defaultRPC: `https://rinkeby.infura.io/v3/${constant_1.INFURA_PROJECT_ID}`,
|
|
119
|
+
explorer: 'https://rinkeby.etherscan.io',
|
|
120
|
+
isTest: true,
|
|
121
|
+
canRemove: true,
|
|
122
|
+
networkName: 'rinkeby',
|
|
123
|
+
}),
|
|
124
|
+
[exports.CHAIN.Kovan]: generateEVMChain({
|
|
125
|
+
chainId: exports.KOVAN_CHAIN,
|
|
126
|
+
chainName: 'Ethereum Kovan',
|
|
127
|
+
symbol: 'KOV',
|
|
128
|
+
decimal: 18,
|
|
129
|
+
defaultRPC: `https://kovan.infura.io/v3/${constant_1.INFURA_PROJECT_ID}`,
|
|
130
|
+
explorer: 'https://kovan.etherscan.io',
|
|
131
|
+
isTest: true,
|
|
132
|
+
canRemove: true,
|
|
133
|
+
networkName: 'kovan',
|
|
134
|
+
}),
|
|
135
|
+
[exports.CHAIN.BSC]: generateEVMChain({
|
|
136
|
+
chainId: exports.BINANCE_CHAIN,
|
|
137
|
+
chainName: 'Binance Smart Chain',
|
|
138
|
+
symbol: 'BNB',
|
|
139
|
+
decimal: 18,
|
|
140
|
+
defaultRPC: 'https://bsc-dataseed.binance.org/',
|
|
141
|
+
explorer: 'https://bscscan.com',
|
|
142
|
+
isTest: false,
|
|
143
|
+
canRemove: true,
|
|
144
|
+
networkName: 'BNB',
|
|
145
|
+
}),
|
|
146
|
+
[exports.CHAIN.BSCTestnet]: generateEVMChain({
|
|
147
|
+
chainId: exports.BINANCE_TEST_CHAIN,
|
|
148
|
+
chainName: 'Binance Smart Test Chain',
|
|
149
|
+
symbol: 'tBNB',
|
|
150
|
+
decimal: 18,
|
|
151
|
+
defaultRPC: 'https://data-seed-prebsc-1-s1.binance.org:8545/',
|
|
152
|
+
explorer: 'https://testnet.bscscan.com',
|
|
153
|
+
isTest: true,
|
|
154
|
+
canRemove: true,
|
|
155
|
+
networkName: 'BNB',
|
|
156
|
+
}),
|
|
157
|
+
// ETHF
|
|
158
|
+
[exports.CHAIN.EthereumFair]: generateEVMChain({
|
|
159
|
+
chainId: exports.ETHEREUM_FAIR_CHAIN,
|
|
160
|
+
chainName: 'EthereumFair',
|
|
161
|
+
symbol: 'ETHF',
|
|
162
|
+
decimal: 18,
|
|
163
|
+
defaultRPC: 'https://rpc.etherfair.org',
|
|
164
|
+
explorer: 'https://explorer.etherfair.org',
|
|
165
|
+
isTest: false,
|
|
166
|
+
canRemove: true,
|
|
167
|
+
networkName: 'Ethereum Fair',
|
|
168
|
+
}),
|
|
169
|
+
// Arbitrum
|
|
170
|
+
[exports.CHAIN.Arbitrum]: generateEVMChain({
|
|
171
|
+
chainId: exports.ARBITRUM_CHAIN,
|
|
172
|
+
chainName: 'Arbitrum',
|
|
173
|
+
symbol: 'ETH',
|
|
174
|
+
decimal: 18,
|
|
175
|
+
defaultRPC: 'https://arb1.arbitrum.io/rpc',
|
|
176
|
+
explorer: 'https://explorer.arbitrum.io',
|
|
177
|
+
isTest: false,
|
|
178
|
+
canRemove: true,
|
|
179
|
+
networkName: 'Arbitrum',
|
|
180
|
+
}),
|
|
181
|
+
[exports.CHAIN.ArbitrumTestnet]: generateEVMChain({
|
|
182
|
+
chainId: exports.ARBITRUM_TEST_CHAIN,
|
|
183
|
+
chainName: 'Arbitrum Testnet',
|
|
184
|
+
symbol: 'ARETH',
|
|
185
|
+
decimal: 18,
|
|
186
|
+
defaultRPC: 'https://rinkeby.arbitrum.io/rpc',
|
|
187
|
+
explorer: 'https://rinkeby-explorer.arbitrum.io',
|
|
188
|
+
isTest: true,
|
|
189
|
+
canRemove: true,
|
|
190
|
+
networkName: 'Arbitrum Testnet',
|
|
191
|
+
}),
|
|
192
|
+
// ETC
|
|
193
|
+
[exports.CHAIN.EthereumClassic]: generateEVMChain({
|
|
194
|
+
chainId: exports.ETHEREUM_CLASSIC_CHAIN,
|
|
195
|
+
chainName: 'Ethereum Classic',
|
|
196
|
+
symbol: 'ETC',
|
|
197
|
+
decimal: 18,
|
|
198
|
+
defaultRPC: 'https://www.ethercluster.com/etc',
|
|
199
|
+
explorer: 'https://blockscout.com/etc/mainnet',
|
|
200
|
+
isTest: false,
|
|
201
|
+
canRemove: true,
|
|
202
|
+
networkName: 'Ethereum Classic',
|
|
203
|
+
}),
|
|
204
|
+
[exports.CHAIN.EthereumClassicMordor]: generateEVMChain({
|
|
205
|
+
chainId: exports.ETHEREUM_CLASSIC_MORDOR_CHAIN,
|
|
206
|
+
chainName: 'Ethereum Classic Mordor',
|
|
207
|
+
symbol: 'METC',
|
|
208
|
+
decimal: 18,
|
|
209
|
+
defaultRPC: 'https://www.ethercluster.com/mordor',
|
|
210
|
+
explorer: 'https://blockscout.com/etc/mordor',
|
|
211
|
+
isTest: true,
|
|
212
|
+
canRemove: true,
|
|
213
|
+
networkName: 'Ethereum Classic Mordor',
|
|
214
|
+
}),
|
|
215
|
+
};
|
|
216
|
+
exports.arcChainConfig = {
|
|
217
|
+
[constant_1.ASSET_CHAIN_ID]: generateEVMChain({
|
|
218
|
+
chainId: constant_1.ASSET_CHAIN_ID,
|
|
219
|
+
chainName: 'Main',
|
|
220
|
+
symbol: 'ABT',
|
|
221
|
+
decimal: 18,
|
|
222
|
+
defaultRPC: 'https://main.abtnetwork.io/api/',
|
|
223
|
+
explorer: 'https://main.abtnetwork.io/explorer',
|
|
224
|
+
isTest: false,
|
|
225
|
+
canRemove: false,
|
|
226
|
+
networkName: 'ArcBlock Main',
|
|
227
|
+
host: constant_1.DEFAULT_MAIN_HOST,
|
|
228
|
+
consensusVersion: '@ocap/statedb-qldb v1.14.9',
|
|
229
|
+
}),
|
|
230
|
+
[constant_1.BATE_CHAIN]: generateEVMChain({
|
|
231
|
+
chainId: constant_1.BATE_CHAIN,
|
|
232
|
+
chainName: 'Beta',
|
|
233
|
+
symbol: 'TBA',
|
|
234
|
+
decimal: 18,
|
|
235
|
+
defaultRPC: constant_1.DEFAULT_BATE_HOST,
|
|
236
|
+
explorer: 'https://beta.abtnetwork.io/explorer',
|
|
237
|
+
isTest: true,
|
|
238
|
+
canRemove: true,
|
|
239
|
+
networkName: 'ArcBlock Beta',
|
|
240
|
+
host: constant_1.DEFAULT_BATE_HOST,
|
|
241
|
+
consensusVersion: 'ocap/statedb-qldb v1.14.3',
|
|
242
|
+
}),
|
|
243
|
+
};
|
|
244
|
+
const getConfigByChainId = (chainId) => {
|
|
245
|
+
let Id = chainId;
|
|
246
|
+
try {
|
|
247
|
+
if (chainId.startsWith(exports.EVM_PREFIX)) {
|
|
248
|
+
Id = chainId.replace(exports.EVM_PREFIX, '');
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
Id = chainId;
|
|
253
|
+
}
|
|
254
|
+
return exports.evmConfig[exports.CHAIN[Id]];
|
|
255
|
+
};
|
|
256
|
+
exports.getConfigByChainId = getConfigByChainId;
|