kit-squared 1.1.4 → 1.1.5

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.
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { type NetworkType } from "./library/wallet.js";
2
2
  export declare function init(http: string, ws: string, networkType?: NetworkType): void;
3
3
  export { getNetworkType, getNetwork, getConnection, checkAccountExists, getAccountBalance } from "./library/connection.js";
4
4
  export { onConnect, onDisconnect } from "./library/connectSchedule.js";
5
- export { clearAddedAccounts, addAccounts, getAddedAccounts, createProgram, } from "./library/program.js";
5
+ export { onSubscriptionFail, clearAddedAccounts, addAccounts, getAddedAccounts, createProgram, } from "./library/program.js";
6
6
  export { transacting, TRANSACTION_STATE, transactionState, onTransaction, transact, simulate, type Simulation, type SimulationError, } from "./library/transaction.ts";
7
7
  export * from "./library/utils.js";
8
8
  export { walletState, walletInitial, walletConnecting, walletConnected, walletError, signer, myKey, me, myKeyString, isMe, getStoredWalletSelection, disconnectWallet, unmountWallet } from "./library/wallet.js";
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ export function init(http, ws, networkType) {
8
8
  }
9
9
  export { getNetworkType, getNetwork, getConnection, checkAccountExists, getAccountBalance } from "./library/connection.js";
10
10
  export { onConnect, onDisconnect } from "./library/connectSchedule.js";
11
- export { clearAddedAccounts, addAccounts, getAddedAccounts, createProgram, } from "./library/program.js";
11
+ export { onSubscriptionFail, clearAddedAccounts, addAccounts, getAddedAccounts, createProgram, } from "./library/program.js";
12
12
  export { transacting, TRANSACTION_STATE, transactionState, onTransaction, transact, simulate, } from "./library/transaction.js";
13
13
  export * from "./library/utils.js";
14
14
  export { walletState, walletInitial, walletConnecting, walletConnected, walletError, signer, myKey, me, myKeyString, isMe, getStoredWalletSelection, disconnectWallet, unmountWallet } from "./library/wallet.js";
@@ -1,3 +1,4 @@
1
+ import { type Callback } from "./utils.js";
1
2
  import { type Address } from "@solana/kit";
2
3
  import type { TransactionSendingSigner } from "@solana/signers";
3
4
  export declare function clearAddedAccounts(): void;
@@ -7,6 +8,11 @@ export declare function addAccounts(accounts: {
7
8
  export declare function getAddedAccounts(): {
8
9
  [key: string]: Address;
9
10
  };
11
+ export declare let onSubscriptionFail: {
12
+ (callback: Callback): () => void;
13
+ trigger: (...args: any[]) => Promise<void>;
14
+ killAll: () => void;
15
+ };
10
16
  export declare function createProgram(programClient: {
11
17
  [key: string]: any;
12
18
  }, idl: {
@@ -1,10 +1,8 @@
1
- import { writable } from "svelte/store";
2
1
  import { camelToSnake, snakeToCamel, camelToPascal, snakeToPascal, getPDA, pascalToCamel, sleep, isIntegerType } from "./utils.js";
3
2
  import { Event } from "./utils.js";
4
- import { signer } from "./wallet.js";
5
3
  import { getConnection } from "./connection.js";
6
4
  import { typeEncoder } from "./utils.js";
7
- import { appendTransactionMessageInstructions, assertIsTransactionMessageWithSingleSendingSigner, createTransactionMessage, fetchEncodedAccount, getBase64Codec, getBase64EncodedWireTransaction, getBase64Encoder, getTransactionEncoder, partiallySignTransactionMessageWithSigners, partiallySignTransactionWithSigners, pipe, sequentialInstructionPlan, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, signTransactionMessageWithSigners, singleInstructionPlan } from "@solana/kit";
5
+ import { fetchEncodedAccount, getBase64Codec } from "@solana/kit";
8
6
  import {} from "@solana/kit";
9
7
  import { transactSingle } from "./transaction.js";
10
8
  let addedAccounts = {};
@@ -19,6 +17,7 @@ export function addAccounts(accounts) {
19
17
  export function getAddedAccounts() {
20
18
  return addedAccounts;
21
19
  }
20
+ export let onSubscriptionFail = Event();
22
21
  export async function createProgram(programClient, idl, signer = null, noEvents = false) {
23
22
  if (!programClient) {
24
23
  throw new Error("Missing program client.");
@@ -87,6 +86,7 @@ export async function createProgram(programClient, idl, signer = null, noEvents
87
86
  }
88
87
  catch (e) {
89
88
  console.error(e);
89
+ onSubscriptionFail.trigger(e);
90
90
  throw new Error("failed to subscribe to program");
91
91
  return;
92
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kit-squared",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Solana Kit functionality with SvelteKit",
5
5
  "license": "ISC",
6
6
  "author": "AnAllergyToAnalogy",