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

15
node_modules/viem/_cjs/celo/chainConfig.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.chainConfig = void 0;
const contracts_js_1 = require("../op-stack/contracts.js");
const fees_js_1 = require("./fees.js");
const formatters_js_1 = require("./formatters.js");
const serializers_js_1 = require("./serializers.js");
exports.chainConfig = {
blockTime: 1_000,
contracts: contracts_js_1.contracts,
formatters: formatters_js_1.formatters,
serializers: serializers_js_1.serializers,
fees: fees_js_1.fees,
};
//# sourceMappingURL=chainConfig.js.map

1
node_modules/viem/_cjs/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,2DAAoD;AACpD,uCAAgC;AAChC,mDAA4C;AAC5C,qDAA8C;AAEjC,QAAA,WAAW,GAAG;IACzB,SAAS,EAAE,KAAK;IAChB,SAAS,EAAT,wBAAS;IACT,UAAU,EAAV,0BAAU;IACV,WAAW,EAAX,4BAAW;IACX,IAAI,EAAJ,cAAI;CACI,CAAA"}

33
node_modules/viem/_cjs/celo/fees.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fees = void 0;
exports.fees = {
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),
]);
const maxFeePerGas = params.multiply(gasPrice - maxPriorityFeePerGas) + maxPriorityFeePerGas;
return {
maxFeePerGas,
maxPriorityFeePerGas,
};
},
};
async function estimateFeePerGasInFeeCurrency(client, feeCurrency) {
const fee = await client.request({
method: 'eth_gasPrice',
params: [feeCurrency],
});
return BigInt(fee);
}
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/_cjs/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,QAAA,IAAI,GAAiC;IAUhD,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;QAGF,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;AAiBD,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;AAiBD,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"}

66
node_modules/viem/_cjs/celo/formatters.js generated vendored Normal file
View File

