Skip to content

Commit 0a3750d

Browse files
authored
Merge pull request #22 from Bhutan-NDI/ethr-integration
Update package version
2 parents 9aa6b5d + 1a8db49 commit 0a3750d

File tree

6 files changed

+25
-46
lines changed

6 files changed

+25
-46
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"dependencies": {
4040
"@ayanworks/credo-polygon-w3c-module": "1.0.0",
41-
"@ayanworks/credo-ethr-module": "0.0.1",
41+
"@bhutan-ndi/ethr-credo-module": "1.0.2",
4242
"@credo-ts/anoncreds": "0.5.3",
4343
"@credo-ts/askar": "0.5.3",
4444
"@credo-ts/core": "0.5.3",

src/cliAgent.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import type { WalletConfig } from '@credo-ts/core/build/types'
33
import type { IndyVdrPoolConfig } from '@credo-ts/indy-vdr'
44

55
// eslint-disable-next-line import/no-extraneous-dependencies
6-
import { EthereumDidRegistrar, EthereumDidResolver, EthereumModule } from '@ayanworks/credo-ethr-module'
76
import { PolygonDidRegistrar, PolygonDidResolver, PolygonModule } from '@ayanworks/credo-polygon-w3c-module'
7+
// eslint-disable-next-line import/no-extraneous-dependencies
8+
import { EthereumDidRegistrar, EthereumDidResolver, EthereumModule } from '@bhutan-ndi/ethr-credo-module'
89
import {
910
AnonCredsCredentialFormatService,
1011
AnonCredsModule,
@@ -192,8 +193,7 @@ const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]])
192193
polygon: new PolygonModule({
193194
didContractAddress: '0xcB80F37eDD2bE3570c6C9D5B0888614E04E1e49E',
194195
schemaManagerContractAddress: '0x4742d43C2dFCa5a1d4238240Afa8547Daf87Ee7a',
195-
fileServerToken:
196-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6IjliZjNiODFlLTA0ZDEtNDdmYy1iZTIwLWE2MTBiZDE5NTZlZiJ9.suWGau_pvNhGSGHRMqomqWoYhwMA7pcRt0kyHhaRZhM',
196+
fileServerToken: 'ACCESS-TOKEN',
197197
rpcUrl: 'https://rpc-amoy.polygon.technology',
198198
serverUrl: 'https://dev-schema.ngotag.com',
199199
}),
@@ -203,16 +203,15 @@ const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]])
203203
{
204204
name: 'sepolia',
205205
chainId: 11155111,
206-
rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/XUo--fMnn250sIOxldOhx1J9-rput18B',
206+
rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/API-KEY',
207207
registry: '0x485cFb9cdB84c0a5AfE69b75E2e79497Fc2256Fc',
208208
},
209209
],
210210
},
211-
schemaManagerContractAddress: '0x1930977f040844021f5C13b42AA8b296f0cb52DB',
211+
schemaManagerContractAddress: '0xa95ACF3119791F65b2192267836df9A472785c15',
212212
serverUrl: 'https://dev-schema.ngotag.com',
213-
fileServerToken:
214-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImU3NGFkMWQyLTY5NGYtNGI3Ny05Mjk2LWY5NTdhY2YxNGE4NSJ9.wNd6OUveLZlJoN5ys68lPOX8aSY1HwVJaMW4K36sY4k',
215-
rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/XUo--fMnn250sIOxldOhx1J9-rput18B',
213+
fileServerToken: 'ACCESS-TOKEN',
214+
rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/API-KEY',
216215
}),
217216
}
218217
}

src/controllers/did/DidController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { DidResolutionResultProps } from '../types'
2-
import type { EthereumDidCreateOptions } from '@ayanworks/credo-ethr-module/build/dids'
32
import type { PolygonDidCreateOptions } from '@ayanworks/credo-polygon-w3c-module/build/dids'
3+
import type { EthereumDidCreateOptions } from '@bhutan-ndi/ethr-credo-module/build/dids'
44
import type { KeyDidCreateOptions } from '@credo-ts/core'
55

