mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 09:45:52 +00:00
Remove use strict make api full esm compatible
This commit is contained in:
parent
3cc5d544a2
commit
0b2bceb842
@ -15,8 +15,8 @@ window.validateAddress = validateAddress
|
||||
window.decryptChatMessage = decryptChatMessage
|
||||
window.decryptChatMessageBase64 = decryptChatMessageBase64
|
||||
|
||||
export { initApi, store } from './api_deps.js'
|
||||
export * from './api/deps/deps.js'
|
||||
export * from './api/api.js'
|
||||
export * from './api/registerUsername.js'
|
||||
export { createWallet } from './api/createWallet.js'
|
||||
export { initApi, store } from './api_deps'
|
||||
export * from './api/deps/deps'
|
||||
export * from './api/api'
|
||||
export * from './api/registerUsername'
|
||||
export { createWallet } from './api/createWallet'
|
||||
|
@ -1,15 +1,12 @@
|
||||
/*
|
||||
Copyright 2017-2018 @ irontiga and vbcs (original developer)
|
||||
*/
|
||||
'use strict'
|
||||
import Base58 from './deps/Base58.js'
|
||||
import Base58 from './deps/Base58'
|
||||
import { Sha256, Sha512 } from 'asmcrypto.js'
|
||||
import nacl from './deps/nacl-fast.js'
|
||||
import utils from './deps/utils.js'
|
||||
|
||||
import {generateSaveWalletData} from './storeWallet.js'
|
||||
|
||||
import publicKeyToAddress from './wallet/publicKeyToAddress.js'
|
||||
import nacl from './deps/nacl-fast'
|
||||
import utils from './deps/utils'
|
||||
import { generateSaveWalletData } from './storeWallet'
|
||||
import publicKeyToAddress from './wallet/publicKeyToAddress'
|
||||
import AltcoinHDWallet from "./bitcoin/AltcoinHDWallet"
|
||||
|
||||
export default class PhraseWallet {
|
||||
|
@ -1,5 +1,5 @@
|
||||
export { request } from './fetch-request.js'
|
||||
export { transactionTypes as transactions } from './transactions/transactions.js'
|
||||
export { processTransaction, processTransactionVersion2, createTransaction, computeChatNonce, signChatTransaction, signArbitraryTransaction, signArbitraryWithFeeTransaction } from './createTransaction.js'
|
||||
export { tradeBotCreateRequest, tradeBotRespondRequest, signTradeBotTxn, deleteTradeOffer, sendBtc, sendLtc, sendDoge, sendDgb, sendRvn, sendArrr } from './tradeRequest.js'
|
||||
export { cancelAllOffers } from './transactions/trade-portal/tradeoffer/cancelAllOffers.js'
|
||||
export { request } from './fetch-request'
|
||||
export { transactionTypes as transactions } from './transactions/transactions'
|
||||
export { processTransaction, processTransactionVersion2, createTransaction, computeChatNonce, signChatTransaction, signArbitraryTransaction, signArbitraryWithFeeTransaction } from './createTransaction'
|
||||
export { tradeBotCreateRequest, tradeBotRespondRequest, signTradeBotTxn, deleteTradeOffer, sendBtc, sendLtc, sendDoge, sendDgb, sendRvn, sendArrr } from './tradeRequest'
|
||||
export { cancelAllOffers } from './transactions/trade-portal/tradeoffer/cancelAllOffers'
|
||||
|
@ -1,10 +1,9 @@
|
||||
'use strict';
|
||||
import Base58 from '../deps/Base58.js'
|
||||
import Base58 from '../deps/Base58'
|
||||
import { Sha256, Sha512 } from 'asmcrypto.js'
|
||||
import jsSHA from 'jssha'
|
||||
import RIPEMD160 from '../deps/ripemd160.js'
|
||||
import utils from '../deps/utils.js'
|
||||
import {BigInteger, EllipticCurve} from './ecbn.js'
|
||||
import RIPEMD160 from '../deps/ripemd160'
|
||||
import utils from '../deps/utils'
|
||||
import { BigInteger, EllipticCurve } from './ecbn'
|
||||
|
||||
export default class AltcoinHDWallet {
|
||||
|
||||
@ -250,8 +249,7 @@ export default class AltcoinHDWallet {
|
||||
const indicatorString = utils.stringtoUTF8Array(indicator)
|
||||
buffer = utils.appendBuffer(seed.reverse(), indicatorString)
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
buffer = seed.reverse()
|
||||
}
|
||||
}
|
||||
@ -506,7 +504,6 @@ export default class AltcoinHDWallet {
|
||||
const childPublicKeySHA256 = new Sha256().process(new Uint8Array(this.childPublicKey)).finish().result
|
||||
this.childPublicKeyHash = new RIPEMD160().update(Buffer.from(childPublicKeySHA256)).digest('hex')
|
||||
|
||||
|
||||
// Call deriveExtendedPublicChildKey // WIll be hardcoding the values...
|
||||
deriveExtendedPublicChildKey(1, 0)
|
||||
}
|
||||
@ -524,15 +521,12 @@ export default class AltcoinHDWallet {
|
||||
const _hmacSha512 = new jsSHA("SHA-512", "UINT8ARRAY", { numRounds: 1, hmacKey: { value: this.chainCode, format: "UINT8ARRAY" } })
|
||||
_hmacSha512.update(new Uint8Array(s))
|
||||
|
||||
|
||||
const IL = BigInteger.fromByteArrayUnsigned([..._hmacSha512.getHMAC('UINT8ARRAY').slice(0, 32)])
|
||||
this.childChainCode = _hmacSha512.getHMAC('UINT8ARRAY').slice(32, 64) // IR according to the SPEC
|
||||
|
||||
|
||||
// SECP256k1 init
|
||||
const epCurve = EllipticCurve.getSECCurveByName("secp256k1")
|
||||
|
||||
|
||||
const ki = IL.add(BigInteger.fromByteArrayUnsigned(this.privateKey)).mod(epCurve.getN()) // parse256(IL) + kpar (mod n) ==> ki
|
||||
this.childPrivateKey = ki.toByteArrayUnsigned()
|
||||
|
||||
@ -653,7 +647,6 @@ export default class AltcoinHDWallet {
|
||||
this.grandChildPublicKey.unshift(0x03) // append point indicator
|
||||
}
|
||||
|
||||
|
||||
// PublicKey Hash
|
||||
const grandChildPublicKeySHA256 = new Sha256().process(new Uint8Array(this.grandChildPublicKey)).finish().result
|
||||
this.grandChildPublicKeyHash = new RIPEMD160().update(Buffer.from(grandChildPublicKeySHA256)).digest('hex')
|
||||
@ -734,7 +727,6 @@ export default class AltcoinHDWallet {
|
||||
deriveExtendedPrivateGrandChildKey(2, 0)
|
||||
}
|
||||
|
||||
|
||||
const deriveExtendedPrivateGrandChildKey = (i, childIndex) => {
|
||||
|
||||
// Serialization Variable
|
||||
@ -816,8 +808,6 @@ export default class AltcoinHDWallet {
|
||||
this.xPublicGrandChildKey = Base58.encode(s)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Hard Code value..
|
||||
let childIndex = 0
|
||||
|
||||
@ -845,10 +835,6 @@ export default class AltcoinHDWallet {
|
||||
_tDerivedMasterPrivateKey: this._tMasterPrivateKey,
|
||||
_tDerivedmasterPublicKey: this._tmasterPublicKey,
|
||||
seed58: this.seed58,
|
||||
// derivedPrivateChildKey: this.xPrivateChildKey,
|
||||
// derivedPublicChildKey: this.xPublicChildKey,
|
||||
// derivedPrivateGrandChildKey: this.xPrivateGrandChildKey,
|
||||
// derivedPublicGrandChildKey: this.xPublicGrandChildKey,
|
||||
address: this.litecoinLegacyAddress,
|
||||
_taddress: this._tlitecoinLegacyAddress
|
||||
}
|
||||
|
@ -6,8 +6,6 @@
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
|
||||
// Copyright (c) 2005 Tom Wu
|
||||
// All Rights Reserved.
|
||||
// See "LICENSE" for details.
|
||||
@ -1862,8 +1860,6 @@
|
||||
}
|
||||
rng_pptr = 0;
|
||||
rng_seed_time();
|
||||
//rng_seed_int(window.screenX);
|
||||
//rng_seed_int(window.screenY);
|
||||
}
|
||||
|
||||
function rng_get_byte() {
|
||||
@ -1874,7 +1870,6 @@
|
||||
for (rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
|
||||
rng_pool[rng_pptr] = 0;
|
||||
rng_pptr = 0;
|
||||
//rng_pool = null;
|
||||
}
|
||||
// TODO: allow reseeding after first request
|
||||
return rng_state.next();
|
||||
@ -1890,7 +1885,6 @@
|
||||
SecureRandom.prototype.nextBytes = rng_get_bytes;
|
||||
|
||||
// prng4.js - uses Arcfour as a PRNG
|
||||
|
||||
function Arcfour() {
|
||||
this.i = 0;
|
||||
this.j = 0;
|
||||
@ -1934,9 +1928,6 @@
|
||||
// An array of bytes the size of the pool will be passed to init()
|
||||
var rng_psize = 256;
|
||||
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* Basic Javascript Elliptic Curve implementation
|
||||
* Ported loosely from BouncyCastle's Java EC code
|
||||
@ -1949,7 +1940,6 @@
|
||||
// Constructor function of Global EllipticCurve object
|
||||
var ec = function () { };
|
||||
|
||||
|
||||
// ----------------
|
||||
// ECFieldElementFp constructor
|
||||
// q instanceof BigInteger
|
||||
@ -2391,7 +2381,6 @@
|
||||
|
||||
return R;
|
||||
};
|
||||
|
||||
ec.PointFp.prototype.isOnCurve = function () {
|
||||
var x = this.getX().toBigInteger();
|
||||
var y = this.getY().toBigInteger();
|
||||
@ -2444,9 +2433,6 @@
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// ----------------
|
||||
// ECCurveFp constructor
|
||||
ec.CurveFp = function (q, a, b) {
|
||||
|
@ -1853,8 +1853,6 @@
|
||||
}
|
||||
rng_pptr = 0;
|
||||
rng_seed_time();
|
||||
//rng_seed_int(window.screenX);
|
||||
//rng_seed_int(window.screenY);
|
||||
}
|
||||
|
||||
function rng_get_byte() {
|
||||
@ -1865,7 +1863,6 @@
|
||||
for (rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
|
||||
rng_pool[rng_pptr] = 0;
|
||||
rng_pptr = 0;
|
||||
//rng_pool = null;
|
||||
}
|
||||
// TODO: allow reseeding after first request
|
||||
return rng_state.next();
|
||||
|
@ -1,5 +1,3 @@
|
||||
'use strict'
|
||||
|
||||
// Qortal TX types
|
||||
const TX_TYPES = {
|
||||
1: "Genesis",
|
||||
|
@ -1,9 +1,9 @@
|
||||
import {transactionTypes as transactions} from './transactions/transactions.js'
|
||||
import Base58 from './deps/Base58.js'
|
||||
import { transactionTypes as transactions } from './transactions/transactions'
|
||||
import Base58 from './deps/Base58'
|
||||
import { request } from './fetch-request'
|
||||
import signChat from './transactions/chat/signChat.js'
|
||||
import signArbitrary from './transactions/arbitrary/signArbitrary.js'
|
||||
import signArbitraryWithFee from './transactions/arbitrary/signArbitraryWithFee.js'
|
||||
import signChat from './transactions/chat/signChat'
|
||||
import signArbitrary from './transactions/arbitrary/signArbitrary'
|
||||
import signArbitraryWithFee from './transactions/arbitrary/signArbitraryWithFee'
|
||||
|
||||
export const createTransaction = (type, keyPair, params) => {
|
||||
const tx = new transactions[type]()
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {kdf} from './kdf.js'
|
||||
import PhraseWallet from './PhraseWallet.js'
|
||||
import Base58 from './deps/Base58.js'
|
||||
import {decryptStoredWallet} from './decryptStoredWallet.js'
|
||||
import { kdf } from './kdf'
|
||||
import PhraseWallet from './PhraseWallet'
|
||||
import Base58 from './deps/Base58'
|
||||
import { decryptStoredWallet } from './decryptStoredWallet'
|
||||
|
||||
export const createWallet = async (sourceType, source, statusUpdateFn) => {
|
||||
let version, seed
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Base58 from './deps/Base58.js'
|
||||
import {kdf} from './kdf.js'
|
||||
import Base58 from './deps/Base58'
|
||||
import { kdf } from './kdf'
|
||||
import { AES_CBC, HmacSha512 } from 'asmcrypto.js'
|
||||
import { get, registerTranslateConfig } from '../../core/translate'
|
||||
|
||||
|
@ -1,10 +1,6 @@
|
||||
// Generated by CoffeeScript 1.8.0
|
||||
|
||||
// == Changed for ES6 modules == //
|
||||
//(function() {
|
||||
//var ALPHABET, ALPHABET_MAP, Base58, i;
|
||||
|
||||
//const Base58 = (typeof module !== "undefined" && module !== null ? module.exports : void 0) || (window.Base58 = {});
|
||||
const Base58 = {};
|
||||
|
||||
const ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
||||
@ -101,8 +97,5 @@ while (string[i] === "1" && i < string.length - 1) {
|
||||
return new (typeof Uint8Array !== "undefined" && Uint8Array !== null ? Uint8Array : Buffer)(bytes.reverse());
|
||||
};
|
||||
|
||||
|
||||
// == Changed for ES6 modules == //
|
||||
//}).call(this);
|
||||
|
||||
export default Base58;
|
@ -1,8 +1,6 @@
|
||||
|
||||
const Base64 = {};
|
||||
|
||||
|
||||
|
||||
Base64.decode = function (string) {
|
||||
|
||||
const binaryString = atob(string);
|
||||
@ -17,7 +15,4 @@ Base64.decode = function (string) {
|
||||
return decoder.decode(bytes);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
export default Base64;
|
||||
|
@ -41,7 +41,8 @@
|
||||
(global["dcodeIO"] = global["dcodeIO"] || {})["bcrypt"] = factory();
|
||||
|
||||
}(this, function () {
|
||||
"use strict";
|
||||
// == Changed for ESM support == //
|
||||
// "use strict";
|
||||
|
||||
/**
|
||||
* bcrypt namespace.
|
||||
@ -492,7 +493,8 @@
|
||||
* see: https://github.com/dcodeIO/utfx for details
|
||||
*/
|
||||
var utfx = function () {
|
||||
"use strict";
|
||||
// == Changed for ESM support == //
|
||||
// "use strict";
|
||||
|
||||
/**
|
||||
* utfx namespace.
|
||||
|
@ -1,6 +1,5 @@
|
||||
// "Generated from Java with JSweet 1.0.0 - http://www.jsweet.org";
|
||||
// BAD IMPLEMENTATION. BROKEN, BUT MUST KEEP CAUSE OF NETWORK
|
||||
//const RIPEMD160 = (function () {
|
||||
// == Convert to ES6 module for export == //
|
||||
const RIPEMD160 = (function () {
|
||||
function RIPEMD160() {
|
||||
|
@ -1,3 +1,2 @@
|
||||
export { default as Base58 } from './Base58.js'
|
||||
|
||||
export { default as utils } from './utils.js'
|
||||
export { default as Base58 } from './Base58'
|
||||
export { default as utils } from './utils'
|
||||
|
@ -10,15 +10,7 @@
|
||||
Change to es6 import/export
|
||||
*/
|
||||
|
||||
import nacl from './nacl-fast.js'
|
||||
|
||||
// (function(root, f) {
|
||||
// 'use strict';
|
||||
// if (typeof module !== 'undefined' && module.exports) module.exports = f(require('tweetnacl'));
|
||||
// else root.ed2curve = f(root.nacl);
|
||||
// }(this, function(nacl) {
|
||||
// 'use strict';
|
||||
// if (!nacl) throw new Error('tweetnacl not loaded');
|
||||
import nacl from './nacl-fast'
|
||||
|
||||
// -- Operations copied from TweetNaCl.js. --
|
||||
|
||||
@ -249,16 +241,8 @@ import nacl from './nacl-fast.js'
|
||||
};
|
||||
}
|
||||
|
||||
// return {
|
||||
// convertPublicKey: convertPublicKey,
|
||||
// convertSecretKey: convertSecretKey,
|
||||
// convertKeyPair: convertKeyPair,
|
||||
// };
|
||||
|
||||
export default {
|
||||
convertPublicKey: convertPublicKey,
|
||||
convertSecretKey: convertSecretKey,
|
||||
convertKeyPair: convertKeyPair,
|
||||
}
|
||||
|
||||
// }));
|
||||
|
@ -1,7 +1,5 @@
|
||||
// == CHANGE TO ES6 EXPORT == //
|
||||
const nacl = {}
|
||||
//(function(nacl) {
|
||||
'use strict';
|
||||
|
||||
// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.
|
||||
// Public domain.
|
||||
@ -2418,5 +2416,4 @@ nacl.setPRNG = function(fn) {
|
||||
})();
|
||||
|
||||
// == CHANGE TO ES6 EXPORT == //
|
||||
//})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {}));
|
||||
export default nacl
|
||||
|
@ -26,8 +26,7 @@ const TYPES = {
|
||||
MESSAGE_TRANSACTION: 17
|
||||
};
|
||||
|
||||
function getKeyPairFromSeed(seed, returnBase58)
|
||||
{
|
||||
function getKeyPairFromSeed(seed, returnBase58) {
|
||||
if (typeof (seed) == "string") {
|
||||
seed = new Uint8Array(Base58.decode(seed));
|
||||
}
|
||||
@ -90,20 +89,17 @@ function appendBuffer (buffer1, buffer2) {
|
||||
return tmp;
|
||||
}
|
||||
|
||||
function equal (buf1, buf2)
|
||||
{
|
||||
function equal(buf1, buf2) {
|
||||
if (buf1.byteLength != buf2.byteLength) return false;
|
||||
var dv1 = new Uint8Array(buf1);
|
||||
var dv2 = new Uint8Array(buf2);
|
||||
for (var i = 0; i != buf1.byteLength; i++)
|
||||
{
|
||||
for (var i = 0; i != buf1.byteLength; i++) {
|
||||
if (dv1[i] != dv2[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function generateAccountSeed(seed, nonce, returnBase58)
|
||||
{
|
||||
function generateAccountSeed(seed, nonce, returnBase58) {
|
||||
if (typeof (seed) == "string") {
|
||||
seed = Base58.decode(seed);
|
||||
}
|
||||
@ -124,8 +120,7 @@ function generateAccountSeed(seed, nonce, returnBase58)
|
||||
|
||||
}
|
||||
|
||||
function getAccountAddressFromPublicKey(publicKey)
|
||||
{
|
||||
function getAccountAddressFromPublicKey(publicKey) {
|
||||
var ADDRESS_VERSION = 58; // Q
|
||||
|
||||
if (typeof (publicKey) == "string") {
|
||||
@ -150,8 +145,7 @@ function getAccountAddressFromPublicKey(publicKey)
|
||||
return Base58.encode(addressArray);
|
||||
}
|
||||
|
||||
function getAccountAddressType(address)
|
||||
{
|
||||
function getAccountAddressType(address) {
|
||||
try {
|
||||
var ADDRESS_VERSION = 58; // Q
|
||||
var AT_ADDRESS_VERSION = 23; // A
|
||||
@ -166,14 +160,11 @@ function getAccountAddressType(address)
|
||||
var checkSumTwo = SHA256.digest(SHA256.digest(addressWitoutChecksum));
|
||||
checkSumTwo = checkSumTwo.subarray(0, 4);
|
||||
|
||||
if (equal(checkSum, checkSumTwo))
|
||||
{
|
||||
if(address[0] == ADDRESS_VERSION)
|
||||
{
|
||||
if (equal(checkSum, checkSumTwo)) {
|
||||
if (address[0] == ADDRESS_VERSION) {
|
||||
return "standard";
|
||||
}
|
||||
if(address[0] == AT_ADDRESS_VERSION)
|
||||
{
|
||||
if (address[0] == AT_ADDRESS_VERSION) {
|
||||
return "at";
|
||||
}
|
||||
}
|
||||
@ -185,8 +176,7 @@ function getAccountAddressType(address)
|
||||
}
|
||||
}
|
||||
|
||||
function isValidAddress(address)
|
||||
{
|
||||
function isValidAddress(address) {
|
||||
return (getAccountAddressType(address) != "invalid");
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
// Extracted from https://github.com/crypto-browserify/ripemd160
|
||||
|
||||
const ARRAY16 = new Array(16);
|
||||
|
||||
const zl = initU8Array([
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
|
||||
|
@ -137,6 +137,5 @@ SHA256.hash = function(message) {
|
||||
return hex;
|
||||
}
|
||||
|
||||
|
||||
// == Convert to ES6 Module == //
|
||||
export default SHA256;
|
@ -1,4 +1,3 @@
|
||||
'use strict'
|
||||
const utils = {
|
||||
int32ToBytes(word) {
|
||||
var byteArray = []
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {waitForConfig, watchConfig} from '../config.js'
|
||||
import { waitForConfig, watchConfig } from '../config'
|
||||
|
||||
let config = {}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {store} from '../api_deps.js'
|
||||
import {stateAwait} from './utils/stateAwait.js'
|
||||
import { store } from '../api_deps'
|
||||
import { stateAwait } from './utils/stateAwait'
|
||||
import { Sha512 } from 'asmcrypto.js'
|
||||
import utils from '../api/deps/utils.js'
|
||||
import utils from '../api/deps/utils'
|
||||
import { get, registerTranslateConfig } from '../../core/translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Not to be confused with register name...this is a special use case
|
||||
*/
|
||||
import {createTransaction, processTransaction, request} from './api.js'
|
||||
import { createTransaction, processTransaction, request } from './api'
|
||||
|
||||
const TX_TYPE = 3 // NAME_REGISTRATION
|
||||
const CHECK_LAST_REF_INTERVAL = 30 * 1000 // err 30 seconds
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { AES_CBC, HmacSha512 } from 'asmcrypto.js'
|
||||
import {kdf} from './kdf.js'
|
||||
import Base58 from './deps/Base58.js'
|
||||
import { kdf } from './kdf'
|
||||
import Base58 from './deps/Base58'
|
||||
|
||||
const getRandomValues = window.crypto ? window.crypto.getRandomValues.bind(window.crypto) : window.msCrypto.getRandomValues.bind(window.msCrypto)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Trade Bot
|
||||
import TradeBotCreateRequest from './transactions/trade-portal/tradebot/TradeBotCreateRequest.js'
|
||||
import TradeBotRespondRequest from './transactions/trade-portal/tradebot/TradeBotRespondRequest.js'
|
||||
import signTradeBotTransaction from './transactions/trade-portal/tradebot/signTradeBotTransaction.js'
|
||||
import DeleteTradeOffer from './transactions/trade-portal/tradeoffer/DeleteTradeOffer.js'
|
||||
import TradeBotCreateRequest from './transactions/trade-portal/tradebot/TradeBotCreateRequest'
|
||||
import TradeBotRespondRequest from './transactions/trade-portal/tradebot/TradeBotRespondRequest'
|
||||
import signTradeBotTransaction from './transactions/trade-portal/tradebot/signTradeBotTransaction'
|
||||
import DeleteTradeOffer from './transactions/trade-portal/tradeoffer/DeleteTradeOffer'
|
||||
import { request } from './fetch-request'
|
||||
|
||||
// TradeBotCreateRequest
|
||||
|
@ -1,5 +1,3 @@
|
||||
'use strict'
|
||||
|
||||
(function () {
|
||||
function generateSignatureArbitraryTransactionV3(keyPair, lastReference, service, arbitraryData, fee, timestamp) => {
|
||||
const data = generateArbitraryTransactionV3Base(keyPair.publicKey, lastReference, service, arbitraryData, fee, timestamp)
|
||||
|
@ -106,7 +106,7 @@ export default class CreatePollTransaction extends TransactionBase {
|
||||
params.push(this._options[i].length, this._options[i].bytes)
|
||||
}
|
||||
|
||||
params.push(this._feeBytes);
|
||||
params.push(this._feeBytes)
|
||||
|
||||
return params
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
'use strict'
|
||||
|
||||
(function () {
|
||||
function generateSignatureRegisterNameTransaction(keyPair, lastReference, owner, name, value, fee, timestamp) => {
|
||||
const data = generateRegisterNameTransactionBase(keyPair.publicKey, lastReference, owner, name, value, fee, timestamp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {store} from '../../api.js'
|
||||
import { store } from '../../api'
|
||||
|
||||
let subscriptions = []
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import publicKeyToAddress from './publicKeyToAddress'
|
||||
import Base58 from '../deps/Base58.js'
|
||||
import Base58 from '../deps/Base58'
|
||||
|
||||
export const base58PublicKeyToAddress = (base58pubkey, qora = false) => {
|
||||
const decodePubKey = Base58.decode(base58pubkey)
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Base58 from '../deps/Base58.js'
|
||||
import BROKEN_RIPEMD160 from '../deps/broken-ripemd160.js'
|
||||
import RIPEMD160 from '../deps/ripemd160.js'
|
||||
import utils from '../deps/utils.js'
|
||||
import {ADDRESS_VERSION} from '../constants.js'
|
||||
import Base58 from '../deps/Base58'
|
||||
import BROKEN_RIPEMD160 from '../deps/broken-ripemd160'
|
||||
import RIPEMD160 from '../deps/ripemd160'
|
||||
import utils from '../deps/utils'
|
||||
import { ADDRESS_VERSION } from '../constants'
|
||||
import { Buffer } from 'buffer'
|
||||
import { Sha256 } from 'asmcrypto.js'
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Base58 from '../deps/Base58.js'
|
||||
import Base58 from '../deps/Base58'
|
||||
|
||||
export const validateAddress = (address) => {
|
||||
const decodePubKey = Base58.decode(address)
|
||||
|
||||
return decodePubKey instanceof Uint8Array && decodePubKey.length == 25;
|
||||
return decodePubKey instanceof Uint8Array && decodePubKey.length == 25
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {store} from './api.js'
|
||||
import { store } from './api'
|
||||
|
||||
let config = false
|
||||
let loaded = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user