signet.js 0.0.1-beta.2 → 0.0.1-beta.4
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 +1 -1
- package/src/chains/Bitcoin/BTCRpcAdapter/BTCRpcAdapter.d.ts +1 -1
- package/src/chains/Bitcoin/BTCRpcAdapter/Mempool/Mempool.d.ts +2 -2
- package/src/chains/Bitcoin/BTCRpcAdapter/Mempool/Mempool.js +1 -1
- package/src/chains/Bitcoin/Bitcoin.d.ts +5 -2
- package/src/chains/Bitcoin/Bitcoin.js +2 -1
- package/src/chains/Chain.d.ts +1 -1
- package/src/chains/ChainSignatureContract.d.ts +1 -1
- package/src/chains/Cosmos/Cosmos.d.ts +4 -2
- package/src/chains/Cosmos/Cosmos.js +2 -1
- package/src/chains/EVM/EVM.d.ts +4 -2
- package/src/chains/EVM/EVM.js +2 -1
- package/src/chains/types.d.ts +1 -1
- package/src/chains/utils.d.ts +1 -1
- package/src/utils/chains/near/contract.d.ts +3 -2
- package/src/utils/chains/near/contract.js +2 -1
- package/src/utils/chains/near/signAndSend/keypair.d.ts +1 -1
- package/src/utils/chains/near/signAndSend/keypair.js +2 -1
- package/src/utils/chains/near/transactionBuilder.d.ts +1 -1
- package/src/utils/chains/near/types.d.ts +4 -1
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BTCTransaction, BTCInput, BTCOutput } from '../../
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { BTCRpcAdapter } from '../../../
|
|
2
|
-
import type { BTCTransaction, BTCInput, BTCOutput } from '../../../
|
|
1
|
+
import { BTCRpcAdapter } from '../../../Bitcoin/BTCRpcAdapter';
|
|
2
|
+
import type { BTCTransaction, BTCInput, BTCOutput } from '../../../Bitcoin/types';
|
|
3
3
|
export declare class Mempool extends BTCRpcAdapter {
|
|
4
4
|
private readonly providerUrl;
|
|
5
5
|
constructor(providerUrl: string);
|
|
@@ -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 '../../../
|
|
5
|
+
import { BTCRpcAdapter } from '../../../Bitcoin/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
|
|
3
|
-
import {
|
|
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
|
|
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.
|
package/src/chains/Chain.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { KeyDerivationPath, MPCPayloads, RSVSignature } from './
|
|
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,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
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
|
|
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.
|
package/src/chains/EVM/EVM.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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.
|
package/src/chains/EVM/EVM.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { fromHex } from '@cosmjs/encoding';
|
|
2
2
|
import { ethers, keccak256 } from 'ethers';
|
|
3
|
-
import { Chain
|
|
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.
|
package/src/chains/types.d.ts
CHANGED
package/src/chains/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MPCSignature, type RSVSignature, type UncompressedPubKeySEC1 } from './
|
|
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/
|
|
5
|
-
import type { RSVSignature, UncompressedPubKeySEC1
|
|
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
|
|
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/
|
|
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
|
|
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/
|
|
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
|
|
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
|