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

2276
node_modules/viem/_cjs/tempo/Abis.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/viem/_cjs/tempo/Abis.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

289
node_modules/viem/_cjs/tempo/Account.js generated vendored Normal file
View File

@@ -0,0 +1,289 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.z_TxEnvelopeTempo = exports.z_SignatureEnvelope = exports.z_KeyAuthorization = void 0;
exports.from = from;
exports.fromHeadlessWebAuthn = fromHeadlessWebAuthn;
exports.fromP256 = fromP256;
exports.fromSecp256k1 = fromSecp256k1;
exports.fromWebAuthnP256 = fromWebAuthnP256;
exports.fromWebCryptoP256 = fromWebCryptoP256;
exports.signKeyAuthorization = signKeyAuthorization;
exports.resolveAccessKey = resolveAccessKey;
const Address = require("ox/Address");
const Hex = require("ox/Hex");
const P256 = require("ox/P256");
const PublicKey = require("ox/PublicKey");
const Secp256k1 = require("ox/Secp256k1");
const Signature = require("ox/Signature");
const tempo_1 = require("ox/tempo");
const WebAuthnP256 = require("ox/WebAuthnP256");
const WebCryptoP256 = require("ox/WebCryptoP256");
const parseAccount_js_1 = require("../accounts/utils/parseAccount.js");
const hashAuthorization_js_1 = require("../utils/authorization/hashAuthorization.js");
const keccak256_js_1 = require("../utils/hash/keccak256.js");
const hashMessage_js_1 = require("../utils/signature/hashMessage.js");
const hashTypedData_js_1 = require("../utils/signature/hashTypedData.js");
const Transaction = require("./Transaction.js");
function from(parameters) {
const { access } = parameters;
if (access)
return fromAccessKey(parameters);
return fromRoot(parameters);
}
function fromHeadlessWebAuthn(privateKey, options) {
const { access, rpId, origin, internal_version } = options;
const publicKey = P256.getPublicKey({ privateKey });
return from({
access,
internal_version,
keyType: 'webAuthn',
publicKey,
async sign({ hash }) {
const { metadata, payload } = WebAuthnP256.getSignPayload({
...options,
challenge: hash,
rpId,
origin,
});
const signature = P256.sign({
payload,
privateKey,
hash: true,
});
return tempo_1.SignatureEnvelope.serialize({
metadata,
signature,
publicKey,
type: 'webAuthn',
});
},
});
}
function fromP256(privateKey, options = {}) {
const { access, internal_version } = options;
const publicKey = P256.getPublicKey({ privateKey });
return from({
access,
internal_version,
keyType: 'p256',
publicKey,
async sign({ hash }) {
const signature = P256.sign({ payload: hash, privateKey });
return tempo_1.SignatureEnvelope.serialize({
signature,
publicKey,
type: 'p256',
});
},
});
}
function fromSecp256k1(privateKey, options = {}) {
const { access, internal_version } = options;
const publicKey = Secp256k1.getPublicKey({ privateKey });
return from({
access,
internal_version,
keyType: 'secp256k1',
publicKey,
async sign(parameters) {
const { hash } = parameters;
const signature = Secp256k1.sign({ payload: hash, privateKey });
return Signature.toHex(signature);
},
});
}
function fromWebAuthnP256(credential, options = {}) {
const { id } = credential;
const publicKey = PublicKey.fromHex(credential.publicKey);
return from({
keyType: 'webAuthn',
publicKey,
async sign({ hash }) {
const { metadata, signature } = await WebAuthnP256.sign({
...options,
challenge: hash,
credentialId: id,
});
return tempo_1.SignatureEnvelope.serialize({
publicKey,
metadata,
signature,
type: 'webAuthn',
});
},
});
}
function fromWebCryptoP256(keyPair, options = {}) {
const { access, internal_version } = options;
const { publicKey, privateKey } = keyPair;
return from({
access,
internal_version,
keyType: 'p256',
publicKey,
async sign({ hash }) {
const signature = await WebCryptoP256.sign({ payload: hash, privateKey });
return tempo_1.SignatureEnvelope.serialize({
signature,
prehash: true,
publicKey,
type: 'p256',
});
},
});
}
async function signKeyAuthorization(account, parameters) {
const { chainId, key, expiry, limits, scopes } = parameters;
const { accessKeyAddress, keyType: type } = resolveAccessKey(key);
const signature = await account.sign({
hash: tempo_1.KeyAuthorization.getSignPayload({
address: accessKeyAddress,
chainId,
expiry,
limits,
scopes,
type,
}),
});
return tempo_1.KeyAuthorization.from({
address: accessKeyAddress,
chainId,
expiry,
limits,
scopes,
signature: tempo_1.SignatureEnvelope.from(signature),
type,
});
}
function fromBase(parameters) {
const { keyType = 'secp256k1', parentAddress, source = 'privateKey', internal_version = 'v2', } = parameters;
const address = parentAddress ?? Address.fromPublicKey(parameters.publicKey);
const publicKey = PublicKey.toHex(parameters.publicKey, {
includePrefix: false,
});
async function sign({ hash }) {
const innerHash = parentAddress && internal_version === 'v2'
? (0, keccak256_js_1.keccak256)(Hex.concat('0x04', hash, parentAddress))
: hash;
const signature = await parameters.sign({ hash: innerHash });
if (parentAddress)
return tempo_1.SignatureEnvelope.serialize(tempo_1.SignatureEnvelope.from({
userAddress: parentAddress,
inner: tempo_1.SignatureEnvelope.from(signature),
type: 'keychain',
version: internal_version,
}));
return signature;
}
return {
address: Address.checksum(address),
keyType,
sign,
async signAuthorization(parameters) {
const { chainId, nonce } = parameters;
const address = parameters.contractAddress ?? parameters.address;
const signature = await sign({
hash: (0, hashAuthorization_js_1.hashAuthorization)({ address, chainId, nonce }),
});
const envelope = tempo_1.SignatureEnvelope.from(signature);
if (envelope.type !== 'secp256k1')
throw new Error('Unsupported signature type. Expected `secp256k1` but got `' +
envelope.type +
'`.');
const { r, s, yParity } = envelope.signature;
return {
address,
chainId,
nonce,
r: Hex.fromNumber(r, { size: 32 }),
s: Hex.fromNumber(s, { size: 32 }),
yParity,
};
},
async signMessage(parameters) {
const { message } = parameters;
return await sign({ hash: (0, hashMessage_js_1.hashMessage)(message) });
},
async signTransaction(transaction, options) {
const { serializer = Transaction.serialize } = options ?? {};
const presign = (() => {
if ('feePayerSignature' in transaction && transaction.feePayerSignature)
return { ...transaction, feePayerSignature: null };
return transaction;
})();
const signature = await sign({
hash: (0, keccak256_js_1.keccak256)(await serializer(presign)),
});
const envelope = tempo_1.SignatureEnvelope.from(signature);
return await serializer(transaction, envelope);
},
async signTypedData(typedData) {
return await sign({ hash: (0, hashTypedData_js_1.hashTypedData)(typedData) });
},
publicKey,
source,
type: 'local',
};
}
function fromRoot(parameters) {
const account = fromBase(parameters);
return {
...account,
source: 'root',
async signKeyAuthorization(key, parameters) {
const { chainId, expiry, limits, scopes } = parameters;
const { accessKeyAddress, keyType: type } = resolveAccessKey(key);
const signature = await account.sign({
hash: tempo_1.KeyAuthorization.getSignPayload({
address: accessKeyAddress,
chainId,
expiry,
limits,
scopes,
type,
}),
});
const keyAuthorization = tempo_1.KeyAuthorization.from({
address: accessKeyAddress,
chainId,
expiry,
limits,
scopes,
signature: tempo_1.SignatureEnvelope.from(signature),
type,
});
return keyAuthorization;
},
};
}
function fromAccessKey(parameters) {
const { access } = parameters;
const { address: parentAddress } = (0, parseAccount_js_1.parseAccount)(access);
const account = fromBase({ ...parameters, parentAddress });
return {
...account,
accessKeyAddress: Address.fromPublicKey(parameters.publicKey),
source: 'accessKey',
};
}
function resolveAccessKey(accessKey) {
if ('accessKeyAddress' in accessKey)
return {
accessKeyAddress: accessKey.accessKeyAddress,
keyType: accessKey.keyType,
};
if ('publicKey' in accessKey && accessKey.publicKey)
return {
accessKeyAddress: Address.fromPublicKey(PublicKey.fromHex(accessKey.publicKey)),
keyType: accessKey.type,
};
return {
accessKeyAddress: accessKey.address,
keyType: accessKey.type,
};
}
var tempo_2 = require("ox/tempo");
Object.defineProperty(exports, "z_KeyAuthorization", { enumerable: true, get: function () { return tempo_2.KeyAuthorization; } });
Object.defineProperty(exports, "z_SignatureEnvelope", { enumerable: true, get: function () { return tempo_2.SignatureEnvelope; } });
Object.defineProperty(exports, "z_TxEnvelopeTempo", { enumerable: true, get: function () { return tempo_2.TxEnvelopeTempo; } });
//# sourceMappingURL=Account.js.map

1
node_modules/viem/_cjs/tempo/Account.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

16
node_modules/viem/_cjs/tempo/Addresses.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.zoneOutbox = exports.validator = exports.tip403Registry = exports.tip20Factory = exports.stablecoinDex = exports.pathUsd = exports.nonceManager = exports.feeManager = exports.addressRegistry = exports.accountRegistrar = exports.accountKeychain = exports.accountImplementation = void 0;
exports.accountImplementation = '0x7702c00000000000000000000000000000000000';
exports.accountKeychain = '0xaAAAaaAA00000000000000000000000000000000';
exports.accountRegistrar = '0x7702ac0000000000000000000000000000000000';
exports.addressRegistry = '0xfdc0000000000000000000000000000000000000';
exports.feeManager = '0xfeec000000000000000000000000000000000000';
exports.nonceManager = '0x4e4F4E4345000000000000000000000000000000';
exports.pathUsd = '0x20c0000000000000000000000000000000000000';
exports.stablecoinDex = '0xdec0000000000000000000000000000000000000';
exports.tip20Factory = '0x20fc000000000000000000000000000000000000';
exports.tip403Registry = '0x403c000000000000000000000000000000000000';
exports.validator = '0xcccccccc00000000000000000000000000000000';
exports.zoneOutbox = '0x1c00000000000000000000000000000000000002';
//# sourceMappingURL=Addresses.js.map

1
node_modules/viem/_cjs/tempo/Addresses.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Addresses.js","sourceRoot":"","sources":["../../tempo/Addresses.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAChC,4CAA4C,CAAA;AACjC,QAAA,eAAe,GAAG,4CAA4C,CAAA;AAC9D,QAAA,gBAAgB,GAAG,4CAA4C,CAAA;AAC/D,QAAA,eAAe,GAAG,4CAA4C,CAAA;AAC9D,QAAA,UAAU,GAAG,4CAA4C,CAAA;AACzD,QAAA,YAAY,GAAG,4CAA4C,CAAA;AAC3D,QAAA,OAAO,GAAG,4CAA4C,CAAA;AACtD,QAAA,aAAa,GAAG,4CAA4C,CAAA;AAC5D,QAAA,YAAY,GAAG,4CAA4C,CAAA;AAC3D,QAAA,cAAc,GAAG,4CAA4C,CAAA;AAC7D,QAAA,SAAS,GAAG,4CAA4C,CAAA;AACxD,QAAA,UAAU,GAAG,4CAA4C,CAAA"}

3
node_modules/viem/_cjs/tempo/Capabilities.js generated vendored Normal file
View File

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

1
node_modules/viem/_cjs/tempo/Capabilities.js.map generated vendored Normal file
View File

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

199
node_modules/viem/_cjs/tempo/Decorator.js generated vendored Normal file
View File

@@ -0,0 +1,199 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decorator = decorator;
const accessKeyActions = require("./actions/accessKey.js");
const ammActions = require("./actions/amm.js");
const dexActions = require("./actions/dex.js");
const faucetActions = require("./actions/faucet.js");
const feeActions = require("./actions/fee.js");
const nonceActions = require("./actions/nonce.js");
const policyActions = require("./actions/policy.js");
const rewardActions = require("./actions/reward.js");
const simulateActions = require("./actions/simulate.js");
const tokenActions = require("./actions/token.js");
const validatorActions = require("./actions/validator.js");
const virtualAddressActions = require("./actions/virtualAddress.js");
const zoneActions = require("./actions/zone.js");
function decorator() {
return (client) => {
return {
accessKey: {
authorize: (parameters) => accessKeyActions.authorize(client, parameters),
authorizeSync: (parameters) => accessKeyActions.authorizeSync(client, parameters),
getMetadata: (parameters) => accessKeyActions.getMetadata(client, parameters),
getRemainingLimit: (parameters) => accessKeyActions.getRemainingLimit(client, parameters),
revoke: (parameters) => accessKeyActions.revoke(client, parameters),
revokeSync: (parameters) => accessKeyActions.revokeSync(client, parameters),
updateLimit: (parameters) => accessKeyActions.updateLimit(client, parameters),
updateLimitSync: (parameters) => accessKeyActions.updateLimitSync(client, parameters),
},
amm: {
getPool: (parameters) => ammActions.getPool(client, parameters),
getLiquidityBalance: (parameters) => ammActions.getLiquidityBalance(client, parameters),
burn: (parameters) => ammActions.burn(client, parameters),
burnSync: (parameters) => ammActions.burnSync(client, parameters),
mint: (parameters) => ammActions.mint(client, parameters),
mintSync: (parameters) => ammActions.mintSync(client, parameters),
rebalanceSwap: (parameters) => ammActions.rebalanceSwap(client, parameters),
rebalanceSwapSync: (parameters) => ammActions.rebalanceSwapSync(client, parameters),
watchBurn: (parameters) => ammActions.watchBurn(client, parameters),
watchMint: (parameters) => ammActions.watchMint(client, parameters),
watchRebalanceSwap: (parameters) => ammActions.watchRebalanceSwap(client, parameters),
},
dex: {
buy: (parameters) => dexActions.buy(client, parameters),
buySync: (parameters) => dexActions.buySync(client, parameters),
cancel: (parameters) => dexActions.cancel(client, parameters),
cancelSync: (parameters) => dexActions.cancelSync(client, parameters),
cancelStale: (parameters) => dexActions.cancelStale(client, parameters),
cancelStaleSync: (parameters) => dexActions.cancelStaleSync(client, parameters),
createPair: (parameters) => dexActions.createPair(client, parameters),
createPairSync: (parameters) => dexActions.createPairSync(client, parameters),
getBalance: (parameters) => dexActions.getBalance(client, parameters),
getBuyQuote: (parameters) => dexActions.getBuyQuote(client, parameters),
getOrder: (parameters) => dexActions.getOrder(client, parameters),
getTickLevel: (parameters) => dexActions.getTickLevel(client, parameters),
getSellQuote: (parameters) => dexActions.getSellQuote(client, parameters),
place: (parameters) => dexActions.place(client, parameters),
placeSync: (parameters) => dexActions.placeSync(client, parameters),
placeFlip: (parameters) => dexActions.placeFlip(client, parameters),
placeFlipSync: (parameters) => dexActions.placeFlipSync(client, parameters),
sell: (parameters) => dexActions.sell(client, parameters),
sellSync: (parameters) => dexActions.sellSync(client, parameters),
withdraw: (parameters) => dexActions.withdraw(client, parameters),
withdrawSync: (parameters) => dexActions.withdrawSync(client, parameters),
watchFlipOrderPlaced: (parameters) => dexActions.watchFlipOrderPlaced(client, parameters),
watchOrderCancelled: (parameters) => dexActions.watchOrderCancelled(client, parameters),
watchOrderFilled: (parameters) => dexActions.watchOrderFilled(client, parameters),
watchOrderPlaced: (parameters) => dexActions.watchOrderPlaced(client, parameters),
},
faucet: {
fund: (parameters) => faucetActions.fund(client, parameters),
fundSync: (parameters) => faucetActions.fundSync(client, parameters),
},
nonce: {
getNonce: (parameters) => nonceActions.getNonce(client, parameters),
watchNonceIncremented: (parameters) => nonceActions.watchNonceIncremented(client, parameters),
},
fee: {
getUserToken: (parameters) => feeActions.getUserToken(client, parameters),
setUserToken: (parameters) => feeActions.setUserToken(client, parameters),
setUserTokenSync: (parameters) => feeActions.setUserTokenSync(client, parameters),
watchSetUserToken: (parameters) => feeActions.watchSetUserToken(client, parameters),
},
policy: {
create: (parameters) => policyActions.create(client, parameters),
createSync: (parameters) => policyActions.createSync(client, parameters),
setAdmin: (parameters) => policyActions.setAdmin(client, parameters),
setAdminSync: (parameters) => policyActions.setAdminSync(client, parameters),
modifyWhitelist: (parameters) => policyActions.modifyWhitelist(client, parameters),
modifyWhitelistSync: (parameters) => policyActions.modifyWhitelistSync(client, parameters),
modifyBlacklist: (parameters) => policyActions.modifyBlacklist(client, parameters),
modifyBlacklistSync: (parameters) => policyActions.modifyBlacklistSync(client, parameters),
getData: (parameters) => policyActions.getData(client, parameters),
isAuthorized: (parameters) => policyActions.isAuthorized(client, parameters),
watchCreate: (parameters) => policyActions.watchCreate(client, parameters),
watchAdminUpdated: (parameters) => policyActions.watchAdminUpdated(client, parameters),
watchWhitelistUpdated: (parameters) => policyActions.watchWhitelistUpdated(client, parameters),
watchBlacklistUpdated: (parameters) => policyActions.watchBlacklistUpdated(client, parameters),
},
reward: {
claim: (parameters) => rewardActions.claim(client, parameters),
claimSync: (parameters) => rewardActions.claimSync(client, parameters),
distribute: (parameters) => rewardActions.distribute(client, parameters),
distributeSync: (parameters) => rewardActions.distributeSync(client, parameters),
getUserRewardInfo: (parameters) => rewardActions.getUserRewardInfo(client, parameters),
setRecipient: (parameters) => rewardActions.setRecipient(client, parameters),
setRecipientSync: (parameters) => rewardActions.setRecipientSync(client, parameters),
watchRewardDistributed: (parameters) => rewardActions.watchRewardDistributed(client, parameters),
watchRewardRecipientSet: (parameters) => rewardActions.watchRewardRecipientSet(client, parameters),
},
simulate: {
simulateBlocks: (parameters) => simulateActions.simulateBlocks(client, parameters),
simulateCalls: (parameters) => simulateActions.simulateCalls(client, parameters),
},
token: {
approve: (parameters) => tokenActions.approve(client, parameters),
approveSync: (parameters) => tokenActions.approveSync(client, parameters),
burnBlocked: (parameters) => tokenActions.burnBlocked(client, parameters),
burnBlockedSync: (parameters) => tokenActions.burnBlockedSync(client, parameters),
burn: (parameters) => tokenActions.burn(client, parameters),
burnSync: (parameters) => tokenActions.burnSync(client, parameters),
changeTransferPolicy: (parameters) => tokenActions.changeTransferPolicy(client, parameters),
changeTransferPolicySync: (parameters) => tokenActions.changeTransferPolicySync(client, parameters),
create: (parameters) => tokenActions.create(client, parameters),
createSync: (parameters) => tokenActions.createSync(client, parameters),
getAllowance: (parameters) => tokenActions.getAllowance(client, parameters),
getBalance: (parameters) => tokenActions.getBalance(client, parameters),
getMetadata: (parameters) => tokenActions.getMetadata(client, parameters),
getRoleAdmin: (parameters) => tokenActions.getRoleAdmin(client, parameters),
hasRole: (parameters) => tokenActions.hasRole(client, parameters),
grantRoles: (parameters) => tokenActions.grantRoles(client, parameters),
grantRolesSync: (parameters) => tokenActions.grantRolesSync(client, parameters),
mint: (parameters) => tokenActions.mint(client, parameters),
mintSync: (parameters) => tokenActions.mintSync(client, parameters),
pause: (parameters) => tokenActions.pause(client, parameters),
pauseSync: (parameters) => tokenActions.pauseSync(client, parameters),
renounceRoles: (parameters) => tokenActions.renounceRoles(client, parameters),
renounceRolesSync: (parameters) => tokenActions.renounceRolesSync(client, parameters),
revokeRoles: (parameters) => tokenActions.revokeRoles(client, parameters),
revokeRolesSync: (parameters) => tokenActions.revokeRolesSync(client, parameters),
setSupplyCap: (parameters) => tokenActions.setSupplyCap(client, parameters),
setSupplyCapSync: (parameters) => tokenActions.setSupplyCapSync(client, parameters),
setRoleAdmin: (parameters) => tokenActions.setRoleAdmin(client, parameters),
setRoleAdminSync: (parameters) => tokenActions.setRoleAdminSync(client, parameters),
transfer: (parameters) => tokenActions.transfer(client, parameters),
transferSync: (parameters) => tokenActions.transferSync(client, parameters),
unpause: (parameters) => tokenActions.unpause(client, parameters),
unpauseSync: (parameters) => tokenActions.unpauseSync(client, parameters),
watchApprove: (parameters) => tokenActions.watchApprove(client, parameters),
watchBurn: (parameters) => tokenActions.watchBurn(client, parameters),
watchCreate: (parameters) => tokenActions.watchCreate(client, parameters),
watchMint: (parameters) => tokenActions.watchMint(client, parameters),
watchAdminRole: (parameters) => tokenActions.watchAdminRole(client, parameters),
watchRole: (parameters) => tokenActions.watchRole(client, parameters),
watchTransfer: (parameters) => tokenActions.watchTransfer(client, parameters),
},
validator: {
add: (parameters) => validatorActions.add(client, parameters),
addSync: (parameters) => validatorActions.addSync(client, parameters),
changeOwner: (parameters) => validatorActions.changeOwner(client, parameters),
changeOwnerSync: (parameters) => validatorActions.changeOwnerSync(client, parameters),
changeStatus: (parameters) => validatorActions.changeStatus(client, parameters),
changeStatusSync: (parameters) => validatorActions.changeStatusSync(client, parameters),
get: (parameters) => validatorActions.get(client, parameters),
getByIndex: (parameters) => validatorActions.getByIndex(client, parameters),
getCount: (parameters) => validatorActions.getCount(client, parameters),
getNextFullDkgCeremony: (parameters) => validatorActions.getNextFullDkgCeremony(client, parameters),
getOwner: (parameters) => validatorActions.getOwner(client, parameters),
list: (parameters) => validatorActions.list(client, parameters),
setNextFullDkgCeremony: (parameters) => validatorActions.setNextFullDkgCeremony(client, parameters),
setNextFullDkgCeremonySync: (parameters) => validatorActions.setNextFullDkgCeremonySync(client, parameters),
update: (parameters) => validatorActions.update(client, parameters),
updateSync: (parameters) => validatorActions.updateSync(client, parameters),
},
virtualAddress: {
getMasterAddress: (parameters) => virtualAddressActions.getMasterAddress(client, parameters),
registerMaster: (parameters) => virtualAddressActions.registerMaster(client, parameters),
registerMasterSync: (parameters) => virtualAddressActions.registerMasterSync(client, parameters),
resolve: (parameters) => virtualAddressActions.resolve(client, parameters),
},
zone: {
deposit: (parameters) => zoneActions.deposit(client, parameters),
depositSync: (parameters) => zoneActions.depositSync(client, parameters),
encryptedDeposit: (parameters) => zoneActions.encryptedDeposit(client, parameters),
encryptedDepositSync: (parameters) => zoneActions.encryptedDepositSync(client, parameters),
getAuthorizationTokenInfo: () => zoneActions.getAuthorizationTokenInfo(client),
getDepositStatus: (parameters) => zoneActions.getDepositStatus(client, parameters),
getWithdrawalFee: (parameters) => zoneActions.getWithdrawalFee(client, parameters),
getZoneInfo: () => zoneActions.getZoneInfo(client),
requestWithdrawal: (parameters) => zoneActions.requestWithdrawal(client, parameters),
requestWithdrawalSync: (parameters) => zoneActions.requestWithdrawalSync(client, parameters),
requestVerifiableWithdrawal: (parameters) => zoneActions.requestVerifiableWithdrawal(client, parameters),
requestVerifiableWithdrawalSync: (parameters) => zoneActions.requestVerifiableWithdrawalSync(client, parameters),
signAuthorizationToken: (parameters) => zoneActions.signAuthorizationToken(client, parameters),
},
};
};
}
//# sourceMappingURL=Decorator.js.map

