Skip to content

Commit

Permalink
Fully resolve namespace instead of shortcut?
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Jul 12, 2023
1 parent 7822fd4 commit 7c50b75
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down Expand Up @@ -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));
});
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7c50b75

Please sign in to comment.