1- import { Account , Application , Bytes , bytes , gtxn , internal , Uint64 , uint64 } from '@algorandfoundation/algorand-typescript'
1+ import {
2+ type Account as AccountType ,
3+ type Application as ApplicationType ,
4+ Bytes ,
5+ bytes ,
6+ gtxn ,
7+ internal ,
8+ Uint64 ,
9+ uint64 ,
10+ } from '@algorandfoundation/algorand-typescript'
211import { lazyContext } from '../context-helpers/internal-context'
312import { asMaybeUint64Cls , asUint64 } from '../util'
13+ import { Account } from './reference'
414
515const resolveAppIndex = ( appIdOrIndex : internal . primitives . StubUint64Compat ) : uint64 => {
616 const input = asUint64 ( appIdOrIndex )
@@ -11,52 +21,52 @@ const resolveAppIndex = (appIdOrIndex: internal.primitives.StubUint64Compat): ui
1121 return txn . apps ( input ) . id
1222}
1323
14- export const getApp = ( app : Application | internal . primitives . StubUint64Compat ) : Application | undefined => {
24+ export const getApp = ( app : ApplicationType | internal . primitives . StubUint64Compat ) : ApplicationType | undefined => {
1525 try {
1626 const appId = asMaybeUint64Cls ( app )
1727 if ( appId !== undefined ) {
1828 return lazyContext . ledger . getApplication ( resolveAppIndex ( appId ) )
1929 }
20- return app as Application
30+ return app as ApplicationType
2131 } catch {
2232 return undefined
2333 }
2434}
2535
2636export const AppParams : internal . opTypes . AppParamsType = {
27- appApprovalProgram ( a : Application | internal . primitives . StubUint64Compat ) : readonly [ bytes , boolean ] {
37+ appApprovalProgram ( a : ApplicationType | internal . primitives . StubUint64Compat ) : readonly [ bytes , boolean ] {
2838 const app = getApp ( a )
2939 return app === undefined ? [ Bytes ( ) , false ] : [ app . approvalProgram , true ]
3040 } ,
31- appClearStateProgram ( a : Application | internal . primitives . StubUint64Compat ) : readonly [ bytes , boolean ] {
41+ appClearStateProgram ( a : ApplicationType | internal . primitives . StubUint64Compat ) : readonly [ bytes , boolean ] {
3242 const app = getApp ( a )
3343 return app === undefined ? [ Bytes ( ) , false ] : [ app . clearStateProgram , true ]
3444 } ,
35- appGlobalNumUint ( a : Application | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
45+ appGlobalNumUint ( a : ApplicationType | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
3646 const app = getApp ( a )
3747 return app === undefined ? [ Uint64 ( 0 ) , false ] : [ app . globalNumUint , true ]
3848 } ,
39- appGlobalNumByteSlice ( a : Application | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
49+ appGlobalNumByteSlice ( a : ApplicationType | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
4050 const app = getApp ( a )
4151 return app === undefined ? [ Uint64 ( 0 ) , false ] : [ app . globalNumBytes , true ]
4252 } ,
43- appLocalNumUint ( a : Application | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
53+ appLocalNumUint ( a : ApplicationType | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
4454 const app = getApp ( a )
4555 return app === undefined ? [ Uint64 ( 0 ) , false ] : [ app . localNumUint , true ]
4656 } ,
47- appLocalNumByteSlice ( a : Application | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
57+ appLocalNumByteSlice ( a : ApplicationType | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
4858 const app = getApp ( a )
4959 return app === undefined ? [ Uint64 ( 0 ) , false ] : [ app . localNumBytes , true ]
5060 } ,
51- appExtraProgramPages ( a : Application | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
61+ appExtraProgramPages ( a : ApplicationType | internal . primitives . StubUint64Compat ) : readonly [ uint64 , boolean ] {
5262 const app = getApp ( a )
5363 return app === undefined ? [ Uint64 ( 0 ) , false ] : [ app . extraProgramPages , true ]
5464 } ,
55- appCreator ( a : Application | internal . primitives . StubUint64Compat ) : readonly [ Account , boolean ] {
65+ appCreator ( a : ApplicationType | internal . primitives . StubUint64Compat ) : readonly [ AccountType , boolean ] {
5666 const app = getApp ( a )
5767 return app === undefined ? [ Account ( ) , false ] : [ app . creator , true ]
5868 } ,
59- appAddress ( a : Application | internal . primitives . StubUint64Compat ) : readonly [ Account , boolean ] {
69+ appAddress ( a : ApplicationType | internal . primitives . StubUint64Compat ) : readonly [ AccountType , boolean ] {
6070 const app = getApp ( a )
6171 return app === undefined ? [ Account ( ) , false ] : [ app . address , true ]
6272 } ,
0 commit comments