1
node_modules/viem/_cjs/tempo/Decorator.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

31
node_modules/viem/_cjs/tempo/Expiry.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.days = days;
exports.hours = hours;
exports.minutes = minutes;
exports.months = months;
exports.seconds = seconds;
exports.weeks = weeks;
exports.years = years;
function days(n) {
return Math.floor(Date.now() / 1000) + n * 24 * 60 * 60;
}
function hours(n) {
return Math.floor(Date.now() / 1000) + n * 60 * 60;
}
function minutes(n) {
return Math.floor(Date.now() / 1000) + n * 60;
}
function months(n) {
return Math.floor(Date.now() / 1000) + n * 30 * 24 * 60 * 60;
}
function seconds(n) {
return Math.floor(Date.now() / 1000) + n;
}
function weeks(n) {
return Math.floor(Date.now() / 1000) + n * 7 * 24 * 60 * 60;
}
function years(n) {
return Math.floor(Date.now() / 1000) + n * 365 * 24 * 60 * 60;
}
//# sourceMappingURL=Expiry.js.map

1
node_modules/viem/_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AGD,SAAgB,KAAK,CAAC,CAAS;IAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AAC/D,CAAC"}

100
node_modules/viem/_cjs/tempo/Formatters.js generated vendored Normal file
View File

@@ -0,0 +1,100 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatTransaction = formatTransaction;
exports.formatTransactionReceipt = formatTransactionReceipt;
exports.formatTransactionRequest = formatTransactionRequest;
const Hex = require("ox/Hex");
const tempo_1 = require("ox/tempo");
const parseAccount_js_1 = require("../accounts/utils/parseAccount.js");
const transaction_js_1 = require("../utils/formatters/transaction.js");
const transactionReceipt_js_1 = require("../utils/formatters/transactionReceipt.js");
const transactionRequest_js_1 = require("../utils/formatters/transactionRequest.js");
const Transaction_js_1 = require("./Transaction.js");
function formatTransaction(transaction) {
if (!(0, Transaction_js_1.isTempo)(transaction))
return (0, transaction_js_1.formatTransaction)(transaction);
const { feePayerSignature, gasPrice: _, nonce, ...tx } = tempo_1.Transaction.fromRpc(transaction);
return {
...tx,
accessList: tx.accessList,
feePayerSignature: feePayerSignature
? {
r: Hex.fromNumber(feePayerSignature.r, { size: 32 }),
s: Hex.fromNumber(feePayerSignature.s, { size: 32 }),
v: BigInt(feePayerSignature.v ?? 27),
yParity: feePayerSignature.yParity,
}
: undefined,
nonce: Number(nonce),
typeHex: tempo_1.Transaction.toRpcType[tx.type],
type: tx.type,
};
}
function formatTransactionReceipt(receipt) {
return (0, transactionReceipt_js_1.formatTransactionReceipt)(receipt);
}
function formatTransactionRequest(r, action) {
const request = r;
const account = request.account
? (0, parseAccount_js_1.parseAccount)(request.account)
: undefined;
if (!(0, Transaction_js_1.isTempo)(request))
return (0, transactionRequest_js_1.formatTransactionRequest)(r, action);
if (action)
request.calls = request.calls ?? [
{
to: r.to ||
(!r.data || r.data === '0x'
? '0x0000000000000000000000000000000000000000'
: undefined),
value: r.value,
data: r.data,
},
];
if (request.feePayer === true)
delete request.feeToken;
const rpc = tempo_1.TransactionRequest.toRpc({
...request,
type: 'tempo',
});
if (action === 'estimateGas') {
rpc.maxFeePerGas = undefined;
rpc.maxPriorityFeePerGas = undefined;
}
rpc.to = undefined;
rpc.data = undefined;
rpc.value = undefined;
const [keyType, keyData] = (() => {
const type = account && 'keyType' in account ? account.keyType : account?.source;
if (!type)
return [undefined, undefined];
if (type === 'webAuthn')
return ['webAuthn', `0x${'ff'.repeat(1400)}`];
if (['p256', 'secp256k1'].includes(type))
return [type, undefined];
return [undefined, undefined];
})();
const keyId = account && 'accessKeyAddress' in account
? account.accessKeyAddress
: undefined;
if (account)
rpc.from = account.address;
return {
...rpc,
...(keyData ? { keyData } : {}),
...(keyId ? { keyId } : {}),
...(keyType ? { keyType } : {}),
...(typeof request.feePayer !== 'undefined'
? {
feePayer: typeof request.feePayer === 'object'
? (0, parseAccount_js_1.parseAccount)(request.feePayer)
: request.feePayer,
}
: {}),
...('feePayerSignature' in request &&
request.feePayerSignature !== undefined
? { feePayerSignature: request.feePayerSignature }
: {}),
};
}
//# sourceMappingURL=Formatters.js.map

1
node_modules/viem/_cjs/tempo/Formatters.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Formatters.js","sourceRoot":"","sources":["../../tempo/Formatters.ts"],"names":[],"mappings":";;AAwBA,8CA8BC;AAED,4DAIC;AAED,4DAsFC;AAjJD,8BAA6B;AAC7B,oCAGiB;AAEjB,uEAAgE;AAChE,uEAAgG;AAChG,qFAAqH;AACrH,qFAAqH;AAErH,qDAQyB;AAEzB,SAAgB,iBAAiB,CAC/B,WAA2B;IAE3B,IAAI,CAAC,IAAA,wBAAO,EAAC,WAAW,CAAC;QAAE,OAAO,IAAA,kCAAsB,EAAC,WAAoB,CAAC,CAAA;IAE9E,MAAM,EACJ,iBAAiB,EACjB,QAAQ,EAAE,CAAC,EACX,KAAK,E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E,SAAS,CAAC,CAAA;IAC/B,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,KAAK,GACT,OAAO,IAAI,kBAAkB,IAAI,OAAO;QACtC,CAAC,CAAC,OAAO,CAAC,gBAAgB;QAC1B,CAAC,CAAC,SAAS,CAAA;IAEf,IAAI,OAAO;QAAE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAA;IAEvC,OAAO;QACL,GAAG,GAAG;QACN,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/B,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/B,GAAG,CAAC,OAAO,OAAO,CAAC,QAAQ,KAAK,WAAW;YACzC,CAAC,CAAC;gBACE,QAAQ,EACN,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;oBAClC,CAAC,CAAC,IAAA,8BAAY,EAAC,OAAO,CAAC,QAAQ,CAAC;oBAChC,CAAC,CAAC,OAAO,CAAC,QAAQ;aACvB;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,mBAAmB,IAAI,OAAO;YAClC,OAAO,CAAC,iBAAiB,KAAK,SAAS;YACrC,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,EAAE;YAClD,CAAC,CAAC,EAAE,CAAC;KACC,CAAA;AACZ,CAAC"}

18
node_modules/viem/_cjs/tempo/Hardfork.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hardforks = void 0;
exports.lt = lt;
exports.hardforks = [
'genesis',
't0',
't1',
't1a',
't1b',
't1c',
't2',
't3',
];
function lt(current, target) {
return exports.hardforks.indexOf(current) < exports.hardforks.indexOf(target);
}
//# sourceMappingURL=Hardfork.js.map

1
node_modules/viem/_cjs/tempo/Hardfork.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Hardfork.js","sourceRoot":"","sources":["../../tempo/Hardfork.ts"],"names":[],"mappings":";;;AAcA,gBAEC;AAhBY,QAAA,SAAS,GAAG;IACvB,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;CACI,CAAA;AAKV,SAAgB,EAAE,CAAC,OAAe,EAAE,MAAgB;IAClD,OAAO,iBAAS,CAAC,OAAO,CAAC,OAAmB,CAAC,GAAG,iBAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;AAC3E,CAAC"}

6
node_modules/viem/_cjs/tempo/P256.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.randomPrivateKey = void 0;
var P256_1 = require("ox/P256");
Object.defineProperty(exports, "randomPrivateKey", { enumerable: true, get: function () { return P256_1.randomPrivateKey; } });
//# sourceMappingURL=P256.js.map

1
node_modules/viem/_cjs/tempo/P256.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"P256.js","sourceRoot":"","sources":["../../tempo/P256.ts"],"names":[],"mappings":";;;AACA,gCAA0C;AAAjC,wGAAA,gBAAgB,OAAA"}

77
node_modules/viem/_cjs/tempo/Storage.js generated vendored Normal file
View File

@@ -0,0 +1,77 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.from = from;
exports.memory = memory;
exports.session = session;
exports.defaultStorage = defaultStorage;
function from(storage, options = {}) {
const { key } = options;
const prefix = key ? `${key}:` : '';
const inflight = new Map();
return {
getItem(k) {
const fullKey = `${prefix}${k}`;
const existing = inflight.get(fullKey);
if (existing)
return existing;
const result = Promise.resolve(storage.getItem(fullKey)).finally(() => {
inflight.delete(fullKey);
});
inflight.set(fullKey, result);
return result;
},
setItem(k, value) {
const fullKey = `${prefix}${k}`;
inflight.delete(fullKey);
return storage.setItem(fullKey, value);
},
removeItem(k) {
const fullKey = `${prefix}${k}`;
inflight.delete(fullKey);
return storage.removeItem(fullKey);
},
};
}
function memory(options = {}) {
const store = new Map();
return from({
getItem(key) {
return store.get(key) ?? null;
},
setItem(key, value) {
store.set(key, value);
},
removeItem(key) {
store.delete(key);
},
}, options);
}
function session(options = {}) {
return from({
getItem(key) {
return globalThis.sessionStorage.getItem(key);
},
setItem(key, value) {
try {
globalThis.sessionStorage.setItem(key, value);
}
catch { }
},
removeItem(key) {
globalThis.sessionStorage.removeItem(key);
},
}, options);
}
let _default;
function defaultStorage() {
if (_default)
return _default;
if (typeof globalThis !== 'undefined' &&
'sessionStorage' in globalThis &&
globalThis.sessionStorage)
_default = session();
else
_default = memory();
return _default;
}
//# sourceMappingURL=Storage.js.map

1
node_modules/viem/_cjs/tempo/Storage.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Storage.js","sourceRoot":"","sources":["../../tempo/Storage.ts"],"names":[],"mappings":";;AAsBA,oBA0BC;AAUD,wBAgBC;AAGD,0BAiBC;AAaD,wCAUC;AA/FD,SAAgB,IAAI,CAAC,OAAgB,EAAE,UAAwB,EAAE;IAC/D,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAA;IACvB,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IACnC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA8C,CAAA;IACtE,OAAO;QACL,OAAO,CAAC,CAAC;YACP,MAAM,OAAO,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,CAAA;YAC/B,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACtC,IAAI,QAAQ;gBAAE,OAAO,QAAQ,CAAA;YAC7B,MAAM,MAAM,GAAG,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AG;YACT,OAAO,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAC/C,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,KAAK;YAChB,IAAI,CAAC;gBACH,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YAC/C,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACZ,CAAC;QACD,UAAU,CAAC,GAAG;YACZ,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAC3C,CAAC;KACF,EACD,OAAO,CACR,CAAA;AACH,CAAC;AAED,IAAI,QAA6B,CAAA;AAWjC,SAAgB,cAAc;IAC5B,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC7B,IACE,OAAO,UAAU,KAAK,WAAW;QACjC,gBAAgB,IAAI,UAAU;QAC9B,UAAU,CAAC,cAAc;QAEzB,QAAQ,GAAG,OAAO,EAAE,CAAA;;QACjB,QAAQ,GAAG,MAAM,EAAE,CAAA;IACxB,OAAO,QAAQ,CAAA;AACjB,CAAC"}

5
node_modules/viem/_cjs/tempo/TokenIds.js generated vendored Normal file
View File

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

1
node_modules/viem/_cjs/tempo/TokenIds.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"TokenIds.js","sourceRoot":"","sources":["../../tempo/TokenIds.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,EAAE,CAAA"}

174
node_modules/viem/_cjs/tempo/Transaction.js generated vendored Normal file
View File

@@ -0,0 +1,174 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.z_TxEnvelopeTempo = exports.z_SignatureEnvelope = exports.z_KeyAuthorization = void 0;
exports.getType = getType;
exports.isTempo = isTempo;
exports.deserialize = deserialize;
exports.serialize = serialize;
const Hex = require("ox/Hex");
const Secp256k1 = require("ox/Secp256k1");
const Signature = require("ox/Signature");
const tempo_1 = require("ox/tempo");
const getTransactionType_js_1 = require("../utils/transaction/getTransactionType.js");
const parseTransaction_js_1 = require("../utils/transaction/parseTransaction.js");
const serializeTransaction_js_1 = require("../utils/transaction/serializeTransaction.js");
function getType(transaction) {
const account = transaction.account;
if ((account?.keyType && account.keyType !== 'secp256k1') ||
account?.source === 'accessKey' ||
typeof transaction.calls !== 'undefined' ||
typeof transaction.feePayer !== 'undefined' ||
typeof transaction.feeToken !== 'undefined' ||
typeof transaction.keyAuthorization !== 'undefined' ||
typeof transaction.nonceKey !== 'undefined' ||
typeof transaction.signature !== 'undefined' ||
typeof transaction.validBefore !== 'undefined' ||
typeof transaction.validAfter !== 'undefined')
return 'tempo';
if (transaction.type)
return transaction.type;
return (0, getTransactionType_js_1.getTransactionType)(transaction);
}
function isTempo(transaction) {
try {
const type = getType(transaction);
return type === 'tempo';
}
catch {
return false;
}
}
function deserialize(serializedTransaction) {
const type = Hex.slice(serializedTransaction, 0, 1);
if (type === '0x76' || type === '0x78')
return deserializeTempo(serializedTransaction);
return (0, parseTransaction_js_1.parseTransaction)(serializedTransaction);
}
async function serialize(transaction, signature) {
if (!isTempo(transaction)) {
if (signature && 'type' in signature && signature.type !== 'secp256k1')
throw new Error('Unsupported signature type. Expected `secp256k1` but got `' +
signature.type +
'`.');
if (signature && 'type' in signature) {
const { r, s, yParity } = signature?.signature;
return (0, serializeTransaction_js_1.serializeTransaction)(transaction, {
r: Hex.fromNumber(r, { size: 32 }),
s: Hex.fromNumber(s, { size: 32 }),
yParity,
});
}
return (0, serializeTransaction_js_1.serializeTransaction)(transaction, signature);
}
const type = getType(transaction);
if (type === 'tempo')
return serializeTempo(transaction, signature);
throw new Error('Unsupported transaction type');
}
function deserializeTempo(serializedTransaction) {
const { feePayerSignature, nonce, ...tx } = tempo_1.TxEnvelopeTempo.deserialize(serializedTransaction);
return {
...tx,
nonce: Number(nonce ?? 0n),
feePayerSignature: feePayerSignature
? {
r: Hex.fromNumber(feePayerSignature.r, { size: 32 }),
s: Hex.fromNumber(feePayerSignature.s, { size: 32 }),
yParity: feePayerSignature.yParity,
}
: feePayerSignature,
};
}
async function serializeTempo(transaction, sig) {
const signature = (() => {
if (transaction.signature)
return transaction.signature;
if (sig && 'type' in sig)
return sig;
if (sig)
return tempo_1.SignatureEnvelope.from({
r: BigInt(sig.r),
s: BigInt(sig.s),
yParity: Number(sig.yParity),
});
return undefined;
})();
const { chainId, feePayer, nonce, ...rest } = transaction;
const feePayerSignature = (() => {
const feePayerSignature = transaction.feePayerSignature;
if (feePayerSignature)
return {
r: BigInt(feePayerSignature.r),
s: BigInt(feePayerSignature.s),
yParity: Number(feePayerSignature.yParity),
};
if (feePayerSignature === null || feePayer)
return null;
return undefined;
})();
const transaction_ox = {
...rest,
calls: rest.calls?.length
? rest.calls
: [
{
to: rest.to ||
(!rest.data || rest.data === '0x'
? '0x0000000000000000000000000000000000000000'
: undefined),
value: rest.value,
data: rest.data,
},
],
chainId: Number(chainId),
feePayerSignature,
type: 'tempo',
...(nonce ? { nonce: BigInt(nonce) } : {}),
};
if (feePayer === true)
delete transaction_ox.feeToken;
if (signature && typeof transaction.feePayer === 'object') {
const tx = tempo_1.TxEnvelopeTempo.from(transaction_ox, {
signature,
});
const sender = (() => {
if (transaction.from)
return transaction.from;
if (signature.type === 'secp256k1')
return Secp256k1.recoverAddress({
payload: tempo_1.TxEnvelopeTempo.getSignPayload(tx),
signature: signature.signature,
});
throw new Error('Unable to extract sender from transaction or signature.');
})();
const hash = tempo_1.TxEnvelopeTempo.getFeePayerSignPayload(tx, {
sender,
});
const feePayerSignature = await transaction.feePayer.sign({
hash,
});
return tempo_1.TxEnvelopeTempo.serialize(tx, {
feePayerSignature: Signature.from(feePayerSignature),
});
}
if (feePayer === true) {
if (signature)
return tempo_1.TxEnvelopeTempo.serialize(transaction_ox, {
format: 'feePayer',
sender: transaction.from,
signature,
});
return tempo_1.TxEnvelopeTempo.serialize(transaction_ox, {
feePayerSignature: null,
});
}
return tempo_1.TxEnvelopeTempo.serialize({ ...transaction_ox, ...(feePayer ? { feeToken: undefined } : {}) }, {
feePayerSignature: undefined,
signature,
});
}
var tempo_2 = require("ox/tempo");
Object.defineProperty(exports, "z_KeyAuthorization", { enumerable: true, get: function () { return tempo_2.KeyAuthorization; } });
Object.defineProperty(exports, "z_SignatureEnvelope", { enumerable: true, get: function () { return tempo_2.SignatureEnvelope; } });
Object.defineProperty(exports, "z_TxEnvelopeTempo", { enumerable: true, get: function () { return tempo_2.TxEnvelopeTempo; } });
//# sourceMappingURL=Transaction.js.map

