<UserOperation>.addAlterSign(privateKey)

(Instance Method)

Feature

Adds an alternative signature (proof_data of authentication) to the user operation using the private key of the sender of the fact. This method modifies the user operation instance directly.

Parameters

string privateKey // privateKey of fact’s sender

Return Value

void

const userOp = mitum.aa.createUserOperation(op.fact, contract, "did:dxd:0x5279AebbF6e284594521d44612157147dF5ff248fca#auth_key");
const privateKey = "24e193a4765504f833eab39ab66c0073971a3bb344a16863268dfedbc178d7cbfpr";
userOp.addAlterSign(privateKey);

console.log(userOp.toHintedObject());

// output
{
  _hint: 'mitum-currency-transfer-operation-v0.0.1',
  fact: {
    _hint: 'mitum-currency-transfer-operation-fact-v0.0.1',
    hash: 'GyJGi4G4GqynPpyJ92pkA4tjaAF7co9nTLrN88JitZhA',
    token: 'MjAyNC0xMi0xMCAwMTo1MTo0Mi4yOTEgKzAwMDAgVVRD',
    sender: '0x0F96D08AF80b9fC86378B6478Fd77780625636Edfca',
    items: [ [Object] ]
  },
  extension: {
    authentication: {
      _hint: 'mitum-extension-base-authentication-v0.0.1',
      contract: '0xdC521b33609647F949427A2330c136EfC3171535fca',
      authentication_id: 'did:dxd:0x5279AebbF6e284594521d44612157147dF5ff248fca#auth_key',
      proof_data: '5BpRZ6B25Q6ufRrUypSfXN6gryWpNns1Sg2ANkWYdAWgmQRPr9B6495wER346ofU2F8JA2jPmp1EBYMAeEwQojKqPRsVg'
    },
    settlement: { _hint: 'mitum-extension-base-settlement-v0.0.1', op_sender: '' }
  },
  hash: '',
  signs: []
}

Last updated