diff --git a/src/codeGenerator/assemblyProcessor/builtinToAsm.ts b/src/codeGenerator/assemblyProcessor/builtinToAsm.ts index 657d4b0..a50b32e 100644 --- a/src/codeGenerator/assemblyProcessor/builtinToAsm.ts +++ b/src/codeGenerator/assemblyProcessor/builtinToAsm.ts @@ -480,13 +480,14 @@ export function createBuiltinInstruction ( `FUN @${RetMem.asmName} Get_Asset_Circulating\n` break case 'getAccountBalance': + case 'getAccountBalanceFx': auxFlatMem = flattenMemory(AstAuxVars, utils.createConstantMemObj(0n), BuiltinToken.line) assemblyCode = tempArgsMem[0].asmCode + auxFlatMem.asmCode + `FUN set_B1_B2 $${tempArgsMem[0].FlatMem.asmName} $${auxFlatMem.FlatMem.asmName}\n` + `FUN @${RetMem.asmName} Get_Account_Balance\n` AstAuxVars.freeRegister(auxFlatMem.FlatMem.address) break - case 'getAccountAssetQuantity': + case 'getAccountQuantity': assemblyCode = tempArgsMem[0].asmCode + tempArgsMem[1].asmCode + `FUN set_B1_B2 $${tempArgsMem[0].FlatMem.asmName} $${tempArgsMem[1].FlatMem.asmName}\n` + `FUN @${RetMem.asmName} Get_Account_Balance\n` diff --git a/src/shaper/templates.ts b/src/shaper/templates.ts index 53f079e..76a38cb 100644 --- a/src/shaper/templates.ts +++ b/src/shaper/templates.ts @@ -457,11 +457,11 @@ export const BuiltInTemplate: SC_FUNCTION[] = [ }, { argsMemObj: [longArg, longArg], - asmName: 'getAccountAssetQuantity', + asmName: 'getAccountQuantity', declaration: 'long', sentences: [], builtin: 'assets', - name: 'getAccountAssetQuantity' + name: 'getAccountQuantity' }, /* fixed number versions */ @@ -544,6 +544,14 @@ export const BuiltInTemplate: SC_FUNCTION[] = [ sentences: [], builtin: 'fourArgsPlus', name: 'distributeToHoldersFx' + }, + { + argsMemObj: [longArg], + asmName: 'getAccountBalanceFx', + declaration: 'fixed', + sentences: [], + builtin: 'assets', + name: 'getAccountBalanceFx' } ] @@ -1296,5 +1304,12 @@ export const fixedAPITableTemplate: SC_FUNCTION[] = [ declaration: 'fixed', sentences: [], name: 'F_Get_Activation_Fee' + }, + { + argsMemObj: [], + asmName: 'Get_Account_Balance', + declaration: 'fixed', + sentences: [], + name: 'F_Get_Account_Balance' } ]