1
node_modules/viem/_cjs/tempo/Transaction.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

162
node_modules/viem/_cjs/tempo/Transport.js generated vendored Normal file
View File

@@ -0,0 +1,162 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withRelay = withRelay;
exports.withFeePayer = withFeePayer;
exports.walletNamespaceCompat = walletNamespaceCompat;
const Address = require("ox/Address");
const Hash = require("ox/Hash");
const Hex = require("ox/Hex");
const Provider = require("ox/Provider");
const RpcRequest = require("ox/RpcRequest");
const getTransactionReceipt_js_1 = require("../actions/public/getTransactionReceipt.js");
const sendTransaction_js_1 = require("../actions/wallet/sendTransaction.js");
const sendTransactionSync_js_1 = require("../actions/wallet/sendTransactionSync.js");
const createClient_js_1 = require("../clients/createClient.js");
const createTransport_js_1 = require("../clients/transports/createTransport.js");
const Transaction = require("./Transaction.js");
function withRelay(defaultTransport, relayTransport, parameters) {
const { policy = 'sign-only' } = parameters ?? {};
return (config) => {
const transport_default = defaultTransport(config);
const transport_relay = relayTransport(config);
return (0, createTransport_js_1.createTransport)({
key: withRelay.type,
name: 'Relay Proxy',
async request({ method, params }, options) {
if (method === 'eth_fillTransaction')
return transport_relay.request({ method, params }, options);
if (method === 'eth_sendRawTransactionSync' ||
method === 'eth_sendRawTransaction') {
const serialized = params[0];
const transaction = Transaction.deserialize(serialized);
if (transaction.feePayerSignature === null) {
if (policy === 'sign-and-broadcast')
return transport_relay.request({ method, params }, options);
{
const signedTransaction = await transport_relay.request({
method: 'eth_signRawTransaction',
params: [serialized],
}, options);
return transport_default.request({ method, params: [signedTransaction] }, options);
}
}
}
return (await transport_default.request({ method, params }, options));
},
type: withRelay.type,
});
};
}
function withFeePayer(defaultTransport, relayTransport, parameters) {
const { policy = 'sign-only' } = parameters ?? {};
return (config) => {
const transport_default = defaultTransport(config);
const transport_relay = relayTransport(config);
return (0, createTransport_js_1.createTransport)({
key: withFeePayer.type,
name: 'Relay Proxy',
async request({ method, params }, options) {
if (method === 'eth_fillTransaction') {
const request = params?.[0];
if (request &&
typeof request === 'object' &&
'feePayer' in request &&
request.feePayer === true)
return transport_relay.request({ method, params }, options);
}
if (method === 'eth_sendRawTransactionSync' ||
method === 'eth_sendRawTransaction') {
const serialized = params[0];
const transaction = Transaction.deserialize(serialized);
if (transaction.feePayerSignature === null) {
if (policy === 'sign-and-broadcast')
return transport_relay.request({ method, params }, options);
{
const signedTransaction = await transport_relay.request({
method: 'eth_signRawTransaction',
params: [serialized],
}, options);
return transport_default.request({ method, params: [signedTransaction] }, options);
}
}
}
return (await transport_default.request({ method, params }, options));
},
type: withFeePayer.type,
});
};
}
function walletNamespaceCompat(transport, options) {
const { account } = options;
const sendCallsMagic = Hash.keccak256(Hex.fromString('TEMPO_5792'));
return (options) => {
const t = transport(options);
const chain = options.chain;
return {
...t,
async request(args) {
const request = RpcRequest.from(args);
const client = (0, createClient_js_1.createClient)({
chain,
transport,
});
if (request.method === 'wallet_sendCalls') {
const params = request.params[0] ?? {};
const { capabilities, chainId, from } = params;
const { sync, ...properties } = capabilities ?? {};
if (!chainId)
throw new Provider.UnsupportedChainIdError();
if (Number(chainId) !== client.chain.id)
throw new Provider.UnsupportedChainIdError();
if (from && !Address.isEqual(from, account.address))
throw new Provider.DisconnectedError();
const calls = (params.calls ?? []).map((call) => ({
to: call.to,
value: call.value ? BigInt(call.value) : undefined,
data: call.data,
}));
const hash = await (async () => {
if (!sync)
return (0, sendTransaction_js_1.sendTransaction)(client, {
account,
...(properties ? properties : {}),
calls,
});
const { transactionHash } = await (0, sendTransactionSync_js_1.sendTransactionSync)(client, {
account,
...(properties ? properties : {}),
calls,
});
return transactionHash;
})();
const id = Hex.concat(hash, Hex.padLeft(chainId, 32), sendCallsMagic);
return {
capabilities: { sync },
id,
};
}
if (request.method === 'wallet_getCallsStatus') {
const [id] = request.params ?? [];
if (!id)
throw new Error('`id` not found');
if (!id.endsWith(sendCallsMagic.slice(2)))
throw new Error('`id` not supported');
Hex.assert(id);
const hash = Hex.slice(id, 0, 32);
const chainId = Hex.slice(id, 32, 64);
const receipt = await (0, getTransactionReceipt_js_1.getTransactionReceipt)(client, { hash });
return {
atomic: true,
chainId: Number(chainId),
id,
receipts: [receipt],
status: receipt.status === 'success' ? 200 : 500,
version: '2.0.0',
};
}
return t.request(args);
},
};
};
}
//# sourceMappingURL=Transport.js.map

1
node_modules/viem/_cjs/tempo/Transport.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

58
node_modules/viem/_cjs/tempo/WebAuthnP256.js generated vendored Normal file
View File

@@ -0,0 +1,58 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createCredential = createCredential;
exports.getCredential = getCredential;
const Bytes = require("ox/Bytes");
const PublicKey = require("ox/PublicKey");
const WebAuthnP256 = require("ox/WebAuthnP256");
async function createCredential(parameters) {
const { createFn, label, rpId, userId } = parameters;
const credential = await WebAuthnP256.createCredential({
...parameters,
authenticatorSelection: {
...parameters.authenticatorSelection,
requireResidentKey: true,
residentKey: 'required',
userVerification: 'required',
},
createFn,
extensions: {
...parameters.extensions,
credProps: true,
},
rp: rpId
? {
id: rpId,
name: rpId,
}
: undefined,
name: undefined,
user: {
displayName: label,
id: new Uint8Array(userId ?? Bytes.fromString(label)),
name: label,
},
});
return {
id: credential.id,
publicKey: PublicKey.toHex(credential.publicKey, {
includePrefix: false,
}),
raw: credential.raw,
};
}
async function getCredential(parameters) {
const { metadata, raw, signature } = await WebAuthnP256.sign({
...parameters,
challenge: parameters.hash ?? '0x',
});
const publicKey = await parameters.getPublicKey(raw);
return {
id: raw.id,
metadata,
publicKey,
raw,
signature,
};
}
//# sourceMappingURL=WebAuthnP256.js.map

1
node_modules/viem/_cjs/tempo/WebAuthnP256.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"WebAuthnP256.js","sourceRoot":"","sources":["../../tempo/WebAuthnP256.ts"],"names":[],"mappings":";;AAgCA,4CAqCC;AA+CD,sCAeC;AAnID,kCAAiC;AAEjC,0CAAyC;AACzC,gDAA+C;AA6BxC,KAAK,UAAU,gBAAgB,CACpC,UAAuC;IAEvC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;IACpD,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,gBAAgB,CAAC;QACrD,GAAG,UAAU;QACb,sBAAsB,EAAE;YACtB,GAAG,UAAU,CAAC,sBAAsB;YACpC,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,UAAU;YACvB,gBAAgB,EAAE,UAAU;SAC7B;QACD,QAAQ;QACR,UAAU,EAAE;YACV,GAAG,UAAU,CAAC,UAAU;YACxB,SAAS,EAAE,IAAI;SAChB;QACD,EAAE,EAAE,IAAI;YACN,CAAC,CAAC;gBACE,EAAE,EAAE,IAAI;gBACR,IAAI,EAAE,IAAI;aACX;YACH,CAAC,CAAC,SAAS;QACb,IAAI,EAAE,SAAkB;QACxB,IAAI,EAAE;YACJ,WAAW,EAAE,KAAK;YAClB,EAAE,EAAE,IAAI,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACrD,IAAI,EAAE,KAAK;SACZ;KACF,CAAC,CAAA;IACF,OAAO;QACL,EAAE,EAAE,UAAU,CAAC,EAAE;QACjB,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE;YAC/C,aAAa,EAAE,KAAK;SACrB,CAAC;QACF,GAAG,EAAE,UAAU,CAAC,GAAG;KACpB,CAAA;AACH,CAAC;AA+CM,KAAK,UAAU,aAAa,CACjC,UAAoC;IAEpC,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC;QAC3D,GAAG,UAAU;QACb,SAAS,EAAE,UAAU,CAAC,IAAI,IAAI,IAAI;KACnC,CAAC,CAAA;IACF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACpD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,QAAQ;QACR,SAAS;QACT,GAAG;QACH,SAAS;KACV,CAAA;AACH,CAAC"}

6
node_modules/viem/_cjs/tempo/WebCryptoP256.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createKeyPair = void 0;
var WebCryptoP256_1 = require("ox/WebCryptoP256");
Object.defineProperty(exports, "createKeyPair", { enumerable: true, get: function () { return WebCryptoP256_1.createKeyPair; } });
//# sourceMappingURL=WebCryptoP256.js.map

1
node_modules/viem/_cjs/tempo/WebCryptoP256.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"WebCryptoP256.js","sourceRoot":"","sources":["../../tempo/WebCryptoP256.ts"],"names":[],"mappings":";;;AACA,kDAAgD;AAAvC,8GAAA,aAAa,OAAA"}

276
node_modules/viem/_cjs/tempo/actions/accessKey.js generated vendored Normal file
View File

@@ -0,0 +1,276 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.authorize = authorize;
exports.authorizeSync = authorizeSync;
exports.revoke = revoke;
exports.revokeSync = revokeSync;
exports.updateLimit = updateLimit;
exports.updateLimitSync = updateLimitSync;
exports.getMetadata = getMetadata;
exports.getRemainingLimit = getRemainingLimit;
exports.signAuthorization = signAuthorization;
const parseAccount_js_1 = require("../../accounts/utils/parseAccount.js");
const readContract_js_1 = require("../../actions/public/readContract.js");
const sendTransaction_js_1 = require("../../actions/wallet/sendTransaction.js");
const sendTransactionSync_js_1 = require("../../actions/wallet/sendTransactionSync.js");
const writeContract_js_1 = require("../../actions/wallet/writeContract.js");
const writeContractSync_js_1 = require("../../actions/wallet/writeContractSync.js");
const parseEventLogs_js_1 = require("../../utils/abi/parseEventLogs.js");
const Abis = require("../Abis.js");
const Account_js_1 = require("../Account.js");
const Addresses = require("../Addresses.js");
const Hardfork = require("../Hardfork.js");
const utils_js_1 = require("../internal/utils.js");
const signatureTypes = {
0: 'secp256k1',
1: 'p256',
2: 'webAuthn',
};
const spendPolicies = {
true: 'limited',
false: 'unlimited',
};
async function authorize(client, parameters) {
return authorize.inner(sendTransaction_js_1.sendTransaction, client, parameters);
}
(function (authorize) {
async function inner(action, client, parameters) {
const { accessKey, chainId = client.chain?.id, expiry, limits, scopes, ...rest } = parameters;
const account_ = rest.account ?? client.account;
if (!account_)
throw new Error('account is required.');
if (!chainId)
throw new Error('chainId is required.');
const parsed = (0, parseAccount_js_1.parseAccount)(account_);
const keyAuthorization = await (0, Account_js_1.signKeyAuthorization)(parsed, {
chainId: BigInt(chainId),
key: accessKey,
expiry,
limits,
scopes,
});
return (await action(client, {
...rest,
keyAuthorization,
}));
}
authorize.inner = inner;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.accountKeychain,
logs,
eventName: 'KeyAuthorized',
strict: true,
});
if (!log)
throw new Error('`KeyAuthorized` event not found.');
return log;
}
authorize.extractEvent = extractEvent;
})(authorize || (exports.authorize = authorize = {}));
async function authorizeSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await authorize.inner(sendTransactionSync_js_1.sendTransactionSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = authorize.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function revoke(client, parameters) {
return revoke.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (revoke) {
async function inner(action, client, parameters) {
const { accessKey, ...rest } = parameters;
const call = revoke.call({ accessKey });
return (await action(client, {
...rest,
...call,
}));
}
revoke.inner = inner;
function call(args) {
const { accessKey } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.accountKeychain,
abi: Abis.accountKeychain,
functionName: 'revokeKey',
args: [resolveAccessKeyAddress(accessKey)],
});
}
revoke.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.accountKeychain,
logs,
eventName: 'KeyRevoked',
strict: true,
});
if (!log)
throw new Error('`KeyRevoked` event not found.');
return log;
}
revoke.extractEvent = extractEvent;
})(revoke || (exports.revoke = revoke = {}));
async function revokeSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await revoke.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = revoke.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function updateLimit(client, parameters) {
return updateLimit.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (updateLimit) {
async function inner(action, client, parameters) {
const { accessKey, token, limit, ...rest } = parameters;
const call = updateLimit.call({ accessKey, token, limit });
return (await action(client, {
...rest,
...call,
}));
}
updateLimit.inner = inner;
function call(args) {
const { accessKey, token, limit } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.accountKeychain,
abi: Abis.accountKeychain,
functionName: 'updateSpendingLimit',
args: [resolveAccessKeyAddress(accessKey), token, limit],
});
}
updateLimit.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.accountKeychain,
logs,
eventName: 'SpendingLimitUpdated',
strict: true,
});
if (!log)
throw new Error('`SpendingLimitUpdated` event not found.');
return log;
}
updateLimit.extractEvent = extractEvent;
})(updateLimit || (exports.updateLimit = updateLimit = {}));
async function updateLimitSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await updateLimit.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = updateLimit.extractEvent(receipt.logs);
return {
account: args.account,
publicKey: args.publicKey,
token: args.token,
limit: args.newLimit,
receipt,
};
}
async function getMetadata(client, parameters) {
const { account: account_ = client.account, accessKey, ...rest } = parameters;
if (!account_)
throw new Error('account is required.');
const account = (0, parseAccount_js_1.parseAccount)(account_);
const result = await (0, readContract_js_1.readContract)(client, {
...rest,
...getMetadata.call({ account: account.address, accessKey }),
});
return {
address: result.keyId,
keyType: signatureTypes[result.signatureType] ??
'secp256k1',
expiry: result.expiry,
spendPolicy: spendPolicies[`${result.enforceLimits}`],
isRevoked: result.isRevoked,
};
}
(function (getMetadata) {
function call(args) {
const { account, accessKey } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.accountKeychain,
abi: Abis.accountKeychain,
functionName: 'getKey',
args: [account, resolveAccessKeyAddress(accessKey)],
});
}
getMetadata.call = call;
})(getMetadata || (exports.getMetadata = getMetadata = {}));
async function getRemainingLimit(client, parameters) {
const { account: account_ = client.account, accessKey, token, ...rest } = parameters;
if (!account_)
throw new Error('account is required.');
const account = (0, parseAccount_js_1.parseAccount)(account_);
const hardfork = client.chain?.hardfork;
if (hardfork && Hardfork.lt(hardfork, 't3')) {
const remaining = await (0, readContract_js_1.readContract)(client, {
...rest,
...getRemainingLimit.call({ account: account.address, accessKey, token }),
});
return { remaining, periodEnd: undefined };
}
const [remaining, periodEnd] = await (0, readContract_js_1.readContract)(client, {
...rest,
...getRemainingLimit.callWithPeriod({
account: account.address,
accessKey,
token,
}),
});
return { remaining, periodEnd };
}
(function (getRemainingLimit) {
function call(args) {
const { account, accessKey, token } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.accountKeychain,
abi: Abis.accountKeychain,
functionName: 'getRemainingLimit',
args: [account, resolveAccessKeyAddress(accessKey), token],
});
}
getRemainingLimit.call = call;
function callWithPeriod(args) {
const { account, accessKey, token } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.accountKeychain,
abi: Abis.accountKeychain,
functionName: 'getRemainingLimitWithPeriod',
args: [account, resolveAccessKeyAddress(accessKey), token],
});
}
getRemainingLimit.callWithPeriod = callWithPeriod;
})(getRemainingLimit || (exports.getRemainingLimit = getRemainingLimit = {}));
async function signAuthorization(client, parameters) {
const { accessKey, chainId = client.chain?.id, ...rest } = parameters;
const account_ = rest.account ?? client.account;
if (!account_)
throw new Error('account is required.');
if (!chainId)
throw new Error('chainId is required.');
const parsed = (0, parseAccount_js_1.parseAccount)(account_);
return (0, Account_js_1.signKeyAuthorization)(parsed, {
chainId: BigInt(chainId),
key: accessKey,
...rest,
});
}
function resolveAccessKeyAddress(accessKey) {
if (typeof accessKey === 'string')
return accessKey;
return accessKey.accessKeyAddress;
}
//# sourceMappingURL=accessKey.js.map

File diff suppressed because one or more lines are too long

324
node_modules/viem/_cjs/tempo/actions/amm.js generated vendored Normal file
View File

