Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlincecum authored and rileystephens28 committed Oct 12, 2024
1 parent 3406b2b commit 2b95e27
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 8 deletions.
63 changes: 59 additions & 4 deletions dist/quais.js
Original file line number Diff line number Diff line change
Expand Up @@ -8392,6 +8392,16 @@ function parseUnits(value, unit) {
function formatQuai(wei) {
return formatUnits(wei, 18);
}
/**
* Converts `value` into a decimal string using 3 decimal places.
*
* @category Utils
* @param {BigNumberish} value - The value to convert.
* @returns {string} The converted value.
*/
function formatQi(value) {
return formatUnits(value, 3);
}
/**
* Converts the decimal string `quai` to a BigInt, using 18 decimal places.
*
Expand All @@ -8402,6 +8412,16 @@ function formatQuai(wei) {
function parseQuai(ether) {
return parseUnits(ether, 18);
}
/**
* Converts `value` into a decimal string using 3 decimal places.
*
* @category Utils
* @param {string} value - The value to convert.
* @returns {bigint} The converted value.
*/
function parseQi(value) {
return parseUnits(value, 3);
}

/**
* Explain UUID and link to RFC here.
Expand Down Expand Up @@ -30318,9 +30338,42 @@ class AbstractProvider {
* @returns {Promise<number>} A promise that resolves to the protocol expansion number.
*/
async getProtocolExpansionNumber() {
return await this.#perform({
method: 'getProtocolExpansionNumber',
});
return getNumber(await this.#perform({ method: 'getProtocolExpansionNumber' }));
}
/**
* Get the active region shards based on the protocol expansion number.
*
* @returns {Promise<Shard[]>} A promise that resolves to the active shards.
*/
async getActiveRegions() {
const protocolExpansionNumber = await this.getProtocolExpansionNumber();
const shards = [Shard.Cyprus];
if (protocolExpansionNumber >= 1) {
shards.push(Shard.Paxos);
}
if (protocolExpansionNumber >= 3) {
shards.push(Shard.Hydra);
}
return shards.sort((a, b) => a.localeCompare(b));
}
/**
* Get the active zones for a shard based on the protocol expansion number.
*
* @returns {Promise<Zone[]>} A promise that resolves to the active zones.
*/
async getActiveZones() {
const protocolExpansionNumber = await this.getProtocolExpansionNumber();
const zones = [Zone.Cyprus1];
if (protocolExpansionNumber >= 1) {
zones.push(Zone.Cyprus2);
}
if (protocolExpansionNumber >= 2) {
zones.push(Zone.Paxos1, Zone.Paxos2);
}
if (protocolExpansionNumber >= 3) {
zones.push(Zone.Cyprus3, Zone.Paxos3, Zone.Hydra1, Zone.Hydra2, Zone.Hydra3);
}
return zones.sort((a, b) => a.localeCompare(b));
}
/**
* Get the latest Qi rate for a zone.
Expand Down Expand Up @@ -34107,6 +34160,7 @@ var quais = /*#__PURE__*/Object.freeze({
ethHashMessage: ethHashMessage,
ethVerifyMessage: ethVerifyMessage,
formatMixedCaseChecksumAddress: formatMixedCaseChecksumAddress,
formatQi: formatQi,
formatQuai: formatQuai,
formatUnits: formatUnits,
fromTwos: fromTwos,
Expand Down Expand Up @@ -34138,6 +34192,7 @@ var quais = /*#__PURE__*/Object.freeze({
makeError: makeError,
mask: mask,
musigCrypto: musigCrypto,
parseQi: parseQi,
parseQuai: parseQuai,
parseUnits: parseUnits,
pbkdf2: pbkdf2,
Expand Down Expand Up @@ -34175,5 +34230,5 @@ var quais = /*#__PURE__*/Object.freeze({
zeroPadValue: zeroPadValue
});

export { AbiCoder, AbstractProvider, AbstractSigner, BaseContract, Block, BrowserProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, ErrorDescription, ErrorFragment, EventFragment, EventLog, EventPayload, FallbackFragment, FeeData, FetchCancelSignal, FetchRequest, FetchResponse, FewestCoinSelector, FixedNumber, Fragment, FunctionFragment, Indexed, Interface, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, LangEs, Ledger, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, N$1 as N, NamedFragment, Network, ParamType, QiHDWallet, QiTransaction, QuaiHDWallet, QuaiTransaction, Result, Shard, Signature, SigningKey, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketProvider, SocketSubscriber, StructFragment, TransactionDescription, TransactionReceipt, Typed, TypedDataEncoder, UTXO, UndecodedEventLog, UnmanagedSubscriber, VoidSigner, Wallet, WebSocketProvider, WeiPerEther, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, Zone, accessListify, checkResultErrors, computeAddress, computeHmac, concat, copyRequest, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32, decryptKeystoreJson, decryptKeystoreJsonSync, denominations, encodeBase58, encodeBase64, encodeBytes32, encryptKeystoreJson, encryptKeystoreJsonSync, ethHashMessage, ethVerifyMessage, formatMixedCaseChecksumAddress, formatQuai, formatUnits, fromTwos, getAddress, getAddressDetails, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getNumber, getTxType, getUint, getZoneForAddress, hashMessage, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isError, isHexString, isKeystoreJson, isQiAddress, isQuaiAddress, keccak256, lock, makeError, mask, musigCrypto, parseQuai, parseUnits, pbkdf2, quais, quaisymbol, randomBytes, recoverAddress, resolveAddress, ripemd160, scrypt, scryptSync, sha256, sha512, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toShard, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, toZone, uuidV4, validateAddress, verifyMessage, verifyTypedData, version, wordlists, zeroPadBytes, zeroPadValue };
export { AbiCoder, AbstractProvider, AbstractSigner, BaseContract, Block, BrowserProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, ErrorDescription, ErrorFragment, EventFragment, EventLog, EventPayload, FallbackFragment, FeeData, FetchCancelSignal, FetchRequest, FetchResponse, FewestCoinSelector, FixedNumber, Fragment, FunctionFragment, Indexed, Interface, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, LangEs, Ledger, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, N$1 as N, NamedFragment, Network, ParamType, QiHDWallet, QiTransaction, QuaiHDWallet, QuaiTransaction, Result, Shard, Signature, SigningKey, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketProvider, SocketSubscriber, StructFragment, TransactionDescription, TransactionReceipt, Typed, TypedDataEncoder, UTXO, UndecodedEventLog, UnmanagedSubscriber, VoidSigner, Wallet, WebSocketProvider, WeiPerEther, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, Zone, accessListify, checkResultErrors, computeAddress, computeHmac, concat, copyRequest, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32, decryptKeystoreJson, decryptKeystoreJsonSync, denominations, encodeBase58, encodeBase64, encodeBytes32, encryptKeystoreJson, encryptKeystoreJsonSync, ethHashMessage, ethVerifyMessage, formatMixedCaseChecksumAddress, formatQi, formatQuai, formatUnits, fromTwos, getAddress, getAddressDetails, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getNumber, getTxType, getUint, getZoneForAddress, hashMessage, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isError, isHexString, isKeystoreJson, isQiAddress, isQuaiAddress, keccak256, lock, makeError, mask, musigCrypto, parseQi, parseQuai, parseUnits, pbkdf2, quais, quaisymbol, randomBytes, recoverAddress, resolveAddress, ripemd160, scrypt, scryptSync, sha256, sha512, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toShard, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, toZone, uuidV4, validateAddress, verifyMessage, verifyTypedData, version, wordlists, zeroPadBytes, zeroPadValue };
//# sourceMappingURL=quais.js.map
2 changes: 1 addition & 1 deletion dist/quais.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/quais.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/quais.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/quais.umd.min.js

Large diffs are not rendered by default.

0 comments on commit 2b95e27

Please sign in to comment.