FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

12
node_modules/viem/_esm/celo/chainConfig.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import { contracts } from '../op-stack/contracts.js';
import { fees } from './fees.js';
import { formatters } from './formatters.js';
import { serializers } from './serializers.js';
export const chainConfig = {
blockTime: 1_000,
contracts,
formatters,
serializers,
fees,
};
//# sourceMappingURL=chainConfig.js.map

1
node_modules/viem/_esm/celo/chainConfig.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"chainConfig.js","sourceRoot":"","sources":["../../celo/chainConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE,KAAK;IAChB,SAAS;IACT,UAAU;IACV,WAAW;IACX,IAAI;CACI,CAAA"}

58
node_modules/viem/_esm/celo/fees.js generated vendored Normal file
View File

@@ -0,0 +1,58 @@
export const fees = {
/*
* Estimates the fees per gas for a transaction.
* If the transaction is to be paid in a token (feeCurrency is present) then the fees
* are estimated in the value of the token. Otherwise falls back to the default
* estimation by returning null.
*
* @param params fee estimation function parameters
*/
estimateFeesPerGas: async (params) => {
if (!params.request?.feeCurrency)
return null;
const [gasPrice, maxPriorityFeePerGas] = await Promise.all([
estimateFeePerGasInFeeCurrency(params.client, params.request.feeCurrency),
estimateMaxPriorityFeePerGasInFeeCurrency(params.client, params.request.feeCurrency),
]);
// eth_gasPrice for cel2 returns baseFeePerGas + maxPriorityFeePerGas
const maxFeePerGas = params.multiply(gasPrice - maxPriorityFeePerGas) + maxPriorityFeePerGas;
return {
maxFeePerGas,
maxPriorityFeePerGas,
};
},
};
/*
* Estimate the fee per gas in the value of the fee token
*
* @param client - Client to use
* @param feeCurrency - Address of a whitelisted fee token
* @returns The fee per gas in wei in the value of the fee token
*
*/
async function estimateFeePerGasInFeeCurrency(client, feeCurrency) {
const fee = await client.request({
method: 'eth_gasPrice',
params: [feeCurrency],
});
return BigInt(fee);
}
/*
* Estimate the max priority fee per gas in the value of the fee token
*
* @param client - Client to use
* @param feeCurrency - Address of a whitelisted fee token
* @returns The fee per gas in wei in the value of the fee token
*
*/
async function estimateMaxPriorityFeePerGasInFeeCurrency(client, feeCurrency) {
const feesPerGas = await client.request({
method: 'eth_maxPriorityFeePerGas',
params: [feeCurrency],
});
return BigInt(feesPerGas);
}
//# sourceMappingURL=fees.js.map

1
node_modules/viem/_esm/celo/fees.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"fees.js","sourceRoot":"","sources":["../../celo/fees.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,IAAI,GAAiC;IAChD;;;;;;;;OAQG;IACH,kBAAkB,EAAE,KAAK,EACvB,MAA8D,EAC9D,EAAE;QACF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW;YAAE,OAAO,IAAI,CAAA;QAE7C,MAAM,CAAC,QAAQ,EAAE,oBAAoB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACzD,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;YACzE,yCAAyC,CACvC,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,OAAO,CAAC,WAAW,CAC3B;SACF,CAAC,CAAA;QAEF,qEAAqE;QACrE,MAAM,YAAY,GAChB,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,oBAAoB,CAAC,GAAG,oBAAoB,CAAA;QAEzE,OAAO;YACL,YAAY;YACZ,oBAAoB;SACrB,CAAA;IACH,CAAC;CACF,CAAA;AAQD;;;;;;;;GAQG;AACH,KAAK,UAAU,8BAA8B,CAC3C,MAAc,EACd,WAAoB;IAEpB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,OAAO,CAAqC;QACnE,MAAM,EAAE,cAAc;QACtB,MAAM,EAAE,CAAC,WAAW,CAAC;KACtB,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;AACpB,CAAC;AAQD;;;;;;;;GAQG;AACH,KAAK,UAAU,yCAAyC,CACtD,MAAc,EACd,WAAoB;IAEpB,MAAM,UAAU,GACd,MAAM,MAAM,CAAC,OAAO,CAAwC;QAC1D,MAAM,EAAE,0BAA0B;QAClC,MAAM,EAAE,CAAC,WAAW,CAAC;KACtB,CAAC,CAAA;IACJ,OAAO,MAAM,CAAC,UAAU,CAAC,CAAA;AAC3B,CAAC"}

63
node_modules/viem/_esm/celo/formatters.js generated vendored Normal file
View File

