-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support any-chain request links #1268
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
recipient={recipient} | ||
onCancel={goBack} | ||
daimoChain={daimoChain} | ||
defaultHomeCoin={(link as DaimoLinkRequest).toCoin ?? toCoin} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DaimoLinkRequest.toCoin
isn't nullable, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
tests for the the request deeplink web pages:
http://localhost:3000/l/request/hola/1.23/1234
^ should show an unfilled request
http://localhost:3000/l/request?to=hola&n=1.23
^ same
http://localhost:3000/l/request?to=hola&n=1.23&t=usdc&c=11155111
^ ideally show an error since sepolia is not hola's home chain
http://localhost:3000/l/request?to=vitalik.eth&n=1.23&t=usdc&c=11155111
^ show unfilled request, open in app > prefills Sepolia USD
dollars: DollarStr; | ||
dollars?: DollarStr; | ||
toCoin: ForeignToken; | ||
toChain: DAv2Chain; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
return null; | ||
} | ||
|
||
let toCoin: ForeignToken | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just : ForeignToken
?
@@ -56,6 +58,8 @@ export const ethereumUSDC: ForeignToken = { | |||
logoURI: TokenLogo.USDC, | |||
}; | |||
|
|||
export const ethereumTokens = [ethereumUSDC]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
[80002, polygonAmoyTokens], | ||
[43114, avalancheTokens], | ||
[43113, avalancheFujiTokens], | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surprised we didn't need this before this PR ^ looks good
for request links using the new query param format, i've made setting the chain and coin mandatory, so this link wouldn't work. maybe we could default to the user's home coin and home chain after DAv2 ships |
const c = url.searchParams.get("c"); | ||
const t = url.searchParams.get("t"); | ||
|
||
if (!to || !c || !t) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid cross-chain request links to Daimo accounts, we could check here that to
is not an account name. eg
// Cross-chain request link destination != Daimo account
if (isValidName(to)) return null;
#1263
TODO
DaimoRequestLink
is usedtoChain
is not base or thetoCoin
is not USDC