From 7c50b7565fb8862ac6ace2d0e1dcb642a6df0b3b Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 11 Jul 2023 19:07:48 -0700 Subject: [PATCH] Fully resolve namespace instead of shortcut? --- invoke.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/invoke.ts b/invoke.ts index 5be7e64..0c95a3b 100755 --- a/invoke.ts +++ b/invoke.ts @@ -2,7 +2,6 @@ import { ArgumentParser } from 'argparse'; import * as SorobanClient from 'soroban-client'; -const xdr = SorobanClient.xdr; async function main() { const parser = new ArgumentParser({ description: 'Invoke a contract function' }) @@ -32,10 +31,10 @@ async function main() { const sourceAccount = await server.getAccount(account); // Some hacky param-parsing as csv. Generated Typescript bindings would be better. - const params: xdr.ScVal[] = []; + const params: SorobanClient.xdr.ScVal[] = []; if (functionParams) { functionParams.split(",").forEach((param) => { - params.push(xdr.ScVal.scvSymbol(param)); + params.push(SorobanClient.xdr.ScVal.scvSymbol(param)); }); } @@ -67,7 +66,7 @@ async function main() { throw new Error(`No result meta XDR: ${JSON.stringify(response)}`); } - const result = xdr.TransactionMeta.fromXDR(response.resultMetaXdr, "base64"); + const result = SorobanClient.xdr.TransactionMeta.fromXDR(response.resultMetaXdr, "base64"); // TODO: Move this scval serializing stuff to stellar-base const scval = result.v3().sorobanMeta()?.returnValue()!; const parsed = SorobanClient.scValToNative(scval);