@@ -0,0 +1,63 @@
import { hexToBigInt } from '../utils/encoding/fromHex.js';
import { defineBlock } from '../utils/formatters/block.js';
import { defineTransaction, formatTransaction, } from '../utils/formatters/transaction.js';
import { defineTransactionRequest } from '../utils/formatters/transactionRequest.js';
import { isCIP64 } from './utils.js';
export const formatters = {
block: /*#__PURE__*/ defineBlock({
format(args) {
const transactions = args.transactions?.map((transaction) => {
if (typeof transaction === 'string')
return transaction;
const formatted = formatTransaction(transaction);
return {
...formatted,
...(transaction.gatewayFee
? {
gatewayFee: hexToBigInt(transaction.gatewayFee),
gatewayFeeRecipient: transaction.gatewayFeeRecipient,
}
: {}),
feeCurrency: transaction.feeCurrency,
};
});
return {
transactions,
};
},
}),
transaction: /*#__PURE__*/ defineTransaction({
format(args) {
if (args.type === '0x7e')
return {
isSystemTx: args.isSystemTx,
mint: args.mint ? hexToBigInt(args.mint) : undefined,
sourceHash: args.sourceHash,
type: 'deposit',
};
const transaction = { feeCurrency: args.feeCurrency };
if (args.type === '0x7b')
transaction.type = 'cip64';
else {
if (args.type === '0x7c')
transaction.type = 'cip42';
transaction.gatewayFee = args.gatewayFee
? hexToBigInt(args.gatewayFee)
: null;
transaction.gatewayFeeRecipient = args.gatewayFeeRecipient;
}
return transaction;
},
}),
transactionRequest: /*#__PURE__*/ defineTransactionRequest({
format(args) {
const request = {};
if (args.feeCurrency)
request.feeCurrency = args.feeCurrency;
if (isCIP64(args))
request.type = '0x7b';
return request;
},
}),
};
//# sourceMappingURL=formatters.js.map

1
node_modules/viem/_esm/celo/formatters.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../celo/formatters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAA;AASpF,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC;QAC/B,MAAM,CAAC,IAAkB;YACvB,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;gBAC1D,IAAI,OAAO,WAAW,KAAK,QAAQ;oBAAE,OAAO,WAAW,CAAA;gBACvD,MAAM,SAAS,GAAG,iBAAiB,CAAC,WAA6B,CAAC,CAAA;gBAClE,OAAO;oBACL,GAAG,SAAS;oBACZ,GAAG,CAAC,WAAW,CAAC,UAAU;wBACxB,CA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O,GAAG,EAA+B,CAAA;YAE/C,IAAI,IAAI,CAAC,WAAW;gBAAE,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;YAC5D,IAAI,OAAO,CAAC,IAAI,CAAC;gBAAE,OAAO,CAAC,IAAI,GAAG,MAAM,CAAA;YAExC,OAAO,OAAO,CAAA;QAChB,CAAC;KACF,CAAC;CACgC,CAAA"}

5
node_modules/viem/_esm/celo/index.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
// biome-ignore lint/performance/noBarrelFile: entrypoint module
export { chainConfig } from './chainConfig.js';
export { parseTransaction } from './parsers.js';
export { serializeTransaction, } from './serializers.js';
//# sourceMappingURL=index.js.map

1
node_modules/viem/_esm/celo/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../celo/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAmC,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEhF,OAAO,EAEL,oBAAoB,GACrB,MAAM,kBAAkB,CAAA"}

128
node_modules/viem/_esm/celo/parsers.js generated vendored Normal file
View File

