add AccountNamespace and fix metadata

This commit is contained in:
Denis Angell
2024-02-29 15:42:17 +01:00
parent 036312d361
commit c7aafb2595
3 changed files with 57 additions and 5 deletions

View File

@@ -0,0 +1,47 @@
import { LedgerIndex } from '../common'
import { AccountRoot, HookState, SignerList } from '../ledger'
import { BaseRequest, BaseResponse } from './baseMethod'
/**
* The `account_namespace` command retrieves the account namespace. All information retrieved is relative to a
* particular version of the ledger. Returns an {@link AccountNamespaceResponse}.
*
* @category Requests
*/
export interface AccountNamespaceRequest extends BaseRequest {
command: 'account_namespace'
/** A unique identifier for the account, most commonly the account's address. */
account: string
/** The hex namespace. */
namespace_id?: string
}
/**
* Response expected from an {@link AccountNamespaceRequest}.
*
* @category Responses
*/
export interface AccountNamespaceResponse extends BaseResponse {
result: {
/**
* The account requested.
*/
account: string
/**
* The namespace_id requested.
*/
namespace_id: string
/**
* A list of HookStates for the specified account namespace_id.
*/
namespace_entries: HookState[]
/**
* The ledger index of the current open ledger, which was used when
* retrieving this information.
*/
ledger_current_index: number
/** If true, this data comes from a validated ledger. */
validated: boolean
}
}

View File

@@ -8,6 +8,10 @@ import {
} from './accountCurrencies' } from './accountCurrencies'
import { AccountInfoRequest, AccountInfoResponse } from './accountInfo' import { AccountInfoRequest, AccountInfoResponse } from './accountInfo'
import { AccountLinesRequest, AccountLinesResponse } from './accountLines' import { AccountLinesRequest, AccountLinesResponse } from './accountLines'
import {
AccountNamespaceRequest,
AccountNamespaceResponse,
} from './accountNamespace'
import { AccountNFTsRequest, AccountNFTsResponse } from './accountNFTs' import { AccountNFTsRequest, AccountNFTsResponse } from './accountNFTs'
import { AccountObjectsRequest, AccountObjectsResponse } from './accountObjects' import { AccountObjectsRequest, AccountObjectsResponse } from './accountObjects'
import { import {
@@ -83,6 +87,7 @@ type Request =
| AccountCurrenciesRequest | AccountCurrenciesRequest
| AccountInfoRequest | AccountInfoRequest
| AccountLinesRequest | AccountLinesRequest
| AccountNamespaceRequest
| AccountNFTsRequest | AccountNFTsRequest
| AccountObjectsRequest | AccountObjectsRequest
| AccountOffersRequest | AccountOffersRequest
@@ -133,6 +138,7 @@ type Response =
| AccountCurrenciesResponse | AccountCurrenciesResponse
| AccountInfoResponse | AccountInfoResponse
| AccountLinesResponse | AccountLinesResponse
| AccountNamespaceResponse
| AccountNFTsResponse | AccountNFTsResponse
| AccountObjectsResponse | AccountObjectsResponse
| AccountOffersResponse | AccountOffersResponse

View File

@@ -11,17 +11,16 @@ export interface HookExecution {
HookReturnCode: string HookReturnCode: string
HookReturnString: string HookReturnString: string
HookStateChangeCount: number HookStateChangeCount: number
Flags: number
} }
} }
export interface HookEmission { export interface HookEmission {
HookEmission: { HookEmission: {
EmitGeneration: number EmittedTxnID: string
EmitBurden: string HookAccount: string
EmitParentTxnID: string HookHash: string
EmitNonce: string EmitNonce: string
EmitCallback: string
EmitHookHash: string
} }
} }