The configuration object for connecting to NEAR Protocol.
A Promise that resolves to a Near
object representing the connection.
const connectionConfig = {
networkId: 'testnet',
nodeUrl: 'https://rpc.testnet.near.org',
walletUrl: 'https://wallet.testnet.near.org',
helperUrl: 'https://helper.testnet.near.org',
keyStore: new InMemoryKeyStore(),
deps: { keyStore: new BrowserLocalStorageKeyStore() },
logger: true,
keyPath: '/path/to/account-key.json',
masterAccount: 'master-account.near',
};
const nearConnection = await connect(connectionConfig);
console.log(nearConnection); // Near object representing the connection
Initialize connection to Near network.