|
1 | | -// import 'package:blockchain_utils/binary/utils.dart'; |
2 | | -// import 'package:blockchain_utils/bip/bip/bip39/bip39_seed_generator.dart'; |
3 | | -// import 'package:blockchain_utils/bip/bip/bip44/bip44_base.dart'; |
4 | | -// import 'package:blockchain_utils/bip/bip/conf/bip44/bip44_coins.dart'; |
5 | | -// import 'package:blockchain_utils/bip/mnemonic/mnemonic.dart'; |
6 | | -// import 'package:cosmos_sdk/cosmos_sdk.dart'; |
7 | | -// import 'package:example/provider.dart'; |
8 | | - |
9 | | -// /// final privateKey2 = CosmosSecp256K1PrivateKey.fromBytes( |
10 | | -// /// Bip44.fromSeed(seedBytes, Bip44Coins.osmosis).privateKey.raw); |
11 | | -// /// final publickey2 = privateKey2.toPublicKey(); |
12 | | - |
13 | | -// /// osmo1wqzpmju4gl0kcajhjls6ufrqecaedxm9udt80k |
14 | | -// void main() async { |
15 | | -// final seedBytes = Bip39SeedGenerator(Mnemonic.fromString( |
16 | | -// "this dove indoor skin shed gap east welcome gift buffalo silent high")) |
17 | | -// .generate(); |
18 | | -// final bip44 = Bip44.fromSeed(seedBytes, Bip44Coins.osmosis).deriveDefaultPath; |
19 | | - |
20 | | -// final privateKey = CosmosSecp256K1PrivateKey.fromBytes(bip44.privateKey.raw); |
21 | | - |
22 | | -// final publickey = privateKey.toPublicKey(); |
23 | | -// // print(pr.toPublicKey().toAddresss(hrp: "osmo")); |
24 | | - |
25 | | -// // final provider = TendermintProvider( |
26 | | -// // TendermintHTTPProvider(url: "https://lcd.osmotest5.osmosis.zone/")); |
27 | | -// final provider = TendermintProvider( |
28 | | -// TendermintHTTPProvider(url: "https://rpc.testnet.osmosis.zone/")); |
29 | | -// final message = OsmosisValSetprefMsgDelegateToValidatorSet( |
30 | | -// delegator: publickey.toAddresss(hrp: CosmosAddrConst.osmosis).address, |
31 | | -// coin: Coin(denom: "uosmo", amount: BigInt.from(10000000))); |
32 | | - |
33 | | -// /// Querying account info from the blockchain |
34 | | -// final accountInfo = await provider.request(TendermintRequestAbciQuery( |
35 | | -// request: QueryAccountInfoRequest( |
36 | | -// publickey.toAddresss(hrp: CosmosAddrConst.osmosis)))); |
37 | | - |
38 | | -// /// Querying the latest block information |
39 | | -// final latestBlock = await provider.request( |
40 | | -// TendermintRequestAbciQuery(request: const GetLatestBlockRequest())); |
41 | | - |
42 | | -// final accountBalances = await provider.request(TendermintRequestAbciQuery( |
43 | | -// request: OsmosisConcentratedLiquidityPoolsRequest())); |
44 | | -// print(accountBalances.pools?.map((e) => e.typeUrl).toList().toSet()); |
45 | | -// return; |
46 | | -// // /// OsmosisGammQueryPoolsRequest |
47 | | -// // print("balances $accountBalances"); |
48 | | -// // return; |
49 | | - |
50 | | -// /// Creating authentication info for transaction |
51 | | -// final authInfo = AuthInfo( |
52 | | -// signerInfos: [ |
53 | | -// SignerInfo( |
54 | | -// publicKey: publickey, |
55 | | -// modeInfo: const ModeInfo(ModeInfoSignle(SignMode.signModeDirect)), |
56 | | -// sequence: accountInfo.info.sequence) |
57 | | -// ], |
58 | | -// fee: Fee(amount: [ |
59 | | -// Coin( |
60 | | -// denom: "uosmo", |
61 | | -// amount: BigInt.from(100000), |
62 | | -// ) |
63 | | -// ], gasLimit: BigInt.from(2000000))); |
64 | | - |
65 | | -// final txbody = TXBody(messages: [message]); |
66 | | - |
67 | | -// /// Creating a signable document for the transaction |
68 | | -// final SignDoc signDoc = SignDoc( |
69 | | -// bodyBytes: txbody.toBuffer(), |
70 | | -// authInfoBytes: authInfo.toBuffer(), |
71 | | -// chainId: latestBlock.block!.header.chainId, |
72 | | -// accountNumber: accountInfo.info.accountNumber); |
73 | | - |
74 | | -// /// Signing the document with the private key |
75 | | -// final sign = privateKey.sign(signDoc.toBuffer()); |
76 | | - |
77 | | -// final txRaw = TxRaw( |
78 | | -// bodyBytes: txbody.toBuffer(), |
79 | | -// authInfoBytes: authInfo.toBuffer(), |
80 | | -// signatures: [sign]); |
81 | | - |
82 | | -// final txForSimulate = |
83 | | -// Tx(body: txbody, authInfo: authInfo, signatures: [sign]); |
84 | | - |
85 | | -// final simulateRequest = await provider.request(TendermintRequestAbciQuery( |
86 | | -// request: SimulateRequest(txForSimulate.toBuffer()))); |
87 | | -// print("simulate $simulateRequest"); |
88 | | -// // final resp = await provider.request(TendermintRequestBroadcastTxCommit( |
89 | | -// // BytesUtils.toHexString(txRaw.toBuffer(), prefix: "0x"))); |
90 | | -// // print("resp $resp"); |
91 | | - |
92 | | -// /// https://celatone.osmosis.zone/osmo-test-5/txs/7C66B231A02BE52E2E42127A6BAAC35C24AEC35519E3FED4545982BEE781EBA8 |
93 | | -// } |
| 1 | +void main() {} |
0 commit comments