Commit 95fe65e
Add handle param to oauth/pay (#14039)
## Summary
- Adds `handle` as an alternative to `recipient` in `/oauth/pay`,
allowing callers to specify an Audius user handle instead of a raw
Solana address
- Resolves handle → user → derives user bank address client-side (pure
PDA math, no RPC call) for instant UI rendering
- Bundles user bank creation (if needed) + transfer into a single atomic
Solana transaction at confirm time, eliminating the separate on-chain
create tx
- New `createUserBankIfNeededInstruction` method on
`ClaimableTokensClient` returns the instruction without sending a tx,
enabling callers to compose it into their own transactions
- UI shows `@handle` with the derived address below when handle mode is
used
## Test plan
- [x] `/oauth/pay?handle=raymont&mint=...&amount=...` resolves and
displays correctly
- [x] `/oauth/pay?recipient=...&mint=...&amount=...` continues to work
as before
- [x] Providing both `handle` and `recipient` shows error
- [x] Invalid handle shows appropriate error
- [x] Payment succeeds in single transaction (user bank creation +
transfer)
- [x] Verify with user who has no existing user bank for the mint
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 95e55db commit 95fe65e
5 files changed
Lines changed: 214 additions & 45 deletions
File tree
- packages
- common/src/services/audius-backend
- sdk/src/sdk/services/Solana/programs/ClaimableTokensClient
- web/src/pages/oauth-pay-page
Lines changed: 39 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
993 | | - | |
994 | | - | |
995 | 993 | | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
1002 | 1011 | | |
| 1012 | + | |
1003 | 1013 | | |
1004 | 1014 | | |
1005 | | - | |
| 1015 | + | |
1006 | 1016 | | |
1007 | 1017 | | |
1008 | 1018 | | |
1009 | 1019 | | |
1010 | | - | |
1011 | 1020 | | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1020 | 1030 | | |
1021 | 1031 | | |
1022 | 1032 | | |
1023 | 1033 | | |
1024 | 1034 | | |
1025 | 1035 | | |
1026 | 1036 | | |
1027 | | - | |
| 1037 | + | |
| 1038 | + | |
1028 | 1039 | | |
1029 | 1040 | | |
1030 | 1041 | | |
1031 | 1042 | | |
1032 | 1043 | | |
1033 | 1044 | | |
| 1045 | + | |
1034 | 1046 | | |
1035 | 1047 | | |
1036 | 1048 | | |
| |||
1041 | 1053 | | |
1042 | 1054 | | |
1043 | 1055 | | |
1044 | | - | |
| 1056 | + | |
| 1057 | + | |
1045 | 1058 | | |
1046 | 1059 | | |
1047 | 1060 | | |
| |||
1072 | 1085 | | |
1073 | 1086 | | |
1074 | 1087 | | |
1075 | | - | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1076 | 1093 | | |
1077 | 1094 | | |
1078 | 1095 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
185 | 230 | | |
186 | 231 | | |
187 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
77 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | | - | |
| 87 | + | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| |||
100 | 107 | | |
101 | 108 | | |
102 | 109 | | |
103 | | - | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| |||
143 | 150 | | |
144 | 151 | | |
145 | 152 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
154 | 177 | | |
155 | 178 | | |
156 | 179 | | |
| |||
236 | 259 | | |
237 | 260 | | |
238 | 261 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
246 | 285 | | |
247 | 286 | | |
248 | 287 | | |
| |||
0 commit comments