@saberhq/solana-contrib
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -43,7 +43,22 @@ import type { ConfirmOptions, Connection, KeyedAccountInfo, PublicKey, RpcResponseAndContext, Signer, SimulatedTransactionResponse, Transaction } from "@solana/web3.js"; | ||
constructor(connection: Connection, broadcaster: Broadcaster, wallet: Wallet, opts?: ConfirmOptions); | ||
/** | ||
* Creates a new SolanaProvider. | ||
*/ | ||
static load({ connection, sendConnection, wallet, opts, }: { | ||
/** | ||
* Connection used for general reads | ||
*/ | ||
connection: Connection; | ||
sendConnection: Connection; | ||
/** | ||
* Connection used for sending transactions | ||
*/ | ||
sendConnection?: Connection; | ||
/** | ||
* Wallet used for signing transactions | ||
*/ | ||
wallet: Wallet; | ||
opts: ConfirmOptions; | ||
/** | ||
* Confirmation options | ||
*/ | ||
opts?: ConfirmOptions; | ||
}): SolanaProvider; | ||
@@ -50,0 +65,0 @@ /** |
@@ -63,3 +63,6 @@ "use strict"; | ||
} | ||
static load({ connection, sendConnection, wallet, opts, }) { | ||
/** | ||
* Creates a new SolanaProvider. | ||
*/ | ||
static load({ connection, sendConnection = connection, wallet, opts, }) { | ||
return new SolanaProvider(connection, new broadcaster_1.SingleConnectionBroadcaster(sendConnection, opts), wallet, opts); | ||
@@ -66,0 +69,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import type { Connection, PublicKey, Signer, Transaction } from "@solana/web3.js"; | ||
import type { ConfirmOptions, Connection, PublicKey, Signer, Transaction } from "@solana/web3.js"; | ||
import type { Provider, Wallet } from "./interfaces"; | ||
@@ -17,4 +17,4 @@ /** | ||
*/ | ||
createProvider(connection: Connection, sendConnection?: Connection): Provider; | ||
createProvider(connection: Connection, sendConnection?: Connection, opts?: ConfirmOptions): Provider; | ||
} | ||
//# sourceMappingURL=wallet.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SignerWallet = void 0; | ||
const _1 = require("."); | ||
const provider_1 = require("./provider"); | ||
@@ -31,4 +30,9 @@ /** | ||
*/ | ||
createProvider(connection, sendConnection) { | ||
return new provider_1.SolanaProvider(connection, new _1.SingleConnectionBroadcaster(sendConnection !== null && sendConnection !== void 0 ? sendConnection : connection), this); | ||
createProvider(connection, sendConnection, opts) { | ||
return provider_1.SolanaProvider.load({ | ||
connection, | ||
sendConnection, | ||
wallet: this, | ||
opts, | ||
}); | ||
} | ||
@@ -35,0 +39,0 @@ } |
{ | ||
"name": "@saberhq/solana-contrib", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Common types and libraries for Solana", | ||
@@ -33,3 +33,3 @@ "author": "Ian Macalinao <ian@saber.so>", | ||
}, | ||
"gitHead": "4efb7cb4a2cd74cf936efb8f6b0fb8025fced491", | ||
"gitHead": "49a0261851caa5d36808f327d5f110f7d497f1fb", | ||
"publishConfig": { | ||
@@ -36,0 +36,0 @@ "access": "public" |
@@ -78,12 +78,27 @@ import type { | ||
/** | ||
* Creates a new SolanaProvider. | ||
*/ | ||
static load({ | ||
connection, | ||
sendConnection, | ||
sendConnection = connection, | ||
wallet, | ||
opts, | ||
}: { | ||
/** | ||
* Connection used for general reads | ||
*/ | ||
connection: Connection; | ||
sendConnection: Connection; | ||
/** | ||
* Connection used for sending transactions | ||
*/ | ||
sendConnection?: Connection; | ||
/** | ||
* Wallet used for signing transactions | ||
*/ | ||
wallet: Wallet; | ||
opts: ConfirmOptions; | ||
/** | ||
* Confirmation options | ||
*/ | ||
opts?: ConfirmOptions; | ||
}): SolanaProvider { | ||
@@ -90,0 +105,0 @@ return new SolanaProvider( |
import type { | ||
ConfirmOptions, | ||
Connection, | ||
@@ -8,3 +9,2 @@ PublicKey, | ||
import { SingleConnectionBroadcaster } from "."; | ||
import type { Provider, Wallet } from "./interfaces"; | ||
@@ -44,10 +44,12 @@ import { SolanaProvider } from "./provider"; | ||
connection: Connection, | ||
sendConnection?: Connection | ||
sendConnection?: Connection, | ||
opts?: ConfirmOptions | ||
): Provider { | ||
return new SolanaProvider( | ||
return SolanaProvider.load({ | ||
connection, | ||
new SingleConnectionBroadcaster(sendConnection ?? connection), | ||
this | ||
); | ||
sendConnection, | ||
wallet: this, | ||
opts, | ||
}); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102355
2007