@@ -0,0 +1,324 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPool = getPool;
exports.getLiquidityBalance = getLiquidityBalance;
exports.rebalanceSwap = rebalanceSwap;
exports.rebalanceSwapSync = rebalanceSwapSync;
exports.mint = mint;
exports.mintSync = mintSync;
exports.burn = burn;
exports.burnSync = burnSync;
exports.watchRebalanceSwap = watchRebalanceSwap;
exports.watchMint = watchMint;
exports.watchBurn = watchBurn;
const tempo_1 = require("ox/tempo");
const multicall_js_1 = require("../../actions/public/multicall.js");
const readContract_js_1 = require("../../actions/public/readContract.js");
const watchContractEvent_js_1 = require("../../actions/public/watchContractEvent.js");
const writeContract_js_1 = require("../../actions/wallet/writeContract.js");
const writeContractSync_js_1 = require("../../actions/wallet/writeContractSync.js");
const parseEventLogs_js_1 = require("../../utils/abi/parseEventLogs.js");
const Abis = require("../Abis.js");
const Addresses = require("../Addresses.js");
const utils_js_1 = require("../internal/utils.js");
async function getPool(client, parameters) {
const { userToken, validatorToken, ...rest } = parameters;
const [pool, totalSupply] = await (0, multicall_js_1.multicall)(client, {
...rest,
contracts: getPool.calls({ userToken, validatorToken }),
allowFailure: false,
deployless: true,
});
return {
reserveUserToken: pool.reserveUserToken,
reserveValidatorToken: pool.reserveValidatorToken,
totalSupply,
};
}
(function (getPool) {
function calls(args) {
const { userToken, validatorToken } = args;
return [
(0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeAmm,
args: [tempo_1.TokenId.toAddress(userToken), tempo_1.TokenId.toAddress(validatorToken)],
functionName: 'getPool',
}),
(0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeAmm,
args: [tempo_1.PoolId.from({ userToken, validatorToken })],
functionName: 'totalSupply',
}),
];
}
getPool.calls = calls;
})(getPool || (exports.getPool = getPool = {}));
async function getLiquidityBalance(client, parameters) {
const { address, poolId, userToken, validatorToken, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
...getLiquidityBalance.call({
address,
poolId,
userToken,
validatorToken,
}),
});
}
(function (getLiquidityBalance) {
function call(args) {
const { address } = args;
const poolId = (() => {
if ('poolId' in args && args.poolId)
return args.poolId;
if ('userToken' in args && 'validatorToken' in args)
return tempo_1.PoolId.from({
userToken: args.userToken,
validatorToken: args.validatorToken,
});
throw new Error('`poolId`, or `userToken` and `validatorToken` must be provided.');
})();
return (0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeAmm,
args: [poolId, address],
functionName: 'liquidityBalances',
});
}
getLiquidityBalance.call = call;
})(getLiquidityBalance || (exports.getLiquidityBalance = getLiquidityBalance = {}));
async function rebalanceSwap(client, parameters) {
return rebalanceSwap.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (rebalanceSwap) {
async function inner(action, client, parameters) {
const { userToken, validatorToken, amountOut, to, ...rest } = parameters;
const call = rebalanceSwap.call({
userToken,
validatorToken,
amountOut,
to,
});
return (await action(client, {
...rest,
...call,
}));
}
rebalanceSwap.inner = inner;
function call(args) {
const { userToken, validatorToken, amountOut, to } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeAmm,
functionName: 'rebalanceSwap',
args: [
tempo_1.TokenId.toAddress(userToken),
tempo_1.TokenId.toAddress(validatorToken),
amountOut,
to,
],
});
}
rebalanceSwap.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.feeAmm,
logs,
eventName: 'RebalanceSwap',
strict: true,
});
if (!log)
throw new Error('`RebalanceSwap` event not found.');
return log;
}
rebalanceSwap.extractEvent = extractEvent;
})(rebalanceSwap || (exports.rebalanceSwap = rebalanceSwap = {}));
async function rebalanceSwapSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await rebalanceSwap.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = rebalanceSwap.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function mint(client, parameters) {
return mint.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (mint) {
async function inner(action, client, parameters) {
const { to, userTokenAddress, validatorTokenAddress, validatorTokenAmount, ...rest } = parameters;
const call = mint.call({
to,
userTokenAddress,
validatorTokenAddress,
validatorTokenAmount,
});
return (await action(client, {
...rest,
...call,
}));
}
mint.inner = inner;
function call(args) {
const { to, userTokenAddress, validatorTokenAddress, validatorTokenAmount, } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeAmm,
functionName: 'mint',
args: [
tempo_1.TokenId.toAddress(userTokenAddress),
tempo_1.TokenId.toAddress(validatorTokenAddress),
validatorTokenAmount,
to,
],
});
}
mint.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.feeAmm,
logs,
eventName: 'Mint',
strict: true,
});
if (!log)
throw new Error('`Mint` event not found.');
return log;
}
mint.extractEvent = extractEvent;
})(mint || (exports.mint = mint = {}));
async function mintSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await mint.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = mint.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function burn(client, parameters) {
return burn.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (burn) {
async function inner(action, client, parameters) {
const { liquidity, to, userToken, validatorToken, ...rest } = parameters;
const call = burn.call({ liquidity, to, userToken, validatorToken });
return (await action(client, {
...rest,
...call,
}));
}
burn.inner = inner;
function call(args) {
const { liquidity, to, userToken, validatorToken } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeAmm,
functionName: 'burn',
args: [
tempo_1.TokenId.toAddress(userToken),
tempo_1.TokenId.toAddress(validatorToken),
liquidity,
to,
],
});
}
burn.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.feeAmm,
logs,
eventName: 'Burn',
strict: true,
});
if (!log)
throw new Error('`Burn` event not found.');
return log;
}
burn.extractEvent = extractEvent;
})(burn || (exports.burn = burn = {}));
async function burnSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await burn.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = burn.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
function watchRebalanceSwap(client, parameters) {
const { onRebalanceSwap, userToken, validatorToken, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.feeManager,
abi: Abis.feeAmm,
eventName: 'RebalanceSwap',
args: userToken !== undefined && validatorToken !== undefined
? {
userToken: tempo_1.TokenId.toAddress(userToken),
validatorToken: tempo_1.TokenId.toAddress(validatorToken),
}
: undefined,
onLogs: (logs) => {
for (const log of logs)
onRebalanceSwap(log.args, log);
},
strict: true,
});
}
function watchMint(client, parameters) {
const { onMint, to, userToken, validatorToken, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.feeManager,
abi: Abis.feeAmm,
eventName: 'Mint',
args: {
to,
...(userToken !== undefined && {
userToken: tempo_1.TokenId.toAddress(userToken),
}),
...(validatorToken !== undefined && {
validatorToken: tempo_1.TokenId.toAddress(validatorToken),
}),
},
onLogs: (logs) => {
for (const log of logs)
onMint(log.args, log);
},
strict: true,
});
}
function watchBurn(client, parameters) {
const { onBurn, userToken, validatorToken, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.feeManager,
abi: Abis.feeAmm,
eventName: 'Burn',
args: userToken !== undefined && validatorToken !== undefined
? {
userToken: tempo_1.TokenId.toAddress(userToken),
validatorToken: tempo_1.TokenId.toAddress(validatorToken),
}
: undefined,
onLogs: (logs) => {
for (const log of logs)
onBurn(log.args, log);
},
strict: true,
});
}
//# sourceMappingURL=amm.js.map

1
node_modules/viem/_cjs/tempo/actions/amm.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

573
node_modules/viem/_cjs/tempo/actions/dex.js generated vendored Normal file
View File

@@ -0,0 +1,573 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buy = buy;
exports.buySync = buySync;
exports.cancel = cancel;
exports.cancelSync = cancelSync;
exports.cancelStale = cancelStale;
exports.cancelStaleSync = cancelStaleSync;
exports.createPair = createPair;
exports.createPairSync = createPairSync;
exports.getBalance = getBalance;
exports.getBuyQuote = getBuyQuote;
exports.getOrder = getOrder;
exports.getOrderbook = getOrderbook;
exports.getTickLevel = getTickLevel;
exports.getSellQuote = getSellQuote;
exports.place = place;
exports.placeFlip = placeFlip;
exports.placeFlipSync = placeFlipSync;
exports.placeSync = placeSync;
exports.sell = sell;
exports.sellSync = sellSync;
exports.watchFlipOrderPlaced = watchFlipOrderPlaced;
exports.watchOrderCancelled = watchOrderCancelled;
exports.watchOrderFilled = watchOrderFilled;
exports.watchOrderPlaced = watchOrderPlaced;
exports.withdraw = withdraw;
exports.withdrawSync = withdrawSync;
const Hash = require("ox/Hash");
const Hex = require("ox/Hex");
const parseAccount_js_1 = require("../../accounts/utils/parseAccount.js");
const readContract_js_1 = require("../../actions/public/readContract.js");
const watchContractEvent_js_1 = require("../../actions/public/watchContractEvent.js");
const writeContract_js_1 = require("../../actions/wallet/writeContract.js");
const writeContractSync_js_1 = require("../../actions/wallet/writeContractSync.js");
const parseEventLogs_js_1 = require("../../utils/abi/parseEventLogs.js");
const Abis = require("../Abis.js");
const Addresses = require("../Addresses.js");
const utils_js_1 = require("../internal/utils.js");
async function buy(client, parameters) {
return buy.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (buy) {
async function inner(action, client, parameters) {
const { tokenIn, tokenOut, amountOut, maxAmountIn, ...rest } = parameters;
const call = buy.call({ tokenIn, tokenOut, amountOut, maxAmountIn });
return (await action(client, {
...rest,
...call,
}));
}
buy.inner = inner;
function call(args) {
const { tokenIn, tokenOut, amountOut, maxAmountIn } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
functionName: 'swapExactAmountOut',
args: [tokenIn, tokenOut, amountOut, maxAmountIn],
});
}
buy.call = call;
})(buy || (exports.buy = buy = {}));
async function buySync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await buy.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
return { receipt };
}
async function cancel(client, parameters) {
return cancel.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (cancel) {
async function inner(action, client, parameters) {
const { orderId, ...rest } = parameters;
const call = cancel.call({ orderId });
return (await action(client, {
...rest,
...call,
}));
}
cancel.inner = inner;
function call(args) {
const { orderId } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
functionName: 'cancel',
args: [orderId],
});
}
cancel.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.stablecoinDex,
logs,
eventName: 'OrderCancelled',
strict: true,
});
if (!log)
throw new Error('`OrderCancelled` event not found.');
return log;
}
cancel.extractEvent = extractEvent;
})(cancel || (exports.cancel = cancel = {}));
async function cancelSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await cancel.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = cancel.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function cancelStale(client, parameters) {
return cancelStale.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (cancelStale) {
async function inner(action, client, parameters) {
const { orderId, ...rest } = parameters;
const call = cancelStale.call({ orderId });
return (await action(client, {
...rest,
...call,
}));
}
cancelStale.inner = inner;
function call(args) {
const { orderId } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
functionName: 'cancelStaleOrder',
args: [orderId],
});
}
cancelStale.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.stablecoinDex,
logs,
eventName: 'OrderCancelled',
strict: true,
});
if (!log)
throw new Error('`OrderCancelled` event not found.');
return log;
}
cancelStale.extractEvent = extractEvent;
})(cancelStale || (exports.cancelStale = cancelStale = {}));
async function cancelStaleSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await cancelStale.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = cancelStale.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function createPair(client, parameters) {
return createPair.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (createPair) {
async function inner(action, client, parameters) {
const { base, ...rest } = parameters;
const call = createPair.call({ base });
return (await action(client, {
...rest,
...call,
}));
}
createPair.inner = inner;
function call(args) {
const { base } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
functionName: 'createPair',
args: [base],
});
}
createPair.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.stablecoinDex,
logs,
eventName: 'PairCreated',
strict: true,
});
if (!log)
throw new Error('`PairCreated` event not found.');
return log;
}
createPair.extractEvent = extractEvent;
})(createPair || (exports.createPair = createPair = {}));
async function createPairSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await createPair.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = createPair.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function getBalance(client, parameters) {
const { account: acc = client.account, token, ...rest } = parameters;
const address = acc ? (0, parseAccount_js_1.parseAccount)(acc).address : undefined;
if (!address)
throw new Error('account is required.');
return (0, readContract_js_1.readContract)(client, {
...rest,
...getBalance.call({ account: address, token }),
});
}
(function (getBalance) {
function call(args) {
const { account, token } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
args: [account, token],
functionName: 'balanceOf',
});
}
getBalance.call = call;
})(getBalance || (exports.getBalance = getBalance = {}));
async function getBuyQuote(client, parameters) {
const { tokenIn, tokenOut, amountOut, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
...getBuyQuote.call({ tokenIn, tokenOut, amountOut }),
});
}
(function (getBuyQuote) {
function call(args) {
const { tokenIn, tokenOut, amountOut } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
args: [tokenIn, tokenOut, amountOut],
functionName: 'quoteSwapExactAmountOut',
});
}
getBuyQuote.call = call;
})(getBuyQuote || (exports.getBuyQuote = getBuyQuote = {}));
async function getOrder(client, parameters) {
const { orderId, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
...getOrder.call({ orderId }),
});
}
(function (getOrder) {
function call(args) {
const { orderId } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
args: [orderId],
functionName: 'getOrder',
});
}
getOrder.call = call;
})(getOrder || (exports.getOrder = getOrder = {}));
async function getOrderbook(client, parameters) {
const { base, quote, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
...getOrderbook.call({ base, quote }),
});
}
(function (getOrderbook) {
function call(args) {
const { base, quote } = args;
const pairKey = getPairKey(base, quote);
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
args: [pairKey],
functionName: 'books',
});
}
getOrderbook.call = call;
})(getOrderbook || (exports.getOrderbook = getOrderbook = {}));
async function getTickLevel(client, parameters) {
const { base, tick, isBid, ...rest } = parameters;
const [head, tail, totalLiquidity] = await (0, readContract_js_1.readContract)(client, {
...rest,
...getTickLevel.call({ base, tick, isBid }),
});
return { head, tail, totalLiquidity };
}
(function (getTickLevel) {
function call(args) {
const { base, tick, isBid } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
args: [base, tick, isBid],
functionName: 'getTickLevel',
});
}
getTickLevel.call = call;
})(getTickLevel || (exports.getTickLevel = getTickLevel = {}));
async function getSellQuote(client, parameters) {
const { tokenIn, tokenOut, amountIn, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
...getSellQuote.call({ tokenIn, tokenOut, amountIn }),
});
}
(function (getSellQuote) {
function call(args) {
const { tokenIn, tokenOut, amountIn } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
args: [tokenIn, tokenOut, amountIn],
functionName: 'quoteSwapExactAmountIn',
});
}
getSellQuote.call = call;
})(getSellQuote || (exports.getSellQuote = getSellQuote = {}));
async function place(client, parameters) {
return place.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (place) {
async function inner(action, client, parameters) {
const { amount, token, type, tick, ...rest } = parameters;
const call = place.call({ amount, token, type, tick });
return (await action(client, {
...rest,
...call,
}));
}
place.inner = inner;
function call(args) {
const { token, amount, type, tick } = args;
const isBid = type === 'buy';
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
functionName: 'place',
args: [token, amount, isBid, tick],
});
}
place.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.stablecoinDex,
logs,
eventName: 'OrderPlaced',
strict: true,
});
if (!log)
throw new Error('`OrderPlaced` event not found.');
return log;
}
place.extractEvent = extractEvent;
})(place || (exports.place = place = {}));
async function placeFlip(client, parameters) {
return placeFlip.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (placeFlip) {
async function inner(action, client, parameters) {
const { amount, flipTick, tick, token, type, ...rest } = parameters;
const call = placeFlip.call({ amount, flipTick, tick, token, type });
return (await action(client, {
...rest,
...call,
}));
}
placeFlip.inner = inner;
function call(args) {
const { token, amount, type, tick, flipTick } = args;
const isBid = type === 'buy';
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
functionName: 'placeFlip',
args: [token, amount, isBid, tick, flipTick],
});
}
placeFlip.call = call;
function extractEvent(logs) {
const parsedLogs = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.stablecoinDex,
logs,
eventName: 'OrderPlaced',
strict: true,
});
const log = parsedLogs.find((l) => l.args.isFlipOrder);
if (!log)
throw new Error('`OrderPlaced` event (flip order) not found.');
return log;
}
placeFlip.extractEvent = extractEvent;
})(placeFlip || (exports.placeFlip = placeFlip = {}));
async function placeFlipSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await placeFlip.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = placeFlip.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function placeSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await place.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = place.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function sell(client, parameters) {
return sell.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (sell) {
async function inner(action, client, parameters) {
const { tokenIn, tokenOut, amountIn, minAmountOut, ...rest } = parameters;
const call = sell.call({ tokenIn, tokenOut, amountIn, minAmountOut });
return (await action(client, {
...rest,
...call,
}));
}
sell.inner = inner;
function call(args) {
const { tokenIn, tokenOut, amountIn, minAmountOut } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
functionName: 'swapExactAmountIn',
args: [tokenIn, tokenOut, amountIn, minAmountOut],
});
}
sell.call = call;
})(sell || (exports.sell = sell = {}));
async function sellSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await sell.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
return { receipt };
}
function watchFlipOrderPlaced(client, parameters) {
const { onFlipOrderPlaced, maker, token, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
eventName: 'OrderPlaced',
args: {
...(maker !== undefined && { maker }),
...(token !== undefined && { token }),
},
onLogs: (logs) => {
for (const log of logs) {
if (log.args.isFlipOrder)
onFlipOrderPlaced(log.args, log);
}
},
strict: true,
});
}
function watchOrderCancelled(client, parameters) {
const { onOrderCancelled, orderId, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
eventName: 'OrderCancelled',
args: orderId !== undefined ? { orderId } : undefined,
onLogs: (logs) => {
for (const log of logs)
onOrderCancelled(log.args, log);
},
strict: true,
});
}
function watchOrderFilled(client, parameters) {
const { onOrderFilled, maker, taker, orderId, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
eventName: 'OrderFilled',
args: {
...(orderId !== undefined && { orderId }),
...(maker !== undefined && { maker }),
...(taker !== undefined && { taker }),
},
onLogs: (logs) => {
for (const log of logs)
onOrderFilled(log.args, log);
},
strict: true,
});
}
function watchOrderPlaced(client, parameters) {
const { onOrderPlaced, maker, token, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
eventName: 'OrderPlaced',
args: {
...(maker !== undefined && { maker }),
...(token !== undefined && { token }),
},
onLogs: (logs) => {
for (const log of logs)
onOrderPlaced(log.args, log);
},
strict: true,
});
}
async function withdraw(client, parameters) {
return withdraw.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (withdraw) {
async function inner(action, client, parameters) {
const { token, amount, ...rest } = parameters;
const call = withdraw.call({ token, amount });
return (await action(client, {
...rest,
...call,
}));
}
withdraw.inner = inner;
function call(args) {
const { token, amount } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.stablecoinDex,
abi: Abis.stablecoinDex,
functionName: 'withdraw',
args: [token, amount],
});
}
withdraw.call = call;
})(withdraw || (exports.withdraw = withdraw = {}));
async function withdrawSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await withdraw.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
return { receipt };
}
function getPairKey(base, quote) {
return Hash.keccak256(Hex.concat(base, quote));
}
//# sourceMappingURL=dex.js.map

1
node_modules/viem/_cjs/tempo/actions/dex.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

28
node_modules/viem/_cjs/tempo/actions/faucet.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fund = fund;
exports.fundSync = fundSync;
const parseAccount_js_1 = require("../../accounts/utils/parseAccount.js");
const waitForTransactionReceipt_js_1 = require("../../actions/public/waitForTransactionReceipt.js");
async function fund(client, parameters) {
const account = (0, parseAccount_js_1.parseAccount)(parameters.account);
return client.request({
method: 'tempo_fundAddress',
params: [account.address],
});
}
async function fundSync(client, parameters) {
const { timeout = 10_000 } = parameters;
const account = (0, parseAccount_js_1.parseAccount)(parameters.account);
const hashes = await client.request({
method: 'tempo_fundAddress',
params: [account.address],
});
const receipts = await Promise.all(hashes.map((hash) => (0, waitForTransactionReceipt_js_1.waitForTransactionReceipt)(client, {
hash,
checkReplacement: false,
timeout,
})));
return receipts;
}
//# sourceMappingURL=faucet.js.map

1
node_modules/viem/_cjs/tempo/actions/faucet.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"faucet.js","sourceRoot":"","sources":["../../../tempo/actions/faucet.ts"],"names":[],"mappings":";;AAkCA,oBAaC;AAoCD,4BAwBC;AAzGD,0EAAmE;AACnE,oGAA6F;AA+BtF,KAAK,UAAU,IAAI,CACxB,MAAgC,EAChC,UAA2B;IAE3B,MAAM,OAAO,GAAG,IAAA,8BAAY,EAAC,UAAU,CAAC,OAAO,CAAC,CAAA;IAChD,OAAO,MAAM,CAAC,OAAO,CAIlB;QACD,MAAM,EAAE,mBAAmB;QAC3B,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;KAC1B,CAAC,CAAA;AACJ,CAAC;AAoCM,KAAK,UAAU,QAAQ,CAC5B,MAAgC,EAChC,UAA+B;IAE/B,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IACvC,MAAM,OAAO,GAAG,IAAA,8BAAY,EAAC,UAAU,CAAC,OAAO,CAAC,CAAA;IAChD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAIhC;QACD,MAAM,EAAE,mBAAmB;QAC3B,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;KAC1B,CAAC,CAAA;IACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAClB,IAAA,wDAAyB,EAAC,MAAM,EAAE;QAChC,IAAI;QACJ,gBAAgB,EAAE,KAAK;QACvB,OAAO;KACR,CAAC,CACH,CACF,CAAA;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}

