Skip to content

Commit

Permalink
chore: merge remote-tracking branch 'origin/feat/multi-chain' into fe…
Browse files Browse the repository at this point in the history
…at/1cy
  • Loading branch information
rozanagy committed Oct 31, 2024
2 parents 9c20a31 + 5aa1195 commit e5d690c
Show file tree
Hide file tree
Showing 93 changed files with 2,645 additions and 916 deletions.
3 changes: 3 additions & 0 deletions config.devnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"appEnvironment": "devnet",
"coordinatorURL": "https://devnet.dlc.link/attestor-1",
"enabledEthereumNetworkIDs": ["421614", "84532", "11155111"],
"enabledRippleNetworkIDs": ["1"],
"bitcoinNetwork": "regtest",
"bitcoinNetworkIndex": 1,
"bitcoinNetworkPreFix": "bcrt1",
"bitcoinBlockchainURL": "https://devnet.dlc.link/electrs",
"bitcoinBlockchainExplorerURL": "https://devnet.dlc.link/electrs",
"bitcoinBlockchainFeeEstimateURL": "https://devnet.dlc.link/electrs/fee-estimates",
"rippleIssuerAddress": "rLTBw1MEy45uE5qmkWseinbj7h4zmdQuR8",
"xrplWebsocket": "wss://s.altnet.rippletest.net:51233",
"ledgerApp": "Bitcoin Test",
"merchants": [
{
Expand Down
10 changes: 10 additions & 0 deletions config.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
"name": "Smart Bitcoin Labs",
"addresses": ["0x46166fA874AAEDEA8d98b15F9A72C84e22Abe2A1"],
"logo": "/images/logos/sbl-logotype.svg"
},
{
"name": "Waterdrip Capital",
"addresses": ["0x2816f3528AD324E6089714DA8E89455f58739e68"],
"logo": "/images/logos/waterdrip-capital-logo.svg"
},
{
"name": "Pattern Research",
"addresses": ["0x707A141c5c19c25E2e6D50b214e39A4293B63234"],
"logo": "/images/logos/pattern-research-logo.svg"
}
],
"protocols": [
Expand Down
3 changes: 3 additions & 0 deletions config.testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"appEnvironment": "testnet",
"coordinatorURL": "https://testnet.dlc.link/attestor-1",
"enabledEthereumNetworkIDs": ["421614", "84532", "11155111"],
"enabledRippleNetworkIDs": ["1"],
"bitcoinNetwork": "testnet",
"bitcoinNetworkIndex": 1,
"bitcoinNetworkPreFix": "tb1",
"bitcoinBlockchainURL": "https://testnet.dlc.link/electrs",
"bitcoinBlockchainExplorerURL": "https://mempool.space/testnet",
"bitcoinBlockchainFeeEstimateURL": "https://mempool.space/testnet/api/v1/fees/recommended",
"rippleIssuerAddress": "ra3oyRVfy4yD4NJPrVcewvDtisZ3FhkcYL",
"xrplWebsocket": "wss://testnet.xrpl-labs.com/",
"ledgerApp": "Bitcoin Test",
"merchants": [
{
Expand Down
42 changes: 42 additions & 0 deletions netlify/functions/fetch-attestor-group-public-key.ts
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 };
62 changes: 62 additions & 0 deletions netlify/functions/submit-xrpl-vault-request.ts
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 };
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"@fontsource/inter": "^5.0.18",
"@fontsource/onest": "^5.0.3",
"@fontsource/poppins": "^5.0.8",
"@gemwallet/api": "^3.8.0",
"@ledgerhq/hw-app-xrp": "^6.29.4",
"@ledgerhq/hw-transport-webusb": "^6.28.6",
"@netlify/functions": "^2.8.1",
"@reduxjs/toolkit": "^1.9.7",
Expand All @@ -44,7 +46,7 @@
"concurrently": "^8.2.2",
"d3": "^7.9.0",
"decimal.js": "^10.4.3",
"dlc-btc-lib": "2.2.7",
"dlc-btc-lib": "2.4.8",
"dotenv": "^16.3.1",
"ethers": "5.7.2",
"formik": "^2.4.5",
Expand All @@ -64,7 +66,8 @@
"redux-persist-expire": "^1.1.1",
"viem": "2.x",
"vite-plugin-toml": "^0.7.0",
"wagmi": "^2.12.2"
"wagmi": "^2.12.2",
"xrpl": "^4.0.0"
},
"devDependencies": {
"@ls-lint/ls-lint": "^2.2.2",
Expand Down
12 changes: 12 additions & 0 deletions public/images/logos/fordefi-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/logos/gem-wallet-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/logos/pattern-research-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e5d690c

Please sign in to comment.