diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/README.md b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/README.md index c9ed6609e9..d3b60edc8c 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/README.md +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/README.md @@ -9,7 +9,7 @@ soroban contract bindings ts \ --rpc-url https://rpc-futurenet.stellar.org:443 \ --network-passphrase "Test SDF Future Network ; October 2022" \ --contract-id CB5T6MLZNWJBUBKEQAUVIG5JJWKYSYVVE2OVN25GMX3VX7CZ7OBAPAU4 \ - --name test_custom_types + --output-dir ./path/to/test_custom_types ``` The network passphrase and contract ID are exported from [index.ts](./src/index.ts) in the `networks` constant. If you are the one who generated this library and you know that this contract is also deployed to other networks, feel free to update `networks` with other valid options. This will help your contract consumers use this library more easily. diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/constants.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/constants.d.ts deleted file mode 100644 index a36801fa01..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * The Soroban contract ID for the test_custom_types contract. - */ -export declare const CONTRACT_ID = "CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE"; -/** - * The Soroban contract ID for the test_custom_types contract, in hex. - * If {@link CONTRACT_ID} is a new-style `C…` string, you will need this hex - * version when making calls to RPC for now. - */ -export declare const CONTRACT_ID_HEX: string; -/** - * The Soroban network passphrase used to initialize this library. - */ -export declare const NETWORK_PASSPHRASE = "Test SDF Future Network ; October 2022"; -/** - * The Soroban RPC endpoint used to initialize this library. - */ -export declare const RPC_URL = "https://rpc-futurenet.stellar.org/soroban/rpc"; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/constants.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/constants.js deleted file mode 100644 index 07725f2bf1..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/constants.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.RPC_URL = exports.NETWORK_PASSPHRASE = exports.CONTRACT_ID_HEX = exports.CONTRACT_ID = void 0; -const soroban_client_1 = require("soroban-client"); -/** - * The Soroban contract ID for the test_custom_types contract. - */ -exports.CONTRACT_ID = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; -/** - * The Soroban contract ID for the test_custom_types contract, in hex. - * If {@link CONTRACT_ID} is a new-style `C…` string, you will need this hex - * version when making calls to RPC for now. - */ -exports.CONTRACT_ID_HEX = new soroban_client_1.Contract(exports.CONTRACT_ID).contractId('hex'); -/** - * The Soroban network passphrase used to initialize this library. - */ -exports.NETWORK_PASSPHRASE = 'Test SDF Future Network ; October 2022'; -/** - * The Soroban RPC endpoint used to initialize this library. - */ -exports.RPC_URL = 'https://rpc-futurenet.stellar.org/soroban/rpc'; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/method-options.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/method-options.d.ts index a9d93421df..f861ff1f28 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/method-options.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/method-options.d.ts @@ -20,11 +20,15 @@ export type ClassOptions = { /** * A Wallet interface, such as Freighter, that has the methods `isConnected`, `isAllowed`, `getUserInfo`, and `signTransaction`. If not provided, will attempt to import and use Freighter. Example: * + * @example * ```ts * import freighter from "@stellar/freighter-api"; - * - * // later, when calling this function: + * import { Contract } from "test_custom_types"; + * const contract = new Contract({ + * …, * wallet: freighter, + * }) + * ``` */ wallet?: Wallet; }; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/server.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/server.d.ts deleted file mode 100644 index 9d2038fc5f..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/server.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export {}; -/** - * SorobanClient.Server instance, initialized using {@link RPC_URL} used to - * initialize this library. - */ diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/server.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/server.js deleted file mode 100644 index 2da01908d9..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/server.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * SorobanClient.Server instance, initialized using {@link RPC_URL} used to - * initialize this library. - */ diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/constants.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/constants.d.ts deleted file mode 100644 index a36801fa01..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * The Soroban contract ID for the test_custom_types contract. - */ -export declare const CONTRACT_ID = "CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE"; -/** - * The Soroban contract ID for the test_custom_types contract, in hex. - * If {@link CONTRACT_ID} is a new-style `C…` string, you will need this hex - * version when making calls to RPC for now. - */ -export declare const CONTRACT_ID_HEX: string; -/** - * The Soroban network passphrase used to initialize this library. - */ -export declare const NETWORK_PASSPHRASE = "Test SDF Future Network ; October 2022"; -/** - * The Soroban RPC endpoint used to initialize this library. - */ -export declare const RPC_URL = "https://rpc-futurenet.stellar.org/soroban/rpc"; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/constants.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/constants.js deleted file mode 100644 index b72f8b29a4..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/constants.js +++ /dev/null @@ -1,19 +0,0 @@ -import { Contract } from 'soroban-client'; -/** - * The Soroban contract ID for the test_custom_types contract. - */ -export const CONTRACT_ID = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; -/** - * The Soroban contract ID for the test_custom_types contract, in hex. - * If {@link CONTRACT_ID} is a new-style `C…` string, you will need this hex - * version when making calls to RPC for now. - */ -export const CONTRACT_ID_HEX = new Contract(CONTRACT_ID).contractId('hex'); -/** - * The Soroban network passphrase used to initialize this library. - */ -export const NETWORK_PASSPHRASE = 'Test SDF Future Network ; October 2022'; -/** - * The Soroban RPC endpoint used to initialize this library. - */ -export const RPC_URL = 'https://rpc-futurenet.stellar.org/soroban/rpc'; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/method-options.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/method-options.d.ts index a9d93421df..f861ff1f28 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/method-options.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/method-options.d.ts @@ -20,11 +20,15 @@ export type ClassOptions = { /** * A Wallet interface, such as Freighter, that has the methods `isConnected`, `isAllowed`, `getUserInfo`, and `signTransaction`. If not provided, will attempt to import and use Freighter. Example: * + * @example * ```ts * import freighter from "@stellar/freighter-api"; - * - * // later, when calling this function: + * import { Contract } from "test_custom_types"; + * const contract = new Contract({ + * …, * wallet: freighter, + * }) + * ``` */ wallet?: Wallet; }; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/server.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/server.d.ts deleted file mode 100644 index 9d2038fc5f..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/server.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export {}; -/** - * SorobanClient.Server instance, initialized using {@link RPC_URL} used to - * initialize this library. - */ diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/server.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/server.js deleted file mode 100644 index 9d2038fc5f..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/server.js +++ /dev/null @@ -1,5 +0,0 @@ -export {}; -/** - * SorobanClient.Server instance, initialized using {@link RPC_URL} used to - * initialize this library. - */ diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/constants.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/constants.d.ts deleted file mode 100644 index a36801fa01..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * The Soroban contract ID for the test_custom_types contract. - */ -export declare const CONTRACT_ID = "CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE"; -/** - * The Soroban contract ID for the test_custom_types contract, in hex. - * If {@link CONTRACT_ID} is a new-style `C…` string, you will need this hex - * version when making calls to RPC for now. - */ -export declare const CONTRACT_ID_HEX: string; -/** - * The Soroban network passphrase used to initialize this library. - */ -export declare const NETWORK_PASSPHRASE = "Test SDF Future Network ; October 2022"; -/** - * The Soroban RPC endpoint used to initialize this library. - */ -export declare const RPC_URL = "https://rpc-futurenet.stellar.org/soroban/rpc"; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/method-options.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/method-options.d.ts index a9d93421df..f861ff1f28 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/method-options.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/method-options.d.ts @@ -20,11 +20,15 @@ export type ClassOptions = { /** * A Wallet interface, such as Freighter, that has the methods `isConnected`, `isAllowed`, `getUserInfo`, and `signTransaction`. If not provided, will attempt to import and use Freighter. Example: * + * @example * ```ts * import freighter from "@stellar/freighter-api"; - * - * // later, when calling this function: + * import { Contract } from "test_custom_types"; + * const contract = new Contract({ + * …, * wallet: freighter, + * }) + * ``` */ wallet?: Wallet; }; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/server.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/server.d.ts deleted file mode 100644 index 9d2038fc5f..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/server.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export {}; -/** - * SorobanClient.Server instance, initialized using {@link RPC_URL} used to - * initialize this library. - */ 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 ee6f020e9c..f5f63980c0 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 @@ -39,11 +39,13 @@ }, "node_modules/asynckit": { "version": "0.4.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { "version": "1.4.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -60,6 +62,8 @@ }, "node_modules/base64-js": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -73,8 +77,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/bignumber.js": { "version": "9.1.1", @@ -155,6 +158,8 @@ }, "node_modules/buffer": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -169,7 +174,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -191,7 +195,8 @@ }, "node_modules/combined-stream": { "version": "1.0.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -277,7 +282,8 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "engines": { "node": ">=0.4.0" } @@ -293,7 +299,8 @@ }, "node_modules/detect-node": { "version": "2.1.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" }, "node_modules/diffie-hellman": { "version": "5.0.3", @@ -331,11 +338,13 @@ }, "node_modules/es6-promise": { "version": "4.2.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "node_modules/eventsource": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-2.0.2.tgz", + "integrity": "sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==", "engines": { "node": ">=12.0.0" } @@ -351,13 +360,14 @@ }, "node_modules/follow-redirects": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], - "license": "MIT", "engines": { "node": ">=4.0" }, @@ -369,7 +379,8 @@ }, "node_modules/form-data": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -413,6 +424,8 @@ }, "node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "funding": [ { "type": "github", @@ -426,8 +439,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "BSD-3-Clause" + ] }, "node_modules/inherits": { "version": "2.0.4", @@ -473,14 +485,16 @@ }, "node_modules/mime-db": { "version": "1.52.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dependencies": { "mime-db": "1.52.0" }, @@ -538,7 +552,8 @@ }, "node_modules/proxy-from-env": { "version": "1.1.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/public-encrypt": { "version": "4.0.3", @@ -689,7 +704,8 @@ }, "node_modules/toml": { "version": "3.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" }, "node_modules/tweetnacl": { "version": "1.0.3", @@ -698,8 +714,9 @@ }, "node_modules/typescript": { "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -710,7 +727,8 @@ }, "node_modules/urijs": { "version": "1.19.11", - "license": "MIT" + "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.11.tgz", + "integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==" }, "node_modules/util-deprecate": { "version": "1.0.2", diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/method-options.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/method-options.ts index 79f5b1e314..05c4c46ca4 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/method-options.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/method-options.ts @@ -22,11 +22,15 @@ export type ClassOptions = { /** * A Wallet interface, such as Freighter, that has the methods `isConnected`, `isAllowed`, `getUserInfo`, and `signTransaction`. If not provided, will attempt to import and use Freighter. Example: * + * @example * ```ts * import freighter from "@stellar/freighter-api"; - * - * // later, when calling this function: + * import { Contract } from "test_custom_types"; + * const contract = new Contract({ + * …, * wallet: freighter, + * }) + * ``` */ wallet?: Wallet } diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/server.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/server.ts deleted file mode 100644 index 46760cf885..0000000000 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/server.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as SorobanClient from 'soroban-client' - -/** - * SorobanClient.Server instance, initialized using {@link RPC_URL} used to - * initialize this library. - */ diff --git a/cmd/crates/soroban-spec-typescript/src/boilerplate.rs b/cmd/crates/soroban-spec-typescript/src/boilerplate.rs index 40a54c6b91..fee02b05a4 100644 --- a/cmd/crates/soroban-spec-typescript/src/boilerplate.rs +++ b/cmd/crates/soroban-spec-typescript/src/boilerplate.rs @@ -77,16 +77,22 @@ impl Project { ("INSERT_RPC_URL_HERE", rpc_url), ]; let root: &Path = self.as_ref(); - ["package.json", "README.md", "src/index.ts", "src/invoke.ts"] - .into_iter() - .try_for_each(|file_name| { - let file = &root.join(file_name); - let mut contents = fs::read_to_string(file).unwrap(); - for (pattern, replacement) in replacement_strings { - contents = contents.replace(pattern, replacement); - } - fs::write(file, contents) - }) + [ + "package.json", + "README.md", + "src/index.ts", + "src/invoke.ts", + "src/method-options.ts", + ] + .into_iter() + .try_for_each(|file_name| { + let file = &root.join(file_name); + let mut contents = fs::read_to_string(file).unwrap(); + for (pattern, replacement) in replacement_strings { + contents = contents.replace(pattern, replacement); + } + fs::write(file, contents) + }) } fn append_index_ts( diff --git a/cmd/crates/soroban-spec-typescript/src/project_template/src/method-options.ts b/cmd/crates/soroban-spec-typescript/src/project_template/src/method-options.ts index ee547200a1..d55991bf8f 100644 --- a/cmd/crates/soroban-spec-typescript/src/project_template/src/method-options.ts +++ b/cmd/crates/soroban-spec-typescript/src/project_template/src/method-options.ts @@ -25,9 +25,11 @@ export type ClassOptions = { * @example * ```ts * import freighter from "@stellar/freighter-api"; - * - * // later, when calling this function: + * import { Contract } from "INSERT_CONTRACT_NAME_HERE"; + * const contract = new Contract({ + * …, * wallet: freighter, + * }) * ``` */ wallet?: Wallet