ts: Fix local provider config (#286)

This commit is contained in:
Armani Ferrante 2021-05-19 13:26:09 -07:00 committed by GitHub
parent 30a58b99e1
commit b652f5f940
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@
"lint:fix": "prettier src/** -w", "lint:fix": "prettier src/** -w",
"watch": "tsc -p tsconfig.cjs.json --watch", "watch": "tsc -p tsconfig.cjs.json --watch",
"prepublishOnly": "yarn build", "prepublishOnly": "yarn build",
"docs": "typedoc --excludePrivate --out ../docs/src/.vuepress/dist/ts/ src/index.ts" "docs": "typedoc --excludePrivate --includeVersion --out ../docs/src/.vuepress/dist/ts/ src/index.ts"
}, },
"dependencies": { "dependencies": {
"@project-serum/borsh": "^0.2.2", "@project-serum/borsh": "^0.2.2",

View File

@ -43,9 +43,9 @@ export default class Provider {
* (This api is for Node only.) * (This api is for Node only.)
*/ */
static local(url?: string, opts?: ConfirmOptions): Provider { static local(url?: string, opts?: ConfirmOptions): Provider {
opts = opts || Provider.defaultOptions(); opts = opts ?? Provider.defaultOptions();
const connection = new Connection( const connection = new Connection(
url || "http://localhost:8899", url ?? "http://localhost:8899",
opts.preflightCommitment opts.preflightCommitment
); );
const wallet = NodeWallet.local(); const wallet = NodeWallet.local();