You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDK clients expose no initialize() bindings and PriceOracleClient/RiskRegistryClient.addVerifier are stale relative to the deployed contracts' real interfaces #517
None of the 7 classes in sdk/src/clients.ts (InvoiceNftClient, MarketplaceClient, FinancingPoolClient, TreasuryClient, RiskRegistryClient, AccessControlClient, PriceOracleClient) exposes an initialize() method, even though KoraClient's own doc
comment (sdk/src/KoraClient.ts:22-33) presents itself as a general-purpose facade "over all 7
Kora Protocol contracts" — meaning the SDK cannot be used to stand up a protocol instance at
all, only to interact with an already-deployed one wired up by hand via scripts/deploy.sh.
Two existing bindings are additionally stale relative to the real contracts:
PriceOracleClient.getPrice(asset: string) / setPrice(admin, asset, price)
(sdk/src/clients.ts:266-277) call get_price/set_price with a single symbol argument.
The actual contract (contracts/price_oracle/src/lib.rs) requires a (base: Symbol, quote: Symbol)pair for both get_price and set_price — the SDK's single-asset signature
cannot express a currency pair at all and would fail against the real contract's XDR interface.
Fixing this closes the loop between the contract-side signature fixes (issues #2, #7, #9) and
the SDK: without it, every downstream fix to the Rust side still leaves the TypeScript client
silently broken for anyone building a dApp or ops tool on top of it.
Add an initialize(...) method to each of the 7 client classes, matching each contract's
current parameter list exactly (cross-reference each contract's pub fn initialize).
Fix PriceOracleClient.getPrice/setPrice to take (base: string, quote: string, ...)
instead of a single asset, and update sdk/src/types.ts if any oracle-related type needs
a base/quote pair shape.
Fix RiskRegistryClient.addVerifier to accept and forward a stakeAmount: bigint.
Description
None of the 7 classes in
sdk/src/clients.ts(InvoiceNftClient,MarketplaceClient,FinancingPoolClient,TreasuryClient,RiskRegistryClient,AccessControlClient,PriceOracleClient) exposes aninitialize()method, even thoughKoraClient's own doccomment (
sdk/src/KoraClient.ts:22-33) presents itself as a general-purpose facade "over all 7Kora Protocol contracts" — meaning the SDK cannot be used to stand up a protocol instance at
all, only to interact with an already-deployed one wired up by hand via
scripts/deploy.sh.Two existing bindings are additionally stale relative to the real contracts:
PriceOracleClient.getPrice(asset: string)/setPrice(admin, asset, price)(
sdk/src/clients.ts:266-277) callget_price/set_pricewith a single symbol argument.The actual contract (
contracts/price_oracle/src/lib.rs) requires a(base: Symbol, quote: Symbol)pair for bothget_priceandset_price— the SDK's single-assetsignaturecannot express a currency pair at all and would fail against the real contract's XDR interface.
RiskRegistryClient.addVerifier(admin, verifier)(sdk/src/clients.ts:224-230) omits thestake_amountparameter thatrisk_registry::add_verifiernow requires(
contracts/risk_registry/src/lib.rs:142) — the same staking-model gap as issues Fix Reentrancy Guard in Financing Pool Contracts #2, Refactor Treasury Contracts #7, Optimize Financing Pool Contracts #9.Requirements and Context
Fixing this closes the loop between the contract-side signature fixes (issues #2, #7, #9) and
the SDK: without it, every downstream fix to the Rust side still leaves the TypeScript client
silently broken for anyone building a dApp or ops tool on top of it.
Suggested Execution
git checkout -b feature/sdk-client-interface-parityinitialize(...)method to each of the 7 client classes, matching each contract'scurrent parameter list exactly (cross-reference each contract's
pub fn initialize).PriceOracleClient.getPrice/setPriceto take(base: string, quote: string, ...)instead of a single
asset, and updatesdk/src/types.tsif any oracle-related type needsa
base/quotepair shape.RiskRegistryClient.addVerifierto accept and forward astakeAmount: bigint.sdk/README.md's usage examples to reflect the corrected signatures.Acceptance Criteria
initialize()method matching its contract's current signaturePriceOracleClient.getPrice/setPricetake a(base, quote)pair, not a singleassetRiskRegistryClient.addVerifieraccepts and forwardsstakeAmountGuidelines: PR description must include
Closes #<issue-number>.Complexity: High (200 points)