199
node_modules/viem/_cjs/tempo/actions/fee.js generated vendored Normal file
View File

@@ -0,0 +1,199 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUserToken = getUserToken;
exports.setUserToken = setUserToken;
exports.setUserTokenSync = setUserTokenSync;
exports.watchSetUserToken = watchSetUserToken;
exports.getValidatorToken = getValidatorToken;
exports.setValidatorToken = setValidatorToken;
exports.setValidatorTokenSync = setValidatorTokenSync;
exports.watchSetValidatorToken = watchSetValidatorToken;
const tempo_1 = require("ox/tempo");
const parseAccount_js_1 = require("../../accounts/utils/parseAccount.js");
const readContract_js_1 = require("../../actions/public/readContract.js");
const watchContractEvent_js_1 = require("../../actions/public/watchContractEvent.js");
const writeContract_js_1 = require("../../actions/wallet/writeContract.js");
const writeContractSync_js_1 = require("../../actions/wallet/writeContractSync.js");
const address_js_1 = require("../../constants/address.js");
const parseEventLogs_js_1 = require("../../utils/abi/parseEventLogs.js");
const Abis = require("../Abis.js");
const Addresses = require("../Addresses.js");
const utils_js_1 = require("../internal/utils.js");
async function getUserToken(client, ...parameters) {
const { account: account_ = client.account, ...rest } = parameters[0] ?? {};
if (!account_)
throw new Error('account is required.');
const account = (0, parseAccount_js_1.parseAccount)(account_);
const address = await (0, readContract_js_1.readContract)(client, {
...rest,
...getUserToken.call({ account: account.address }),
});
if (address === address_js_1.zeroAddress)
return null;
return {
address,
id: tempo_1.TokenId.fromAddress(address),
};
}
(function (getUserToken) {
function call(args) {
const { account } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeManager,
args: [account],
functionName: 'userTokens',
});
}
getUserToken.call = call;
})(getUserToken || (exports.getUserToken = getUserToken = {}));
async function setUserToken(client, parameters) {
return setUserToken.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (setUserToken) {
async function inner(action, client, parameters) {
const { token, ...rest } = parameters;
const call = setUserToken.call({ token });
return (await action(client, {
...rest,
...call,
}));
}
setUserToken.inner = inner;
function call(args) {
const { token } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeManager,
functionName: 'setUserToken',
args: [tempo_1.TokenId.toAddress(token)],
});
}
setUserToken.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.feeManager,
logs,
eventName: 'UserTokenSet',
strict: true,
});
if (!log)
throw new Error('`UserTokenSet` event not found.');
return log;
}
setUserToken.extractEvent = extractEvent;
})(setUserToken || (exports.setUserToken = setUserToken = {}));
async function setUserTokenSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await setUserToken.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = setUserToken.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
function watchSetUserToken(client, parameters) {
const { onUserTokenSet, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.feeManager,
abi: Abis.feeManager,
eventName: 'UserTokenSet',
onLogs: (logs) => {
for (const log of logs)
onUserTokenSet(log.args, log);
},
strict: true,
});
}
async function getValidatorToken(client, parameters) {
const { validator, ...rest } = parameters;
const address = await (0, readContract_js_1.readContract)(client, {
...rest,
...getValidatorToken.call({ validator }),
});
if (address === address_js_1.zeroAddress)
return null;
return {
address,
id: tempo_1.TokenId.fromAddress(address),
};
}
(function (getValidatorToken) {
function call(args) {
const { validator } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeManager,
args: [validator],
functionName: 'validatorTokens',
});
}
getValidatorToken.call = call;
})(getValidatorToken || (exports.getValidatorToken = getValidatorToken = {}));
async function setValidatorToken(client, parameters) {
return setValidatorToken.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (setValidatorToken) {
async function inner(action, client, parameters) {
const { token, ...rest } = parameters;
const call = setValidatorToken.call({ token });
return (await action(client, {
...rest,
...call,
}));
}
setValidatorToken.inner = inner;
function call(args) {
const { token } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.feeManager,
abi: Abis.feeManager,
functionName: 'setValidatorToken',
args: [tempo_1.TokenId.toAddress(token)],
});
}
setValidatorToken.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.feeManager,
logs,
eventName: 'ValidatorTokenSet',
strict: true,
});
if (!log)
throw new Error('`ValidatorTokenSet` event not found.');
return log;
}
setValidatorToken.extractEvent = extractEvent;
})(setValidatorToken || (exports.setValidatorToken = setValidatorToken = {}));
async function setValidatorTokenSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await setValidatorToken.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = setValidatorToken.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
function watchSetValidatorToken(client, parameters) {
const { onValidatorTokenSet, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.feeManager,
abi: Abis.feeManager,
eventName: 'ValidatorTokenSet',
onLogs: (logs) => {
for (const log of logs)
onValidatorTokenSet(log.args, log);
},
strict: true,
});
}
//# sourceMappingURL=fee.js.map

1
node_modules/viem/_cjs/tempo/actions/fee.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

17
node_modules/viem/_cjs/tempo/actions/index.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.zone = exports.virtualAddress = exports.validator = exports.token = exports.simulate = exports.reward = exports.policy = exports.nonce = exports.fee = exports.faucet = exports.dex = exports.amm = exports.accessKey = void 0;
exports.accessKey = require("./accessKey.js");
exports.amm = require("./amm.js");
exports.dex = require("./dex.js");
exports.faucet = require("./faucet.js");
exports.fee = require("./fee.js");
exports.nonce = require("./nonce.js");
exports.policy = require("./policy.js");
exports.reward = require("./reward.js");
exports.simulate = require("./simulate.js");
exports.token = require("./token.js");
exports.validator = require("./validator.js");
exports.virtualAddress = require("./virtualAddress.js");
exports.zone = require("./zone.js");
//# sourceMappingURL=index.js.map

1
node_modules/viem/_cjs/tempo/actions/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../tempo/actions/index.ts"],"names":[],"mappings":";;;AACA,8CAA2C;AAC3C,kCAA+B;AAC/B,kCAA+B;AAC/B,wCAAqC;AACrC,kCAA+B;AAC/B,sCAAmC;AACnC,wCAAqC;AACrC,wCAAqC;AACrC,4CAAyC;AACzC,sCAAmC;AACnC,8CAA2C;AAC3C,wDAAqD;AACrD,oCAAiC"}

43
node_modules/viem/_cjs/tempo/actions/nonce.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNonce = getNonce;
exports.watchNonceIncremented = watchNonceIncremented;
const readContract_js_1 = require("../../actions/public/readContract.js");
const watchContractEvent_js_1 = require("../../actions/public/watchContractEvent.js");
const Abis = require("../Abis.js");
const Addresses = require("../Addresses.js");
const utils_js_1 = require("../internal/utils.js");
async function getNonce(client, parameters) {
const { account, nonceKey, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
...getNonce.call({ account, nonceKey }),
});
}
(function (getNonce) {
function call(args) {
const { account, nonceKey } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.nonceManager,
abi: Abis.nonce,
args: [account, nonceKey],
functionName: 'getNonce',
});
}
getNonce.call = call;
})(getNonce || (exports.getNonce = getNonce = {}));
function watchNonceIncremented(client, parameters) {
const { onNonceIncremented, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.nonceManager,
abi: Abis.nonce,
eventName: 'NonceIncremented',
onLogs: (logs) => {
for (const log of logs)
onNonceIncremented(log.args, log);
},
strict: true,
});
}
//# sourceMappingURL=nonce.js.map

1
node_modules/viem/_cjs/tempo/actions/nonce.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"nonce.js","sourceRoot":"","sources":["../../../tempo/actions/nonce.ts"],"names":[],"mappings":";;AAyCA,4BAYC;AA2DD,sDAkBC;AA/HD,0EAAmE;AAEnE,sFAA+E;AAO/E,mCAAkC;AAClC,6CAA4C;AAE5C,mDAAiD;AA0B1C,KAAK,UAAU,QAAQ,CAI5B,MAAyC,EACzC,UAA+B;IAE/B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAA;IACjD,OAAO,IAAA,8BAAY,EAAC,MAAM,EAAE;QAC1B,GAAG,IAAI;QACP,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;KACxC,CAAC,CAAA;AACJ,CAAC;AAED,WAAiB,QAAQ;IA8CvB,SAAgB,IAAI,CAAC,IAAU;QAC7B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QAClC,OAAO,IAAA,qBAAU,EAAC;YAChB,OAAO,EAAE,SAAS,CAAC,YAAY;YAC/B,GAAG,EAAE,IAAI,CAAC,KAAK;YACf,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;YACzB,YAAY,EAAE,UAAU;SACzB,CAAC,CAAA;IACJ,CAAC;IARe,aAAI,OAQnB,CAAA;AACH,CAAC,EAvDgB,QAAQ,wBAAR,QAAQ,QAuDxB;AAED,SAAgB,qBAAqB,CAInC,MAAyC,EACzC,UAA4C;IAE5C,MAAM,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAA;IAClD,OAAO,IAAA,0CAAkB,EAAC,MAAM,EAAE;QAChC,GAAG,IAAI;QACP,OAAO,EAAE,SAAS,CAAC,YAAY;QAC/B,GAAG,EAAE,IAAI,CAAC,KAAK;QACf,SAAS,EAAE,kBAAkB;QAC7B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YACf,KAAK,MAAM,GAAG,IAAI,IAAI;gBAAE,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QAC3D,CAAC;QACD,MAAM,EAAE,IAAI;KACb,CAAC,CAAA;AACJ,CAAC"}

346
node_modules/viem/_cjs/tempo/actions/policy.js generated vendored Normal file
View File

@@ -0,0 +1,346 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.create = create;
exports.createSync = createSync;
exports.setAdmin = setAdmin;
exports.setAdminSync = setAdminSync;
exports.modifyWhitelist = modifyWhitelist;
exports.modifyWhitelistSync = modifyWhitelistSync;
exports.modifyBlacklist = modifyBlacklist;
exports.modifyBlacklistSync = modifyBlacklistSync;
exports.getData = getData;
exports.isAuthorized = isAuthorized;
exports.watchCreate = watchCreate;
exports.watchAdminUpdated = watchAdminUpdated;
exports.watchWhitelistUpdated = watchWhitelistUpdated;
exports.watchBlacklistUpdated = watchBlacklistUpdated;
const parseAccount_js_1 = require("../../accounts/utils/parseAccount.js");
const readContract_js_1 = require("../../actions/public/readContract.js");
const watchContractEvent_js_1 = require("../../actions/public/watchContractEvent.js");
const writeContract_js_1 = require("../../actions/wallet/writeContract.js");
const writeContractSync_js_1 = require("../../actions/wallet/writeContractSync.js");
const parseEventLogs_js_1 = require("../../utils/abi/parseEventLogs.js");
const Abis = require("../Abis.js");
const Addresses = require("../Addresses.js");
const utils_js_1 = require("../internal/utils.js");
const policyTypeMap = {
whitelist: 0,
blacklist: 1,
};
async function create(client, parameters) {
return create.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (create) {
async function inner(action, client, parameters) {
const { account = client.account, addresses, chain = client.chain, type, ...rest } = parameters;
if (!account)
throw new Error('`account` is required');
const admin = (0, parseAccount_js_1.parseAccount)(account).address;
const call = create.call({ admin, type, addresses });
return action(client, {
...rest,
account,
chain,
...call,
});
}
create.inner = inner;
function call(args) {
const { admin, type, addresses } = args;
const config = (() => {
if (addresses)
return {
functionName: 'createPolicyWithAccounts',
args: [admin, policyTypeMap[type], addresses],
};
return {
functionName: 'createPolicy',
args: [admin, policyTypeMap[type]],
};
})();
return (0, utils_js_1.defineCall)({
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
...config,
});
}
create.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.tip403Registry,
logs,
eventName: 'PolicyCreated',
strict: true,
});
if (!log)
throw new Error('`PolicyCreated` event not found.');
return log;
}
create.extractEvent = extractEvent;
})(create || (exports.create = create = {}));
async function createSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await create.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = create.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function setAdmin(client, parameters) {
return setAdmin.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (setAdmin) {
async function inner(action, client, parameters) {
const { policyId, admin, ...rest } = parameters;
const call = setAdmin.call({ policyId, admin });
return (await action(client, {
...rest,
...call,
}));
}
setAdmin.inner = inner;
function call(args) {
const { policyId, admin } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
functionName: 'setPolicyAdmin',
args: [policyId, admin],
});
}
setAdmin.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.tip403Registry,
logs,
eventName: 'PolicyAdminUpdated',
strict: true,
});
if (!log)
throw new Error('`PolicyAdminUpdated` event not found.');
return log;
}
setAdmin.extractEvent = extractEvent;
})(setAdmin || (exports.setAdmin = setAdmin = {}));
async function setAdminSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await setAdmin.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = setAdmin.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function modifyWhitelist(client, parameters) {
return modifyWhitelist.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (modifyWhitelist) {
async function inner(action, client, parameters) {
const { address: targetAccount, allowed, policyId, ...rest } = parameters;
const call = modifyWhitelist.call({
address: targetAccount,
allowed,
policyId,
});
return (await action(client, {
...rest,
...call,
}));
}
modifyWhitelist.inner = inner;
function call(args) {
const { policyId, address, allowed } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
functionName: 'modifyPolicyWhitelist',
args: [policyId, address, allowed],
});
}
modifyWhitelist.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.tip403Registry,
logs,
eventName: 'WhitelistUpdated',
strict: true,
});
if (!log)
throw new Error('`WhitelistUpdated` event not found.');
return log;
}
modifyWhitelist.extractEvent = extractEvent;
})(modifyWhitelist || (exports.modifyWhitelist = modifyWhitelist = {}));
async function modifyWhitelistSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await modifyWhitelist.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = modifyWhitelist.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function modifyBlacklist(client, parameters) {
return modifyBlacklist.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (modifyBlacklist) {
async function inner(action, client, parameters) {
const { address: targetAccount, policyId, restricted, ...rest } = parameters;
const call = modifyBlacklist.call({
address: targetAccount,
policyId,
restricted,
});
return (await action(client, {
...rest,
...call,
}));
}
modifyBlacklist.inner = inner;
function call(args) {
const { policyId, address, restricted } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
functionName: 'modifyPolicyBlacklist',
args: [policyId, address, restricted],
});
}
modifyBlacklist.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.tip403Registry,
logs,
eventName: 'BlacklistUpdated',
strict: true,
});
if (!log)
throw new Error('`BlacklistUpdated` event not found.');
return log;
}
modifyBlacklist.extractEvent = extractEvent;
})(modifyBlacklist || (exports.modifyBlacklist = modifyBlacklist = {}));
async function modifyBlacklistSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await modifyBlacklist.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = modifyBlacklist.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
async function getData(client, parameters) {
const { policyId, ...rest } = parameters;
const result = await (0, readContract_js_1.readContract)(client, {
...rest,
...getData.call({ policyId }),
});
return {
admin: result[1],
type: result[0] === 0 ? 'whitelist' : 'blacklist',
};
}
(function (getData) {
function call(args) {
const { policyId } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
args: [policyId],
functionName: 'policyData',
});
}
getData.call = call;
})(getData || (exports.getData = getData = {}));
async function isAuthorized(client, parameters) {
const { policyId, user, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
...isAuthorized.call({ policyId, user }),
});
}
(function (isAuthorized) {
function call(args) {
const { policyId, user } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
args: [policyId, user],
functionName: 'isAuthorized',
});
}
isAuthorized.call = call;
})(isAuthorized || (exports.isAuthorized = isAuthorized = {}));
function watchCreate(client, parameters) {
const { onPolicyCreated, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
eventName: 'PolicyCreated',
onLogs: (logs) => {
for (const log of logs)
onPolicyCreated({
...log.args,
type: log.args.policyType === 0 ? 'whitelist' : 'blacklist',
}, log);
},
strict: true,
});
}
function watchAdminUpdated(client, parameters) {
const { onAdminUpdated, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
eventName: 'PolicyAdminUpdated',
onLogs: (logs) => {
for (const log of logs)
onAdminUpdated(log.args, log);
},
strict: true,
});
}
function watchWhitelistUpdated(client, parameters) {
const { onWhitelistUpdated, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
eventName: 'WhitelistUpdated',
onLogs: (logs) => {
for (const log of logs)
onWhitelistUpdated(log.args, log);
},
strict: true,
});
}
function watchBlacklistUpdated(client, parameters) {
const { onBlacklistUpdated, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: Addresses.tip403Registry,
abi: Abis.tip403Registry,
eventName: 'BlacklistUpdated',
onLogs: (logs) => {
for (const log of logs)
onBlacklistUpdated(log.args, log);
},
strict: true,
});
}
//# sourceMappingURL=policy.js.map

1
node_modules/viem/_cjs/tempo/actions/policy.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

233
node_modules/viem/_cjs/tempo/actions/reward.js generated vendored Normal file
View File

@@ -0,0 +1,233 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.claim = claim;
exports.claimSync = claimSync;
exports.distribute = distribute;
exports.distributeSync = distributeSync;
exports.getGlobalRewardPerToken = getGlobalRewardPerToken;
exports.getPendingRewards = getPendingRewards;
exports.getUserRewardInfo = getUserRewardInfo;
exports.setRecipient = setRecipient;
exports.setRecipientSync = setRecipientSync;
exports.watchRewardDistributed = watchRewardDistributed;
exports.watchRewardRecipientSet = watchRewardRecipientSet;
const readContract_js_1 = require("../../actions/public/readContract.js");
const watchContractEvent_js_1 = require("../../actions/public/watchContractEvent.js");
const writeContract_js_1 = require("../../actions/wallet/writeContract.js");
const writeContractSync_js_1 = require("../../actions/wallet/writeContractSync.js");
const parseEventLogs_js_1 = require("../../utils/abi/parseEventLogs.js");
const Abis = require("../Abis.js");
const utils_js_1 = require("../internal/utils.js");
async function claim(client, parameters) {
return claim.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (claim) {
async function inner(action, client, parameters) {
const { token, ...rest } = parameters;
const call = claim.call({ token });
return (await action(client, {
...rest,
...call,
}));
}
claim.inner = inner;
function call(args) {
const { token } = args;
return (0, utils_js_1.defineCall)({
address: token,
abi: Abis.tip20,
args: [],
functionName: 'claimRewards',
});
}
claim.call = call;
})(claim || (exports.claim = claim = {}));
async function claimSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await claim.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
return {
receipt,
};
}
async function distribute(client, parameters) {
return distribute.inner(writeContract_js_1.writeContract, client, parameters);
}
async function distributeSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await distribute.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = distribute.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
(function (distribute) {
async function inner(action, client, parameters) {
const { amount, token, ...rest } = parameters;
const call = distribute.call({ amount, token });
return (await action(client, {
...rest,
...call,
}));
}
distribute.inner = inner;
function call(args) {
const { amount, token } = args;
return (0, utils_js_1.defineCall)({
address: token,
abi: Abis.tip20,
args: [amount],
functionName: 'distributeReward',
});
}
distribute.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.tip20,
logs,
eventName: 'RewardDistributed',
strict: true,
});
if (!log)
throw new Error('`RewardDistributed` event not found.');
return log;
}
distribute.extractEvent = extractEvent;
})(distribute || (exports.distribute = distribute = {}));
async function getGlobalRewardPerToken(client, parameters) {
return (0, readContract_js_1.readContract)(client, {
...parameters,
...getGlobalRewardPerToken.call(parameters),
});
}
(function (getGlobalRewardPerToken) {
function call(args) {
const { token } = args;
return (0, utils_js_1.defineCall)({
address: token,
abi: Abis.tip20,
args: [],
functionName: 'globalRewardPerToken',
});
}
getGlobalRewardPerToken.call = call;
})(getGlobalRewardPerToken || (exports.getGlobalRewardPerToken = getGlobalRewardPerToken = {}));
async function getPendingRewards(client, parameters) {
return (0, readContract_js_1.readContract)(client, {
...parameters,
...getPendingRewards.call(parameters),
});
}
(function (getPendingRewards) {
function call(args) {
const { account, token } = args;
return (0, utils_js_1.defineCall)({
address: token,
abi: Abis.tip20,
args: [account],
functionName: 'getPendingRewards',
});
}
getPendingRewards.call = call;
})(getPendingRewards || (exports.getPendingRewards = getPendingRewards = {}));
async function getUserRewardInfo(client, parameters) {
return (0, readContract_js_1.readContract)(client, {
...parameters,
...getUserRewardInfo.call(parameters),
});
}
(function (getUserRewardInfo) {
function call(args) {
const { account, token } = args;
return (0, utils_js_1.defineCall)({
address: token,
abi: Abis.tip20,
args: [account],
functionName: 'userRewardInfo',
});
}
getUserRewardInfo.call = call;
})(getUserRewardInfo || (exports.getUserRewardInfo = getUserRewardInfo = {}));
async function setRecipient(client, parameters) {
return setRecipient.inner(writeContract_js_1.writeContract, client, parameters);
}
async function setRecipientSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await setRecipient.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = setRecipient.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
(function (setRecipient) {
async function inner(action, client, parameters) {
const { recipient, token, ...rest } = parameters;
const call = setRecipient.call({ recipient, token });
return (await action(client, {
...rest,
...call,
}));
}
setRecipient.inner = inner;
function call(args) {
const { recipient, token } = args;
return (0, utils_js_1.defineCall)({
address: token,
abi: Abis.tip20,
args: [recipient],
functionName: 'setRewardRecipient',
});
}
setRecipient.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.tip20,
logs,
eventName: 'RewardRecipientSet',
strict: true,
});
if (!log)
throw new Error('`RewardRecipientSet` event not found.');
return log;
}
setRecipient.extractEvent = extractEvent;
})(setRecipient || (exports.setRecipient = setRecipient = {}));
function watchRewardDistributed(client, parameters) {
const { onRewardDistributed, token, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: token,
abi: Abis.tip20,
eventName: 'RewardDistributed',
onLogs: (logs) => {
for (const log of logs)
onRewardDistributed(log.args, log);
},
strict: true,
});
}
function watchRewardRecipientSet(client, parameters) {
const { onRewardRecipientSet, token, ...rest } = parameters;
return (0, watchContractEvent_js_1.watchContractEvent)(client, {
...rest,
address: token,
abi: Abis.tip20,
eventName: 'RewardRecipientSet',
onLogs: (logs) => {
for (const log of logs)
onRewardRecipientSet(log.args, log);
},
strict: true,
});
}
//# sourceMappingURL=reward.js.map

