Skip to content

Commit

Permalink
feat: ibtc/integrationAddress (#37)
Browse files Browse the repository at this point in the history
* feat: modify currency name

* feat: add field to raw vault interface

* fix: modify functions related to raw vault
  • Loading branch information
Polybius93 committed Nov 12, 2024
1 parent 8ed29fb commit d9b631f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 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.10",
"version": "2.4.14",
"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
2 changes: 1 addition & 1 deletion src/constants/ripple.constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { convertStringToHex } from 'xrpl';

export const TRANSACTION_SUCCESS_CODE = 'tesSUCCESS';
export const XRPL_DLCBTC_CURRENCY_HEX = convertStringToHex('dlcBTC').padEnd(40, '0');
export const XRPL_DLCBTC_CURRENCY_HEX = convertStringToHex('iBTC').padEnd(40, '0');
1 change: 1 addition & 0 deletions src/functions/ripple/ripple.functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export function decodeURI(URI: string): RawVault {
btcFeeRecipient: URI.slice(332, 398),
taprootPubKey: URI.slice(398, 462),
closingTxId: '', // Deprecated
icyIntegrationAddress: '', // not used in xrpl
};
} catch (error) {
throw new Error(`Could not decode NFT URI: ${error}`);
Expand Down
1 change: 1 addition & 0 deletions src/models/ethereum-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface RawVault {
btcMintFeeBasisPoints: BigNumber;
btcRedeemFeeBasisPoints: BigNumber;
taprootPubKey: string;
icyIntegrationAddress: string;
}

export interface SSPVaultUpdate {
Expand Down
13 changes: 7 additions & 6 deletions src/network-handlers/ripple-handler.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { Decimal } from 'decimal.js';
import { BigNumber } from 'ethers';
import {
AutoFillValues,
MultisignatureTransactionResponse,
SignResponse,
XRPLSignatures,
} from 'src/models/ripple.model.js';
import xrpl, {
AccountNFTsRequest,
AccountObject,
Expand All @@ -29,6 +23,12 @@ import {
} from '../functions/ripple/ripple.functions.js';
import { RippleError } from '../models/errors.js';
import { RawVault, SSFVaultUpdate, SSPVaultUpdate } from '../models/ethereum-models.js';
import {
AutoFillValues,
MultisignatureTransactionResponse,
SignResponse,
XRPLSignatures,
} from '../models/ripple.model.js';
import { shiftValue, unshiftValue } from '../utilities/index.js';

function buildDefaultNftVault(): RawVault {
Expand All @@ -47,6 +47,7 @@ function buildDefaultNftVault(): RawVault {
btcMintFeeBasisPoints: BigNumber.from(100),
btcRedeemFeeBasisPoints: BigNumber.from(100),
taprootPubKey: '0'.repeat(64),
icyIntegrationAddress: '',
};
}

Expand Down
3 changes: 3 additions & 0 deletions tests/mocks/ethereum-vault.test.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const TEST_VAULT_1: RawVault = {
btcMintFeeBasisPoints: BigNumber.from('0x64'),
btcRedeemFeeBasisPoints: BigNumber.from('0x64'),
taprootPubKey: '',
icyIntegrationAddress: '',
};

export const TEST_VAULT_2: RawVault = {
Expand All @@ -34,6 +35,7 @@ export const TEST_VAULT_2: RawVault = {
btcMintFeeBasisPoints: BigNumber.from('0x64'),
btcRedeemFeeBasisPoints: BigNumber.from('0x64'),
taprootPubKey: 'dc544c17af0887dfc8ca9936755c9fdef0c79bbc8866cd69bf120c71509742d2',
icyIntegrationAddress: '',
};

export const TEST_VAULT_3: RawVault = {
Expand All @@ -51,4 +53,5 @@ export const TEST_VAULT_3: RawVault = {
btcMintFeeBasisPoints: BigNumber.from('0x64'),
btcRedeemFeeBasisPoints: BigNumber.from('0x64'),
taprootPubKey: 'b362931e3e4cf3cc20f75ae11ff5a4c115ec1548cb5f2c7c48294929f1e8979c',
icyIntegrationAddress: '',
};

0 comments on commit d9b631f

Please sign in to comment.