@@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatters = void 0;
const fromHex_js_1 = require("../utils/encoding/fromHex.js");
const block_js_1 = require("../utils/formatters/block.js");
const transaction_js_1 = require("../utils/formatters/transaction.js");
const transactionRequest_js_1 = require("../utils/formatters/transactionRequest.js");
const utils_js_1 = require("./utils.js");
exports.formatters = {
block: (0, block_js_1.defineBlock)({
format(args) {
const transactions = args.transactions?.map((transaction) => {
if (typeof transaction === 'string')
return transaction;
const formatted = (0, transaction_js_1.formatTransaction)(transaction);
return {
...formatted,
...(transaction.gatewayFee
? {
gatewayFee: (0, fromHex_js_1.hexToBigInt)(transaction.gatewayFee),
gatewayFeeRecipient: transaction.gatewayFeeRecipient,
}
: {}),
feeCurrency: transaction.feeCurrency,
};
});
return {
transactions,
};
},
}),
transaction: (0, transaction_js_1.defineTransaction)({
format(args) {
if (args.type === '0x7e')
return {
isSystemTx: args.isSystemTx,
mint: args.mint ? (0, fromHex_js_1.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
? (0, fromHex_js_1.hexToBigInt)(args.gatewayFee)
: null;
transaction.gatewayFeeRecipient = args.gatewayFeeRecipient;
}
return transaction;
},
}),
transactionRequest: (0, transactionRequest_js_1.defineTransactionRequest)({
format(args) {
const request = {};
if (args.feeCurrency)
request.feeCurrency = args.feeCurrency;
if ((0, utils_js_1.isCIP64)(args))
request.type = '0x7b';
return request;
},
}),
};
//# sourceMappingURL=formatters.js.map

1
node_modules/viem/_cjs/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,6DAA0D;AAC1D,2DAA0D;AAC1D,uEAG2C;AAC3C,qFAAoF;AASpF,yCAAoC;AAEvB,QAAA,UAAU,GAAG;IACxB,KAAK,EAAgB,IAAA,sBAAW,EAAC;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,IAAA,kCAAiB,EAAC,WAA6B,CAAC,CAAA;gBAClE,OAAO;oBACL,GAAG,SAAS;oBACZ,GAAG,CAAC,WAAW,CAAC,UAAU;wBACxB,CAAC,CAAC;4BACE,UAAU,EAAE,IAAA,wBAAW,EAAC,WAAW,CAAC,UAAU,CAAC;4BAC/C,mBAAmB,EAAE,WAAW,CAAC,mBAAmB;yBACrD;wBACH,CAAC,CAAC,EAAE,CAAC;oBACP,WAAW,EAAE,WAAW,CAAC,WAAW;iBACrC,CAAA;YACH,CAAC,CAAC,CAAA;YACF,OAAO;gBACL,YAAY;aACA,CAAA;QAChB,CAAC;KACF,CAAC;IACF,WAAW,EAAgB,IAAA,kCAAiB,EAAC;QAC3C,MAAM,CAAC,IAAwB;YAC7B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;gBACtB,OAAO;oBACL,UAAU,EAAE,IAAI,CAAC,UAAU;oBAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,wBAAW,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;oBACpD,UAAU,EAAE,IAAI,CAAC,UAAU;oBAC3B,IAAI,EAAE,SAAS;iBACG,CAAA;YAEtB,MAAM,WAAW,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAqB,CAAA;YAExE,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;gBAAE,WAAW,CAAC,IAAI,GAAG,OAAO,CAAA;iBAC/C,CAAC;gBACJ,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;oBAAE,WAAW,CAAC,IAAI,GAAG,OAAO,CAAA;gBAEpD,WAAW,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;oBACtC,CAAC,CAAC,IAAA,wBAAW,EAAC,IAAI,CAAC,UAAU,CAAC;oBAC9B,CAAC,CAAC,IAAI,CAAA;gBACR,WAAW,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAA;YAC5D,CAAC;YAED,OAAO,WAAW,CAAA;QACpB,CAAC;KACF,CAAC;IACF,kBAAkB,EAAgB,IAAA,gDAAwB,EAAC;QACzD,MAAM,CAAC,IAA4B;YACjC,MAAM,OAAO,GAAG,EAA+B,CAAA;YAE/C,IAAI,IAAI,CAAC,WAAW;gBAAE,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;YAC5D,IAAI,IAAA,kBAAO,EAAC,IAAI,CAAC;gBAAE,OAAO,CAAC,IAAI,GAAG,MAAM,CAAA;YAExC,OAAO,OAAO,CAAA;QAChB,CAAC;KACF,CAAC;CACgC,CAAA"}

10
node_modules/viem/_cjs/celo/index.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeTransaction = exports.parseTransaction = exports.chainConfig = void 0;
var chainConfig_js_1 = require("./chainConfig.js");
Object.defineProperty(exports, "chainConfig", { enumerable: true, get: function () { return chainConfig_js_1.chainConfig; } });
var parsers_js_1 = require("./parsers.js");
Object.defineProperty(exports, "parseTransaction", { enumerable: true, get: function () { return parsers_js_1.parseTransaction; } });
var serializers_js_1 = require("./serializers.js");
Object.defineProperty(exports, "serializeTransaction", { enumerable: true, get: function () { return serializers_js_1.serializeTransaction; } });
//# sourceMappingURL=index.js.map

1
node_modules/viem/_cjs/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":";;;AACA,mDAA8C;AAArC,6GAAA,WAAW,OAAA;AAEpB,2CAAgF;AAAtC,8GAAA,gBAAgB,OAAA;AAE1D,mDAGyB;AADvB,sHAAA,oBAAoB,OAAA"}

131
node_modules/viem/_cjs/celo/parsers.js generated vendored Normal file
View File

@@ -0,0 +1,131 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseTransaction = parseTransaction;
const transaction_js_1 = require("../errors/transaction.js");
const parsers_js_1 = require("../op-stack/parsers.js");
const isHex_js_1 = require("../utils/data/isHex.js");
const slice_js_1 = require("../utils/data/slice.js");
const fromHex_js_1 = require("../utils/encoding/fromHex.js");
const parseTransaction_js_1 = require("../utils/transaction/parseTransaction.js");
const serializers_js_1 = require("./serializers.js");
function parseTransaction(serializedTransaction) {
const serializedType = (0, slice_js_1.sliceHex)(serializedTransaction, 0, 1);
if (serializedType === '0x7c')
return parseTransactionCIP42(serializedTransaction);
if (serializedType === '0x7b')
return parseTransactionCIP64(serializedTransaction);
return (0, parsers_js_1.parseTransaction)(serializedTransaction);
}
function parseTransactionCIP42(serializedTransaction) {
const transactionArray = (0, parseTransaction_js_1.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 transaction_js_1.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: (0, fromHex_js_1.hexToNumber)(chainId),
type: 'cip42',
};
if ((0, isHex_js_1.isHex)(to) && to !== '0x')
transaction.to = to;
if ((0, isHex_js_1.isHex)(gas) && gas !== '0x')
transaction.gas = (0, fromHex_js_1.hexToBigInt)(gas);
if ((0, isHex_js_1.isHex)(data) && data !== '0x')
transaction.data = data;
if ((0, isHex_js_1.isHex)(nonce) && nonce !== '0x')
transaction.nonce = (0, fromHex_js_1.hexToNumber)(nonce);
if ((0, isHex_js_1.isHex)(value) && value !== '0x')
transaction.value = (0, fromHex_js_1.hexToBigInt)(value);
if ((0, isHex_js_1.isHex)(feeCurrency) && feeCurrency !== '0x')
transaction.feeCurrency = feeCurrency;
if ((0, isHex_js_1.isHex)(gatewayFeeRecipient) && gatewayFeeRecipient !== '0x')
transaction.gatewayFeeRecipient = gatewayFeeRecipient;
if ((0, isHex_js_1.isHex)(gatewayFee) && gatewayFee !== '0x')
transaction.gatewayFee = (0, fromHex_js_1.hexToBigInt)(gatewayFee);
if ((0, isHex_js_1.isHex)(maxFeePerGas) && maxFeePerGas !== '0x')
transaction.maxFeePerGas = (0, fromHex_js_1.hexToBigInt)(maxFeePerGas);
if ((0, isHex_js_1.isHex)(maxPriorityFeePerGas) && maxPriorityFeePerGas !== '0x')
transaction.maxPriorityFeePerGas = (0, fromHex_js_1.hexToBigInt)(maxPriorityFeePerGas);
if (accessList.length !== 0 && accessList !== '0x')
transaction.accessList = (0, parseTransaction_js_1.parseAccessList)(accessList);
(0, serializers_js_1.assertTransactionCIP42)(transaction);
return transaction;
}
function parseTransactionCIP64(serializedTransaction) {
const transactionArray = (0, parseTransaction_js_1.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 transaction_js_1.InvalidSerializedTransactionError({
attributes: {
chainId,
nonce,
maxPriorityFeePerGas,
maxFeePerGas,
gas,
to,
value,
data,
accessList,
feeCurrency,
...(transactionArray.length > 10
? {
v,
r,
s,
}
: {}),
},
serializedTransaction,
type: 'cip64',
});
}
const transaction = {
chainId: (0, fromHex_js_1.hexToNumber)(chainId),
type: 'cip64',
};
if ((0, isHex_js_1.isHex)(to) && to !== '0x')
transaction.to = to;
if ((0, isHex_js_1.isHex)(gas) && gas !== '0x')
transaction.gas = (0, fromHex_js_1.hexToBigInt)(gas);
if ((0, isHex_js_1.isHex)(data) && data !== '0x')
transaction.data = data;
if ((0, isHex_js_1.isHex)(nonce) && nonce !== '0x')
transaction.nonce = (0, fromHex_js_1.hexToNumber)(nonce);
if ((0, isHex_js_1.isHex)(value) && value !== '0x')
transaction.value = (0, fromHex_js_1.hexToBigInt)(value);
if ((0, isHex_js_1.isHex)(feeCurrency) && feeCurrency !== '0x')
transaction.feeCurrency = feeCurrency;
if ((0, isHex_js_1.isHex)(maxFeePerGas) && maxFeePerGas !== '0x')
transaction.maxFeePerGas = (0, fromHex_js_1.hexToBigInt)(maxFeePerGas);
if ((0, isHex_js_1.isHex)(maxPriorityFeePerGas) && maxPriorityFeePerGas !== '0x')
transaction.maxPriorityFeePerGas = (0, fromHex_js_1.hexToBigInt)(maxPriorityFeePerGas);
if (accessList.length !== 0 && accessList !== '0x')
transaction.accessList = (0, parseTransaction_js_1.parseAccessList)(accessList);
(0, serializers_js_1.assertTransactionCIP64)(transaction);
return transaction;
}
//# sourceMappingURL=parsers.js.map

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

@@ -0,0 +1 @@
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../celo/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GAAG,IAAA,qCAAe,EAAC,UAAiC,CAAC,CAAA;IAE7E,IAAA,uCAAsB,EAAC,WAA2C,CAAC,CAAA;IAEnE,OAAO,WAA2C,CAAA;AACpD,CAAC"}

99
node_modules/viem/_cjs/celo/serializers.js generated vendored Normal file
View File

@@ -0,0 +1,99 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializers = void 0;
exports.serializeTransaction = serializeTransaction;
exports.assertTransactionCIP42 = assertTransactionCIP42;
exports.assertTransactionCIP64 = assertTransactionCIP64;
const number_js_1 = require("../constants/number.js");
const address_js_1 = require("../errors/address.js");
const base_js_1 = require("../errors/base.js");
const chain_js_1 = require("../errors/chain.js");
const node_js_1 = require("../errors/node.js");
const serializers_js_1 = require("../op-stack/serializers.js");
const isAddress_js_1 = require("../utils/address/isAddress.js");
const concat_js_1 = require("../utils/data/concat.js");
const toHex_js_1 = require("../utils/encoding/toHex.js");
const toRlp_js_1 = require("../utils/encoding/toRlp.js");
const serializeAccessList_js_1 = require("../utils/transaction/serializeAccessList.js");
const serializeTransaction_js_1 = require("../utils/transaction/serializeTransaction.js");
const utils_js_1 = require("./utils.js");
function serializeTransaction(transaction, signature) {
if ((0, utils_js_1.isCIP64)(transaction))
return serializeTransactionCIP64(transaction, signature);
return (0, serializers_js_1.serializeTransaction)(transaction, signature);
}
exports.serializers = {
transaction: serializeTransaction,
};
function serializeTransactionCIP64(transaction, signature) {
assertTransactionCIP64(transaction);
const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, feeCurrency, data, } = transaction;
const serializedTransaction = [
(0, toHex_js_1.toHex)(chainId),
nonce ? (0, toHex_js_1.toHex)(nonce) : '0x',
maxPriorityFeePerGas ? (0, toHex_js_1.toHex)(maxPriorityFeePerGas) : '0x',
maxFeePerGas ? (0, toHex_js_1.toHex)(maxFeePerGas) : '0x',
gas ? (0, toHex_js_1.toHex)(gas) : '0x',
to ?? '0x',
value ? (0, toHex_js_1.toHex)(value) : '0x',
data ?? '0x',
(0, serializeAccessList_js_1.serializeAccessList)(accessList),
feeCurrency,
...(0, serializeTransaction_js_1.toYParitySignatureArray)(transaction, signature),
];
return (0, concat_js_1.concatHex)([
'0x7b',
(0, toRlp_js_1.toRlp)(serializedTransaction),
]);
}
const MAX_MAX_FEE_PER_GAS = number_js_1.maxUint256;
function assertTransactionCIP42(transaction) {
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to, feeCurrency, gatewayFee, gatewayFeeRecipient, } = transaction;
if (chainId <= 0)
throw new chain_js_1.InvalidChainIdError({ chainId });
if (to && !(0, isAddress_js_1.isAddress)(to))
throw new address_js_1.InvalidAddressError({ address: to });
if (gasPrice)
throw new base_js_1.BaseError('`gasPrice` is not a valid CIP-42 Transaction attribute.');
if ((0, utils_js_1.isPresent)(maxFeePerGas) && maxFeePerGas > MAX_MAX_FEE_PER_GAS)
throw new node_js_1.FeeCapTooHighError({ maxFeePerGas });
if ((0, utils_js_1.isPresent)(maxPriorityFeePerGas) &&
(0, utils_js_1.isPresent)(maxFeePerGas) &&
maxPriorityFeePerGas > maxFeePerGas)
throw new node_js_1.TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
if (((0, utils_js_1.isPresent)(gatewayFee) && (0, utils_js_1.isEmpty)(gatewayFeeRecipient)) ||
((0, utils_js_1.isPresent)(gatewayFeeRecipient) && (0, utils_js_1.isEmpty)(gatewayFee))) {
throw new base_js_1.BaseError('`gatewayFee` and `gatewayFeeRecipient` must be provided together.');
}
if ((0, utils_js_1.isPresent)(feeCurrency) && !(0, isAddress_js_1.isAddress)(feeCurrency)) {
throw new base_js_1.BaseError('`feeCurrency` MUST be a token address for CIP-42 transactions.');
}
if ((0, utils_js_1.isPresent)(gatewayFeeRecipient) && !(0, isAddress_js_1.isAddress)(gatewayFeeRecipient)) {
throw new address_js_1.InvalidAddressError(gatewayFeeRecipient);
}
if ((0, utils_js_1.isEmpty)(feeCurrency) && (0, utils_js_1.isEmpty)(gatewayFeeRecipient)) {
throw new base_js_1.BaseError('Either `feeCurrency` or `gatewayFeeRecipient` must be provided for CIP-42 transactions.');
}
}
function assertTransactionCIP64(transaction) {
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to, feeCurrency, } = transaction;
if (chainId <= 0)
throw new chain_js_1.InvalidChainIdError({ chainId });
if (to && !(0, isAddress_js_1.isAddress)(to))
throw new address_js_1.InvalidAddressError({ address: to });
if (gasPrice)
throw new base_js_1.BaseError('`gasPrice` is not a valid CIP-64 Transaction attribute.');
if ((0, utils_js_1.isPresent)(maxFeePerGas) && maxFeePerGas > MAX_MAX_FEE_PER_GAS)
throw new node_js_1.FeeCapTooHighError({ maxFeePerGas });
if ((0, utils_js_1.isPresent)(maxPriorityFeePerGas) &&
(0, utils_js_1.isPresent)(maxFeePerGas) &&
maxPriorityFeePerGas > maxFeePerGas)
throw new node_js_1.TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
if ((0, utils_js_1.isPresent)(feeCurrency) && !(0, isAddress_js_1.isAddress)(feeCurrency)) {
throw new base_js_1.BaseError('`feeCurrency` MUST be a token address for CIP-64 transactions.');
}
if ((0, utils_js_1.isEmpty)(feeCurrency)) {
throw new base_js_1.BaseError('`feeCurrency` must be provided for CIP-64 transactions.');
}
}
//# sourceMappingURL=serializers.js.map

