Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c459285
Update abi for new Ethereum Schema Smart Contract
kinxa0 Aug 11, 2025
5a6e2fe
Add schema registry client for ethereum
kinxa0 Aug 11, 2025
3833702
Add schema registry tests
kinxa0 Aug 11, 2025
2f92315
Code Refactor
kinxa0 Aug 12, 2025
3ef6c44
Update ethereu ledger service
kinxa0 Aug 12, 2025
b64e19a
Update tests
kinxa0 Aug 12, 2025
353f977
Update test
kinxa0 Aug 12, 2025
0136d78
Refactor error messages
kinxa0 Aug 13, 2025
942afc0
Add .prettierignore and update script
kinxa0 Aug 13, 2025
c4ca9ff
Update package.json
kinxa0 Aug 14, 2025
917ced9
Merge pull request #4 from Bhutan-NDI/feat/ethr-schema-client
kinxa0 Aug 14, 2025
f881f6f
update version
kinxa0 Aug 14, 2025
015dc73
Set schema module config optional
kinxa0 Aug 15, 2025
0baac4e
Update readme.md
kinxa0 Aug 15, 2025
7813b8c
Merge pull request #5 from Bhutan-NDI/fix/app-module-config
kinxa0 Aug 15, 2025
e0ea22b
Update package.json
kinxa0 Aug 15, 2025
b2d0562
refactor: publicKeyHex to publicKeyBase58
sairanjit Nov 5, 2025
3e0a96f
fix: lint issues
sairanjit Nov 5, 2025
a0d4539
chore(ci): update changeset config and release workflow
kinxa0 Dec 26, 2025
f5ce7c6
docs(changeset): Refactor publicKeyHex to publicKeyBase58
kinxa0 Dec 26, 2025
d2c671d
chore(ci): update changeset config and release workflow
kinxa0 Dec 26, 2025
4606c92
Merge branch 'main' into refactor/did-resolution
kinxa0 Dec 26, 2025
d04fef9
chore(ci): configure alpha tag for unstable release
kinxa0 Dec 26, 2025
11da38a
chore(ci): fix the config and workflow for correct version
kinxa0 Dec 26, 2025
1f44ad7
feat: create existing schema from file server
kinxa0 Feb 11, 2026
dcf0aed
test: test cases for creating existing schema
kinxa0 Feb 11, 2026
eebd8f9
fix: invalid path for schema type
kinxa0 Feb 11, 2026
7490877
fix: handle schema exist on ledger error
kinxa0 Feb 13, 2026
06e8bc9
test: add test for duplicate schema error on blockchain
kinxa0 Feb 13, 2026
6c30630
feat: update ci for dev branch
kinxa0 Feb 13, 2026
6a1c699
Merge pull request #6 from Bhutan-NDI/refactor/did-resolution
kinxa0 Feb 13, 2026
4455782
Merge pull request #8 from Bhutan-NDI/feat/create-existing-schema
kinxa0 Feb 13, 2026
e737ee3
Merge pull request #9 from Bhutan-NDI/dev
kinxa0 Mar 9, 2026
26a6373
fix (ci): fix changesets workflow to avoid duplicate unstable release…
kinxa0 Mar 10, 2026
f4e84e9
fix: the format issue for CI
kinxa0 Mar 10, 2026
e028758
Merge pull request #10 from Bhutan-NDI/fix/github-release-workflow
kinxa0 Mar 10, 2026
6948724
fix(cd): prevent prettier from hanging during changeset version step
kinxa0 Mar 10, 2026
558ad2c
Merge pull request #11 from Bhutan-NDI/fix/github-release-workflow
kinxa0 Mar 10, 2026
1ae4734
chore(release): new version
github-actions[bot] Mar 10, 2026
dfde49d
Merge pull request #12 from Bhutan-NDI/changeset-release/main
kinxa0 Mar 10, 2026
2d5af55
fix(cd): resolve npm registry authentication error 404
kinxa0 Mar 10, 2026
91a54bf
Merge pull request #13 from Bhutan-NDI/fix/github-release-workflow
kinxa0 Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"changelog": "@changesets/cli/changelog",
"commit": "./commit",
"privatePackages": false,
"fixed": [["@ayanworks/*"]],
"fixed": [["@bhutan-ndi/*"]],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
pull_request:
branches:
- main
- dev
push:
branches:
- main
- dev

concurrency:
# Cancel previous runs that are not completed yet
Expand Down
50 changes: 23 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ on:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write
contents: write
id-token: write

jobs:
release-stable:
runs-on: ubuntu-latest
name: Release Stable
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout Repo
Expand All @@ -27,38 +30,39 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache: yarn
registry-url: https://registry.npmjs.org/

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
title: 'chore(release): new version'
commit: 'chore(release): new version'
publish: yarn release
version: yarn changeset-version
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Get current package version
if: steps.changesets.outputs.published == 'true'
id: get_version
run: echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV

- name: Create Github Release
if: "startsWith(github.event.head_commit.message, 'chore(release): new version')"
if: steps.changesets.outputs.published == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.CURRENT_PACKAGE_VERSION }}

