Skip to content

Commit

Permalink
update the test ts script to use newer js sdk export names (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland authored Jan 8, 2025
1 parent 1496c5e commit 8327f56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions events.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ts-node-script

import { ArgumentParser } from 'argparse';
import { Contract, SorobanRpc } from '@stellar/stellar-sdk';
import { Contract, rpc } from '@stellar/stellar-sdk';

async function main() {
const parser = new ArgumentParser({ description: 'Get contract events' })
Expand All @@ -17,9 +17,9 @@ async function main() {
ledgerFrom,
} = parser.parse_args() as Record<string, string>;

const server = new SorobanRpc.Server(rpcUrl, { allowHttp: true });
const server = new rpc.Server(rpcUrl, { allowHttp: true });

let filters: SorobanRpc.Api.EventFilter[] = [];
let filters: rpc.Api.EventFilter[] = [];

if (contractId != null) {
filters.push({
Expand Down
6 changes: 2 additions & 4 deletions invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import { ArgumentParser } from 'argparse';
import {
Contract,
Keypair,
rpc,
TransactionBuilder,
SorobanRpc,
scValToNative,
xdr,
} from '@stellar/stellar-sdk';

const { Server } = SorobanRpc;

async function main() {
const parser = new ArgumentParser({ description: 'Invoke a contract function' })

Expand Down Expand Up @@ -61,7 +59,7 @@ async function main() {
console.log(JSON.stringify(result));
return;
} else {
const server = new Server(rpcUrl, { allowHttp: true });
const server = new rpc.Server(rpcUrl, { allowHttp: true });
const sourceAccount = await server.getAccount(account);
const contract = new Contract(contractId);
// Some hacky param-parsing as csv. Generated Typescript bindings would be better.
Expand Down

0 comments on commit 8327f56

Please sign in to comment.