@@ -0,0 +1,128 @@
import { InvalidSerializedTransactionError } from '../errors/transaction.js';
import { parseTransaction as parseTransaction_op } from '../op-stack/parsers.js';
import { isHex } from '../utils/data/isHex.js';
import { sliceHex } from '../utils/data/slice.js';
import { hexToBigInt, hexToNumber } from '../utils/encoding/fromHex.js';
import { parseAccessList, toTransactionArray, } from '../utils/transaction/parseTransaction.js';
import { assertTransactionCIP42, assertTransactionCIP64, } from './serializers.js';
export function parseTransaction(serializedTransaction) {
const serializedType = sliceHex(serializedTransaction, 0, 1);
if (serializedType === '0x7c')
return parseTransactionCIP42(serializedTransaction);
if (serializedType === '0x7b')
return parseTransactionCIP64(serializedTransaction);
return parseTransaction_op(serializedTransaction);
}
function parseTransactionCIP42(serializedTransaction) {
const transactionArray = toTransactionArray(serializedTransaction);
const [chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gas, feeCurrency, gatewayFeeRecipient, gatewayFee, to, value, data, accessList, v, r, s,] = transactionArray;
if (transactionArray.length !== 15 && transactionArray.length !== 12) {
throw new InvalidSerializedTransactionError({
attributes: {
chainId,
nonce,
maxPriorityFeePerGas,
maxFeePerGas,
gas,
feeCurrency,
to,
gatewayFeeRecipient,
gatewayFee,
value,
data,
accessList,
...(transactionArray.length > 12
? {
v,
r,
s,
}
: {}),
},
serializedTransaction,
type: 'cip42',
});
}
const transaction = {
chainId: hexToNumber(chainId),
type: 'cip42',
};
if (isHex(to) && to !== '0x')
transaction.to = to;
if (isHex(gas) && gas !== '0x')
transaction.gas = hexToBigInt(gas);
if (isHex(data) && data !== '0x')
transaction.data = data;
if (isHex(nonce) && nonce !== '0x')
transaction.nonce = hexToNumber(nonce);
if (isHex(value) && value !== '0x')
transaction.value = hexToBigInt(value);
if (isHex(feeCurrency) && feeCurrency !== '0x')
transaction.feeCurrency = feeCurrency;
if (isHex(gatewayFeeRecipient) && gatewayFeeRecipient !== '0x')
transaction.gatewayFeeRecipient = gatewayFeeRecipient;
if (isHex(gatewayFee) && gatewayFee !== '0x')
transaction.gatewayFee = hexToBigInt(gatewayFee);
if (isHex(maxFeePerGas) && maxFeePerGas !== '0x')
transaction.maxFeePerGas = hexToBigInt(maxFeePerGas);
if (isHex(maxPriorityFeePerGas) && maxPriorityFeePerGas !== '0x')
transaction.maxPriorityFeePerGas = hexToBigInt(maxPriorityFeePerGas);
if (accessList.length !== 0 && accessList !== '0x')
transaction.accessList = parseAccessList(accessList);
assertTransactionCIP42(transaction);
return transaction;
}
function parseTransactionCIP64(serializedTransaction) {
const transactionArray = toTransactionArray(serializedTransaction);
const [chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gas, to, value, data, accessList, feeCurrency, v, r, s,] = transactionArray;
if (transactionArray.length !== 13 && transactionArray.length !== 10) {
throw new InvalidSerializedTransactionError({
attributes: {
chainId,
nonce,
maxPriorityFeePerGas,
maxFeePerGas,
gas,
to,
value,
data,
accessList,
feeCurrency,
...(transactionArray.length > 10
? {
v,
r,
s,
}
: {}),
},
serializedTransaction,
type: 'cip64',
});
}
const transaction = {
chainId: hexToNumber(chainId),
type: 'cip64',
};
if (isHex(to) && to !== '0x')
transaction.to = to;
if (isHex(gas) && gas !== '0x')
transaction.gas = hexToBigInt(gas);
if (isHex(data) && data !== '0x')
transaction.data = data;
if (isHex(nonce) && nonce !== '0x')
transaction.nonce = hexToNumber(nonce);
if (isHex(value) && value !== '0x')
transaction.value = hexToBigInt(value);
if (isHex(feeCurrency) && feeCurrency !== '0x')
transaction.feeCurrency = feeCurrency;
if (isHex(maxFeePerGas) && maxFeePerGas !== '0x')
transaction.maxFeePerGas = hexToBigInt(maxFeePerGas);
if (isHex(maxPriorityFeePerGas) && maxPriorityFeePerGas !== '0x')
transaction.maxPriorityFeePerGas = hexToBigInt(maxPriorityFeePerGas);
if (accessList.length !== 0 && accessList !== '0x')
transaction.accessList = parseAccessList(accessList);
assertTransactionCIP64(transaction);
return transaction;
}
//# sourceMappingURL=parsers.js.map

