Skip to content
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
13 changes: 12 additions & 1 deletion src/transactions/amm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,24 @@ export async function authorizeDerivedKeyAMM(
SellingDAOCoinCreatorPublicKey: string;
QuoteCurrencyPublicKey: string;
numSubOrders: number;
/**
* When buying or selling raw DESO (i.e. QuoteCurrencyPublicKey === 'DESO'),
* set this to the total DESO amount (in nanos) that will be spent/received
* across all sub-orders so the derived key limit covers the full trade.
* Falls back to a hardcoded default when not provided.
*/
GlobalDESOLimitNanos?: number;
}
) {
const jwt = await identity.jwt();
const deriveResponse = await identity.derive(
{
GlobalDESOLimit:
payload.QuoteCurrencyPublicKey === 'DESO' ? 100000 * 1e9 : 1e9,
payload.GlobalDESOLimitNanos !== undefined
? payload.GlobalDESOLimitNanos
: payload.QuoteCurrencyPublicKey === 'DESO'
? 100000 * 1e9
: 1e9,
TransactionCountLimitMap: {
AUTHORIZE_DERIVED_KEY: 1,
// CREATE_USER_ASSOCIATION: payload.numSubOrders,
Expand Down
Loading