release-unstable:
name: Release Unstable (Alpha Snapshot)
runs-on: ubuntu-latest
name: Release Unstable
needs: release-stable
if: "always() && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'ayanworks/credo-ethr-module') || (github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore(release): new version'))"
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository

steps:
- name: Checkout Repo
Expand All @@ -68,40 +72,32 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache: yarn
registry-url: https://registry.npmjs.org

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Creating .npmrc
- name: Configure npm authentication
run: |
cat << EOF > ".npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create unstable release
- name: Create snapshot release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# this ensures there's always a patch release created
cat << 'EOF' > .changeset/snapshot-template-changeset.md
---
'@ayanworks/credo-ethr-module': patch
---

snapshot release
EOF

yarn changeset version --snapshot alpha
yarn prettier --write .
yarn build
yarn changeset publish --tag alpha

CURRENT_PACKAGE_VERSION=$(node -p "require('./package.json').version")
git config --global user.name "Ayanworks"
git config --global user.email "github@ayanworks.com"

git config --global user.name "Bhutan NDI"
git config --global user.email "github@bhutanndi.bt"

git tag v$CURRENT_PACKAGE_VERSION
git push origin v$CURRENT_PACKAGE_VERSION --no-verify
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Node modules & build
node_modules
dist
build

# Ignore generated ABI
src/abi/SchemaRegistry.json
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @bhutan-ndi/ethr-credo-module

## 1.0.3

### Patch Changes

- f5ce7c6: Refactor publicKeyHex to publicKeyBase58
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Usage

```ts
import { EthereumDidResolver, EthereumDidRegistrar, EthereumModule } from 'credo-ethr-module'
import { EthereumDidResolver, EthereumDidRegistrar, EthereumModule } from '@bhutan-ndi/ethr-credo-module'

const agent = new Agent({
config: {
Expand All @@ -26,5 +26,6 @@ const agent = new Agent({
schemaManagerContractAddress: 'schemaManagerContractAddress' // ethereum schema manager contract address,
serverUrl: 'serverUrl' // ethereum file server url,
}),
}
})
```
1 change: 1 addition & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const config: Config.InitialOptions = {
displayName: packageJson.name,
setupFilesAfterEnv: ['./tests/setup.ts'],
testTimeout: 120000,
forceExit: true,
}

export default config
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"name": "@ayanworks/credo-ethr-module",
"name": "@bhutan-ndi/ethr-credo-module",
"main": "build/index",
"types": "build/index",
"version": "0.0.1",
"version": "1.0.3",
"files": [
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"homepage": "https://github.com/ayanworks/credo-ethr-module",
"homepage": "https://github.com/Bhutan-NDI/ethr-credo-module",
"repository": {
"type": "git",
"url": "https://github.com/ayanworks/credo-ethr-module"
"url": "https://github.com/Bhutan-NDI/ethr-credo-module"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./build",
"compile": "tsc -p tsconfig.build.json",
"prepublishOnly": "yarn run build",
"check-types": "tsc --noEmit -p tsconfig.build.json",
"check-format": "yarn prettier --check",
"prettier": "prettier --ignore-path .gitignore '**/*.+(js|json|ts|md|yml|yaml)'",
"check-format": "prettier --check .",
"format": "prettier --write .",
"test": "jest",
"lint": "eslint --ignore-path .gitignore .",
"release": "yarn build && yarn changeset publish --no-git-tag",
"changeset-version": "yarn changeset version && yarn prettier --write"
"changeset-version": "yarn changeset version && yarn prettier --write ."
},
"dependencies": {
"@credo-ts/askar": "0.5.3",
Expand Down
49 changes: 0 additions & 49 deletions patches/@credo-ts+core+0.5.3.patch

This file was deleted.

5 changes: 5 additions & 0 deletions src/EthereumApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export class EthereumApi {
return schemaDetails
}

public async createExistingSchema({ did, schemaId }: { did: string; schemaId: string }) {
const schemaDetails = await this.ledgerService.createExistingSchema(this.agentContext, { did, schemaId })
return schemaDetails
}

public async getSchemaById(did: string, schemaId: string) {
const schemaDetails = await this.ledgerService.getSchemaByDidAndSchemaId(this.agentContext, did, schemaId)
return schemaDetails
Expand Down
16 changes: 8 additions & 8 deletions src/EthereumModuleConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import type { ConfigurationOptions } from 'ethr-did-resolver/lib/configuration'
*/
export interface EthereumModuleConfigOptions {
config: ConfigurationOptions
rpcUrl: string
fileServerToken: string
schemaManagerContractAddress: string
serverUrl: string
rpcUrl?: string
fileServerToken?: string
schemaManagerContractAddress?: string
serverUrl?: string
}

export class EthereumModuleConfig {
public rpcUrl: string
public fileServerToken: string
public schemaManagerContractAddress: string
public serverUrl: string
public rpcUrl: string | undefined
public fileServerToken: string | undefined
public schemaManagerContractAddress: string | undefined
public serverUrl: string | undefined
public readonly config: ConfigurationOptions

public constructor({
Expand Down
Loading