UNPKG

@bridgesplit/rwa-token-sdk

Version:

RWA Token SDK for the development of permissioned tokens on SVM blockchains.

19 lines 983 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getProvider = void 0; const anchor_1 = require("@coral-xyz/anchor"); const web3_js_1 = require("@solana/web3.js"); /** Retrieves the provider used for interacting with the Solana blockchain. * @returns The initialized provider for interacting with the Solana blockchain. */ /* Used for local testing, rwa client builds its own provider. */ const getProvider = () => { var _a; const connectionUrl = (_a = process.env.RPC_URL) !== null && _a !== void 0 ? _a : "http://localhost:8899"; const connection = new web3_js_1.Connection(connectionUrl); const anchorProvider = anchor_1.AnchorProvider.local(); const provider = new anchor_1.AnchorProvider(connection, anchorProvider.wallet, Object.assign(Object.assign({}, anchor_1.AnchorProvider.defaultOptions()), { commitment: "processed" })); return provider; }; exports.getProvider = getProvider; //# sourceMappingURL=index.js.map