Repository navigation
feat: align Stellar SDK with mainnet readiness #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,11 @@ import type { StellarFundableClientConfig } from "@fundable/sdk/stellar"; | |
| | Property | Availability | | ||
| | --- | --- | | ||
| | `flows` | Always present; `contracts.flow` is required. | | ||
| | `lockups` | Present when `contracts.lockup` is configured. | | ||
| | `router` | Present when `contracts.router` is configured. | | ||
| | `streamNft` | Present when `contracts.streamNft` is configured. | | ||
| | `paymaster` | Present when `contracts.paymaster` is configured. | | ||
| | `sponsorship` | Present when `sponsorship.backendUrl` is configured. | | ||
| | `paymaster` | Deprecated; migration-only when `contracts.paymaster` is configured. | | ||
|
|
||
| ## Flow client | ||
|
|
||
|
|
@@ -40,6 +42,17 @@ import type { StellarFundableClientConfig } from "@fundable/sdk/stellar"; | |
| | `createLockup` | Assembled transaction returning Stream NFT token ID. | | ||
| | `withdraw` | Assembled transaction for an amount and token ID. | | ||
| | `withdrawMax` | Assembled transaction returning the withdrawn amount. | | ||
| | `ownerOf`, `statusOf`, `coreStreamId` | Canonical reads keyed by NFT token ID. | | ||
| | `getStream` | Owner, type, status, transferability, token ID, and core ID. | | ||
| | `voidFlow` | NFT-owner Flow void transaction. | | ||
|
|
||
| ## Lockup client | ||
|
|
||
| | Method | Result | | ||
| | --- | --- | | ||
| | `cancel`, `renounce` | Sender-authorized Lockup transactions using a core stream ID. | | ||
| | `statusOf`, `isCancelable` | Current Lockup lifecycle and cancellation state. | | ||
| | `withdrawableAmount`, `refundableAmount` | Current amounts as `bigint`. | | ||
|
|
||
| ## Stream NFT client | ||
|
|
||
|
|
@@ -48,8 +61,22 @@ import type { StellarFundableClientConfig } from "@fundable/sdk/stellar"; | |
| | `ownerOf` | Owner Stellar address. | | ||
| | `balanceOf` | Number of Stream NFTs owned as `bigint`. | | ||
| | `getStreamData` | `{ tokenId, streamId, streamKind }`. | | ||
| | `isTransferable` | Immutable on-chain transfer policy. | | ||
| | `transfer` | Assembled transfer transaction. | | ||
|
|
||
| ## Sponsorship client | ||
|
|
||
| | Method | Result | | ||
| | --- | --- | | ||
| | `authenticate` | Signed-wallet backend session. | | ||
| | `quote` | Fee token, estimate, maximum, and conversion rate. | | ||
| | `build` | FeeForwarder transaction, user auth entry, and expiration. | | ||
| | `submit` | Durable IDs, status, transaction hash, and confirmed NFT token ID. | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Document 🤖 Prompt for AI Agents |
||
| | `isBuildExpired` | Whether a build must be rebuilt before signing or submission. | | ||
|
|
||
| `fundable.signSponsorshipAuthorization(build)` signs the backend-issued user | ||
| authorization entry with the configured wallet callback. | ||
|
|
||
| ## Paymaster client | ||
|
|
||
| | Method | Result | | ||
|
|
@@ -89,6 +116,7 @@ try { | |
|
|
||
| The stable error codes are `INVALID_ARGUMENT`, `INVALID_CONFIGURATION`, | ||
| `UNSUPPORTED_CHAIN`, `UNSUPPORTED_CAPABILITY`, `SIMULATION_FAILED`, | ||
| `TRANSACTION_FAILED`, and `RPC_UNAVAILABLE`. The underlying failure may be | ||
| `TRANSACTION_FAILED`, `RPC_UNAVAILABLE`, `API_REQUEST_FAILED`, | ||
| `AUTHENTICATION_REQUIRED`, and `AUTHORIZATION_EXPIRED`. The underlying failure may be | ||
| available as `error.cause`; do not display raw provider responses to end users | ||
| without filtering sensitive data. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,3 +70,21 @@ bindings are compiled into the SDK behind chain-neutral high-level clients. | |
|
|
||
| `0.1.0-alpha.3` adds the high-level Lockup Router mapping without changing the | ||
| generated bindings or contract artifacts, so it retains this exact provenance. | ||
|
|
||
| ## Mainnet-readiness release provenance | ||
|
|
||
| - Contract commit: `62dfc41ac8c1fa48d66c5fe5e9c7e98f9e4f9529` | ||
| - Stellar CLI: `stellar 27.0.0` | ||
|
Comment on lines
+76
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Complete the mainnet-readiness provenance record. The section must include the contract release tag and the exact command for each binding. Add the release tag and 🤖 Prompt for AI Agents |
||
|
|
||
| Reproducible WASM SHA-256 values: | ||
|
|
||
| | Contract | SHA-256 | | ||
| | --- | --- | | ||
| | Flow | `6201c10afc509b53bf3a9bb307730ee996accdcc4f17864126bbd8aa576dbee6` | | ||
| | Lockup | `500f152a8ffb8126e36af6df149eee5712c9a575b9c1979142de2619fe8920d3` | | ||
| | Router | `c1ddde9e7679fd1068523a7994a7fbc1390a0a98526ccfba0a317886f36b6f09` | | ||
| | Stream NFT | `0e6440a0a2108b254459988c214bcb225ddd838fabdb7623450a65ccbdeddb63` | | ||
|
|
||
| The SDK `0.2.0` bindings were generated from the four reproducible release | ||
| artifacts with the corresponding `pnpm generate:* -- /absolute/path.wasm` | ||
| commands. The transitional Paymaster was intentionally not regenerated. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Sponsored transactions | ||
|
|
||
| Production sponsorship uses Fundable's authenticated backend and the native | ||
| OpenZeppelin FeeForwarder flow. The browser prepares the intended Router or | ||
| engine call; the backend chooses and validates the fee token, relayer, target, | ||
| function, arguments, fee bounds, and authorization tree. | ||
|
|
||
| ```ts | ||
| await fundable.sponsorship!.authenticate( | ||
| connectedAccount, | ||
| "TESTNET", | ||
| wallet.signMessage, | ||
| ); | ||
|
|
||
| const unsignedXdr = transaction.toXDR(); | ||
| const quote = await fundable.sponsorship!.quote(unsignedXdr, "TESTNET"); | ||
| // Display quote.feeToken, estimatedFeeUi, maximumFeeUi, and the action. | ||
|
|
||
| let build = await fundable.sponsorship!.build(unsignedXdr, "TESTNET"); | ||
| if (fundable.sponsorship!.isBuildExpired(build)) { | ||
| build = await fundable.sponsorship!.build(unsignedXdr, "TESTNET"); | ||
| } | ||
|
|
||
| const signedAuthEntry = | ||
| await fundable.signSponsorshipAuthorization(build); | ||
| const result = await fundable.sponsorship!.submit({ | ||
| build, | ||
| signedAuthEntry, | ||
| network: "TESTNET", | ||
| intent, | ||
| idempotencyKey: crypto.randomUUID(), | ||
| }); | ||
| ``` | ||
|
|
||
| Use `result.streamTokenId` as the public stream identifier only after it is | ||
| present in a confirmed backend result. `result.transactionHash` identifies the | ||
| submission and must never be substituted for a stream ID. If authorization | ||
| expires, rebuild and show the updated fee before asking the wallet to sign. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the capability availability condition.
Sponsorship does not depend on a contract ID. It becomes available when
sponsorship.backendUrlis configured.Replace “when their contract IDs are configured” with “when their corresponding contract IDs or sponsorship backend URL are configured.”
🤖 Prompt for AI Agents