1
node_modules/viem/_cjs/tempo/actions/reward.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

157
node_modules/viem/_cjs/tempo/actions/simulate.js generated vendored Normal file
View File

@@ -0,0 +1,157 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.simulateBlocks = simulateBlocks;
exports.simulateCalls = simulateCalls;
const BlockOverrides = require("ox/BlockOverrides");
const parseAccount_js_1 = require("../../accounts/utils/parseAccount.js");
const abi_js_1 = require("../../errors/abi.js");
const contract_js_1 = require("../../errors/contract.js");
const node_js_1 = require("../../errors/node.js");
const decodeFunctionResult_js_1 = require("../../utils/abi/decodeFunctionResult.js");
const encodeFunctionData_js_1 = require("../../utils/abi/encodeFunctionData.js");
const concat_js_1 = require("../../utils/data/concat.js");
const toHex_js_1 = require("../../utils/encoding/toHex.js");
const getContractError_js_1 = require("../../utils/errors/getContractError.js");
const getNodeError_js_1 = require("../../utils/errors/getNodeError.js");
const block_js_1 = require("../../utils/formatters/block.js");
const log_js_1 = require("../../utils/formatters/log.js");
const transactionRequest_js_1 = require("../../utils/formatters/transactionRequest.js");
const stateOverride_js_1 = require("../../utils/stateOverride.js");
const assertRequest_js_1 = require("../../utils/transaction/assertRequest.js");
async function simulateBlocks(client, parameters) {
const { blockNumber, blockTag = client.experimental_blockTag ?? 'latest', blocks, returnFullTransactions, traceTransfers, validation, } = parameters;
try {
const blockStateCalls = [];
for (const block of blocks) {
const blockOverrides = block.blockOverrides
? BlockOverrides.toRpc(block.blockOverrides)
: undefined;
const calls = block.calls.map((call_) => {
const call = call_;
const account = call.account
? (0, parseAccount_js_1.parseAccount)(call.account)
: client.account
? (0, parseAccount_js_1.parseAccount)(client.account)
: undefined;
const data = call.abi ? (0, encodeFunctionData_js_1.encodeFunctionData)(call) : call.data;
const request = {
...call,
account,
data: call.dataSuffix
? (0, concat_js_1.concat)([data || '0x', call.dataSuffix])
: data,
from: call.from ?? account?.address,
};
(0, assertRequest_js_1.assertRequest)(request);
return (0, transactionRequest_js_1.formatTransactionRequest)(request);
});
const stateOverrides = block.stateOverrides
? (0, stateOverride_js_1.serializeStateOverride)(block.stateOverrides)
: undefined;
blockStateCalls.push({
blockOverrides,
calls,
stateOverrides,
});
}
const blockNumberHex = typeof blockNumber === 'bigint' ? (0, toHex_js_1.numberToHex)(blockNumber) : undefined;
const block = blockNumberHex || blockTag;
const result = await client.request({
method: 'tempo_simulateV1',
params: [
{
blockStateCalls,
returnFullTransactions,
traceTransfers,
validation,
},
block,
],
});
return {
blocks: result.blocks.map((block, i) => ({
...(0, block_js_1.formatBlock)(block),
calls: block.calls?.map((call, j) => {
const { abi, args, functionName, to } = blocks[i].calls[j];
const data = call.error?.data ?? call.returnData;
const gasUsed = BigInt(call.gasUsed);
const logs = call.logs?.map((log) => (0, log_js_1.formatLog)(log));
const status = call.status === '0x1' ? 'success' : 'failure';
const result = abi && status === 'success' && data !== '0x'
? (0, decodeFunctionResult_js_1.decodeFunctionResult)({
abi,
data,
functionName,
})
: null;
const error = (() => {
if (status === 'success')
return undefined;
let error;
if (data === '0x')
error = new abi_js_1.AbiDecodingZeroDataError();
else if (data)
error = new contract_js_1.RawContractError({ data });
if (!error)
return undefined;
return (0, getContractError_js_1.getContractError)(error, {
abi: (abi ?? []),
address: to ?? '0x',
args,
functionName: functionName ?? '<unknown>',
});
})();
return {
data,
gasUsed,
logs,
status,
...(status === 'success'
? {
result,
}
: {
error,
}),
};
}),
})),
tokenMetadata: result.tokenMetadata ?? {},
};
}
catch (e) {
const cause = e;
const error = (0, getNodeError_js_1.getNodeError)(cause, {});
if (error instanceof node_js_1.UnknownNodeError)
throw cause;
throw error;
}
}
async function simulateCalls(client, parameters) {
const { blockNumber, blockTag, calls, stateOverrides, traceTransfers, validation, } = parameters;
const account = parameters.account
? (0, parseAccount_js_1.parseAccount)(parameters.account)
: undefined;
const result = await simulateBlocks(client, {
blockNumber,
blockTag: blockTag,
blocks: [
{
calls: calls.map((call) => ({
...call,
from: account?.address,
})),
stateOverrides,
},
],
traceTransfers,
validation,
});
const { calls: block_calls, ...block } = result.blocks[0];
return {
block,
results: block_calls,
tokenMetadata: result.tokenMetadata,
};
}
//# sourceMappingURL=simulate.js.map

1
node_modules/viem/_cjs/tempo/actions/simulate.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"simulate.js","sourceRoot":"","sources":["../../../tempo/actions/simulate.ts"],"names":[],"mappings":";;AAsHA,wCAoIC;AAmHD,sCA4CC;AAxZD,oDAAmD;AAInD,0EAG6C;AAG7C,gDAA8D;AAE9D,0DAA2D;AAC3D,kDAAuD;AAYvD,qFAGgD;AAChD,iFAG8C;AAC9C,0DAAmD;AACnD,4DAGsC;AACtC,gFAAyE;AACzE,wEAG2C;AAC3C,8DAGwC;AACxC,0DAAyD;AACzD,wFAGqD;AACrD,mEAGqC;AACrC,+EAGiD;AA0D1C,KAAK,UAAU,cAAc,CAIlC,MAAgC,EAChC,UAA4C;IAE5C,MAAM,EACJ,WAAW,EACX,QAAQ,GAAG,MAAM,CAAC,qBAAqB,IAAI,QAAQ,EACnD,MAAM,EACN,sBAAsB,EACtB,cAAc,EACd,UAAU,GACX,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,EAAE,CA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EAAE,EAAE,CAAC,CAAA;QACrC,IAAI,KAAK,YAAY,0BAAgB;YAAE,MAAM,KAAK,CAAA;QAClD,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC;AAmHM,KAAK,UAAU,aAAa,CAKjC,MAAgC,EAChC,UAAoD;IAEpD,MAAM,EACJ,WAAW,EACX,QAAQ,EACR,KAAK,EACL,cAAc,EACd,cAAc,EACd,UAAU,GACX,GAAG,UAAU,CAAA;IAEd,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO;QAChC,CAAC,CAAC,IAAA,8BAAY,EAAC,UAAU,CAAC,OAAO,CAAC;QAClC,CAAC,CAAC,SAAS,CAAA;IAEb,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE;QAC1C,WAAW;QACX,QAAQ,EAAE,QAAqB;QAC/B,MAAM,EAAE;YACN;gBACE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBAC1B,GAAI,IAAa;oBACjB,IAAI,EAAE,OAAO,EAAE,OAAO;iBACvB,CAAC,CAAQ;gBACV,cAAc;aACf;SACF;QACD,cAAc;QACd,UAAU;KACX,CAAC,CAAA;IAEF,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IAEzD,OAAO;QACL,KAAK;QACL,OAAO,EAAE,WAAW;QACpB,aAAa,EAAE,MAAM,CAAC,aAAa;KACU,CAAA;AACjD,CAAC"}

1186
node_modules/viem/_cjs/tempo/actions/token.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/viem/_cjs/tempo/actions/token.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

308
node_modules/viem/_cjs/tempo/actions/validator.js generated vendored Normal file
View File

@@ -0,0 +1,308 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.add = add;
exports.addSync = addSync;
exports.changeOwner = changeOwner;
exports.changeOwnerSync = changeOwnerSync;
exports.changeStatus = changeStatus;
exports.changeStatusSync = changeStatusSync;
exports.getNextFullDkgCeremony = getNextFullDkgCeremony;
exports.getOwner = getOwner;
exports.get = get;
exports.getByIndex = getByIndex;
exports.getCount = getCount;
exports.list = list;
exports.setNextFullDkgCeremony = setNextFullDkgCeremony;
exports.setNextFullDkgCeremonySync = setNextFullDkgCeremonySync;
exports.update = update;
exports.updateSync = updateSync;
const readContract_js_1 = require("../../actions/public/readContract.js");
const writeContract_js_1 = require("../../actions/wallet/writeContract.js");
const writeContractSync_js_1 = require("../../actions/wallet/writeContractSync.js");
const Abis = require("../Abis.js");
const Addresses = require("../Addresses.js");
const utils_js_1 = require("../internal/utils.js");
async function add(client, parameters) {
return add.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (add) {
async function inner(action, client, parameters) {
const { newValidatorAddress, publicKey, active, inboundAddress, outboundAddress, ...rest } = parameters;
const callData = add.call({
newValidatorAddress,
publicKey,
active,
inboundAddress,
outboundAddress,
});
return (await action(client, {
...rest,
...callData,
}));
}
add.inner = inner;
function call(args) {
const { newValidatorAddress, publicKey, active, inboundAddress, outboundAddress, } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [
newValidatorAddress,
publicKey,
active,
inboundAddress,
outboundAddress,
],
functionName: 'addValidator',
});
}
add.call = call;
})(add || (exports.add = add = {}));
async function addSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await add.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
return { receipt };
}
async function changeOwner(client, parameters) {
return changeOwner.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (changeOwner) {
async function inner(action, client, parameters) {
const { newOwner, ...rest } = parameters;
const callData = changeOwner.call({ newOwner });
return (await action(client, {
...rest,
...callData,
}));
}
changeOwner.inner = inner;
function call(args) {
const { newOwner } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [newOwner],
functionName: 'changeOwner',
});
}
changeOwner.call = call;
})(changeOwner || (exports.changeOwner = changeOwner = {}));
async function changeOwnerSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await changeOwner.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
return { receipt };
}
async function changeStatus(client, parameters) {
return changeStatus.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (changeStatus) {
async function inner(action, client, parameters) {
const { validator, active, ...rest } = parameters;
const callData = changeStatus.call({ validator, active });
return (await action(client, {
...rest,
...callData,
}));
}
changeStatus.inner = inner;
function call(args) {
const { validator, active } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [validator, active],
functionName: 'changeValidatorStatus',
});
}
changeStatus.call = call;
})(changeStatus || (exports.changeStatus = changeStatus = {}));
async function changeStatusSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await changeStatus.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
return { receipt };
}
async function getNextFullDkgCeremony(client, parameters = {}) {
return (0, readContract_js_1.readContract)(client, {
...parameters,
...getNextFullDkgCeremony.call(),
});
}
(function (getNextFullDkgCeremony) {
function call() {
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [],
functionName: 'getNextFullDkgCeremony',
});
}
getNextFullDkgCeremony.call = call;
})(getNextFullDkgCeremony || (exports.getNextFullDkgCeremony = getNextFullDkgCeremony = {}));
async function getOwner(client, parameters = {}) {
return (0, readContract_js_1.readContract)(client, {
...parameters,
...getOwner.call(),
});
}
(function (getOwner) {
function call() {
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [],
functionName: 'owner',
});
}
getOwner.call = call;
})(getOwner || (exports.getOwner = getOwner = {}));
async function get(client, parameters) {
const { validator, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
...get.call({ validator }),
});
}
(function (get) {
function call(args) {
const { validator } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [validator],
functionName: 'validators',
});
}
get.call = call;
})(get || (exports.get = get = {}));
async function getByIndex(client, parameters) {
const { index, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
...getByIndex.call({ index }),
});
}
(function (getByIndex) {
function call(args) {
const { index } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [index],
functionName: 'validatorsArray',
});
}
getByIndex.call = call;
})(getByIndex || (exports.getByIndex = getByIndex = {}));
async function getCount(client, parameters = {}) {
return (0, readContract_js_1.readContract)(client, {
...parameters,
...getCount.call(),
});
}
(function (getCount) {
function call() {
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [],
functionName: 'validatorCount',
});
}
getCount.call = call;
})(getCount || (exports.getCount = getCount = {}));
async function list(client, parameters = {}) {
return (0, readContract_js_1.readContract)(client, {
...parameters,
...list.call(),
});
}
(function (list) {
function call() {
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [],
functionName: 'getValidators',
});
}
list.call = call;
})(list || (exports.list = list = {}));
async function setNextFullDkgCeremony(client, parameters) {
return setNextFullDkgCeremony.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (setNextFullDkgCeremony) {
async function inner(action, client, parameters) {
const { epoch, ...rest } = parameters;
const callData = setNextFullDkgCeremony.call({ epoch });
return (await action(client, {
...rest,
...callData,
}));
}
setNextFullDkgCeremony.inner = inner;
function call(args) {
const { epoch } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [epoch],
functionName: 'setNextFullDkgCeremony',
});
}
setNextFullDkgCeremony.call = call;
})(setNextFullDkgCeremony || (exports.setNextFullDkgCeremony = setNextFullDkgCeremony = {}));
async function setNextFullDkgCeremonySync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await setNextFullDkgCeremony.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
return { receipt };
}
async function update(client, parameters) {
return update.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (update) {
async function inner(action, client, parameters) {
const { newValidatorAddress, publicKey, inboundAddress, outboundAddress, ...rest } = parameters;
const callData = update.call({
newValidatorAddress,
publicKey,
inboundAddress,
outboundAddress,
});
return (await action(client, {
...rest,
...callData,
}));
}
update.inner = inner;
function call(args) {
const { newValidatorAddress, publicKey, inboundAddress, outboundAddress } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.validator,
abi: Abis.validatorConfig,
args: [newValidatorAddress, publicKey, inboundAddress, outboundAddress],
functionName: 'updateValidator',
});
}
update.call = call;
})(update || (exports.update = update = {}));
async function updateSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await update.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
return { receipt };
}
//# sourceMappingURL=validator.js.map

File diff suppressed because one or more lines are too long

95
node_modules/viem/_cjs/tempo/actions/virtualAddress.js generated vendored Normal file
View File

@@ -0,0 +1,95 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMasterAddress = getMasterAddress;
exports.resolve = resolve;
exports.registerMaster = registerMaster;
exports.registerMasterSync = registerMasterSync;
const Hex = require("ox/Hex");
const readContract_js_1 = require("../../actions/public/readContract.js");
const writeContract_js_1 = require("../../actions/wallet/writeContract.js");
const writeContractSync_js_1 = require("../../actions/wallet/writeContractSync.js");
const address_js_1 = require("../../constants/address.js");
const parseEventLogs_js_1 = require("../../utils/abi/parseEventLogs.js");
const Abis = require("../Abis.js");
const Addresses = require("../Addresses.js");
const utils_js_1 = require("../internal/utils.js");
async function getMasterAddress(client, parameters) {
const address = await (0, readContract_js_1.readContract)(client, {
...parameters,
...getMasterAddress.call({ masterId: parameters.masterId }),
});
if (address === address_js_1.zeroAddress)
return null;
return address;
}
(function (getMasterAddress) {
function call(args) {
const { masterId } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.addressRegistry,
abi: Abis.addressRegistry,
args: [masterId],
functionName: 'getMaster',
});
}
getMasterAddress.call = call;
})(getMasterAddress || (exports.getMasterAddress = getMasterAddress = {}));
async function resolve(client, parameters) {
if (!isVirtual(parameters.address))
return parameters.address;
const masterId = Hex.slice(parameters.address, 0, 4);
return getMasterAddress(client, { ...parameters, masterId });
}
async function registerMaster(client, parameters) {
return registerMaster.inner(writeContract_js_1.writeContract, client, parameters);
}
(function (registerMaster) {
async function inner(action, client, parameters) {
const { salt, ...rest } = parameters;
const call = registerMaster.call({ salt });
return (await action(client, {
...rest,
...call,
}));
}
registerMaster.inner = inner;
function call(args) {
const { salt } = args;
return (0, utils_js_1.defineCall)({
address: Addresses.addressRegistry,
abi: Abis.addressRegistry,
functionName: 'registerVirtualMaster',
args: [salt],
});
}
registerMaster.call = call;
function extractEvent(logs) {
const [log] = (0, parseEventLogs_js_1.parseEventLogs)({
abi: Abis.addressRegistry,
logs,
eventName: 'MasterRegistered',
strict: true,
});
if (!log)
throw new Error('`MasterRegistered` event not found.');
return log;
}
registerMaster.extractEvent = extractEvent;
})(registerMaster || (exports.registerMaster = registerMaster = {}));
async function registerMasterSync(client, parameters) {
const { throwOnReceiptRevert = true, ...rest } = parameters;
const receipt = await registerMaster.inner(writeContractSync_js_1.writeContractSync, client, {
...rest,
throwOnReceiptRevert,
});
const { args } = registerMaster.extractEvent(receipt.logs);
return {
...args,
receipt,
};
}
const virtualMagic = '0xfdfdfdfdfdfdfdfdfdfd';
function isVirtual(address) {
return Hex.slice(address, 4, 14).toLowerCase() === virtualMagic;
}
//# sourceMappingURL=virtualAddress.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"virtualAddress.js","sourceRoot":"","sources":["../../../tempo/actions/virtualAddress.ts"],"names":[],"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,QAqF9B;AA2BM,KAAK,UAAU,kBAAkB,CAItC,MAAyC,EACzC,UAAyD;IAEzD,MAAM,EAAE,oBAAoB,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAA;IAC3D,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,wCAAiB,EAAE,MAAM,EAAE;QACpE,GAAG,IAAI;QACP,oBAAoB;KACZ,CAAC,CAAA;IACX,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1D,OAAO;QACL,GAAG,IAAI;QACP,OAAO;KACC,CAAA;AACZ,CAAC;AAwBD,MAAM,YAAY,GAAG,wBAAwB,CAAA;AAG7C,SAAS,SAAS,CAAC,OAAe;IAChC,OAAO,GAAG,CAAC,KAAK,CAAC,OAAkB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,YAAY,CAAA;AAC5E,CAAC"}

