File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Assets/Thirdweb/Core/Scripts Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,22 @@ public async Task<T> Read<T>(string functionName, params object[] args)
383383 return JsonConvert . DeserializeObject < T > ( JsonConvert . SerializeObject ( rawResults ) ) ;
384384 }
385385
386+ public async Task < T > ReadRaw < T > ( string functionName , params object [ ] args )
387+ where T : new ( )
388+ {
389+ if ( Utils . IsWebGLBuild ( ) )
390+ {
391+ return await Bridge . InvokeRoute < T > ( getRoute ( "call" ) , Utils . ToJsonStringArray ( functionName , args ) ) ;
392+ }
393+
394+ if ( this . ABI == null )
395+ throw new UnityException ( "You must pass an ABI for native platform custom calls" ) ;
396+
397+ var contract = Utils . GetWeb3 ( ) . Eth . GetContract ( this . ABI , this . Address ) ;
398+ var function = contract . GetFunction ( functionName ) ;
399+ return await function . CallDeserializingToObjectAsync < T > ( args ) ;
400+ }
401+
386402 private T ConvertValue < T > ( object value )
387403 {
388404 if ( value is T result )
You can’t perform that action at this time.
0 commit comments