Skip to content

Commit

Permalink
feat: modify currency symbol for xrpl
Browse files Browse the repository at this point in the history
  • Loading branch information
Polybius93 committed Oct 17, 2024
1 parent b75773e commit a643120
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "dlc-btc-lib",
"version": "2.4.0",
"version": "2.4.1",
"description": "This library provides a comprehensive set of interfaces and functions for minting dlcBTC tokens on supported blockchains.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions src/functions/ripple/ripple.functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export async function setTrustLine(
result: { lines },
}: AccountLinesResponse = await rippleClient.request(accountNonXRPBalancesRequest);

if (lines.some(line => line.currency === 'DLC' && line.account === issuerAddress)) {
if (lines.some(line => line.currency === 'BTC' && line.account === issuerAddress)) {
console.log(`Trust Line already exists for Issuer: ${issuerAddress}`);
return;
}
Expand All @@ -174,7 +174,7 @@ export async function setTrustLine(
TransactionType: 'TrustSet',
Account: ownerAddress,
LimitAmount: {
currency: 'DLC',
currency: 'BTC',
issuer: issuerAddress,
value: '10000000000',
},
Expand Down Expand Up @@ -311,7 +311,7 @@ export async function getDLCBTCBalance(
}: AccountLinesResponse = await rippleClient.request(accountNonXRPBalancesRequest);

const dlcBTCBalance = lines.find(
line => line.currency === 'DLC' && line.account === issuerAddress
line => line.currency === 'BTC' && line.account === issuerAddress
);
if (!dlcBTCBalance) {
return 0;
Expand Down Expand Up @@ -345,7 +345,7 @@ export async function createCheck(
Destination: destinationAddress,
DestinationTag: destinationTag,
SendMax: {
currency: 'DLC',
currency: 'BTC',
value: shiftedAmountAsNumber.toString(),
issuer: destinationAddress,
},
Expand Down
8 changes: 6 additions & 2 deletions src/network-handlers/ripple-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ export class RippleHandler {
if (
[
'8FC923A16C90FB7316673D35CA228C82916B8E9F63EADC57BAA7C51C2E7716AA',
'AD2F46F345B07A070CBB0797D47D4D1A6CAA2BB541A0932014B909194665E4D5',
'DDF48640BF7DBC84FD08C1129999415CF5745095871FA6E50F1EAEB8AB032654',
'BA8B88BC1FD746F538AA6EFD1F1BFC982E3CCDD93EDDCFB4541EA608B355D778',
'48A7965799596CDA23C774778CD2D65E3E7C01648077539840A51ABD54791E32',
'93BAA031806AE4902933C1EE9B66E7EBAF0F7A182314085BEFF99DF080A1CBCB',
'F51C7E3CCFD2EC8CA9A460A34C5BC185E9466031865E76736C0A60BC3F7C7316',
].includes(checkID)
Expand All @@ -549,7 +553,7 @@ export class RippleHandler {
Account: this.issuerAddress,
CheckID: checkID,
Amount: {
currency: 'DLC',
currency: 'BTC',
value: dlcBTCAmount,
issuer: this.issuerAddress,
},
Expand Down Expand Up @@ -602,7 +606,7 @@ export class RippleHandler {
Destination: destinationAddress,
DestinationTag: 1,
Amount: {
currency: 'DLC',
currency: 'BTC',
value: dlcBTCAmount,
issuer: this.issuerAddress,
},
Expand Down

0 comments on commit a643120

Please sign in to comment.