> ## 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/tin-debit-record 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/tin-debit-record.ts). See the [reference index](https://trust-link-tsn.mintlify.site/sdk/api-reference.md) for package import boundaries and verification scope.

## decryptGpruTinDebitOwnerRecordV1

Authenticate this owner's compact action against an already accepted statement.

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/tin-debit-record`. [Implementation, line 115](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/tin-debit-record.ts#L115).

```ts theme={null}
decryptGpruTinDebitOwnerRecordV1(params: { memoPayload: string; masterSeed: Uint8Array; gpruElgamalPublicKey: Uint8Array; gpruBalanceScanPublicKeyX: Uint8Array; gpruBalanceScanPublicKeyY: Uint8Array; publicInputs: readonly string[]; expectedLeg: 0 | 1; }): { record: GpruTinDebitOwnerRecordV1; balanceBlindingDelta: string; }
```

## deriveGpruTinDebitBalancePointV1

TCAP point encoding; transfer openings allow u128 accumulated balances and the empty identity.

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/tin-debit-record`. [Implementation, line 37](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/tin-debit-record.ts#L37).

```ts theme={null}
deriveGpruTinDebitBalancePointV1(balance: string, blinding: string): BabyJubPointV1
```

## GpruTinDebitMemoBindingV1

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/tin-debit-record`. [Implementation, line 42](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/tin-debit-record.ts#L42).

```ts theme={null}
export type GpruTinDebitMemoBindingV1 = {
  leg: 0 | 1; successorPortfolioRoot: string; successorBalancePoint: { x: string; y: string };
  actionCommitment: string; encryptedBlindingDelta: string; deltaEphemeralPublicKey: { x: string; y: string };
};
```

## GpruTinDebitOwnerRecordV1

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/tin-debit-record`. [Implementation, line 46](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/tin-debit-record.ts#L46).

```ts theme={null}
export type GpruTinDebitOwnerRecordV1 = {
  version: 1; recordType: "tsn-gpru-tin-debit-action-v1"; actionKind: 4; leg: 0 | 1;
  sequence: string; previousMemoCommitment: string; actionCommitment: string; authorizationCommitment: string;
  nullifier: string; tokenId: number; amountBaseUnits: string; amountCommitment: string; amountBlinding: string;
};
```

## parseGpruTinDebitMemoBindingV1

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

```ts theme={null}
parseGpruTinDebitMemoBindingV1(memoPayload: string): GpruTinDebitMemoBindingV1
```

Direct failure expressions:

```text theme={null}
new Error("Transfer Memo point or delta cipher is invalid")
```

## recoverGpruTinDebitOwnerOpeningV1

Recover one owner's successor after the caller independently verifies this exact
Groth16 statement and authenticates the prior opening against its selected root.
This helper verifies records and arithmetic; it does not verify a proof or receipt.

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/tin-debit-record`. [Implementation, line 131](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/tin-debit-record.ts#L131).

```ts theme={null}
recoverGpruTinDebitOwnerOpeningV1(params: { memoPayload: string; masterSeed: Uint8Array; gpruElgamalPublicKey: Uint8Array; gpruBalanceScanPublicKeyX: Uint8Array; gpruBalanceScanPublicKeyY: Uint8Array; publicInputs: readonly string[]; expectedLeg: 0 | 1; priorOpening: GpruTinDebitOwnerOpeningV1; }): GpruTinDebitOwnerOpeningV1
```

Direct failure expressions:

```text theme={null}
new Error("Transfer recovery requires one explicit owner leg")
new Error("Transfer Memo differs from its verified leg statement")
new Error("Transfer prior opening has an unsupported field set")
new Error("Prior owner sequence and Memo disagree")
new Error("Transfer owner record differs from its predecessor or verified statement")
new Error("Transfer recovered balance is outside u128")
new Error("Transfer recovered opening differs from the proof-bound successor point")
```

## validateGpruTinDebitOwnerRecordV1

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/gpru/tin-debit-record`. [Implementation, line 65](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/gpru/tin-debit-record.ts#L65).

```ts theme={null}
validateGpruTinDebitOwnerRecordV1(value: unknown): GpruTinDebitOwnerRecordV1
```

Direct failure expressions:

```text theme={null}
new Error("Transfer owner record has an unsupported field set")
new Error("Unsupported transfer owner record")
new Error("Transfer record token ID must be a positive u32")
new Error("Transfer record sequence and predecessor Memo disagree")
new Error("Transfer private amount opening differs from its commitment")
new Error("Transfer private action commitment differs from its statement")
```


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