432
node_modules/viem/_cjs/tempo/actions/zone.js generated vendored Normal file
View File

@@ -0,0 +1,432 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deposit = deposit;
exports.depositSync = depositSync;
exports.encryptedDeposit = encryptedDeposit;
exports.encryptedDepositSync = encryptedDepositSync;
exports.getAuthorizationTokenInfo = getAuthorizationTokenInfo;
exports.getDepositStatus = getDepositStatus;
exports.getWithdrawalFee = getWithdrawalFee;
exports.getZoneInfo = getZoneInfo;
exports.requestWithdrawal = requestWithdrawal;
exports.requestWithdrawalSync = requestWithdrawalSync;
exports.requestVerifiableWithdrawal = requestVerifiableWithdrawal;
exports.requestVerifiableWithdrawalSync = requestVerifiableWithdrawalSync;
exports.signAuthorizationToken = signAuthorizationToken;
const Bytes = require("ox/Bytes");
const Hex = require("ox/Hex");
const PublicKey = require("ox/PublicKey");
const Secp256k1 = require("ox/Secp256k1");
const tempo_1 = require("ox/tempo");
const parseAccount_js_1 = require("../../accounts/utils/parseAccount.js");
const readContract_js_1 = require("../../actions/public/readContract.js");
const sendTransaction_js_1 = require("../../actions/wallet/sendTransaction.js");
const sendTransactionSync_js_1 = require("../../actions/wallet/sendTransactionSync.js");
const bytes_js_1 = require("../../constants/bytes.js");
const encodeAbiParameters_js_1 = require("../../utils/abi/encodeAbiParameters.js");
const Abis = require("../Abis.js");
const Addresses = require("../Addresses.js");
const utils_js_1 = require("../internal/utils.js");
const Storage = require("../Storage.js");
const ZoneAbis = require("../zones/Abis.js");
const zone_js_1 = require("../zones/zone.js");
async function deposit(client, parameters) {
const chainId = client.chain?.id;
if (!chainId)
throw new Error('`chain` is required.');
const { account = client.account, ...rest } = parameters;
const account_ = account ? (0, parseAccount_js_1.parseAccount)(account) : undefined;
if (!account)
throw new Error('`account` is required.');
const recipient = parameters.recipient ?? account_?.address;
if (!recipient)
throw new Error('`recipient` is required.');
const args = { ...parameters, chainId, recipient };
return (0, sendTransaction_js_1.sendTransaction)(client, {
...rest,
calls: deposit.calls(args),
});
}
(function (deposit) {
function calls(args) {
const { amount, chainId, memo = bytes_js_1.zeroHash, recipient, token, zoneId } = args;
const portalAddress = (0, zone_js_1.getPortalAddress)(chainId, zoneId);
return [
(0, utils_js_1.defineCall)({
address: tempo_1.TokenId.toAddress(token),
abi: Abis.tip20,
functionName: 'approve',
args: [portalAddress, amount],
}),
(0, utils_js_1.defineCall)({
address: portalAddress,
abi: ZoneAbis.zonePortal,
functionName: 'deposit',
args: [tempo_1.TokenId.toAddress(token), recipient, amount, memo],
}),
];
}
deposit.calls = calls;
})(deposit || (exports.deposit = deposit = {}));
async function depositSync(client, parameters) {
const chainId = client.chain?.id;
if (!chainId)
throw new Error('`chain` is required.');
const { account = client.account, throwOnReceiptRevert = true, ...rest } = parameters;
const account_ = account ? (0, parseAccount_js_1.parseAccount)(account) : undefined;
if (!account)
throw new Error('`account` is required.');
const recipient = parameters.recipient ?? account_?.address;
if (!recipient)
throw new Error('`recipient` is required.');
const args = { ...parameters, chainId, recipient };
const receipt = await (0, sendTransactionSync_js_1.sendTransactionSync)(client, {
...rest,
throwOnReceiptRevert,
calls: deposit.calls(args),
});
return { receipt };
}
async function encryptedDeposit(client, parameters) {
const chainId = client.chain?.id;
if (!chainId)
throw new Error('`chain` is required.');
const { account = client.account, ...rest } = parameters;
const account_ = account ? (0, parseAccount_js_1.parseAccount)(account) : undefined;
if (!account)
throw new Error('`account` is required.');
const recipient = parameters.recipient ?? account_?.address;
if (!recipient)
throw new Error('`recipient` is required.');
const portalAddress = (0, zone_js_1.getPortalAddress)(chainId, parameters.zoneId);
const [publicKey, keyIndex] = await Promise.all([
(0, readContract_js_1.readContract)(client, {
address: portalAddress,
abi: ZoneAbis.zonePortal,
functionName: 'sequencerEncryptionKey',
}),
(0, readContract_js_1.readContract)(client, {
address: portalAddress,
abi: ZoneAbis.zonePortal,
functionName: 'encryptionKeyCount',
}),
]);
if (keyIndex === 0n) {
throw new Error('No sequencer encryption key configured.');
}
const encrypted = await encryptDepositPayload({ x: publicKey[0], yParity: publicKey[1] }, recipient, parameters.memo);
const args = {
...parameters,
chainId,
encrypted,
keyIndex: keyIndex - 1n,
recipient,
};
return (0, sendTransaction_js_1.sendTransaction)(client, {
...rest,
calls: encryptedDeposit.calls(args),
});
}
(function (encryptedDeposit) {
function calls(args) {
const { amount, chainId, encrypted, keyIndex, token, zoneId } = args;
const portalAddress = (0, zone_js_1.getPortalAddress)(chainId, zoneId);
return [
(0, utils_js_1.defineCall)({
address: tempo_1.TokenId.toAddress(token),
abi: Abis.tip20,
functionName: 'approve',
args: [portalAddress, amount],
}),
(0, utils_js_1.defineCall)({
address: portalAddress,
abi: ZoneAbis.zonePortal,
functionName: 'depositEncrypted',
args: [
tempo_1.TokenId.toAddress(token),
amount,
keyIndex,
{
ephemeralPubkeyX: encrypted.ephemeralPubkeyX,
ephemeralPubkeyYParity: encrypted.ephemeralPubkeyYParity,
ciphertext: encrypted.ciphertext,
nonce: encrypted.nonce,
tag: encrypted.tag,
},
],
}),
];
}
encryptedDeposit.calls = calls;
})(encryptedDeposit || (exports.encryptedDeposit = encryptedDeposit = {}));
async function encryptedDepositSync(client, parameters) {
const chainId = client.chain?.id;
if (!chainId)
throw new Error('`chain` is required.');
const { account = client.account, throwOnReceiptRevert = true, ...rest } = parameters;
const account_ = account ? (0, parseAccount_js_1.parseAccount)(account) : undefined;
if (!account)
throw new Error('`account` is required.');
const recipient = parameters.recipient ?? account_?.address;
if (!recipient)
throw new Error('`recipient` is required.');
const portalAddress = (0, zone_js_1.getPortalAddress)(chainId, parameters.zoneId);
const [publicKey, keyIndex] = await Promise.all([
(0, readContract_js_1.readContract)(client, {
address: portalAddress,
abi: ZoneAbis.zonePortal,
functionName: 'sequencerEncryptionKey',
}),
(0, readContract_js_1.readContract)(client, {
address: portalAddress,
abi: ZoneAbis.zonePortal,
functionName: 'encryptionKeyCount',
}),
]);
if (keyIndex === 0n) {
throw new Error('No sequencer encryption key configured.');
}
const encrypted = await encryptDepositPayload({ x: publicKey[0], yParity: publicKey[1] }, recipient, parameters.memo);
const args = {
...parameters,
chainId,
encrypted,
keyIndex: keyIndex - 1n,
recipient,
};
const receipt = await (0, sendTransactionSync_js_1.sendTransactionSync)(client, {
...rest,
throwOnReceiptRevert,
calls: encryptedDeposit.calls(args),
});
return { receipt };
}
async function getAuthorizationTokenInfo(client) {
const info = await client.request({
method: 'zone_getAuthorizationTokenInfo',
params: [],
});
return {
account: info.account,
expiresAt: Hex.toBigInt(info.expiresAt),
};
}
async function getDepositStatus(client, parameters) {
const { tempoBlockNumber } = parameters;
const status = await client.request({
method: 'zone_getDepositStatus',
params: [Hex.fromNumber(tempoBlockNumber)],
});
return {
deposits: status.deposits.map((deposit) => ({
amount: Hex.toBigInt(deposit.amount),
depositHash: deposit.depositHash,
kind: deposit.kind,
memo: deposit.memo,
recipient: deposit.recipient,
sender: deposit.sender,
status: deposit.status,
token: deposit.token,
})),
processed: status.processed,
tempoBlockNumber: Hex.toBigInt(status.tempoBlockNumber),
zoneProcessedThrough: Hex.toBigInt(status.zoneProcessedThrough),
};
}
async function getWithdrawalFee(client, parameters = {}) {
const { gas = 0n, ...rest } = parameters;
return (0, readContract_js_1.readContract)(client, {
...rest,
address: Addresses.zoneOutbox,
abi: ZoneAbis.zoneOutbox,
functionName: 'calculateWithdrawalFee',
args: [gas],
});
}
async function getZoneInfo(client) {
const info = await client.request({
method: 'zone_getZoneInfo',
params: [],
});
return {
chainId: Hex.toNumber(info.chainId),
sequencer: info.sequencer,
zoneId: Hex.toNumber(info.zoneId),
zoneTokens: info.zoneTokens,
};
}
async function requestWithdrawal(client, parameters) {
const { account = client.account, ...rest } = parameters;
const account_ = account ? (0, parseAccount_js_1.parseAccount)(account) : undefined;
if (!account)
throw new Error('`account` is required.');
const to = parameters.to ?? account_?.address;
if (!to)
throw new Error('`to` is required.');
const args = { ...parameters, to };
return (0, sendTransaction_js_1.sendTransaction)(client, {
...rest,
calls: requestWithdrawal.calls(args),
});
}
(function (requestWithdrawal) {
function calls(args) {
const { amount, data = '0x', fallbackRecipient = args.to, gas = 0n, memo = bytes_js_1.zeroHash, to, token, } = args;
return [
(0, utils_js_1.defineCall)({
address: tempo_1.TokenId.toAddress(token),
abi: Abis.tip20,
functionName: 'approve',
args: [Addresses.zoneOutbox, amount],
}),
(0, utils_js_1.defineCall)({
address: Addresses.zoneOutbox,
abi: ZoneAbis.zoneOutbox,
functionName: 'requestWithdrawal',
args: [
tempo_1.TokenId.toAddress(token),
to,
amount,
memo,
gas,
fallbackRecipient,
data,
'0x',
],
}),
];
}
requestWithdrawal.calls = calls;
})(requestWithdrawal || (exports.requestWithdrawal = requestWithdrawal = {}));
async function requestWithdrawalSync(client, parameters) {
const { account = client.account, throwOnReceiptRevert = true, ...rest } = parameters;
const account_ = account ? (0, parseAccount_js_1.parseAccount)(account) : undefined;
if (!account)
throw new Error('`account` is required.');
const to = parameters.to ?? account_?.address;
if (!to)
throw new Error('`to` is required.');
const args = { ...parameters, to };
const receipt = await (0, sendTransactionSync_js_1.sendTransactionSync)(client, {
...rest,
calls: requestWithdrawal.calls(args),
throwOnReceiptRevert,
});
return { receipt };
}
async function requestVerifiableWithdrawal(client, parameters) {
const { account = client.account, ...rest } = parameters;
const account_ = account ? (0, parseAccount_js_1.parseAccount)(account) : undefined;
if (!account)
throw new Error('`account` is required.');
const to = parameters.to ?? account_?.address;
if (!to)
throw new Error('`to` is required.');
const args = { ...parameters, to };
return (0, sendTransaction_js_1.sendTransaction)(client, {
...rest,
calls: requestVerifiableWithdrawal.calls(args),
});
}
(function (requestVerifiableWithdrawal) {
function calls(args) {
const { amount, data = '0x', fallbackRecipient = args.to, gas = 0n, memo = bytes_js_1.zeroHash, revealTo, to, token, } = args;
return [
(0, utils_js_1.defineCall)({
address: tempo_1.TokenId.toAddress(token),
abi: Abis.tip20,
functionName: 'approve',
args: [Addresses.zoneOutbox, amount],
}),
(0, utils_js_1.defineCall)({
address: Addresses.zoneOutbox,
abi: ZoneAbis.zoneOutbox,
functionName: 'requestWithdrawal',
args: [
tempo_1.TokenId.toAddress(token),
to,
amount,
memo,
gas,
fallbackRecipient,
data,
revealTo,
],
}),
];
}
requestVerifiableWithdrawal.calls = calls;
})(requestVerifiableWithdrawal || (exports.requestVerifiableWithdrawal = requestVerifiableWithdrawal = {}));
async function requestVerifiableWithdrawalSync(client, parameters) {
const { account = client.account, throwOnReceiptRevert = true, ...rest } = parameters;
const account_ = account ? (0, parseAccount_js_1.parseAccount)(account) : undefined;
if (!account)
throw new Error('`account` is required.');
const to = parameters.to ?? account_?.address;
if (!to)
throw new Error('`to` is required.');
const args = { ...parameters, to };
const receipt = await (0, sendTransactionSync_js_1.sendTransactionSync)(client, {
...rest,
calls: requestVerifiableWithdrawal.calls(args),
throwOnReceiptRevert,
});
return { receipt };
}
async function signAuthorizationToken(client, parameters = {}) {
const { account = client.account, issuedAt = Math.floor(Date.now() / 1000), expiresAt = issuedAt + 86_400, storage = Storage.defaultStorage(), } = parameters;
const chain = parameters.chain ?? client.chain;
if (!chain)
throw new Error('`signAuthorizationToken` requires a chain.');
const account_ = account ? (0, parseAccount_js_1.parseAccount)(account) : undefined;
if (!account_ || !account_.sign)
throw new Error('`account` with `sign` is required.');
const storageKey = `auth:${account_.address.toLowerCase()}:${chain.id}`;
const authentication = tempo_1.ZoneRpcAuthentication.from({
chainId: chain.id,
expiresAt,
issuedAt,
zoneId: tempo_1.ZoneId.fromChainId(chain.id),
});
const payload = tempo_1.ZoneRpcAuthentication.getSignPayload(authentication);
const signature = await account_.sign({ hash: payload });
const token = tempo_1.ZoneRpcAuthentication.serialize(authentication, {
signature,
});
await storage.setItem(storageKey, token);
await storage.setItem(`auth:token:${chain.id}`, token);
return { authentication, token };
}
async function encryptDepositPayload(publicKey, recipient, memo = bytes_js_1.zeroHash) {
const sequencerPublicKey = PublicKey.from({
prefix: publicKey.yParity,
x: Hex.toBigInt(publicKey.x),
});
const { privateKey: ephemeralPrivateKey, publicKey: ephemeralPublicKey } = Secp256k1.createKeyPair();
const sharedSecret = Secp256k1.getSharedSecret({
privateKey: ephemeralPrivateKey,
publicKey: sequencerPublicKey,
as: 'Bytes',
});
const hkdfKey = await globalThis.crypto.subtle.importKey('raw', sharedSecret.buffer, 'HKDF', false, ['deriveKey']);
const aesKey = await globalThis.crypto.subtle.deriveKey({
name: 'HKDF',
hash: 'SHA-256',
salt: new Uint8Array(12),
info: new TextEncoder().encode('ecies-aes-key'),
}, hkdfKey, { name: 'AES-GCM', length: 256 }, false, ['encrypt']);
const nonce = Bytes.random(12);
const plaintext = (0, encodeAbiParameters_js_1.encodeAbiParameters)([{ type: 'address' }, { type: 'bytes32' }], [recipient, memo]);
const ciphertextWithTag = new Uint8Array(await globalThis.crypto.subtle.encrypt({ name: 'AES-GCM', iv: nonce, tagLength: 128 }, aesKey, Bytes.from(plaintext)));
const ciphertext = ciphertextWithTag.slice(0, -16);
const tag = ciphertextWithTag.slice(-16);
const compressedEphemeral = PublicKey.compress(ephemeralPublicKey);
return {
ciphertext: Hex.fromBytes(ciphertext),
ephemeralPubkeyX: Hex.fromNumber(compressedEphemeral.x, { size: 32 }),
ephemeralPubkeyYParity: compressedEphemeral.prefix,
nonce: Hex.fromBytes(nonce),
tag: Hex.fromBytes(tag),
};
}
//# sourceMappingURL=zone.js.map

1
node_modules/viem/_cjs/tempo/actions/zone.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

127
node_modules/viem/_cjs/tempo/chainConfig.js generated vendored Normal file
View File

@@ -0,0 +1,127 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.chainConfig = void 0;
const Address = require("ox/Address");
const Hex = require("ox/Hex");
const PublicKey = require("ox/PublicKey");
const tempo_1 = require("ox/tempo");
const getCode_js_1 = require("../actions/public/getCode.js");
const verifyHash_js_1 = require("../actions/public/verifyHash.js");
const number_js_1 = require("../constants/number.js");
const defineChain_js_1 = require("../utils/chain/defineChain.js");
const transaction_js_1 = require("../utils/formatters/transaction.js");
const transactionReceipt_js_1 = require("../utils/formatters/transactionReceipt.js");
const transactionRequest_js_1 = require("../utils/formatters/transactionRequest.js");
const getAction_js_1 = require("../utils/getAction.js");
const keccak256_js_1 = require("../utils/hash/keccak256.js");
const accessKey_js_1 = require("./actions/accessKey.js");
const Formatters = require("./Formatters.js");
const Concurrent = require("./internal/concurrent.js");
const Transaction = require("./Transaction.js");
const maxExpirySecs = 25;
exports.chainConfig = {
blockTime: 1_000,
extendSchema: (0, defineChain_js_1.extendSchema)(),
formatters: {
transaction: (0, transaction_js_1.defineTransaction)({
exclude: ['aaAuthorizationList'],
format: Formatters.formatTransaction,
}),
transactionReceipt: (0, transactionReceipt_js_1.defineTransactionReceipt)({
format: Formatters.formatTransactionReceipt,
}),
transactionRequest: (0, transactionRequest_js_1.defineTransactionRequest)({
format: Formatters.formatTransactionRequest,
}),
},
prepareTransactionRequest: [
async (r, { phase }) => {
const request = r;
if (phase === 'afterFillParameters') {
if (request.feePayer) {
if (request.keyAuthorization?.signature.type === 'webAuthn')
request.gas = (request.gas ?? 0n) + 20000n;
else if (request.account?.source === 'accessKey')
request.gas = (request.gas ?? 0n) + 10000n;
}
return request;
}
const useExpiringNonce = await (async () => {
if (request.nonceKey === 'expiring')
return true;
if (request.feePayer && typeof request.nonceKey === 'undefined')
return true;
const address = request.account?.address;
if (address && typeof request.nonceKey === 'undefined')
return await Concurrent.detect(address);
return false;
})();
if (useExpiringNonce) {
request.nonceKey = number_js_1.maxUint256;
request.nonce = 0;
if (typeof request.validBefore === 'undefined')
request.validBefore = Math.floor(Date.now() / 1000) + maxExpirySecs;
}
else if (typeof request.nonceKey !== 'undefined') {
request.nonce = typeof request.nonce === 'number' ? request.nonce : 0;
}
if (!request.feeToken && request.chain?.feeToken)
request.feeToken = request.chain.feeToken;
return request;
},
{ runAt: ['beforeFillTransaction', 'afterFillParameters'] },
],
serializers: {
transaction: ((transaction, signature) => Transaction.serialize(transaction, signature)),
},
async verifyHash(client, parameters) {
const { address, hash, signature, mode } = parameters;
const envelope = (() => {
if (typeof signature !== 'string')
return;
try {
return tempo_1.SignatureEnvelope.deserialize(signature);
}
catch {
return undefined;
}
})();
if (envelope) {
if (envelope?.type === 'keychain' && mode === 'allowAccessKey') {
const accessKeyAddress = Address.fromPublicKey(PublicKey.from(envelope.inner.publicKey));
const keyInfo = await (0, accessKey_js_1.getMetadata)(client, {
account: address,
accessKey: accessKeyAddress,
blockNumber: parameters.blockNumber,
blockTag: parameters.blockTag,
});
if (keyInfo.isRevoked)
return false;
if (keyInfo.expiry <= BigInt(Math.floor(Date.now() / 1000)))
return false;
const innerPayload = envelope.version === 'v2'
? (0, keccak256_js_1.keccak256)(Hex.concat('0x04', hash, address))
: hash;
return tempo_1.SignatureEnvelope.verify(envelope.inner, {
address: accessKeyAddress,
payload: innerPayload,
});
}
if (envelope.type === 'p256' || envelope.type === 'webAuthn') {
const code = await (0, getCode_js_1.getCode)(client, {
address,
blockNumber: parameters.blockNumber,
blockTag: parameters.blockTag,
});
if (!code ||
code === '0xef01007702c00000000000000000000000000000000000')
return tempo_1.SignatureEnvelope.verify(envelope, {
address,
payload: hash,
});
}
}
return await (0, getAction_js_1.getAction)(client, verifyHash_js_1.verifyHash, 'verifyHash')({ ...parameters, chain: null });
},
};
//# sourceMappingURL=chainConfig.js.map