66
import {

src/controllers/ethereum/EthereumController.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { RestAgentModules } from '../../cliAgent'
22
import type { SchemaMetadata } from '../types'
33

44
import { generateSecp256k1KeyPair } from '@ayanworks/credo-polygon-w3c-module'
5-
// import { DidOperation } from '@ayanworks/credo-polygon-w3c-module/build/ledger'
65
import { Agent, CredoError } from '@credo-ts/core'
76
import * as fs from 'fs'
87
import { injectable } from 'tsyringe'
@@ -69,16 +68,6 @@ export class Ethereum extends Controller {
6968
schemaName,
7069
schema,
7170
})
72-
73-
if (schemaResponse.schemaState?.state === 'failed') {
74-
const reason = schemaResponse.schemaState?.reason?.toLowerCase()
75-
if (reason && reason.includes('insufficient') && reason.includes('funds')) {
76-
throw new Error('Insufficient funds to the address, Please add funds to perform this operation')
77-
} else {
78-
throw new Error(schemaResponse.schemaState?.reason)
79-
}
80-
}
81-
8271
const schemaServerConfig = fs.readFileSync('config.json', 'utf-8')
8372
const configJson = JSON.parse(schemaServerConfig)
8473
if (!configJson.schemaFileServerURL) {

src/controllers/multi-tenancy/MultiTenancyController.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import type {
77
SchemaMetadata,
88
SignDataOptions,
99
} from '../types'
10-
import type { EthereumDidCreateOptions } from '@ayanworks/credo-ethr-module/build/dids'
1110
import type { PolygonDidCreateOptions } from '@ayanworks/credo-polygon-w3c-module/build/dids'
11+
import type { EthereumDidCreateOptions } from '@bhutan-ndi/ethr-credo-module/build/dids'
1212
import type {
1313
AcceptProofRequestOptions,
1414
ConnectionRecordProps,
@@ -592,7 +592,7 @@ export class MultiTenancyController extends Controller {
592592
if (!privatekey || typeof privatekey !== 'string' || !privatekey.trim() || privatekey.length !== 64) {
593593
throw Error('Invalid private key or not supported')
594594
}
595-
this.agent.config.logger.info("creating did-ether")
595+
this.agent.config.logger.info('creating did-ether')
596596

597597
createDidResponse = await tenantAgent.dids.create<EthereumDidCreateOptions>({
598598
method: DidMethod.Ethereum,
@@ -1115,15 +1115,6 @@ export class MultiTenancyController extends Controller {
11151115
})
11161116
})
11171117

1118-
if (schemaResponse.schemaState?.state === 'failed') {
1119-
const reason = schemaResponse.schemaState?.reason?.toLowerCase()
1120-
if (reason && reason.includes('insufficient') && reason.includes('funds')) {
1121-
throw new Error('Insufficient funds to the address, Please add funds to perform this operation')
1122-
} else {
1123-
throw new Error(schemaResponse.schemaState?.reason)
1124-
}
1125-
}
1126-
11271118
const configFileData = fs.readFileSync('config.json', 'utf-8')
11281119
const config = JSON.parse(configFileData)
11291120
if (!config.schemaFileServerURL) {

yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,6 @@
4444
dependencies:
4545
static-eval "2.0.2"
4646

47-
"@ayanworks/credo-ethr-module@0.0.1":
48-
version "0.0.1"
49-
resolved "https://registry.yarnpkg.com/@ayanworks/credo-ethr-module/-/credo-ethr-module-0.0.1.tgz#ea4f7741aae72a51dd7e2a5737e5c87b670c772d"
50-
integrity sha512-KbuSGertPYttBx1CEUFA/wjC0EolL7fTegVtsBAlCKGNynIf9XGyjIDLgtjBmlptEq2R0a2nxJ9ErScLTY4BVQ==
51-
dependencies:
52-
"@credo-ts/askar" "0.5.3"
53-
"@credo-ts/core" "0.5.3"
54-
axios "^1.6.3"
55-
did-resolver "^4.1.0"
56-
ethers "^6.9.0"
57-
ethr-did "^3.0.38"
58-
ethr-did-resolver "^11.0.4"
59-
keccak256 "^1.0.6"
60-
6147
"@ayanworks/credo-polygon-w3c-module@1.0.0":
6248
version "1.0.0"
6349
resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-1.0.0.tgz#e48dcb48f8708b2959ebe02fcf3a5e08b168d479"
@@ -434,6 +420,20 @@
434420
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
435421
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
436422

423+
"@bhutan-ndi/ethr-credo-module@1.0.2":
424+
version "1.0.2"
425+
resolved "https://registry.yarnpkg.com/@bhutan-ndi/ethr-credo-module/-/ethr-credo-module-1.0.2.tgz#b694c0bbe83867579eef92f34fd6c9e05b884683"
426+
integrity sha512-ymYyhTOGYfnmi3Ke80DD9+x1rJS1U5RsBopMXxoaQpumwC77pMx0Ocv9e/AZ5y4QVLVrJzXjBhZlZBmFAhJtUw==
427+
dependencies:
428+
"@credo-ts/askar" "0.5.3"
429+
"@credo-ts/core" "0.5.3"
430+
axios "^1.6.3"
431+
did-resolver "^4.1.0"
432+
ethers "^6.9.0"
433+
ethr-did "^3.0.38"
434+
ethr-did-resolver "^11.0.4"
435+
keccak256 "^1.0.6"
436+
437437
"@credo-ts/anoncreds@0.5.3":
438438
version "0.5.3"
439439
resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.5.3.tgz#3e6775b461fc34e377bebe2c0ca53c34ee630a26"

0 commit comments

Comments
 (0)