Socket
Socket
Sign inDemoInstall

@eth-optimism/sdk

Package Overview
Dependencies
Maintainers
2
Versions
498
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eth-optimism/sdk - npm Package Compare versions

Comparing version 3.3.1 to 3.3.2

2

dist/adapters/dai-bridge.d.ts

@@ -1,2 +0,2 @@

import { AddressLike } from '../interfaces';
import type { AddressLike } from '../interfaces';
import { StandardBridgeAdapter } from './standard-bridge';

@@ -3,0 +3,0 @@ export declare class DAIBridgeAdapter extends StandardBridgeAdapter {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DAIBridgeAdapter = void 0;
const core_utils_1 = require("@eth-optimism/core-utils");
const ethers_1 = require("ethers");
const core_utils_1 = require("@eth-optimism/core-utils");
const utils_1 = require("../utils");
const coercion_1 = require("../utils/coercion");
const standard_bridge_1 = require("./standard-bridge");

@@ -39,7 +39,7 @@ class DAIBridgeAdapter extends standard_bridge_1.StandardBridgeAdapter {

const allowedL1Token = await l1Bridge.l1Token();
if (!(0, core_utils_1.hexStringEquals)(allowedL1Token, (0, utils_1.toAddress)(l1Token))) {
if (!(0, core_utils_1.hexStringEquals)(allowedL1Token, (0, coercion_1.toAddress)(l1Token))) {
return false;
}
const allowedL2Token = await l1Bridge.l2Token();
if (!(0, core_utils_1.hexStringEquals)(allowedL2Token, (0, utils_1.toAddress)(l2Token))) {
if (!(0, core_utils_1.hexStringEquals)(allowedL2Token, (0, coercion_1.toAddress)(l2Token))) {
return false;

@@ -46,0 +46,0 @@ }

@@ -1,2 +0,2 @@

import { AddressLike } from '../interfaces';
import type { AddressLike } from '../interfaces';
import { StandardBridgeAdapter } from './standard-bridge';

@@ -3,0 +3,0 @@ export declare class ECOBridgeAdapter extends StandardBridgeAdapter {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ECOBridgeAdapter = void 0;
const core_utils_1 = require("@eth-optimism/core-utils");
const ethers_1 = require("ethers");
const core_utils_1 = require("@eth-optimism/core-utils");
const utils_1 = require("../utils");
const coercion_1 = require("../utils/coercion");
const standard_bridge_1 = require("./standard-bridge");

@@ -44,6 +44,6 @@ class ECOBridgeAdapter extends standard_bridge_1.StandardBridgeAdapter {

]);
if (!(0, core_utils_1.hexStringEquals)(remoteL1Token, (0, utils_1.toAddress)(l1Token))) {
if (!(0, core_utils_1.hexStringEquals)(remoteL1Token, (0, coercion_1.toAddress)(l1Token))) {
return false;
}
if (!(0, core_utils_1.hexStringEquals)(remoteL2Token, (0, utils_1.toAddress)(l2Token))) {
if (!(0, core_utils_1.hexStringEquals)(remoteL2Token, (0, coercion_1.toAddress)(l2Token))) {
return false;

@@ -50,0 +50,0 @@ }

@@ -1,4 +0,5 @@

import { ethers, Overrides, BigNumber } from 'ethers';
import { TransactionRequest, BlockTag } from '@ethersproject/abstract-provider';
import { NumberLike, AddressLike, TokenBridgeMessage } from '../interfaces';
import type { BlockTag, TransactionRequest } from '@ethersproject/abstract-provider';
import type { BigNumber, Overrides } from 'ethers';
import { ethers } from 'ethers';
import type { AddressLike, NumberLike, TokenBridgeMessage } from '../interfaces';
import { StandardBridgeAdapter } from './standard-bridge';

@@ -5,0 +6,0 @@ export declare class ETHBridgeAdapter extends StandardBridgeAdapter {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ETHBridgeAdapter = void 0;
const ethers_1 = require("ethers");
const contracts_1 = require("@eth-optimism/contracts");
const core_utils_1 = require("@eth-optimism/core-utils");
const ethers_1 = require("ethers");
const interfaces_1 = require("../interfaces");
const utils_1 = require("../utils");
const coercion_1 = require("../utils/coercion");
const misc_utils_1 = require("../utils/misc-utils");
const standard_bridge_1 = require("./standard-bridge");

@@ -22,6 +23,6 @@ class ETHBridgeAdapter extends standard_bridge_1.StandardBridgeAdapter {

if ((opts === null || opts === void 0 ? void 0 : opts.recipient) === undefined) {
return this.l1Bridge.populateTransaction.depositETH((opts === null || opts === void 0 ? void 0 : opts.l2GasLimit) || 200000, '0x', Object.assign(Object.assign({}, (0, utils_1.omit)((opts === null || opts === void 0 ? void 0 : opts.overrides) || {}, 'value')), { value: amount }));
return this.l1Bridge.populateTransaction.depositETH((opts === null || opts === void 0 ? void 0 : opts.l2GasLimit) || 200000, '0x', Object.assign(Object.assign({}, (0, misc_utils_1.omit)((opts === null || opts === void 0 ? void 0 : opts.overrides) || {}, 'value')), { value: amount }));
}
else {
return this.l1Bridge.populateTransaction.depositETHTo((0, utils_1.toAddress)(opts.recipient), (opts === null || opts === void 0 ? void 0 : opts.l2GasLimit) || 200000, '0x', Object.assign(Object.assign({}, (0, utils_1.omit)((opts === null || opts === void 0 ? void 0 : opts.overrides) || {}, 'value')), { value: amount }));
return this.l1Bridge.populateTransaction.depositETHTo((0, coercion_1.toAddress)(opts.recipient), (opts === null || opts === void 0 ? void 0 : opts.l2GasLimit) || 200000, '0x', Object.assign(Object.assign({}, (0, misc_utils_1.omit)((opts === null || opts === void 0 ? void 0 : opts.overrides) || {}, 'value')), { value: amount }));
}

@@ -34,6 +35,6 @@ },

if ((opts === null || opts === void 0 ? void 0 : opts.recipient) === undefined) {
return this.l2Bridge.populateTransaction.withdraw((0, utils_1.toAddress)(l2Token), amount, 0, '0x', Object.assign(Object.assign({}, (0, utils_1.omit)((opts === null || opts === void 0 ? void 0 : opts.overrides) || {}, 'value')), { value: this.messenger.bedrock ? amount : 0 }));
return this.l2Bridge.populateTransaction.withdraw((0, coercion_1.toAddress)(l2Token), amount, 0, '0x', Object.assign(Object.assign({}, (0, misc_utils_1.omit)((opts === null || opts === void 0 ? void 0 : opts.overrides) || {}, 'value')), { value: this.messenger.bedrock ? amount : 0 }));
}
else {
return this.l2Bridge.populateTransaction.withdrawTo((0, utils_1.toAddress)(l2Token), (0, utils_1.toAddress)(opts.recipient), amount, 0, '0x', Object.assign(Object.assign({}, (0, utils_1.omit)((opts === null || opts === void 0 ? void 0 : opts.overrides) || {}, 'value')), { value: this.messenger.bedrock ? amount : 0 }));
return this.l2Bridge.populateTransaction.withdrawTo((0, coercion_1.toAddress)(l2Token), (0, coercion_1.toAddress)(opts.recipient), amount, 0, '0x', Object.assign(Object.assign({}, (0, misc_utils_1.omit)((opts === null || opts === void 0 ? void 0 : opts.overrides) || {}, 'value')), { value: this.messenger.bedrock ? amount : 0 }));
}

@@ -93,4 +94,4 @@ },

async supportsTokenPair(l1Token, l2Token) {
return ((0, core_utils_1.hexStringEquals)((0, utils_1.toAddress)(l1Token), ethers_1.ethers.constants.AddressZero) &&
(0, core_utils_1.hexStringEquals)((0, utils_1.toAddress)(l2Token), contracts_1.predeploys.OVM_ETH));
return ((0, core_utils_1.hexStringEquals)((0, coercion_1.toAddress)(l1Token), ethers_1.ethers.constants.AddressZero) &&
(0, core_utils_1.hexStringEquals)((0, coercion_1.toAddress)(l2Token), contracts_1.predeploys.OVM_ETH));
}

@@ -97,0 +98,0 @@ }

@@ -1,4 +0,4 @@

export * from './standard-bridge';
export * from './eth-bridge';
export * from './dai-bridge';
export * from './eco-bridge';
export * from './eth-bridge';
export * from './standard-bridge';

@@ -17,6 +17,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./standard-bridge"), exports);
__exportStar(require("./eth-bridge"), exports);
__exportStar(require("./dai-bridge"), exports);
__exportStar(require("./eco-bridge"), exports);
__exportStar(require("./eth-bridge"), exports);
__exportStar(require("./standard-bridge"), exports);
//# sourceMappingURL=index.js.map

@@ -1,5 +0,6 @@

import { ethers, Contract, Overrides, Signer, BigNumber, CallOverrides } from 'ethers';
import { TransactionRequest, TransactionResponse, BlockTag } from '@ethersproject/abstract-provider';
import { CrossChainMessenger } from '../cross-chain-messenger';
import { IBridgeAdapter, NumberLike, AddressLike, TokenBridgeMessage } from '../interfaces';
import type { BlockTag, TransactionRequest, TransactionResponse } from '@ethersproject/abstract-provider';
import type { BigNumber, CallOverrides, Overrides, Signer } from 'ethers';
import { Contract, ethers } from 'ethers';
import type { CrossChainMessenger } from '../cross-chain-messenger';
import type { AddressLike, IBridgeAdapter, NumberLike, TokenBridgeMessage } from '../interfaces';
export declare class StandardBridgeAdapter implements IBridgeAdapter {

@@ -6,0 +7,0 @@ messenger: CrossChainMessenger;

@@ -7,5 +7,5 @@ "use strict";

exports.StandardBridgeAdapter = void 0;
const ethers_1 = require("ethers");
const contracts_1 = require("@eth-optimism/contracts");
const core_utils_1 = require("@eth-optimism/core-utils");
const ethers_1 = require("ethers");
const L1StandardBridge_json_1 = __importDefault(require("../forge-artifacts/L1StandardBridge.json"));

@@ -15,3 +15,3 @@ const L2StandardBridge_json_1 = __importDefault(require("../forge-artifacts/L2StandardBridge.json"));

const interfaces_1 = require("../interfaces");
const utils_1 = require("../utils");
const coercion_1 = require("../utils/coercion");
class StandardBridgeAdapter {

@@ -24,3 +24,3 @@ constructor(opts) {

}
const token = new ethers_1.Contract((0, utils_1.toAddress)(l1Token), OptimismMintableERC20_json_1.default.abi, this.messenger.l1Provider);
const token = new ethers_1.Contract((0, coercion_1.toAddress)(l1Token), OptimismMintableERC20_json_1.default.abi, this.messenger.l1Provider);
return token.populateTransaction.approve(this.l1Bridge.address, amount, (opts === null || opts === void 0 ? void 0 : opts.overrides) || {});

@@ -33,6 +33,6 @@ },

if ((opts === null || opts === void 0 ? void 0 : opts.recipient) === undefined) {
return this.l1Bridge.populateTransaction.depositERC20((0, utils_1.toAddress)(l1Token), (0, utils_1.toAddress)(l2Token), amount, (opts === null || opts === void 0 ? void 0 : opts.l2GasLimit) || 200000, '0x', (opts === null || opts === void 0 ? void 0 : opts.overrides) || {});
return this.l1Bridge.populateTransaction.depositERC20((0, coercion_1.toAddress)(l1Token), (0, coercion_1.toAddress)(l2Token), amount, (opts === null || opts === void 0 ? void 0 : opts.l2GasLimit) || 200000, '0x', (opts === null || opts === void 0 ? void 0 : opts.overrides) || {});
}
else {
return this.l1Bridge.populateTransaction.depositERC20To((0, utils_1.toAddress)(l1Token), (0, utils_1.toAddress)(l2Token), (0, utils_1.toAddress)(opts.recipient), amount, (opts === null || opts === void 0 ? void 0 : opts.l2GasLimit) || 200000, '0x', (opts === null || opts === void 0 ? void 0 : opts.overrides) || {});
return this.l1Bridge.populateTransaction.depositERC20To((0, coercion_1.toAddress)(l1Token), (0, coercion_1.toAddress)(l2Token), (0, coercion_1.toAddress)(opts.recipient), amount, (opts === null || opts === void 0 ? void 0 : opts.l2GasLimit) || 200000, '0x', (opts === null || opts === void 0 ? void 0 : opts.overrides) || {});
}

@@ -45,6 +45,6 @@ },

if ((opts === null || opts === void 0 ? void 0 : opts.recipient) === undefined) {
return this.l2Bridge.populateTransaction.withdraw((0, utils_1.toAddress)(l2Token), amount, 0, '0x', (opts === null || opts === void 0 ? void 0 : opts.overrides) || {});
return this.l2Bridge.populateTransaction.withdraw((0, coercion_1.toAddress)(l2Token), amount, 0, '0x', (opts === null || opts === void 0 ? void 0 : opts.overrides) || {});
}
else {
return this.l2Bridge.populateTransaction.withdrawTo((0, utils_1.toAddress)(l2Token), (0, utils_1.toAddress)(opts.recipient), amount, 0, '0x', (opts === null || opts === void 0 ? void 0 : opts.overrides) || {});
return this.l2Bridge.populateTransaction.withdrawTo((0, coercion_1.toAddress)(l2Token), (0, coercion_1.toAddress)(opts.recipient), amount, 0, '0x', (opts === null || opts === void 0 ? void 0 : opts.overrides) || {});
}

@@ -65,4 +65,4 @@ },

this.messenger = opts.messenger;
this.l1Bridge = new ethers_1.Contract((0, utils_1.toAddress)(opts.l1Bridge), L1StandardBridge_json_1.default.abi, this.messenger.l1Provider);
this.l2Bridge = new ethers_1.Contract((0, utils_1.toAddress)(opts.l2Bridge), L2StandardBridge_json_1.default.abi, this.messenger.l2Provider);
this.l1Bridge = new ethers_1.Contract((0, coercion_1.toAddress)(opts.l1Bridge), L1StandardBridge_json_1.default.abi, this.messenger.l1Provider);
this.l2Bridge = new ethers_1.Contract((0, coercion_1.toAddress)(opts.l2Bridge), L2StandardBridge_json_1.default.abi, this.messenger.l2Provider);
}

@@ -120,9 +120,9 @@ async getDepositsByAddress(address, opts) {

async supportsTokenPair(l1Token, l2Token) {
const contract = new ethers_1.Contract((0, utils_1.toAddress)(l2Token), OptimismMintableERC20_json_1.default.abi, this.messenger.l2Provider);
if ((0, core_utils_1.hexStringEquals)((0, utils_1.toAddress)(l1Token), ethers_1.ethers.constants.AddressZero) ||
(0, core_utils_1.hexStringEquals)((0, utils_1.toAddress)(l2Token), contracts_1.predeploys.OVM_ETH)) {
const contract = new ethers_1.Contract((0, coercion_1.toAddress)(l2Token), OptimismMintableERC20_json_1.default.abi, this.messenger.l2Provider);
if ((0, core_utils_1.hexStringEquals)((0, coercion_1.toAddress)(l1Token), ethers_1.ethers.constants.AddressZero) ||
(0, core_utils_1.hexStringEquals)((0, coercion_1.toAddress)(l2Token), contracts_1.predeploys.OVM_ETH)) {
return false;
}
const remoteL1Token = await contract.l1Token();
if (!(0, core_utils_1.hexStringEquals)(remoteL1Token, (0, utils_1.toAddress)(l1Token))) {
if (!(0, core_utils_1.hexStringEquals)(remoteL1Token, (0, coercion_1.toAddress)(l1Token))) {
return false;

@@ -140,3 +140,3 @@ }

}
const token = new ethers_1.Contract((0, utils_1.toAddress)(l1Token), OptimismMintableERC20_json_1.default.abi, this.messenger.l1Provider);
const token = new ethers_1.Contract((0, coercion_1.toAddress)(l1Token), OptimismMintableERC20_json_1.default.abi, this.messenger.l1Provider);
return token.allowance(await signer.getAddress(), this.l1Bridge.address);

@@ -143,0 +143,0 @@ }

@@ -1,7 +0,10 @@

import { Provider, BlockTag, TransactionResponse, TransactionRequest } from '@ethersproject/abstract-provider';
import { Signer } from '@ethersproject/abstract-signer';
import { ethers, BigNumber, Overrides, CallOverrides, PayableOverrides } from 'ethers';
import { BedrockOutputData, BedrockCrossChainMessageProof } from '@eth-optimism/core-utils';
import { OEContracts, OEContractsLike, MessageLike, MessageRequestLike, TransactionLike, AddressLike, NumberLike, SignerOrProviderLike, CrossChainMessage, CrossChainMessageRequest, CrossChainMessageProof, MessageDirection, MessageStatus, TokenBridgeMessage, MessageReceipt, BridgeAdapterData, BridgeAdapters, StateRoot, StateRootBatch, IBridgeAdapter, ProvenWithdrawal, LowLevelMessage } from './interfaces';
import { DeepPartial } from './utils';
import type { BedrockCrossChainMessageProof, BedrockOutputData } from '@eth-optimism/core-utils';
import type { BlockTag, TransactionRequest, TransactionResponse } from '@ethersproject/abstract-provider';
import { Provider } from '@ethersproject/abstract-provider';
import type { Signer } from '@ethersproject/abstract-signer';
import type { CallOverrides, Overrides, PayableOverrides } from 'ethers';
import { BigNumber, ethers } from 'ethers';
import type { AddressLike, BridgeAdapterData, BridgeAdapters, CrossChainMessage, CrossChainMessageProof, CrossChainMessageRequest, IBridgeAdapter, LowLevelMessage, MessageLike, MessageReceipt, MessageRequestLike, NumberLike, OEContracts, OEContractsLike, ProvenWithdrawal, SignerOrProviderLike, StateRoot, StateRootBatch, TokenBridgeMessage, TransactionLike } from './interfaces';
import { MessageDirection, MessageStatus } from './interfaces';
import type { DeepPartial } from './utils';
export declare class CrossChainMessenger {

@@ -8,0 +11,0 @@ l1SignerOrProvider: Signer | Provider;

@@ -30,6 +30,6 @@ "use strict";

exports.CrossChainMessenger = void 0;
const contracts_1 = require("@eth-optimism/contracts");
const core_utils_1 = require("@eth-optimism/core-utils");
const abstract_provider_1 = require("@ethersproject/abstract-provider");
const ethers_1 = require("ethers");
const core_utils_1 = require("@eth-optimism/core-utils");
const contracts_1 = require("@eth-optimism/contracts");
const rlp = __importStar(require("rlp"));

@@ -36,0 +36,0 @@ const semver_1 = __importDefault(require("semver"));

@@ -0,5 +1,5 @@

export * from './adapters';
export * from './cross-chain-messenger';
export * from './interfaces';
export * from './l2-provider';
export * from './utils';
export * from './cross-chain-messenger';
export * from './adapters';
export * from './l2-provider';

@@ -17,7 +17,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./adapters"), exports);
__exportStar(require("./cross-chain-messenger"), exports);
__exportStar(require("./interfaces"), exports);
__exportStar(require("./l2-provider"), exports);
__exportStar(require("./utils"), exports);
__exportStar(require("./cross-chain-messenger"), exports);
__exportStar(require("./adapters"), exports);
__exportStar(require("./l2-provider"), exports);
//# sourceMappingURL=index.js.map

@@ -1,5 +0,5 @@

import { Contract, Overrides, Signer, BigNumber, CallOverrides, PayableOverrides } from 'ethers';
import { TransactionRequest, TransactionResponse, BlockTag } from '@ethersproject/abstract-provider';
import { NumberLike, AddressLike, TokenBridgeMessage } from './types';
import { CrossChainMessenger } from '../cross-chain-messenger';
import type { BlockTag, TransactionRequest, TransactionResponse } from '@ethersproject/abstract-provider';
import type { BigNumber, CallOverrides, Contract, Overrides, PayableOverrides, Signer } from 'ethers';
import type { CrossChainMessenger } from '../cross-chain-messenger';
import type { AddressLike, NumberLike, TokenBridgeMessage } from './types';
export interface IBridgeAdapter {

@@ -6,0 +6,0 @@ messenger: CrossChainMessenger;

@@ -1,3 +0,3 @@

import { Provider, TransactionRequest, TransactionResponse, Block, BlockWithTransactions } from '@ethersproject/abstract-provider';
import { BigNumber } from 'ethers';
import type { Block, BlockWithTransactions, Provider, TransactionRequest, TransactionResponse } from '@ethersproject/abstract-provider';
import type { BigNumber } from 'ethers';
export interface L2Transaction extends TransactionResponse {

@@ -4,0 +4,0 @@ l1BlockNumber: number;

@@ -1,6 +0,6 @@

import { Provider, TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider';
import { Signer } from '@ethersproject/abstract-signer';
import { Contract, BigNumber } from 'ethers';
import { CrossChainMessenger } from '../cross-chain-messenger';
import { IBridgeAdapter } from './bridge-adapter';
import type { Provider, TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider';
import type { Signer } from '@ethersproject/abstract-signer';
import type { BigNumber, Contract } from 'ethers';
import type { CrossChainMessenger } from '../cross-chain-messenger';
import type { IBridgeAdapter } from './bridge-adapter';
export declare enum L1ChainID {

@@ -7,0 +7,0 @@ MAINNET = 1,

@@ -1,4 +0,4 @@

import { Provider, TransactionRequest } from '@ethersproject/abstract-provider';
import type { Provider, TransactionRequest } from '@ethersproject/abstract-provider';
import { BigNumber } from 'ethers';
import { L2Provider, ProviderLike } from './interfaces';
import type { L2Provider, ProviderLike } from './interfaces';
export declare const getL1GasPrice: (l2Provider: ProviderLike) => Promise<BigNumber>;

@@ -5,0 +5,0 @@ export declare const estimateL1Gas: (l2Provider: ProviderLike, tx: TransactionRequest) => Promise<BigNumber>;

@@ -7,8 +7,8 @@ "use strict";

exports.asL2Provider = exports.isL2Provider = exports.estimateTotalGasCost = exports.estimateL2GasCost = exports.estimateL1GasCost = exports.estimateL1Gas = exports.getL1GasPrice = void 0;
const contracts_1 = require("@eth-optimism/contracts");
const transactions_1 = require("@ethersproject/transactions");
const ethers_1 = require("ethers");
const contracts_1 = require("@eth-optimism/contracts");
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
const utils_1 = require("./utils");
const assert_1 = require("./utils/assert");
const utils_1 = require("./utils");
const getNonceForTx = async (provider, tx) => {

@@ -15,0 +15,0 @@ if (tx.nonce !== undefined) {

@@ -1,2 +0,3 @@

import { L1ChainID, L2ChainID, OEContractsLike, OEL2ContractsLike, BridgeAdapterData } from '../interfaces';
import type { BridgeAdapterData, OEContractsLike, OEL2ContractsLike } from '../interfaces';
import { L1ChainID, L2ChainID } from '../interfaces';
export declare const DEPOSIT_CONFIRMATION_BLOCKS: {

@@ -3,0 +4,0 @@ [ChainID in L2ChainID]: number;

@@ -6,2 +6,4 @@ "use strict";

const ethers_1 = require("ethers");
const adapters_1 = require("../adapters");
const interfaces_1 = require("../interfaces");
const portalAddresses = {

@@ -33,3 +35,3 @@ mainnet: '0xbEb5Fc579115071764c7423A4f12eDde41f106Ed',

const disputeGameFactoryAddresses = {
mainnet: ethers_1.ethers.constants.AddressZero,
mainnet: '0xe5965Ab5962eDc7477C8520243A95517CD252fA9',
goerli: ethers_1.ethers.constants.AddressZero,

@@ -48,4 +50,2 @@ sepolia: '0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1',

};
const interfaces_1 = require("../interfaces");
const adapters_1 = require("../adapters");
exports.DEPOSIT_CONFIRMATION_BLOCKS = {

@@ -52,0 +52,0 @@ [interfaces_1.L2ChainID.OPTIMISM]: 50,

import { Provider } from '@ethersproject/abstract-provider';
import { Signer } from '@ethersproject/abstract-signer';
import { ethers, BigNumber } from 'ethers';
import { SignerOrProviderLike, ProviderLike, TransactionLike, NumberLike, AddressLike } from '../interfaces';
import type { BigNumber } from 'ethers';
import { ethers } from 'ethers';
import type { AddressLike, NumberLike, ProviderLike, SignerOrProviderLike, TransactionLike } from '../interfaces';
export declare const toSignerOrProvider: (signerOrProvider: SignerOrProviderLike) => Signer | Provider;

@@ -6,0 +7,0 @@ export declare const toProvider: (provider: ProviderLike) => Provider;

@@ -1,5 +0,5 @@

import { ethers, Contract } from 'ethers';
import { DeepPartial } from './type-utils';
import { CrossChainMessenger } from '../cross-chain-messenger';
import { OEContracts, OEL1Contracts, OEL2Contracts, OEContractsLike, AddressLike, BridgeAdapters, BridgeAdapterData } from '../interfaces';
import { Contract, ethers } from 'ethers';
import type { CrossChainMessenger } from '../cross-chain-messenger';
import type { AddressLike, BridgeAdapterData, BridgeAdapters, OEContracts, OEContractsLike, OEL1Contracts, OEL2Contracts } from '../interfaces';
import type { DeepPartial } from './type-utils';
export declare const getContractInterfaceBedrock: (name: string) => ethers.utils.Interface;

@@ -6,0 +6,0 @@ export declare const getOEContract: (contractName: keyof OEL1Contracts | keyof OEL2Contracts, l2ChainId: number, opts?: {

@@ -9,22 +9,22 @@ "use strict";

const ethers_1 = require("ethers");
const adapters_1 = require("../adapters");
const DisputeGameFactory_json_1 = __importDefault(require("../forge-artifacts/DisputeGameFactory.json"));
const FaultDisputeGame_json_1 = __importDefault(require("../forge-artifacts/FaultDisputeGame.json"));
const GasPriceOracle_json_1 = __importDefault(require("../forge-artifacts/GasPriceOracle.json"));
const L1Block_json_1 = __importDefault(require("../forge-artifacts/L1Block.json"));
const L1CrossDomainMessenger_json_1 = __importDefault(require("../forge-artifacts/L1CrossDomainMessenger.json"));
const L1ERC721Bridge_json_1 = __importDefault(require("../forge-artifacts/L1ERC721Bridge.json"));
const L1StandardBridge_json_1 = __importDefault(require("../forge-artifacts/L1StandardBridge.json"));
const L2CrossDomainMessenger_json_1 = __importDefault(require("../forge-artifacts/L2CrossDomainMessenger.json"));
const L2ERC721Bridge_json_1 = __importDefault(require("../forge-artifacts/L2ERC721Bridge.json"));
const L2OutputOracle_json_1 = __importDefault(require("../forge-artifacts/L2OutputOracle.json"));
const L2StandardBridge_json_1 = __importDefault(require("../forge-artifacts/L2StandardBridge.json"));
const L2ToL1MessagePasser_json_1 = __importDefault(require("../forge-artifacts/L2ToL1MessagePasser.json"));
const OptimismMintableERC20_json_1 = __importDefault(require("../forge-artifacts/OptimismMintableERC20.json"));
const OptimismMintableERC20Factory_json_1 = __importDefault(require("../forge-artifacts/OptimismMintableERC20Factory.json"));
const OptimismPortal_json_1 = __importDefault(require("../forge-artifacts/OptimismPortal.json"));
const L1CrossDomainMessenger_json_1 = __importDefault(require("../forge-artifacts/L1CrossDomainMessenger.json"));
const L2CrossDomainMessenger_json_1 = __importDefault(require("../forge-artifacts/L2CrossDomainMessenger.json"));
const OptimismMintableERC20Factory_json_1 = __importDefault(require("../forge-artifacts/OptimismMintableERC20Factory.json"));
const OptimismPortal2_json_1 = __importDefault(require("../forge-artifacts/OptimismPortal2.json"));
const ProxyAdmin_json_1 = __importDefault(require("../forge-artifacts/ProxyAdmin.json"));
const L2OutputOracle_json_1 = __importDefault(require("../forge-artifacts/L2OutputOracle.json"));
const L1ERC721Bridge_json_1 = __importDefault(require("../forge-artifacts/L1ERC721Bridge.json"));
const L2ERC721Bridge_json_1 = __importDefault(require("../forge-artifacts/L2ERC721Bridge.json"));
const L1Block_json_1 = __importDefault(require("../forge-artifacts/L1Block.json"));
const L2ToL1MessagePasser_json_1 = __importDefault(require("../forge-artifacts/L2ToL1MessagePasser.json"));
const GasPriceOracle_json_1 = __importDefault(require("../forge-artifacts/GasPriceOracle.json"));
const DisputeGameFactory_json_1 = __importDefault(require("../forge-artifacts/DisputeGameFactory.json"));
const OptimismPortal2_json_1 = __importDefault(require("../forge-artifacts/OptimismPortal2.json"));
const FaultDisputeGame_json_1 = __importDefault(require("../forge-artifacts/FaultDisputeGame.json"));
const chain_constants_1 = require("./chain-constants");
const coercion_1 = require("./coercion");
const adapters_1 = require("../adapters");
const chain_constants_1 = require("./chain-constants");
const NAME_REMAPPING = {

@@ -31,0 +31,0 @@ AddressManager: 'Lib_AddressManager',

@@ -0,7 +1,7 @@

export * from './chain-constants';
export * from './coercion';
export * from './contracts';
export * from './type-utils';
export * from './misc-utils';
export * from './merkle-utils';
export * from './chain-constants';
export * from './message-utils';
export * from './misc-utils';
export * from './type-utils';

@@ -17,9 +17,9 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./chain-constants"), exports);
__exportStar(require("./coercion"), exports);
__exportStar(require("./contracts"), exports);
__exportStar(require("./type-utils"), exports);
__exportStar(require("./misc-utils"), exports);
__exportStar(require("./merkle-utils"), exports);
__exportStar(require("./chain-constants"), exports);
__exportStar(require("./message-utils"), exports);
__exportStar(require("./misc-utils"), exports);
__exportStar(require("./type-utils"), exports);
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import { ethers, BigNumber } from 'ethers';
import { BigNumber, ethers } from 'ethers';
export declare const makeMerkleTreeProof: (leaves: string[], index: number) => string[];

@@ -3,0 +3,0 @@ export declare const maybeAddProofNode: (key: string, proof: string[]) => string[];

@@ -27,4 +27,4 @@ "use strict";

exports.makeStateTrieProof = exports.maybeAddProofNode = exports.makeMerkleTreeProof = void 0;
const core_utils_1 = require("@eth-optimism/core-utils");
const ethers_1 = require("ethers");
const core_utils_1 = require("@eth-optimism/core-utils");
const merkletreejs_1 = require("merkletreejs");

@@ -31,0 +31,0 @@ const rlp = __importStar(require("rlp"));

import { BigNumber } from 'ethers';
import { LowLevelMessage } from '../interfaces';
import type { LowLevelMessage } from '../interfaces';
export declare const hashLowLevelMessage: (message: LowLevelMessage) => string;
export declare const hashMessageHash: (messageHash: string) => string;
export declare const migratedWithdrawalGasLimit: (data: string, chainID: number) => BigNumber;
{
"name": "@eth-optimism/sdk",
"version": "3.3.1",
"version": "3.3.2",
"description": "[Optimism] Tools for working with Optimism",

@@ -16,3 +16,3 @@ "main": "dist/index",

],
"homepage": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/sdk#readme",
"homepage": "https://github.com/ethereum-optimism/ecosystem/tree/main/packages/sdk#readme",
"license": "MIT",

@@ -22,3 +22,3 @@ "author": "Optimism PBC",

"type": "git",
"url": "https://github.com/ethereum-optimism/optimism.git"
"url": "https://github.com/ethereum-optimism/ecosystem.git"
},

@@ -53,7 +53,7 @@ "devDependencies": {

"@eth-optimism/contracts": "0.6.0",
"@eth-optimism/core-utils": "^0.13.2",
"lodash": "^4.17.21",
"merkletreejs": "^0.3.11",
"rlp": "^2.2.7",
"semver": "^7.6.0",
"@eth-optimism/core-utils": "0.13.2"
"semver": "^7.6.0"
},

@@ -71,3 +71,3 @@ "peerDependencies": {

"pre-commit": "lint-staged",
"test": "hardhat test",
"test:sdk": "hardhat test",
"test:next": "vitest",

@@ -74,0 +74,0 @@ "test:next:run": "vitest run",

/* eslint-disable @typescript-eslint/no-unused-vars */
import { hexStringEquals } from '@eth-optimism/core-utils'
import { Contract } from 'ethers'
import { hexStringEquals } from '@eth-optimism/core-utils'
import { AddressLike } from '../interfaces'
import { toAddress } from '../utils'
import type { AddressLike } from '../interfaces'
import { toAddress } from '../utils/coercion'
import { StandardBridgeAdapter } from './standard-bridge'

@@ -8,0 +8,0 @@

/* eslint-disable @typescript-eslint/no-unused-vars */
import { hexStringEquals } from '@eth-optimism/core-utils'
import { Contract } from 'ethers'
import { hexStringEquals } from '@eth-optimism/core-utils'
import { AddressLike } from '../interfaces'
import { toAddress } from '../utils'
import type { AddressLike } from '../interfaces'
import { toAddress } from '../utils/coercion'
import { StandardBridgeAdapter } from './standard-bridge'

@@ -8,0 +8,0 @@

/* eslint-disable @typescript-eslint/no-unused-vars */
import { ethers, Overrides, BigNumber } from 'ethers'
import { TransactionRequest, BlockTag } from '@ethersproject/abstract-provider'
import { predeploys } from '@eth-optimism/contracts'
import { hexStringEquals } from '@eth-optimism/core-utils'
import type { BlockTag,TransactionRequest } from '@ethersproject/abstract-provider'
import type { BigNumber,Overrides } from 'ethers';
import { ethers } from 'ethers'
import type {
AddressLike,
NumberLike,
TokenBridgeMessage} from '../interfaces';
import {
NumberLike,
AddressLike,
TokenBridgeMessage,
MessageDirection,
} from '../interfaces'
import { toAddress, omit } from '../utils'
import { toAddress } from '../utils/coercion'
import { omit } from '../utils/misc-utils'
import { StandardBridgeAdapter } from './standard-bridge'

@@ -15,0 +18,0 @@

@@ -1,4 +0,4 @@

export * from './standard-bridge'
export * from './eth-bridge'
export * from './dai-bridge'
export * from './eco-bridge'
export * from './eth-bridge'
export * from './standard-bridge'
/* eslint-disable @typescript-eslint/no-unused-vars */
import {
ethers,
Contract,
Overrides,
Signer,
BigNumber,
CallOverrides,
} from 'ethers'
import {
import { predeploys } from '@eth-optimism/contracts'
import { hexStringEquals } from '@eth-optimism/core-utils'
import type {
BlockTag,
TransactionRequest,
TransactionResponse,
BlockTag,
} from '@ethersproject/abstract-provider'
import { predeploys } from '@eth-optimism/contracts'
import { hexStringEquals } from '@eth-optimism/core-utils'
import type {
BigNumber,
CallOverrides, Overrides,
Signer} from 'ethers';
import {
Contract,
ethers} from 'ethers'
import type { CrossChainMessenger } from '../cross-chain-messenger'
import l1StandardBridgeArtifact from '../forge-artifacts/L1StandardBridge.json'
import l2StandardBridgeArtifact from '../forge-artifacts/L2StandardBridge.json'
import optimismMintableERC20 from '../forge-artifacts/OptimismMintableERC20.json'
import { CrossChainMessenger } from '../cross-chain-messenger'
import {
import type {
AddressLike,
IBridgeAdapter,
NumberLike,
AddressLike,
TokenBridgeMessage,
TokenBridgeMessage} from '../interfaces';
import {
MessageDirection,
} from '../interfaces'
import { toAddress } from '../utils'
import { toAddress } from '../utils/coercion'

@@ -41,3 +41,2 @@ /**

* Creates a StandardBridgeAdapter instance.
*
* @param opts Options for the adapter.

@@ -44,0 +43,0 @@ * @param opts.messenger Provider used to make queries related to cross-chain interactions.

@@ -0,5 +1,5 @@

export * from './adapters'
export * from './cross-chain-messenger'
export * from './interfaces'
export * from './l2-provider'
export * from './utils'
export * from './cross-chain-messenger'
export * from './adapters'
export * from './l2-provider'

@@ -1,17 +0,17 @@

import {
import type {
BlockTag,
TransactionRequest,
TransactionResponse,
} from '@ethersproject/abstract-provider'
import type {
BigNumber,
CallOverrides,
Contract,
Overrides,
PayableOverrides,
Signer,
BigNumber,
CallOverrides,
PayableOverrides,
} from 'ethers'
import {
TransactionRequest,
TransactionResponse,
BlockTag,
} from '@ethersproject/abstract-provider'
import { NumberLike, AddressLike, TokenBridgeMessage } from './types'
import { CrossChainMessenger } from '../cross-chain-messenger'
import type { CrossChainMessenger } from '../cross-chain-messenger'
import type { AddressLike, NumberLike, TokenBridgeMessage } from './types'

@@ -40,3 +40,2 @@ /**

* Gets all deposits for a given address.
*
* @param address Address to search for messages from.

@@ -60,3 +59,2 @@ * @param opts Options object.

* Gets all withdrawals for a given address.
*
* @param address Address to search for messages from.

@@ -80,3 +78,2 @@ * @param opts Options object.

* Checks whether the given token pair is supported by the bridge.
*
* @param l1Token The L1 token address.

@@ -93,3 +90,2 @@ * @param l2Token The L2 token address.

* Queries the account's approval amount for a given L1 token.
*
* @param l1Token The L1 token address.

@@ -108,3 +104,2 @@ * @param l2Token The L2 token address.

* Approves a deposit into the L2 chain.
*
* @param l1Token The L1 token address.

@@ -130,3 +125,2 @@ * @param l2Token The L2 token address.

* Deposits some tokens into the L2 chain.
*
* @param l1Token The L1 token address.

@@ -156,3 +150,2 @@ * @param l2Token The L2 token address.

* Withdraws some tokens back to the L1 chain.
*
* @param l1Token The L1 token address.

@@ -185,3 +178,2 @@ * @param l2Token The L2 token address.

* Generates a transaction for approving some tokens to deposit into the L2 chain.
*
* @param l1Token The L1 token address.

@@ -205,3 +197,2 @@ * @param l2Token The L2 token address.

* Generates a transaction for depositing some tokens into the L2 chain.
*
* @param l1Token The L1 token address.

@@ -229,3 +220,2 @@ * @param l2Token The L2 token address.

* Generates a transaction for withdrawing some tokens back to the L1 chain.
*
* @param l1Token The L1 token address.

@@ -257,3 +247,2 @@ * @param l2Token The L2 token address.

* Estimates gas required to approve some tokens to deposit into the L2 chain.
*
* @param l1Token The L1 token address.

@@ -277,3 +266,2 @@ * @param l2Token The L2 token address.

* Estimates gas required to deposit some tokens into the L2 chain.
*
* @param l1Token The L1 token address.

@@ -301,3 +289,2 @@ * @param l2Token The L2 token address.

* Estimates gas required to withdraw some tokens back to the L1 chain.
*
* @param l1Token The L1 token address.

@@ -304,0 +291,0 @@ * @param l2Token The L2 token address.

@@ -1,9 +0,9 @@

import {
import type {
Block,
BlockWithTransactions,
Provider,
TransactionRequest,
TransactionResponse,
Block,
BlockWithTransactions,
} from '@ethersproject/abstract-provider'
import { BigNumber } from 'ethers'
import type { BigNumber } from 'ethers'

@@ -46,3 +46,2 @@ /**

* Gets the current L1 (data) gas price.
*
* @returns Current L1 data gas price in wei.

@@ -54,3 +53,2 @@ */

* Estimates the L1 (data) gas required for a transaction.
*
* @param tx Transaction to estimate L1 gas for.

@@ -64,3 +62,2 @@ * @returns Estimated L1 gas.

* cost by the current L1 gas price.
*
* @param tx Transaction to estimate L1 gas cost for.

@@ -75,3 +72,2 @@ * @returns Estimated L1 gas cost.

* getGasPrice and estimateGas for the given transaction request.
*
* @param tx Transaction to estimate L2 gas cost for.

@@ -85,3 +81,2 @@ * @returns Estimated L2 gas cost.

* and the estimated L2 gas cost.
*
* @param tx Transaction to estimate total gas cost for.

@@ -88,0 +83,0 @@ * @returns Estimated total gas cost.

@@ -1,2 +0,2 @@

import {
import type {
Provider,

@@ -6,7 +6,7 @@ TransactionReceipt,

} from '@ethersproject/abstract-provider'
import { Signer } from '@ethersproject/abstract-signer'
import { Contract, BigNumber } from 'ethers'
import type { Signer } from '@ethersproject/abstract-signer'
import type { BigNumber,Contract } from 'ethers'
import { CrossChainMessenger } from '../cross-chain-messenger'
import { IBridgeAdapter } from './bridge-adapter'
import type { CrossChainMessenger } from '../cross-chain-messenger'
import type { IBridgeAdapter } from './bridge-adapter'

@@ -13,0 +13,0 @@ /**

@@ -1,10 +0,10 @@

import { Provider, TransactionRequest } from '@ethersproject/abstract-provider'
import { getContractInterface,predeploys } from '@eth-optimism/contracts'
import type { Provider, TransactionRequest } from '@ethersproject/abstract-provider'
import { serialize } from '@ethersproject/transactions'
import { Contract, BigNumber } from 'ethers'
import { predeploys, getContractInterface } from '@eth-optimism/contracts'
import { BigNumber,Contract } from 'ethers'
import cloneDeep from 'lodash/cloneDeep'
import type { L2Provider, NumberLike,ProviderLike } from './interfaces'
import { toBigNumber,toNumber, toProvider } from './utils'
import { assert } from './utils/assert'
import { L2Provider, ProviderLike, NumberLike } from './interfaces'
import { toProvider, toNumber, toBigNumber } from './utils'

@@ -15,3 +15,2 @@ type ProviderTypeIsWrong = any

* Gets a reasonable nonce for the transaction.
*
* @param provider Provider to get the nonce from.

@@ -37,3 +36,2 @@ * @param tx Requested transaction.

* Returns a Contract object for the GasPriceOracle.
*
* @param provider Provider to attach the contract to.

@@ -52,3 +50,2 @@ * @returns Contract object for the GasPriceOracle.

* Gets the current L1 gas price as seen on L2.
*
* @param l2Provider L2 provider to query the L1 gas price from.

@@ -66,3 +63,2 @@ * @returns Current L1 gas price as seen on L2.

* Estimates the amount of L1 gas required for a given L2 transaction.
*
* @param l2Provider L2 provider to query the gas usage from.

@@ -98,3 +94,2 @@ * @param tx Transaction to estimate L1 gas for.

* Estimates the amount of L1 gas cost for a given L2 transaction in wei.
*
* @param l2Provider L2 provider to query the gas usage from.

@@ -130,3 +125,2 @@ * @param tx Transaction to estimate L1 gas cost for.

* Estimates the L2 gas cost for a given L2 transaction in wei.
*
* @param l2Provider L2 provider to query the gas usage from.

@@ -148,3 +142,2 @@ * @param tx Transaction to estimate L2 gas cost for.

* Estimates the total gas cost for a given L2 transaction in wei.
*
* @param l2Provider L2 provider to query the gas usage from.

@@ -166,3 +159,2 @@ * @param tx Transaction to estimate total gas cost for.

* if true
*
* @param provider The provider to check

@@ -186,3 +178,2 @@ * @returns Boolean

* of the original provider.
*
* @param provider Provider to wrap into an L2 provider.

@@ -189,0 +180,0 @@ * @returns Provider wrapped as an L2 provider.

import { predeploys } from '@eth-optimism/core-utils'
import { ethers } from 'ethers'
import {
DAIBridgeAdapter,
ECOBridgeAdapter,
StandardBridgeAdapter,
} from '../adapters'
import type {
BridgeAdapterData,
OEContractsLike,
OEL1ContractsLike,
OEL2ContractsLike} from '../interfaces';
import {
L1ChainID,
L2ChainID
} from '../interfaces'
// The addresses below should be for the proxy if it is a proxied contract.

@@ -37,3 +52,3 @@

const disputeGameFactoryAddresses = {
mainnet: ethers.constants.AddressZero,
mainnet: '0xe5965Ab5962eDc7477C8520243A95517CD252fA9',
goerli: ethers.constants.AddressZero,

@@ -57,16 +72,2 @@ sepolia: '0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1',

import {
L1ChainID,
L2ChainID,
OEContractsLike,
OEL1ContractsLike,
OEL2ContractsLike,
BridgeAdapterData,
} from '../interfaces'
import {
StandardBridgeAdapter,
DAIBridgeAdapter,
ECOBridgeAdapter,
} from '../adapters'
export const DEPOSIT_CONFIRMATION_BLOCKS: {

@@ -119,3 +120,2 @@ [ChainID in L2ChainID]: number

* Loads the L1 contracts for a given network by the network name.
*
* @param network The name of the network to load the contracts for.

@@ -122,0 +122,0 @@ * @returns The L1 contracts for the given network.

@@ -0,17 +1,19 @@

import type {
TransactionReceipt,
TransactionResponse} from '@ethersproject/abstract-provider';
import {
Provider,
TransactionReceipt,
TransactionResponse,
Provider
} from '@ethersproject/abstract-provider'
import { Signer } from '@ethersproject/abstract-signer'
import { ethers, BigNumber } from 'ethers'
import type { BigNumber } from 'ethers';
import { ethers } from 'ethers'
import { assert } from './assert'
import {
import type {
AddressLike,
NumberLike,
ProviderLike,
SignerOrProviderLike,
ProviderLike,
TransactionLike,
NumberLike,
AddressLike,
} from '../interfaces'
import { assert } from './assert'

@@ -21,3 +23,2 @@ /**

* string then it is a JSON-RPC url.
*
* @param signerOrProvider SignerOrProviderLike to turn into a Signer or Provider.

@@ -43,3 +44,2 @@ * @returns Input as a Signer or Provider.

* JSON-RPC url.
*
* @param provider ProviderLike to turn into a Provider.

@@ -60,3 +60,2 @@ * @returns Input as a Provider.

* Converts a ProviderLike into a JsonRpcProvider.
*
* @param provider ProviderLike to turn into a JsonRpcProvider.

@@ -81,3 +80,2 @@ * @returns Input as a JsonRpcProvider.

* Pulls a transaction hash out of a TransactionLike object.
*
* @param transaction TransactionLike to convert into a transaction hash.

@@ -104,3 +102,2 @@ * @returns Transaction hash corresponding to the TransactionLike input.

* Converts a number-like into an ethers BigNumber.
*
* @param num Number-like to convert into a BigNumber.

@@ -115,3 +112,2 @@ * @returns Number-like as a BigNumber.

* Converts a number-like into a number.
*
* @param num Number-like to convert into a number.

@@ -126,3 +122,2 @@ * @returns Number-like as a number.

* Converts an address-like into a 0x-prefixed address string.
*
* @param addr Address-like to convert into an address.

@@ -129,0 +124,0 @@ * @returns Address-like as an address.

import { getContractInterface, predeploys } from '@eth-optimism/contracts'
import { ethers, Contract } from 'ethers'
import { Contract,ethers } from 'ethers'
import { ETHBridgeAdapter,StandardBridgeAdapter } from '../adapters'
import type { CrossChainMessenger } from '../cross-chain-messenger'
import disputeGameFactory from '../forge-artifacts/DisputeGameFactory.json'
import faultDisputeGame from '../forge-artifacts/FaultDisputeGame.json'
import gasPriceOracle from '../forge-artifacts/GasPriceOracle.json'
import l1Block from '../forge-artifacts/L1Block.json'
import l1CrossDomainMessenger from '../forge-artifacts/L1CrossDomainMessenger.json'
import l1ERC721Bridge from '../forge-artifacts/L1ERC721Bridge.json'
import l1StandardBridge from '../forge-artifacts/L1StandardBridge.json'
import l2CrossDomainMessenger from '../forge-artifacts/L2CrossDomainMessenger.json'
import l2ERC721Bridge from '../forge-artifacts/L2ERC721Bridge.json'
import l2OutputOracle from '../forge-artifacts/L2OutputOracle.json'
import l2StandardBridge from '../forge-artifacts/L2StandardBridge.json'
import l2ToL1MessagePasser from '../forge-artifacts/L2ToL1MessagePasser.json'
import optimismMintableERC20 from '../forge-artifacts/OptimismMintableERC20.json'
import optimismMintableERC20Factory from '../forge-artifacts/OptimismMintableERC20Factory.json'
import optimismPortal from '../forge-artifacts/OptimismPortal.json'
import l1CrossDomainMessenger from '../forge-artifacts/L1CrossDomainMessenger.json'
import l2CrossDomainMessenger from '../forge-artifacts/L2CrossDomainMessenger.json'
import optimismMintableERC20Factory from '../forge-artifacts/OptimismMintableERC20Factory.json'
import optimismPortal2 from '../forge-artifacts/OptimismPortal2.json'
import proxyAdmin from '../forge-artifacts/ProxyAdmin.json'
import l2OutputOracle from '../forge-artifacts/L2OutputOracle.json'
import l1ERC721Bridge from '../forge-artifacts/L1ERC721Bridge.json'
import l2ERC721Bridge from '../forge-artifacts/L2ERC721Bridge.json'
import l1Block from '../forge-artifacts/L1Block.json'
import l2ToL1MessagePasser from '../forge-artifacts/L2ToL1MessagePasser.json'
import gasPriceOracle from '../forge-artifacts/GasPriceOracle.json'
import disputeGameFactory from '../forge-artifacts/DisputeGameFactory.json'
import optimismPortal2 from '../forge-artifacts/OptimismPortal2.json'
import faultDisputeGame from '../forge-artifacts/FaultDisputeGame.json'
import { toAddress } from './coercion'
import { DeepPartial } from './type-utils'
import { CrossChainMessenger } from '../cross-chain-messenger'
import { StandardBridgeAdapter, ETHBridgeAdapter } from '../adapters'
import type {
AddressLike,
BridgeAdapterData,
BridgeAdapters,
OEContracts,
OEContractsLike,
OEL1Contracts,
OEL2Contracts,
} from '../interfaces'
import {
BRIDGE_ADAPTER_DATA,
CONTRACT_ADDRESSES,
DEFAULT_L2_CONTRACT_ADDRESSES,
BRIDGE_ADAPTER_DATA,
IGNORABLE_CONTRACTS,
} from './chain-constants'
import {
OEContracts,
OEL1Contracts,
OEL2Contracts,
OEContractsLike,
AddressLike,
BridgeAdapters,
BridgeAdapterData,
} from '../interfaces'
import { toAddress } from './coercion'
import type { DeepPartial } from './type-utils'

@@ -121,3 +121,2 @@ /**

* function will throw an error.
*
* @param contractName Name of the contract to connect to.

@@ -177,3 +176,2 @@ * @param l2ChainId Chain ID for the L2 network.

* function will throw an error.
*
* @param l2ChainId Chain ID for the L2 network.

@@ -245,3 +243,2 @@ * @param opts Additional options for connecting to the contracts.

* Gets a series of bridge adapters for the given L2 chain ID.
*
* @param l2ChainId Chain ID for the L2 network.

@@ -248,0 +245,0 @@ * @param messenger Cross chain messenger to connect to the bridge adapters

@@ -0,7 +1,7 @@

export * from './chain-constants'
export * from './coercion'
export * from './contracts'
export * from './type-utils'
export * from './misc-utils'
export * from './merkle-utils'
export * from './chain-constants'
export * from './message-utils'
export * from './misc-utils'
export * from './type-utils'
/* Imports: External */
import { ethers, BigNumber } from 'ethers'
import {

@@ -8,2 +7,3 @@ fromHexString,

} from '@eth-optimism/core-utils'
import { BigNumber,ethers } from 'ethers'
import { MerkleTree } from 'merkletreejs'

@@ -14,3 +14,2 @@ import * as rlp from 'rlp'

* Generates a Merkle proof (using the particular scheme we use within Lib_MerkleTree).
*
* @param leaves Leaves of the merkle tree.

@@ -54,3 +53,2 @@ * @param index Index to generate a proof for.

* natively so we instead append an extra proof element to handle it instead.
*
* @param key Key that the proof is for.

@@ -89,3 +87,2 @@ * @param proof Proof to potentially modify.

* Generates a Merkle-Patricia trie proof for a given account and storage slot.
*
* @param provider RPC provider attached to an EVM-compatible chain.

@@ -92,0 +89,0 @@ * @param blockNumber Block number to generate the proof at.

import { hashWithdrawal } from '@eth-optimism/core-utils'
import { BigNumber, utils, ethers } from 'ethers'
import { BigNumber, ethers,utils } from 'ethers'
import { LowLevelMessage } from '../interfaces'
import type { LowLevelMessage } from '../interfaces'

@@ -19,3 +19,2 @@ const { hexDataLength } = utils

* Utility for hashing a LowLevelMessage object.
*
* @param message LowLevelMessage object to hash.

@@ -39,3 +38,2 @@ * @returns Hash of the given LowLevelMessage.

* because the first mapping in the contract is used.
*
* @param messageHash Message hash to hash.

@@ -42,0 +40,0 @@ * @returns Hash of the given message hash.

@@ -6,3 +6,2 @@ // TODO: A lot of this stuff could probably live in core-utils instead.

* Returns a copy of the given object ({ ...obj }) with the given keys omitted.
*
* @param obj Object to return with the keys omitted.

@@ -9,0 +8,0 @@ * @param keys Keys to omit from the returned object.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc