Skip to content

Commit da2db6f

Browse files
authored
Merge pull request #853 from starknet-io/feat/sepolia
Sepolia network
2 parents 1d7bd73 + 4f59a8f commit da2db6f

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

src/constants.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@ export const ADDR_BOUND = 2n ** 251n - MAX_STORAGE_ITEM_SIZE;
2525
export enum BaseUrl {
2626
SN_MAIN = 'https://alpha-mainnet.starknet.io',
2727
SN_GOERLI = 'https://alpha4.starknet.io',
28+
SN_SEPOLIA = 'https://alpha-sepolia.starknet.io',
2829
}
2930

3031
export enum NetworkName {
3132
SN_MAIN = 'SN_MAIN',
3233
SN_GOERLI = 'SN_GOERLI',
34+
SN_SEPOLIA = 'SN_SEPOLIA',
3335
}
3436

3537
export enum StarknetChainId {
3638
SN_MAIN = '0x534e5f4d41494e', // encodeShortString('SN_MAIN'),
3739
SN_GOERLI = '0x534e5f474f45524c49', // encodeShortString('SN_GOERLI')
40+
SN_SEPOLIA = '0x534e5f5345504f4c4941', // encodeShortString('SN_SEPOLIA')
3841
}
3942

4043
export enum TransactionHashPrefix {
@@ -50,14 +53,19 @@ export const UDC = {
5053
ENTRYPOINT: 'deployContract',
5154
};
5255

53-
export const RPC_DEFAULT_VERSION = 'v0_5';
56+
export const RPC_DEFAULT_VERSION = 'v0_6';
5457

55-
export const RPC_GOERLI_NODES = [
56-
`https://starknet-testnet.public.blastapi.io/rpc/${RPC_DEFAULT_VERSION}`,
57-
`https://free-rpc.nethermind.io/goerli-juno/${RPC_DEFAULT_VERSION}`,
58-
];
59-
60-
export const RPC_MAINNET_NODES = [
61-
`https://starknet-mainnet.public.blastapi.io/rpc/${RPC_DEFAULT_VERSION}`,
62-
`https://free-rpc.nethermind.io/mainnet-juno/${RPC_DEFAULT_VERSION}`,
63-
];
58+
export const RPC_NODES = {
59+
SN_GOERLI: [
60+
`https://starknet-testnet.public.blastapi.io/rpc/${RPC_DEFAULT_VERSION}`,
61+
`https://free-rpc.nethermind.io/goerli-juno/${RPC_DEFAULT_VERSION}`,
62+
],
63+
SN_MAIN: [
64+
`https://starknet-mainnet.public.blastapi.io/rpc/${RPC_DEFAULT_VERSION}`,
65+
`https://free-rpc.nethermind.io/mainnet-juno/${RPC_DEFAULT_VERSION}`,
66+
],
67+
SN_SEPOLIA: [
68+
`https://starknet-sepolia.public.blastapi.io/rpc/${RPC_DEFAULT_VERSION}`,
69+
`https://free-rpc.nethermind.io/sepolia-juno/${RPC_DEFAULT_VERSION}`,
70+
],
71+
};

src/utils/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NetworkName, RPC_GOERLI_NODES, RPC_MAINNET_NODES } from '../constants';
1+
import { NetworkName, RPC_NODES } from '../constants';
22
import {
33
BigNumberish,
44
BlockIdentifier,
@@ -73,7 +73,7 @@ export const getDefaultNodeUrl = (networkName?: NetworkName, mute: boolean = fal
7373
if (!mute)
7474
// eslint-disable-next-line no-console
7575
console.warn('Using default public node url, please provide nodeUrl in provider options!');
76-
const nodes = networkName === NetworkName.SN_MAIN ? RPC_MAINNET_NODES : RPC_GOERLI_NODES;
76+
const nodes = RPC_NODES[networkName ?? NetworkName.SN_GOERLI]; // TODO: when goerli deprecated switch default to sepolia
7777
const randIdx = Math.floor(Math.random() * nodes.length);
7878
return nodes[randIdx];
7979
};

0 commit comments

Comments
 (0)