@@ -2,6 +2,7 @@ import { Account, Application, gtxn, internal, uint64 } from '@algorandfoundatio
22import { lazyContext } from '../context-helpers/internal-context'
33import { asMaybeUint64Cls } from '../util'
44import { getApp } from './app-params'
5+ import { Global } from './global'
56
67export const getAccount = ( acct : Account | internal . primitives . StubUint64Compat ) : Account => {
78 const acctId = asMaybeUint64Cls ( acct )
@@ -84,14 +85,19 @@ export const AcctParams: internal.opTypes.AcctParamsType = {
8485 const acct = getAccount ( a )
8586 return [ acct . totalBoxBytes , acct . balance !== 0 ]
8687 } ,
87- // TODO: implement v11 methods
88- acctIncentiveEligible : function ( _a : Account | uint64 ) : readonly [ boolean , boolean ] {
89- throw new Error ( 'Function not implemented.' )
88+ acctIncentiveEligible : function ( a : Account | internal . primitives . StubUint64Compat ) : readonly [ boolean , boolean ] {
89+ const acct = getAccount ( a )
90+ const accountData = lazyContext . ledger . accountDataMap . get ( acct )
91+ return [ accountData ?. incentiveEligible ?? false , acct . balance !== 0 ]
9092 } ,
91- acctLastProposed : function ( _a : Account | uint64 ) : readonly [ uint64 , boolean ] {
92- throw new Error ( 'Function not implemented.' )
93+ acctLastProposed : function ( a : Account | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
94+ const acct = getAccount ( a )
95+ const accountData = lazyContext . ledger . accountDataMap . get ( acct )
96+ return [ accountData ?. lastProposed ?? Global . round , acct . balance !== 0 ]
9397 } ,
94- acctLastHeartbeat : function ( _a : Account | uint64 ) : readonly [ uint64 , boolean ] {
95- throw new Error ( 'Function not implemented.' )
98+ acctLastHeartbeat : function ( a : Account | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
99+ const acct = getAccount ( a )
100+ const accountData = lazyContext . ledger . accountDataMap . get ( acct )
101+ return [ accountData ?. lastHeartbeat ?? Global . round , acct . balance !== 0 ]
96102 } ,
97103}
0 commit comments