@@ -2,10 +2,10 @@ import { struct } from "../types/struct.js";
22import { int64 } from "../types/int64.js" ;
33import { uint32 } from "../types/uint32.js" ;
44import { option } from "../types/option.js" ;
5- import { string as string_ } from "../types/string.js" ;
65import { array } from "../types/array.js" ;
76import { UNBOUNDED_MAX_LENGTH , type XdrType } from "../core/xdr-type.js" ;
87import { XdrValue } from "../values/xdr-value.js" ;
8+ import { XdrString , xdrString } from "../values/xdr-string.js" ;
99import { PublicKey , type PublicKeyWire } from "./public-key.js" ;
1010import { Thresholds , type ThresholdsWire } from "./thresholds.js" ;
1111import { Signer , type SignerWire } from "./signer.js" ;
@@ -21,7 +21,7 @@ export interface AccountEntryWire {
2121 numSubEntries : number ;
2222 inflationDest : PublicKeyWire | null ;
2323 flags : number ;
24- homeDomain : string ;
24+ homeDomain : XdrString ;
2525 thresholds : ThresholdsWire ;
2626 signers : SignerWire [ ] ;
2727 ext : AccountEntryExtWire ;
@@ -66,7 +66,7 @@ export class AccountEntry extends XdrValue {
6666 readonly numSubEntries : number ;
6767 readonly inflationDest : PublicKey | null ;
6868 readonly flags : number ;
69- readonly homeDomain : string ;
69+ readonly homeDomain : XdrString ;
7070 readonly thresholds : Thresholds ;
7171 readonly signers : Signer [ ] ;
7272 readonly ext : AccountEntryExt ;
@@ -78,7 +78,7 @@ export class AccountEntry extends XdrValue {
7878 numSubEntries : uint32 ( ) ,
7979 inflationDest : option ( PublicKey . schema ) ,
8080 flags : uint32 ( ) ,
81- homeDomain : string_ ( 32 ) ,
81+ homeDomain : xdrString ( 32 ) ,
8282 thresholds : Thresholds . schema ,
8383 signers : array ( Signer . schema , UNBOUNDED_MAX_LENGTH ) ,
8484 ext : AccountEntryExt . schema ,
@@ -91,7 +91,7 @@ export class AccountEntry extends XdrValue {
9191 numSubEntries : number ;
9292 inflationDest : PublicKey | null ;
9393 flags : number ;
94- homeDomain : Uint8Array | string ;
94+ homeDomain : XdrString | string | Uint8Array ;
9595 thresholds : Thresholds | Uint8Array | string ;
9696 signers : Signer [ ] ;
9797 ext : AccountEntryExt ;
@@ -104,9 +104,9 @@ export class AccountEntry extends XdrValue {
104104 this . inflationDest = input . inflationDest ;
105105 this . flags = input . flags ;
106106 this . homeDomain =
107- input . homeDomain instanceof Uint8Array
108- ? new TextDecoder ( "latin1" ) . decode ( input . homeDomain )
109- : input . homeDomain ;
107+ input . homeDomain instanceof XdrString
108+ ? input . homeDomain
109+ : new XdrString ( input . homeDomain ) ;
110110 this . thresholds =
111111 input . thresholds instanceof Thresholds
112112 ? input . thresholds
0 commit comments