diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.d.ts index 58a5712000..ca7baf384e 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.d.ts @@ -113,7 +113,7 @@ export interface Client { /** * Construct and simulate a u32_fail_on_even transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - u32FailOnEven: ({ u32_ }: { + u32_fail_on_even: ({ u32_ }: { u32_: u32; }, options?: { /** @@ -132,7 +132,7 @@ export interface Client { /** * Construct and simulate a u32_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - u32: ({ u32_ }: { + u32_: ({ u32_ }: { u32_: u32; }, options?: { /** @@ -151,7 +151,7 @@ export interface Client { /** * Construct and simulate a i32_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - i32: ({ i32_ }: { + i32_: ({ i32_ }: { i32_: i32; }, options?: { /** @@ -170,7 +170,7 @@ export interface Client { /** * Construct and simulate a i64_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - i64: ({ i64_ }: { + i64_: ({ i64_ }: { i64_: i64; }, options?: { /** @@ -190,7 +190,7 @@ export interface Client { * Construct and simulate a strukt_hel transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. * * Example contract method which takes a struct */ - struktHel: ({ strukt }: { + strukt_hel: ({ strukt }: { strukt: Test; }, options?: { /** @@ -304,7 +304,7 @@ export interface Client { /** * Construct and simulate a bytes_n transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - bytesN: ({ bytes_n }: { + bytes_n: ({ bytes_n }: { bytes_n: Buffer; }, options?: { /** @@ -419,7 +419,7 @@ export interface Client { /** * Construct and simulate a multi_args transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - multiArgs: ({ a, b }: { + multi_args: ({ a, b }: { a: u32; b: boolean; }, options?: { @@ -573,7 +573,7 @@ export interface Client { /** * Construct and simulate a tuple_strukt transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - tupleStrukt: ({ tuple_strukt }: { + tuple_strukt: ({ tuple_strukt }: { tuple_strukt: TupleStruct; }, options?: { /** @@ -597,23 +597,23 @@ export declare class Client extends ContractClient { hello: (json: string) => AssembledTransaction; woid: (json: string) => AssembledTransaction; val: (json: string) => AssembledTransaction; - u32FailOnEven: (json: string) => AssembledTransaction>; - u32: (json: string) => AssembledTransaction; - i32: (json: string) => AssembledTransaction; - i64: (json: string) => AssembledTransaction; - struktHel: (json: string) => AssembledTransaction; + u32_fail_on_even: (json: string) => AssembledTransaction>; + u32_: (json: string) => AssembledTransaction; + i32_: (json: string) => AssembledTransaction; + i64_: (json: string) => AssembledTransaction; + strukt_hel: (json: string) => AssembledTransaction; strukt: (json: string) => AssembledTransaction; simple: (json: string) => AssembledTransaction; complex: (json: string) => AssembledTransaction; addresse: (json: string) => AssembledTransaction; bytes: (json: string) => AssembledTransaction; - bytesN: (json: string) => AssembledTransaction; + bytes_n: (json: string) => AssembledTransaction; card: (json: string) => AssembledTransaction; boolean: (json: string) => AssembledTransaction; not: (json: string) => AssembledTransaction; i128: (json: string) => AssembledTransaction; u128: (json: string) => AssembledTransaction; - multiArgs: (json: string) => AssembledTransaction; + multi_args: (json: string) => AssembledTransaction; map: (json: string) => AssembledTransaction>; vec: (json: string) => AssembledTransaction; tuple: (json: string) => AssembledTransaction; @@ -621,6 +621,6 @@ export declare class Client extends ContractClient { u256: (json: string) => AssembledTransaction; i256: (json: string) => AssembledTransaction; string: (json: string) => AssembledTransaction; - tupleStrukt: (json: string) => AssembledTransaction; + tuple_strukt: (json: string) => AssembledTransaction; }; } diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.js index 18ae74e3f5..3ef56d5536 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.js +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.js @@ -83,23 +83,23 @@ class Client extends index_js_1.ContractClient { hello: (this.txFromJSON), woid: (this.txFromJSON), val: (this.txFromJSON), - u32FailOnEven: (this.txFromJSON), - u32: (this.txFromJSON), - i32: (this.txFromJSON), - i64: (this.txFromJSON), - struktHel: (this.txFromJSON), + u32_fail_on_even: (this.txFromJSON), + u32_: (this.txFromJSON), + i32_: (this.txFromJSON), + i64_: (this.txFromJSON), + strukt_hel: (this.txFromJSON), strukt: (this.txFromJSON), simple: (this.txFromJSON), complex: (this.txFromJSON), addresse: (this.txFromJSON), bytes: (this.txFromJSON), - bytesN: (this.txFromJSON), + bytes_n: (this.txFromJSON), card: (this.txFromJSON), boolean: (this.txFromJSON), not: (this.txFromJSON), i128: (this.txFromJSON), u128: (this.txFromJSON), - multiArgs: (this.txFromJSON), + multi_args: (this.txFromJSON), map: (this.txFromJSON), vec: (this.txFromJSON), tuple: (this.txFromJSON), @@ -107,7 +107,7 @@ class Client extends index_js_1.ContractClient { u256: (this.txFromJSON), i256: (this.txFromJSON), string: (this.txFromJSON), - tupleStrukt: (this.txFromJSON) + tuple_strukt: (this.txFromJSON) }; } exports.Client = Client; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.d.ts index 58a5712000..ca7baf384e 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.d.ts @@ -113,7 +113,7 @@ export interface Client { /** * Construct and simulate a u32_fail_on_even transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - u32FailOnEven: ({ u32_ }: { + u32_fail_on_even: ({ u32_ }: { u32_: u32; }, options?: { /** @@ -132,7 +132,7 @@ export interface Client { /** * Construct and simulate a u32_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - u32: ({ u32_ }: { + u32_: ({ u32_ }: { u32_: u32; }, options?: { /** @@ -151,7 +151,7 @@ export interface Client { /** * Construct and simulate a i32_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - i32: ({ i32_ }: { + i32_: ({ i32_ }: { i32_: i32; }, options?: { /** @@ -170,7 +170,7 @@ export interface Client { /** * Construct and simulate a i64_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - i64: ({ i64_ }: { + i64_: ({ i64_ }: { i64_: i64; }, options?: { /** @@ -190,7 +190,7 @@ export interface Client { * Construct and simulate a strukt_hel transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. * * Example contract method which takes a struct */ - struktHel: ({ strukt }: { + strukt_hel: ({ strukt }: { strukt: Test; }, options?: { /** @@ -304,7 +304,7 @@ export interface Client { /** * Construct and simulate a bytes_n transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - bytesN: ({ bytes_n }: { + bytes_n: ({ bytes_n }: { bytes_n: Buffer; }, options?: { /** @@ -419,7 +419,7 @@ export interface Client { /** * Construct and simulate a multi_args transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - multiArgs: ({ a, b }: { + multi_args: ({ a, b }: { a: u32; b: boolean; }, options?: { @@ -573,7 +573,7 @@ export interface Client { /** * Construct and simulate a tuple_strukt transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - tupleStrukt: ({ tuple_strukt }: { + tuple_strukt: ({ tuple_strukt }: { tuple_strukt: TupleStruct; }, options?: { /** @@ -597,23 +597,23 @@ export declare class Client extends ContractClient { hello: (json: string) => AssembledTransaction; woid: (json: string) => AssembledTransaction; val: (json: string) => AssembledTransaction; - u32FailOnEven: (json: string) => AssembledTransaction>; - u32: (json: string) => AssembledTransaction; - i32: (json: string) => AssembledTransaction; - i64: (json: string) => AssembledTransaction; - struktHel: (json: string) => AssembledTransaction; + u32_fail_on_even: (json: string) => AssembledTransaction>; + u32_: (json: string) => AssembledTransaction; + i32_: (json: string) => AssembledTransaction; + i64_: (json: string) => AssembledTransaction; + strukt_hel: (json: string) => AssembledTransaction; strukt: (json: string) => AssembledTransaction; simple: (json: string) => AssembledTransaction; complex: (json: string) => AssembledTransaction; addresse: (json: string) => AssembledTransaction; bytes: (json: string) => AssembledTransaction; - bytesN: (json: string) => AssembledTransaction; + bytes_n: (json: string) => AssembledTransaction; card: (json: string) => AssembledTransaction; boolean: (json: string) => AssembledTransaction; not: (json: string) => AssembledTransaction; i128: (json: string) => AssembledTransaction; u128: (json: string) => AssembledTransaction; - multiArgs: (json: string) => AssembledTransaction; + multi_args: (json: string) => AssembledTransaction; map: (json: string) => AssembledTransaction>; vec: (json: string) => AssembledTransaction; tuple: (json: string) => AssembledTransaction; @@ -621,6 +621,6 @@ export declare class Client extends ContractClient { u256: (json: string) => AssembledTransaction; i256: (json: string) => AssembledTransaction; string: (json: string) => AssembledTransaction; - tupleStrukt: (json: string) => AssembledTransaction; + tuple_strukt: (json: string) => AssembledTransaction; }; } diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.js index df40e6ec43..e0de8f7259 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.js +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.js @@ -66,23 +66,23 @@ export class Client extends ContractClient { hello: (this.txFromJSON), woid: (this.txFromJSON), val: (this.txFromJSON), - u32FailOnEven: (this.txFromJSON), - u32: (this.txFromJSON), - i32: (this.txFromJSON), - i64: (this.txFromJSON), - struktHel: (this.txFromJSON), + u32_fail_on_even: (this.txFromJSON), + u32_: (this.txFromJSON), + i32_: (this.txFromJSON), + i64_: (this.txFromJSON), + strukt_hel: (this.txFromJSON), strukt: (this.txFromJSON), simple: (this.txFromJSON), complex: (this.txFromJSON), addresse: (this.txFromJSON), bytes: (this.txFromJSON), - bytesN: (this.txFromJSON), + bytes_n: (this.txFromJSON), card: (this.txFromJSON), boolean: (this.txFromJSON), not: (this.txFromJSON), i128: (this.txFromJSON), u128: (this.txFromJSON), - multiArgs: (this.txFromJSON), + multi_args: (this.txFromJSON), map: (this.txFromJSON), vec: (this.txFromJSON), tuple: (this.txFromJSON), @@ -90,6 +90,6 @@ export class Client extends ContractClient { u256: (this.txFromJSON), i256: (this.txFromJSON), string: (this.txFromJSON), - tupleStrukt: (this.txFromJSON) + tuple_strukt: (this.txFromJSON) }; } diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/index.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/index.d.ts index 58a5712000..ca7baf384e 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/index.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/index.d.ts @@ -113,7 +113,7 @@ export interface Client { /** * Construct and simulate a u32_fail_on_even transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - u32FailOnEven: ({ u32_ }: { + u32_fail_on_even: ({ u32_ }: { u32_: u32; }, options?: { /** @@ -132,7 +132,7 @@ export interface Client { /** * Construct and simulate a u32_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - u32: ({ u32_ }: { + u32_: ({ u32_ }: { u32_: u32; }, options?: { /** @@ -151,7 +151,7 @@ export interface Client { /** * Construct and simulate a i32_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - i32: ({ i32_ }: { + i32_: ({ i32_ }: { i32_: i32; }, options?: { /** @@ -170,7 +170,7 @@ export interface Client { /** * Construct and simulate a i64_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - i64: ({ i64_ }: { + i64_: ({ i64_ }: { i64_: i64; }, options?: { /** @@ -190,7 +190,7 @@ export interface Client { * Construct and simulate a strukt_hel transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. * * Example contract method which takes a struct */ - struktHel: ({ strukt }: { + strukt_hel: ({ strukt }: { strukt: Test; }, options?: { /** @@ -304,7 +304,7 @@ export interface Client { /** * Construct and simulate a bytes_n transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - bytesN: ({ bytes_n }: { + bytes_n: ({ bytes_n }: { bytes_n: Buffer; }, options?: { /** @@ -419,7 +419,7 @@ export interface Client { /** * Construct and simulate a multi_args transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - multiArgs: ({ a, b }: { + multi_args: ({ a, b }: { a: u32; b: boolean; }, options?: { @@ -573,7 +573,7 @@ export interface Client { /** * Construct and simulate a tuple_strukt transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - tupleStrukt: ({ tuple_strukt }: { + tuple_strukt: ({ tuple_strukt }: { tuple_strukt: TupleStruct; }, options?: { /** @@ -597,23 +597,23 @@ export declare class Client extends ContractClient { hello: (json: string) => AssembledTransaction; woid: (json: string) => AssembledTransaction; val: (json: string) => AssembledTransaction; - u32FailOnEven: (json: string) => AssembledTransaction>; - u32: (json: string) => AssembledTransaction; - i32: (json: string) => AssembledTransaction; - i64: (json: string) => AssembledTransaction; - struktHel: (json: string) => AssembledTransaction; + u32_fail_on_even: (json: string) => AssembledTransaction>; + u32_: (json: string) => AssembledTransaction; + i32_: (json: string) => AssembledTransaction; + i64_: (json: string) => AssembledTransaction; + strukt_hel: (json: string) => AssembledTransaction; strukt: (json: string) => AssembledTransaction; simple: (json: string) => AssembledTransaction; complex: (json: string) => AssembledTransaction; addresse: (json: string) => AssembledTransaction; bytes: (json: string) => AssembledTransaction; - bytesN: (json: string) => AssembledTransaction; + bytes_n: (json: string) => AssembledTransaction; card: (json: string) => AssembledTransaction; boolean: (json: string) => AssembledTransaction; not: (json: string) => AssembledTransaction; i128: (json: string) => AssembledTransaction; u128: (json: string) => AssembledTransaction; - multiArgs: (json: string) => AssembledTransaction; + multi_args: (json: string) => AssembledTransaction; map: (json: string) => AssembledTransaction>; vec: (json: string) => AssembledTransaction; tuple: (json: string) => AssembledTransaction; @@ -621,6 +621,6 @@ export declare class Client extends ContractClient { u256: (json: string) => AssembledTransaction; i256: (json: string) => AssembledTransaction; string: (json: string) => AssembledTransaction; - tupleStrukt: (json: string) => AssembledTransaction; + tuple_strukt: (json: string) => AssembledTransaction; }; } diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package-lock.json b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package-lock.json index 2261fc9671..adf57362af 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package-lock.json +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "@stellar/freighter-api": "2.0.0", - "@stellar/stellar-sdk": "stellar/js-stellar-sdk#bindings", + "@stellar/stellar-sdk": "AhaLabs/js-stellar-sdk#fix/no-jsification", "buffer": "6.0.3" }, "devDependencies": { @@ -45,7 +45,7 @@ }, "node_modules/@stellar/stellar-sdk": { "version": "11.2.2", - "resolved": "git+ssh://git@github.com/stellar/js-stellar-sdk.git#bdf74951f89bbc9bd48179b4a7a4ad33db570643", + "resolved": "git+ssh://git@github.com/AhaLabs/js-stellar-sdk.git#3450acb5c658f90bf05d27820fcf23bddd14b0dc", "license": "Apache-2.0", "dependencies": { "@stellar/stellar-base": "^11.0.0", diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package.json b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package.json index 042f8c02b9..69ff4abbf6 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package.json +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package.json @@ -4,7 +4,7 @@ "dependencies": { "@stellar/freighter-api": "2.0.0", "buffer": "6.0.3", - "@stellar/stellar-sdk": "stellar/js-stellar-sdk#bindings" + "@stellar/stellar-sdk": "AhaLabs/js-stellar-sdk#fix/no-jsification" }, "scripts": { "build": "node ./scripts/build.mjs" diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/index.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/index.ts index 9fd5e51f94..2ad154c3a4 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/index.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/index.ts @@ -125,7 +125,7 @@ export interface Client { /** * Construct and simulate a u32_fail_on_even transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - u32FailOnEven: ({u32_}: {u32_: u32}, options?: { + u32_fail_on_even: ({u32_}: {u32_: u32}, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE */ @@ -145,7 +145,7 @@ export interface Client { /** * Construct and simulate a u32_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - u32: ({u32_}: {u32_: u32}, options?: { + u32_: ({u32_}: {u32_: u32}, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE */ @@ -165,7 +165,7 @@ export interface Client { /** * Construct and simulate a i32_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - i32: ({i32_}: {i32_: i32}, options?: { + i32_: ({i32_}: {i32_: i32}, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE */ @@ -185,7 +185,7 @@ export interface Client { /** * Construct and simulate a i64_ transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - i64: ({i64_}: {i64_: i64}, options?: { + i64_: ({i64_}: {i64_: i64}, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE */ @@ -206,7 +206,7 @@ export interface Client { * Construct and simulate a strukt_hel transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. * * Example contract method which takes a struct */ - struktHel: ({strukt}: {strukt: Test}, options?: { + strukt_hel: ({strukt}: {strukt: Test}, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE */ @@ -326,7 +326,7 @@ export interface Client { /** * Construct and simulate a bytes_n transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - bytesN: ({bytes_n}: {bytes_n: Buffer}, options?: { + bytes_n: ({bytes_n}: {bytes_n: Buffer}, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE */ @@ -447,7 +447,7 @@ export interface Client { /** * Construct and simulate a multi_args transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - multiArgs: ({a, b}: {a: u32, b: boolean}, options?: { + multi_args: ({a, b}: {a: u32, b: boolean}, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE */ @@ -608,7 +608,7 @@ export interface Client { /** * Construct and simulate a tuple_strukt transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ - tupleStrukt: ({tuple_strukt}: {tuple_strukt: TupleStruct}, options?: { + tuple_strukt: ({tuple_strukt}: {tuple_strukt: TupleStruct}, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE */ @@ -670,23 +670,23 @@ export class Client extends ContractClient { hello: this.txFromJSON, woid: this.txFromJSON, val: this.txFromJSON, - u32FailOnEven: this.txFromJSON>, - u32: this.txFromJSON, - i32: this.txFromJSON, - i64: this.txFromJSON, - struktHel: this.txFromJSON>, + u32_fail_on_even: this.txFromJSON>, + u32_: this.txFromJSON, + i32_: this.txFromJSON, + i64_: this.txFromJSON, + strukt_hel: this.txFromJSON>, strukt: this.txFromJSON, simple: this.txFromJSON, complex: this.txFromJSON, addresse: this.txFromJSON, bytes: this.txFromJSON, - bytesN: this.txFromJSON, + bytes_n: this.txFromJSON, card: this.txFromJSON, boolean: this.txFromJSON, not: this.txFromJSON, i128: this.txFromJSON, u128: this.txFromJSON, - multiArgs: this.txFromJSON, + multi_args: this.txFromJSON, map: this.txFromJSON>, vec: this.txFromJSON>, tuple: this.txFromJSON, @@ -694,6 +694,6 @@ export class Client extends ContractClient { u256: this.txFromJSON, i256: this.txFromJSON, string: this.txFromJSON, - tupleStrukt: this.txFromJSON + tuple_strukt: this.txFromJSON } } \ No newline at end of file diff --git a/cmd/crates/soroban-spec-typescript/src/lib.rs b/cmd/crates/soroban-spec-typescript/src/lib.rs index f80aa55e79..709478bca0 100644 --- a/cmd/crates/soroban-spec-typescript/src/lib.rs +++ b/cmd/crates/soroban-spec-typescript/src/lib.rs @@ -7,7 +7,6 @@ use std::{fs, io}; use crate::types::Type; -use heck::ToLowerCamelCase; use itertools::Itertools; use sha2::{Digest, Sha256}; use stellar_xdr::curr::{Limits, ScSpecEntry, WriteXdr}; @@ -152,13 +151,9 @@ const METHOD_OPTIONS: &str = r"{ simulate?: boolean; }"; -fn jsify_name(name: &String) -> String { - name.to_lower_camel_case() -} - pub fn entry_to_name_and_return_type(entry: &Entry) -> Option<(String, String)> { if let Entry::Function { name, outputs, .. } = entry { - Some((jsify_name(name), outputs_to_return_type(outputs))) + Some((name.to_owned(), outputs_to_return_type(outputs))) } else { None } @@ -191,12 +186,11 @@ pub fn entry_to_method_type(entry: &Entry) -> String { }) .unwrap_or_default(); let doc = doc_to_ts_doc(doc, Some(name)); - let js_name = jsify_name(name); let return_type = outputs_to_return_type(outputs); format!( r#" {doc} - {js_name}: ({input}options?: {METHOD_OPTIONS}) => Promise> + {name}: ({input}options?: {METHOD_OPTIONS}) => Promise> "# ) } diff --git a/cmd/crates/soroban-spec-typescript/src/project_template/package.json b/cmd/crates/soroban-spec-typescript/src/project_template/package.json index 1fd6a6718e..24fd2e637f 100644 --- a/cmd/crates/soroban-spec-typescript/src/project_template/package.json +++ b/cmd/crates/soroban-spec-typescript/src/project_template/package.json @@ -4,7 +4,7 @@ "dependencies": { "@stellar/freighter-api": "2.0.0", "buffer": "6.0.3", - "@stellar/stellar-sdk": "stellar/js-stellar-sdk#bindings" + "@stellar/stellar-sdk": "AhaLabs/js-stellar-sdk#fix/no-jsification" }, "scripts": { "build": "node ./scripts/build.mjs" diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/package-lock.json b/cmd/crates/soroban-spec-typescript/ts-tests/package-lock.json index 0147ef4f12..401e4213b3 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/package-lock.json +++ b/cmd/crates/soroban-spec-typescript/ts-tests/package-lock.json @@ -7,7 +7,7 @@ "hasInstallScript": true, "devDependencies": { "@ava/typescript": "^4.1.0", - "@stellar/stellar-sdk": "stellar/js-stellar-sdk#bindings", + "@stellar/stellar-sdk": "AhaLabs/js-stellar-sdk#fix/no-jsification", "@types/node": "^20.4.9", "@typescript-eslint/eslint-plugin": "^6.10.0", "@typescript-eslint/parser": "^6.10.0", @@ -233,7 +233,7 @@ }, "node_modules/@stellar/stellar-sdk": { "version": "11.2.2", - "resolved": "git+ssh://git@github.com/stellar/js-stellar-sdk.git#bdf74951f89bbc9bd48179b4a7a4ad33db570643", + "resolved": "git+ssh://git@github.com/AhaLabs/js-stellar-sdk.git#3450acb5c658f90bf05d27820fcf23bddd14b0dc", "dev": true, "license": "Apache-2.0", "dependencies": { diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/package.json b/cmd/crates/soroban-spec-typescript/ts-tests/package.json index 6767934340..cda7e2974a 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/package.json +++ b/cmd/crates/soroban-spec-typescript/ts-tests/package.json @@ -14,7 +14,7 @@ "ava": "^5.3.1", "dotenv": "^16.3.1", "eslint": "^8.53.0", - "@stellar/stellar-sdk": "stellar/js-stellar-sdk#bindings", + "@stellar/stellar-sdk": "AhaLabs/js-stellar-sdk#fix/no-jsification", "typescript": "^5.3.3" }, "ava": { diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-custom-types.ts b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-custom-types.ts index c5643f920f..6fc3388cff 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-custom-types.ts +++ b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-custom-types.ts @@ -24,33 +24,30 @@ test('woid', async t => { test('u32_fail_on_even', async t => { t.deepEqual( - (await contract.u32FailOnEven({ u32_: 1 })).result, + (await contract.u32_fail_on_even({ u32_: 1 })).result, new Ok(1) ) t.deepEqual( - (await contract.u32FailOnEven({ u32_: 0 })).result, + (await contract.u32_fail_on_even({ u32_: 0 })).result, new Err({ message: "Please provide an odd number" }) ) }) test('u32_', async t => { - // @ts-expect-error "heck" crate's `to_lower_camel_case` mismatches our `toLowerCamelCase` in stellar-sdk! t.is((await contract.u32_({ u32_: 1 })).result, 1) }) test('i32_', async t => { - // @ts-expect-error "heck" crate's `to_lower_camel_case` mismatches our `toLowerCamelCase` in stellar-sdk! t.is((await contract.i32_({ i32_: 1 })).result, 1) }) test('i64_', async t => { - // @ts-expect-error "heck" crate's `to_lower_camel_case` mismatches our `toLowerCamelCase` in stellar-sdk! t.is((await contract.i64_({ i64_: 1n })).result, 1n) }) test("strukt_hel", async (t) => { const test = { a: 0, b: true, c: "world" } - t.deepEqual((await contract.struktHel({ strukt: test })).result, ["Hello", "world"]) + t.deepEqual((await contract.strukt_hel({ strukt: test })).result, ["Hello", "world"]) }) test("strukt", async (t) => { @@ -117,7 +114,7 @@ test('bytes', async t => { test('bytes_n', async t => { const bytes_n = Buffer.from('123456789') // what's the correct way to construct bytes_n? - t.deepEqual((await contract.bytesN({ bytes_n })).result, bytes_n) + t.deepEqual((await contract.bytes_n({ bytes_n })).result, bytes_n) }) test('card', async t => { @@ -142,8 +139,8 @@ test('u128', async t => { }) test('multi_args', async t => { - t.is((await contract.multiArgs({ a: 1, b: true })).result, 1) - t.is((await contract.multiArgs({ a: 1, b: false })).result, 0) + t.is((await contract.multi_args({ a: 1, b: true })).result, 1) + t.is((await contract.multi_args({ a: 1, b: false })).result, 0) }) test('map', async t => { @@ -193,5 +190,5 @@ test('string', async t => { test('tuple_strukt', async t => { const arg = [{ a: 0, b: true, c: 'hello' }, { tag: 'First', values: undefined }] as const const res = [{ a: 0, b: true, c: 'hello' }, { tag: 'First' }] - t.deepEqual((await contract.tupleStrukt({ tuple_strukt: arg })).result, res) + t.deepEqual((await contract.tuple_strukt({ tuple_strukt: arg })).result, res) }) diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-hello-world.ts b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-hello-world.ts index 9fe15466a1..7dd9ff4b37 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-hello-world.ts +++ b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-hello-world.ts @@ -25,8 +25,8 @@ test("auth", async (t) => { }); test("inc", async (t) => { - const { result: startingBalance } = await contract.getCount() + const { result: startingBalance } = await contract.get_count() const inc = await contract.inc() t.is((await inc.signAndSend()).result, startingBalance + 1) - t.is((await contract.getCount()).result, startingBalance + 1) + t.is((await contract.get_count()).result, startingBalance + 1) });