1
- import { AnyT , jsonArrayMember , jsonMember , jsonObject } from 'typedjson' ;
1
+ import { jsonArrayMember , jsonMember , jsonObject } from 'typedjson' ;
2
2
3
3
import { Account } from './Account' ;
4
- import { TransferV1 } from './Transfer' ;
4
+ import { Transfer } from './Transfer' ;
5
5
import { DeployInfo } from './DeployInfo' ;
6
6
import { EraInfo } from './EraInfo' ;
7
7
import { Bid } from './Bid' ;
@@ -17,6 +17,7 @@ import { Contract } from './Contract';
17
17
import { ContractPackage } from './ContractPackage' ;
18
18
import { CLValue , CLValueParser } from './clvalue' ;
19
19
import { SystemByteCode } from './ByteCode' ;
20
+ import { ContractWasm } from './ContractWasm' ;
20
21
21
22
/**
22
23
* Represents a stored value in a decentralized system. The value can be of different types
@@ -57,8 +58,8 @@ export class StoredValue {
57
58
/**
58
59
* The WebAssembly (WASM) bytecode for the contract, represented as `AnyT`.
59
60
*/
60
- @jsonMember ( { name : 'ContractWASM ' , constructor : AnyT } )
61
- contractWASM ?: any ;
61
+ @jsonMember ( { name : 'ContractWasm ' , constructor : ContractWasm } )
62
+ ContractWasm ?: ContractWasm ;
62
63
63
64
/**
64
65
* The stored contract package information.
@@ -67,10 +68,17 @@ export class StoredValue {
67
68
contractPackage ?: ContractPackage ;
68
69
69
70
/**
70
- * The legacy transfer information, representing a historical transfer.
71
+ * The transfer information, representing a historical transfer.
71
72
*/
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 ;
74
82
75
83
/**
76
84
* The information related to a deploy operation.
@@ -117,8 +125,8 @@ export class StoredValue {
117
125
/**
118
126
* The stored package information, typically a contract or executable package.
119
127
*/
120
- @jsonMember ( { name : 'Package ' , constructor : Package } )
121
- package ?: Package ;
128
+ @jsonMember ( { name : 'SmartContract ' , constructor : Package } )
129
+ smartContract ?: Package ;
122
130
123
131
/**
124
132
* The stored bytecode, representing compiled contract or executable code.
@@ -162,4 +170,10 @@ export class StoredValue {
162
170
*/
163
171
@jsonMember ( { name : 'EntryPoint' , constructor : EntryPointValue } )
164
172
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 ;
165
179
}
0 commit comments