1
node_modules/viem/_esm/celo/parsers.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../celo/parsers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OAAO,EAAE,gBAAgB,IAAI,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAGhF,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAGvE,OAAO,EAEL,eAAe,EACf,kBAAkB,GACnB,MAAM,0CAA0C,CAAA;AACjD,OAAO,EACL,sBAAsB,EACtB,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KAAK,IAAI;QAAE,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;IAClE,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,IAAI;QAAE,WAAW,CAAC,IAAI,GAAG,IAAI,CAAA;IACzD,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI;QAAE,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA;IAC1E,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI;QAAE,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA;IAC1E,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,WAAW,KAAK,IAAI;QAC5C,WAAW,CAAC,WAAW,GAAG,WAAW,CAAA;IACvC,IAAI,KAAK,CAAC,YAAY,CAAC,IAAI,YAAY,KAAK,IAAI;QAC9C,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;IACtD,IAAI,KAAK,CAAC,oBAAoB,CAAC,IAAI,oBAAoB,KAAK,IAAI;QAC9D,WAAW,CAAC,oBAAoB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAA;IACtE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,KAAK,IAAI;QAChD,WAAW,CAAC,UAAU,GAAG,eAAe,CAAC,UAAiC,CAAC,CAAA;IAE7E,sBAAsB,CAAC,WAA2C,CAAC,CAAA;IAEnE,OAAO,WAA2C,CAAA;AACpD,CAAC"}

94
node_modules/viem/_esm/celo/serializers.js generated vendored Normal file
View File

@@ -0,0 +1,94 @@
import { maxUint256 } from '../constants/number.js';
import { InvalidAddressError } from '../errors/address.js';
import { BaseError } from '../errors/base.js';
import { InvalidChainIdError } from '../errors/chain.js';
import { FeeCapTooHighError, TipAboveFeeCapError } from '../errors/node.js';
import { serializeTransaction as serializeTransaction_op } from '../op-stack/serializers.js';
import { isAddress } from '../utils/address/isAddress.js';
import { concatHex } from '../utils/data/concat.js';
import { toHex } from '../utils/encoding/toHex.js';
import { toRlp } from '../utils/encoding/toRlp.js';
import { serializeAccessList } from '../utils/transaction/serializeAccessList.js';
import { toYParitySignatureArray } from '../utils/transaction/serializeTransaction.js';
import { isCIP64, isEmpty, isPresent } from './utils.js';
export function serializeTransaction(transaction, signature) {
if (isCIP64(transaction))
return serializeTransactionCIP64(transaction, signature);
return serializeTransaction_op(transaction, signature);
}
export const serializers = {
transaction: serializeTransaction,
};
function serializeTransactionCIP64(transaction, signature) {
assertTransactionCIP64(transaction);
const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, feeCurrency, data, } = transaction;
const serializedTransaction = [
toHex(chainId),
nonce ? toHex(nonce) : '0x',
maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : '0x',
maxFeePerGas ? toHex(maxFeePerGas) : '0x',
gas ? toHex(gas) : '0x',
to ?? '0x',
value ? toHex(value) : '0x',
data ?? '0x',
serializeAccessList(accessList),
feeCurrency,
...toYParitySignatureArray(transaction, signature),
];
return concatHex([
'0x7b',
toRlp(serializedTransaction),
]);
}
// maxFeePerGas must be less than maxUint256
const MAX_MAX_FEE_PER_GAS = maxUint256;
export function assertTransactionCIP42(transaction) {
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to, feeCurrency, gatewayFee, gatewayFeeRecipient, } = transaction;
if (chainId <= 0)
throw new InvalidChainIdError({ chainId });
if (to && !isAddress(to))
throw new InvalidAddressError({ address: to });
if (gasPrice)
throw new BaseError('`gasPrice` is not a valid CIP-42 Transaction attribute.');
if (isPresent(maxFeePerGas) && maxFeePerGas > MAX_MAX_FEE_PER_GAS)
throw new FeeCapTooHighError({ maxFeePerGas });
if (isPresent(maxPriorityFeePerGas) &&
isPresent(maxFeePerGas) &&
maxPriorityFeePerGas > maxFeePerGas)
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
if ((isPresent(gatewayFee) && isEmpty(gatewayFeeRecipient)) ||
(isPresent(gatewayFeeRecipient) && isEmpty(gatewayFee))) {
throw new BaseError('`gatewayFee` and `gatewayFeeRecipient` must be provided together.');
}
if (isPresent(feeCurrency) && !isAddress(feeCurrency)) {
throw new BaseError('`feeCurrency` MUST be a token address for CIP-42 transactions.');
}
if (isPresent(gatewayFeeRecipient) && !isAddress(gatewayFeeRecipient)) {
throw new InvalidAddressError(gatewayFeeRecipient);
}
if (isEmpty(feeCurrency) && isEmpty(gatewayFeeRecipient)) {
throw new BaseError('Either `feeCurrency` or `gatewayFeeRecipient` must be provided for CIP-42 transactions.');
}
}
export function assertTransactionCIP64(transaction) {
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to, feeCurrency, } = transaction;
if (chainId <= 0)
throw new InvalidChainIdError({ chainId });
if (to && !isAddress(to))
throw new InvalidAddressError({ address: to });
if (gasPrice)
throw new BaseError('`gasPrice` is not a valid CIP-64 Transaction attribute.');
if (isPresent(maxFeePerGas) && maxFeePerGas > MAX_MAX_FEE_PER_GAS)
throw new FeeCapTooHighError({ maxFeePerGas });
if (isPresent(maxPriorityFeePerGas) &&
isPresent(maxFeePerGas) &&
maxPriorityFeePerGas > maxFeePerGas)
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
if (isPresent(feeCurrency) && !isAddress(feeCurrency)) {
throw new BaseError('`feeCurrency` MUST be a token address for CIP-64 transactions.');
}
if (isEmpty(feeCurrency)) {
throw new BaseError('`feeCurrency` must be provided for CIP-64 transactions.');
}
}
//# sourceMappingURL=serializers.js.map

