Skip to content

Commit

Permalink
feat: new signHere + submitTx functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
chadoh committed Oct 26, 2023
1 parent f448483 commit 204476d
Show file tree
Hide file tree
Showing 5 changed files with 347 additions and 204 deletions.
7 changes: 5 additions & 2 deletions cmd/crates/soroban-spec-typescript/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,14 @@ fn generate_class(fns: &[Entry], spec: &[ScSpecEntry]) -> String {
.join(",\n ");
format!(
r#"export class Contract {{
spec: ContractSpec;
spec: ContractSpec;
constructor(public readonly options: ClassOptions) {{
this.spec = new ContractSpec([
{spec}
]);
]);
}}
submitTx(txXdr: XDR_BASE64, allSigned: PubKeyToAuthEntries, secondsToWait = 10): Promise<SubmitResponse> {{
return submitTx({{ txXdr, allSigned, secondsToWait, ...this.options }});
}}
{methods}
}}"#,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as SorobanClient from 'soroban-client';
import { ContractSpec, Address } from 'soroban-client';
import { Buffer } from "buffer";
import { invoke } from './invoke.js';
import type { ResponseTypes, Wallet, ClassOptions } from './method-options.js'
import { invoke, submitTx } from './invoke.js';
import type { PubKeyToAuthEntries, SubmitResponse } from './invoke.js';
import type { ResponseTypes, Wallet, ClassOptions, XDR_BASE64 } from './method-options.js'

export * from './invoke.js'
export * from './method-options.js'
Expand Down
Loading

0 comments on commit 204476d

Please sign in to comment.