Commit Graph

1493 Commits

Author SHA1 Message Date
lunar-mining
ffe6afccdf Revert "src/util: made TokenList struct called in darkfid::main()"
This reverts commit 873d259bd2.
2021-09-29 09:04:02 +02:00
lunar-mining
873d259bd2 src/util: made TokenList struct called in darkfid::main() 2021-09-29 08:56:56 +02:00
ghassmo
0b6fe5811b move parsing params functions and NetworkName enum to src/util.rs 2021-09-29 02:39:10 +03:00
ghassmo
ef9e32a86b darkfid: add NetworkName enum and clean up 2021-09-28 21:08:41 +03:00
ghassmo
e8c54c0a49 Merge branch 'master' of github.com:darkrenaissance/darkfi 2021-09-28 20:50:27 +03:00
ghassmo
8f015b548b cashierdb: remove token_id from main_keypair 2021-09-28 20:49:53 +03:00
lunar-mining
685f8e96ff bin/darkfi: test function for f64 -> u64 2021-09-28 19:44:39 +02:00
lunar-mining
0e372a8f57 bin/darkfid: renamed parse_network to parse_params 2021-09-28 19:44:39 +02:00
lunar-mining
712650b58b bin/darkfid: removed testcase 2021-09-28 19:44:39 +02:00
ghassmo
10b3bec61b NetworkName: minor changes 2021-09-28 20:37:46 +03:00
parazyd
61cb717aba service/sol: Pay fees from main wallet when sending tx.
This comes with an implication that the main wallet has some funds
for this operation.
2021-09-28 18:08:11 +02:00
parazyd
b9d82a23e4 Makefile updates. 2021-09-28 18:08:11 +02:00
ghassmo
b90d2c09a1 remove hardcoded network name across the project and use enum instead 2021-09-28 18:55:05 +03:00
parazyd
cf2870061d service/sol: More cleanups. 2021-09-28 17:43:32 +02:00
ghassmo
00bacb3555 Cashierd: listen to notification from bridge listen() function 2021-09-28 18:00:15 +03:00
ghassmo
796c41983f Bridge: implement listen() function 2021-09-28 17:59:40 +03:00
parazyd
c6e4e3f3b4 service/sol: Implement function for fetching SPL Token balance.
It can be used as follows:

fn main() {
    let main_pk = Pubkey::from_str("mainWallet").unwrap();
    let mint_pk = Pubkey::from_str("usdcMint").unwrap();
    let (tokn_pk, _) = get_associated_token_account(&main_pk, &mint_pk);
    let (bal, dec) = get_account_token_balance(
        "https://api.mainnet-beta.solana.com".to_string(),
        &tokn_pk,
        &mint_pk
    ).unwrap();

    println!("Balance:  {}", bal);
    println!("Decimals: {}", dec);
    println!("UI representation: {}", bal / u64::pow(10, dec as u32));
}
2021-09-28 15:46:14 +02:00
parazyd
3ac9d7edbe service/sol: Fix and clean up account subscription handling. 2021-09-28 14:24:48 +02:00
parazyd
a8941a7045 rpc: Add Clone implementation for structs, and use untagged enum. 2021-09-28 14:24:48 +02:00
ghassmo
e6c68c76bf update todo.md 2021-09-28 15:12:16 +03:00
ghassmo
ca85a4e59c cashierdb: attach token_id to the main keypair for tokens & change
asset_id name to token_id in schema and all functions
2021-09-28 14:57:57 +03:00
ghassmo
c142c83bda util: generate_id() function take &str as token_id instead of
json::Value
2021-09-28 14:56:54 +03:00
lunar-mining
2b0dc655c6 bin/darkfid: float->u64 conversion test case 2021-09-28 10:21:46 +02:00
Janus
5c12623b95 Move script subscribe into BtcClient from BitcoinKeys 2021-09-27 09:50:37 -04:00
ghassmo
aed1a17f1f BtcClient: minor changes 2021-09-27 16:16:57 +03:00
ghassmo
d81cca4030 BtcClient: remove hardcoded network endpoints 2021-09-27 15:49:26 +03:00
Janus
780d9ccb3a Restructure BitcoinKeys 2021-09-27 08:23:41 -04:00
Janus
0e56638463 Remove commented btc fn from cashierdb 2021-09-27 08:23:06 -04:00
Janus
21298801b4 Add rand feature to secp256k1 crate 2021-09-27 08:20:53 -04:00
parazyd
5e9a87eed9 sol: Don't hardcode network endpoints. 2021-09-27 12:06:43 +02:00
lunar-mining
11230c6252 renamed parse_token() to symbol_to_id() 2021-09-27 10:14:52 +02:00
lunar-mining
97083e4592 renamed parse_id to generate_id 2021-09-27 10:10:38 +02:00
lunar-mining
5031d8a7d5 todo: standardize 'asset' to 'token' 2021-09-27 10:01:11 +02:00
lunar-mining
190c419f0b bin/darkfid: implemented transfer() 2021-09-27 09:52:50 +02:00
lunar-mining
9964cb301f darkfid.toml, cli/cli_config: added gateway URLs and mint/spend path 2021-09-27 08:34:38 +02:00
ghassmo
027fa103f2 SolClient: WIP clean up & change subscribe commitment to finalized & calculate the fee when send received balance to main keypair 2021-09-26 21:38:09 +03:00
ghassmo
6d40023181 change futures crate version 2021-09-26 21:37:48 +03:00
ghassmo
dbafb55bb2 Bridge: change struct name of TokenClient to NetworkClient & minor
changes
2021-09-25 22:30:13 +03:00
lunar-mining
8c502a6c7c src/util: return token_id if serialize correctly 2021-09-25 20:35:29 +02:00
lunar-mining
e40b197598 src/error: added NetworkParse error 2021-09-25 20:34:47 +02:00
lunar-mining
e42ad6dad3 bin/darkfid: parse network and token param 2021-09-25 20:34:19 +02:00
lunar-mining
20b91a2465 todo: deleted completed todos 2021-09-25 14:40:13 +02:00
lunar-mining
f072ffbe13 bin/darkfid: key_gen() no longer returns tuple 2021-09-25 14:40:13 +02:00
lunar-mining
cc4cb9d774 wallet/walletdb: moved logic to top of key_gen() to prevent key re-generation 2021-09-25 14:40:13 +02:00
lunar-mining
1a2b82a67a wallet/walletdb: check key exists before writing key 2021-09-25 14:40:13 +02:00
ghassmo
e75142363f walletdb: change the name of walletdb in test function to avoid conflict 2021-09-25 12:45:01 +03:00
lunar-mining
0f4c5d163f temporarily disabled test files 2021-09-25 08:27:15 +02:00
ghassmo
be20a03a48 SolClient: WIP refactoring 2021-09-25 02:31:39 +03:00
ghassmo
eb4e8d4d0a cashierd: check if it's a valid token id when receive deposit/withraw
request
2021-09-24 22:02:04 +03:00
narodnik
6b690b9e2c halo2 lookup argument 2021-09-24 20:26:12 +02:00