Skip to content
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

fix: Add address in txns #180

Merged
merged 1 commit into from
Feb 3, 2023
Merged
Changes from all commits
Commits
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
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