2025-06-22 00:21:09 +03:00

34 lines
812 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.connect = void 0;
/**
* Connect to NEAR using the provided configuration.
*
* {@link ConnectConfig#networkId} and {@link ConnectConfig#nodeUrl} are required.
*
* To sign transactions you can also pass: {@link ConnectConfig#keyStore}
*
* Both are passed they are prioritize in that order.
*
* @see {@link ConnectConfig}
* @example
* ```js
* async function initNear() {
* const near = await connect({
* networkId: 'testnet',
* nodeUrl: 'https://rpc.testnet.near.org'
* })
* }
* ```
*
* @module browserConnect
*/
const near_1 = require("./near");
/**
* Initialize connection to Near network.
*/
async function connect(config) {
return new near_1.Near(config);
}
exports.connect = connect;