@@ -25,6 +25,10 @@ export class GlobalData {
2525 assetOptInMinBalance : uint64
2626 genesisHash : bytes
2727 opcodeBudget ?: uint64
28+ payoutsEnabled : boolean
29+ payoutsGoOnlineFee : uint64
30+ payoutsPercent : uint64
31+ payoutsMinBalance : uint64
2832
2933 constructor ( ) {
3034 this . minTxnFee = Uint64 ( MIN_TXN_FEE )
@@ -35,6 +39,10 @@ export class GlobalData {
3539 this . assetCreateMinBalance = Uint64 ( DEFAULT_ASSET_CREATE_MIN_BALANCE )
3640 this . assetOptInMinBalance = Uint64 ( DEFAULT_ASSET_OPT_IN_MIN_BALANCE )
3741 this . genesisHash = DEFAULT_GLOBAL_GENESIS_HASH
42+ this . payoutsEnabled = false
43+ this . payoutsGoOnlineFee = Uint64 ( 0 )
44+ this . payoutsPercent = Uint64 ( 0 )
45+ this . payoutsMinBalance = Uint64 ( 0 )
3846 }
3947}
4048const getGlobalData = ( ) : GlobalData => {
@@ -184,10 +192,44 @@ export const Global: internal.opTypes.GlobalType = {
184192 get genesisHash ( ) : bytes {
185193 return getGlobalData ( ) . genesisHash
186194 } ,
187- payoutsEnabled : false ,
188- // TODO: implement v11 fields
189- payoutsGoOnlineFee : 0 ,
190- payoutsPercent : 0 ,
191- payoutsMinBalance : 0 ,
192- payoutsMaxBalance : 0 ,
195+
196+ /**
197+ * Whether block proposal payouts are enabled.
198+ * Min AVM version: 11
199+ */
200+ get payoutsEnabled ( ) : boolean {
201+ return getGlobalData ( ) . payoutsEnabled
202+ } ,
203+
204+ /**
205+ * The fee required in a keyreg transaction to make an account incentive eligible.
206+ * Min AVM version: 11
207+ */
208+ get payoutsGoOnlineFee ( ) : uint64 {
209+ return getGlobalData ( ) . payoutsGoOnlineFee
210+ } ,
211+
212+ /**
213+ * The percentage of transaction fees in a block that can be paid to the block proposer.
214+ * Min AVM version: 11
215+ */
216+ get payoutsPercent ( ) : uint64 {
217+ return getGlobalData ( ) . payoutsPercent
218+ } ,
219+
220+ /**
221+ * The minimum algo balance an account must have in the agreement round to receive block payouts in the proposal round.
222+ * Min AVM version: 11
223+ */
224+ get payoutsMinBalance ( ) : uint64 {
225+ return getGlobalData ( ) . payoutsMinBalance
226+ } ,
227+
228+ /**
229+ * The maximum algo balance an account can have in the agreement round to receive block payouts in the proposal round.
230+ * Min AVM version: 11
231+ */
232+ get payoutsMaxBalance ( ) : uint64 {
233+ return getGlobalData ( ) . payoutsMinBalance
234+ } ,
193235}
0 commit comments