> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arksat.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK utilities and Provider

> Detection, Client construction, and raw RPC.

## getArksatProvider

`getArksatProvider(): ArksatProvider | undefined` detects the extension immediately. Returns undefined during SSR; does not connect or unlock.

## waitForArksatProvider

`waitForArksatProvider({ timeoutMs?, signal? }): Promise<ArksatProvider>` waits for injection. Default timeout: 5000 ms.

## createArksatClient

```ts theme={null}
import { waitForArksatProvider, createArksatClient } from '@arksat/wallet-sdk'
const provider = await waitForArksatProvider()
const client = createArksatClient(provider)
```

Wraps Provider methods with object parameters and named results. It does not automatically request permissions or retry mutations.

| Operation | Client | Provider |
| - | - | - |
| Connect | accounts object | Address array |
| Send BTC | Object parameters; txid object | Positional parameters; txid string |
| Send tokens | Object parameters; txid object | Positional parameters; txid string |
| Sign | Named fields | String or string array |

## request

RPC params are tuples matching raw Provider arguments:

```ts theme={null}
const network = await provider.request({ method: 'getNetwork' })
const txid = await provider.request({
  method: 'sendToAddress',
  params: [address, 1000],
})
```

Supported RPC methods are listed by ARKSAT\_PROVIDER\_METHODS and getCapabilities. requestAccounts is a convenience alias.

## Amount utilities

decimalAmountToRaw, formatRawAssetAmount, and toRawAmountString handle exact conversion. [Amounts](https://docs.arksat.xyz/en/amounts.md).

## Scope

The SDK uses the browser extension, not a remote Web wallet HTTP API. Private-key export, internal wallet administration, and settlement are not public RPC methods.

## Error guards and development exports

`isArksatProviderError(error)` structurally checks known error codes, `message`, and `retryable` across bundles and execution contexts. It does not rely on `instanceof`.

`@arksat/wallet-sdk/mock` exports `createMockProvider`; `@arksat/wallet-sdk/conformance` exports `runConformance`. These exports are independent of the main entry. See [developer tools](https://docs.arksat.xyz/en/developer-tools.md).

Wait timeout and polling values must be finite milliseconds from 0 to 2147483647; invalid values reject with `TypeError`. `waitForTransaction` polls no faster than once per 1000 ms. Conformance `timeoutMs` must be strictly positive.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.