1
node_modules/viem/_esm/celo/serializers.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"serializers.js","sourceRoot":"","sources":["../../celo/serializers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,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AAE,EAAE,CAAC,CAAA;IAExE,IAAI,QAAQ;QACV,MAAM,IAAI,SAAS,CACjB,yDAAyD,CAC1D,CAAA;IAEH,IAAI,SAAS,CAAC,YAAY,CAAC,IAAI,YAAY,GAAG,mBAAmB;QAC/D,MAAM,IAAI,kBAAkB,CAAC,EAAE,YAAY,EAAE,CAAC,CAAA;IAChD,IACE,SAAS,CAAC,oBAAoB,CAAC;QAC/B,SAAS,CAAC,YAAY,CAAC;QACvB,oBAAoB,GAAG,YAAY;QAEnC,MAAM,IAAI,mBAAmB,CAAC,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC,CAAA;IAEvE,IAAI,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,SAAS,CACjB,gEAAgE,CACjE,CAAA;IACH,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CACjB,yDAAyD,CAC1D,CAAA;IACH,CAAC;AACH,CAAC"}

2
node_modules/viem/_esm/celo/types.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=types.js.map

1
node_modules/viem/_esm/celo/types.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../celo/types.ts"],"names":[],"mappings":""}

37
node_modules/viem/_esm/celo/utils.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import { trim } from '../utils/data/trim.js';
export function isEmpty(value) {
return (value === 0 ||
value === 0n ||
value === undefined ||
value === null ||
value === '0' ||
value === '' ||
(typeof value === 'string' &&
(trim(value).toLowerCase() === '0x' ||
trim(value).toLowerCase() === '0x00')));
}
export function isPresent(value) {
return !isEmpty(value);
}
/** @internal */
export function isEIP1559(transaction) {
return (typeof transaction.maxFeePerGas !== 'undefined' &&
typeof transaction.maxPriorityFeePerGas !== 'undefined');
}
export function isCIP64(transaction) {
/*
* Enable end user to force the tx to be considered as a CIP-64.
*
* The preliminary type will be determined as "eip1559" by src/utils/transaction/getTransactionType.ts
* and so we need the logic below to check for the specific value instead of checking if just any
* transaction type is provided. If that's anything else than "cip64" then we need to reevaluate the
* type based on the transaction fields.
*
* Modify with caution and according to https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0064.md
*/
if (transaction.type === 'cip64') {
return true;
}
return isEIP1559(transaction) && isPresent(transaction.feeCurrency);
}
//# sourceMappingURL=utils.js.map

1
node_modules/viem/_esm/celo/utils.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../celo/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAO5C,MAAM,UAAU,OAAO,CACrB,KAA2C;IAE3C,OAAO,CACL,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,EAAE;QACZ,KAAK,KAAK,SAAS;QACnB,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,GAAG;QACb,KAAK,KAAK,EAAE;QACZ,CAAC,OAAO,KAAK,KAAK,QAAQ;YACxB,CAAC,IAAI,CAAC,KAAgB,CAAC,CAAC,WAAW,EAAE,KAAK,IAAI;gBAC5C,IAAI,CAAC,KAAgB,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,CACtD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,KAA2C;IAE3C,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AACxB,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,SAAS,CACvB,WAAiE;IAEjE,OAAO,CACL,OAAO,WAAW,CAAC,YAAY,KAAK,WAAW;QAC/C,OAAO,WAAW,CAAC,oBAAoB,KAAK,WAAW,CACxD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,WAAiE;IAEjE;;;;;;;;;OASG;IACH,IAAI,WAAW,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,SAAS,CAAC,WAAW,CAAC,IAAI,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAA;AACrE,CAAC"}