{"version":3,"sources":["../src/const.ts","../src/hooks/client.ts","../src/hooks/account.ts","../src/hooks/balance.ts","../src/hooks/latest-blockhash.ts","../src/hooks/multiple-accounts.ts","../src/hooks/program-accounts.ts","../src/hooks/recent-prioritization-fees.ts","../src/hooks/signature-statuses.ts","../src/hooks/signatures-for-address.ts","../src/hooks/simulate-transaction.ts","../src/hooks/slot.ts","../src/hooks/token-account-balance.ts","../src/hooks/token-account.ts","../src/hooks/token-mint.ts","../src/hooks/transaction.ts","../src/providers.tsx","../src/index.ts"],"names":["useQuery","createSolanaClient","useQueryClient","useMutation","address","fetchEncodedAccount","assertAccountExists","decodeAccount","fetchEncodedAccounts","assertAccountsExist","fetchMint","checkedTokenProgramAddress","getAssociatedTokenAccountAddress","assertIsAddress","decodeToken","decodeMint","QueryClient","React","QueryClientProvider"],"mappings":";;;;;;;;;;;;;;;;;;AAGO,IAAM,SAAY,GAAA;AAElB,IAAM,oBAAuB,GAAA;ACG7B,SAAS,eAAgC,GAAA;AAC9C,EAAA,MAAM,EAAE,IAAA,EAAM,MAAO,EAAA,GAAIA,mBAAuB,CAAA;AAAA;AAAA;AAAA,IAG9C,aAAaC,uBAAmB,CAAA;AAAA,MAC9B,YAAc,EAAA;AAAA,KACf,CAAA;AAAA,IACD,QAAA,EAAU,CAAC,oBAAoB,CAAA;AAAA,IAC/B,SAAW,EAAA;AAAA,GACZ,CAAA;AACD,EAAO,OAAA,MAAA;AACT;AAKO,SAAS,qBAAwB,GAAA;AACtC,EAAA,MAAM,cAAcC,yBAAe,EAAA;AACnC,EAAA,OAAOC,sBAAY,CAAA;AAAA,IACjB,UAAA,EAAY,OAAO,SAA2C,KAAA;AAC5D,MAAA,WAAA,CAAY,YAAa,CAAA,CAAC,oBAAoB,CAAA,EAAG,SAAS,CAAA;AAE1D,MAAO,OAAA,MAAM,QAAQ,OAAQ,EAAA;AAAA;AAC/B,GACD,CAAA;AACH;;;ACKO,SAAS,UAAA,CAId,EAAE,OAAS,EAAA,MAAA,E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EY = \"gill-client\";\n","import { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { createSolanaClient, type SolanaClient } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\n\n/**\n * Get the current Solana client (including `rpc` and `rpcSubscriptions`)\n */\nexport function useSolanaClient(): SolanaClient {\n  const { data: config } = useQuery<SolanaClient>({\n    // fallback data should not be reached if used within `SolanaProvider`\n    // since we set the initial value. but just in case => devnet\n    initialData: createSolanaClient({\n      urlOrMoniker: \"devnet\",\n    }),\n    queryKey: [GILL_HOOK_CLIENT_KEY],\n    staleTime: Infinity,\n  });\n  return config;\n}\n\n/**\n * Update your Solana client (including `rpc` and `rpcSubscriptions`)\n */\nexport function useUpdateSolanaClient() {\n  const queryClient = useQueryClient();\n  return useMutation({\n    mutationFn: async (newClient: SolanaClient): Promise<void> => {\n      queryClient.setQueryData([GILL_HOOK_CLIENT_KEY], newClient);\n\n      return await Promise.resolve();\n    },\n  });\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Account, Address, Decoder, FetchAccountConfig, Simplify } from \"gill\";\nimport { assertAccountExists, decodeAccount, fetchEncodedAccount } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Omit<FetchAccountConfig, \"abortSignal\">>;\n\ntype UseAccountResponse<TAddress extends string = string, TData extends Uint8Array | object = Uint8Array> = Account<\n  TData,\n  TAddress\n> & {\n  exists: true;\n};\n\ntype UseAccountInput<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n  TDecodedData extends object = Uint8Array,\n> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the account to get the balance of\n   */\n  address: Address | TAddress;\n  /**\n   * Account decoder that can decode the account's `data` byte array value\n   */\n  decoder?: Decoder<TDecodedData>;\n};\n\n/**\n * Get the account info for an address using the Solana RPC method of\n * [`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo)\n */\nexport function useAccount<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n  TDecodedData extends object = Uint8Array,\n>({ options, config, abortSignal, address, decoder }: UseAccountInput<TConfig, TAddress, TDecodedData>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  if (abortSignal) {\n    // @ts-expect-error we stripped the `abortSignal` from the type but are now adding it back in\n    config = {\n      ...(config || {}),\n      abortSignal,\n    };\n  }\n\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!address,\n    queryFn: async () => {\n      const account = await fetchEncodedAccount(rpc, address as Address, config);\n      assertAccountExists(account);\n      if (decoder) return decodeAccount(account, decoder);\n      return account;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getAccountInfo\", address],\n  });\n  return {\n    ...rest,\n    account: data as UseAccountResponse<TAddress, TDecodedData>,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Address, GetBalanceApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\ntype RpcConfig = Simplify<Parameters<GetBalanceApi[\"getBalance\"]>>[1];\n\ntype UseBalanceResponse = ReturnType<GetBalanceApi[\"getBalance\"]>[\"value\"];\n\ntype UseBalanceInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the account to get the balance of\n   */\n  address: Address | string;\n};\n\n/**\n * Get an account's balance (in lamports) using the Solana RPC method of\n * [`getBalance`](https://solana.com/docs/rpc/http/getbalance)\n */\nexport function useBalance<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  address,\n}: UseBalanceInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!address,\n    queryFn: async () => {\n      const { value } = await rpc.getBalance(address as Address, config).send({ abortSignal });\n      return value;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getBalance\", address],\n  });\n  return {\n    ...rest,\n    balance: data as UseBalanceResponse,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetLatestBlockhashApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetLatestBlockhashApi[\"getLatestBlockhash\"]>>[0];\n\ntype UseLatestBlockhashResponse = ReturnType<GetLatestBlockhashApi[\"getLatestBlockhash\"]>[\"value\"];\n\ntype UseLatestBlockhashInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig>;\n\n/**\n * Get the latest blockhash using the Solana RPC method of\n * [`getLatestBlockhash`](https://solana.com/docs/rpc/http/getlatestblockhash)\n *\n * To auto refetch the latest blockhash, provide a `options.refetchInterval` value\n */\nexport function useLatestBlockhash<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n}: UseLatestBlockhashInput<TConfig> = {}) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    ...options,\n    queryFn: async () => {\n      const { value } = await rpc.getLatestBlockhash(config).send({ abortSignal });\n      return value;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getLatestBlockhash\"],\n  });\n  return {\n    ...rest,\n    latestBlockhash: data as UseLatestBlockhashResponse,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Account, Address, Decoder, FetchAccountsConfig, Simplify } from \"gill\";\nimport { assertAccountsExist, decodeAccount, fetchEncodedAccounts } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Omit<FetchAccountsConfig, \"abortSignal\">>;\n\ntype UseMultipleAccountsInput<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n  TDecodedData extends object = Uint8Array,\n> = GillUseRpcHook<TConfig> & {\n  /**\n   * List of addresses to fetch accounts for.\n   */\n  addresses: Address<TAddress>[];\n  /**\n   * Optional decoder to decode the account's `data` buffer.\n   */\n  decoder?: Decoder<TDecodedData>;\n};\n\ntype UseMultipleAccountsResponse<TAddress extends string = string, TDecodedData extends object = Uint8Array> = {\n  accounts: Account<TDecodedData, TAddress>[];\n};\n\n/**\n * Fetch multiple accounts using the Solana RPC method of\n * [`getMultipleAccounts`](https://solana.com/docs/rpc/http/getmultipleaccounts)\n *\n * Optionally provide a {@link Decoder | `decoder`} to automatically decode all Accounts using it.\n */\nexport function useMultipleAccounts<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n  TDecodedData extends object = Uint8Array,\n>({ addresses, decoder, config, options, abortSignal }: UseMultipleAccountsInput<TConfig, TAddress, TDecodedData>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  if (abortSignal) {\n    // @ts-expect-error we stripped the `abortSignal` from the type but are now adding it back in\n    config = {\n      ...(config || {}),\n      abortSignal,\n    };\n  }\n\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && addresses.length > 0,\n    queryFn: async () => {\n      const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n      assertAccountsExist(maybeAccounts);\n      return maybeAccounts.map((acc) => (decoder ? decodeAccount(acc, decoder) : acc));\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getMultipleAccounts\", addresses, config?.commitment],\n  });\n\n  return {\n    ...rest,\n    accounts: data,\n  } as UseMultipleAccountsResponse<TAddress, TDecodedData>;\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n  AccountInfoBase,\n  AccountInfoWithBase64EncodedData,\n  AccountInfoWithBase64EncodedZStdCompressedData,\n  AccountInfoWithJsonData,\n  AccountInfoWithPubkey,\n  Address,\n  GetProgramAccountsApi,\n  Simplify,\n  SolanaRpcResponse,\n} from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype Encoding = \"base64\" | \"base64+zstd\" | \"jsonParsed\";\n\ntype RpcConfig = Simplify<\n  Parameters<GetProgramAccountsApi[\"getProgramAccounts\"]>[1] &\n    Readonly<{\n      encoding?: Encoding;\n    }>\n>;\n\ntype UseProgramAccountsInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the program used to call\n   * [`getProgramAccounts`](https://solana.com/docs/rpc/http/getprogramaccounts)\n   */\n  program: Address | string;\n};\n\ntype UseProgramAccountsResponse<TConfig extends RpcConfig> = TConfig extends {\n  encoding: \"base64\";\n  withContext: true;\n}\n  ? SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[]>\n  : TConfig extends { encoding: \"base64\" }\n    ? AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[]\n    : TConfig extends { encoding: \"base64+zstd\"; withContext: true }\n      ? SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData>[]>\n      : TConfig extends { encoding: \"base64+zstd\" }\n        ? AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData>[]\n        : TConfig extends { encoding: \"jsonParsed\"; withContext: true }\n          ? SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithJsonData>[]>\n          : TConfig extends { encoding: \"jsonParsed\" }\n            ? AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithJsonData>[]\n            : TConfig extends { withContext: true }\n              ? SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[]>\n              : AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[];\n/**\n * Get all the accounts owned by a `program` using the Solana RPC method of\n * [`getProgramAccounts`](https://solana.com/docs/rpc/http/getprogramaccounts)\n */\nexport function useProgramAccounts<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  program,\n}: UseProgramAccountsInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  const { data, ...rest } = useQuery({\n    ...options,\n    enabled: (options?.enabled ?? true) && !!program,\n    queryFn: async () => {\n      const accounts = await rpc.getProgramAccounts(program as Address, config).send({ abortSignal });\n      return accounts;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getProgramAccounts\", program],\n  });\n\n  return {\n    ...rest,\n    accounts: data as Simplify<UseProgramAccountsResponse<TConfig>>,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetRecentPrioritizationFeesApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype UseRecentPrioritizationFeesInput = Simplify<\n  Pick<GillUseRpcHook<{}>, \"abortSignal\" | \"options\"> & {\n    addresses?: Parameters<GetRecentPrioritizationFeesApi[\"getRecentPrioritizationFees\"]>[0];\n  }\n>;\n\ntype UseRecentPrioritizationFeesResponse = ReturnType<GetRecentPrioritizationFeesApi[\"getRecentPrioritizationFees\"]>;\n\n/**\n * Get the recent prioritization fees for a list of addresses using the Solana RPC method of\n * [`getRecentPrioritizationFees`](https://solana.com/docs/rpc/http/getrecentprioritizationfees)\n */\nexport function useRecentPrioritizationFees({\n  options,\n  abortSignal,\n  addresses,\n}: UseRecentPrioritizationFeesInput = {}) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  const { data, ...rest } = useQuery({\n    ...options,\n    queryFn: async () => {\n      const fees = await rpc.getRecentPrioritizationFees(addresses).send({ abortSignal });\n      return fees;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getRecentPrioritizationFees\", addresses],\n  });\n\n  return {\n    ...rest,\n    fees: data as UseRecentPrioritizationFeesResponse,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetSignatureStatusesApi, Signature, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetSignatureStatusesApi[\"getSignatureStatuses\"]>[1]>;\n\ntype UseSignatureStatusesInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * List of signatures used to call\n   * [`getSignatureStatuses`](https://solana.com/docs/rpc/http/getsignaturestatuses)\n   */\n  signatures: Signature[] | string[];\n};\n\ntype UseSignatureStatusesResponse = ReturnType<GetSignatureStatusesApi[\"getSignatureStatuses\"]>[\"value\"];\n\n/**\n * Get the statuses of signatures using the Solana RPC method of\n * [`getSignatureStatuses`](https://solana.com/docs/rpc/http/getsignaturestatuses)\n */\nexport function useSignatureStatuses<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  signatures,\n}: UseSignatureStatusesInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    ...options,\n    enabled: (options?.enabled ?? true) && signatures && signatures.length > 0,\n    queryFn: async () => {\n      const { value } = await rpc.getSignatureStatuses(signatures as Signature[], config).send({ abortSignal });\n      return value;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getSignatureStatuses\", signatures],\n  });\n  return {\n    ...rest,\n    statuses: data as UseSignatureStatusesResponse,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { Address, GetSignaturesForAddressApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetSignaturesForAddressApi[\"getSignaturesForAddress\"]>[1]>;\n\ntype UseSignaturesForAddressInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the account to fetch signatures of\n   */\n  address: Address | string;\n};\n\ntype UseSignaturesForAddressResponse = ReturnType<GetSignaturesForAddressApi[\"getSignaturesForAddress\"]>;\n\n/**\n * Returns signatures for confirmed transactions that include the given address\n * in their `accountKeys` list. Returns signatures backwards in time from the\n * provided signature or most recent confirmed block using the Solana RPC method of\n * [`getSignaturesForAddress`](https://solana.com/docs/rpc/http/getsignaturesforaddress)\n */\nexport function useSignaturesForAddress<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  address,\n}: UseSignaturesForAddressInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!address,\n    queryFn: async () => {\n      const signatures = await rpc.getSignaturesForAddress(address as Address, config).send({ abortSignal });\n      return signatures;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getSignaturesForAddress\", address],\n  });\n  return {\n    ...rest,\n    signatures: data as UseSignaturesForAddressResponse,\n  };\n}\n","\"use client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Base64EncodedWireTransaction, Simplify, SimulateTransactionApi } from \"gill\";\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<SimulateTransactionApi[\"simulateTransaction\"]>>[1];\n\nconst DEFAULT_CONFIG: RpcConfig = {\n  replaceRecentBlockhash: true,\n  sigVerify: false,\n  encoding: \"base64\",\n  commitment: \"confirmed\",\n} as const;\n\ntype UseSimulateTransactionInput<TConfig extends RpcConfig = RpcConfig> = Omit<GillUseRpcHook<TConfig>, \"config\"> & {\n  transaction: Base64EncodedWireTransaction;\n  /**\n   * @default { replaceRecentBlockhash: true, sigVerify: false, encoding: \"base64\", commitment: \"confirmed\" }\n   */\n  config?: TConfig;\n};\n\ntype UseSimulateTransactionResponse = ReturnType<SimulateTransactionApi[\"simulateTransaction\"]>;\n\n/**\n * Simulate a transaction using the Solana RPC method of\n * [`simulateTransaction`](https://solana.com/docs/rpc/http/simulatetransaction)\n */\nexport function useSimulateTransaction<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  transaction,\n}: UseSimulateTransactionInput<TConfig>) {\n  const { rpc } = useSolanaClient();\n\n  const mergedConfig = { ...DEFAULT_CONFIG, ...config } as RpcConfig;\n\n  const { data, ...rest } = useQuery({\n    ...options,\n    enabled: (options?.enabled ?? true) && !!transaction,\n    queryKey: [GILL_HOOK_CLIENT_KEY, \"simulateTransaction\", transaction, mergedConfig],\n    queryFn: async () => {\n      const simulation = await rpc.simulateTransaction(transaction, mergedConfig).send({ abortSignal });\n      return simulation;\n    },\n  });\n\n  return {\n    ...rest,\n    simulation: data as UseSimulateTransactionResponse,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetSlotApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetSlotApi[\"getSlot\"]>>[0];\n\ntype UseSlotResponse = ReturnType<GetSlotApi[\"getSlot\"]>;\n\ntype UseSlotInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig>;\n\n/**\n * Get the current slot using the Solana RPC method of\n * [`getSlot`](https://solana.com/docs/rpc/http/getslot)\n *\n * To auto refetch the slot, provide a `options.refetchInterval` value\n */\nexport function useSlot<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n}: UseSlotInput<TConfig> = {}) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  const { data, ...rest } = useQuery({\n    ...options,\n    queryFn: async () => {\n      const slot = await rpc.getSlot(config).send({ abortSignal });\n      return slot;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getSlot\"],\n  });\n\n  return {\n    ...rest,\n    slot: data as UseSlotResponse,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Address, GetTokenAccountBalanceApi, Simplify } from \"gill\";\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetTokenAccountBalanceApi[\"getTokenAccountBalance\"]>>[1];\n\ntype UseTokenAccountBalanceInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  address: Address | string;\n};\n\ntype UseTokenAccountBalanceResponse = ReturnType<GetTokenAccountBalanceApi[\"getTokenAccountBalance\"]>;\n\nexport function useTokenAccountBalance<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  address,\n}: UseTokenAccountBalanceInput<TConfig>) {\n  const { rpc } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!address,\n    queryFn: async () => {\n      const { value } = await rpc.getTokenAccountBalance(address as Address, config).send({ abortSignal });\n      return value;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, \"getTokenAccountBalance\", address],\n  });\n\n  return {\n    ...rest,\n    balance: data as UseTokenAccountBalanceResponse,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Account, Address, FetchAccountConfig, Simplify } from \"gill\";\nimport { address, assertAccountExists, assertIsAddress, fetchEncodedAccount } from \"gill\";\nimport {\n  checkedTokenProgramAddress,\n  decodeToken,\n  fetchMint,\n  getAssociatedTokenAccountAddress,\n  type Token,\n} from \"gill/programs\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Omit<FetchAccountConfig, \"abortSignal\">>;\n\ntype UseTokenAccountResponse<TAddress extends Address = Address> = Simplify<\n  Account<Token, TAddress> & {\n    exists: true;\n  }\n>;\n\ntype TokenAccountInputWithDeclaredAta<TAddress extends Address = Address> = {\n  /**\n   * Address of the {@link https://solana.com/docs/tokens#associated-token-account | Token Account} to get and decode\n   */\n  ata: TAddress;\n};\n\ntype TokenAccountInputWithDerivedAtaDetails = {\n  /**\n   * Address of the {@link https://solana.com/docs/tokens#token-account | Token Account}'s `mint`\n   */\n  mint: Address;\n  /**\n   * Address of the {@link https://solana.com/docs/tokens#token-account | Token Account}'s `owner`\n   */\n  owner: Address;\n  /**\n   * The {@link https://solana.com/docs/tokens#token-programs | Token Program} used to create the `mint`\n   *\n   * If no `tokenProgram` is provided, the hook will automatically fetch the\n   * {@link https://solana.com/docs/tokens#mint-account | Mint account} to retrieve the correct Token Program address\n   */\n  tokenProgram?: Address;\n};\n\ntype UseTokenAccountInput<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends Address = Address,\n> = GillUseRpcHook<TConfig> & (TokenAccountInputWithDeclaredAta<TAddress> | TokenAccountInputWithDerivedAtaDetails);\n\nfunction hasDeclaredAta(\n  input: TokenAccountInputWithDeclaredAta | TokenAccountInputWithDerivedAtaDetails,\n): input is TokenAccountInputWithDeclaredAta {\n  return (input as TokenAccountInputWithDeclaredAta).ata !== undefined;\n}\n\n/**\n * Get and parse an owner's {@link https://solana.com/docs/tokens#token-account | Token account} for a\n * {@link https://solana.com/docs/tokens#mint-account | Mint} and {@link https://solana.com/docs/tokens#token-programs | Token Program}\n */\nexport function useTokenAccount<TConfig extends RpcConfig = RpcConfig, TAddress extends Address = Address>({\n  options,\n  config,\n  abortSignal,\n  // tokenProgram,\n  ...tokenAccountOptions\n}: UseTokenAccountInput<TConfig, TAddress>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  if (abortSignal) {\n    // @ts-expect-error the `abortSignal` was stripped from the type but is now being added back in\n    config = {\n      ...(config || {}),\n      abortSignal,\n    };\n  }\n\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled:\n      (options?.enabled ?? true) &&\n      (hasDeclaredAta(tokenAccountOptions)\n        ? !!tokenAccountOptions.ata\n        : Boolean(tokenAccountOptions.mint && tokenAccountOptions.owner)),\n    queryFn: async () => {\n      let ata: Address;\n\n      if (hasDeclaredAta(tokenAccountOptions)) {\n        // if the user manually provides the ata, we will use that\n        ata = tokenAccountOptions.ata;\n      } else {\n        // auto fetch the token program address if not provided\n        if (!tokenAccountOptions.tokenProgram) {\n          const mint = await fetchMint(rpc, address(tokenAccountOptions.mint));\n          tokenAccountOptions.tokenProgram = mint.programAddress;\n        }\n\n        checkedTokenProgramAddress(tokenAccountOptions.tokenProgram);\n\n        ata = await getAssociatedTokenAccountAddress(\n          tokenAccountOptions.mint,\n          tokenAccountOptions.owner,\n          tokenAccountOptions.tokenProgram,\n        );\n      }\n\n      assertIsAddress(ata);\n      const account = await fetchEncodedAccount(rpc, ata, config);\n      assertAccountExists(account);\n      return decodeToken(account);\n    },\n    queryKey: [\n      GILL_HOOK_CLIENT_KEY,\n      urlOrMoniker,\n      \"getTokenAccount\",\n      hasDeclaredAta(tokenAccountOptions)\n        ? [{ ata: tokenAccountOptions.ata }]\n        : [\n            {\n              mint: tokenAccountOptions.mint,\n              owner: tokenAccountOptions.owner,\n            },\n          ],\n    ],\n  });\n\n  return {\n    ...rest,\n    account: data as UseTokenAccountResponse<TAddress>,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Account, Address, FetchAccountConfig, Simplify } from \"gill\";\nimport { assertAccountExists, fetchEncodedAccount } from \"gill\";\nimport { decodeMint, type Mint } from \"gill/programs\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Omit<FetchAccountConfig, \"abortSignal\">>;\n\ntype UseTokenMintResponse<TAddress extends string = string> = Simplify<\n  Account<Mint, TAddress> & {\n    exists: true;\n  }\n>;\n\ntype UseTokenMintInput<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the Mint account to get and decode\n   */\n  mint: Address<TAddress> | TAddress;\n};\n\n/**\n * Get and parse a token's {@link https://solana.com/docs/tokens#mint-account | Mint account}\n */\nexport function useTokenMint<TConfig extends RpcConfig = RpcConfig, TAddress extends string = string>({\n  options,\n  config,\n  abortSignal,\n  mint,\n}: UseTokenMintInput<TConfig, TAddress>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  if (abortSignal) {\n    // @ts-expect-error we stripped the `abortSignal` from the type but are now adding it back in\n    config = {\n      ...(config || {}),\n      abortSignal,\n    };\n  }\n\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!mint,\n    queryFn: async () => {\n      const account = await fetchEncodedAccount(rpc, mint as Address<TAddress>, config);\n      assertAccountExists(account);\n      return decodeMint(account);\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getMintAccount\", mint],\n  });\n  return {\n    ...rest,\n    account: data as UseTokenMintResponse<TAddress>,\n  };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetTransactionApi, Signature, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetTransactionApi[\"getTransaction\"]>[1]>;\n\ntype UseTransactionResponse = ReturnType<GetTransactionApi[\"getTransaction\"]>;\n\ntype UseTransactionInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * Transaction signature as a base-58 encoded string\n   */\n  signature: Signature | string;\n};\n\n/**\n * Get transaction details for a confirmed transaction using the Solana RPC method of\n * [`getTransaction`](https://solana.com/docs/rpc/http/gettransaction)\n *\n * Default `config` includes:\n * - `maxSupportedTransactionVersion` of `0`\n * - `encoding` of `json`\n */\nexport function useTransaction<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  signature,\n}: UseTransactionInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!signature,\n    queryFn: async () => {\n      const response = await rpc\n        .getTransaction(signature as Signature, {\n          encoding: \"json\",\n          // set default values for better DX\n          maxSupportedTransactionVersion: 0,\n          ...(config || {}),\n        })\n        .send({ abortSignal });\n      return response;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getTransaction\", signature],\n  });\n  return {\n    ...rest,\n    transaction: data as UseTransactionResponse,\n  };\n}\n","\"use client\";\n\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport type { SolanaClient } from \"gill\";\nimport React from \"react\";\nimport { GILL_HOOK_CLIENT_KEY } from \"./const.js\";\n\n/**\n * Provider to utilize gill hooks for Solana\n */\nexport function SolanaProvider({\n  client,\n  children,\n  queryClient = new QueryClient(),\n}: {\n  client: SolanaClient;\n  children: React.ReactNode;\n  queryClient?: QueryClient;\n}) {\n  queryClient.setQueryData([GILL_HOOK_CLIENT_KEY], client);\n  return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;\n}\n","// @ts-ignore - Patch BigInt to allow calling `JSON.stringify` on objects that use\ninterface BigInt {\n  /** Convert a BigInt to string form when calling `JSON.stringify()` */\n  toJSON: () => string;\n}\n\n// @ts-ignore - Only add the toJSON method if it doesn't already exist\nif (BigInt.prototype.toJSON === undefined) {\n  // @ts-ignore - toJSON does not exist which is why we are patching it\n  BigInt.prototype.toJSON = function () {\n    return String(this);\n  };\n}\n\nexport * from \"./const.js\";\nexport * from \"./hooks/index.js\";\nexport * from \"./providers.js\";\n\n/**\n * Reexporting the Solana Wallet Standard functionality allows gill to\n * provide a cohesive developer experience\n */\nexport * from \"@solana/react\";\nexport * from \"@solana/wallet-standard-chains\";\nexport * from \"@solana/wallet-standard-features\";\nexport * from \"@wallet-standard/core\";\nexport * from \"@wallet-standard/react\";\nexport * from \"@wallet-standard/ui\";\n"]}