I'm working through the beneficiary vesting example where we have two beneficiaries: beneficiary 2 (giver who can reclaim funds after deadline), and beneficiary 1 (must claim gift before deadline).
In the demo lucid claim function, i tried to parametrize the signer function like so
async function claimVestedFunds(beneficiary: string): Promise<TxHash> {...
But I set up the wallet from the point of view of beneficiary 2 (wallet address):
lucid.selectWalletFromSeed(secretSeed);
const addr: Address = await lucid.wallet.address();
const details: AddressDetails = getAddressDetails(addr);
const beneficiary2: string = details.paymentCredential.hash
Then I hard-coded beneficiary 1 PKH into the Vesting datum, but I'm not sure how to get 1 to do the signing in claimVestedFunds
const tx = await lucid
.newTx()
.collectFrom(ourUTxO, Data.void())
.addSignerKey(beneficiary)
.attachSpendingValidator(mistery1)
.validFrom(Date.now()-100000)
.complete();
I thought this would work because these two beneficiaries are actually derived from the same seed phrase (i control both accounts).
My code appears to allow beneficiary 2 to vest and reclaim, but i'm not sure how to allow beneficiary 1 to sign