-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge remote-tracking branch 'origin/feat/multi-chain' into fe…
…at/1cy
- Loading branch information
Showing
93 changed files
with
2,645 additions
and
916 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Handler, HandlerEvent } from '@netlify/functions'; | ||
import { getAttestorExtendedGroupPublicKey } from 'dlc-btc-lib/attestor-request-functions'; | ||
|
||
const handler: Handler = async (event: HandlerEvent) => { | ||
try { | ||
if (!event.queryStringParameters) { | ||
return { | ||
statusCode: 400, | ||
body: JSON.stringify({ | ||
message: 'No Parameters were provided', | ||
}), | ||
}; | ||
} | ||
|
||
if (!event.queryStringParameters.coordinatorURL) { | ||
return { | ||
statusCode: 400, | ||
body: JSON.stringify({ | ||
message: 'No Coordinator URL was provided', | ||
}), | ||
}; | ||
} | ||
|
||
const coordinatorURL = event.queryStringParameters.coordinatorURL; | ||
|
||
const attestorGroupPublicKey = await getAttestorExtendedGroupPublicKey(coordinatorURL); | ||
|
||
return { | ||
statusCode: 200, | ||
body: attestorGroupPublicKey, | ||
}; | ||
} catch (error: any) { | ||
return { | ||
statusCode: 500, | ||
body: JSON.stringify({ | ||
message: `Failed to get Attestor Group Public Key: ${error.message}`, | ||
}), | ||
}; | ||
} | ||
}; | ||
|
||
export { handler }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { Handler, HandlerEvent } from '@netlify/functions'; | ||
import { submitSetupXRPLVaultRequest } from 'dlc-btc-lib/attestor-request-functions'; | ||
import { AttestorChainID } from 'dlc-btc-lib/models'; | ||
|
||
const handler: Handler = async (event: HandlerEvent) => { | ||
try { | ||
if (!event.queryStringParameters) { | ||
return { | ||
statusCode: 400, | ||
body: JSON.stringify({ | ||
message: 'No Parameters were provided', | ||
}), | ||
}; | ||
} | ||
|
||
if (!event.queryStringParameters.coordinatorURL) { | ||
return { | ||
statusCode: 400, | ||
body: JSON.stringify({ | ||
message: 'No Coordinator URL was provided', | ||
}), | ||
}; | ||
} | ||
|
||
if (!event.queryStringParameters.userXRPLAddress) { | ||
return { | ||
statusCode: 400, | ||
body: JSON.stringify({ | ||
message: 'No XRPL User Address was provided', | ||
}), | ||
}; | ||
} | ||
|
||
if (!event.queryStringParameters.attestorChainID) { | ||
return { | ||
statusCode: 400, | ||
body: JSON.stringify({ | ||
message: 'No Attestor Chain ID was provided', | ||
}), | ||
}; | ||
} | ||
|
||
const coordinatorURL = event.queryStringParameters.coordinatorURL; | ||
const userXRPLAddress = event.queryStringParameters.userXRPLAddress; | ||
const attestorChainID = event.queryStringParameters.attestorChainID as AttestorChainID; | ||
|
||
await submitSetupXRPLVaultRequest(coordinatorURL, userXRPLAddress, attestorChainID); | ||
|
||
return { | ||
statusCode: 200, | ||
}; | ||
} catch (error: any) { | ||
return { | ||
statusCode: 500, | ||
body: JSON.stringify({ | ||
message: `Failed to submit Setup XRPL Vault Request: ${error.message}`, | ||
}), | ||
}; | ||
} | ||
}; | ||
|
||
export { handler }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.