signet.js 0.0.1-beta.3 → 0.0.1-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signet.js",
3
- "version": "0.0.1-beta.3",
3
+ "version": "0.0.1-beta.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -1,4 +1,4 @@
1
- import type { BTCTransaction, BTCInput, BTCOutput } from '../../index.js';
1
+ import type { BTCTransaction, BTCInput, BTCOutput } from '../../Bitcoin/types';
2
2
  export declare abstract class BTCRpcAdapter {
3
3
  abstract selectUTXOs(from: string, targets: BTCOutput[]): Promise<{
4
4
  inputs: BTCInput[];
@@ -1,4 +1,4 @@
1
- import { BTCRpcAdapter } from '../../../Bitcoin/BTCRpcAdapter';
1
+ import { BTCRpcAdapter } from '../../../Bitcoin/BTCRpcAdapter/BTCRpcAdapter';
2
2
  import type { BTCTransaction, BTCInput, BTCOutput } from '../../../Bitcoin/types';
3
3
  export declare class Mempool extends BTCRpcAdapter {
4
4
  private readonly providerUrl;
@@ -2,7 +2,7 @@
2
2
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3
3
  // @ts-expect-error
4
4
  import coinselect from 'coinselect';
5
- import { BTCRpcAdapter } from '../../../Bitcoin/BTCRpcAdapter';
5
+ import { BTCRpcAdapter } from '../../../Bitcoin/BTCRpcAdapter/BTCRpcAdapter';
6
6
  export class Mempool extends BTCRpcAdapter {
7
7
  constructor(providerUrl) {
8
8
  super();
@@ -1,6 +1,9 @@
1
1
  import * as bitcoin from 'bitcoinjs-lib';
2
- import type { MPCPayloads, RSVSignature, KeyDerivationPath, ChainSignatureContract, BTCRpcAdapter, BTCNetworkIds, BTCTransactionRequest, BTCUnsignedTransaction } from '../index.js';
3
- import { Chain } from '../index.js';
2
+ import type { MPCPayloads, RSVSignature, KeyDerivationPath } from '../types';
3
+ import type { ChainSignatureContract } from '../ChainSignatureContract';
4
+ import type { BTCNetworkIds, BTCTransactionRequest, BTCUnsignedTransaction } from '../Bitcoin/types';
5
+ import { BTCRpcAdapter } from '../Bitcoin/BTCRpcAdapter';
6
+ import { Chain } from '../Chain';
4
7
  /**
5
8
  * Implementation of the Chain interface for Bitcoin network.
6
9
  * Handles interactions with both Bitcoin mainnet and testnet, supporting P2WPKH transactions.
@@ -1,5 +1,6 @@
1
1
  import * as bitcoin from 'bitcoinjs-lib';
2
- import { Chain, utils } from '../index.js';
2
+ import { Chain } from '../Chain';
3
+ import { utils } from '../index.js';
3
4
  import { parseBTCNetwork } from '../Bitcoin/utils';
4
5
  /**
5
6
  * Implementation of the Chain interface for Bitcoin network.
@@ -1,4 +1,4 @@
1
- import type { KeyDerivationPath, MPCPayloads, RSVSignature } from './index.js';
1
+ import type { KeyDerivationPath, MPCPayloads, RSVSignature } from './types';
2
2
  /**
3
3
  * Core interface for blockchain implementations.
4
4
  * Provides a standardized way to interact with different blockchain networks through a common set of methods.
@@ -1,5 +1,5 @@
1
1
  import type BN from 'bn.js';
2
- import type { RSVSignature, UncompressedPubKeySEC1 } from './index.js';
2
+ import type { RSVSignature, UncompressedPubKeySEC1 } from './types';
3
3
  /**
4
4
  * Arguments for the sign method
5
5
  */
@@ -1,5 +1,7 @@
1
- import type { MPCPayloads, RSVSignature, KeyDerivationPath, CosmosNetworkIds, CosmosTransactionRequest, CosmosUnsignedTransaction, ChainSignatureContract } from '../index.js';
2
- import { Chain } from '../index.js';
1
+ import type { CosmosNetworkIds, CosmosTransactionRequest, CosmosUnsignedTransaction } from '../Cosmos/types';
2
+ import type { ChainSignatureContract } from '../ChainSignatureContract';
3
+ import type { MPCPayloads, RSVSignature, KeyDerivationPath } from '../types';
4
+ import { Chain } from '../Chain';
3
5
  /**
4
6
  * Implementation of the Chain interface for Cosmos-based networks.
5
7
  * Handles interactions with Cosmos SDK chains like Cosmos Hub, Osmosis, etc.
@@ -6,7 +6,8 @@ import { GasPrice, StargateClient, calculateFee } from '@cosmjs/stargate';
6
6
  import { bech32 } from 'bech32';
7
7
  import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing';
8
8
  import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx';
9
- import { Chain, utils } from '../index.js';
9
+ import { Chain } from '../Chain';
10
+ import { utils } from '../index.js';
10
11
  import { fetchChainInfo } from '../Cosmos/utils';
11
12
  /**
12
13
  * Implementation of the Chain interface for Cosmos-based networks.
@@ -1,5 +1,7 @@
1
- import { type MPCPayloads, type RSVSignature, type KeyDerivationPath, type EVMTransactionRequest, type EVMUnsignedTransaction, type ChainSignatureContract } from '../index.js';
2
- import { Chain } from '../index.js';
1
+ import type { MPCPayloads, RSVSignature, KeyDerivationPath } from '../types';
2
+ import type { EVMTransactionRequest, EVMUnsignedTransaction } from '../EVM/types';
3
+ import type { ChainSignatureContract } from '../ChainSignatureContract';
4
+ import { Chain } from '../Chain';
3
5
  /**
4
6
  * Implementation of the Chain interface for EVM-compatible networks.
5
7
  * Handles interactions with Ethereum Virtual Machine based blockchains like Ethereum, BSC, Polygon, etc.
@@ -1,6 +1,7 @@
1
1
  import { fromHex } from '@cosmjs/encoding';
2
2
  import { ethers, keccak256 } from 'ethers';
3
- import { Chain, fetchEVMFeeProperties } from '../index.js';
3
+ import { Chain } from '../Chain';
4
+ import { fetchEVMFeeProperties } from '../EVM/utils';
4
5
  /**
5
6
  * Implementation of the Chain interface for EVM-compatible networks.
6
7
  * Handles interactions with Ethereum Virtual Machine based blockchains like Ethereum, BSC, Polygon, etc.
@@ -1,4 +1,4 @@
1
- import { type SignArgs } from './index.js';
1
+ import { type SignArgs } from './ChainSignatureContract';
2
2
  interface SuccessResponse {
3
3
  transactionHash: string;
4
4
  success: true;
@@ -1,4 +1,4 @@
1
- import { type MPCSignature, type RSVSignature, type UncompressedPubKeySEC1 } from './index.js';
1
+ import { type MPCSignature, type RSVSignature, type UncompressedPubKeySEC1 } from './types';
2
2
  export declare const toRSV: (signature: MPCSignature) => RSVSignature;
3
3
  /**
4
4
  * Compresses an uncompressed public key to its compressed format following SEC1 standards.
@@ -1,8 +1,9 @@
1
1
  import { type Account } from '@near-js/accounts';
2
2
  import { KeyPair } from '@near-js/crypto';
3
3
  import BN from 'bn.js';
4
- import { ChainSignatureContract } from '../../../chains/index.js';
5
- import type { RSVSignature, UncompressedPubKeySEC1, SignArgs } from '../../../chains/index.js';
4
+ import { ChainSignatureContract } from '../../../chains/ChainSignatureContract';
5
+ import type { RSVSignature, UncompressedPubKeySEC1 } from '../../../chains/types';
6
+ import type { SignArgs } from '../../../chains/ChainSignatureContract';
6
7
  import { type NearNetworkIds, type ChainSignatureContractIds } from '../../chains/near/types';
7
8
  interface ChainSignatureContractArgs {
8
9
  networkId: NearNetworkIds;
@@ -3,7 +3,8 @@ import { KeyPair } from '@near-js/crypto';
3
3
  import { actionCreators } from '@near-js/transactions';
4
4
  import BN from 'bn.js';
5
5
  import { base_decode } from 'near-api-js/lib/utils/serialize';
6
- import { ChainSignatureContract, utils } from '../../../chains/index.js';
6
+ import { ChainSignatureContract } from '../../../chains/ChainSignatureContract';
7
+ import { utils } from '../../../chains/index.js';
7
8
  import { chains } from '../../index.js';
8
9
  import { getNearAccount } from '../../chains/near/account';
9
10
  import { DONT_CARE_ACCOUNT_ID, NEAR_MAX_GAS, } from '../../chains/near/constants';
@@ -1,5 +1,5 @@
1
1
  import { type KeyPair } from '@near-js/crypto';
2
- import { type Response } from '../../../../chains/index.js';
2
+ import { type Response } from '../../../../chains/types';
3
3
  import { type BitcoinRequest, type CosmosRequest, type EVMRequest } from '../../../chains/near/types';
4
4
  export declare const EVMTransaction: (req: EVMRequest, keyPair: KeyPair) => Promise<Response>;
5
5
  export declare const BTCTransaction: (req: BitcoinRequest, keyPair: KeyPair) => Promise<Response>;
@@ -1,4 +1,5 @@
1
- import { Bitcoin, Cosmos, EVM, BTCRpcAdapters } from '../../../../chains/index.js';
1
+ import { Bitcoin, Cosmos, EVM } from '../../../../chains/index.js';
2
+ import { BTCRpcAdapters } from '../../../../chains/Bitcoin/BTCRpcAdapter';
2
3
  import { getNearAccount } from '../../../chains/near/account';
3
4
  import { NearChainSignatureContract } from '../../../chains/near/contract';
4
5
  export const EVMTransaction = async (req, keyPair) => {
@@ -1,5 +1,5 @@
1
1
  import type { Action, FinalExecutionOutcome, NetworkId } from '@near-wallet-selector/core';
2
- import { type RSVSignature, type KeyDerivationPath, type MPCPayloads } from '../../../chains/index.js';
2
+ import { type RSVSignature, type KeyDerivationPath, type MPCPayloads } from '../../../chains/types';
3
3
  import { type NFTKeysContracts, type ChainSignatureContractIds } from '../../chains/near/types';
4
4
  export declare const mpcPayloadsToChainSigTransaction: ({ networkId, contractId, mpcPayloads, path, }: {
5
5
  networkId: NetworkId;
@@ -1,4 +1,7 @@
1
- import { type BTCTransactionRequest, type BTCNetworkIds, type CosmosNetworkIds, type CosmosTransactionRequest, type EVMTransactionRequest, type KeyDerivationPath } from '../../../chains/index.js';
1
+ import type { KeyDerivationPath } from '../../../chains/types';
2
+ import type { BTCTransactionRequest, BTCNetworkIds } from '../../../chains/Bitcoin/types';
3
+ import type { CosmosNetworkIds, CosmosTransactionRequest } from '../../../chains/Cosmos/types';
4
+ import { type EVMTransactionRequest } from '../../../chains/EVM/types';
2
5
  /**
3
6
  Available ChainSignature contracts:
4
7
  - Mainnet: v1.signer