-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsendTransactionPlayground.ts
78 lines (67 loc) · 2.57 KB
/
sendTransactionPlayground.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* eslint-disable no-unused-vars */
/* eslint-disable no-console */
import {
sendAptosTransaction,
sendCeloTransaction,
sendCosmosTransaction,
sendEthereumTransaction,
sendNearTransaction,
sendSolanaTransaction,
sendTonTransaction,
sendSuiTransaction,
} from './utils';
import {
getAptosSignedTx,
getCosmosSignedTx,
getEthereumSignedTx,
getCeloSignedTx,
getNearSignedTx,
getSolanaSignedTx,
getTonSignedTx,
getSuiSignedTx,
} from './utils/signTx';
const MNEMONIC = require('./mnemonic.json');
const main = async () => {
const mnemonic = MNEMONIC.bip44;
/* ethereum sendtransaction */
const { ethereumSignedTx } = await getEthereumSignedTx(mnemonic);
console.log('>ethSignedTx', ethereumSignedTx);
const ethereumTxResult = await sendEthereumTransaction(ethereumSignedTx);
console.log('Ethereum TxHash : ', ethereumTxResult);
/* celo sendtransaction */
const { celoSignedTx } = await getCeloSignedTx(mnemonic);
console.log('>celoSignedTx', celoSignedTx);
const celoTxResult = await sendCeloTransaction(celoSignedTx);
console.log('Celo TxHash : ', celoTxResult);
/* near sendtransaction */
const { nearSignedTx } = await getNearSignedTx(mnemonic);
console.log('>nearSignedTx', nearSignedTx);
const nearTxResult = await sendNearTransaction(nearSignedTx);
console.log('Near TxHash : ', nearTxResult);
/* cosmos sendtransaction */
const { cosmosSignedTx } = await getCosmosSignedTx(mnemonic);
console.log('>cosmosSignedTx', cosmosSignedTx);
const cosmosTxResult = await sendCosmosTransaction(cosmosSignedTx);
console.log('Cosmos TxHash', cosmosTxResult);
/* solana sendtransaction */
const { solanaSignedTx } = await getSolanaSignedTx(mnemonic);
console.log('>solanaSignedTx', solanaSignedTx);
const solanaTxResult = await sendSolanaTransaction(solanaSignedTx);
console.log('Solana TxHash', solanaTxResult);
/* aptos sendtransaction */
const { aptosSignedTx } = await getAptosSignedTx(mnemonic);
console.log('>aptosSignedTx', aptosSignedTx);
const aptosTxResult = await sendAptosTransaction(aptosSignedTx);
console.log('Aptos TxHash', aptosTxResult);
/* ton sendtransaction */
const { tonSignedTx } = await getTonSignedTx(mnemonic);
console.log('>tonSignedTx', tonSignedTx);
const tonTxResult = await sendTonTransaction(tonSignedTx, mnemonic);
console.log('Ton TxHash', tonTxResult);
/* sui sendtransaction */
const { suiSignedTx } = await getSuiSignedTx(mnemonic);
console.log('>suiSignedTx', suiSignedTx);
const suiTxResult = await sendSuiTransaction(suiSignedTx);
console.log('Sui TxHash', suiTxResult);
};
main();