|
1 |
| -// // // ignore_for_file: avoid_print |
| 1 | +// ignore_for_file: unused_local_variable |
2 | 2 |
|
3 |
| -// import 'package:example/test/address/ada_shelly/ada_shelly.dart'; |
4 |
| -// import 'package:example/test/address/algo/algo.dart'; |
5 |
| -// import 'package:example/test/address/aptos/aptos.dart'; |
6 |
| -// import 'package:example/test/address/atom/atom.dart'; |
7 |
| -// import 'package:example/test/address/avax/avax.dart'; |
8 |
| -// import 'package:example/test/address/bch_p2pkh/bch_p2pkh.dart'; |
9 |
| -// import 'package:example/test/address/bch_p2sh/bch_p2sh.dart'; |
10 |
| -// import 'package:example/test/address/egld/egld.dart'; |
11 |
| -// import 'package:example/test/address/eos/eos.dart'; |
12 |
| -// import 'package:example/test/address/ergo/ergo.dart'; |
13 |
| -// import 'package:example/test/address/eth/eth.dart'; |
14 |
| -// import 'package:example/test/address/fil/fil.dart'; |
15 |
| -// import 'package:example/test/address/icx/icx.dart'; |
16 |
| -// import 'package:example/test/address/inj/inj.dart'; |
17 |
| -// import 'package:example/test/address/nano/nano.dart'; |
18 |
| -// import 'package:example/test/address/near/near.dart'; |
19 |
| -// import 'package:example/test/address/neo/neo.dart'; |
20 |
| -// import 'package:example/test/address/okex/okex.dart'; |
21 |
| -// import 'package:example/test/address/one/one.dart'; |
22 |
| -// import 'package:example/test/address/p2pkh/p2pkh.dart'; |
23 |
| -// import 'package:example/test/address/p2sh/p2sh.dart'; |
24 |
| -// import 'package:example/test/address/p2tr/p2tr.dart'; |
25 |
| -// import 'package:example/test/address/p2wpkh/p2wpkh.dart'; |
26 |
| -// import 'package:example/test/address/sol/sol.dart'; |
27 |
| -// import 'package:example/test/address/substrate/substrate.dart'; |
28 |
| -// import 'package:example/test/address/trx/trx.dart'; |
29 |
| -// import 'package:example/test/address/xlm/xml.dart'; |
30 |
| -// import 'package:example/test/address/xmr/xmr.dart'; |
31 |
| -// import 'package:example/test/address/xrp/xrp.dart'; |
32 |
| -// import 'package:example/test/address/xtz/xtz.dart'; |
33 |
| -// import 'package:example/test/address/zil/zil.dart'; |
34 |
| -// import 'package:example/test/algorand/mnemonic.dart'; |
35 |
| -// import 'package:example/test/base58/base58.dart'; |
36 |
| -// import 'package:example/test/base58/base58_xmr.dart'; |
37 |
| -// import 'package:example/test/bech32/bch_bech32.dart'; |
38 |
| -// import 'package:example/test/bech32/bech32.dart'; |
39 |
| -// import 'package:example/test/bech32/segwit_bech32.dart'; |
40 |
| -// import 'package:example/test/bip/bip32/ed25519/ed25519.dart'; |
41 |
| -// import 'package:example/test/bip/bip32/ed25519_blake2b/ed25519_blake2b.dart'; |
42 |
| -// import 'package:example/test/bip/bip32/ed25519_khalow/ed25519_khalow.dart'; |
43 |
| -// import 'package:example/test/bip/bip32/nist256p1/nist256p1.dart'; |
44 |
| -// import 'package:example/test/bip/bip32/secp256k1/secp256k1.dart'; |
45 |
| -// import 'package:example/test/bip/bip38/bip38_addr.dart'; |
46 |
| -// import 'package:example/test/bip/bip38/bip38_ec.dart'; |
47 |
| -// import 'package:example/test/bip/bip38/bip38_no_ec.dart'; |
48 |
| -// import 'package:example/test/bip/bip39/bip39.dart'; |
49 |
| -// import 'package:example/test/bip/bip44/bip44.dart'; |
50 |
| -// import 'package:example/test/bip/bip49/bip49.dart'; |
51 |
| -// import 'package:example/test/bip/bip84/bip84.dart'; |
52 |
| -// import 'package:example/test/bip/bip86/bip86.dart'; |
53 |
| -// import 'package:example/test/cardano/bip32/icarus.dart'; |
54 |
| -// import 'package:example/test/cardano/bip32/legacy.dart'; |
55 |
| -// import 'package:example/test/cardano/byron/byron_lagacy.dart'; |
56 |
| -// import 'package:example/test/cardano/cip1852/cip1852.dart'; |
57 |
| -// import 'package:example/test/cardano/mnemonic/mnemonic.dart'; |
58 |
| -// import 'package:example/test/cardano/shelly/shelly.dart'; |
59 |
| -// import 'package:example/test/cbor.dart'; |
60 |
| -// import 'package:example/test/crypto/aes/aes_ctr.dart'; |
61 |
| -// import 'package:example/test/crypto/blake2b/blake2b.dart'; |
62 |
| -// import 'package:example/test/crypto/chacha20_poly1305/chacha20_poly1305.dart'; |
63 |
| -// import 'package:example/test/crypto/crc32/crc32.dart'; |
64 |
| -// import 'package:example/test/crypto/hmac/hmac.dart'; |
65 |
| -// import 'package:example/test/crypto/keccack/keccack.dart'; |
66 |
| -// import 'package:example/test/crypto/md4/md4.dart'; |
67 |
| -// import 'package:example/test/crypto/md5/md5.dart'; |
68 |
| -// import 'package:example/test/crypto/pbkdf2/pbkdf2.dart'; |
69 |
| -// import 'package:example/test/crypto/ripemd/ripemd.dart'; |
70 |
| -// import 'package:example/test/crypto/scrypt/scrypt.dart'; |
71 |
| -// import 'package:example/test/crypto/sha1/sha1.dart'; |
72 |
| -// import 'package:example/test/crypto/sha256/sha256.dart'; |
73 |
| -// import 'package:example/test/crypto/sha3/sha3.dart'; |
74 |
| -// import 'package:example/test/crypto/sha512/sha512.dart'; |
75 |
| -// import 'package:example/test/crypto/sha512_256/sha512_256.dart'; |
76 |
| -// import 'package:example/test/crypto/shake/shake.dart'; |
77 |
| -// import 'package:example/test/crypto/x_modem_crc/x_modem_crc.dart'; |
78 |
| -// import 'package:example/test/ecdsa/ed.dart'; |
79 |
| -// import 'package:example/test/ecdsa/projective.dart'; |
80 |
| -// import 'package:example/test/elctrum/mnemonic/mnemonic.dart'; |
81 |
| -// import 'package:example/test/elctrum/v1/v1.dart'; |
82 |
| -// import 'package:example/test/elctrum/v2/v2.dart'; |
83 |
| -// import 'package:example/test/monero/mnemonic/monero_mnemonic.dart'; |
84 |
| -// import 'package:example/test/monero/monero.dart'; |
85 |
| -// import 'package:example/test/schnorrkel/derive.dart'; |
86 |
| -// import 'package:example/test/schnorrkel/schnorrkel_key.dart'; |
87 |
| -// import 'package:example/test/schnorrkel/sign.dart'; |
88 |
| -// import 'package:example/test/schnorrkel/vrf.dart'; |
89 |
| -// import 'package:example/test/secure_storage.dart'; |
90 |
| -// import 'package:example/test/ss58/ss58.dart'; |
91 |
| -// import 'package:example/test/substrate/scale.dart'; |
92 |
| -// import 'package:example/test/substrate/substrate.dart'; |
93 |
| -// import 'package:example/test/uuid.dart'; |
94 |
| -// import 'package:example/test/wif/wif.dart'; |
95 |
| -// import 'package:flutter/foundation.dart'; |
| 3 | +import 'package:blockchain_utils/blockchain_utils.dart'; |
96 | 4 |
|
97 |
| -// void main() { |
98 |
| -// _testAll(); |
99 |
| -// } |
| 5 | +void main() { |
| 6 | + const String passphrase = 'MRTNETWORK'; |
| 7 | + final mnemonic = Bip39MnemonicGenerator(Bip39Languages.japanese) |
| 8 | + .fromWordsNumber(Bip39WordsNum.wordsNum24); |
| 9 | + final seed = Bip39SeedGenerator(mnemonic).generate(passphrase); |
| 10 | + final ethereumWallet = Bip44.fromSeed(seed, Bip44Coins.ethereum); |
| 11 | + final defaultEthereumWallet = ethereumWallet.deriveDefaultPath; |
| 12 | + final ethereumaddress = defaultEthereumWallet.publicKey.toAddress; |
100 | 13 |
|
101 |
| -// typedef TestMethod = void Function(); |
| 14 | + final tronmWallet = Bip44.fromSeed(seed, Bip44Coins.tron); |
| 15 | + final defaultTronWallet = ethereumWallet.deriveDefaultPath; |
| 16 | + final tronaddress = defaultEthereumWallet.publicKey.toAddress; |
102 | 17 |
|
103 |
| -// /// its very slow in web debugging |
104 |
| -// /// if you want to test this method on the web should remove the condition |
105 |
| -// void _web() { |
106 |
| -// if (kIsWeb) return; |
107 |
| -// _test("bip38 No Ecdsa", bip38NoEcdsaTest); |
108 |
| -// _test("bip38 ECDSA", bip38ECDSATest); |
109 |
| -// _test("scrypt", testScrypt); |
110 |
| -// _test("pbkdf2", pbkdf2Test); |
111 |
| -// _test("secure storage", testSecureStorage); |
112 |
| -// } |
| 18 | + Bip49.fromSeed(seed, Bip49Coins.litecoin); |
| 19 | + Bip84.fromSeed(seed, Bip84Coins.bitcoin); |
| 20 | + Bip86.fromSeed(seed, Bip86Coins.bitcoin); |
113 | 21 |
|
114 |
| -// void _test(String name, TestMethod process) { |
115 |
| -// try { |
116 |
| -// process(); |
117 |
| -// print("success $name"); |
118 |
| -// } catch (e) { |
119 |
| -// print("failed $name $e"); |
120 |
| -// throw Exception(); |
121 |
| -// } |
122 |
| -// } |
| 22 | + final bitconWallet = Bip44.fromSeed(seed, Bip44Coins.tron); |
| 23 | + final defaultBitcoinWallet = ethereumWallet.deriveDefaultPath; |
| 24 | + final bitconP2pkh = defaultEthereumWallet.publicKey.toAddress; |
123 | 25 |
|
124 |
| -// void _testAll() async { |
125 |
| -// final DateTime start = DateTime.now(); |
126 |
| -// _encodeDecodeAddrTest(); |
127 |
| -// _test("UUID", testUUID); |
128 |
| -// _test("bech32", bech32Test); |
129 |
| -// _test("wif", wifTest); |
130 |
| -// _test("substrate scale", substrateScaleTest); |
131 |
| -// _test("ss58", ss58Test); |
132 |
| -// _test("bip38 ", bip38Test); |
133 |
| -// _test("segwit Bech32 ", segwitBech32Test); |
134 |
| -// _test("bch bech32", bchBech32Test); |
135 |
| -// _test("base58 xmr", testBase58XMR); |
136 |
| -// _test("base58", testBase58); |
137 |
| -// _test("bip49", bip49Test); |
138 |
| -// _test("bip44", bip44Test); |
139 |
| -// _test("algorandMnemonic and derive address", algorandMnemonicAndAddressTest); |
140 |
| -// _test("substrate derive", substrateDeriveTest); |
141 |
| -// _test("monero mnemonic", moneroMnemonucTest); |
142 |
| -// _test("monero", moneroTest); |
143 |
| -// _test("electrum v2", electrumV2Test); |
144 |
| -// _test("electrum v1", electrumV1Test); |
145 |
| -// _test("electrum mnemonic", electrumMnemonicTest); |
146 |
| -// _test("cardano shelly", cardanoShellyTest); |
147 |
| -// _test("cardano mnemonic", cardanoMnemonicTest); |
148 |
| -// _test("cardano cip1852", cip1852Test); |
149 |
| -// _test("byron legacy", byronLegacyTest); |
150 |
| -// _test("cardano icarus", cardanoIcarusTest); |
151 |
| -// _test("cardano legacy", cardanoLegacyTest); |
152 |
| -// _test("bip86", bip86Test); |
153 |
| -// _test("bip84", bip84Test); |
154 |
| -// _test("bip39", testBip39); |
155 |
| -// _test("secp256k1", secpTest); |
156 |
| -// _test("nist", nistTest); |
157 |
| -// _test("ed25519-blake2b", edBlake2bTest); |
158 |
| -// _test("ed25519-khalow", edKhalowTest); |
159 |
| -// _test("ed25519", edTest); |
160 |
| -// _test("schnorr", schnoorTestDerive); |
161 |
| -// _test("vrf sigh", vrfSignTest); |
162 |
| -// _test("schnorrkel keys", schnoorKeyTest); |
163 |
| -// _test("schnorrkel-sign", testSchnoor); |
164 |
| -// _test("ecdsa", testECDSA); |
165 |
| -// _test("eddsa", testEDDSa); |
166 |
| -// _test("sha1", testSha1); |
167 |
| -// _test("ripemd", testRipemd); |
168 |
| -// _test("md5", md5Test); |
169 |
| -// _test("md4", md4Test); |
170 |
| -// _test("keccack", testKecc); |
171 |
| -// _test("hmac", testHmac); |
172 |
| -// _test("crc", crcTest); |
173 |
| -// _test("chacha-poly1305", chachaTest); |
174 |
| -// _test("aes", testAes); |
175 |
| -// _test("blake2b", blake2bTest); |
176 |
| -// _test("sha256", testSha256); |
177 |
| -// _test("sha512", testSha512); |
178 |
| -// _test("sha3", testSha3); |
179 |
| -// _test("sha512/256", testSha512256); |
180 |
| -// _test("modemCrc", testModemCrc); |
181 |
| -// _test("shake digest", testShakeDigest); |
182 |
| -// _test("cbor test", cborTest); |
183 |
| -// _web(); |
184 |
| -// final DateTime end = DateTime.now(); |
185 |
| -// print("end: ${end.difference(start).inMilliseconds}"); |
186 |
| -// } |
| 26 | + final cardano = CardanoIcarusSeedGenerator(mnemonic.toStr()); |
187 | 27 |
|
188 |
| -// void _encodeDecodeAddrTest() { |
189 |
| -// _test("zil Address", zilAddressTest); |
190 |
| -// _test("xtz Address", xtzAddressTest); |
191 |
| -// _test("xrp Address", xrpAddressTest); |
192 |
| -// _test("xmr Address", xmrAddressTest); |
193 |
| -// _test("xlm Address", xlmAddressTest); |
194 |
| -// _test("trx Address", trxAddressTest); |
195 |
| -// _test("substrate Address", substrateAddressTest); |
196 |
| -// _test("sol Address", solAddressTest); |
197 |
| -// _test("p2wpkh Address", p2wpkhAddressTest); |
198 |
| -// _test("p2tr Address", p2trAddressTest); |
199 |
| -// _test("p2sh Address", p2shAddressTest); |
200 |
| -// _test("p2pkh Address", p2pkhAddressTest); |
201 |
| -// _test("one Address", oneAddressTest); |
202 |
| -// _test("okex Address", okexAddressTest); |
203 |
| -// _test("neo Address", neoAddressTest); |
204 |
| -// _test("near Address", nearAddressTest); |
205 |
| -// _test("nano Address", nanoAddressTest); |
206 |
| -// _test("injAddressTest", injAddressTest); |
207 |
| -// _test("icx Address", icxAddressTest); |
208 |
| -// _test("fil Address", filAddressTest); |
209 |
| -// _test("ethereum Address", ethereumAddressTest); |
210 |
| -// _test("ergo Address", ergoAddressTest); |
211 |
| -// _test("eos Address", eosAddrTest); |
212 |
| -// _test("egld Address", egldAddrTest); |
213 |
| -// _test("bchP2sh Address", bchP2shAddressTest); |
214 |
| -// _test("bchP2pkh Address", bchP2pkhTest); |
215 |
| -// _test("avax Address", avaxAddrTest); |
216 |
| -// _test("atom Address", atomAddressTest); |
217 |
| -// _test("aptos Address", aptosAddressTest); |
218 |
| -// _test("algo Address", algoAddressTest); |
219 |
| -// _test("ada Shelly Address", adaShellyAddrTest); |
220 |
| -// } |
221 |
| -void main() {} |
| 28 | + // final cardano = CardanoShelley.fromCip1852Object(seed, Bip44Coins.tron); |
| 29 | + // final defaultBitcoinWallet = ethereumWallet.deriveDefaultPath; |
| 30 | + // final bitconP2pkh = defaultEthereumWallet.publicKey.toAddress; |
| 31 | + final substrate = Substrate.fromSeed( |
| 32 | + List<int>.filled(32, 1), SubstrateCoins.polkadotSr25519); |
| 33 | + final substrateAddress = substrate.publicKey.toAddress; |
| 34 | + |
| 35 | + final moneromnemonic = |
| 36 | + MoneroMnemonicGenerator().fromWordsNumber(MoneroWordsNum.wordsNum25); |
| 37 | + final moneroSeed = MoneroSeedGenerator(moneromnemonic).generate(); |
| 38 | + final monero = MoneroAccount.fromSeed(moneroSeed); |
| 39 | + final moneroAddress = monero.primaryAddress; |
| 40 | + final subAddress = monero.subaddress(1, majorIndex: 0); |
| 41 | + |
| 42 | + final slip10Ed = Bip32Slip10Ed25519.fromSeed(List<int>.filled(32, 1)); |
| 43 | + final edWallet = slip10Ed.derivePath("44'/0'/0'"); |
| 44 | + final slipScp = Bip32Slip10Secp256k1.fromSeed(List<int>.filled(32, 1)); |
| 45 | + final ecWallet = slipScp.derivePath("44'/0'/0'"); |
| 46 | +} |
0 commit comments