Skip to content

Feat/update node address #756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,40 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v3.4.5](https://github.com/nevermined-io/sdk-js/compare/v3.1.2...v3.4.5)
#### [v3.4.5](https://github.com/nevermined-io/sdk-js/compare/v3.1.3-rc3...v3.4.5)

> 13 December 2024

#### [v3.1.3-rc3](https://github.com/nevermined-io/sdk-js/compare/v3.1.3-rc2...v3.1.3-rc3)

> 27 May 2025

- feat: use infura when possible [`6e1d779`](https://github.com/nevermined-io/sdk-js/commit/6e1d7793e1f086f65235ae11d3dbb94e95e9d203)
- Automated CHANGELOG.md update [`14c7924`](https://github.com/nevermined-io/sdk-js/commit/14c792419b3b5d0e05fe22f8d4069bf4ca07a013)

#### [v3.1.3-rc2](https://github.com/nevermined-io/sdk-js/compare/v3.1.3-rc1...v3.1.3-rc2)

> 14 May 2025

- chore: deprecating nightly tests [`a25542e`](https://github.com/nevermined-io/sdk-js/commit/a25542e2ead0d28ae54afe61110dc7a21e920098)
- feat: keep public client [`de71057`](https://github.com/nevermined-io/sdk-js/commit/de71057fe5d7d46edf294b36e0772cdd9f7d2524)
- feat: support new zerodev api [`4fef851`](https://github.com/nevermined-io/sdk-js/commit/4fef8518d451bfc78fa63100714bbaafb8588095)

#### [v3.1.3-rc1](https://github.com/nevermined-io/sdk-js/compare/v3.1.3-rc0...v3.1.3-rc1)

> 2 April 2025

- feat: update addresses: [`4769b25`](https://github.com/nevermined-io/sdk-js/commit/4769b258993e4127215f8c6ead0d36b8635b3236)
- Automated CHANGELOG.md update [`5f82840`](https://github.com/nevermined-io/sdk-js/commit/5f82840d8e1818fb93c4e8573f0feaaf34b338b4)

#### [v3.1.3-rc0](https://github.com/nevermined-io/sdk-js/compare/v3.1.2...v3.1.3-rc0)

> 2 April 2025

- docs: updating documentation [skip actions] [`f098fa4`](https://github.com/nevermined-io/sdk-js/commit/f098fa406b279555b091a27edc69b478a17a9bb3)
- docs: updating documentation [skip actions] [`3bc109f`](https://github.com/nevermined-io/sdk-js/commit/3bc109ff1cb437eb0febae8ad672146e330829f8)
- docs: updating documentation [skip actions] [`30c0da7`](https://github.com/nevermined-io/sdk-js/commit/30c0da75daa6b7269c5a1f38eb50bb4222878eff)

#### [v3.1.2](https://github.com/nevermined-io/sdk-js/compare/v3.1.2-rc2...v3.1.2)

> 5 March 2025
Expand Down
6 changes: 3 additions & 3 deletions integration/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (process.env.NETWORK_NAME === 'matic') {
marketplaceUri: 'https://marketplace-api.matic.nevermined.app',
neverminedNodeUri: 'https://node.matic.nevermined.app',
web3ProviderUri: `https://polygon-mainnet.infura.io/v3/${infuraToken}`,
neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
neverminedNodeAddress: '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da',
graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public',
} as NeverminedOptions)
}
Expand All @@ -57,7 +57,7 @@ if (process.env.NETWORK_NAME === 'gnosis') {
marketplaceUri: 'https://marketplace-api.gnosis.nevermined.app',
neverminedNodeUri: 'https://node.gnosis.nevermined.app',
web3ProviderUri: `https://rpc.gnosischain.com/`,
neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
neverminedNodeAddress: '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da',
graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public',
} as NeverminedOptions)
}
Expand All @@ -68,7 +68,7 @@ if (process.env.NETWORK_NAME === 'base') {
marketplaceUri: 'https://marketplace-api.base.nevermined.app',
neverminedNodeUri: 'https://node.base.nevermined.app',
web3ProviderUri: `https://mainnet.base.org`,
neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
neverminedNodeAddress: '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da',
graphHttpUri: undefined,
} as NeverminedOptions)
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/sdk",
"version": "3.1.2",
"version": "3.1.3-rc3",
"description": "Javascript SDK for connecting with Nevermined Data Platform ",
"main": "./dist/node/sdk.js",
"typings": "./dist/node/sdk.d.ts",
Expand Down Expand Up @@ -190,5 +190,6 @@
},
"browser": {
"fs": false
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
29 changes: 19 additions & 10 deletions src/Instantiable.abstract.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { Chain, createWalletClient, custom, http, PublicClient, WalletClient } from 'viem'
import {
Chain,
createPublicClient,
createWalletClient,
custom,
http,
PublicClient,
WalletClient,
} from 'viem'
import { Logger, LoggerInstance, LogLevel } from './models/Logger'
import { NeverminedOptions } from './models/NeverminedOptions'
import { Nevermined } from './nevermined/Nevermined'
Expand Down Expand Up @@ -44,16 +52,17 @@ export async function getWeb3ViemClients(
config: Partial<NeverminedOptions> = {},
): Promise<Web3Clients> {
const chain = getChain(config.chainId)
const providerTransport = config.web3ProviderUri
? http(config.web3ProviderUri)
: window && window.ethereum
? custom(window.ethereum!)
: http()

const publicClient = {
const providerTransport =
typeof window !== 'undefined' && window.ethereum
? custom(window.ethereum!)
: config.web3ProviderUri
? http(config.web3ProviderUri)
: http()

const publicClient = createPublicClient({
chain,
transport: http(),
}
transport: providerTransport,
})

const walletClient = createWalletClient({
// cacheTime: 0 as number,
Expand Down
14 changes: 7 additions & 7 deletions src/nevermined/resources/AppNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class AppDeploymentArbitrum extends NeverminedAppOptions {
marketplaceUri = 'https://marketplace-api.arbitrum.nevermined.app'
graphHttpUri = 'https://api.studio.thegraph.com/query/78075/public'
neverminedNodeUri = 'https://node.arbitrum.nevermined.app'
neverminedNodeAddress = '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1'
neverminedNodeAddress = '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da'
neverminedBackendUri = 'https://one-backend.arbitrum.nevermined.app'
verbose = true
gasMultiplier = 0
Expand All @@ -86,7 +86,7 @@ export class AppDeploymentGnosis extends NeverminedAppOptions {
marketplaceUri = 'https://marketplace-api.gnosis.nevermined.app'
graphHttpUri = 'https://api.studio.thegraph.com/query/78075/public'
neverminedNodeUri = 'https://node.gnosis.nevermined.app'
neverminedNodeAddress = '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1'
neverminedNodeAddress = '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da'
neverminedBackendUri = 'https://one-backend.gnosis.nevermined.app'
verbose = true
gasMultiplier = 0
Expand All @@ -104,7 +104,7 @@ export class AppDeploymentMatic extends NeverminedAppOptions {
marketplaceUri = 'https://marketplace-api.matic.nevermined.app'
graphHttpUri = 'https://api.studio.thegraph.com/query/78075/public'
neverminedNodeUri = 'https://node.matic.nevermined.app'
neverminedNodeAddress = '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1'
neverminedNodeAddress = '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da'
neverminedBackendUri = 'https://one-backend.matic.nevermined.app'
verbose = true
gasMultiplier = 1.2
Expand All @@ -122,7 +122,7 @@ export class AppDeploymentBase extends NeverminedAppOptions {
marketplaceUri = 'https://marketplace-api.base.nevermined.app'
graphHttpUri = 'https://api.studio.thegraph.com/query/78075/public'
neverminedNodeUri = 'https://node.base.nevermined.app'
neverminedNodeAddress = '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1'
neverminedNodeAddress = '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da'
neverminedBackendUri = 'https://one-backend.base.nevermined.app'
verbose = true
gasMultiplier = 0
Expand Down Expand Up @@ -158,7 +158,7 @@ export class AppDeploymentCelo extends NeverminedAppOptions {
marketplaceUri = 'https://marketplace-api.celo.nevermined.app'
graphHttpUri = 'https://api.studio.thegraph.com/query/78075/public'
neverminedNodeUri = 'https://node.celo.nevermined.app'
neverminedNodeAddress = '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1'
neverminedNodeAddress = '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da'
neverminedBackendUri = 'https://one-backend.celo.nevermined.app'
verbose = true
gasMultiplier = 0
Expand All @@ -176,7 +176,7 @@ export class AppDeploymentOptimism extends NeverminedAppOptions {
marketplaceUri = 'https://marketplace-api.optimism.nevermined.app'
graphHttpUri = 'https://api.studio.thegraph.com/query/78075/public'
neverminedNodeUri = 'https://node.optimism.nevermined.app'
neverminedNodeAddress = '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1'
neverminedNodeAddress = '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da'
neverminedBackendUri = 'https://one-backend.optimism.nevermined.app'
verbose = true
gasMultiplier = 0
Expand All @@ -194,7 +194,7 @@ export class AppDeploymentPeaq extends NeverminedAppOptions {
marketplaceUri = 'https://marketplace-api.peaq.nevermined.app'
graphHttpUri = 'https://api.studio.thegraph.com/query/78075/public'
neverminedNodeUri = 'https://node.peaq.nevermined.app'
neverminedNodeAddress = '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1'
neverminedNodeAddress = '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da'
neverminedBackendUri = 'https://one-backend.peaq.nevermined.app'
verbose = true
gasMultiplier = 0
Expand Down
8 changes: 4 additions & 4 deletions src/nevermined/utils/BlockchainViemUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,13 +556,13 @@ export async function createKernelClient(signer: any, chainId: number, zeroDevPr
return createKernelAccountClient({
account,
chain: getChain(chainId),
bundlerTransport: http(`https://rpc.zerodev.app/api/v2/bundler/${zeroDevProjectId}`),
bundlerTransport: http(`https://rpc.zerodev.app/api/v3/${zeroDevProjectId}/chain/${chainId}`),
client: publicClient,
paymaster: {
getPaymasterData: (userOperation) => {
const zerodevPaymaster = createZeroDevPaymasterClient({
chain: getChain(chainId),
transport: http(`https://rpc.zerodev.app/api/v2/paymaster/${zeroDevProjectId}`),
transport: http(`https://rpc.zerodev.app/api/v3/${zeroDevProjectId}/chain/${chainId}`),
})
return zerodevPaymaster.sponsorUserOperation({
userOperation,
Expand Down Expand Up @@ -647,13 +647,13 @@ export async function getSessionKey(

const kernelPaymaster = createZeroDevPaymasterClient({
chain: getChain(chainId),
transport: http(`https://rpc.zerodev.app/api/v2/paymaster/${zeroDevProjectId}`),
transport: http(`https://rpc.zerodev.app/api/v3/${zeroDevProjectId}/chain/${chainId}`),
})

const kernelClient = createKernelAccountClient({
account: sessionKeyAccount,
chain: getChain(chainId),
bundlerTransport: http(`https://rpc.zerodev.app/api/v2/bundler/${zeroDevProjectId}`),
bundlerTransport: http(`https://rpc.zerodev.app/api/v3/${zeroDevProjectId}/chain/${chainId}`),
paymaster: {
getPaymasterData(userOperation) {
return kernelPaymaster.sponsorUserOperation({ userOperation })
Expand Down
4 changes: 2 additions & 2 deletions test/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if (process.env.NETWORK_NAME === 'geth-localnet') {
chainId: 100,
marketplaceUri: 'https://marketplace-api.gnosis.nevermined.app',
neverminedNodeUri: 'https://node.gnosis.nevermined.app',
neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
neverminedNodeAddress: '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da',
web3ProviderUri: `https://rpc.gnosischain.com/`,
graphHttpUri: undefined,
// verbose: LogLevel.Verbose,
Expand All @@ -60,7 +60,7 @@ if (process.env.NETWORK_NAME === 'geth-localnet') {
chainId: 8453,
marketplaceUri: 'https://marketplace-api.base.nevermined.app',
neverminedNodeUri: 'https://node.base.nevermined.app',
neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
neverminedNodeAddress: '0x6B16D0b334824581B4a24A49Fd7fcbD6509CE5da',
web3ProviderUri: `https://mainnet.base.org`,
graphHttpUri: undefined,
// verbose: LogLevel.Verbose,
Expand Down
Loading