How to use the bitsharesjs/es.ChainStore.getAccount function in bitsharesjs

To help you get started, we’ve selected a few bitsharesjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bitshares / bitshares-ui / app / components / Registration / WalletRegistrationForm.jsx View on Github external
renderAccountCreateForm() {
        const {registrarAccount} = this.state;

        const myAccounts = AccountStore.getMyAccounts();
        const firstAccount = myAccounts.length === 0;
        const hasWallet = WalletDb.getWallet();
        const valid = this.isValid();
        let isLTM = false;
        const registrar = registrarAccount
            ? ChainStore.getAccount(registrarAccount)
            : null;
        if (registrar) {
            if (registrar.get("lifetime_referrer") === registrar.get("id")) {
                isLTM = true;
            }
        }

        const buttonClass = classNames("button-primary", {
            disabled: !valid || (registrarAccount && !isLTM)
        });

        return (
            <form> this.onSubmit(e)}
                noValidate
                className="text-left"</form>
github bitshares / bitshares-ui / web / app / components / Utility / BindToChainState.jsx View on Github external
prop.forEach( obj_id => {
                        //console.log("-- Wrapper.chain_accounts_list item -->", obj_id, index);
                        if(obj_id) {
                            let new_obj = ChainStore.getAccount(obj_id, this.default_props["autosubscribe"]);
                            if(new_obj) ++resolved_objects_counter;
                            if(prop_prev_state[index] !== new_obj) {
                                changes = true;
                                prop_new_state[index] = new_obj;
                            } else {
                                prop_new_state[index] = prop_prev_state[index];
                            }
                        }
                        ++index;
                        ++all_objects_counter;
                    });
                    //console.log("-- Wrapper.chain_accounts_list: ", prop_new_state);
github bitshares / bitshares-ui / app / components / Account / CreateAccountPassword.jsx View on Github external
_renderAccountCreateForm() {
        let {registrar_account} = this.state;

        let my_accounts = AccountStore.getMyAccounts();
        let firstAccount = my_accounts.length === 0;
        let valid = this.isValid();
        let isLTM = false;
        let registrar = registrar_account
            ? ChainStore.getAccount(registrar_account)
            : null;
        if (registrar) {
            if (registrar.get("lifetime_referrer") == registrar.get("id")) {
                isLTM = true;
            }
        }

        let buttonClass = classNames("submit-button button no-margin", {
            disabled: !valid || (registrar_account &amp;&amp; !isLTM)
        });

        return (
            <div style="{{textAlign:">
                </div>
github bitshares / bitshares-ui / web / app / components / Transfer / Transfer.jsx View on Github external
_onAccountDropdown(account) {
        let newAccount = ChainStore.getAccount(account);
        if (newAccount) {
            this.setState({
                from_name: account,
                from_account: ChainStore.getAccount(account)
            });
        }
    }
github bitshares / bitshares-ui / web / app / stores / AccountStore.js View on Github external
let auths = account_auths.map(auth => {
            let account = ChainStore.getAccount(auth.get(0));
            if(account === undefined) return undefined;
            return this.getMyAuthorityForAccount(account, ++recursion_count);
        });
github bitshares / bitshares-ui / web / app / components / Blockchain / TransactionConfirm.jsx View on Github external
onConfirmClick(e) {
        e.preventDefault();
        if(this.props.propose) {
            const propose_options = {
                fee_paying_account: ChainStore.getAccount(this.props.fee_paying_account).get("id")
            };
            this.props.transaction.update_head_block().then(() => {
                WalletDb.process_transaction(this.props.transaction.propose(propose_options), null, true);
            });
        } else {
            TransactionConfirmActions.broadcast(this.props.transaction, this.props.resolve, this.props.reject);
        }
    }
github bitshares / bitshares-ui / web / app / components / Utility / BindToChainState.jsx View on Github external
let new_obj = ChainStore.getObject(prop, false, this.default_props["autosubscribe"]);
                    if (new_obj === undefined && this.required_props.indexOf(key) === -1 && new_obj !== this.state[key]) new_state[key] = new_obj;
                    else if (new_obj && new_obj !== this.state[key]) new_state[key] = new_obj;
                    ++all_objects_counter;
                    if (new_obj !== undefined) ++resolved_objects_counter;
                } else {
                    if(this.state[key]) new_state[key] = null;
                }
            }
            for( let key of this.chain_accounts )
            {
                let prop = props[key] || this.dynamic_props[key] || this.default_props[key];
                if(prop) {
                    if(prop[0] === "#" && Number.parseInt(prop.substring(1)))
                        prop = "1.2." + prop.substring(1);
                    let new_obj = ChainStore.getAccount(prop, this.default_props["autosubscribe"]);
                    if (new_obj === undefined && this.required_props.indexOf(key) === -1 && new_obj !== this.state[key]) new_state[key] = new_obj;
                    else if (new_obj && new_obj !== this.state[key]) new_state[key] = new_obj;
                    ++all_objects_counter;
                    if (new_obj !== undefined) ++resolved_objects_counter;
                } else {
                    if(this.state[key]) new_state[key] = null;
                }
            }
            for( let key of this.chain_key_refs )
            {
                let prop = props[key] || this.dynamic_prop[key] || this.default_props[key];
                if(prop) {
                    let new_obj = ChainStore.getAccountRefsOfKey(prop);
                    if (new_obj === undefined && this.required_props.indexOf(key) === -1 && new_obj !== this.state[key]) new_state[key] = new_obj;
                    else if (new_obj && new_obj !== this.state[key]) new_state[key] = new_obj;
                    ++all_objects_counter;
github bitshares / bitshares-ui / web / app / stores / AccountStore.js View on Github external
account_refs.forEach(id => {
            let account = ChainStore.getAccount(id);
            if (account === undefined) {
                return;
            }
            if (account) {
                this._addIgnoredAccount(account.get("name"));
            }
        });
    }
github bitshares / bitshares-ui / web / app / components / Modal / ProposalApproveModal.jsx View on Github external
onChangePayee(account) {
        let fullAccount = ChainStore.getAccount(account);

        if (fullAccount) {
            this.setState({
                payee: fullAccount.get("id")
            });
        }
    }