diff --git a/README.md b/README.md index 7598291c..59d0dde9 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ yarn add @imtbl/core-sdk Initialize the Core SDK client with the network on which you want your application to run (see [all networks available](./src/config/config.ts)): | Param | Description | | -- | -- | -| `Config.SANDBOX` | The default test network (currently, it is Goƫrli) | +| `Config.SANDBOX` | The default test network (currently, it is Sepolia) | | `Config.PRODUCTION` | Ethereum network | ```ts @@ -99,13 +99,13 @@ ImmutableX provides two Stark key generation methods: If your user has a Stark key that was generated using the deterministic method, the Core SDK provides a way for you to retrieve this key using the [generateLegacyStarkPrivateKey()](https://github.com/immutable/imx-core-sdk/blob/83f800956f541f338b3267ec7cb16e039182dfa6/src/utils/stark/starkCurve.ts#L152) method: ```ts -import { AlchemyProvider } from '@ethersproject/providers'; +import { EtherscanProvider } from '@ethersproject/providers'; import { Wallet } from '@ethersproject/wallet'; import { generateLegacyStarkPrivateKey } from '@imtbl/core-sdk'; // Create Ethereum signer -const ethNetwork = 'goerli'; // Or 'mainnet' -const provider = new AlchemyProvider(ethNetwork, YOUR_ALCHEMY_API_KEY); +const ethNetwork = 'sepolia'; // Or 'mainnet' +const provider = new EtherscanProvider(ethNetwork, ETHERSCAN_API_KEY); const ethSigner = new Wallet(YOUR_PRIVATE_ETH_KEY).connect(provider); // Get the legacy Stark private key @@ -161,13 +161,13 @@ The second option provides an application with an interface to the user's accoun The Core SDK provides functionality for applications to generate Stark (L2) [signers](/src/utils/stark/starkSigner.ts#L60). ```ts -import { AlchemyProvider } from '@ethersproject/providers'; +import { EtherscanProvider } from '@ethersproject/providers'; import { Wallet } from '@ethersproject/wallet'; import { createStarkSigner } from '@imtbl/core-sdk'; // Create Ethereum signer -const ethNetwork = 'goerli'; // Or 'mainnet' -const provider = new AlchemyProvider(ethNetwork, YOUR_ALCHEMY_API_KEY); +const ethNetwork = 'sepolia'; // Or 'mainnet' +const provider = new EtherscanProvider(ethNetwork, ETHERSCAN_API_KEY); const ethSigner = new Wallet(YOUR_PRIVATE_ETH_KEY).connect(provider); // Create Stark signer diff --git a/examples/.env.example b/examples/.env.example index d8640992..be4f446b 100644 --- a/examples/.env.example +++ b/examples/.env.example @@ -1,3 +1,3 @@ PRIVATE_KEY= STARK_PRIVATE_KEY= -ALCHEMY_API_KEY= +ETHERSCAN_API_KEY= diff --git a/examples/addMetadataSchemaToCollection.ts b/examples/addMetadataSchemaToCollection.ts index 0df2a33e..16e1c42f 100644 --- a/examples/addMetadataSchemaToCollection.ts +++ b/examples/addMetadataSchemaToCollection.ts @@ -6,7 +6,7 @@ import { import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/cancelOrder.ts b/examples/cancelOrder.ts index ddf1e801..735e4551 100644 --- a/examples/cancelOrder.ts +++ b/examples/cancelOrder.ts @@ -6,7 +6,7 @@ import { import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/completeErc20Withdrawal.ts b/examples/completeErc20Withdrawal.ts index ec4f7176..d82cb1d1 100644 --- a/examples/completeErc20Withdrawal.ts +++ b/examples/completeErc20Withdrawal.ts @@ -3,7 +3,7 @@ import { generateWalletConnection } from './libs/walletConnection'; (async () => { try { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const client = new ImmutableX(Config.SANDBOX); diff --git a/examples/completeEthWithdrawal.ts b/examples/completeEthWithdrawal.ts index 5d1e01aa..3fb91384 100644 --- a/examples/completeEthWithdrawal.ts +++ b/examples/completeEthWithdrawal.ts @@ -3,7 +3,7 @@ import { generateWalletConnection } from './libs/walletConnection'; (async () => { try { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const client = new ImmutableX(Config.SANDBOX); diff --git a/examples/completeNftWithdrawal.ts b/examples/completeNftWithdrawal.ts index 48de141f..29550bb1 100644 --- a/examples/completeNftWithdrawal.ts +++ b/examples/completeNftWithdrawal.ts @@ -3,7 +3,7 @@ import { generateWalletConnection } from './libs/walletConnection'; (async () => { try { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const client = new ImmutableX(Config.SANDBOX); diff --git a/examples/createCollection.ts b/examples/createCollection.ts index 6856d56f..2c5ab6f6 100644 --- a/examples/createCollection.ts +++ b/examples/createCollection.ts @@ -1,13 +1,13 @@ -import { AlchemyProvider } from '@ethersproject/providers'; +import { EtherscanProvider } from '@ethersproject/providers'; import { Wallet } from '@ethersproject/wallet'; import { ImmutableX, Config, CreateCollectionRequest } from '@imtbl/core-sdk'; import { requireEnvironmentVariable } from './libs/utils'; (async () => { const privateKey = requireEnvironmentVariable('PRIVATE_KEY'); - const alchemyKey = requireEnvironmentVariable('ALCHEMY_API_KEY'); + const etherscanKey = requireEnvironmentVariable('ETHERSCAN_API_KEY'); const wallet = new Wallet(privateKey); - const provider = new AlchemyProvider('goerli', alchemyKey); + const provider = new EtherscanProvider('sepolia', etherscanKey); const signer = wallet.connect(provider); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/createErc20Withdrawal.ts b/examples/createErc20Withdrawal.ts index 6690c0cf..1ef54f59 100644 --- a/examples/createErc20Withdrawal.ts +++ b/examples/createErc20Withdrawal.ts @@ -3,7 +3,7 @@ import { generateWalletConnection } from './libs/walletConnection'; (async () => { try { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const client = new ImmutableX(Config.SANDBOX); diff --git a/examples/createEthWithdrawal.ts b/examples/createEthWithdrawal.ts index e3a25609..de6c50fd 100644 --- a/examples/createEthWithdrawal.ts +++ b/examples/createEthWithdrawal.ts @@ -3,7 +3,7 @@ import { generateWalletConnection } from './libs/walletConnection'; (async () => { try { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const client = new ImmutableX(Config.SANDBOX); diff --git a/examples/createExchangeTransfer.ts b/examples/createExchangeTransfer.ts index b643ac20..e563df87 100644 --- a/examples/createExchangeTransfer.ts +++ b/examples/createExchangeTransfer.ts @@ -6,7 +6,7 @@ import { import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/createMetadataRefresh.ts b/examples/createMetadataRefresh.ts index a0f15b35..32adf3de 100644 --- a/examples/createMetadataRefresh.ts +++ b/examples/createMetadataRefresh.ts @@ -6,7 +6,7 @@ import { import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/createNftWithdrawal.ts b/examples/createNftWithdrawal.ts index b8e43cb3..6fc7ea5a 100644 --- a/examples/createNftWithdrawal.ts +++ b/examples/createNftWithdrawal.ts @@ -3,7 +3,7 @@ import { generateWalletConnection } from './libs/walletConnection'; (async () => { try { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const client = new ImmutableX(Config.SANDBOX); diff --git a/examples/createOrder.ts b/examples/createOrder.ts index 9f66ef39..daabd7e0 100644 --- a/examples/createOrder.ts +++ b/examples/createOrder.ts @@ -2,7 +2,7 @@ import { Config, ImmutableX, UnsignedOrderRequest } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/createProject.ts b/examples/createProject.ts index d0191705..7c95d7f1 100644 --- a/examples/createProject.ts +++ b/examples/createProject.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config, CreateProjectRequest } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/createTrade.ts b/examples/createTrade.ts index 940fa5c4..8bb676d1 100644 --- a/examples/createTrade.ts +++ b/examples/createTrade.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config, GetSignableTradeRequest } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/depositEth.ts b/examples/depositEth.ts index 997de6f5..70eec68a 100644 --- a/examples/depositEth.ts +++ b/examples/depositEth.ts @@ -3,7 +3,7 @@ import { generateWalletConnection } from './libs/walletConnection'; (async () => { try { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); // IMX class client const client = new ImmutableX(Config.SANDBOX); diff --git a/examples/depositNft.ts b/examples/depositNft.ts index f5b2cb25..787e1482 100644 --- a/examples/depositNft.ts +++ b/examples/depositNft.ts @@ -3,7 +3,7 @@ import { generateWalletConnection } from './libs/walletConnection'; (async () => { try { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); // IMX class client const client = new ImmutableX(Config.SANDBOX); diff --git a/examples/getMetadataRefreshErrors.ts b/examples/getMetadataRefreshErrors.ts index 06f32f20..cf07a1d5 100644 --- a/examples/getMetadataRefreshErrors.ts +++ b/examples/getMetadataRefreshErrors.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/getMetadataRefreshResults.ts b/examples/getMetadataRefreshResults.ts index 1363bfc9..fd5581f9 100644 --- a/examples/getMetadataRefreshResults.ts +++ b/examples/getMetadataRefreshResults.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/getProjects.ts b/examples/getProjects.ts index ab5724ee..572d0300 100644 --- a/examples/getProjects.ts +++ b/examples/getProjects.ts @@ -4,7 +4,7 @@ import { generateWalletConnection } from './libs/walletConnection'; (async () => { try { const client = new ImmutableX(Config.SANDBOX); - const wallet = await generateWalletConnection('goerli'); + const wallet = await generateWalletConnection('sepolia'); const pageSize = 200; const projects = await client.getProjects(wallet.ethSigner, pageSize); diff --git a/examples/libs/walletConnection.ts b/examples/libs/walletConnection.ts index 6b7bf811..25d00146 100644 --- a/examples/libs/walletConnection.ts +++ b/examples/libs/walletConnection.ts @@ -1,4 +1,4 @@ -import { AlchemyProvider } from '@ethersproject/providers'; +import { EtherscanProvider } from '@ethersproject/providers'; import { Wallet } from '@ethersproject/wallet'; import { createStarkSigner, WalletConnection } from '@imtbl/core-sdk'; import { requireEnvironmentVariable } from './utils'; @@ -11,10 +11,10 @@ export const generateWalletConnection = async ( ): Promise => { const userPrivateKey = requireEnvironmentVariable('PRIVATE_KEY'); const userStarkKey = requireEnvironmentVariable('STARK_PRIVATE_KEY'); - const alchemyKey = requireEnvironmentVariable('ALCHEMY_API_KEY'); + const etherscanKey = requireEnvironmentVariable('ETHERSCAN_API_KEY'); // connect provider - const provider = new AlchemyProvider(ethNetwork, alchemyKey); + const provider = new EtherscanProvider(ethNetwork, etherscanKey); // L1 credentials const ethSigner = new Wallet(userPrivateKey).connect(provider); diff --git a/examples/listMetadataRefreshes.ts b/examples/listMetadataRefreshes.ts index b072caab..9b428036 100644 --- a/examples/listMetadataRefreshes.ts +++ b/examples/listMetadataRefreshes.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/mint.ts b/examples/mint.ts index 309a168a..6b8a9f28 100644 --- a/examples/mint.ts +++ b/examples/mint.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config, UnsignedMintRequest } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/registerUser.ts b/examples/registerUser.ts index 5b2945a3..8bbd0c48 100644 --- a/examples/registerUser.ts +++ b/examples/registerUser.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/transferErc20.ts b/examples/transferErc20.ts index b9a83630..7c22df13 100644 --- a/examples/transferErc20.ts +++ b/examples/transferErc20.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/transferEth.ts b/examples/transferEth.ts index 35cf0b66..1f70f772 100644 --- a/examples/transferEth.ts +++ b/examples/transferEth.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/transferNfts.ts b/examples/transferNfts.ts index f0940f76..a440529b 100644 --- a/examples/transferNfts.ts +++ b/examples/transferNfts.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/examples/updateCollection.ts b/examples/updateCollection.ts index ef77a60a..8b7e2378 100644 --- a/examples/updateCollection.ts +++ b/examples/updateCollection.ts @@ -6,7 +6,7 @@ import { generateWalletConnection } from './libs/walletConnection'; // IMX class client const client = new ImmutableX(Config.SANDBOX); - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const collectionAddress = ''; // collection address diff --git a/examples/updateMetadataSchemaByName.ts b/examples/updateMetadataSchemaByName.ts index 968cd306..dab08cc9 100644 --- a/examples/updateMetadataSchemaByName.ts +++ b/examples/updateMetadataSchemaByName.ts @@ -2,7 +2,7 @@ import { ImmutableX, Config, MetadataSchemaRequest } from '@imtbl/core-sdk'; import { generateWalletConnection } from './libs/walletConnection'; (async () => { - const walletConnection = await generateWalletConnection('goerli'); + const walletConnection = await generateWalletConnection('sepolia'); const imxClient = new ImmutableX(Config.SANDBOX); diff --git a/src/utils/crypto/crypto.test.ts b/src/utils/crypto/crypto.test.ts index 9150edaa..dc08c167 100644 --- a/src/utils/crypto/crypto.test.ts +++ b/src/utils/crypto/crypto.test.ts @@ -4,7 +4,7 @@ import { Wallet } from '@ethersproject/wallet'; describe('signRaw()', () => { test('Correctly signs string', async () => { - const provider = getDefaultProvider('goerli', {}); + const provider = getDefaultProvider('sepolia', {}); const signer = new Wallet( '5c7b4b5cad9a3fc7b1ba235a49cd74e615488a18b0d6a531739fd1062935104d', ).connect(provider); @@ -19,7 +19,7 @@ describe('signRaw()', () => { describe('signMessage()', () => { test('Correctly signs message', async () => { - const provider = getDefaultProvider('goerli', {}); + const provider = getDefaultProvider('sepolia', {}); const signer = new Wallet( '5c7b4b5cad9a3fc7b1ba235a49cd74e615488a18b0d6a531739fd1062935104d', ).connect(provider);