typescript contract binding code-gen type definitions are duplicated/missing
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust, typescript
Research direction
Start by running the three stellar contract bindings typescript commands and inspecting the generated src/index.ts files. Trace the contract binding TypeScript code-generation entry point to determine why shared types are duplicated or omitted, then verify that each generated output builds without duplicate definitions or unresolved types.
Written by the indexing model from the issue text.
Description
The exact issues here are distinct but possibly related to https://github.com/stellar/stellar-cli/issues/732.
What version are you using?
stellar version
stellar 23.1.4 ()
stellar-xdr 23.0.0 (e83a6337204ecfdb0ac0d44ffb857130c1249b1b)
xdr curr (4b7a2ef7931ab2ca2499be68d849f38190b443ca)
What did you do?
Example 1:
stellar contract bindings typescript \
--rpc-url https://soroban-testnet.stellar.org/ \
--network-passphrase "Test SDF Network ; September 2015" \
--contract-id CBZHXZBNABBQRFBNQXYXMJ3NKETUKDIBSILNQUWHVV3RXMRP3AZYLK66 \
--output-dir ./factory \
--overwrite
Example 2:
stellar contract bindings typescript \
--rpc-url https://soroban-testnet.stellar.org/ \
--network-passphrase "Test SDF Network ; September 2015" \
--contract-id CCYJJ2A2BAQHKKSNJ3NHRV66GA6XCHHBLROFBBR7J33YIYMWDL57XOUL \
--output-dir ./pool \
--overwrite
Example 3:
stellar contract bindings typescript \
--rpc-url https://soroban-testnet.stellar.org/ \
--network-passphrase "Test SDF Network ; September 2015" \
--contract-id CAVSGXMRXOCASPTKMLCFCPEKOLNMSQRFTLTLHYIBXBP22K2GUEIN5IN7 \
--output-dir ./router \
--overwrite
What did you expect to see?
Generated buildable src/index.ts.
What did you see instead?
Build errors as follows.
Example 1:
Duplicate definition of the StorageKey type
export type StorageKey = {tag: "Owner", values: void} | {tag: "FeeAmtTickSpacing", values: readonly [u32]} | {tag: "GetPool", values: readonly [string, string, u32]} | {tag: "WasmHash", values: void};
export type StorageKey = {tag: "Owner", values: void} | {tag: "FeeAmtTickSpacing", values: readonly [u32]} | {tag: "GetPool", values: readonly [string, string, u32]} | {tag: "WasmHash", values: void} | {tag: "DefaultRouter", values: void};
Example 2:
The SqrtPriceX96 type is not defined (this is defined as u256 in the contract source code)
export interface SwapStepResult {
amount_in: u256;
amount_out: u256;
fee_amount: u256;
sqrt_ratio_next: SqrtPriceX96;
}
Example 3:
The SqrtPriceX96 type is not defined (this is defined as u256 in the contract source code)
export interface SwapStepResult {
amount_in: u256;
amount_out: u256;
fee_amount: u256;
sqrt_ratio_next: SqrtPriceX96;
}
The CountryCode type is not defined
/**
* Represents different types of country relationships for individuals
*/
export type IndividualCountryRelation = {tag: "Residence", values: readonly [CountryCode]} | {tag: "Citizenship", values: readonly [CountryCode]} | {tag: "SourceOfFunds", values: readonly [CountryCode]} | {tag: "TaxResidency", values: readonly [CountryCode]} | {tag: "Custom", values: readonly [string, CountryCode]};
/**
* Represents different types of country relationships for organizations
*/
export type OrganizationCountryRelation = {tag: "Incorporation", values: readonly [CountryCode]} | {tag: "OperatingJurisdiction", values: readonly [CountryCode]} | {tag: "TaxJurisdiction", values: readonly [CountryCode]} | {tag: "SourceOfFunds", values: readonly [CountryCode]} | {tag: "Custom", values: readonly [string, CountryCode]};
Duplicate definition of the DataKey type
/**
* Keys under which we'll store the immutable fields
*/
export type DataKey = {tag: "Factory", values: void} | {tag: "XlmAddress", values: void};
// ...
/**
* Storage keys for the modular compliance contract.
*/
export type DataKey = {tag: "HookModules", values: readonly [ComplianceHook]} | {tag: "ModuleRegistered", values: readonly [ComplianceHook, string]};
- Dominant language
- Rust
- Stars
- 123
- Forks
- 141
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stellar/stellar-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stellar/stellar-cli#2384 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
stellar/stellar-cli#2347 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
stellar/stellar-cli#2723 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
stellar/stellar-cli#2722 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
stellar/stellar-cli#2703 ·
All issues in stellar/stellar-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100