@haven-fi/solauto-sdk 1.0.574 → 1.0.576
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,11 +3,12 @@ import { Connection, PublicKey } from "@solana/web3.js";
|
|
3
3
|
export declare abstract class TxHandler {
|
4
4
|
rpcUrl: string;
|
5
5
|
programId: PublicKey;
|
6
|
+
wsEndpoint?: string | undefined;
|
6
7
|
connection: Connection;
|
7
8
|
umi: Umi;
|
8
9
|
signer: Signer;
|
9
10
|
otherSigners: Signer[];
|
10
|
-
constructor(rpcUrl: string, localTest?: boolean, programId?: PublicKey);
|
11
|
+
constructor(rpcUrl: string, localTest?: boolean, programId?: PublicKey, wsEndpoint?: string | undefined);
|
11
12
|
log(...args: any[]): void;
|
12
13
|
abstract defaultLookupTables(): string[];
|
13
14
|
abstract resetLiveTxUpdates(success?: boolean): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"txHandler.d.ts","sourceRoot":"","sources":["../../src/clients/txHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"txHandler.d.ts","sourceRoot":"","sources":["../../src/clients/txHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIxD,8BAAsB,SAAS;IAOpB,MAAM,EAAE,MAAM;IAEd,SAAS,EAAE,SAAS;IACpB,UAAU,CAAC,EAAE,MAAM;IATrB,UAAU,EAAG,UAAU,CAAC;IACxB,GAAG,EAAG,GAAG,CAAC;IACV,MAAM,EAAG,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAM;gBAG1B,MAAM,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,OAAO,EACZ,SAAS,GAAE,SAAgC,EAC3C,UAAU,CAAC,EAAE,MAAM,YAAA;IAe5B,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAIzB,QAAQ,CAAC,mBAAmB,IAAI,MAAM,EAAE;IAExC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAC9D"}
|
@@ -4,11 +4,12 @@ exports.TxHandler = void 0;
|
|
4
4
|
const utils_1 = require("../utils");
|
5
5
|
const constants_1 = require("../constants");
|
6
6
|
class TxHandler {
|
7
|
-
constructor(rpcUrl, localTest, programId = constants_1.SOLAUTO_PROD_PROGRAM) {
|
7
|
+
constructor(rpcUrl, localTest, programId = constants_1.SOLAUTO_PROD_PROGRAM, wsEndpoint) {
|
8
8
|
this.rpcUrl = rpcUrl;
|
9
9
|
this.programId = programId;
|
10
|
+
this.wsEndpoint = wsEndpoint;
|
10
11
|
this.otherSigners = [];
|
11
|
-
const [connection, umi] = (0, utils_1.getSolanaRpcConnection)(this.rpcUrl, this.programId);
|
12
|
+
const [connection, umi] = (0, utils_1.getSolanaRpcConnection)(this.rpcUrl, this.programId, wsEndpoint);
|
12
13
|
this.connection = connection;
|
13
14
|
this.umi = umi;
|
14
15
|
if (!globalThis.LOCAL_TEST && localTest) {
|
@@ -54,7 +54,7 @@ async function buildSwbSubmitResponseTx(conn, signer, mint) {
|
|
54
54
|
const feed = getPullFeed(conn, mint, (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(signer.publicKey));
|
55
55
|
const [pullIx, responses] = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await feed.fetchUpdateIx({
|
56
56
|
crossbarClient: crossbar,
|
57
|
-
}),
|
57
|
+
}), 2, 200);
|
58
58
|
return {
|
59
59
|
tx: (0, umi_1.transactionBuilder)().add({
|
60
60
|
bytesCreatedOnChain: 0,
|
package/package.json
CHANGED
package/src/clients/txHandler.ts
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
import { Signer, Umi } from "@metaplex-foundation/umi";
|
2
2
|
import { Connection, PublicKey } from "@solana/web3.js";
|
3
|
-
import {
|
4
|
-
consoleLog,
|
5
|
-
getSolanaRpcConnection,
|
6
|
-
} from "../utils";
|
3
|
+
import { consoleLog, getSolanaRpcConnection } from "../utils";
|
7
4
|
import { SOLAUTO_PROD_PROGRAM } from "../constants";
|
8
5
|
|
9
6
|
export abstract class TxHandler {
|
@@ -15,9 +12,14 @@ export abstract class TxHandler {
|
|
15
12
|
constructor(
|
16
13
|
public rpcUrl: string,
|
17
14
|
localTest?: boolean,
|
18
|
-
public programId: PublicKey = SOLAUTO_PROD_PROGRAM
|
15
|
+
public programId: PublicKey = SOLAUTO_PROD_PROGRAM,
|
16
|
+
public wsEndpoint?: string
|
19
17
|
) {
|
20
|
-
const [connection, umi] = getSolanaRpcConnection(
|
18
|
+
const [connection, umi] = getSolanaRpcConnection(
|
19
|
+
this.rpcUrl,
|
20
|
+
this.programId,
|
21
|
+
wsEndpoint
|
22
|
+
);
|
21
23
|
this.connection = connection;
|
22
24
|
this.umi = umi;
|
23
25
|
|
@@ -58,7 +58,7 @@ export async function buildSwbSubmitResponseTx(
|
|
58
58
|
await feed.fetchUpdateIx({
|
59
59
|
crossbarClient: crossbar,
|
60
60
|
}),
|
61
|
-
|
61
|
+
2,
|
62
62
|
200
|
63
63
|
);
|
64
64
|
|
@@ -100,4 +100,4 @@ export async function getSwitchboardFeedData(
|
|
100
100
|
);
|
101
101
|
|
102
102
|
return results;
|
103
|
-
}
|
103
|
+
}
|