コード例 #1
0
                        ]).then(([smartAssetsIdList, bytes, wavesAsset, hasScript]) => {
                            const bigNumberFee = currentFee(bytes, hasScript, smartAssetsIdList);
                            const count = bigNumberFee
                                .div(feeConfig.calculate_fee_rules.default.fee)
                                .dp(0, BigNumber.ROUND_UP);

                            const fee = new Money(bigNumberFee, wavesAsset);
                            const feeList = ds.utils.getTransferFeeList()
                                .map(money => money.cloneWithTokens(money.getTokens().times(count)));

                            return MULTY_FEE_TRANSACTIONS[tx.type] ? [fee, ...feeList] : [fee];
                        });
コード例 #2
0
ファイル: AssetLogo.js プロジェクト: wavesplatform/WavesGUI
            $postLink() {
                if (!this.size || !(this.assetName || this.assetId)) {
                    throw new Error('Wrong params!');
                }

                this._canPayFee = !!ds.utils.getTransferFeeList()
                    .find(money => money.asset.id === this.assetId);

                if (this.assetId) {
                    waves.node.assets.getAsset(this.assetId).then(asset => {
                        this._isSmart = asset.hasScript;
                    });
                }

                $element.find('.asset__logo')
                    .css({
                        width: `${this.size}px`,
                        height: `${this.size}px`
                    });

                this._addLogo();
            }
コード例 #3
0
ファイル: DexMyOrders.js プロジェクト: wavesplatform/WavesGUI
                    .then(result => {
                        const lastOrder = result.slice().reverse().find(where({ progress: gt(__, 0) }));

                        if (!lastOrder) {
                            return result;
                        }

                        return ds.api.transactions.getExchangeTxList({
                            sender: user.address,
                            timeStart: ds.utils.normalizeTime(lastOrder.timestamp.getTime())
                        }).then(txList => {
                            const transactionsByOrderHash = DexMyOrders._getTransactionsByOrderIdHash(txList);
                            this.loadingError = false;
                            return result.map(order => {
                                if (!transactionsByOrderHash[order.id]) {
                                    transactionsByOrderHash[order.id] = [];
                                }
                                order.exchange = transactionsByOrderHash[order.id];
                                return order;
                            });
                        }).catch(() => result);
                    })
コード例 #4
0
ファイル: DexMyOrders.js プロジェクト: wavesplatform/WavesGUI
 /**
  * @param {number} timestamp
  * @return {boolean}
  * @private
  */
 static _isNewOrder(timestamp) {
     return ds.utils.normalizeTime(Date.now()) < timestamp + 1000 * 8;
 }