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

View File

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