-
Notifications
You must be signed in to change notification settings - Fork 25
feat(escrow): add arbiter_address support for 2-of-3 multisig escrow #256
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ const createEscrowSchema = z.object({ | |
| currency: z.enum(["usdc_pol", "usdc_sol", "pol", "sol", "btc", "eth", "usdc_eth", "usdt"]), | ||
| depositor_address: z.string().min(10, "Depositor wallet address is required"), | ||
| beneficiary_address: z.string().min(10, "Beneficiary wallet address is required"), | ||
| arbiter_address: z.string().min(10).optional(), | ||
| }); | ||
|
|
||
| // GET /api/gigs/[id]/escrow - Get escrow status for a gig | ||
|
|
@@ -70,7 +71,7 @@ export async function POST( | |
| ); | ||
| } | ||
|
|
||
| const { application_id, currency, depositor_address, beneficiary_address } = validationResult.data; | ||
| const { application_id, currency, depositor_address, beneficiary_address, arbiter_address } = validationResult.data; | ||
|
|
||
| // Get gig — must be poster | ||
| const { data: gig } = await supabase | ||
|
|
@@ -161,6 +162,7 @@ export async function POST( | |
| beneficiary_email: `${workerProfile?.username || application.applicant_id}@ugig.net`, | ||
| depositor_address, | ||
| beneficiary_address, | ||
| arbiter_address, | ||
| description: `Gig escrow: ${gig.title}`, | ||
| metadata: { | ||
| gig_id: gigId, | ||
|
|
@@ -190,6 +192,7 @@ export async function POST( | |
| currency, | ||
| platform_fee_usd: platformFee, | ||
| platform_fee_rate: platformFeeRate, | ||
| arbiter_address: arbiter_address || null, | ||
| status: "pending_payment", | ||
|
Comment on lines
192
to
196
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The A new migration — e.g. |
||
| metadata: { | ||
| payment_address: paymentAddress, | ||
|
|
||
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.
arbiter_addressmin-length validation is missing a user-facing error message, unlike the requireddepositor_addressandbeneficiary_addressfields which both have descriptive messages.