1
node_modules/viem/_cjs/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":";;;AAsBA,oDAOC;AAoDD,wDAsDC;AAED,wDAwCC;AAjLD,sDAAmD;AACnD,qDAA0D;AAC1D,+CAA6C;AAC7C,iDAAwD;AACxD,+CAA2E;AAC3E,+DAA4F;AAG5F,gEAAyD;AACzD,uDAAmD;AACnD,yDAAkD;AAClD,yDAAkD;AAClD,wFAAiF;AACjF,0FAAsF;AAOtF,yCAAwD;AAExD,SAAgB,oBAAoB,CAClC,WAAwC,EACxC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AC,EAAE,CAAC;QACtD,MAAM,IAAI,mBAAS,CACjB,gEAAgE,CACjE,CAAA;IACH,CAAC;IAED,IAAI,IAAA,kBAAO,EAAC,WAAW,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,mBAAS,CACjB,yDAAyD,CAC1D,CAAA;IACH,CAAC;AACH,CAAC"}

3
node_modules/viem/_cjs/celo/types.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

1
node_modules/viem/_cjs/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":""}

32
node_modules/viem/_cjs/celo/utils.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEmpty = isEmpty;
exports.isPresent = isPresent;
exports.isEIP1559 = isEIP1559;
exports.isCIP64 = isCIP64;
const trim_js_1 = require("../utils/data/trim.js");
function isEmpty(value) {
return (value === 0 ||
value === 0n ||
value === undefined ||
value === null ||
value === '0' ||
value === '' ||
(typeof value === 'string' &&
((0, trim_js_1.trim)(value).toLowerCase() === '0x' ||
(0, trim_js_1.trim)(value).toLowerCase() === '0x00')));
}
function isPresent(value) {
return !isEmpty(value);
}
function isEIP1559(transaction) {
return (typeof transaction.maxFeePerGas !== 'undefined' &&
typeof transaction.maxPriorityFeePerGas !== 'undefined');
}
function isCIP64(transaction) {
if (transaction.type === 'cip64') {
return true;
}
return isEIP1559(transaction) && isPresent(transaction.feeCurrency);
}
//# sourceMappingURL=utils.js.map

1
node_modules/viem/_cjs/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":";;AAQA,0BAcC;AAED,8BAIC;AAGD,8BAOC;AAED,0BAkBC;AAzDD,mDAA4C;AAO5C,SAAgB,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,IAAA,cAAI,EAAC,KAAgB,CAAC,CAAC,WAAW,EAAE,KAAK,IAAI;gBAC5C,IAAA,cAAI,EAAC,KAAgB,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,CACtD,CAAA;AACH,CAAC;AAED,SAAgB,SAAS,CACvB,KAA2C;IAE3C,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AACxB,CAAC;AAGD,SAAgB,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,SAAgB,OAAO,CACrB,WAAiE;IAYjE,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"}