Skip to content

[Wallet SDK] Create party with Pre-approval #710

@PHOL-DA

Description

@PHOL-DA

Currently the primary use-case flow for wallet integrators is that they set up the party and right after setup preapproval. We should allow to make this configurable early one so that:

const receiver = await sdk.userLedger?.signAndAllocateExternalParty(
    keyPairReceiver.privateKey,
    'bob'
)

const transferPreApprovalProposal =
    await sdk.userLedger?.createTransferPreapprovalCommand(
        validatorOperatorParty!,
        receiver?.partyId!,
        instrumentAdminPartyId
    )

await sdk.userLedger?.prepareSignExecuteAndWaitFor(
    [transferPreApprovalProposal],
    keyPairReceiver.privateKey,
    v4()
)

becomes a single command call.

const receiver = await sdk.userLedger?.signAndAllocateExternalPartyWithPreapproval(
    keyPairReceiver.privateKey,
    'bob'
)

(this can only be done for the case where privateKey is provided, so for offline signed transactions they would need to do the normal flow)

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions