Skip to content

Commit 151fbbf

Browse files
committed
Merge branch 'feat/base-sepolia' of github.com:nevermined-io/sdk-js into feat/base-sepolia
2 parents dee541c + eca2dfa commit 151fbbf

File tree

6 files changed

+35
-22
lines changed

6 files changed

+35
-22
lines changed

integration/config.ts

+11
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ if (process.env.NETWORK_NAME === 'base') {
7373
} as NeverminedOptions)
7474
}
7575

76+
if (process.env.NETWORK_NAME === 'base-sepolia') {
77+
Object.assign(configBase, {
78+
chainId: 84532,
79+
marketplaceUri: 'https://marketplace-api.base-sepolia.nevermined.app',
80+
neverminedNodeUri: 'https://node.base-sepolia.nevermined.app',
81+
web3ProviderUri: `https://base-sepolia.drpc.org`,
82+
neverminedNodeAddress: '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc',
83+
graphHttpUri: undefined,
84+
} as NeverminedOptions)
85+
}
86+
7687
if (process.env.NETWORK_NAME === 'one-staging') {
7788
Object.assign(configBase, {
7889
chainId: 421614,

scripts/download-artifacts.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fi
2020

2121
REPO_URL=https://artifacts.nevermined.network
2222
declare -A NETWORKS_MAP
23-
NETWORKS_MAP=( ["mainnet"]="1" ["rinkeby"]="4" ["optimism"]="10" ["kovan"]="42" ["gnosis"]="100" ["matic"]="137" ["peaq"]="3338" ["base"]="8453" ["mumbai"]="80001" ["celo-alfajores"]="44787" ["celo"]="42220" ["aurora"]="1313161554" ["aurora-testnet"]="1313161555" ["arbitrum-one"]="42161" ["arbitrum-goerli"]="421613" ["arbitrum-sepolia"]="421614" )
23+
NETWORKS_MAP=( ["mainnet"]="1" ["rinkeby"]="4" ["optimism"]="10" ["kovan"]="42" ["gnosis"]="100" ["matic"]="137" ["peaq"]="3338" ["base"]="8453" ["base-sepolia"]="84532" ["mumbai"]="80001" ["celo-alfajores"]="44787" ["celo"]="42220" ["aurora"]="1313161554" ["aurora-testnet"]="1313161555" ["arbitrum-one"]="42161" ["arbitrum-goerli"]="421613" ["arbitrum-sepolia"]="421614" )
2424

2525
SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
2626
UNPACK_DIR="$SCRIPT_DIR/../artifacts"

src/events/ContractEvent.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export class ContractEvent extends NeverminedEvent {
8282
chainId === 3338 ||
8383
chainId === 8453 ||
8484
chainId === 42220 ||
85-
chainId === 80001
85+
chainId === 80001 ||
86+
chainId === 84532
8687
) {
8788
const latestBlock = await this.client.public.getBlockNumber()
8889
options.fromBlock = latestBlock - 999n

src/nevermined/utils/BlockchainViemUtils.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,12 @@ export const formatEther = (value: bigint): string => {
533533
* @param zeroDevProjectId the zero dev project id, you can get it from the ZeroDev dashboard
534534
* @returns the kernel client
535535
*/
536-
export async function createKernelClient(signer: any, chainId: number, zeroDevProjectId: string) {
536+
export async function createKernelClient(
537+
signer: any,
538+
chainId: number,
539+
zeroDevProjectId: string,
540+
provider?: string,
541+
) {
537542
const publicClient = createPublicClient({
538543
chain: getChain(chainId),
539544
transport: http(),
@@ -556,13 +561,17 @@ export async function createKernelClient(signer: any, chainId: number, zeroDevPr
556561
return createKernelAccountClient({
557562
account,
558563
chain: getChain(chainId),
559-
bundlerTransport: http(`https://rpc.zerodev.app/api/v2/bundler/${zeroDevProjectId}`),
564+
bundlerTransport: http(
565+
`https://rpc.zerodev.app/api/v2/bundler/${zeroDevProjectId}?provider=${provider}`,
566+
),
560567
client: publicClient,
561568
paymaster: {
562569
getPaymasterData: (userOperation) => {
563570
const zerodevPaymaster = createZeroDevPaymasterClient({
564571
chain: getChain(chainId),
565-
transport: http(`https://rpc.zerodev.app/api/v2/paymaster/${zeroDevProjectId}`),
572+
transport: http(
573+
`https://rpc.zerodev.app/api/v2/paymaster/${zeroDevProjectId}?provider=${provider}`,
574+
),
566575
})
567576
return zerodevPaymaster.sponsorUserOperation({
568577
userOperation,

src/utils/Network.ts

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export async function getNetworkName(networkId: number): Promise<string> {
4949
return 'peaq-mainnet'
5050
case 8453:
5151
return 'base'
52+
case 84532:
53+
return 'base-sepolia'
5254
case 10200:
5355
return 'chiado' // Gnosis testnet
5456
case 31337:
@@ -117,6 +119,8 @@ export function isTestnet(networkId: number): boolean {
117119
return false
118120
case 8453:
119121
return false
122+
case 84532:
123+
return true
120124
case 10200:
121125
return true
122126
case 31337:

test/config.ts

+5-17
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,11 @@ if (process.env.NETWORK_NAME === 'geth-localnet') {
5757
} as NeverminedOptions
5858
} else if (process.env.NETWORK_NAME === 'gnosis') {
5959
config = {
60-
chainId: 100,
61-
marketplaceUri: 'https://marketplace-api.gnosis.nevermined.app',
62-
neverminedNodeUri: 'https://node.gnosis.nevermined.app',
63-
neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
64-
web3ProviderUri: `https://rpc.gnosischain.com/`,
65-
graphHttpUri: undefined,
66-
// verbose: LogLevel.Verbose,
67-
artifactsFolder: './artifacts',
68-
circuitsFolder: './circuits',
69-
} as NeverminedOptions
70-
} else if (process.env.NETWORK_NAME === 'base') {
71-
config = {
72-
chainId: 8453,
73-
marketplaceUri: 'https://marketplace-api.base.nevermined.app',
74-
neverminedNodeUri: 'https://node.base.nevermined.app',
75-
neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
76-
web3ProviderUri: `https://1rpc.io/base`,
60+
chainId: 84532,
61+
marketplaceUri: 'https://marketplace-api.base-sepolia.nevermined.app',
62+
neverminedNodeUri: 'https://node.base-sepolia.nevermined.app',
63+
neverminedNodeAddress: '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc',
64+
web3ProviderUri: `https://base-sepolia.drpc.org`,
7765
graphHttpUri: undefined,
7866
// verbose: LogLevel.Verbose,
7967
artifactsFolder: './artifacts',

0 commit comments

Comments
 (0)