Skip to content

Commit f4da55f

Browse files
committed
Allow setting the "caller" parameter for the simulation method
1 parent 356c360 commit f4da55f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@creit-tech/stellar-router-sdk",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"license": "MIT",
55
"exports": "./src/mod.ts",
66
"fmt": {

src/sdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class StellarRouterSdk {
3737
);
3838
}
3939

40-
async simResult<T>(invocations: Invocation[], opts?: { source?: string }): Promise<T> {
40+
async simResult<T>(invocations: Invocation[], opts?: { caller?: string; source?: string }): Promise<T> {
4141
if (!this.params?.rpcUrl) {
4242
throw new Error("No `rpcUrl` parameter was provided to the SDK.");
4343
}
@@ -46,7 +46,7 @@ export class StellarRouterSdk {
4646
new Account(opts?.source || SIMULATION_ACCOUNT, "0"),
4747
{ networkPassphrase: Networks.PUBLIC, fee: "0" },
4848
).setTimeout(0)
49-
.addOperation(this.exec(SIMULATION_ACCOUNT, invocations))
49+
.addOperation(this.exec(opts?.caller || SIMULATION_ACCOUNT, invocations))
5050
.build();
5151

5252
const sim = await new rpc.Server(this.params.rpcUrl, { allowHttp: true })

0 commit comments

Comments
 (0)