diff --git a/events.ts b/events.ts index 272932b..6095e93 100755 --- a/events.ts +++ b/events.ts @@ -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' }) @@ -17,9 +17,9 @@ async function main() { ledgerFrom, } = parser.parse_args() as Record; - 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({ diff --git a/invoke.ts b/invoke.ts index 590ee61..efd313c 100755 --- a/invoke.ts +++ b/invoke.ts @@ -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' }) @@ -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.