Closed quankori closed 1 year ago
Currently, I am trying to decode scVal to its native format, but it is not working. I followed these steps:
AAAADwAAAAdkZXBvc2l0AA==
SorobanClient.xdr.ScVal
const svcValue = SorobanClient.xdr.ScVal.scvSymbol( "AAAADwAAAAdkZXBvc2l0AA==", );
The result is as follows:
ChildUnion { _switch: ChildEnum { name: 'scvString', value: 14 }, _arm: 'str', _armType: String { _maxLength: 4294967295 }, _value: 'AAAADwAAAAdkZXBvc2l0AA==' }
scValToNative
const scValDecode = await SorobanClient.scValToNative(svcValue); console.log(scValDecode);
The result is AAAADwAAAAdkZXBvc2l0AA==. I attempted to decode it on website laboratory stellar, and the result was different: ZGVwb3NpdA==
ZGVwb3NpdA==
that's because the scvValue itself is not correct: you need to specify the decoding
scvValue
const svcValue = SorobanClient.xdr.ScVal.fromXDR( "AAAADwAAAAdkZXBvc2l0AA==", "base64" );
then it should be correct
Currently, I am trying to decode scVal to its native format, but it is not working. I followed these steps:
AAAADwAAAAdkZXBvc2l0AA==
of type Sym.SorobanClient.xdr.ScVal
using the following code:The result is as follows:
scValToNative
, it returns the same old variable:The result is
AAAADwAAAAdkZXBvc2l0AA==
. I attempted to decode it on website laboratory stellar, and the result was different:ZGVwb3NpdA==