-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: addresses are the bane of my existence * fixed up transfers, added progress bar * converting hex to bigint to be able use the right value when transferring * wip: started changes to cli for new sdk, finally got the sdk to link to this project * wip: update balance check to work with new sdk * wip: updated transfer with new sdk methods; updated new key creation with correct methods from new sdk * Improves README readability. (#42) * Improves README readability. * Update README.md Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> --------- Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> * remove deps, move files, add license, fix package.json * linting hooks, tidy * mostly fix types? * replace console.log > debug * improve debug by stringifying output * Mixmix/types+lint (#44) * Improves README readability. (#42) * Improves README readability. * Update README.md Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> --------- Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> * remove deps, move files, add license, fix package.json * linting hooks, tidy * mostly fix types? --------- Co-authored-by: Johnny <9611008+johnnymatthews@users.noreply.github.com> Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> * start setting up bin scrupts * removing zaps; changing language around wallet * wip: getting register ready * ignor built files * wip: "singletonish" entropy and keyring * wip: pulling in frankies changes with a bit of cleanup * install commander * fixups * more tidy * add transfer sketch * first pass on balance * support encrypted accounts * wip: minor fixes, removing mnemonic from key generation * wip: setting up keyrings * wip: updated main to initialize with selecting or create new account * wip: initializing entropy in main, passing new entropy to flows * wip: can get acct on cli initialization; entropy intitialized; entropy passed to balance flow for now * wip: remvoed use of wallet namespace (switched to manage accounts); main is now updated to what is expected when talking about having a selected acct or force user to create a new one * wip: balance is now working with the new flow * wip: cleanup of manage accounts folder * wip: updating register to use account selected from config * undo some changes * Mixmix/debug (#45) * Improves README readability. (#42) * Improves README readability. * Update README.md Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> --------- Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> * remove deps, move files, add license, fix package.json * linting hooks, tidy * mostly fix types? * replace console.log > debug * improve debug by stringifying output * fixups * more tidy * undo some changes * Update src/common/initializeEntropy.ts Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> --------- Co-authored-by: Johnny <9611008+johnnymatthews@users.noreply.github.com> Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> * add cli list * first pass transfer * wip: registration looks to be working with properly created acct * wip: user programs added fucntion to check if program exists on endpoint * wip: registration and removing a program * wip * install pre-release sdk * get transfer working * wip: trying to debug accounts their were some bugs i was finding when creating a new account i also added the abbilty to create a debug account when importing by adding `#debug` to the end of the seed * wip: cleanup from frankies changes * wip: more cleanup and added no op program to filesystem * wip: registering is working with default key proxy and adding verifying keys to list * wip: silently handling error, logging an error message * wip: debugging undefined error in subscriber * wip: removing hardcoded debug from initialize entropy, already available on account data * wip: new release for sdk * wip: fixing account flows * replace console.log with "print" * wip * wip * got balances woorking * fix register * sdk upgrade: has key fix potentioally, also seems like their was some types that were not updated * fix accounts? * fix accounts * temp: jhonny plz coppy console.log * remove temp commit * fix refference * Update src/entropy.ts Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> * tidy up * tidy * fix endpoints logic * yarn.lock * add bundling to ts * add commander * tidy tui * tidyups * Update tsconfig.json Co-authored-by: Frankie <frankie.diamond@gmail.com> * Update tsconfig.json Co-authored-by: Frankie <frankie.diamond@gmail.com> * Update tsconfig.json Co-authored-by: Frankie <frankie.diamond@gmail.com> * fixups * fixup start command * lock fix --------- Co-authored-by: Nayyir Jutha <nayyir@entropy.xyz> Co-authored-by: Johnny <9611008+johnnymatthews@users.noreply.github.com> Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com> Co-authored-by: frankie <frankie.diamond@gmail.com>
- Loading branch information
1 parent
b27a9e5
commit de39fd9
Showing
19 changed files
with
494 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { initializeEntropy } from '../../common/initializeEntropy' | ||
import * as config from '../../config' | ||
import { debug } from '../../common/utils' | ||
|
||
const hexToBigInt = (hexString: string) => BigInt(hexString) | ||
|
||
export async function cliGetBalance ({ address, password, endpoint }) { | ||
const storedConfig = await config.get() | ||
const account = storedConfig.accounts.find(account => account.address === address) | ||
if (!account) throw Error(`No account with address ${address}`) | ||
// QUESTION: is throwing the right response? | ||
debug('account', account) | ||
|
||
// check if data is encrypted + we have a password | ||
if (typeof account.data === 'string' && !password) { | ||
throw Error('This account requires a password, add --password <password>') | ||
} | ||
|
||
const entropy = await initializeEntropy({ keyMaterial: account.data, password, endpoint }) | ||
|
||
const accountInfo = (await entropy.substrate.query.system.account(address)) as any | ||
debug('accountInfo', accountInfo) | ||
|
||
return hexToBigInt(accountInfo.data.free).toString() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.