client
Classes
Section titled “Classes”AccountDecodeError
Section titled “AccountDecodeError”Defined in: packages/sage/src/client/errors.ts:190
Error thrown when validated account data cannot produce a trustworthy SDK snapshot.
Examples
Section titled “Examples”declare const fleetAddress: Address;declare const cause: unknown;throw new AccountDecodeError('fleet', fleetAddress, cause);declare const characterAddress: Address;declare const cause: unknown;throw new AccountDecodeError( 'character', characterAddress, cause, 'The Character references a different Profile. Verify the Profile address and retry.',);message
Optional cause-and-remedy guidance for validated data that decoded successfully but contradicts the requested gameplay relationship.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AccountDecodeError( accountType, address, cause, message?): AccountDecodeError;Defined in: packages/sage/src/client/errors.ts:191
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accountType | EntityType |
address | Address |
cause | unknown |
message | string |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
AccountNotFoundError
Section titled “AccountNotFoundError”Defined in: packages/sage/src/client/errors.ts:113
Error thrown when a required account does not exist at the requested address.
Example
Section titled “Example”declare const fleetAddress: Address;throw new AccountNotFoundError('fleet', fleetAddress);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AccountNotFoundError(accountType, address): AccountNotFoundError;Defined in: packages/sage/src/client/errors.ts:114
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accountType | EntityType |
address | Address |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
ContextDisposedError
Section titled “ContextDisposedError”Defined in: packages/sage/src/client/errors.ts:96
Error thrown when a read API is invoked after its context is disposed.
Example
Section titled “Example”throw new ContextDisposedError();Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ContextDisposedError(): ContextDisposedError;Defined in: packages/sage/src/client/errors.ts:97
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
InvalidAccountOwnerError
Section titled “InvalidAccountOwnerError”Defined in: packages/sage/src/client/errors.ts:133
Error thrown when an account belongs to a different program.
Example
Section titled “Example”declare const fleetAddress: Address;declare const sageProgram: Address;declare const actualOwner: Address;throw new InvalidAccountOwnerError('fleet', fleetAddress, sageProgram, actualOwner);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InvalidAccountOwnerError( accountType, address, expectedOwner, actualOwner): InvalidAccountOwnerError;Defined in: packages/sage/src/client/errors.ts:134
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accountType | EntityType |
address | Address |
expectedOwner | Address |
actualOwner | Address |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
InvalidDerivationInputError
Section titled “InvalidDerivationInputError”Defined in: packages/sage/src/client/errors.ts:334
Error thrown when a pure gameplay derivation input cannot be encoded or used safely.
Example
Section titled “Example”throw new InvalidDerivationInputError('Fleet mining units per second', -1);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InvalidDerivationInputError( field, value, remedy?): InvalidDerivationInputError;Defined in: packages/sage/src/client/errors.ts:338
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
field | string | undefined |
value | number | bigint | undefined |
remedy | string | 'Supply a finite, nonnegative number before deriving the gameplay value.' |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”readonly field: string;Defined in: packages/sage/src/client/errors.ts:335
message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”readonly value: number | bigint;Defined in: packages/sage/src/client/errors.ts:336
stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
InvalidDiscriminatorError
Section titled “InvalidDiscriminatorError”Defined in: packages/sage/src/client/errors.ts:156
Error thrown when account bytes do not start with the expected discriminator.
Example
Section titled “Example”declare const fleetAddress: Address;throw new InvalidDiscriminatorError('fleet', fleetAddress);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InvalidDiscriminatorError(accountType, address): InvalidDiscriminatorError;Defined in: packages/sage/src/client/errors.ts:157
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accountType | EntityType |
address | Address |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
InvalidEntityIdError
Section titled “InvalidEntityIdError”Defined in: packages/sage/src/client/errors.ts:277
Error thrown when a generated account id cannot fit its unsigned 16-bit PDA seed.
Example
Section titled “Example”throw new InvalidEntityIdError('recipe', 65_536);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InvalidEntityIdError(entityType, id): InvalidEntityIdError;Defined in: packages/sage/src/client/errors.ts:288
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
entityType | | "starSystem" | "celestialBody" | "recipe" | "market" | "scanPattern" | "faction" | "region" |
id | number |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”entityType
Section titled “entityType”readonly entityType: | "starSystem" | "celestialBody" | "recipe" | "market" | "scanPattern" | "faction" | "region";Defined in: packages/sage/src/client/errors.ts:278
readonly id: number;Defined in: packages/sage/src/client/errors.ts:286
message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
MissingGameContextError
Section titled “MissingGameContextError”Defined in: packages/sage/src/client/errors.ts:260
Error thrown when an operation needs a canonical Game address.
Example
Section titled “Example”throw new MissingGameContextError();Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MissingGameContextError(): MissingGameContextError;Defined in: packages/sage/src/client/errors.ts:261
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
ProviderError
Section titled “ProviderError”Defined in: packages/sage/src/client/errors.ts:208
Error thrown when the configured provider cannot satisfy a read.
Example
Section titled “Example”throw new ProviderError('The z.ink provider is unavailable. Check its endpoint and retry.');Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ProviderError(message, details?): ProviderError;Defined in: packages/sage/src/client/errors.ts:209
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message | string |
details | SageSdkErrorDetails |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
RegistryOutOfSyncError
Section titled “RegistryOutOfSyncError”Defined in: packages/sage/src/client/errors.ts:397
Error thrown when live state and one cached definitions section disagree.
A cached section behind live state is marked for refresh on its next lookup. After an authoritative read confirms that mismatch, further refresh attempts for the section are coalesced for one second. Sequence-sensitive sections reject callers behind the loaded section. Ship lookups may reuse newer stable identity summaries; an id removed from the newer ship rows throws without scheduling an impossible historical refresh.
Example
Section titled “Example”throw new RegistryOutOfSyncError('ships', 12, 11, 3);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RegistryOutOfSyncError( section, expectedSequenceId, actualSequenceId, definitionId, definitionMissingAfterRefresh?): RegistryOutOfSyncError;Defined in: packages/sage/src/client/errors.ts:406
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
section | "ships" | "cargo" | "craftingHabs" | "habBuildings" | "xp" | "research" | undefined |
expectedSequenceId | number | undefined | undefined |
actualSequenceId | number | undefined |
definitionId | number | undefined |
definitionMissingAfterRefresh | boolean | false |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”actualSequenceId
Section titled “actualSequenceId”readonly actualSequenceId: number;Defined in: packages/sage/src/client/errors.ts:401
address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”definitionId
Section titled “definitionId”readonly definitionId: number;Defined in: packages/sage/src/client/errors.ts:402
definitionMissingAfterRefresh
Section titled “definitionMissingAfterRefresh”readonly definitionMissingAfterRefresh: boolean;Defined in: packages/sage/src/client/errors.ts:404
Whether a fresh Game read already confirmed the definition is absent.
expectedSequenceId
Section titled “expectedSequenceId”readonly expectedSequenceId: number | undefined;Defined in: packages/sage/src/client/errors.ts:400
message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”section
Section titled “section”readonly section: "ships" | "cargo" | "craftingHabs" | "habBuildings" | "xp" | "research";Defined in: packages/sage/src/client/errors.ts:398
stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
RelationshipNotDiscoverableError
Section titled “RelationshipNotDiscoverableError”Defined in: packages/sage/src/client/errors.ts:247
Error thrown when a requested relationship has no configured discovery capability.
Example
Section titled “Example”throw new RelationshipNotDiscoverableError( 'Wallet-to-Profile discovery is unavailable. Configure a provider.',);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RelationshipNotDiscoverableError(message, details?): RelationshipNotDiscoverableError;Defined in: packages/sage/src/client/errors.ts:248
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message | string |
details | SageSdkErrorDetails |
Returns
Section titled “Returns”RelationshipNotDiscoverableError
Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
ResourceLimitExceededError
Section titled “ResourceLimitExceededError”Defined in: packages/sage/src/client/errors.ts:221
Error thrown before an untrusted collection or payload can exceed a context limit.
Example
Section titled “Example”throw new ResourceLimitExceededError('discovery results', 1001, 1000);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ResourceLimitExceededError( resource, actual, limit): ResourceLimitExceededError;Defined in: packages/sage/src/client/errors.ts:227
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
resource | string |
actual | number |
limit | number |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
Inherited from
Section titled “Inherited from”actual
Section titled “actual”readonly actual: number;Defined in: packages/sage/src/client/errors.ts:224
The observed quantity, or a conservative decoded-byte upper bound when an encoded payload is rejected before decoding.
address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
Inherited from
Section titled “Inherited from”readonly limit: number;Defined in: packages/sage/src/client/errors.ts:225
message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
Inherited from
Section titled “Inherited from”resource
Section titled “resource”readonly resource: string;Defined in: packages/sage/src/client/errors.ts:222
stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”SageSdkError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”SageSdkError.prepareStackTrace
SageSdkError
Section titled “SageSdkError”Defined in: packages/sage/src/client/errors.ts:67
Base error for all SDK failures.
Messages identify the gameplay cause and a corrective next step.
Example
Section titled “Example”throw new SageSdkError( 'ACCOUNT_NOT_FOUND', 'The Fleet account was not found. Verify the Fleet address and cluster.',);Extends
Section titled “Extends”Error
Extended by
Section titled “Extended by”AccountDecodeErrorAccountNotFoundErrorContextDisposedErrorInvalidAccountOwnerErrorInvalidDiscriminatorErrorInvalidDerivationInputErrorInvalidEntityIdErrorMissingGameContextErrorProviderErrorResourceLimitExceededErrorRelationshipNotDiscoverableErrorRegistryOutOfSyncError
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SageSdkError( code, message, details?): SageSdkError;Defined in: packages/sage/src/client/errors.ts:74
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code | SageSdkErrorCode |
message | string |
details | SageSdkErrorDetails |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructorProperties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType | undefined;Defined in: packages/sage/src/client/errors.ts:69
address
Section titled “address”readonly address: Address | undefined;Defined in: packages/sage/src/client/errors.ts:70
cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”Error.causereadonly code: SageSdkErrorCode;Defined in: packages/sage/src/client/errors.ts:68
message
Section titled “message”message: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”Error.messagename: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”Error.nameprovider
Section titled “provider”readonly provider: | DataSourceIdentity | undefined;Defined in: packages/sage/src/client/errors.ts:71
stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”Error.stackstrategy
Section titled “strategy”readonly strategy: DiscoveryStrategy | undefined;Defined in: packages/sage/src/client/errors.ts:72
stackTraceLimit
Section titled “stackTraceLimit”static stackTraceLimit: number;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Error.stackTraceLimitMethods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Error.captureStackTraceprepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.10.1/node_modules/@types/node/globals.d.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”Error.prepareStackTraceInterfaces
Section titled “Interfaces”AccountDefinition
Section titled “AccountDefinition”Defined in: packages/sage/src/client/contracts.ts:431
Adapter-owned definition for validating and decoding one account type.
Decoded snapshots may contain primitives, arrays, and plain objects. Account
definitions must normalize mutation-capable built-ins such as typed arrays,
Date, Map, and Set to immutable domain values before returning them.
The returned value must be an acyclic JSON-safe tree without undefined,
symbol-keyed properties, accessors, or functions. Acyclic repeated object
references are allowed and retain their identity in the frozen runtime tree.
Each decoder receives an isolated copy of the untrusted provider account, so
decoder mutation cannot affect another concurrent decoder or raw read.
Decoders return plain data without methods. Public domain layers attach their
required toJSON() method after reading through this port; returning a
method from decode violates the immutable plain-data contract.
A context reuses decoded cache entries only for the same definition object;
distinct definitions cannot consume or overwrite each other’s typed data.
Keep definitions as stable module-level singletons. Reconstructing an
equivalent definition for each call deliberately creates independent cache
slots and prevents cache reuse.
Example
Section titled “Example”declare const programAddress: Address;const definition: AccountDefinition<{ name: string }> = { type: 'fleet', programAddress, discriminator: new Uint8Array([1]), minimumDataLength: 128, decode: () => ({ name: 'Ravager' }),};Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TSnapshot |
Properties
Section titled “Properties”discriminator
Section titled “discriminator”readonly discriminator: Uint8Array<ArrayBufferLike> | readonly number[];Defined in: packages/sage/src/client/contracts.ts:434
minimumDataLength?
Section titled “minimumDataLength?”readonly optional minimumDataLength?: number;Defined in: packages/sage/src/client/contracts.ts:436
Optional positive safe-integer byte minimum enforced before decoding.
programAddress
Section titled “programAddress”readonly programAddress: Address;Defined in: packages/sage/src/client/contracts.ts:433
readonly type: EntityType;Defined in: packages/sage/src/client/contracts.ts:432
Methods
Section titled “Methods”decode()
Section titled “decode()”decode(account): Readonly<TSnapshot>;Defined in: packages/sage/src/client/contracts.ts:437
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
account | RawAccount |
Returns
Section titled “Returns”Readonly<TSnapshot>
AccountProvider
Section titled “AccountProvider”Defined in: packages/sage/src/client/contracts.ts:315
Provider contract for raw z.ink account access.
Provider results remain untrusted until an account definition validates and
decodes them. Provider implementations must sanitize transport-specific
causes before wrapping them in a typed SageSdkError; unknown exceptions are
normalized by the data plane without retaining their raw cause.
Example
Section titled “Example”const provider: AccountProvider = { identity: { kind: 'fixture', name: 'unit-test' }, readAccount: async () => undefined, discoverAccounts: async () => [],};Properties
Section titled “Properties”identity
Section titled “identity”readonly identity: DataSourceIdentity;Defined in: packages/sage/src/client/contracts.ts:316
Methods
Section titled “Methods”discoverAccounts()
Section titled “discoverAccounts()”discoverAccounts(request): Promise<readonly RawAccount[]>;Defined in: packages/sage/src/client/contracts.ts:332
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request | ProgramAccountRequest |
Returns
Section titled “Returns”Promise<readonly RawAccount[]>
readAccount()
Section titled “readAccount()”readAccount(address, options?): Promise<RawAccount | undefined>;Defined in: packages/sage/src/client/contracts.ts:317
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
address | Address |
options? | ReadAccountOptions |
Returns
Section titled “Returns”Promise<RawAccount | undefined>
readAccounts()?
Section titled “readAccounts()?”optional readAccounts(addresses, options?): Promise<readonly (RawAccount | undefined)[]>;Defined in: packages/sage/src/client/contracts.ts:328
Optional provider batching capability.
Implementations preserve input order. Callers can fall back to ordered
readAccount calls when a provider does not expose this transport method.
Large reads can span multiple source slots because every RPC chunk records
its own response context.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
addresses | readonly Address[] |
options? | ReadAccountOptions |
Returns
Section titled “Returns”Promise<readonly (RawAccount | undefined)[]>
CacheKey
Section titled “CacheKey”Defined in: packages/sage/src/client/contracts.ts:763
Address-keyed cache identity scoped to one context.
Example
Section titled “Example”declare const programAddress: Address;declare const address: Address;const key: CacheKey = { cluster: 'zink-ptr', programAddress, accountType: 'fleet', address };Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType;Defined in: packages/sage/src/client/contracts.ts:766
address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/client/contracts.ts:767
cluster
Section titled “cluster”readonly cluster: ClusterIdentity;Defined in: packages/sage/src/client/contracts.ts:764
programAddress
Section titled “programAddress”readonly programAddress: Address;Defined in: packages/sage/src/client/contracts.ts:765
CacheRecord
Section titled “CacheRecord”Defined in: packages/sage/src/client/contracts.ts:781
Compatibility prototype; not the runtime cache representation.
The shipped context owns its cache internally and does not expose cache records for inspection or mutation.
Example
Section titled “Example”declare const record: CacheRecord<unknown>;const snapshot = record.invalidated ? undefined : record.snapshot;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TSnapshot |
Properties
Section titled “Properties”invalidated
Section titled “invalidated”readonly invalidated: boolean;Defined in: packages/sage/src/client/contracts.ts:784
readonly key: CacheKey;Defined in: packages/sage/src/client/contracts.ts:782
snapshot
Section titled “snapshot”readonly snapshot: SnapshotEnvelope<TSnapshot>;Defined in: packages/sage/src/client/contracts.ts:783
CustomClusterIdentity
Section titled “CustomClusterIdentity”Defined in: packages/sage/src/client/contracts.ts:128
An application-defined cluster identity.
Example
Section titled “Example”const cluster: CustomClusterIdentity = { name: 'local-fixture' };Properties
Section titled “Properties”readonly name: string;Defined in: packages/sage/src/client/contracts.ts:129
DataSourceIdentity
Section titled “DataSourceIdentity”Defined in: packages/sage/src/client/contracts.ts:148
The source that supplied a raw account or translated snapshot.
Example
Section titled “Example”const source: DataSourceIdentity = { kind: 'fixture', name: 'unit-test' };Properties
Section titled “Properties”readonly kind: "indexer" | "rpc" | "websocket" | "fixture" | "application";Defined in: packages/sage/src/client/contracts.ts:149
readonly name: string;Defined in: packages/sage/src/client/contracts.ts:150
DiagnosticEvent
Section titled “DiagnosticEvent”Defined in: packages/sage/src/client/contracts.ts:797
Compatibility prototype; no context-wide diagnostic emitter ships.
Shipped diagnostics are limited to finder provenance through readMeta() and
subscription delivery events through SubscriptionObserver.onDiagnostic.
Example
Section titled “Example”const event: DiagnosticEvent = { kind: 'cache-hit', cluster: 'zink-ptr' };Properties
Section titled “Properties”accountType?
Section titled “accountType?”readonly optional accountType?: EntityType;Defined in: packages/sage/src/client/contracts.ts:802
address?
Section titled “address?”readonly optional address?: Address;Defined in: packages/sage/src/client/contracts.ts:801
cluster
Section titled “cluster”readonly cluster: ClusterIdentity;Defined in: packages/sage/src/client/contracts.ts:800
readonly kind: | "cache-hit" | "cache-miss" | "provider-read" | "validation" | "discovery";Defined in: packages/sage/src/client/contracts.ts:798
DiscoveryRequest
Section titled “DiscoveryRequest”Defined in: packages/sage/src/client/contracts.ts:518
A discovery request supplied to the shared data port.
Discovery always consults the provider, so direct-read freshness controls
such as refresh and maxAgeMs are intentionally unavailable.
Example
Section titled “Example”const request: DiscoveryRequest = { strategy: 'targeted-program-accounts', filters: [],};Extends
Section titled “Extends”Properties
Section titled “Properties”commitment?
Section titled “commitment?”readonly optional commitment?: Commitment;Defined in: packages/sage/src/client/contracts.ts:179
Inherited from
Section titled “Inherited from”filters
Section titled “filters”readonly filters: readonly ProgramAccountFilter[];Defined in: packages/sage/src/client/contracts.ts:528
policy?
Section titled “policy?”readonly optional policy?: "cache-first" | "no-store";Defined in: packages/sage/src/client/contracts.ts:520
Controls whether validated discoveries populate the account cache.
signal?
Section titled “signal?”readonly optional signal?: AbortSignal;Defined in: packages/sage/src/client/contracts.ts:180
Inherited from
Section titled “Inherited from”strategy
Section titled “strategy”readonly strategy: AccountDiscoveryStrategy;Defined in: packages/sage/src/client/contracts.ts:527
Selects the discovery behavior when no indexer takes precedence.
When an indexer is configured, targeted-program-accounts, broad-scan,
and indexer are advisory and use the indexer. Use direct or derived
to bypass the indexer for a request.
IndexerDiscoveryRequest
Section titled “IndexerDiscoveryRequest”Defined in: packages/sage/src/client/contracts.ts:224
Address-only discovery request accepted by a replaceable indexer.
Indexers return candidate addresses, never decoded domain state. The context validates every candidate through its direct account provider before a finder can expose it.
Example
Section titled “Example”declare const programAddress: Address;const request: IndexerDiscoveryRequest = { accountType: 'fleet', programAddress, filters: [],};Extends
Section titled “Extends”Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType;Defined in: packages/sage/src/client/contracts.ts:225
commitment?
Section titled “commitment?”readonly optional commitment?: Commitment;Defined in: packages/sage/src/client/contracts.ts:179
Inherited from
Section titled “Inherited from”ProgramAccountRequest.commitment
filters
Section titled “filters”readonly filters: readonly ProgramAccountFilter[];Defined in: packages/sage/src/client/contracts.ts:205
Inherited from
Section titled “Inherited from”programAddress
Section titled “programAddress”readonly programAddress: Address;Defined in: packages/sage/src/client/contracts.ts:204
Inherited from
Section titled “Inherited from”ProgramAccountRequest.programAddress
signal?
Section titled “signal?”readonly optional signal?: AbortSignal;Defined in: packages/sage/src/client/contracts.ts:180
Inherited from
Section titled “Inherited from”IndexerProvider
Section titled “IndexerProvider”Defined in: packages/sage/src/client/contracts.ts:247
Optional address-only provider for reverse and high-cardinality discovery.
Implementations must treat signal as cancellation, preserve candidate
order, and sanitize transport failures before throwing a SageSdkError.
Duplicate addresses are allowed; the context deduplicates them before direct
validation. A configured provider must support every account type and stable
filter request that its context may issue. An empty result means the request
is supported and has no candidates; it does not trigger RPC fallback. Use a
separate context or the direct/derived strategies when indexer coverage is
intentionally partial.
Example
Section titled “Example”const indexer: IndexerProvider = { identity: { kind: 'indexer', name: 'application-indexer' }, discoverAddresses: async () => [],};Properties
Section titled “Properties”identity
Section titled “identity”readonly identity: DataSourceIdentity & { kind: "indexer";};Defined in: packages/sage/src/client/contracts.ts:248
Type Declaration
Section titled “Type Declaration”readonly kind: "indexer";Methods
Section titled “Methods”discoverAddresses()
Section titled “discoverAddresses()”discoverAddresses(request): Promise<readonly Address[]>;Defined in: packages/sage/src/client/contracts.ts:249
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request | IndexerDiscoveryRequest |
Returns
Section titled “Returns”Promise<readonly Address[]>
IndexerValidationMeta
Section titled “IndexerValidationMeta”Defined in: packages/sage/src/internal/read-meta.ts:48
Conservative validation summary for address hints returned by an indexer.
Example
Section titled “Example”const summary: IndexerValidationMeta = { candidateCount: 3, duplicateCount: 1, missingCount: 1, validatedCount: 1,};Properties
Section titled “Properties”candidateCount
Section titled “candidateCount”readonly candidateCount: number;Defined in: packages/sage/src/internal/read-meta.ts:49
duplicateCount
Section titled “duplicateCount”readonly duplicateCount: number;Defined in: packages/sage/src/internal/read-meta.ts:50
missingCount
Section titled “missingCount”readonly missingCount: number;Defined in: packages/sage/src/internal/read-meta.ts:51
validatedCount
Section titled “validatedCount”readonly validatedCount: number;Defined in: packages/sage/src/internal/read-meta.ts:52
ProgramAccountFilter
Section titled “ProgramAccountFilter”Defined in: packages/sage/src/client/contracts.ts:190
A verified byte comparison used for targeted program-account discovery.
Example
Section titled “Example”const filter: ProgramAccountFilter = { offset: 0, bytes: new Uint8Array([1]) };Properties
Section titled “Properties”readonly bytes: Uint8Array;Defined in: packages/sage/src/client/contracts.ts:192
offset
Section titled “offset”readonly offset: number;Defined in: packages/sage/src/client/contracts.ts:191
ProgramAccountRequest
Section titled “ProgramAccountRequest”Defined in: packages/sage/src/client/contracts.ts:203
A targeted program-account request using only adapter-verified offsets.
Example
Section titled “Example”declare const programAddress: Address;const request: ProgramAccountRequest = { programAddress, filters: [] };Extends
Section titled “Extends”Extended by
Section titled “Extended by”Properties
Section titled “Properties”commitment?
Section titled “commitment?”readonly optional commitment?: Commitment;Defined in: packages/sage/src/client/contracts.ts:179
Inherited from
Section titled “Inherited from”filters
Section titled “filters”readonly filters: readonly ProgramAccountFilter[];Defined in: packages/sage/src/client/contracts.ts:205
programAddress
Section titled “programAddress”readonly programAddress: Address;Defined in: packages/sage/src/client/contracts.ts:204
signal?
Section titled “signal?”readonly optional signal?: AbortSignal;Defined in: packages/sage/src/client/contracts.ts:180
Inherited from
Section titled “Inherited from”RawAccount
Section titled “RawAccount”Defined in: packages/sage/src/client/contracts.ts:161
Raw, untrusted account bytes returned by a provider.
Example
Section titled “Example”declare const rawAccount: RawAccount;const bytes = rawAccount.data;Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/client/contracts.ts:162
commitment
Section titled “commitment”readonly commitment: Commitment;Defined in: packages/sage/src/client/contracts.ts:168
readonly data: Uint8Array;Defined in: packages/sage/src/client/contracts.ts:165
executable
Section titled “executable”readonly executable: boolean;Defined in: packages/sage/src/client/contracts.ts:166
lamports
Section titled “lamports”readonly lamports: bigint;Defined in: packages/sage/src/client/contracts.ts:164
readonly owner: Address;Defined in: packages/sage/src/client/contracts.ts:163
readonly slot: bigint;Defined in: packages/sage/src/client/contracts.ts:167
ReadAccountOptions
Section titled “ReadAccountOptions”Defined in: packages/sage/src/client/contracts.ts:178
Options shared by direct and batched raw-account reads.
Example
Section titled “Example”const options: ReadAccountOptions = { commitment: 'confirmed' };Extended by
Section titled “Extended by”AccountSubscriptionRequestDiscoveryRequestProgramAccountRequestReadOptionsWalletProfileDiscoveryRequest
Properties
Section titled “Properties”commitment?
Section titled “commitment?”readonly optional commitment?: Commitment;Defined in: packages/sage/src/client/contracts.ts:179
signal?
Section titled “signal?”readonly optional signal?: AbortSignal;Defined in: packages/sage/src/client/contracts.ts:180
ReadOptions
Section titled “ReadOptions”Defined in: packages/sage/src/client/contracts.ts:469
Cache-first read controls for account and finder operations.
Example
Section titled “Example”const options: ReadOptions = { refresh: true, commitment: 'confirmed' };Extends
Section titled “Extends”Extended by
Section titled “Extended by”Properties
Section titled “Properties”commitment?
Section titled “commitment?”readonly optional commitment?: Commitment;Defined in: packages/sage/src/client/contracts.ts:179
Inherited from
Section titled “Inherited from”maxAgeMs?
Section titled “maxAgeMs?”readonly optional maxAgeMs?: number;Defined in: packages/sage/src/client/contracts.ts:481
Maximum age of a completed cache entry in milliseconds.
Overrides the context’s defaultMaxAgeMs. Use 0 to always revalidate or
Infinity to reuse completed cache entries until explicit invalidation.
policy?
Section titled “policy?”readonly optional policy?: "cache-first" | "no-store";Defined in: packages/sage/src/client/contracts.ts:482
refresh?
Section titled “refresh?”readonly optional refresh?: boolean;Defined in: packages/sage/src/client/contracts.ts:475
Bypasses a completed cache entry.
A refresh may share a compatible provider request that is already in flight, because that request has not yet produced cached state.
signal?
Section titled “signal?”readonly optional signal?: AbortSignal;Defined in: packages/sage/src/client/contracts.ts:180
Inherited from
Section titled “Inherited from”SageDataPort
Section titled “SageDataPort”Defined in: packages/sage/src/client/contracts.ts:632
Public read and discovery boundary shared by built-in domains and extensions.
Cache entries are partitioned by stable account-definition object identity
and may retain one view per commitment. They remain in memory until replaced,
explicitly removed with invalidate(), or released when the owning context
is disposed. The context rejects new cache keys above maxCacheEntries;
callers can use no-store for intentional reads beyond that bound.
Reconstructing definitions per call can therefore exhaust the configured
capacity. Invalidation retains lightweight per-key generation barriers until
context disposal so older in-flight reads and discoveries cannot repopulate
a removed entry.
Example
Section titled “Example”declare const ctx: SageContext;declare const definition: AccountDefinition<unknown>;declare const address: Address;const data: SageDataPort = ctx.data;const envelope = await data.read(definition, address);data.invalidate(definition, address);Methods
Section titled “Methods”discover()
Section titled “discover()”discover<TSnapshot>(definition, request): Promise<readonly SnapshotEnvelope<TSnapshot>[]>;Defined in: packages/sage/src/client/contracts.ts:659
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TSnapshot |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
definition | AccountDefinition<TSnapshot> |
request | DiscoveryRequest |
Returns
Section titled “Returns”Promise<readonly SnapshotEnvelope<TSnapshot>[]>
invalidate()
Section titled “invalidate()”invalidate<TSnapshot>(definition, address): void;Defined in: packages/sage/src/client/contracts.ts:639
Removes the exact cached account generation.
Operations that started before invalidation may still resolve to their original callers, but cannot repopulate this cache entry or satisfy reads that start after invalidation.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TSnapshot |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
definition | AccountDefinition<TSnapshot> |
address | Address |
Returns
Section titled “Returns”void
read()
Section titled “read()”read<TSnapshot>( definition, address,options?): Promise<SnapshotEnvelope<TSnapshot>>;Defined in: packages/sage/src/client/contracts.ts:643
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TSnapshot |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
definition | AccountDefinition<TSnapshot> |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<SnapshotEnvelope<TSnapshot>>
readMany()
Section titled “readMany()”readMany<TSnapshot>( definition, addresses, options?): Promise<readonly ( | SnapshotEnvelope<TSnapshot>| undefined)[]>;Defined in: packages/sage/src/client/contracts.ts:654
Reads addresses in input order.
Context reads remain individually deduplicated. Uncached unique addresses use provider batching when available; direct-only providers use a bounded fallback worker pool.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TSnapshot |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
definition | AccountDefinition<TSnapshot> |
addresses | readonly Address[] |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<readonly (
| SnapshotEnvelope<TSnapshot>
| undefined)[]>
readRaw()
Section titled “readRaw()”readRaw(address, options?): Promise<RawAccount | undefined>;Defined in: packages/sage/src/client/contracts.ts:677
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
address | Address |
options? | ReadAccountOptions |
Returns
Section titled “Returns”Promise<RawAccount | undefined>
subscribe()
Section titled “subscribe()”subscribe<TSnapshot>( definition, address, observer,options?): Promise<SageSubscription>;Defined in: packages/sage/src/client/contracts.ts:671
Subscribes to one typed account and emits the selected cache view.
Registration establishes the WebSocket listener first, then performs one
direct read to close the registration race and emit current state. Valid
stream updates use the same validation and cache path as direct reads. A
failed initial read is reported through onError; it does not reject the
subscription handle or end the registered stream.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TSnapshot |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
definition | AccountDefinition<TSnapshot> |
address | Address |
observer | SubscriptionObserver<TSnapshot> |
options? | ReadAccountOptions |
Returns
Section titled “Returns”Promise<SageSubscription>
SageSdkErrorDetails
Section titled “SageSdkErrorDetails”Defined in: packages/sage/src/client/errors.ts:47
Safe contextual fields carried by SDK errors.
Example
Section titled “Example”declare const address: Address;const details: SageSdkErrorDetails = { accountType: 'fleet', address };Properties
Section titled “Properties”accountType?
Section titled “accountType?”readonly optional accountType?: EntityType;Defined in: packages/sage/src/client/errors.ts:48
address?
Section titled “address?”readonly optional address?: Address;Defined in: packages/sage/src/client/errors.ts:49
cause?
Section titled “cause?”readonly optional cause?: unknown;Defined in: packages/sage/src/client/errors.ts:50
provider?
Section titled “provider?”readonly optional provider?: DataSourceIdentity;Defined in: packages/sage/src/client/errors.ts:51
strategy?
Section titled “strategy?”readonly optional strategy?: DiscoveryStrategy;Defined in: packages/sage/src/client/errors.ts:52
SnapshotEnvelope
Section titled “SnapshotEnvelope”Defined in: packages/sage/src/client/contracts.ts:449
A fully described immutable account snapshot plus its read provenance.
Example
Section titled “Example”declare const envelope: SnapshotEnvelope<unknown>;const slot = envelope.slot;const snapshot = envelope.data;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TSnapshot |
Properties
Section titled “Properties”accountType
Section titled “accountType”readonly accountType: EntityType;Defined in: packages/sage/src/client/contracts.ts:453
address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/client/contracts.ts:451
commitment
Section titled “commitment”readonly commitment: Commitment;Defined in: packages/sage/src/client/contracts.ts:455
readonly data: Readonly<TSnapshot>;Defined in: packages/sage/src/client/contracts.ts:450
fetchedAt
Section titled “fetchedAt”readonly fetchedAt: number;Defined in: packages/sage/src/client/contracts.ts:456
programAddress
Section titled “programAddress”readonly programAddress: Address;Defined in: packages/sage/src/client/contracts.ts:452
readonly slot: bigint;Defined in: packages/sage/src/client/contracts.ts:454
source
Section titled “source”readonly source: DataSourceIdentity;Defined in: packages/sage/src/client/contracts.ts:457
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/client/contracts.ts:459
Returns a JSON-safe copy with every bigint represented as a decimal string.
Returns
Section titled “Returns”unknown
WalletProfileDiscoveryProvider
Section titled “WalletProfileDiscoveryProvider”Defined in: packages/sage/src/client/contracts.ts:292
Replaceable address-only provider for wallet-to-Profile discovery.
Implementations may use an application index, service, or recorded mapping,
but their output is never authoritative. They return Profile addresses only;
the SDK validates account ownership, discriminator, shape, and the stored
wallet-key relationship through its direct account provider. Duplicate and
stale addresses are permitted and reported through finder metadata.
Concurrent requests for the same wallet and commitment are single-flighted
per context; cancelling one caller does not cancel the shared provider call.
Shared operations are in-flight only: a settled failure is removed so a
later request can retry the provider.
Implementations must sanitize transport-specific causes before throwing a
typed SageSdkError; unknown exceptions are normalized without their cause.
Example
Section titled “Example”const walletProfiles: WalletProfileDiscoveryProvider = { identity: { kind: 'indexer', name: 'application-wallet-index' }, discoverProfileAddresses: async () => [],};Properties
Section titled “Properties”identity
Section titled “identity”readonly identity: DataSourceIdentity;Defined in: packages/sage/src/client/contracts.ts:293
Methods
Section titled “Methods”discoverProfileAddresses()
Section titled “discoverProfileAddresses()”discoverProfileAddresses(request): Promise<readonly Address[]>;Defined in: packages/sage/src/client/contracts.ts:294
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request | WalletProfileDiscoveryRequest |
Returns
Section titled “Returns”Promise<readonly Address[]>
WalletProfileDiscoveryRequest
Section titled “WalletProfileDiscoveryRequest”Defined in: packages/sage/src/client/contracts.ts:266
Address-only request accepted by a wallet-to-Profile discovery provider.
The provider returns hints only. The identity domain directly reads every candidate Profile and verifies that its decoded key list contains the requested wallet before exposing it.
Example
Section titled “Example”declare const wallet: Address;const request: WalletProfileDiscoveryRequest = { wallet };Extends
Section titled “Extends”Properties
Section titled “Properties”commitment?
Section titled “commitment?”readonly optional commitment?: Commitment;Defined in: packages/sage/src/client/contracts.ts:179
Inherited from
Section titled “Inherited from”signal?
Section titled “signal?”readonly optional signal?: AbortSignal;Defined in: packages/sage/src/client/contracts.ts:180
Inherited from
Section titled “Inherited from”wallet
Section titled “wallet”readonly wallet: Address;Defined in: packages/sage/src/client/contracts.ts:267
WalletProfileValidationMeta
Section titled “WalletProfileValidationMeta”Defined in: packages/sage/src/internal/read-meta.ts:67
Validation summary for wallet-to-Profile address hints.
Example
Section titled “Example”const summary: WalletProfileValidationMeta = { candidateCount: 3, duplicateCount: 1, missingCount: 1, validatedCount: 1,};Properties
Section titled “Properties”candidateCount
Section titled “candidateCount”readonly candidateCount: number;Defined in: packages/sage/src/internal/read-meta.ts:68
duplicateCount
Section titled “duplicateCount”readonly duplicateCount: number;Defined in: packages/sage/src/internal/read-meta.ts:69
missingCount
Section titled “missingCount”readonly missingCount: number;Defined in: packages/sage/src/internal/read-meta.ts:70
validatedCount
Section titled “validatedCount”readonly validatedCount: number;Defined in: packages/sage/src/internal/read-meta.ts:71
Type Aliases
Section titled “Type Aliases”AccountDiscoveryStrategy
Section titled “AccountDiscoveryStrategy”type AccountDiscoveryStrategy = | "direct" | "derived" | "indexer" | "targeted-program-accounts" | "broad-scan";Defined in: packages/sage/src/client/contracts.ts:492
Strategies supported by generic account discovery requests.
Example
Section titled “Example”const strategy: AccountDiscoveryStrategy = 'targeted-program-accounts';ClusterIdentity
Section titled “ClusterIdentity”type ClusterIdentity = | KnownCluster | CustomClusterIdentity;Defined in: packages/sage/src/client/contracts.ts:139
Identity used to isolate context-owned caches and providers.
Example
Section titled “Example”const cluster: ClusterIdentity = { name: 'local-fixture' };Commitment
Section titled “Commitment”type Commitment = KitCommitment;Defined in: packages/sage/src/client/contracts.ts:33
A z.ink/Solana RPC commitment level.
Example
Section titled “Example”const commitment: Commitment = 'confirmed';DiscoveryStrategy
Section titled “DiscoveryStrategy”type DiscoveryStrategy = | AccountDiscoveryStrategy | "known-addresses" | "wallet-profile-provider";Defined in: packages/sage/src/client/contracts.ts:502
Every strategy name exposed through public read metadata and errors.
Example
Section titled “Example”const strategy: DiscoveryStrategy = 'wallet-profile-provider';EntityType
Section titled “EntityType”type EntityType = | "game" | "profile" | "profileFaction" | "character" | "fleet" | "fleetCrewBinding" | "starSystem" | "celestialBody" | "starbasePlayer" | "starbaseUpgradeProcess" | "cargoPod" | "claimStakeInstance" | "recipe" | "craftingHabInstance" | "craftingProcess" | "market" | "marketOrder" | "scanPattern" | "loot" | "outlawFlag" | "atlasRewardRegistry" | "atlasRewardConfig" | "atlasRewardTreasury" | "faction" | "factionConfig" | "factionEconomicsConfig" | "factionRelationTracker" | "factionStanding" | "factionTreasury" | "factionOwnership" | "kingSystemTracker" | "regionTracker" | "loyaltyEpoch" | "loyaltyContribution" | "loyaltyAtlasBank";Defined in: packages/sage/src/client/contracts.ts:75
Stable account and gameplay entity identifiers used by cache keys and references.
Example
Section titled “Example”const type: EntityType = 'fleet';KnownCluster
Section titled “KnownCluster”type KnownCluster = "zink-ptr";Defined in: packages/sage/src/client/contracts.ts:119
A known deployment preset supported by the installed SDK version.
Example
Section titled “Example”const cluster: KnownCluster = 'zink-ptr';SageRpc
Section titled “SageRpc”type SageRpc = Rpc<GetAccountInfoApi & GetMultipleAccountsApi & GetProgramAccountsApi>;Defined in: packages/sage/src/client/contracts.ts:43
The minimal Kit RPC surface used by the read-only z.ink provider.
Example
Section titled “Example”declare const rpc: SageRpc;const ctx = createSageContext({ cluster: 'zink-ptr', rpc });SageSdkErrorCode
Section titled “SageSdkErrorCode”type SageSdkErrorCode = | "ACCOUNT_NOT_FOUND" | "INVALID_ACCOUNT_OWNER" | "INVALID_DISCRIMINATOR" | "INVALID_ENTITY_ID" | "INVALID_DERIVATION_INPUT" | "ACCOUNT_DECODE_FAILED" | "RELATIONSHIP_NOT_DISCOVERABLE" | "MISSING_GAME_CONTEXT" | "REGISTRY_OUT_OF_SYNC" | "STALE_BINDING_VERSION" | "PROVIDER_ERROR" | "RESOURCE_LIMIT_EXCEEDED" | "CONTEXT_DISPOSED" | "INVALID_ACTION_INPUT" | "INCOMPATIBLE_PLAN_COMPOSITION" | "MISSING_WRITE_TRANSPORT" | "TRANSACTION_TOO_LARGE" | "TRANSACTION_EXPIRED" | "ACTION_PRECONDITION_FAILED" | "SIMULATION_FAILED" | "TRANSACTION_SUBMISSION_FAILED" | "TRANSACTION_OUTCOME_UNKNOWN";Defined in: packages/sage/src/client/errors.ts:15
Stable error codes for read behavior and approved write boundaries.
Example
Section titled “Example”const code: SageSdkErrorCode = 'ACCOUNT_NOT_FOUND';SageWriteRpc
Section titled “SageWriteRpc”type SageWriteRpc = Rpc<GetBlockHeightApi & GetLatestBlockhashApi & SimulateTransactionApi & SendTransactionApi & GetSignatureStatusesApi>;Defined in: packages/sage/src/client/contracts.ts:60
The minimal Kit RPC surface used for explicit write-side operations.
Context creation only retains this transport; it never invokes it. Assembly uses it for blockhash lifetime, signer-free simulation, submission, and confirmation during explicit Plan operations.
Example
Section titled “Example”declare const rpc: SageRpc;declare const writeRpc: SageWriteRpc;const ctx = createSageContext({ cluster: 'zink-ptr', rpc, writeRpc });Functions
Section titled “Functions”createSageContext()
Section titled “createSageContext()”function createSageContext(options): SageContext;Defined in: packages/sage/src/client/context.ts:2079
Creates an isolated context synchronously without performing network I/O.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options | SageContextOptions |
Returns
Section titled “Returns”Example
Section titled “Example”declare const rpc: SageRpc;const ctx = createSageContext({ cluster: 'zink-ptr', rpc });entityRef()
Section titled “entityRef()”function entityRef<TType>(type, address): EntityRef<TType>;Defined in: packages/sage/src/client/refs.ts:24
Creates a plain typed reference without resolving or reading the account.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TType extends EntityType |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
type | TType |
address | Address |
Returns
Section titled “Returns”EntityRef<TType>
Example
Section titled “Example”declare const fleetAddress: Address;const fleet = entityRef('fleet', fleetAddress);References
Section titled “References”AccountSubscriptionEvent
Section titled “AccountSubscriptionEvent”Re-exports AccountSubscriptionEvent
AccountSubscriptionProvider
Section titled “AccountSubscriptionProvider”Re-exports AccountSubscriptionProvider
AccountSubscriptionRegistration
Section titled “AccountSubscriptionRegistration”Re-exports AccountSubscriptionRegistration
AccountSubscriptionRequest
Section titled “AccountSubscriptionRequest”Re-exports AccountSubscriptionRequest
Address
Section titled “Address”Re-exports Address
CargoDefinitionSummary
Section titled “CargoDefinitionSummary”Re-exports CargoDefinitionSummary
DefinitionLookupOptions
Section titled “DefinitionLookupOptions”Re-exports DefinitionLookupOptions
DefinitionSection
Section titled “DefinitionSection”Re-exports DefinitionSection
DefinitionSectionSnapshot
Section titled “DefinitionSectionSnapshot”Re-exports DefinitionSectionSnapshot
EntityRef
Section titled “EntityRef”Re-exports EntityRef
readMeta
Section titled “readMeta”Re-exports readMeta
ReadMeta
Section titled “ReadMeta”Re-exports ReadMeta
ReadMetaFilter
Section titled “ReadMetaFilter”Re-exports ReadMetaFilter
RegistrySnapshotStore
Section titled “RegistrySnapshotStore”Re-exports RegistrySnapshotStore
SageContext
Section titled “SageContext”Re-exports SageContext
SageContextOptions
Section titled “SageContextOptions”Re-exports SageContextOptions
SageSubscription
Section titled “SageSubscription”Re-exports SageSubscription
ShipDefinitionSummary
Section titled “ShipDefinitionSummary”Re-exports ShipDefinitionSummary
SubscriptionDiagnosticEvent
Section titled “SubscriptionDiagnosticEvent”Re-exports SubscriptionDiagnosticEvent
SubscriptionObserver
Section titled “SubscriptionObserver”Re-exports SubscriptionObserver
SubscriptionOptions
Section titled “SubscriptionOptions”Re-exports SubscriptionOptions