Skip to content

Commit

Permalink
fix: Add address in txns (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Feb 3, 2023
1 parent 75427b8 commit 1e5c682
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/did-manager/cheqd-did-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class CheqdDIDProvider extends AbstractIdentifierProvider {
private readonly cosmosPayerWallet: Promise<DirectSecp256k1HdWallet | DirectSecp256k1Wallet>
private sdk?: CheqdSDK
private fee?: DidStdFee
private address?: string

constructor(options: { defaultKms: string, cosmosPayerSeed: string, networkType?: NetworkType, rpcUrl?: string }) {
super()
Expand Down Expand Up @@ -96,7 +97,7 @@ export class CheqdDIDProvider extends AbstractIdentifierProvider {

this.sdk = await createCheqdSDK(sdkOptions)
this.fee = fee

this.address = (await wallet.getAccounts())[0].address
if (this?.fee && !this?.fee?.payer) {
const feePayer = (await (await this.cosmosPayerWallet).getAccounts())[0].address
this.fee.payer = feePayer
Expand All @@ -116,7 +117,7 @@ export class CheqdDIDProvider extends AbstractIdentifierProvider {
const tx = await sdk.createDidTx(
signInputs,
options.document,
'',
this.address!,
this?.fee,
undefined,
options?.versionId,
Expand Down Expand Up @@ -171,7 +172,7 @@ export class CheqdDIDProvider extends AbstractIdentifierProvider {
const tx = await sdk.updateDidTx(
signInputs,
document as DIDDocument,
'',
this.address!,
this?.fee,
undefined,
options?.versionId,
Expand Down Expand Up @@ -226,7 +227,7 @@ export class CheqdDIDProvider extends AbstractIdentifierProvider {
const tx = await sdk.deactivateDidTx(
signInputs,
document as DIDDocument,
'',
this.address!,
this?.fee,
undefined,
undefined,
Expand All @@ -249,7 +250,7 @@ export class CheqdDIDProvider extends AbstractIdentifierProvider {
const tx = await sdk.createResourceTx(
options.signInputs,
options.payload,
'',
this.address!,
this?.fee,
undefined,
{ sdk: sdk }
Expand Down

0 comments on commit 1e5c682

Please sign in to comment.