diff --git a/packages/xrpl/src/models/methods/accountNamespace.ts b/packages/xrpl/src/models/methods/accountNamespace.ts new file mode 100644 index 00000000..ffad0db9 --- /dev/null +++ b/packages/xrpl/src/models/methods/accountNamespace.ts @@ -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 + } +} diff --git a/packages/xrpl/src/models/methods/index.ts b/packages/xrpl/src/models/methods/index.ts index 7c5aee39..2a91fec4 100644 --- a/packages/xrpl/src/models/methods/index.ts +++ b/packages/xrpl/src/models/methods/index.ts @@ -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 diff --git a/packages/xrpl/src/models/transactions/metadata.ts b/packages/xrpl/src/models/transactions/metadata.ts index f531684d..fa716761 100644 --- a/packages/xrpl/src/models/transactions/metadata.ts +++ b/packages/xrpl/src/models/transactions/metadata.ts @@ -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 } }