-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Description
The Zora SDK documentation mentions that developers can provide their referral address.
The createCoin function has a platformReferrer parameter, but the tradeCoin function doesn’t expose any referrer field.
By looking into the Zora SDK code, it seems that the referrer parameter can be provided to the postQuote call in the type PostQuoteData , but there is currently no way to pass it in via tradeParameters.
I've tried to modify the SDK locally, but the Zora API doesn't seem to use the provided referrer field (the field hookData is empty in the call data returned by the API).
More details:
We can see below that the body object used for postQuote can contain a field referrer , but it’s not currently mapped from tradeParameters .
PostQuoteData type
export type PostQuoteData = {
body?: {
referrer?: string;
signatures?: Array<{
// ...
}>;
};
};PostQuote call
const quote = await postQuote({
body: {
tokenIn: tradeParameters.sell,
tokenOut: tradeParameters.buy,
amountIn: tradeParameters.amountIn.toString(),
slippage: tradeParameters.slippage,
chainId: base.id,
sender: tradeParameters.sender,
recipient: tradeParameters.recipient || tradeParameters.sender,
// referrer should be added here ( referrer: tradeParameters.referrer, )
signatures: tradeParameters.signatures,
},
});TradeParameters type
export type TradeParameters = {
sell: TradeCurrency;
buy: TradeCurrency;
amountIn: bigint;
slippage?: number;
// can be smart wallet or EOA here.
sender: Address;
// needs to be EOA, if signer is blank assumes EOA in sender.
signer?: Address;
recipient?: Address;
// referrer should be added here ( referrer?: string; )
signatures?: SignatureWithPermit<PermitStringAmounts>[];
permitActiveSeconds?: number;
};Metadata
Metadata
Assignees
Labels
No labels