import { sc , u , wallet } from "@cityofzion/neon-core" ; function addressToScriptHash ( address ) { return u . reverseHex ( wallet . getScriptHashFromAddress ( address ) ) ; } example export function name ( scriptHash ) { return ( sb = new sc . ScriptBuilder ( ) ) => { return sb . emitAppCall ( scriptHash , "name" , [ ] ) ; } ; } example export function symbol ( scriptHash ) { return ( sb = new sc . ScriptBuilder ( ) ) => { return sb . emitAppCall ( scriptHash , "symbol" , [ ] ) ; } ; } example export function decimals ( scriptHash ) { return ( sb = new sc . ScriptBuilder ( ) ) => { return sb . emitAppCall ( scriptHash , "decimals" , [ ] ) ; } ; } example export function totalSupply ( scriptHash ) { return ( sb = new sc . ScriptBuilder ( ) ) => { return sb . emitAppCall ( scriptHash , "totalSupply" , [ ] ) ; } ; } example export function balanceOf ( scriptHash , addr ) { return ( sb = new sc . ScriptBuilder ( ) ) => { const addressHash = addressToScriptHash ( addr ) ; return sb . emitAppCall ( scriptHash , "balanceOf" , [ addressHash ] ) ; } ; } example export function transfer ( scriptHash , fromAddr , toAddr , amt ) { return ( sb = new sc . ScriptBuilder ( ) ) => { const fromHash = addressToScriptHash ( fromAddr ) ; const toHash = addressToScriptHash ( toAddr ) ; const adjustedAmt = new u . Fixed8 ( amt ) . toRawNumber ( ) ; return sb . emitAppCall ( scriptHash , "transfer" , [ fromHash , toHash , sc . ContractParam . integer ( adjustedAmt . toString ( ) ) , ] ) ; } ; }