Summary
The get-starknet README currently documents a GetStarknetResult interface that no longer matches the implementation exported by the core package.
In particular, the README documents:
getPreAuthorizedWallets(...)
and:
enable(
wallet,
options?: {
starknetVersion?: "v4" | "v5"
}
)
However, the current implementation exposes:
getAuthorizedWallets(...)
and enable() accepts RequestAccountsParameters.
The implementation also exposes discoverVirtualWallets(), which is missing from the README interface.
This can cause TypeScript users to implement against methods and options that do not exist in the current package.
Affected Files
Repository:
starknet-io/get-starknet
Documentation:
README.md
Implementation:
packages/core/src/main.ts
packages/core/src/types.ts
Current Documentation
The README currently shows:
interface GetStarknetResult {
getAvailableWallets: (
options?: GetWalletOptions,
) => Promise<StarknetWindowObject[]>
getPreAuthorizedWallets: (
options?: GetWalletOptions,
) => Promise<StarknetWindowObject[]>
getDiscoveryWallets: (
options?: GetWalletOptions
) => Promise<WalletProvider[]>
getLastConnectedWallet:
() => Promise<StarknetWindowObject | null>
enable: (
wallet: StarknetWindowObject,
options?: {
starknetVersion?: "v4" | "v5"
},
) => Promise<ConnectedStarknetWindowObject>
disconnect:
(options?: { clearLastWallet?: boolean }) => Promise<void>
}
Actual API
The current GetStarknetResult interface contains:
export interface GetStarknetResult {
getAvailableWallets: (
options?: GetWalletOptions,
) => Promise<StarknetWindowObject[]>
getAuthorizedWallets: (
options?: GetWalletOptions,
) => Promise<StarknetWindowObject[]>
getDiscoveryWallets: (
options?: GetWalletOptions,
) => Promise<WalletProvider[]>
getLastConnectedWallet:
() => Promise<StarknetWindowObject | null | undefined>
discoverVirtualWallets:
() => Promise<void>
enable: (
wallet: StarknetWindowObject | VirtualWallet,
options?: RequestAccountsParameters,
) => Promise<StarknetWindowObject>
disconnect:
(options?: DisconnectOptions) => Promise<void>
}
API Differences
1. Renamed method
Documented:
getPreAuthorizedWallets()
Actual:
A developer copying the README example will receive an error such as:
Property 'getPreAuthorizedWallets' does not exist on type 'GetStarknetResult'
2. enable() options are outdated
Documented:
{
starknetVersion?: "v4" | "v5"
}
Actual:
RequestAccountsParameters
The implementation currently forwards:
into:
rather than reading starknetVersion.
3. Virtual wallets are missing from the documentation
The actual API accepts:
StarknetWindowObject | VirtualWallet
for enable().
The README only documents:
4. discoverVirtualWallets() is undocumented
The implementation exposes:
but this method is absent from the README's interface.
5. Return type differs
README:
Promise<ConnectedStarknetWindowObject>
Actual:
Promise<StarknetWindowObject>
Steps to Reproduce
- Install the current package.
pnpm add @starknet-io/get-starknet-core
-
Copy the API from the README.
-
Try:
const result = getStarknet()
await result.getPreAuthorizedWallets()
- TypeScript reports that the method does not exist.
The actual method is:
await result.getAuthorizedWallets()
Likewise:
await result.enable(wallet, {
starknetVersion: "v5",
})
does not match the current enable() options type.
Expected Behavior
The README should match the public TypeScript interface exported by the package.
Suggested Fix
Replace the hand-maintained interface in the README with the current interface.
For example:
interface GetStarknetResult {
getAvailableWallets(
options?: GetWalletOptions
): Promise<StarknetWindowObject[]>
getAuthorizedWallets(
options?: GetWalletOptions
): Promise<StarknetWindowObject[]>
getDiscoveryWallets(
options?: GetWalletOptions
): Promise<WalletProvider[]>
getLastConnectedWallet():
Promise<StarknetWindowObject | null | undefined>
discoverVirtualWallets():
Promise<void>
enable(
wallet: StarknetWindowObject | VirtualWallet,
options?: RequestAccountsParameters
): Promise<StarknetWindowObject>
disconnect(
options?: DisconnectOptions
): Promise<void>
}
Better Long-Term Fix
Avoid manually duplicating TypeScript interfaces in the README.
Instead, either:
- link directly to
GetStarknetResult;
- generate API documentation from TypeScript declarations;
- include a CI check ensuring README snippets compile.
A compile-tested documentation example would have caught this drift automatically.
Impact
Severity: Low / Medium
Category:
- developer experience
- API documentation
- TypeScript integration
Potential consequences:
- broken copied examples;
- failed TypeScript builds;
- developers using removed API names;
- incorrect wallet connection parameters;
- virtual-wallet functionality being undiscoverable;
- unnecessary debugging of library behavior.
Environment
Repository:
starknet-io/get-starknet
Branch:
master
Affected documentation:
README.md
Affected implementation:
packages/core/src/main.ts
packages/core/src/types.ts
Summary
The
get-starknetREADME currently documents aGetStarknetResultinterface that no longer matches the implementation exported by thecorepackage.In particular, the README documents:
and:
However, the current implementation exposes:
and
enable()acceptsRequestAccountsParameters.The implementation also exposes
discoverVirtualWallets(), which is missing from the README interface.This can cause TypeScript users to implement against methods and options that do not exist in the current package.
Affected Files
Repository:
starknet-io/get-starknetDocumentation:
README.mdImplementation:
Current Documentation
The README currently shows:
Actual API
The current
GetStarknetResultinterface contains:API Differences
1. Renamed method
Documented:
Actual:
A developer copying the README example will receive an error such as:
2.
enable()options are outdatedDocumented:
Actual:
RequestAccountsParametersThe implementation currently forwards:
into:
wallet_requestAccountsrather than reading
starknetVersion.3. Virtual wallets are missing from the documentation
The actual API accepts:
for
enable().The README only documents:
StarknetWindowObject4.
discoverVirtualWallets()is undocumentedThe implementation exposes:
but this method is absent from the README's interface.
5. Return type differs
README:
Actual:
Steps to Reproduce
Copy the API from the README.
Try:
The actual method is:
Likewise:
does not match the current
enable()options type.Expected Behavior
The README should match the public TypeScript interface exported by the package.
Suggested Fix
Replace the hand-maintained interface in the README with the current interface.
For example:
Better Long-Term Fix
Avoid manually duplicating TypeScript interfaces in the README.
Instead, either:
GetStarknetResult;A compile-tested documentation example would have caught this drift automatically.
Impact
Severity: Low / Medium
Category:
Potential consequences:
Environment
Repository:
starknet-io/get-starknetBranch:
masterAffected documentation:
README.mdAffected implementation: