This page is generated from the
@gol/sdk type declarations by
pnpm sdk:reference. It reads the built dist/index.d.ts and
dist/server.d.ts of the sdk repository, so it describes a released
interface rather than prose written by hand. Do not edit it directly. If the
version below differs from the one in current availability,
reconcile the two before relying on either.| Item | Value |
|---|---|
| Package | @gol/sdk@0.5.0 |
| Entry points | ., ./server |
| Node.js | >=22 |
| Runtime dependency | viem |
How to read this page
Signatures are the declarations the package exports, not a rewritten summary.Address, Hex, and PublicClient are viem types that the package does not re-export, so install viem alongside the SDK. A client parameter is narrowed to the read methods the SDK calls, which a viem PublicClient satisfies.
- Classes list the constructor options and every method a caller can use, including inherited methods.
- Functions are module-level helpers.
- Values are exported constants.
- Types are interfaces and aliases. Ones generated from the platform contract are listed with the API operation that defines their shape.
@gol/sdk
Browser-safe policy encoding, owner wallet payloads, owner operations, and verification. Safe to import from a web page, a mobile bundle, or a server.
Classes
| Class | Options | Methods |
|---|---|---|
GolApiError | none | 3 |
GolTransportError | none | 0 |
GolApiError
new GolApiError(status: number, code: string, message: string, correlationId: string | null)
Error.
| Method | Signature | Returns |
|---|---|---|
code | code: string | |
correlationId | correlationId: string | null | |
status | status: number |
GolTransportError
new GolTransportError(message: string, options?: ErrorOptions)
Error.
Functions
| Function | Signature | Returns |
|---|---|---|
accountExecuteCall | accountExecuteCall(family: AccountFamily, account: Address, target: Address, data: Hex): OwnerAccountCall | Make the account call target through its own execution path. |
assertAccountImplementation | assertAccountImplementation(client: AccountReader, family: AccountFamily, account: Address, blockNumber?: bigint): Promise<void> | Read a fixed block for a consistent preflight. Call before each owner approval and agent submission. |
buildWalletSigningPayload | buildWalletSigningPayload(input: WalletSigningInput): WalletSigningPayload | Build the exact eth_signTypedData_v4 payload whose hash the selected account’s reviewed owner path checks for a core digest. A delegated EOA (nexus7702) signs the GOL payload itself, so its hash is the digest. |
combinedApprovalStructHash | combinedApprovalStructHash(mandateId: Hex, gasPolicyId: Hex): Hex | |
contractProjectId | contractProjectId(projectUuid: string): Hex | Version 1: canonical UUID bytes followed by 16 zero bytes. |
coreDomain | coreDomain(chainId: number, core: Address): { readonly name: "GOL Mandate"; readonly version: "3"; readonly chainId: number; readonly verifyingContract: `0x${string}`; } | |
coreDomainSeparator | coreDomainSeparator(chainId: number, core: Address): Hex | EIP-712 domain separator of the version 3 core. |
developerRelayerTransaction | developerRelayerTransaction(execution: GasExecutionResponse, expected?: { submitter?: Address; core?: Address; }): DeveloperRelayerTransaction | The exact EIP-1559 transaction a developer-operated relayer signs for an execution in external_pending, after checking that its calldata is the agent’s signed transfer under this execution’s mandate, action, and policy. The relayer chooses its own nonce and a priority fee not above maxFeePerGas, signs with its own key, and submits the raw bytes. |
eip7702AuthorizationHash | eip7702AuthorizationHash(nonce: bigint | number | string): Hex | keccak256(0x05 || rlp([chainId, address, nonce])) for the reviewed delegate on Base Sepolia. |
encodeCreateChildMandate | encodeCreateChildMandate(terms: MandateTermsInput, mandatePolicy: Hex, authorization: Hex): Hex | Child mandate creation. authorization is the parent agent’s 65-byte signature over the child’s MandateTerms; anyone may send the call. |
encodeCreateMandateWithGas | encodeCreateMandateWithGas(terms: MandateTermsInput, mandatePolicy: Hex, gasPolicy: GasPolicyInput, packedOwnerSignature: Hex): Hex | |
encodeRevokeGasPolicy | encodeRevokeGasPolicy(gasPolicyId: Hex, deadline: number, packedOwnerSignature: Hex): Hex | Relayed revocation with an owner signature; deadline = 0 and empty signature is the direct owner form. |
encodeSafetyAction | encodeSafetyAction(mandateId: Hex, actionCode: SafetyActionCode, deadline: number, packedOwnerSignature: Hex): Hex | Relayed owner pause, resume, or revoke; a direct account call uses deadline 0 and no signature. |
encodeTransferInput | encodeTransferInput(asset: Address, recipient: Address, amount: bigint): Hex | The 96-byte fungible_asset.transfer@1 input: abi.encode(asset, recipient, amount). |
encodeTransferPolicy | encodeTransferPolicy(input: TransferPolicyInput): Hex | Canonical bounded fungible_asset.transfer@1 policy (encoding section 3): action, asset, and recipient allowlists plus per-action and lifetime caps. |
gasActionTypedData | gasActionTypedData(message: GasActionAuthorizationMessage, core: Address, chainId?: number): { domain: { readonly name: "GOL Mandate"; readonly version: "3"; readonly chainId: number; readonly verifyingContract: `0x${string}`; }; types: { readonly GasActionAuthorization: readonly [{ readonly name: "mandateId"; readonly type: "bytes32"; }, { readonly name: "actionTag"; readonly type: "uint32"; }, { readonly name: "schemaVersion"; readonly type: "uint16"; }, { readonly name: "actionId"; readonly type: "bytes32"; }, { readonly name: "capabilityDigest"; readonly type: "bytes32"; }, { readonly name: "deadline"; readonly type: "uint48"; }, { readonly name: "inputHash"; readonly type: "bytes32"; }, { readonly name: "gasPolicyId"; readonly type: "bytes32"; }, { readonly name: "maxCharge"; readonly type: "uint128"; }]; }; primaryType: "GasActionAuthorization"; message: { mandateId: `0x${string}`; actionTag: number; schemaVersion: number; actionId: `0x${string}`; capabilityDigest: `0x${string}`; deadline: number; inputHash: `0x${string}`; gasPolicyId: `0x${string}`; maxCharge: bigint; }; } | Typed data the executing mandate’s agent signs for one inline-settled action. |
golOwnerPayloadStructHash | golOwnerPayloadStructHash(payload: GolOwnerPayload): Hex | EIP-712 struct hash of a GOL owner payload. |
hashGasActionAuthorization | hashGasActionAuthorization(message: GasActionAuthorizationMessage, core: Address, chainId?: number): Hex | |
hashGasMandate | hashGasMandate(terms: GasMandateTerms, chainId: number, core: Address): Hex | |
hashOwnerGasPolicy | hashOwnerGasPolicy(policy: OwnerGasPolicy, chainId: number, core: Address): Hex | |
nexus133InitData | nexus133InitData(core: Address): Hex | The canonical Nexus 1.3.3 initialization of a nexus7702 account (encoding section 6.4): no validator, the version 3 core as the only executor, and no hook, fallback, or pre-validation hook. |
ownerSafetySigningHash | ownerSafetySigningHash(client: AccountReader, family: AccountFamily, account: Address, digest: Hex): Promise<Hex> | Safety digests remain preparable after implementation drift. This does not grant authority. |
ownerSigningHash | ownerSigningHash(client: AccountReader, family: AccountFamily, account: Address, digest: Hex): Promise<Hex> | The owner signs this hash with its wallet. The SDK never accepts an owner key. |
ownerUserOpNonceKey | ownerUserOpNonceKey(family: UserOperationFamily): bigint | EntryPoint v0.7 nonce key for owner UserOperations. Safe and the delegated EOA have no selected UserOperation path. |
ownerUserOpSigningHash | ownerUserOpSigningHash(family: UserOperationFamily, userOpHash: Hex): Hex | |
packOwnerSignature | packOwnerSignature(family: AccountFamily, signature: Hex): Hex | Preserve a Safe threshold payload or pack the reviewed single-owner dialect. |
packOwnerUserOpSignature | packOwnerUserOpSignature(family: UserOperationFamily, signature: Hex): Hex | |
prepareCombinedGasApproval | prepareCombinedGasApproval(client: Pick<PublicClient, "getChainId" | "getBytecode" | "getStorageAt" | "readContract">, family: AccountFamily, chainId: number, core: Address, terms: GasMandateTerms, mandatePolicy: Hex, gasPolicy: OwnerGasPolicy): Promise<CombinedGasApproval> | Prepare one owner signature after the account installation has been verified. |
prepareGasRevocation | prepareGasRevocation(client: Pick<PublicClient, "getChainId" | "getBytecode" | "getStorageAt" | "readContract">, family: AccountFamily, chainId: number, core: Address, account: Address, policyId: Hex, deadline: number): Promise<PreparedGasRevocation> | Owner safety action. It remains preparable after an account implementation drift. |
prepareOwnerInstallation | prepareOwnerInstallation(client: AccountReader, family: AccountFamily, account: Address, core: Address, entityId?: number): Promise<OwnerAccountCall> | Prepare account self-call calldata after a fresh implementation preflight. |
prepareOwnerOperation | prepareOwnerOperation(client: Pick<PublicClient, "getChainId" | "readContract" | "estimateFeesPerGas">, family: AccountFamily, account: Address, call: OwnerAccountCall, options?: OwnerOperationOptions): Promise<OwnerOperation> | Prepare an owner operation that makes the account perform call through its reviewed owner path: a Safe transaction, or an EntryPoint v0.7 user operation. |
preparePermanentRemoval | preparePermanentRemoval(client: AccountReader, family: AccountFamily, account: Address, core: Address, options?: { safePreviousModule?: Address; alchemyEntityId?: number; }): Promise<OwnerAccountCall> | Prepare tested invalidate-then-remove calldata, including after slot drift. The owner must authorize it. |
prepareProjectBoundGasApproval | prepareProjectBoundGasApproval(client: Parameters<typeof prepareCombinedGasApproval>[0], family: AccountFamily, chainId: number, core: Address, projectUuid: string, terms: GasMandateTerms, mandatePolicy: Hex, gasPolicy: OwnerGasPolicy): Promise<CombinedGasApproval> | Bind a platform project UUID before any owner signing request is prepared. |
revocationStructHash | revocationStructHash(gasPolicyId: Hex, nonce: bigint, deadline: number): Hex | |
safetyActionStructHash | safetyActionStructHash(mandateId: Hex, actionCode: SafetyActionCode, nonce: bigint, deadline: number): Hex | |
selfSentEip7702Setup | selfSentEip7702Setup(prepared: PreparedEip7702Setup, expected?: { account?: Address; core?: Address; }): { to: Address; data: Hex; value: 0n; authorization: null | { chainId: number; address: Address; nonce: number; }; } | The setup for a wallet that sends type-4 transactions itself: it signs the authorization for authorization.nonce (the account nonce plus one, because the sender’s nonce increments first) and sends data to its own address. |
signOwnerOperation | signOwnerOperation(signer: OwnerSigner, operation: OwnerOperation): Promise<Hex> | Sign a prepared owner operation with a caller-supplied owner wallet. |
signPreparedChildMandate | signPreparedChildMandate(parentAgent: AgentSigner, prepared: PreparedChildMandate, expected?: PreparedChildMandateExpectations): Promise<{ authorization: Hex; submission: { to: Address; data: Hex; }; }> | Verify, ask the parent agent to sign the child’s MandateTerms, and return the authorization for submitChildMandate plus the call anyone may send to create the child without GOL’s sponsorship. |
signPreparedEip7702Setup | signPreparedEip7702Setup(signers: { authorization?: Eip7702AuthorizationSigner; initialization: RawHashSigner; }, prepared: PreparedEip7702Setup, expected?: { account?: Address; core?: Address; }): Promise<SubmitEip7702SetupInput> | Verify a prepared setup, collect the owner’s authorization (when the EOA is not yet delegated) and initialization signature, and check both recover to the account before returning the sponsored submission body. The SDK never receives the owner key. |
signPreparedGasExecution | signPreparedGasExecution(signer: AgentSigner, prepared: PrepareGasExecutionResponse, expected?: PreparedGasExecutionExpectations): Promise<{ mandateId: string; gasPolicyId: string; recipient: string; amountBaseUnits: string; deadline: number; maxChargeWei: string; agentSignature: string; }> | Verify, ask the agent wallet to sign, and return the submission body for submitGasExecution. The signature must recover to the prepared agent. |
signPreparedGasPolicy | signPreparedGasPolicy(signer: OwnerSigner, prepared: PreparedGasPolicy, expected?: PreparedGasPolicyExpectations): Promise<{ to: Address; data: Hex; }> | Verify, ask the owner wallet to sign, and return the core call anyone may send. |
signPreparedRevocation | signPreparedRevocation(signer: OwnerSigner, prepared: PreparedPolicyRevocation): Promise<{ to: Address; data: Hex; }> | Verify a prepared relayed revocation, sign it with the owner wallet, and return the core call. |
signPreparedSafetyAction | signPreparedSafetyAction(signer: OwnerSigner, prepared: PreparedMandateSafetyAction, expected?: { mandateId?: Hex; action?: SafetyActionName; }): Promise<{ to: Address; data: Hex; }> | Recompute the core digest and wallet payload before signing an owner pause, resume, or revoke of any mandate in the policy’s tree. |
signWalletSigningPayload | signWalletSigningPayload(signer: OwnerSigner, payload: WalletSigningPayload): Promise<Hex> | Ask the owner wallet to sign, then pack the reviewed account-family signature. |
toGasMandateTerms | toGasMandateTerms(terms: MandateTermsInput): GasMandateTerms | Normalize API mandate terms into the typed form the encoders hash. |
userOperationHash | userOperationHash(op: PackedUserOperation, chainId?: number): Hex | EntryPoint v0.7 user operation hash, computed locally. |
verifyPreparedChildMandate | verifyPreparedChildMandate(prepared: PreparedChildMandate, expected?: PreparedChildMandateExpectations): void | Recompute a prepared child mandate: its policy bytes from the reviewed intent, its terms and identifier under the version 3 domain, and the parent agent’s signing payload. Throws prepared_child_mismatch on any difference. The core enforces every ancestor’s limits regardless. |
verifyPreparedEip7702Setup | verifyPreparedEip7702Setup(prepared: PreparedEip7702Setup, expected?: { account?: Address; core?: Address; }): void | Recompute a prepared setup without trusting the API: the delegate, chain, authorization hash, canonical initialization, and both call forms. Throws prepared_setup_mismatch on any difference. |
verifyPreparedGasExecution | verifyPreparedGasExecution(prepared: PrepareGasExecutionResponse, expected?: PreparedGasExecutionExpectations): void | Recompute the agent’s GasActionAuthorization from the typed transfer without trusting the API. Throws prepared_execution_mismatch on any difference, including a maxChargeWei above the agent’s own ceiling. |
verifyPreparedGasPolicy | verifyPreparedGasPolicy(prepared: PreparedGasPolicy, expected?: PreparedGasPolicyExpectations): void | Recompute a prepared approval without trusting the API: the policy bytes against the reviewed intent, mandate and gas-policy IDs, the combined digest, and the wallet payload. Optional expectations pin what the application asked for. Throws prepared_policy_mismatch on any difference. |
verifyWalletSigningPayload | verifyWalletSigningPayload(payload: WalletSigningPayload, expected: WalletSigningInput): void | Recompute a payload received from the API. Throws unless it is the exact reviewed shape for the family, account, and digest. |
Values
| Name | Value | Notes |
|---|---|---|
BASE_SEPOLIA_CHAIN_ID | 84532 | |
BASE_SEPOLIA_USDC | "0x036CbD53842c5426634e7929541eC2318f3dCF7e" | |
CHARGEABLE_OUTCOMES | { readonly success: 1; readonly refusal: 2; readonly revert: 4; } | |
CORE_DOMAIN_NAME | "GOL Mandate" | |
CORE_DOMAIN_VERSION | "3" | |
ENTRY_POINT_V07 | "0x0000000071727De22E5E9d8BAf0edAc6f37da032" | |
ERC1967_IMPLEMENTATION_SLOT | "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc" | |
GAS_ACTION_TYPES | { readonly GasActionAuthorization: readonly [{ readonly name: "mandateId"; readonly type: "bytes32"; }, { readonly name: "actionTag"; readonly type: "uint32"; }, { readonly name: "schemaVersion"; readonly type: "uint16"; }, { readonly name: "actionId"; readonly type: "bytes32"; }, { readonly name: "capabilityDigest"; readonly type: "bytes32"; }, { readonly name: "deadline"; readonly type: "uint48"; }, { readonly name: "inputHash"; readonly type: "bytes32"; }, { readonly name: "gasPolicyId"; readonly type: "bytes32"; }, { readonly name: "maxCharge"; readonly type: "uint128"; }]; } | |
GAS_FORMULA_INLINE | 2 | |
GOL_OWNER_PAYLOAD_TYPES | { readonly CombinedGasApproval: readonly [{ readonly name: "mandateId"; readonly type: "bytes32"; }, { readonly name: "gasPolicyId"; readonly type: "bytes32"; }]; readonly GasRevocation: readonly [{ readonly name: "gasPolicyId"; readonly type: "bytes32"; }, { readonly name: "nonce"; readonly type: "uint256"; }, { readonly name: "deadline"; readonly type: "uint48"; }]; readonly SafetyAction: readonly [{ readonly name: "mandateId"; readonly type: "bytes32"; }, { readonly name: "action"; readonly type: "uint8"; }, { readonly name: "nonce"; readonly type: "uint256"; }, { readonly name: "deadline"; readonly type: "uint48"; }]; } | |
HOSTED_TREE_LIMITS | { readonly maxDepth: 2; readonly maxActiveDescendants: 16; } | |
MANDATE_TERMS_TYPES | { readonly MandateTerms: readonly [{ readonly name: "parentId"; readonly type: "bytes32"; }, { readonly name: "account"; readonly type: "address"; }, { readonly name: "agent"; readonly type: "address"; }, { readonly name: "accountProfileId"; readonly type: "bytes32"; }, { readonly name: "installEpoch"; readonly type: "uint64"; }, { readonly name: "projectId"; readonly type: "bytes32"; }, { readonly name: "mode"; readonly type: "uint8"; }, { readonly name: "policyVersion"; readonly type: "uint8"; }, { readonly name: "policyHash"; readonly type: "bytes32"; }, { readonly name: "validFrom"; readonly type: "uint48"; }, { readonly name: "expiresAt"; readonly type: "uint48"; }, { readonly name: "maxDepth"; readonly type: "uint32"; }, { readonly name: "maxActiveDescendants"; readonly type: "uint32"; }, { readonly name: "approvalExpiresAt"; readonly type: "uint48"; }, { readonly name: "salt"; readonly type: "bytes32"; }]; } | |
NATIVE_FEE_ASSET | "0x0000000000000000000000000000000000000000" | |
NEXUS_133_BOOTSTRAP | "0x0000B1c0A80cb7DD166a15e7390b8A4Ced4500C6" | |
NEXUS_133_CODEHASH | "0xfc3c26ffa661fd6db8009869d45aa5bf8534c63ae7823bb6d4d0c01cc053e1c7" | |
NEXUS_133_DEFAULT_VALIDATOR | "0x0000B1C0790E5a28293276C320d2B95D651dBaD6" | |
NEXUS_133_DELEGATE | "0x0000B1c01cB3b5770D8806f0D214d50131a08a5B" | |
NEXUS_133_DELEGATION_CODE | Hex | |
SAFETY_ACTION_CODES | { readonly pause: 1; readonly resume: 2; readonly revoke: 3; } | |
TRANSFER_ACTION_TAG | 1 | |
TRANSFER_CAPABILITY_DIGEST | `0x${string}` | |
TRANSFER_SCHEMA_VERSION | 1 |
API request and response types
These aliases are generated from the platform OpenAPI contract, so their shape is exactly the one in the API reference.Operation is the OpenAPI operationId that defines the type.
| Type | Operation | Declaration |
|---|---|---|
AccountStatus | getAccountStatus | type AccountStatus = Json<"getAccountStatus", 200> |
ApiErrorResponse | platform schema | type ApiErrorResponse = components["schemas"]["def-0"] |
ApiKey | platform schema | type ApiKey = components["schemas"]["def-2"] |
ApiKeyIdentityResponse | getApiKeyIdentity | type ApiKeyIdentityResponse = operations["getApiKeyIdentity"]["responses"][200]["content"]["application/json"] |
AuditEvent | platform schema | type AuditEvent = components["schemas"]["def-3"] |
ChildMandateObservation | confirmChildMandate | type ChildMandateObservation = Json<"confirmChildMandate", 202> |
ChildMandateRecord | confirmChildMandate | type ChildMandateRecord = Json<"confirmChildMandate", 200> |
ConfirmGasPolicyInput | confirmGasPolicy | type ConfirmGasPolicyInput = Body<"confirmGasPolicy"> |
ConfirmGasPolicyRevocationInput | confirmGasPolicyRevocation | type ConfirmGasPolicyRevocationInput = Body<"confirmGasPolicyRevocation"> |
ConfirmGasPolicySafetyActionInput | confirmGasPolicySafetyAction | type ConfirmGasPolicySafetyActionInput = Body<"confirmGasPolicySafetyAction"> |
ConsoleIdentityResponse | getConsoleIdentity | type ConsoleIdentityResponse = operations["getConsoleIdentity"]["responses"][200]["content"]["application/json"] |
CreateApiKeyInput | createApiKey | type CreateApiKeyInput = operations["createApiKey"]["requestBody"]["content"]["application/json"] |
CreateApiKeyResponse | createApiKey | type CreateApiKeyResponse = operations["createApiKey"]["responses"][201]["content"]["application/json"] |
CreateGoogleSessionInput | createGoogleSession | type CreateGoogleSessionInput = operations["createGoogleSession"]["requestBody"]["content"]["application/json"] |
CreateGoogleSessionResponse | createGoogleSession | type CreateGoogleSessionResponse = operations["createGoogleSession"]["responses"][200]["content"]["application/json"] |
CreateProjectInput | createProject | type CreateProjectInput = operations["createProject"]["requestBody"]["content"]["application/json"] |
CreateProjectResponse | createProject | type CreateProjectResponse = operations["createProject"]["responses"][201]["content"]["application/json"] |
CreateWebhookEndpointInput | createWebhookEndpoint | type CreateWebhookEndpointInput = Body<"createWebhookEndpoint"> |
CreateWebhookEndpointResponse | createWebhookEndpoint | type CreateWebhookEndpointResponse = Json<"createWebhookEndpoint", 201> |
Eip7702Setup | getEip7702Setup | type Eip7702Setup = Json<"getEip7702Setup", 200> |
GasConfiguration | getGasConfiguration | type GasConfiguration = Json<"getGasConfiguration", 200> |
GasExecutionResponse | getGasExecution | type GasExecutionResponse = operations["getGasExecution"]["responses"][200]["content"]["application/json"] |
GasObservation | confirmGasPolicy | type GasObservation = Json<"confirmGasPolicy", 202> |
GasPolicyRecord | getGasPolicy | type GasPolicyRecord = Json<"getGasPolicy", 200> |
ListApiKeysResponse | listApiKeys | type ListApiKeysResponse = operations["listApiKeys"]["responses"][200]["content"]["application/json"] |
ListAuditEventsResponse | listAuditEvents | type ListAuditEventsResponse = operations["listAuditEvents"]["responses"][200]["content"]["application/json"] |
ListChildMandatesResponse | listChildMandates | type ListChildMandatesResponse = Json<"listChildMandates", 200> |
ListGasExecutionsResponse | listGasExecutions | type ListGasExecutionsResponse = Json<"listGasExecutions", 200> |
ListGasPoliciesResponse | listGasPolicies | type ListGasPoliciesResponse = Json<"listGasPolicies", 200> |
ListProjectsResponse | listProjects | type ListProjectsResponse = operations["listProjects"]["responses"][200]["content"]["application/json"] |
PrepareChildMandateInput | prepareChildMandate | type PrepareChildMandateInput = Body<"prepareChildMandate"> |
PreparedChildMandate | prepareChildMandate | type PreparedChildMandate = Json<"prepareChildMandate", 200> |
PreparedEip7702Setup | prepareEip7702Setup | type PreparedEip7702Setup = Json<"prepareEip7702Setup", 200> |
PreparedGasPolicy | prepareGasPolicy | type PreparedGasPolicy = Json<"prepareGasPolicy", 200> |
PreparedMandateSafetyAction | prepareGasPolicySafetyAction | type PreparedMandateSafetyAction = Json<"prepareGasPolicySafetyAction", 200> |
PreparedPolicyRevocation | prepareGasPolicyRevocation | type PreparedPolicyRevocation = Json<"prepareGasPolicyRevocation", 200> |
PrepareGasExecutionInput | prepareGasExecution | type PrepareGasExecutionInput = operations["prepareGasExecution"]["requestBody"]["content"]["application/json"] |
PrepareGasExecutionResponse | prepareGasExecution | type PrepareGasExecutionResponse = operations["prepareGasExecution"]["responses"][200]["content"]["application/json"] |
PrepareGasPolicyInput | prepareGasPolicy | type PrepareGasPolicyInput = Body<"prepareGasPolicy"> |
PrepareGasPolicySafetyActionInput | prepareGasPolicySafetyAction | type PrepareGasPolicySafetyActionInput = Body<"prepareGasPolicySafetyAction"> |
Project | platform schema | type Project = components["schemas"]["def-1"] |
RenewConsoleSessionResponse | renewConsoleSession | type RenewConsoleSessionResponse = operations["renewConsoleSession"]["responses"][200]["content"]["application/json"] |
RotateApiKeyInput | rotateApiKey | type RotateApiKeyInput = operations["rotateApiKey"]["requestBody"]["content"]["application/json"] |
RotateApiKeyResponse | rotateApiKey | type RotateApiKeyResponse = operations["rotateApiKey"]["responses"][201]["content"]["application/json"] |
RotateWebhookSecretResponse | rotateWebhookEndpointSecret | type RotateWebhookSecretResponse = Json<"rotateWebhookEndpointSecret", 200> |
SafetyActionObservation | confirmGasPolicySafetyAction | type SafetyActionObservation = Json<"confirmGasPolicySafetyAction", 202> |
StartEmailChallengeInput | startEmailChallenge | type StartEmailChallengeInput = operations["startEmailChallenge"]["requestBody"]["content"]["application/json"] |
StartEmailChallengeResponse | startEmailChallenge | type StartEmailChallengeResponse = operations["startEmailChallenge"]["responses"][202]["content"]["application/json"] |
SubmitChildMandateInput | submitChildMandate | type SubmitChildMandateInput = Body<"submitChildMandate"> |
SubmitDeveloperRelayerTransactionInput | submitDeveloperRelayerTransaction | type SubmitDeveloperRelayerTransactionInput = Body<"submitDeveloperRelayerTransaction"> |
SubmitEip7702SetupInput | submitEip7702Setup | type SubmitEip7702SetupInput = Body<"submitEip7702Setup"> |
SubmitGasExecutionInput | submitGasExecution | type SubmitGasExecutionInput = operations["submitGasExecution"]["requestBody"]["content"]["application/json"] |
VerifyEmailChallengeInput | verifyEmailChallenge | type VerifyEmailChallengeInput = operations["verifyEmailChallenge"]["requestBody"]["content"]["application/json"] |
VerifyEmailChallengeResponse | verifyEmailChallenge | type VerifyEmailChallengeResponse = operations["verifyEmailChallenge"]["responses"][200]["content"]["application/json"] |
WebhookDelivery | listWebhookDeliveries | type WebhookDelivery = Json<"listWebhookDeliveries", 200>["data"][number] |
WebhookEndpoint | listWebhookEndpoints | type WebhookEndpoint = Json<"listWebhookEndpoints", 200>["data"][number] |
Types
AccountFamily
type AccountFamily = "safe" | "nexus" | "kernel" | "alchemy" | "nexus7702";
AgentSigner
interface AgentSigner {
signTypedData(typedData: TypedDataPayload): Promise<Hex>;
}
ApiKeyScope
type ApiKeyScope = ApiKey["scopes"][number];
CombinedGasApproval
interface CombinedGasApproval {
mandateId: Hex;
gasPolicyId: Hex;
digest: Hex;
ownerSigningHash: Hex;
summary: {
chainId: number;
account: Address;
core: Address;
projectId: Hex;
agent: Address;
submitter: Address;
recipient: Address;
attester: Address;
feeAsset: Address;
maxPerActionWei: bigint;
maxTotalWei: bigint;
chargeableOutcomes: number;
expiresAt: number;
};
encodeSubmission(ownerWalletSignature: Hex): Hex;
}
DeveloperRelayerTransaction
interface DeveloperRelayerTransaction {
chainId: 84532;
type: "eip1559";
from: Address;
to: Address;
data: Hex;
value: 0n;
gas: bigint;
maxFeePerGas: bigint;
}
Eip7702AuthorizationSigner
interface Eip7702AuthorizationSigner {
signAuthorization(request: {
chainId: number;
address: Address;
nonce: number;
}): Promise<{
r: Hex;
s: Hex;
yParity?: number | undefined;
v?: bigint | undefined;
}>;
}
GasActionAuthorizationMessage
interface GasActionAuthorizationMessage {
mandateId: Hex;
actionId: Hex;
deadline: number;
inputHash: Hex;
gasPolicyId: Hex;
maxCharge: bigint;
}
GasExecutionSummary
type GasExecutionSummary = ListGasExecutionsResponse["data"][number];
GasMandateTerms
interface GasMandateTerms {
parentId: Hex;
account: Address;
agent: Address;
accountProfileId: Hex;
installEpoch: bigint;
projectId: Hex;
mode: number;
policyVersion: number;
policyHash: Hex;
validFrom: number;
expiresAt: number;
maxDepth: number;
maxActiveDescendants: number;
approvalExpiresAt: number;
salt: Hex;
}
GasPolicyInput
interface GasPolicyInput {
mandateId: Hex;
account: Address;
projectId: Hex;
accountProfileId: Hex;
installEpoch: Numeric;
feeAsset: Address;
submitter: Address;
recipient: Address;
attester: Address;
maxPerAction: Numeric;
maxTotal: Numeric;
expiresAt: Numeric;
chargeableOutcomes: Numeric;
formulaVersion: Numeric;
nonce: Numeric;
}
GolEnvironment
type GolEnvironment = Project["environments"][number]["name"];
GolOwnerPayload
type GolOwnerPayload = {
primaryType: "CombinedGasApproval";
message: {
mandateId: Hex;
gasPolicyId: Hex;
};
} | {
primaryType: "GasRevocation";
message: {
gasPolicyId: Hex;
nonce: Numeric;
deadline: Numeric;
};
} | {
primaryType: "SafetyAction";
message: {
mandateId: Hex;
action: Numeric;
nonce: Numeric;
deadline: Numeric;
};
};
MandateTermsInput
interface MandateTermsInput {
parentId: Hex;
account: Address;
agent: Address;
accountProfileId: Hex;
installEpoch: Numeric;
projectId: Hex;
mode: Numeric;
policyVersion: Numeric;
policyHash: Hex;
validFrom: Numeric;
expiresAt: Numeric;
maxDepth: Numeric;
maxActiveDescendants: Numeric;
approvalExpiresAt: Numeric;
salt: Hex;
}
OwnerAccountCall
type OwnerAccountCall = {
to: Address;
data: Hex;
/** Safe must delegatecall MultiSendCallOnly. Other calls target the account itself. */
operation: 0 | 1;
};
OwnerGasPolicy
interface OwnerGasPolicy {
mandateId: Hex;
account: Address;
projectId: Hex;
accountProfileId: Hex;
installEpoch: bigint;
/** Formula version 2 supports native ETH only. */
feeAsset: Address;
/** The only address that may send an inline-settled action under this policy. */
submitter: Address;
/** The address the account reimburses. */
recipient: Address;
/** Signs revert claims; zero unless the revert bit is set. */
attester: Address;
maxPerAction: bigint;
maxTotal: bigint;
expiresAt: number;
/** 1 = success, 2 = refusal, 4 = revert. */
chargeableOutcomes: number;
formulaVersion: number;
nonce: bigint;
}
OwnerOperation
type OwnerOperation = {
kind: "safe_transaction";
family: "safe";
account: Address;
nonce: bigint;
typedData: TypedDataPayload;
expectedHash: Hex;
/** Encode `execTransaction` after the owners sign `typedData`. */
encode(signatures: Hex): {
to: Address;
data: Hex;
value: 0n;
};
} | {
kind: "eoa_transaction";
family: "nexus7702";
account: Address;
/** The owner's wallet sends this transaction from the account itself. */
transaction: {
from: Address;
to: Address;
data: Hex;
value: 0n;
};
} | {
kind: "user_operation";
family: UserOperationFamily;
account: Address;
userOperation: PackedUserOperation;
userOpHash: Hex;
/** The owner wallet signs `userOpHash` with EIP-191 `personal_sign`. */
message: {
raw: Hex;
};
/** Direct EntryPoint submission from any funded address, or give the signed operation to a bundler. */
encode(ownerSignature: Hex, beneficiary: Address): {
to: Address;
data: Hex;
value: 0n;
gas: bigint;
userOperation: PackedUserOperation;
};
};
OwnerOperationOptions
interface OwnerOperationOptions {
verificationGasLimit?: bigint;
callGasLimit?: bigint;
preVerificationGas?: bigint;
maxFeePerGas?: bigint;
maxPriorityFeePerGas?: bigint;
}
OwnerSigner
interface OwnerSigner {
signTypedData(typedData: TypedDataPayload): Promise<Hex>;
signMessage?(args: {
message: {
raw: Hex;
};
}): Promise<Hex>;
}
PackedUserOperation
interface PackedUserOperation {
sender: Address;
nonce: bigint;
initCode: Hex;
callData: Hex;
accountGasLimits: Hex;
preVerificationGas: bigint;
gasFees: Hex;
paymasterAndData: Hex;
signature: Hex;
}
PreparedChildMandateExpectations
interface PreparedChildMandateExpectations {
core?: Address;
parentMandateId?: Hex;
parentAgent?: Address;
agent?: Address;
recipients?: readonly Address[];
maxPerActionBaseUnits?: bigint;
maxTotalBaseUnits?: bigint;
tree?: {
maxDepth: number;
maxActiveDescendants: number;
};
}
PreparedGasExecutionExpectations
interface PreparedGasExecutionExpectations {
core?: Address;
mandateId?: Hex;
gasPolicyId?: Hex;
agent?: Address;
recipient?: Address;
amountBaseUnits?: bigint;
deadline?: number;
/** The largest network charge the agent accepts for this action. */
maxChargeWei?: bigint;
relayerMode?: "gol" | "developer";
}
PreparedGasPolicyExpectations
interface PreparedGasPolicyExpectations {
/** The platform project UUID the approval must bind. */
projectId?: string;
core?: Address;
account?: Address;
agent?: Address;
recipients?: readonly Address[];
maxPerActionBaseUnits?: bigint;
maxTotalBaseUnits?: bigint;
maxGasPerActionWei?: bigint;
maxGasTotalWei?: bigint;
chargeableOutcomesMask?: number;
/** The relayer the owner intends to approve; for `gol`, the configured relayer and recipient. */
relayer?: {
mode: "gol";
submitter?: Address;
recipient?: Address;
} | {
mode: "developer";
submitter: Address;
recipient: Address;
};
attester?: Address;
tree?: {
maxDepth: number;
maxActiveDescendants: number;
};
}
PreparedGasRevocation
interface PreparedGasRevocation {
account: Address;
policyId: Hex;
nonce: bigint;
deadline: number;
digest: Hex;
ownerSigningHash: Hex;
encodeSubmission(ownerWalletSignature: Hex): Hex;
}
RawHashSigner
interface RawHashSigner {
sign(request: {
hash: Hex;
}): Promise<Hex>;
}
SafetyActionCode
type SafetyActionCode = (typeof SAFETY_ACTION_CODES)[SafetyActionName];
SafetyActionName
type SafetyActionName = keyof typeof SAFETY_ACTION_CODES;
SignatureFormat
type SignatureFormat = "safe_threshold" | "nexus_k1" | "kernel_root" | "alchemy_entity_zero" | "eoa";
SmartAccountFamily
type SmartAccountFamily = Exclude<AccountFamily, "nexus7702">;
TransferPolicyInput
interface TransferPolicyInput {
asset?: Address;
recipients: readonly Address[];
maxPerActionBaseUnits: bigint;
maxTotalBaseUnits: bigint;
}
TypedDataPayload
interface TypedDataPayload {
domain: Record<string, unknown>;
types: Record<string, Array<{
name: string;
type: string;
}>>;
primaryType: string;
message: Record<string, unknown>;
}
UserOperationFamily
type UserOperationFamily = Exclude<AccountFamily, "safe" | "nexus7702">;
WalletSigningInput
interface WalletSigningInput {
family: AccountFamily;
account: Address;
core: Address;
payload: GolOwnerPayload;
chainId?: number;
}
WalletSigningPayload
interface WalletSigningPayload {
family: AccountFamily;
method: "eth_signTypedData_v4";
typedData: TypedDataPayload;
expectedHash: Hex;
digest: Hex;
signatureFormat: SignatureFormat;
}
@gol/sdk/server
Typed API clients, polling helpers, and webhook verification. Server-only, because these calls carry your API key or developer session token.
Classes
| Class | Options | Methods |
|---|---|---|
GolApiClient | GolApiClientOptions | 31 |
GolApiError | none | 3 |
GolManagementClient | GolManagementClientOptions | 29 |
GolTransportError | none | 0 |
GolWebhookVerificationError | none | 1 |
GolApiClient
new GolApiClient(options: GolApiClientOptions)
ProjectResources, an internal base class the package does not export.
| Method | Signature | Returns |
|---|---|---|
confirmChildMandate | confirmChildMandate(projectId: string, gasPolicyId: `0x${string}`, draftId: string, transactionHash: `0x${string}`): Promise<{ status: "confirmed"; child: ChildMandateRecord; } | ChildMandateObservation> | Record a child the developer created itself once it reaches the selected head. |
confirmGasPolicy | confirmGasPolicy(projectId: string, draftId: string, transactionHash: `0x${string}`): Promise<{ status: "confirmed"; policy: GasPolicyRecord; } | GasObservation> | Returns the policy once finalized on-chain, or an observing status to retry. |
confirmGasPolicyRevocation | confirmGasPolicyRevocation(projectId: string, gasPolicyId: `0x${string}`, transactionHash: `0x${string}`): Promise<{ status: "confirmed"; policy: GasPolicyRecord; } | GasObservation> | |
confirmGasPolicySafetyAction | confirmGasPolicySafetyAction(projectId: string, gasPolicyId: `0x${string}`, input: ConfirmGasPolicySafetyActionInput): Promise<{ status: "confirmed"; policy: GasPolicyRecord; } | SafetyActionObservation> | |
createWebhookEndpoint | createWebhookEndpoint(projectId: string, input: CreateWebhookEndpointInput): Promise<CreateWebhookEndpointResponse> | The returned secret is shown once. Store it to verify deliveries. |
deleteWebhookEndpoint | deleteWebhookEndpoint(projectId: string, endpointId: string): Promise<{ id: string; deleted: true; }> | |
getAccountStatus | getAccountStatus(projectId: string, account: `0x${string}`): Promise<AccountStatus> | |
getEip7702Setup | getEip7702Setup(projectId: string, account: `0x${string}`, setupId: string): Promise<Eip7702Setup> | A sponsored EIP-7702 setup. Polling is authoritative. |
getGasConfiguration | getGasConfiguration(projectId: string): Promise<GasConfiguration> | |
getGasExecution | getGasExecution(projectId: string, executionId: string): Promise<GasExecutionResponse> | |
getGasPolicy | getGasPolicy(projectId: string, gasPolicyId: `0x${string}`): Promise<GasPolicyRecord> | Current on-chain policy state. Unknown or conflicting chain state reads as unavailable. |
listChildMandates | listChildMandates(projectId: string, gasPolicyId: `0x${string}`): Promise<ListChildMandatesResponse> | Every recorded mandate of the policy’s tree, with state read from chain at one block. |
listGasExecutions | listGasExecutions(projectId: string, options?: PageOptions & { state?: string; }): Promise<ListGasExecutionsResponse> | |
listGasPolicies | listGasPolicies(projectId: string, options?: PageOptions): Promise<ListGasPoliciesResponse> | |
listWebhookDeliveries | listWebhookDeliveries(projectId: string, endpointId: string, limit?: number): Promise<WebhookDelivery[]> | |
listWebhookEndpoints | listWebhookEndpoints(projectId: string): Promise<WebhookEndpoint[]> | |
openGasExecutionDispute | openGasExecutionDispute(projectId: string, executionId: string, reason: string): Promise<{ id: string; }> | Freezes new submissions under the execution’s gas policy until an operator resolves it. |
prepareChildMandate | prepareChildMandate(projectId: string, gasPolicyId: `0x${string}`, input: PrepareChildMandateInput): Promise<PreparedChildMandate> | Compile a child mandate from typed intent. Creates no authority; the parent agent signs signing. |
prepareEip7702Setup | prepareEip7702Setup(projectId: string, account: `0x${string}`): Promise<PreparedEip7702Setup> | Prepare the owner’s EIP-7702 setup of a nexus7702 account. Verify it with verifyPreparedEip7702Setup before the owner signs. |
prepareGasExecution | prepareGasExecution(projectId: string, actionId: `0x${string}`, input: PrepareGasExecutionInput): Promise<PrepareGasExecutionResponse> | Fetch the exact EIP-712 payload for the agent wallet to sign. |
prepareGasPolicy | prepareGasPolicy(projectId: string, input: PrepareGasPolicyInput): Promise<PreparedGasPolicy> | Compile the owner’s exact approval. Creates no authority; the owner wallet signs signing. |
prepareGasPolicyRevocation | prepareGasPolicyRevocation(projectId: string, gasPolicyId: `0x${string}`, deadline?: number): Promise<PreparedPolicyRevocation> | |
prepareGasPolicySafetyAction | prepareGasPolicySafetyAction(projectId: string, gasPolicyId: `0x${string}`, input: PrepareGasPolicySafetyActionInput): Promise<PreparedMandateSafetyAction> | |
rotateWebhookSecret | rotateWebhookSecret(projectId: string, endpointId: string): Promise<RotateWebhookSecretResponse> | |
sendWebhookTest | sendWebhookTest(projectId: string, endpointId: string): Promise<{ eventId: string; }> | |
setWebhookEndpointEnabled | setWebhookEndpointEnabled(projectId: string, endpointId: string, enabled: boolean): Promise<WebhookEndpoint> | |
submitChildMandate | submitChildMandate(projectId: string, gasPolicyId: `0x${string}`, draftId: string, authorization: `0x${string}`): Promise<ChildMandateRecord> | Ask GOL’s hosted relayer to create the child with the parent agent’s authorization. |
submitDeveloperRelayerTransaction | submitDeveloperRelayerTransaction(projectId: string, executionId: string, rawSignedTransaction: `0x${string}`): Promise<GasExecutionResponse> | Submit the developer relayer’s signed EIP-1559 transaction for an execution in external_pending. Build it with developerRelayerTransaction. |
submitEip7702Setup | submitEip7702Setup(projectId: string, account: `0x${string}`, input: SubmitEip7702SetupInput): Promise<Eip7702Setup> | Ask GOL’s hosted relayer to send the owner-signed setup at GOL’s cost, within the daily limit. |
submitGasExecution | submitGasExecution(projectId: string, actionId: `0x${string}`, input: SubmitGasExecutionInput): Promise<GasExecutionResponse> | Submit a typed transfer signed by the developer’s agent. The API owns execution logic. |
whoami | whoami(): Promise<ApiKeyIdentityResponse> |
GolApiError
new GolApiError(status: number, code: string, message: string, correlationId: string | null)
Error.
| Method | Signature | Returns |
|---|---|---|
code | code: string | |
correlationId | correlationId: string | null | |
status | status: number |
GolManagementClient
new GolManagementClient(options: GolManagementClientOptions)
ProjectResources, an internal base class the package does not export.
| Method | Signature | Returns |
|---|---|---|
createApiKey | createApiKey(projectId: string, input: CreateApiKeyInput): Promise<CreateApiKeyResponse> | |
createGoogleSession | createGoogleSession(input: CreateGoogleSessionInput): Promise<CreateGoogleSessionResponse> | |
createProject | createProject(input: CreateProjectInput): Promise<Project> | |
createWebhookEndpoint | createWebhookEndpoint(projectId: string, input: CreateWebhookEndpointInput): Promise<CreateWebhookEndpointResponse> | The returned secret is shown once. Store it to verify deliveries. |
deleteWebhookEndpoint | deleteWebhookEndpoint(projectId: string, endpointId: string): Promise<{ id: string; deleted: true; }> | |
getAccountStatus | getAccountStatus(projectId: string, account: `0x${string}`): Promise<AccountStatus> | |
getEip7702Setup | getEip7702Setup(projectId: string, account: `0x${string}`, setupId: string): Promise<Eip7702Setup> | A sponsored EIP-7702 setup. Polling is authoritative. |
getGasConfiguration | getGasConfiguration(projectId: string): Promise<GasConfiguration> | |
getGasExecution | getGasExecution(projectId: string, executionId: string, environment?: "test" | "live"): Promise<GasExecutionResponse> | |
getGasPolicy | getGasPolicy(projectId: string, gasPolicyId: `0x${string}`): Promise<GasPolicyRecord> | Current on-chain policy state. Unknown or conflicting chain state reads as unavailable. |
getIdentity | getIdentity(): Promise<ConsoleIdentityResponse> | |
listApiKeys | listApiKeys(projectId: string): Promise<ListApiKeysResponse> | |
listAuditEvents | listAuditEvents(projectId: string, limit?: number): Promise<ListAuditEventsResponse> | |
listChildMandates | listChildMandates(projectId: string, gasPolicyId: `0x${string}`): Promise<ListChildMandatesResponse> | Every recorded mandate of the policy’s tree, with state read from chain at one block. |
listGasExecutions | listGasExecutions(projectId: string, options?: PageOptions & { state?: string; }): Promise<ListGasExecutionsResponse> | |
listGasPolicies | listGasPolicies(projectId: string, options?: PageOptions): Promise<ListGasPoliciesResponse> | |
listProjects | listProjects(): Promise<ListProjectsResponse> | |
listWebhookDeliveries | listWebhookDeliveries(projectId: string, endpointId: string, limit?: number): Promise<WebhookDelivery[]> | |
listWebhookEndpoints | listWebhookEndpoints(projectId: string): Promise<WebhookEndpoint[]> | |
openGasExecutionDispute | openGasExecutionDispute(projectId: string, executionId: string, reason: string): Promise<{ id: string; }> | Freezes new submissions under the execution’s gas policy until an operator resolves it. |
renewSession | renewSession(): Promise<RenewConsoleSessionResponse> | |
revokeApiKey | revokeApiKey(projectId: string, apiKeyId: string): Promise<ApiKey> | |
revokeSession | revokeSession(): Promise<void> | |
rotateApiKey | rotateApiKey(projectId: string, apiKeyId: string, input: RotateApiKeyInput): Promise<RotateApiKeyResponse> | |
rotateWebhookSecret | rotateWebhookSecret(projectId: string, endpointId: string): Promise<RotateWebhookSecretResponse> | |
sendWebhookTest | sendWebhookTest(projectId: string, endpointId: string): Promise<{ eventId: string; }> | |
setWebhookEndpointEnabled | setWebhookEndpointEnabled(projectId: string, endpointId: string, enabled: boolean): Promise<WebhookEndpoint> | |
startEmailChallenge | startEmailChallenge(email: string): Promise<StartEmailChallengeResponse> | |
verifyEmailChallenge | verifyEmailChallenge(challengeId: string, code: string): Promise<VerifyEmailChallengeResponse> |
GolTransportError
new GolTransportError(message: string, options?: ErrorOptions)
Error.
GolWebhookVerificationError
new GolWebhookVerificationError(message: string)
Extends Error.
| Method | Signature | Returns |
|---|---|---|
name | name: string |
Functions
| Function | Signature | Returns |
|---|---|---|
verifyWebhook | verifyWebhook(rawBody: string | Uint8Array, headers: Headers | Record<string, string | string[] | undefined>, secrets: string | readonly string[], options?: { toleranceSeconds?: number; now?: Date; }): GolWebhookEvent<Data> | Verify a GOL webhook against the exact raw request body. Accepts the current secret and, during rotation, the previous one. |
waitForChildMandate | waitForChildMandate(client: GolApiClient | GolManagementClient, projectId: string, gasPolicyId: `0x${string}`, mandateId: `0x${string}`, options?: WaitOptions): Promise<ChildMandateRecord> | Poll a child mandate of the policy’s tree until it leaves pending. |
waitForEip7702Setup | waitForEip7702Setup(client: GolApiClient | GolManagementClient, projectId: string, account: `0x${string}`, setupId: string, options?: WaitOptions): Promise<Eip7702Setup> | Poll a sponsored EIP-7702 setup until it is confirmed or failed. |
waitForGasExecution | waitForGasExecution(client: GolApiClient, projectId: string, executionId: string, options?: WaitOptions & { until?: (execution: GasExecutionResponse) => boolean; }): Promise<GasExecutionResponse> | Poll an execution until until returns true, by default a terminal state. Polling is authoritative. |
waitForGasPolicyConfirmation | waitForGasPolicyConfirmation(client: GolApiClient, projectId: string, draftId: string, transactionHash: `0x${string}`, options?: WaitOptions): Promise<GasPolicyRecord> | Poll confirmation until the approval reaches the hosted service’s selected Base head. |
waitForGasPolicyRevocation | waitForGasPolicyRevocation(client: GolApiClient, projectId: string, gasPolicyId: `0x${string}`, transactionHash: `0x${string}`, options?: WaitOptions): Promise<GasPolicyRecord> | Poll a gas-policy revocation until both providers confirm it at the selected head. |
waitForGasPolicySafetyAction | waitForGasPolicySafetyAction(client: GolApiClient, projectId: string, gasPolicyId: `0x${string}`, input: ConfirmGasPolicySafetyActionInput, options?: WaitOptions): Promise<GasPolicyRecord> | Poll an owner pause, resume, or revoke until both providers confirm it at the selected head. |
API request and response types
These aliases are generated from the platform OpenAPI contract, so their shape is exactly the one in the API reference.Operation is the OpenAPI operationId that defines the type.
| Type | Operation | Declaration |
|---|---|---|
ApiKey | platform schema | type ApiKey = components["schemas"]["def-2"] |
ApiKeyIdentityResponse | getApiKeyIdentity | type ApiKeyIdentityResponse = operations["getApiKeyIdentity"]["responses"][200]["content"]["application/json"] |
AuditEvent | platform schema | type AuditEvent = components["schemas"]["def-3"] |
Project | platform schema | type Project = components["schemas"]["def-1"] |
Types
GolApiClientOptions
interface GolApiClientOptions extends GolClientOptions {
apiKey: string;
}
GolClientOptions
interface GolClientOptions {
baseUrl: string;
fetch?: typeof fetch;
}
GolManagementClientOptions
interface GolManagementClientOptions extends GolClientOptions {
sessionToken?: string | null;
}
GolWebhookEvent
interface GolWebhookEvent<Data = unknown> {
id: string;
type: "gas_execution.updated" | "gas_policy.confirmed" | "gas_policy.revoked" | "gas_policy.paused" | "gas_policy.resumed" | "gas_policy.child_created" | "gas_policy.child_updated" | "account.eip7702_setup_updated" | "webhook.test" | (string & {});
createdAt: string;
projectId: string;
environment: "test" | "live";
data: Data;
}
PageOptions
interface PageOptions {
limit?: number;
cursor?: string;
environment?: "test" | "live";
}
WaitOptions
interface WaitOptions {
intervalMs?: number;
timeoutMs?: number;
signal?: AbortSignal;
}