1- import { AnyT , jsonArrayMember , jsonMember , jsonObject } from 'typedjson' ;
1+ import { jsonArrayMember , jsonMember , jsonObject } from 'typedjson' ;
22
33import { Account } from './Account' ;
4- import { TransferV1 } from './Transfer' ;
4+ import { Transfer } from './Transfer' ;
55import { DeployInfo } from './DeployInfo' ;
66import { EraInfo } from './EraInfo' ;
77import { Bid } from './Bid' ;
@@ -17,6 +17,7 @@ import { Contract } from './Contract';
1717import { ContractPackage } from './ContractPackage' ;
1818import { CLValue , CLValueParser } from './clvalue' ;
1919import { SystemByteCode } from './ByteCode' ;
20+ import { ContractWasm } from './ContractWasm' ;
2021
2122/**
2223 * Represents a stored value in a decentralized system. The value can be of different types
@@ -57,8 +58,8 @@ export class StoredValue {
5758 /**
5859 * The WebAssembly (WASM) bytecode for the contract, represented as `AnyT`.
5960 */
60- @jsonMember ( { name : 'ContractWASM ' , constructor : AnyT } )
61- contractWASM ?: any ;
61+ @jsonMember ( { name : 'ContractWasm ' , constructor : ContractWasm } )
62+ ContractWasm ?: ContractWasm ;
6263
6364 /**
6465 * The stored contract package information.
@@ -67,10 +68,17 @@ export class StoredValue {
6768 contractPackage ?: ContractPackage ;
6869
6970 /**
70- * The legacy transfer information, representing a historical transfer.
71+ * The transfer information, representing a historical transfer.
7172 */
72- @jsonMember ( { name : 'LegacyTransfer' , constructor : TransferV1 } )
73- legacyTransfer ?: TransferV1 ;
73+ @jsonMember ( {
74+ name : 'Transfer' ,
75+ constructor : Transfer ,
76+ deserializer : json => {
77+ if ( ! json ) return ;
78+ return Transfer . fromJSON ( json ) ;
79+ }
80+ } )
81+ transfer ?: Transfer ;
7482
7583 /**
7684 * The information related to a deploy operation.
@@ -117,8 +125,8 @@ export class StoredValue {
117125 /**
118126 * The stored package information, typically a contract or executable package.
119127 */
120- @jsonMember ( { name : 'Package ' , constructor : Package } )
121- package ?: Package ;
128+ @jsonMember ( { name : 'SmartContract ' , constructor : Package } )
129+ smartContract ?: Package ;
122130
123131 /**
124132 * The stored bytecode, representing compiled contract or executable code.
@@ -162,4 +170,10 @@ export class StoredValue {
162170 */
163171 @jsonMember ( { name : 'EntryPoint' , constructor : EntryPointValue } )
164172 entryPoint ?: EntryPointValue ;
173+
174+ /**
175+ * Raw bytes. Similar to a [`crate::StoredValue::CLValue`] but does not incur overhead of a [`crate::CLValue`] and [`crate::CLType`].
176+ */
177+ @jsonMember ( { name : 'RawBytes' , constructor : String } )
178+ rawBytes ?: string ;
165179}
0 commit comments