1
node_modules/viem/_cjs/tempo/chainConfig.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"chainConfig.js","sourceRoot":"","sources":["../../tempo/chainConfig.ts"],"names":[],"mappings":";;;AAAA,sCAAqC;AACrC,8BAA6B;AAC7B,0CAAyC;AACzC,oCAA0D;AAC1D,6DAAsD;AACtD,mEAA4D;AAC5D,sDAAmD;AAEnD,kEAA4D;AAC5D,uEAAsE;AACtE,qFAAoF;AACpF,qFAAoF;AACpF,wDAAiD;AACjD,6DAAsD;AAGtD,yDAAoD;AACpD,8CAA6C;AAE7C,uDAAsD;AACtD,gDAA+C;AAE/C,MAAM,aAAa,GAAG,EAAE,CAAA;AAEX,QAAA,WAAW,GAAG;IACzB,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE,IAAA,6BAAY,GAGtB;IACJ,UAAU,EAAE;QACV,WAAW,EAAE,IAAA,kCAAiB,EAAC;YAC7B,OAAO,EAAE,CAAC,qBAA8B,CAAC;YACzC,MAAM,EAAE,UAAU,CAAC,iBAAiB;SACrC,CAAC;QACF,kBAAkB,EAAE,IAAA,gDAAwB,EAAC;YAC3C,MAAM,EAAE,UAAU,CAAC,wBAAwB;SAC5C,CAAC;QACF,kBAAkB,EAAE,IAAA,gDAAwB,EAAC;YAC3C,MAAM,EAAE,UAAU,CAAC,wBAAwB;SAC5C,CAAC;KACH;IACD,yBAAyB,EAAE;QACzB,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;YACrB,MAAM,OAAO,GAAG,CAKf,CAAA;YAID,IAAI,KAAK,KAAK,qBAAqB,EAAE,CAAC;gBACpC,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;oBACrB,IAAI,OA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CAAA;IACnC,CAAC;CAC0D,CAAA"}

36
node_modules/viem/_cjs/tempo/index.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebCryptoP256 = exports.WebAuthnP256 = exports.withRelay = exports.withFeePayer = exports.walletNamespaceCompat = exports.Transport = exports.Transaction = exports.TokenIds = exports.Storage = exports.P256 = exports.Hardfork = exports.Formatters = exports.Expiry = exports.tempoActions = exports.Capabilities = exports.Actions = exports.Addresses = exports.Account = exports.Abis = exports.VirtualMaster = exports.VirtualAddress = exports.TokenId = exports.Tick = exports.TempoAddress = exports.Period = exports.Secp256k1 = exports.PublicKey = exports.Bytes = void 0;
var ox_1 = require("ox");
Object.defineProperty(exports, "Bytes", { enumerable: true, get: function () { return ox_1.Bytes; } });
Object.defineProperty(exports, "PublicKey", { enumerable: true, get: function () { return ox_1.PublicKey; } });
Object.defineProperty(exports, "Secp256k1", { enumerable: true, get: function () { return ox_1.Secp256k1; } });
var tempo_1 = require("ox/tempo");
Object.defineProperty(exports, "Period", { enumerable: true, get: function () { return tempo_1.Period; } });
Object.defineProperty(exports, "TempoAddress", { enumerable: true, get: function () { return tempo_1.TempoAddress; } });
Object.defineProperty(exports, "Tick", { enumerable: true, get: function () { return tempo_1.Tick; } });
Object.defineProperty(exports, "TokenId", { enumerable: true, get: function () { return tempo_1.TokenId; } });
Object.defineProperty(exports, "VirtualAddress", { enumerable: true, get: function () { return tempo_1.VirtualAddress; } });
Object.defineProperty(exports, "VirtualMaster", { enumerable: true, get: function () { return tempo_1.VirtualMaster; } });
exports.Abis = require("./Abis.js");
exports.Account = require("./Account.js");
exports.Addresses = require("./Addresses.js");
exports.Actions = require("./actions/index.js");
exports.Capabilities = require("./Capabilities.js");
var Decorator_js_1 = require("./Decorator.js");
Object.defineProperty(exports, "tempoActions", { enumerable: true, get: function () { return Decorator_js_1.decorator; } });
exports.Expiry = require("./Expiry.js");
exports.Formatters = require("./Formatters.js");
exports.Hardfork = require("./Hardfork.js");
exports.P256 = require("./P256.js");
exports.Storage = require("./Storage.js");
exports.TokenIds = require("./TokenIds.js");
exports.Transaction = require("./Transaction.js");
exports.Transport = require("./Transport.js");
var Transport_js_1 = require("./Transport.js");
Object.defineProperty(exports, "walletNamespaceCompat", { enumerable: true, get: function () { return Transport_js_1.walletNamespaceCompat; } });
Object.defineProperty(exports, "withFeePayer", { enumerable: true, get: function () { return Transport_js_1.withFeePayer; } });
Object.defineProperty(exports, "withRelay", { enumerable: true, get: function () { return Transport_js_1.withRelay; } });
exports.WebAuthnP256 = require("./WebAuthnP256.js");
exports.WebCryptoP256 = require("./WebCryptoP256.js");
//# sourceMappingURL=index.js.map

1
node_modules/viem/_cjs/tempo/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":";;;AACA,yBAAgD;AAAvC,2FAAA,KAAK,OAAA;AAAE,+FAAA,SAAS,OAAA;AAAE,+FAAA,SAAS,OAAA;AAYpC,kCAOiB;AANf,+FAAA,MAAM,OAAA;AACN,qGAAA,YAAY,OAAA;AACZ,6FAAA,IAAI,OAAA;AACJ,gGAAA,OAAO,OAAA;AACP,uGAAA,cAAc,OAAA;AACd,sGAAA,aAAa,OAAA;AAEf,oCAAiC;AACjC,0CAAuC;AACvC,8CAA2C;AAC3C,gDAA6C;AAC7C,oDAAiD;AACjD,+CAGuB;AADrB,4GAAA,SAAS,OAAgB;AAE3B,wCAAqC;AACrC,gDAA6C;AAC7C,4CAAyC;AACzC,oCAAiC;AACjC,0CAAuC;AACvC,4CAAyC;AA8BzC,kDAA+C;AAC/C,8CAA2C;AAC3C,+CAA+E;AAAtE,qHAAA,qBAAqB,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,yGAAA,SAAS,OAAA;AACvD,oDAAiD;AACjD,sDAAmD"}

18
node_modules/viem/_cjs/tempo/internal/concurrent.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.detect = detect;
const concurrentCounts = new Map();
async function detect(key) {
concurrentCounts.set(key, (concurrentCounts.get(key) ?? 0) + 1);
await Promise.resolve();
const isConcurrent = (concurrentCounts.get(key) ?? 0) > 1;
queueMicrotask(() => {
const count = concurrentCounts.get(key) ?? 0;
if (count <= 1)
concurrentCounts.delete(key);
else
concurrentCounts.set(key, count - 1);
});
return isConcurrent;
}
//# sourceMappingURL=concurrent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"concurrent.js","sourceRoot":"","sources":["../../../tempo/internal/concurrent.ts"],"names":[],"mappings":";;AAaA,wBAUC;AAvBD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAA;AAa3C,KAAK,UAAU,MAAM,CAAC,GAAW;IACtC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAC/D,MAAM,OAAO,CAAC,OAAO,EAAE,CAAA;IACvB,MAAM,YAAY,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;IACzD,cAAc,CAAC,GAAG,EAAE;QAClB,MAAM,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC5C,IAAI,KAAK,IAAI,CAAC;YAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;;YACvC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IACF,OAAO,YAAY,CAAA;AACrB,CAAC"}

3
node_modules/viem/_cjs/tempo/internal/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/tempo/internal/types.js.map generated vendored Normal file
View File

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

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

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defineCall = defineCall;
exports.normalizeValue = normalizeValue;
const index_js_1 = require("../../utils/index.js");
function defineCall(call) {
return {
...call,
data: (0, index_js_1.encodeFunctionData)(call),
to: call.address,
};
}
function normalizeValue(value) {
if (Array.isArray(value))
return value.map(normalizeValue);
if (typeof value === 'function')
return undefined;
if (typeof value !== 'object' || value === null)
return value;
if (Object.getPrototypeOf(value) !== Object.prototype)
try {
return structuredClone(value);
}
catch {
return undefined;
}
const normalized = {};
for (const [k, v] of Object.entries(value))
normalized[k] = normalizeValue(v);
return normalized;
}
//# sourceMappingURL=utils.js.map

1
node_modules/viem/_cjs/tempo/internal/utils.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../tempo/internal/utils.ts"],"names":[],"mappings":";;AASA,gCAyBC;AAQD,wCAcC;AAjDD,mDAAyD;AAEzD,SAAgB,UAAU,CASxB,IAEqE;IASrE,OAAO;QACL,GAAI,IAAY;QAChB,IAAI,EAAE,IAAA,6BAAkB,EAAC,IAAa,CAAC;QACvC,EAAE,EAAE,IAAI,CAAC,OAAO;KACR,CAAA;AACZ,CAAC;AAQD,SAAgB,cAAc,CAAO,KAAW;IAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,cAAc,CAAU,CAAA;IACnE,IAAI,OAAO,KAAK,KAAK,UAAU;QAAE,OAAO,SAAkB,CAAA;IAC1D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAC7D,IAAI,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,SAAS;QACnD,IAAI,CAAC;YACH,OAAO,eAAe,CAAC,KAAK,CAAC,CAAA;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAkB,CAAA;QAC3B,CAAC;IAEH,MAAM,UAAU,GAA4B,EAAE,CAAA;IAC9C,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,UAAU,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;IAC7E,OAAO,UAAmB,CAAA;AAC5B,CAAC"}

82
node_modules/viem/_cjs/tempo/zones/Abis.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.zoneOutbox = exports.zonePortal = void 0;
exports.zonePortal = [
{
name: 'deposit',
type: 'function',
stateMutability: 'nonpayable',
inputs: [
{ name: '_token', type: 'address' },
{ name: 'to', type: 'address' },
{ name: 'amount', type: 'uint128' },
{ name: 'memo', type: 'bytes32' },
],
outputs: [{ name: '', type: 'bytes32' }],
},
{
name: 'depositEncrypted',
type: 'function',
stateMutability: 'nonpayable',
inputs: [
{ name: 'token', type: 'address' },
{ name: 'amount', type: 'uint128' },
{ name: 'keyIndex', type: 'uint256' },
{
name: 'encrypted',
type: 'tuple',
components: [
{ name: 'ephemeralPubkeyX', type: 'bytes32' },
{ name: 'ephemeralPubkeyYParity', type: 'uint8' },
{ name: 'ciphertext', type: 'bytes' },
{ name: 'nonce', type: 'bytes12' },
{ name: 'tag', type: 'bytes16' },
],
},
],
outputs: [{ name: '', type: 'bytes32' }],
},
{
name: 'sequencerEncryptionKey',
type: 'function',
stateMutability: 'view',
inputs: [],
outputs: [
{ name: 'x', type: 'bytes32' },
{ name: 'yParity', type: 'uint8' },
],
},
{
name: 'encryptionKeyCount',
type: 'function',
stateMutability: 'view',
inputs: [],
outputs: [{ name: '', type: 'uint256' }],
},
];
exports.zoneOutbox = [
{
name: 'requestWithdrawal',
type: 'function',
stateMutability: 'nonpayable',
inputs: [
{ name: 'token', type: 'address' },
{ name: 'to', type: 'address' },
{ name: 'amount', type: 'uint128' },
{ name: 'memo', type: 'bytes32' },
{ name: 'gasLimit', type: 'uint64' },
{ name: 'fallbackRecipient', type: 'address' },
{ name: 'data', type: 'bytes' },
{ name: 'revealTo', type: 'bytes' },
],
outputs: [],
},
{
name: 'calculateWithdrawalFee',
type: 'function',
stateMutability: 'view',
inputs: [{ name: 'gasLimit', type: 'uint64' }],
outputs: [{ name: 'fee', type: 'uint128' }],
},
];
//# sourceMappingURL=Abis.js.map

1
node_modules/viem/_cjs/tempo/zones/Abis.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Abis.js","sourceRoot":"","sources":["../../../tempo/zones/Abis.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACxB;QACE,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,YAAY;QAC7B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YACnC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;YAC/B,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YACnC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;SAClC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KACzC;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,YAAY;QAC7B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAClC,EAAE,IAAI,EAAE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EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;YAC/B,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YACnC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;YACjC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;YACpC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE;YAC9C,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE;YAC/B,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE;SACpC;QACD,OAAO,EAAE,EAAE;KACZ;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC5C;CACO,CAAA"}

13
node_modules/viem/_cjs/tempo/zones/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.zoneModerato = exports.zone = exports.portalAddresses = exports.getPortalAddress = exports.from = exports.http = exports.Abis = void 0;
exports.Abis = require("./Abis.js");
var transport_js_1 = require("./transport.js");
Object.defineProperty(exports, "http", { enumerable: true, get: function () { return transport_js_1.http; } });
var zone_js_1 = require("./zone.js");
Object.defineProperty(exports, "from", { enumerable: true, get: function () { return zone_js_1.from; } });
Object.defineProperty(exports, "getPortalAddress", { enumerable: true, get: function () { return zone_js_1.getPortalAddress; } });
Object.defineProperty(exports, "portalAddresses", { enumerable: true, get: function () { return zone_js_1.portalAddresses; } });
Object.defineProperty(exports, "zone", { enumerable: true, get: function () { return zone_js_1.zone; } });
Object.defineProperty(exports, "zoneModerato", { enumerable: true, get: function () { return zone_js_1.zoneModerato; } });
//# sourceMappingURL=index.js.map

1
node_modules/viem/_cjs/tempo/zones/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../tempo/zones/index.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AACjC,+CAA0D;AAAjD,oGAAA,IAAI,OAAA;AACb,qCAMkB;AALhB,+FAAA,IAAI,OAAA;AACJ,2GAAA,gBAAgB,OAAA;AAChB,0GAAA,eAAe,OAAA;AACf,+FAAA,IAAI,OAAA;AACJ,uGAAA,YAAY,OAAA"}

24
node_modules/viem/_cjs/tempo/zones/transport.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.http = http;
const http_js_1 = require("../../clients/transports/http.js");
const Storage_ = require("../Storage.js");
function http(url, config = {}) {
const { storage: storage_, onFetchRequest, ...rest } = config;
const storage = storage_ ?? Storage_.defaultStorage();
return (config) => (0, http_js_1.http)(url, {
...rest,
async onFetchRequest(request, init) {
const next = (await onFetchRequest?.(request, init)) ?? init;
const headers = new Headers(next.headers);
const chainId = config.chain?.id;
if (chainId) {
const token = (await storage.getItem(`auth:token:${chainId}`)) ?? null;
if (token)
headers.set('X-Authorization-Token', token);
}
return { ...next, headers };
},
})(config);
}
//# sourceMappingURL=transport.js.map

1
node_modules/viem/_cjs/tempo/zones/transport.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../tempo/zones/transport.ts"],"names":[],"mappings":";;AAkCA,oBAuBC;AAzDD,8DAIyC;AAEzC,0CAAyC;AA4BzC,SAAgB,IAAI,CAClB,GAAwB,EACxB,SAAyB,EAAE;IAE3B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;IAC7D,MAAM,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAAC,cAAc,EAAE,CAAA;IAErD,OAAO,CAAC,MAAM,EAAE,EAAE,CAChB,IAAA,cAAK,EAAC,GAAG,EAAE;QACT,GAAG,IAAI;QACP,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI;YAChC,MAAM,IAAI,GAAG,CAAC,MAAM,cAAc,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,IAAI,CAAA;YAC5D,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAEzC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,EAAE,CAAA;YAChC,IAAI,OAAO,EAAE,CAAC;gBACZ,MAAM,KAAK,GAAG,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC,IAAI,IAAI,CAAA;gBACtE,IAAI,KAAK;oBAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAA;YACxD,CAAC;YAED,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAA;QAC7B,CAAC;KACF,CAAC,CAAC,MAAM,CAAC,CAAA;AACd,CAAC"}

53
node_modules/viem/_cjs/tempo/zones/zone.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.zoneModerato = exports.zone = exports.portalAddresses = void 0;
exports.getPortalAddress = getPortalAddress;
exports.from = from;
const tempo_1 = require("ox/tempo");
const tempo_js_1 = require("../../chains/definitions/tempo.js");
const tempoModerato_js_1 = require("../../chains/definitions/tempoModerato.js");
const defineChain_js_1 = require("../../utils/chain/defineChain.js");
const chainConfig_js_1 = require("../chainConfig.js");
exports.portalAddresses = {
[tempoModerato_js_1.tempoModerato.id]: {
6: '0x7069DeC4E64Fd07334A0933eDe836C17259c9B23',
7: '0x3F5296303400B56271b476F5A0B9cBF74350D6Ac',
},
};
function getPortalAddress(chainId, zoneId) {
const address = exports.portalAddresses[chainId]?.[zoneId];
if (!address)
throw new Error(`No portal address configured for zone ${zoneId} on chain ${chainId}.`);
return address;
}
exports.zone = from({
sourceId: tempo_js_1.tempo.id,
rpcHost: 'tempo.xyz',
});
exports.zoneModerato = from({
sourceId: tempoModerato_js_1.tempoModerato.id,
rpcHost: 'tempoxyz.dev',
});
function from(options) {
return (id) => {
const chainId = tempo_1.ZoneId.toChainId(id);
const paddedId = String(id).padStart(3, '0');
return (0, defineChain_js_1.defineChain)({
...chainConfig_js_1.chainConfig,
id: chainId,
name: `Tempo Zone ${paddedId}`,
nativeCurrency: {
name: 'USD',
symbol: 'USD',
decimals: 6,
},
rpcUrls: {
default: {
http: [`https://rpc-zone-${paddedId}.${options.rpcHost}`],
},
},
sourceId: options.sourceId,
});
};
}
//# sourceMappingURL=zone.js.map

1
node_modules/viem/_cjs/tempo/zones/zone.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"zone.js","sourceRoot":"","sources":["../../../tempo/zones/zone.ts"],"names":[],"mappings":";;;AAaA,4CAYC;AAaD,oBAsBC;AA5DD,oCAAiC;AACjC,gEAAyD;AACzD,gFAAyE;AACzE,qEAA8D;AAC9D,sDAA+C;AAElC,QAAA,eAAe,GAAG;IAC7B,CAAC,gCAAa,CAAC,EAAE,CAAC,EAAE;QAClB,CAAC,EAAE,4CAA4C;QAC/C,CAAC,EAAE,4CAA4C;KAChD;CAC+D,CAAA;AAElE,SAAgB,gBAAgB,CAC9B,OAAe,EACf,MAAc;IAEd,MAAM,OAAO,GACX,uBACD,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;IACpB,IAAI,CAAC,OAAO;QACV,MAAM,IAAI,KAAK,CACb,yCAAyC,MAAM,aAAa,OAAO,GAAG,CACvE,CAAA;IACH,OAAO,OAAO,CAAA;AAChB,CAAC;AAEY,QAAA,IAAI,GAAiB,IAAI,CAAC;IACrC,Q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