Sometimes a merchant wants to use the same XPUB key for their payout on a platform commissions and for their merchant account. We need a table which associates XPUBs with XPUBIndex and nothing else.
We can then create a new async utils function getXPUBIndex which takes an XPUB key as a parameter and does the following:
Validates the key (validateXPUB)
Checks for the key in the new XPUBKeys table
If there is a match return the current XPUB address derivation index of the key
If it was not already in the XPUBKeys table, add it to the table, discover the XPUB index (using #116 ) and then return the discovered index
Sometimes a merchant wants to use the same XPUB key for their payout on a platform commissions and for their merchant account. We need a table which associates XPUBs with XPUBIndex and nothing else.
We can then create a new async utils function
getXPUBIndex
which takes an XPUB key as a parameter and does the following:validateXPUB
)