Release to production (add braga)#55
Merged
Merged
Conversation
* Allow external tests * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Add Braga
Change examples, docs and tests to use braga instead of kaolin
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SDK and its docs/tests to target the new Braga testnet, introduces a Braga chain definition, and tightens Entity payload conversion behavior (with accompanying tests). It also includes CI/release workflow adjustments.
Changes:
- Add
bragachain definition and wire it into chain selection + tests. - Update examples/smoke tests/README/workflows to use Braga as the default testnet.
- Change
Entity.toText()/Entity.toJson()to throw on missing/invalid payloads and add unit tests.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/src/utils.ts | Removes unused localhost RPC URL helper. |
| test/src/smoke-tests/index.ts | Switch smoke test chain from kaolin to braga (TS). |
| test/src/smoke-tests/index.mjs | Switch smoke test chain from kaolin to braga (ESM). |
| test/src/smoke-tests/index.js | Switch smoke test chain from kaolin to braga (JS). |
| test/src/smoke-tests/index.cjs | Switch smoke test chain from kaolin to braga (CJS). |
| test/src/network-health.test.ts | Adds braga to chain list and makes it the default CHAIN. |
| test/src/arkiv.test.ts | Adds external-RPC support, refactors entity creation, and makes timeouts configurable. |
| src/utils/chains.test.ts | Adds test coverage for chainFromName("braga") + casing. |
| src/types/entity.ts | Makes toText()/toJson() stricter with better errors/causes. |
| src/types/entity.test.ts | Adds unit tests for new Entity conversion semantics. |
| src/clients/decorators/arkivWallet.ts | Updates doc examples to use braga. |
| src/clients/decorators/arkivPublic.ts | Updates doc examples to use braga. |
| src/clients/createWalletClient.ts | Updates docs to reference Braga RPC. |
| src/clients/createPublicClient.ts | Updates docs to reference Braga RPC. |
| src/chains/index.ts | Exports the new braga chain. |
| src/chains/braga.ts | Defines the Braga chain (IDs, RPC URLs, explorer). |
| sample/write_example.ts | Updates sample to use braga. |
| sample/read_example.ts | Updates sample to use braga. |
| README.md | Updates README examples and faucet link to Braga. |
| package.json | Bumps version and tweaks release scripts to include commit messages. |
| docs/main/interfaces/Entity.md | Updates generated docs references for Entity methods. |
| .github/workflows/network-health.yml | Defaults network health workflow to braga. |
| .github/workflows/ci.yml | Uses a GitHub App token for checkout/push; avoids empty docs commits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+34
to
+38
| if (process.env.ARKIV_SDK_TEST_RPC_URL || process.env.ARKIV_SDK_TEST_WS_URL) { | ||
| httpUrls = [process.env.ARKIV_SDK_TEST_RPC_URL || "undefined"] | ||
| wsUrls = [process.env.ARKIV_SDK_TEST_WS_URL || "undefined"] | ||
| rpcName = "External Arkiv Node" | ||
| chainId = parseInt(process.env.ARKIV_SDK_TEST_CHAIN_ID || "1337") |
| import { execCommand, launchLocalArkivNode } from "./utils.js" | ||
|
|
||
|
|
||
| const basicCRUDTestTimeout: number = parseInt(process.env.ARKIV_SDK_TEST_CRUD_TIMEOUT || "20000") |
| * - Docs: https://docs.arkiv.network/ts-sdk/clients/public | ||
| * | ||
| * A Public Client is an interface to "public" [Ethereum JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/), [Arkiv JSON-RPC API](https://docs.arkiv.network/json-rpc/), and [Kaolin JSON-RPC API](https://kaolin.holesky.arkiv.network/rpc) methods such as retrieving block numbers, transactions, reading from smart contracts, etc through [Public Actions](/docs/actions/public/introduction). | ||
| * A Public Client is an interface to "public" [Ethereum JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/), [Arkiv JSON-RPC API](https://docs.arkiv.network/json-rpc/), and [Braga JSON-RPC API](https://braga.holesky.arkiv.network/rpc) methods such as retrieving block numbers, transactions, reading from smart contracts, etc through [Public Actions](/docs/actions/public/introduction). |
| * - Docs: https://docs.arkiv.network/ts-sdk/clients/public | ||
| * | ||
| * A Public Client is an interface to "public" [Ethereum JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/), [Arkiv JSON-RPC API](https://docs.arkiv.network/json-rpc/), and [Kaolin JSON-RPC API](https://kaolin.holesky.arkiv.network/rpc) methods such as retrieving block numbers, transactions, reading from smart contracts, etc through [Public Actions](/docs/actions/public/introduction). | ||
| * A Public Client is an interface to "public" [Ethereum JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/), [Arkiv JSON-RPC API](https://docs.arkiv.network/json-rpc/), and [Braga JSON-RPC API](https://braga.holesky.arkiv.network/rpc) methods such as retrieving block numbers, transactions, reading from smart contracts, etc through [Public Actions](/docs/actions/public/introduction). |
Comment on lines
97
to
+109
| @@ -106,7 +106,7 @@ Defined in: [src/types/entity.ts:45](https://github.com/Arkiv-Network/arkiv-sdk- | |||
|
|
|||
| > **toText**(): `string` | |||
|
|
|||
| Defined in: [src/types/entity.ts:41](https://github.com/Arkiv-Network/arkiv-sdk-js/blob/93d4c0c74e3503d5b045842ef9b11e8553a0c98b/src/types/entity.ts#L41) | |||
| Defined in: [src/types/entity.ts:50](https://github.com/Arkiv-Network/arkiv-sdk-js/blob/develop/src/types/entity.ts#L50) | |||
Comment on lines
50
to
+55
| toText(): string { | ||
| return this.payload ? bytesToString(this.payload) : "" | ||
| if (this.payload === undefined) { | ||
| throw new Error( | ||
| "Entity has no payload – it was probably queried without withPayload(true) via QueryBuilder", | ||
| ) | ||
| } |
Comment on lines
72
to
+76
| toJson(): any { | ||
| return this.payload ? JSON.parse(bytesToString(this.payload)) : {} | ||
| const text = this.toText() | ||
| if (!text) { | ||
| throw new Error("Entity has empty payload, cannot parse as JSON") | ||
| } |
krzysiekfonal
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.