> ## Documentation Index
> Fetch the complete documentation index at: https://trust-link-tsn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# gpru/chain-history API

> Source-derived exports, parameter and result types, public methods and source links.

This reference is generated from the checked-out TypeScript exports. Types and signatures describe the package contract; source presence does not establish deployment or service availability. Error expressions below are direct throws, not an exhaustive list of failures from dependencies.

[Source module](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts). See the [reference index](https://trust-link-tsn.mintlify.site/sdk/api-reference.md) for package import boundaries and verification scope.

## decodeFinalizedGpruCreditV1

Read current and historical credit receipts for owner recovery only.

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/chain-history`. [Implementation, line 93](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts#L93).

```ts theme={null}
decodeFinalizedGpruCreditV1(wire: GpruHistoryWireTransactionV1, signature: string, slot: number): GpruFinalizedCreditV1 | null
```

## decodeFinalizedGpruTinDebitV1

Chain acceptance plus exact account, public digest and both compact Memo bindings.

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/chain-history`. [Implementation, line 61](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts#L61).

```ts theme={null}
decodeFinalizedGpruTinDebitV1(wire: GpruHistoryWireTransactionV1, signature: string, slot: number): GpruFinalizedTinDebitV1 | null
```

## GpruFinalizedCreditV1

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/chain-history`. [Implementation, line 38](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts#L38).

```ts theme={null}
export type GpruFinalizedCreditV1 = {
  signature: string;
  slot: number;
  sequence: bigint;
  oldRoot: string;
  newRoot: string;
  memoPayload: string;
  assetEntry: string;
  reserveState: string;
  fundingProofVersion: 1 | 2 | 3;
  accountingEpoch?: string;
  fundingRoot?: string;
  action: GpruDecryptedMemoActionV1["onChainAction"];
};
```

## GpruFinalizedTinDebitV1

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/chain-history`. [Implementation, line 53](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts#L53).

```ts theme={null}
export type GpruFinalizedTinDebitV1 = {
  kind: "TIN_DEBIT"; signature: string; slot: number; sequence: bigint; oldRoot: string; newRoot: string;
  memoPayloads: [string, string]; assetEntry: string; reserveState: string; proof: GpruTinDebitProofV1;
  action: { actionKind: 4; tokenId: number; amountCommitment: string; actionCommitment: string; authorizationCommitment: string; nullifier: string };
};
```

## GpruFinalizedTransitionV1

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/chain-history`. [Implementation, line 58](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts#L58).

```ts theme={null}
export type GpruFinalizedTransitionV1 = GpruFinalizedCreditV1 | GpruFinalizedTinDebitV1;
```

## loadGpruFinalizedCreditHistoryV1

Read only public finalized credits. No owner key material enters RPC calls.

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/chain-history`. [Implementation, line 214](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts#L214).

```ts theme={null}
loadGpruFinalizedCreditHistoryV1(params: { connection: Connection; signal?: AbortSignal; onProgress?: (message: string) => void; }): Promise<{ credits: GpruFinalizedTransitionV1[]; snapshot: RootSnapshot; }>
```

## loadTinGpruDebitOpeningV1

Private owner-seed scope only; the high-level wallet-authorized callback owns consent.

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/chain-history`. [Implementation, line 363](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts#L363).

```ts theme={null}
loadTinGpruDebitOpeningV1(params: OwnerHistoryParams & { tokenId: number; expectedGlobalRoot: string; expectedRootSequence: string; }): Promise<GpruTinDebitOwnerOpeningV1>
```

## loadTinGpruTokenBalancesV1

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/chain-history`. [Implementation, line 348](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts#L348).

```ts theme={null}
loadTinGpruTokenBalancesV1(params: OwnerHistoryParams): Promise<{ tokenBalances: Array<{ tokenId: number; mint: string; decimals: number; balanceBaseUnits: string; }>; latestGlobalSequence: string; latestOwnerSequence: string; actionCount: number; }>
```

## validateGpruGlobalCreditHistoryV1

Require every global transition from the activated empty root through the finalized snapshot.

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/chain-history`. [Implementation, line 186](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/chain-history.ts#L186).

```ts theme={null}
validateGpruGlobalCreditHistoryV1(credits: readonly GpruFinalizedTransitionV1[], snapshot: RootSnapshot): void
```


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