@atomicfinance/client
Advanced tools
Comparing version 0.1.4 to 0.1.5
610
lib/Cfd.ts
@@ -1,73 +0,141 @@ | ||
import Client from './Client' | ||
import Client from './Client'; | ||
import { | ||
AddMultisigSignRequest, AddMultisigSignResponse, | ||
AddPubkeyHashSignRequest, AddPubkeyHashSignResponse, | ||
AddRawTransactionRequest, AddRawTransactionResponse, | ||
AddScriptHashSignRequest, AddScriptHashSignResponse, | ||
AddSignRequest, AddSignResponse, | ||
AppendDescriptorChecksumRequest, AppendDescriptorChecksumResponse, | ||
BlindRawTransactionRequest, BlindRawTransactionResponse, | ||
CalculateEcSignatureRequest, CalculateEcSignatureResponse, | ||
ConvertAesRequest, ConvertAesResponse, | ||
ConvertEntropyToMnemonicRequest, ConvertEntropyToMnemonicResponse, | ||
ConvertMnemonicToSeedRequest, ConvertMnemonicToSeedResponse, | ||
CreateAddressRequest, CreateAddressResponse, | ||
CreateDescriptorRequest, CreateDescriptorResponse, | ||
CreateExtkeyRequest, CreateExtkeyResponse, | ||
CreateExtkeyFromParentRequest, CreateExtkeyFromParentResponse, | ||
CreateExtkeyFromParentKeyRequest, CreateExtkeyFromParentKeyResponse, | ||
CreateExtkeyFromParentPathRequest, CreateExtkeyFromParentPathResponse, | ||
CreateExtkeyFromSeedRequest, CreateExtkeyFromSeedResponse, | ||
CreateExtPubkeyRequest, CreateExtPubkeyResponse, | ||
CreateKeyPairRequest, CreateKeyPairResponse, | ||
CreateMultisigScriptSigRequest, CreateMultisigScriptSigResponse, | ||
CreateScriptRequest, CreateScriptResponse, | ||
DecodeBase58Request, DecodeBase58Response, | ||
DecodeDerSignatureToRawRequest, DecodeDerSignatureToRawResponse, | ||
DecodeRawTransactionRequest, DecodeRawTransactionResponse, | ||
ElementsAddRawTransactionRequest, ElementsAddRawTransactionResponse, | ||
CreateDestroyAmountRequest, CreateDestroyAmountResponse, | ||
CreatePegInAddressRequest, CreatePegInAddressResponse, | ||
CreateRawPeginRequest, CreateRawPeginResponse, | ||
CreateRawPegoutRequest, CreateRawPegoutResponse, | ||
ElementsCreateRawTransactionRequest, ElementsCreateRawTransactionResponse, | ||
ElementsDecodeRawTransactionRequest, ElementsDecodeRawTransactionResponse, | ||
GetConfidentialAddressRequest, GetConfidentialAddressResponse, | ||
GetUnblindedAddressRequest, GetUnblindedAddressResponse, | ||
SetRawIssueAssetRequest, SetRawIssueAssetResponse, | ||
SetRawReissueAssetRequest, SetRawReissueAssetResponse, | ||
UnblindRawTransactionRequest, UnblindRawTransactionResponse, | ||
EncodeBase58Request, EncodeBase58Response, | ||
EncodeSignatureByDerRequest, EncodeSignatureByDerResponse, | ||
EstimateFeeRequest, EstimateFeeResponse, | ||
FundRawTransactionRequest, FundRawTransactionResponse, | ||
GetAddressInfoRequest, GetAddressInfoResponse, | ||
GetAddressesFromMultisigRequest, GetAddressesFromMultisigResponse, | ||
GetCommitmentRequest, GetCommitmentResponse, | ||
GetCompressedPubkeyRequest, GetCompressedPubkeyResponse, | ||
GetDefaultBlindingKeyRequest, GetDefaultBlindingKeyResponse, | ||
GetExtkeyInfoRequest, GetExtkeyInfoResponse, | ||
GetIssuanceBlindingKeyRequest, GetIssuanceBlindingKeyResponse, | ||
GetMnemonicWordlistRequest, GetMnemonicWordlistResponse, | ||
GetPrivkeyFromExtkeyRequest, GetPrivkeyFromExtkeyResponse, | ||
GetPrivkeyFromWifRequest, GetPrivkeyFromWifResponse, | ||
GetPrivkeyWifRequest, GetPrivkeyWifResponse, | ||
GetPubkeyFromExtkeyRequest, GetPubkeyFromExtkeyResponse, | ||
GetPubkeyFromPrivkeyRequest, GetPubkeyFromPrivkeyResponse, | ||
GetWitnessStackNumRequest, GetWitnessStackNumResponse, | ||
CreateMultisigRequest, CreateMultisigResponse, | ||
ParseDescriptorRequest, ParseDescriptorResponse, | ||
ParseScriptRequest, ParseScriptResponse, | ||
SelectUtxosRequest, SelectUtxosResponse, | ||
SerializeLedgerFormatRequest, SerializeLedgerFormatResponse, | ||
CreateSignatureHashRequest, CreateSignatureHashResponse, | ||
CreateElementsSignatureHashRequest, CreateElementsSignatureHashResponse, | ||
SignWithPrivkeyRequest, SignWithPrivkeyResponse, | ||
AddMultisigSignRequest, | ||
AddMultisigSignResponse, | ||
AddPubkeyHashSignRequest, | ||
AddPubkeyHashSignResponse, | ||
AddRawTransactionRequest, | ||
AddRawTransactionResponse, | ||
AddScriptHashSignRequest, | ||
AddScriptHashSignResponse, | ||
AddSignRequest, | ||
AddSignResponse, | ||
AppendDescriptorChecksumRequest, | ||
AppendDescriptorChecksumResponse, | ||
BlindRawTransactionRequest, | ||
BlindRawTransactionResponse, | ||
CalculateEcSignatureRequest, | ||
CalculateEcSignatureResponse, | ||
ConvertAesRequest, | ||
ConvertAesResponse, | ||
ConvertEntropyToMnemonicRequest, | ||
ConvertEntropyToMnemonicResponse, | ||
ConvertMnemonicToSeedRequest, | ||
ConvertMnemonicToSeedResponse, | ||
CreateAddressRequest, | ||
CreateAddressResponse, | ||
CreateDescriptorRequest, | ||
CreateDescriptorResponse, | ||
CreateExtkeyRequest, | ||
CreateExtkeyResponse, | ||
CreateExtkeyFromParentRequest, | ||
CreateExtkeyFromParentResponse, | ||
CreateExtkeyFromParentKeyRequest, | ||
CreateExtkeyFromParentKeyResponse, | ||
CreateExtkeyFromParentPathRequest, | ||
CreateExtkeyFromParentPathResponse, | ||
CreateExtkeyFromSeedRequest, | ||
CreateExtkeyFromSeedResponse, | ||
CreateExtPubkeyRequest, | ||
CreateExtPubkeyResponse, | ||
CreateKeyPairRequest, | ||
CreateKeyPairResponse, | ||
CreateMultisigScriptSigRequest, | ||
CreateMultisigScriptSigResponse, | ||
CreateScriptRequest, | ||
CreateScriptResponse, | ||
DecodeBase58Request, | ||
DecodeBase58Response, | ||
DecodeDerSignatureToRawRequest, | ||
DecodeDerSignatureToRawResponse, | ||
DecodeRawTransactionRequest, | ||
DecodeRawTransactionResponse, | ||
ElementsAddRawTransactionRequest, | ||
ElementsAddRawTransactionResponse, | ||
CreateDestroyAmountRequest, | ||
CreateDestroyAmountResponse, | ||
CreatePegInAddressRequest, | ||
CreatePegInAddressResponse, | ||
CreateRawPeginRequest, | ||
CreateRawPeginResponse, | ||
CreateRawPegoutRequest, | ||
CreateRawPegoutResponse, | ||
ElementsCreateRawTransactionRequest, | ||
ElementsCreateRawTransactionResponse, | ||
ElementsDecodeRawTransactionRequest, | ||
ElementsDecodeRawTransactionResponse, | ||
GetConfidentialAddressRequest, | ||
GetConfidentialAddressResponse, | ||
GetUnblindedAddressRequest, | ||
GetUnblindedAddressResponse, | ||
SetRawIssueAssetRequest, | ||
SetRawIssueAssetResponse, | ||
SetRawReissueAssetRequest, | ||
SetRawReissueAssetResponse, | ||
UnblindRawTransactionRequest, | ||
UnblindRawTransactionResponse, | ||
EncodeBase58Request, | ||
EncodeBase58Response, | ||
EncodeSignatureByDerRequest, | ||
EncodeSignatureByDerResponse, | ||
EstimateFeeRequest, | ||
EstimateFeeResponse, | ||
FundRawTransactionRequest, | ||
FundRawTransactionResponse, | ||
GetAddressInfoRequest, | ||
GetAddressInfoResponse, | ||
GetAddressesFromMultisigRequest, | ||
GetAddressesFromMultisigResponse, | ||
GetCommitmentRequest, | ||
GetCommitmentResponse, | ||
GetCompressedPubkeyRequest, | ||
GetCompressedPubkeyResponse, | ||
GetDefaultBlindingKeyRequest, | ||
GetDefaultBlindingKeyResponse, | ||
GetExtkeyInfoRequest, | ||
GetExtkeyInfoResponse, | ||
GetIssuanceBlindingKeyRequest, | ||
GetIssuanceBlindingKeyResponse, | ||
GetMnemonicWordlistRequest, | ||
GetMnemonicWordlistResponse, | ||
GetPrivkeyFromExtkeyRequest, | ||
GetPrivkeyFromExtkeyResponse, | ||
GetPrivkeyFromWifRequest, | ||
GetPrivkeyFromWifResponse, | ||
GetPrivkeyWifRequest, | ||
GetPrivkeyWifResponse, | ||
GetPubkeyFromExtkeyRequest, | ||
GetPubkeyFromExtkeyResponse, | ||
GetPubkeyFromPrivkeyRequest, | ||
GetPubkeyFromPrivkeyResponse, | ||
GetWitnessStackNumRequest, | ||
GetWitnessStackNumResponse, | ||
CreateMultisigRequest, | ||
CreateMultisigResponse, | ||
ParseDescriptorRequest, | ||
ParseDescriptorResponse, | ||
ParseScriptRequest, | ||
ParseScriptResponse, | ||
SelectUtxosRequest, | ||
SelectUtxosResponse, | ||
SerializeLedgerFormatRequest, | ||
SerializeLedgerFormatResponse, | ||
CreateSignatureHashRequest, | ||
CreateSignatureHashResponse, | ||
CreateElementsSignatureHashRequest, | ||
CreateElementsSignatureHashResponse, | ||
SignWithPrivkeyRequest, | ||
SignWithPrivkeyResponse, | ||
GetSupportedFunctionResponse, | ||
CreateRawTransactionRequest, CreateRawTransactionResponse, | ||
UpdateTxOutAmountRequest, UpdateTxOutAmountResponse, | ||
UpdateWitnessStackRequest, UpdateWitnessStackResponse, | ||
VerifySignRequest, VerifySignResponse, | ||
VerifySignatureRequest, VerifySignatureResponse | ||
} from 'cfd-js-wasm' | ||
CreateRawTransactionRequest, | ||
CreateRawTransactionResponse, | ||
UpdateTxOutAmountRequest, | ||
UpdateTxOutAmountResponse, | ||
UpdateWitnessStackRequest, | ||
UpdateWitnessStackResponse, | ||
VerifySignRequest, | ||
VerifySignResponse, | ||
VerifySignatureRequest, | ||
VerifySignatureResponse, | ||
} from 'cfd-js-wasm'; | ||
@@ -77,281 +145,411 @@ export default class Cfd { | ||
constructor (client?: Client) { | ||
this.client = client | ||
constructor(client?: Client) { | ||
this.client = client; | ||
} | ||
async AddMultisigSign(jsonObject: AddMultisigSignRequest): Promise<AddMultisigSignResponse> { | ||
return this.client.getMethod('AddMultisigSign')(jsonObject) | ||
async AddMultisigSign( | ||
jsonObject: AddMultisigSignRequest | ||
): Promise<AddMultisigSignResponse> { | ||
return this.client.getMethod('AddMultisigSign')(jsonObject); | ||
} | ||
async AddPubkeyHashSign(jsonObject: AddPubkeyHashSignRequest): Promise<AddPubkeyHashSignResponse> { | ||
return this.client.getMethod('AddPubkeyHashSign')(jsonObject) | ||
async AddPubkeyHashSign( | ||
jsonObject: AddPubkeyHashSignRequest | ||
): Promise<AddPubkeyHashSignResponse> { | ||
return this.client.getMethod('AddPubkeyHashSign')(jsonObject); | ||
} | ||
async AddRawTransaction(jsonObject: AddRawTransactionRequest): Promise<AddRawTransactionResponse> { | ||
return this.client.getMethod('AddRawTransaction')(jsonObject) | ||
async AddRawTransaction( | ||
jsonObject: AddRawTransactionRequest | ||
): Promise<AddRawTransactionResponse> { | ||
return this.client.getMethod('AddRawTransaction')(jsonObject); | ||
} | ||
async AddScriptHashSign(jsonObject: AddScriptHashSignRequest): Promise<AddScriptHashSignResponse> { | ||
return this.client.getMethod('AddScriptHashSign')(jsonObject) | ||
async AddScriptHashSign( | ||
jsonObject: AddScriptHashSignRequest | ||
): Promise<AddScriptHashSignResponse> { | ||
return this.client.getMethod('AddScriptHashSign')(jsonObject); | ||
} | ||
async AddSign(jsonObject: AddSignRequest): Promise<AddSignResponse> { | ||
return this.client.getMethod('AddSign')(jsonObject) | ||
return this.client.getMethod('AddSign')(jsonObject); | ||
} | ||
async AppendDescriptorChecksum(jsonObject: AppendDescriptorChecksumRequest): Promise<AppendDescriptorChecksumResponse> { | ||
return this.client.getMethod('AppendDescriptorChecksum')(jsonObject) | ||
async AppendDescriptorChecksum( | ||
jsonObject: AppendDescriptorChecksumRequest | ||
): Promise<AppendDescriptorChecksumResponse> { | ||
return this.client.getMethod('AppendDescriptorChecksum')(jsonObject); | ||
} | ||
async BlindRawTransaction(jsonObject: BlindRawTransactionRequest): Promise<BlindRawTransactionResponse> { | ||
return this.client.getMethod('BlindRawTransaction')(jsonObject) | ||
async BlindRawTransaction( | ||
jsonObject: BlindRawTransactionRequest | ||
): Promise<BlindRawTransactionResponse> { | ||
return this.client.getMethod('BlindRawTransaction')(jsonObject); | ||
} | ||
async CalculateEcSignature(jsonObject: CalculateEcSignatureRequest): Promise<CalculateEcSignatureResponse> { | ||
return this.client.getMethod('CalculateEcSignature')(jsonObject) | ||
async CalculateEcSignature( | ||
jsonObject: CalculateEcSignatureRequest | ||
): Promise<CalculateEcSignatureResponse> { | ||
return this.client.getMethod('CalculateEcSignature')(jsonObject); | ||
} | ||
async ConvertAes(jsonObject: ConvertAesRequest): Promise<ConvertAesResponse> { | ||
return this.client.getMethod('ConvertAes')(jsonObject) | ||
return this.client.getMethod('ConvertAes')(jsonObject); | ||
} | ||
async ConvertEntropyToMnemonic(jsonObject: ConvertEntropyToMnemonicRequest): Promise<ConvertEntropyToMnemonicResponse> { | ||
return this.client.getMethod('ConvertEntropyToMnemonic')(jsonObject) | ||
async ConvertEntropyToMnemonic( | ||
jsonObject: ConvertEntropyToMnemonicRequest | ||
): Promise<ConvertEntropyToMnemonicResponse> { | ||
return this.client.getMethod('ConvertEntropyToMnemonic')(jsonObject); | ||
} | ||
async ConvertMnemonicToSeed(jsonObject: ConvertMnemonicToSeedRequest): Promise<ConvertMnemonicToSeedResponse> { | ||
return this.client.getMethod('ConvertMnemonicToSeed')(jsonObject) | ||
async ConvertMnemonicToSeed( | ||
jsonObject: ConvertMnemonicToSeedRequest | ||
): Promise<ConvertMnemonicToSeedResponse> { | ||
return this.client.getMethod('ConvertMnemonicToSeed')(jsonObject); | ||
} | ||
async CreateAddress(jsonObject: CreateAddressRequest): Promise<CreateAddressResponse> { | ||
return this.client.getMethod('CreateAddress')(jsonObject) | ||
async CreateAddress( | ||
jsonObject: CreateAddressRequest | ||
): Promise<CreateAddressResponse> { | ||
return this.client.getMethod('CreateAddress')(jsonObject); | ||
} | ||
async CreateDescriptor(jsonObject: CreateDescriptorRequest): Promise<CreateDescriptorResponse> { | ||
return this.client.getMethod('CreateDescriptor')(jsonObject) | ||
async CreateDescriptor( | ||
jsonObject: CreateDescriptorRequest | ||
): Promise<CreateDescriptorResponse> { | ||
return this.client.getMethod('CreateDescriptor')(jsonObject); | ||
} | ||
async CreateExtkey(jsonObject: CreateExtkeyRequest): Promise<CreateExtkeyResponse> { | ||
return this.client.getMethod('CreateExtkey')(jsonObject) | ||
async CreateExtkey( | ||
jsonObject: CreateExtkeyRequest | ||
): Promise<CreateExtkeyResponse> { | ||
return this.client.getMethod('CreateExtkey')(jsonObject); | ||
} | ||
async CreateExtkeyFromParent(jsonObject: CreateExtkeyFromParentRequest): Promise<CreateExtkeyFromParentResponse> { | ||
return this.client.getMethod('CreateExtkeyFromParent')(jsonObject) | ||
async CreateExtkeyFromParent( | ||
jsonObject: CreateExtkeyFromParentRequest | ||
): Promise<CreateExtkeyFromParentResponse> { | ||
return this.client.getMethod('CreateExtkeyFromParent')(jsonObject); | ||
} | ||
async CreateExtkeyFromParentKey(jsonObject: CreateExtkeyFromParentKeyRequest): Promise<CreateExtkeyFromParentKeyResponse> { | ||
return this.client.getMethod('CreateExtkeyFromParentKey')(jsonObject) | ||
async CreateExtkeyFromParentKey( | ||
jsonObject: CreateExtkeyFromParentKeyRequest | ||
): Promise<CreateExtkeyFromParentKeyResponse> { | ||
return this.client.getMethod('CreateExtkeyFromParentKey')(jsonObject); | ||
} | ||
async CreateExtkeyFromParentPath(jsonObject: CreateExtkeyFromParentPathRequest): Promise<CreateExtkeyFromParentPathResponse> { | ||
return this.client.getMethod('CreateExtkeyFromParentPath')(jsonObject) | ||
async CreateExtkeyFromParentPath( | ||
jsonObject: CreateExtkeyFromParentPathRequest | ||
): Promise<CreateExtkeyFromParentPathResponse> { | ||
return this.client.getMethod('CreateExtkeyFromParentPath')(jsonObject); | ||
} | ||
async CreateExtkeyFromSeed(jsonObject: CreateExtkeyFromSeedRequest): Promise<CreateExtkeyFromSeedResponse> { | ||
return this.client.getMethod('CreateExtkeyFromSeed')(jsonObject) | ||
async CreateExtkeyFromSeed( | ||
jsonObject: CreateExtkeyFromSeedRequest | ||
): Promise<CreateExtkeyFromSeedResponse> { | ||
return this.client.getMethod('CreateExtkeyFromSeed')(jsonObject); | ||
} | ||
async CreateExtPubkey(jsonObject: CreateExtPubkeyRequest): Promise<CreateExtPubkeyResponse> { | ||
return this.client.getMethod('CreateExtPubkey')(jsonObject) | ||
async CreateExtPubkey( | ||
jsonObject: CreateExtPubkeyRequest | ||
): Promise<CreateExtPubkeyResponse> { | ||
return this.client.getMethod('CreateExtPubkey')(jsonObject); | ||
} | ||
async CreateKeyPair(jsonObject: CreateKeyPairRequest): Promise<CreateKeyPairResponse> { | ||
return this.client.getMethod('CreateKeyPair')(jsonObject) | ||
async CreateKeyPair( | ||
jsonObject: CreateKeyPairRequest | ||
): Promise<CreateKeyPairResponse> { | ||
return this.client.getMethod('CreateKeyPair')(jsonObject); | ||
} | ||
async CreateMultisigScriptSig(jsonObject: CreateMultisigScriptSigRequest): Promise<CreateMultisigScriptSigResponse> { | ||
return this.client.getMethod('CreateMultisigScriptSig')(jsonObject) | ||
async CreateMultisigScriptSig( | ||
jsonObject: CreateMultisigScriptSigRequest | ||
): Promise<CreateMultisigScriptSigResponse> { | ||
return this.client.getMethod('CreateMultisigScriptSig')(jsonObject); | ||
} | ||
async CreateScript(jsonObject: CreateScriptRequest): Promise<CreateScriptResponse> { | ||
return this.client.getMethod('CreateScript')(jsonObject) | ||
async CreateScript( | ||
jsonObject: CreateScriptRequest | ||
): Promise<CreateScriptResponse> { | ||
return this.client.getMethod('CreateScript')(jsonObject); | ||
} | ||
async DecodeBase58(jsonObject: DecodeBase58Request): Promise<DecodeBase58Response> { | ||
return this.client.getMethod('DecodeBase58')(jsonObject) | ||
async DecodeBase58( | ||
jsonObject: DecodeBase58Request | ||
): Promise<DecodeBase58Response> { | ||
return this.client.getMethod('DecodeBase58')(jsonObject); | ||
} | ||
async DecodeDerSignatureToRaw(jsonObject: DecodeDerSignatureToRawRequest): Promise<DecodeDerSignatureToRawResponse> { | ||
return this.client.getMethod('DecodeDerSignatureToRaw')(jsonObject) | ||
async DecodeDerSignatureToRaw( | ||
jsonObject: DecodeDerSignatureToRawRequest | ||
): Promise<DecodeDerSignatureToRawResponse> { | ||
return this.client.getMethod('DecodeDerSignatureToRaw')(jsonObject); | ||
} | ||
async DecodeRawTransaction(jsonObject: DecodeRawTransactionRequest): Promise<DecodeRawTransactionResponse> { | ||
return this.client.getMethod('DecodeRawTransaction')(jsonObject) | ||
async DecodeRawTransaction( | ||
jsonObject: DecodeRawTransactionRequest | ||
): Promise<DecodeRawTransactionResponse> { | ||
return this.client.getMethod('DecodeRawTransaction')(jsonObject); | ||
} | ||
async ElementsAddRawTransaction(jsonObject: ElementsAddRawTransactionRequest): Promise<ElementsAddRawTransactionResponse> { | ||
return this.client.getMethod('ElementsAddRawTransaction')(jsonObject) | ||
async ElementsAddRawTransaction( | ||
jsonObject: ElementsAddRawTransactionRequest | ||
): Promise<ElementsAddRawTransactionResponse> { | ||
return this.client.getMethod('ElementsAddRawTransaction')(jsonObject); | ||
} | ||
async CreateDestroyAmount(jsonObject: CreateDestroyAmountRequest): Promise<CreateDestroyAmountResponse> { | ||
return this.client.getMethod('CreateDestroyAmount')(jsonObject) | ||
async CreateDestroyAmount( | ||
jsonObject: CreateDestroyAmountRequest | ||
): Promise<CreateDestroyAmountResponse> { | ||
return this.client.getMethod('CreateDestroyAmount')(jsonObject); | ||
} | ||
async CreatePegInAddress(jsonObject: CreatePegInAddressRequest): Promise<CreatePegInAddressResponse> { | ||
return this.client.getMethod('CreatePegInAddress')(jsonObject) | ||
async CreatePegInAddress( | ||
jsonObject: CreatePegInAddressRequest | ||
): Promise<CreatePegInAddressResponse> { | ||
return this.client.getMethod('CreatePegInAddress')(jsonObject); | ||
} | ||
async CreateRawPegin(jsonObject: CreateRawPeginRequest): Promise<CreateRawPeginResponse> { | ||
return this.client.getMethod('CreateRawPegin')(jsonObject) | ||
async CreateRawPegin( | ||
jsonObject: CreateRawPeginRequest | ||
): Promise<CreateRawPeginResponse> { | ||
return this.client.getMethod('CreateRawPegin')(jsonObject); | ||
} | ||
async CreateRawPegout(jsonObject: CreateRawPegoutRequest): Promise<CreateRawPegoutResponse> { | ||
return this.client.getMethod('CreateRawPegout')(jsonObject) | ||
async CreateRawPegout( | ||
jsonObject: CreateRawPegoutRequest | ||
): Promise<CreateRawPegoutResponse> { | ||
return this.client.getMethod('CreateRawPegout')(jsonObject); | ||
} | ||
async ElementsCreateRawTransaction(jsonObject: ElementsCreateRawTransactionRequest): Promise<ElementsCreateRawTransactionResponse> { | ||
return this.client.getMethod('ElementsCreateRawTransaction')(jsonObject) | ||
async ElementsCreateRawTransaction( | ||
jsonObject: ElementsCreateRawTransactionRequest | ||
): Promise<ElementsCreateRawTransactionResponse> { | ||
return this.client.getMethod('ElementsCreateRawTransaction')(jsonObject); | ||
} | ||
async ElementsDecodeRawTransaction(jsonObject: ElementsDecodeRawTransactionRequest): Promise<ElementsDecodeRawTransactionResponse> { | ||
return this.client.getMethod('ElementsDecodeRawTransaction')(jsonObject) | ||
async ElementsDecodeRawTransaction( | ||
jsonObject: ElementsDecodeRawTransactionRequest | ||
): Promise<ElementsDecodeRawTransactionResponse> { | ||
return this.client.getMethod('ElementsDecodeRawTransaction')(jsonObject); | ||
} | ||
async GetConfidentialAddress(jsonObject: GetConfidentialAddressRequest): Promise<GetConfidentialAddressResponse> { | ||
return this.client.getMethod('GetConfidentialAddress')(jsonObject) | ||
async GetConfidentialAddress( | ||
jsonObject: GetConfidentialAddressRequest | ||
): Promise<GetConfidentialAddressResponse> { | ||
return this.client.getMethod('GetConfidentialAddress')(jsonObject); | ||
} | ||
async GetUnblindedAddress(jsonObject: GetUnblindedAddressRequest): Promise<GetUnblindedAddressResponse> { | ||
return this.client.getMethod('GetUnblindedAddress')(jsonObject) | ||
async GetUnblindedAddress( | ||
jsonObject: GetUnblindedAddressRequest | ||
): Promise<GetUnblindedAddressResponse> { | ||
return this.client.getMethod('GetUnblindedAddress')(jsonObject); | ||
} | ||
async SetRawIssueAsset(jsonObject: SetRawIssueAssetRequest): Promise<SetRawIssueAssetResponse> { | ||
return this.client.getMethod('SetRawIssueAsset')(jsonObject) | ||
async SetRawIssueAsset( | ||
jsonObject: SetRawIssueAssetRequest | ||
): Promise<SetRawIssueAssetResponse> { | ||
return this.client.getMethod('SetRawIssueAsset')(jsonObject); | ||
} | ||
async SetRawReissueAsset(jsonObject: SetRawReissueAssetRequest): Promise<SetRawReissueAssetResponse> { | ||
return this.client.getMethod('SetRawReissueAsset')(jsonObject) | ||
async SetRawReissueAsset( | ||
jsonObject: SetRawReissueAssetRequest | ||
): Promise<SetRawReissueAssetResponse> { | ||
return this.client.getMethod('SetRawReissueAsset')(jsonObject); | ||
} | ||
async UnblindRawTransaction(jsonObject: UnblindRawTransactionRequest): Promise<UnblindRawTransactionResponse> { | ||
return this.client.getMethod('UnblindRawTransaction')(jsonObject) | ||
async UnblindRawTransaction( | ||
jsonObject: UnblindRawTransactionRequest | ||
): Promise<UnblindRawTransactionResponse> { | ||
return this.client.getMethod('UnblindRawTransaction')(jsonObject); | ||
} | ||
async EncodeBase58(jsonObject: EncodeBase58Request): Promise<EncodeBase58Response> { | ||
return this.client.getMethod('EncodeBase58')(jsonObject) | ||
async EncodeBase58( | ||
jsonObject: EncodeBase58Request | ||
): Promise<EncodeBase58Response> { | ||
return this.client.getMethod('EncodeBase58')(jsonObject); | ||
} | ||
async EncodeSignatureByDer(jsonObject: EncodeSignatureByDerRequest): Promise<EncodeSignatureByDerResponse> { | ||
return this.client.getMethod('EncodeSignatureByDer')(jsonObject) | ||
async EncodeSignatureByDer( | ||
jsonObject: EncodeSignatureByDerRequest | ||
): Promise<EncodeSignatureByDerResponse> { | ||
return this.client.getMethod('EncodeSignatureByDer')(jsonObject); | ||
} | ||
async EstimateFee(jsonObject: EstimateFeeRequest): Promise<EstimateFeeResponse> { | ||
return this.client.getMethod('EstimateFee')(jsonObject) | ||
async EstimateFee( | ||
jsonObject: EstimateFeeRequest | ||
): Promise<EstimateFeeResponse> { | ||
return this.client.getMethod('EstimateFee')(jsonObject); | ||
} | ||
async FundRawTransaction(jsonObject: FundRawTransactionRequest): Promise<FundRawTransactionResponse> { | ||
return this.client.getMethod('FundRawTransaction')(jsonObject) | ||
async FundRawTransaction( | ||
jsonObject: FundRawTransactionRequest | ||
): Promise<FundRawTransactionResponse> { | ||
return this.client.getMethod('FundRawTransaction')(jsonObject); | ||
} | ||
async GetAddressInfo(jsonObject: GetAddressInfoRequest): Promise<GetAddressInfoResponse> { | ||
return this.client.getMethod('GetAddressInfo')(jsonObject) | ||
async GetAddressInfo( | ||
jsonObject: GetAddressInfoRequest | ||
): Promise<GetAddressInfoResponse> { | ||
return this.client.getMethod('GetAddressInfo')(jsonObject); | ||
} | ||
async GetAddressesFromMultisig(jsonObject: GetAddressesFromMultisigRequest): Promise<GetAddressesFromMultisigResponse> { | ||
return this.client.getMethod('GetAddressesFromMultisig')(jsonObject) | ||
async GetAddressesFromMultisig( | ||
jsonObject: GetAddressesFromMultisigRequest | ||
): Promise<GetAddressesFromMultisigResponse> { | ||
return this.client.getMethod('GetAddressesFromMultisig')(jsonObject); | ||
} | ||
async GetCommitment(jsonObject: GetCommitmentRequest): Promise<GetCommitmentResponse> { | ||
return this.client.getMethod('GetCommitment')(jsonObject) | ||
async GetCommitment( | ||
jsonObject: GetCommitmentRequest | ||
): Promise<GetCommitmentResponse> { | ||
return this.client.getMethod('GetCommitment')(jsonObject); | ||
} | ||
async GetCompressedPubkey(jsonObject: GetCompressedPubkeyRequest): Promise<GetCompressedPubkeyResponse> { | ||
return this.client.getMethod('GetCompressedPubkey')(jsonObject) | ||
async GetCompressedPubkey( | ||
jsonObject: GetCompressedPubkeyRequest | ||
): Promise<GetCompressedPubkeyResponse> { | ||
return this.client.getMethod('GetCompressedPubkey')(jsonObject); | ||
} | ||
async GetDefaultBlindingKey(jsonObject: GetDefaultBlindingKeyRequest): Promise<GetDefaultBlindingKeyResponse> { | ||
return this.client.getMethod('GetDefaultBlindingKey')(jsonObject) | ||
async GetDefaultBlindingKey( | ||
jsonObject: GetDefaultBlindingKeyRequest | ||
): Promise<GetDefaultBlindingKeyResponse> { | ||
return this.client.getMethod('GetDefaultBlindingKey')(jsonObject); | ||
} | ||
async GetExtkeyInfo(jsonObject: GetExtkeyInfoRequest): Promise<GetExtkeyInfoResponse> { | ||
return this.client.getMethod('GetExtkeyInfo')(jsonObject) | ||
async GetExtkeyInfo( | ||
jsonObject: GetExtkeyInfoRequest | ||
): Promise<GetExtkeyInfoResponse> { | ||
return this.client.getMethod('GetExtkeyInfo')(jsonObject); | ||
} | ||
async GetIssuanceBlindingKey(jsonObject: GetIssuanceBlindingKeyRequest): Promise<GetIssuanceBlindingKeyResponse> { | ||
return this.client.getMethod('GetIssuanceBlindingKey')(jsonObject) | ||
async GetIssuanceBlindingKey( | ||
jsonObject: GetIssuanceBlindingKeyRequest | ||
): Promise<GetIssuanceBlindingKeyResponse> { | ||
return this.client.getMethod('GetIssuanceBlindingKey')(jsonObject); | ||
} | ||
async GetMnemonicWordlist(jsonObject: GetMnemonicWordlistRequest): Promise<GetMnemonicWordlistResponse> { | ||
return this.client.getMethod('GetMnemonicWordlist')(jsonObject) | ||
async GetMnemonicWordlist( | ||
jsonObject: GetMnemonicWordlistRequest | ||
): Promise<GetMnemonicWordlistResponse> { | ||
return this.client.getMethod('GetMnemonicWordlist')(jsonObject); | ||
} | ||
async GetPrivkeyFromExtkey(jsonObject: GetPrivkeyFromExtkeyRequest): Promise<GetPrivkeyFromExtkeyResponse> { | ||
return this.client.getMethod('GetPrivkeyFromExtkey')(jsonObject) | ||
async GetPrivkeyFromExtkey( | ||
jsonObject: GetPrivkeyFromExtkeyRequest | ||
): Promise<GetPrivkeyFromExtkeyResponse> { | ||
return this.client.getMethod('GetPrivkeyFromExtkey')(jsonObject); | ||
} | ||
async GetPrivkeyFromWif(jsonObject: GetPrivkeyFromWifRequest): Promise<GetPrivkeyFromWifResponse> { | ||
return this.client.getMethod('GetPrivkeyFromWif')(jsonObject) | ||
async GetPrivkeyFromWif( | ||
jsonObject: GetPrivkeyFromWifRequest | ||
): Promise<GetPrivkeyFromWifResponse> { | ||
return this.client.getMethod('GetPrivkeyFromWif')(jsonObject); | ||
} | ||
async GetPrivkeyWif(jsonObject: GetPrivkeyWifRequest): Promise<GetPrivkeyWifResponse> { | ||
return this.client.getMethod('GetPrivkeyWif')(jsonObject) | ||
async GetPrivkeyWif( | ||
jsonObject: GetPrivkeyWifRequest | ||
): Promise<GetPrivkeyWifResponse> { | ||
return this.client.getMethod('GetPrivkeyWif')(jsonObject); | ||
} | ||
async GetPubkeyFromExtkey(jsonObject: GetPubkeyFromExtkeyRequest): Promise<GetPubkeyFromExtkeyResponse> { | ||
return this.client.getMethod('GetPubkeyFromExtkey')(jsonObject) | ||
async GetPubkeyFromExtkey( | ||
jsonObject: GetPubkeyFromExtkeyRequest | ||
): Promise<GetPubkeyFromExtkeyResponse> { | ||
return this.client.getMethod('GetPubkeyFromExtkey')(jsonObject); | ||
} | ||
async GetPubkeyFromPrivkey(jsonObject: GetPubkeyFromPrivkeyRequest): Promise<GetPubkeyFromPrivkeyResponse> { | ||
return this.client.getMethod('GetPubkeyFromPrivkey')(jsonObject) | ||
async GetPubkeyFromPrivkey( | ||
jsonObject: GetPubkeyFromPrivkeyRequest | ||
): Promise<GetPubkeyFromPrivkeyResponse> { | ||
return this.client.getMethod('GetPubkeyFromPrivkey')(jsonObject); | ||
} | ||
async GetWitnessStackNum(jsonObject: GetWitnessStackNumRequest): Promise<GetWitnessStackNumResponse> { | ||
return this.client.getMethod('GetWitnessStackNum')(jsonObject) | ||
async GetWitnessStackNum( | ||
jsonObject: GetWitnessStackNumRequest | ||
): Promise<GetWitnessStackNumResponse> { | ||
return this.client.getMethod('GetWitnessStackNum')(jsonObject); | ||
} | ||
async CreateMultisig(jsonObject: CreateMultisigRequest): Promise<CreateMultisigResponse> { | ||
return this.client.getMethod('CreateMultisig')(jsonObject) | ||
async CreateMultisig( | ||
jsonObject: CreateMultisigRequest | ||
): Promise<CreateMultisigResponse> { | ||
return this.client.getMethod('CreateMultisig')(jsonObject); | ||
} | ||
async ParseDescriptor(jsonObject: ParseDescriptorRequest): Promise<ParseDescriptorResponse> { | ||
return this.client.getMethod('ParseDescriptor')(jsonObject) | ||
async ParseDescriptor( | ||
jsonObject: ParseDescriptorRequest | ||
): Promise<ParseDescriptorResponse> { | ||
return this.client.getMethod('ParseDescriptor')(jsonObject); | ||
} | ||
async ParseScript(jsonObject: ParseScriptRequest): Promise<ParseScriptResponse> { | ||
return this.client.getMethod('ParseScript')(jsonObject) | ||
async ParseScript( | ||
jsonObject: ParseScriptRequest | ||
): Promise<ParseScriptResponse> { | ||
return this.client.getMethod('ParseScript')(jsonObject); | ||
} | ||
async SelectUtxos(jsonObject: SelectUtxosRequest): Promise<SelectUtxosResponse> { | ||
return this.client.getMethod('SelectUtxos')(jsonObject) | ||
async SelectUtxos( | ||
jsonObject: SelectUtxosRequest | ||
): Promise<SelectUtxosResponse> { | ||
return this.client.getMethod('SelectUtxos')(jsonObject); | ||
} | ||
async SerializeLedgerFormat(jsonObject: SerializeLedgerFormatRequest): Promise<SerializeLedgerFormatResponse> { | ||
return this.client.getMethod('SerializeLedgerFormat')(jsonObject) | ||
async SerializeLedgerFormat( | ||
jsonObject: SerializeLedgerFormatRequest | ||
): Promise<SerializeLedgerFormatResponse> { | ||
return this.client.getMethod('SerializeLedgerFormat')(jsonObject); | ||
} | ||
async CreateSignatureHash(jsonObject: CreateSignatureHashRequest): Promise<CreateSignatureHashResponse> { | ||
return this.client.getMethod('CreateSignatureHash')(jsonObject) | ||
async CreateSignatureHash( | ||
jsonObject: CreateSignatureHashRequest | ||
): Promise<CreateSignatureHashResponse> { | ||
return this.client.getMethod('CreateSignatureHash')(jsonObject); | ||
} | ||
async CreateElementsSignatureHash(jsonObject: CreateElementsSignatureHashRequest): Promise<CreateElementsSignatureHashResponse> { | ||
return this.client.getMethod('CreateElementsSignatureHash')(jsonObject) | ||
async CreateElementsSignatureHash( | ||
jsonObject: CreateElementsSignatureHashRequest | ||
): Promise<CreateElementsSignatureHashResponse> { | ||
return this.client.getMethod('CreateElementsSignatureHash')(jsonObject); | ||
} | ||
async SignWithPrivkey(jsonObject: SignWithPrivkeyRequest): Promise<SignWithPrivkeyResponse> { | ||
return this.client.getMethod('SignWithPrivkey')(jsonObject) | ||
async SignWithPrivkey( | ||
jsonObject: SignWithPrivkeyRequest | ||
): Promise<SignWithPrivkeyResponse> { | ||
return this.client.getMethod('SignWithPrivkey')(jsonObject); | ||
} | ||
async GetSupportedFunction(): Promise<GetSupportedFunctionResponse> { | ||
return this.client.getMethod('GetSupportedFunction')() | ||
return this.client.getMethod('GetSupportedFunction')(); | ||
} | ||
async CreateRawTransaction(jsonObject: CreateRawTransactionRequest): Promise<CreateRawTransactionResponse> { | ||
return this.client.getMethod('CreateRawTransaction')(jsonObject) | ||
async CreateRawTransaction( | ||
jsonObject: CreateRawTransactionRequest | ||
): Promise<CreateRawTransactionResponse> { | ||
return this.client.getMethod('CreateRawTransaction')(jsonObject); | ||
} | ||
async UpdateTxOutAmount(jsonObject: UpdateTxOutAmountRequest): Promise<UpdateTxOutAmountResponse> { | ||
return this.client.getMethod('UpdateTxOutAmount')(jsonObject) | ||
async UpdateTxOutAmount( | ||
jsonObject: UpdateTxOutAmountRequest | ||
): Promise<UpdateTxOutAmountResponse> { | ||
return this.client.getMethod('UpdateTxOutAmount')(jsonObject); | ||
} | ||
async UpdateWitnessStack(jsonObject: UpdateWitnessStackRequest): Promise<UpdateWitnessStackResponse> { | ||
return this.client.getMethod('UpdateWitnessStack')(jsonObject) | ||
async UpdateWitnessStack( | ||
jsonObject: UpdateWitnessStackRequest | ||
): Promise<UpdateWitnessStackResponse> { | ||
return this.client.getMethod('UpdateWitnessStack')(jsonObject); | ||
} | ||
async VerifySign(jsonObject: VerifySignRequest): Promise<VerifySignResponse> { | ||
return this.client.getMethod('VerifySign')(jsonObject) | ||
return this.client.getMethod('VerifySign')(jsonObject); | ||
} | ||
async VerifySignature(jsonObject: VerifySignatureRequest): Promise<VerifySignatureResponse> { | ||
return this.client.getMethod('VerifySignature')(jsonObject) | ||
async VerifySignature( | ||
jsonObject: VerifySignatureRequest | ||
): Promise<VerifySignatureResponse> { | ||
return this.client.getMethod('VerifySignature')(jsonObject); | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
declare module "@liquality/errors" { | ||
declare module '@liquality/errors' { | ||
function DuplicateProviderError(error: string): any; | ||
@@ -3,0 +3,0 @@ function InvalidProviderError(error: string): any; |
@@ -1,6 +0,6 @@ | ||
import * as _ from 'lodash' | ||
const { find, findLast, findLastIndex, isFunction } = _ | ||
import * as _ from 'lodash'; | ||
const { find, findLast, findLastIndex, isFunction } = _; | ||
import Dlc from './Dlc' | ||
import Cfd from './Cfd' | ||
import Dlc from './Dlc'; | ||
import Cfd from './Cfd'; | ||
@@ -11,4 +11,4 @@ import { | ||
NoProviderError, | ||
UnimplementedMethodError | ||
} from '@liquality/errors' | ||
UnimplementedMethodError, | ||
} from '@liquality/errors'; | ||
@@ -26,15 +26,15 @@ export default class Client extends Dlc { | ||
*/ | ||
constructor (client?: Client) { | ||
super(client) | ||
this.client = client | ||
constructor(client?: Client) { | ||
super(client); | ||
this.client = client; | ||
/** | ||
* @type {Array} | ||
*/ | ||
this._providers = [] | ||
this._providers = []; | ||
this._dlc = new Dlc(this) | ||
this._cfd = new Cfd(this) | ||
this._dlc = new Dlc(this); | ||
this._cfd = new Cfd(this); | ||
this.identifier = 'Client' | ||
this.identifier = 'Client'; | ||
} | ||
@@ -49,5 +49,7 @@ | ||
*/ | ||
addProvider (provider: any) { | ||
addProvider(provider: any) { | ||
if (!isFunction(provider.setClient)) { | ||
throw new (InvalidProviderError('Provider should have "setClient" method') as any) | ||
throw new (InvalidProviderError( | ||
'Provider should have "setClient" method' | ||
) as any)(); | ||
} | ||
@@ -57,13 +59,13 @@ | ||
this._providers, | ||
_provider => provider.constructor === _provider.constructor | ||
) | ||
(_provider) => provider.constructor === _provider.constructor | ||
); | ||
if (duplicate) { | ||
throw new (DuplicateProviderError('Duplicate provider') as any) | ||
throw new (DuplicateProviderError('Duplicate provider') as any)(); | ||
} | ||
provider.setClient(this) | ||
this._providers.push(provider) | ||
provider.setClient(this); | ||
this._providers.push(provider); | ||
return this | ||
return this; | ||
} | ||
@@ -83,27 +85,33 @@ | ||
*/ | ||
getProviderForMethod (method: any, requestor: any = false) : Client { | ||
getProviderForMethod(method: any, requestor: any = false): Client { | ||
if (this._providers.concat(this.client._providers).length === 0) { | ||
throw new (NoProviderError('No provider provided. Add a provider to the client') as any) | ||
throw new (NoProviderError( | ||
'No provider provided. Add a provider to the client' | ||
) as any)(); | ||
} | ||
let indexOfRequestor = requestor | ||
? findLastIndex( | ||
this._providers.concat(this.client._providers), | ||
function(provider) { | ||
return requestor.constructor === provider.constructor || (provider.getIdentifier && requestor.getIdentifier() === provider.getIdentifier()) | ||
}, | ||
) : this._providers.concat(this.client._providers).length | ||
? findLastIndex(this._providers.concat(this.client._providers), function ( | ||
provider | ||
) { | ||
return ( | ||
requestor.constructor === provider.constructor || | ||
(provider.getIdentifier && | ||
requestor.getIdentifier() === provider.getIdentifier()) | ||
); | ||
}) | ||
: this._providers.concat(this.client._providers).length; | ||
if (indexOfRequestor === -1) indexOfRequestor = 0 | ||
if (indexOfRequestor === -1) indexOfRequestor = 0; | ||
let provider = findLast( | ||
this._providers.concat(this.client._providers), | ||
function(provider) { | ||
function (provider) { | ||
try { | ||
return isFunction((provider as any)[method]) | ||
} catch(e) { | ||
return isFunction((provider as any)[method]); | ||
} catch (e) { | ||
try { | ||
return isFunction(provider.getMethod(method)) | ||
} catch(e) { | ||
return false | ||
return isFunction(provider.getMethod(method)); | ||
} catch (e) { | ||
return false; | ||
} | ||
@@ -113,9 +121,11 @@ } | ||
indexOfRequestor - 1 | ||
) | ||
); | ||
if (provider == null) { | ||
throw new (UnimplementedMethodError(`Unimplemented method "${method}"`) as any) | ||
throw new (UnimplementedMethodError( | ||
`Unimplemented method "${method}"` | ||
) as any)(); | ||
} | ||
return provider | ||
return provider; | ||
} | ||
@@ -130,11 +140,11 @@ | ||
*/ | ||
getMethod (method: any, requestor?: any) : any { | ||
getMethod(method: any, requestor?: any): any { | ||
try { | ||
const provider = this.getProviderForMethod(method, requestor) | ||
return (provider as any)[method].bind(provider) | ||
} catch(e) { | ||
const provider = this.getProviderForMethod(method, requestor); | ||
return (provider as any)[method].bind(provider); | ||
} catch (e) { | ||
try { | ||
return this.client.getMethod(method) | ||
} catch(e) { | ||
return (this.client as any)[method] | ||
return this.client.getMethod(method); | ||
} catch (e) { | ||
return (this.client as any)[method]; | ||
} | ||
@@ -144,13 +154,13 @@ } | ||
get dlc () { | ||
return this._dlc | ||
get dlc() { | ||
return this._dlc; | ||
} | ||
get cfd () { | ||
return this._cfd | ||
get cfd() { | ||
return this._cfd; | ||
} | ||
getIdentifier () { | ||
getIdentifier() { | ||
return this.identifier; | ||
} | ||
} |
348
lib/Dlc.ts
@@ -1,31 +0,65 @@ | ||
import Client from './Client' | ||
import Client from './Client'; | ||
import { | ||
AddSignatureToFundTransactionRequest, AddSignatureToFundTransactionResponse, | ||
AddSignaturesToCetRequest, AddSignaturesToCetResponse, | ||
AddSignaturesToMutualClosingTxRequest, AddSignaturesToMutualClosingTxResponse, | ||
AddSignaturesToRefundTxRequest, AddSignaturesToRefundTxResponse, | ||
CreateCetRequest, CreateCetResponse, | ||
CreateClosingTransactionRequest, CreateClosingTransactionResponse, | ||
CreateDlcTransactionsRequest, CreateDlcTransactionsResponse, | ||
CreateFundTransactionRequest, CreateFundTransactionResponse, | ||
CreateMutualClosingTransactionRequest, CreateMutualClosingTransactionResponse, | ||
CreatePenaltyTransactionRequest, CreatePenaltyTransactionResponse, | ||
CreateRefundTransactionRequest, CreateRefundTransactionResponse, | ||
GetRawCetSignatureRequest, GetRawCetSignatureResponse, | ||
GetRawCetSignaturesRequest, GetRawCetSignaturesResponse, | ||
GetRawFundTxSignatureRequest, GetRawFundTxSignatureResponse, | ||
GetRawMutualClosingTxSignatureRequest, GetRawMutualClosingTxSignatureResponse, | ||
GetRawRefundTxSignatureRequest, GetRawRefundTxSignatureResponse, | ||
GetSchnorrPublicNonceRequest, GetSchnorrPublicNonceResponse, | ||
SchnorrSignRequest, SchnorrSignResponse, | ||
SignClosingTransactionRequest, SignClosingTransactionResponse, | ||
SignFundTransactionRequest, SignFundTransactionResponse, | ||
VerifyCetSignatureRequest, VerifyCetSignatureResponse, | ||
VerifyCetSignaturesRequest, VerifyCetSignaturesResponse, | ||
VerifyFundTxSignatureRequest, VerifyFundTxSignatureResponse, | ||
VerifyMutualClosingTxSignatureRequest, VerifyMutualClosingTxSignatureResponse, | ||
VerifyRefundTxSignatureRequest, VerifyRefundTxSignatureResponse | ||
} from 'cfd-dlc-js-wasm' | ||
AddSignatureToFundTransactionRequest, | ||
AddSignatureToFundTransactionResponse, | ||
AddSignaturesToCetRequest, | ||
AddSignaturesToCetResponse, | ||
AddSignaturesToMutualClosingTxRequest, | ||
AddSignaturesToMutualClosingTxResponse, | ||
AddSignaturesToRefundTxRequest, | ||
AddSignaturesToRefundTxResponse, | ||
CreateCetRequest, | ||
CreateCetResponse, | ||
CreateClosingTransactionRequest, | ||
CreateClosingTransactionResponse, | ||
CreateDlcTransactionsRequest, | ||
CreateDlcTransactionsResponse, | ||
CreateFundTransactionRequest, | ||
CreateFundTransactionResponse, | ||
CreateMutualClosingTransactionRequest, | ||
CreateMutualClosingTransactionResponse, | ||
CreatePenaltyTransactionRequest, | ||
CreatePenaltyTransactionResponse, | ||
CreateRefundTransactionRequest, | ||
CreateRefundTransactionResponse, | ||
GetRawCetSignatureRequest, | ||
GetRawCetSignatureResponse, | ||
GetRawCetSignaturesRequest, | ||
GetRawCetSignaturesResponse, | ||
GetRawFundTxSignatureRequest, | ||
GetRawFundTxSignatureResponse, | ||
GetRawMutualClosingTxSignatureRequest, | ||
GetRawMutualClosingTxSignatureResponse, | ||
GetRawRefundTxSignatureRequest, | ||
GetRawRefundTxSignatureResponse, | ||
GetSchnorrPublicNonceRequest, | ||
GetSchnorrPublicNonceResponse, | ||
SchnorrSignRequest, | ||
SchnorrSignResponse, | ||
SignClosingTransactionRequest, | ||
SignClosingTransactionResponse, | ||
SignFundTransactionRequest, | ||
SignFundTransactionResponse, | ||
VerifyCetSignatureRequest, | ||
VerifyCetSignatureResponse, | ||
VerifyCetSignaturesRequest, | ||
VerifyCetSignaturesResponse, | ||
VerifyFundTxSignatureRequest, | ||
VerifyFundTxSignatureResponse, | ||
VerifyMutualClosingTxSignatureRequest, | ||
VerifyMutualClosingTxSignatureResponse, | ||
VerifyRefundTxSignatureRequest, | ||
VerifyRefundTxSignatureResponse, | ||
} from 'cfd-dlc-js-wasm'; | ||
import { InputDetails, OutcomeDetails, OracleInfo, OfferMessage, AcceptMessage, SignMessage, Contract } from '@atomicfinance/bitcoin-dlc-provider' | ||
import { | ||
Input, | ||
InputDetails, | ||
OutcomeDetails, | ||
OracleInfo, | ||
OfferMessage, | ||
AcceptMessage, | ||
SignMessage, | ||
Contract, | ||
} from '@atomicfinance/bitcoin-dlc-provider'; | ||
@@ -35,145 +69,257 @@ export default class Dlc { | ||
constructor (client?: Client) { | ||
this.client = client | ||
constructor(client?: Client) { | ||
this.client = client; | ||
} | ||
async initializeContractAndOffer (input: InputDetails, outcomes: Array<OutcomeDetails>, oracleInfo: OracleInfo, startingIndex: number = 0): Promise<OfferMessage> { | ||
return this.client.getMethod('initializeContractAndOffer')(input, outcomes, oracleInfo, startingIndex) | ||
async initializeContractAndOffer( | ||
input: InputDetails, | ||
outcomes: Array<OutcomeDetails>, | ||
oracleInfo: OracleInfo, | ||
startingIndex: number = 0, | ||
fixedInputs: Input[] = [] | ||
): Promise<OfferMessage> { | ||
return this.client.getMethod('initializeContractAndOffer')( | ||
input, | ||
outcomes, | ||
oracleInfo, | ||
startingIndex, | ||
fixedInputs | ||
); | ||
} | ||
async confirmContractOffer (offerMessage: OfferMessage, startingIndex: number = 0): Promise<AcceptMessage> { | ||
return this.client.getMethod('confirmContractOffer')(offerMessage, startingIndex) | ||
async confirmContractOffer( | ||
offerMessage: OfferMessage, | ||
startingIndex: number = 0, | ||
fixedInputs: Input[] = [] | ||
): Promise<AcceptMessage> { | ||
return this.client.getMethod('confirmContractOffer')( | ||
offerMessage, | ||
startingIndex, | ||
fixedInputs | ||
); | ||
} | ||
async signContract (acceptMessage: AcceptMessage): Promise<SignMessage> { | ||
return this.client.getMethod('signContract')(acceptMessage) | ||
async signContract(acceptMessage: AcceptMessage): Promise<SignMessage> { | ||
return this.client.getMethod('signContract')(acceptMessage); | ||
} | ||
async finalizeContract (signMessage: SignMessage): Promise<string> { | ||
return this.client.getMethod('finalizeContract')(signMessage) | ||
async finalizeContract(signMessage: SignMessage): Promise<string> { | ||
return this.client.getMethod('finalizeContract')(signMessage); | ||
} | ||
async unilateralClose (oracleSignature: string, outcomeIndex: number, contractId: string): Promise<string[]> { | ||
return this.client.getMethod('unilateralClose')(oracleSignature, outcomeIndex, contractId) | ||
async unilateralClose( | ||
oracleSignature: string, | ||
outcomeIndex: number, | ||
contractId: string | ||
): Promise<string[]> { | ||
return this.client.getMethod('unilateralClose')( | ||
oracleSignature, | ||
outcomeIndex, | ||
contractId | ||
); | ||
} | ||
async buildUnilateralClose (oracleSignature: string, outcomeIndex: number, contractId: string): Promise<string[]> { | ||
return this.client.getMethod('buildUnilateralClose')(oracleSignature, outcomeIndex, contractId) | ||
async buildUnilateralClose( | ||
oracleSignature: string, | ||
outcomeIndex: number, | ||
contractId: string | ||
): Promise<string[]> { | ||
return this.client.getMethod('buildUnilateralClose')( | ||
oracleSignature, | ||
outcomeIndex, | ||
contractId | ||
); | ||
} | ||
hasDlc (contractId: string): boolean { | ||
return this.client.getMethod('hasDlc')(contractId) | ||
async getFundingUtxoAddressesForOfferMessages (offerMessages: OfferMessage[]) { | ||
return this.client.getMethod('getFundingUtxoAddressesForOfferMessages')(offerMessages) | ||
} | ||
async importContract (contract: Contract) { | ||
return this.client.getMethod('importContract')(contract) | ||
async getFundingUtxoAddressesForAcceptMessages (acceptMessages: AcceptMessage[]) { | ||
return this.client.getMethod('getFundingUtxoAddressesForAcceptMessages')(acceptMessages) | ||
} | ||
exportContract (contractId: string): Contract { | ||
return this.client.getMethod('exportContract')(contractId) | ||
hasDlc(contractId: string): boolean { | ||
return this.client.getMethod('hasDlc')(contractId); | ||
} | ||
exportContracts (): Contract[] { | ||
return this.client.getMethod('exportContracts')() | ||
async importContract(contract: Contract, startingIndex: number) { | ||
return this.client.getMethod('importContract')(contract, startingIndex); | ||
} | ||
async AddSignatureToFundTransaction(jsonObject: AddSignatureToFundTransactionRequest): Promise<AddSignatureToFundTransactionResponse> { | ||
return this.client.getMethod('AddSignatureToFundTransaction')(jsonObject) | ||
exportContract(contractId: string): Contract { | ||
return this.client.getMethod('exportContract')(contractId); | ||
} | ||
async AddSignaturesToCet(jsonObject: AddSignaturesToCetRequest): Promise<AddSignaturesToCetResponse> { | ||
return this.client.getMethod('AddSignaturesToCet')(jsonObject) | ||
exportContracts(): Contract[] { | ||
return this.client.getMethod('exportContracts')(); | ||
} | ||
async AddSignaturesToMutualClosingTx(jsonObject: AddSignaturesToMutualClosingTxRequest): Promise<AddSignaturesToMutualClosingTxResponse> { | ||
return this.client.getMethod('AddSignaturesToMutualClosingTx')(jsonObject) | ||
deleteContract (contractId: string) { | ||
return this.client.getMethod('deleteContract')(contractId) | ||
} | ||
async AddSignaturesToRefundTx(jsonObject: AddSignaturesToRefundTxRequest): Promise<AddSignaturesToRefundTxResponse> { | ||
return this.client.getMethod('AddSignaturesToRefundTx')(jsonObject) | ||
async importContractFromOfferMessage (offerMessage: OfferMessage, startingIndex: number) { | ||
return this.client.getMethod('importContractFromOfferMessage')(offerMessage, startingIndex) | ||
} | ||
async importContractFromAcceptMessage (offerMessage: OfferMessage, acceptMessage: AcceptMessage, startingIndex: number) { | ||
return this.client.getMethod('importContractFromAcceptMessage')(offerMessage, acceptMessage, startingIndex) | ||
} | ||
async importContractFromAcceptAndSignMessage (offerMessage: OfferMessage, acceptMessage: AcceptMessage, signMessage: SignMessage, startingIndex: number) { | ||
return this.client.getMethod('importContractFromAcceptAndSignMessage')(offerMessage, acceptMessage, signMessage, startingIndex) | ||
} | ||
async importContractFromSignMessage (offerMessage: OfferMessage, signMessage: SignMessage, startingIndex: number) { | ||
return this.client.getMethod('importContractFromSignMessage')(offerMessage, signMessage, startingIndex) | ||
} | ||
async AddSignatureToFundTransaction( | ||
jsonObject: AddSignatureToFundTransactionRequest | ||
): Promise<AddSignatureToFundTransactionResponse> { | ||
return this.client.getMethod('AddSignatureToFundTransaction')(jsonObject); | ||
} | ||
async AddSignaturesToCet( | ||
jsonObject: AddSignaturesToCetRequest | ||
): Promise<AddSignaturesToCetResponse> { | ||
return this.client.getMethod('AddSignaturesToCet')(jsonObject); | ||
} | ||
async AddSignaturesToMutualClosingTx( | ||
jsonObject: AddSignaturesToMutualClosingTxRequest | ||
): Promise<AddSignaturesToMutualClosingTxResponse> { | ||
return this.client.getMethod('AddSignaturesToMutualClosingTx')(jsonObject); | ||
} | ||
async AddSignaturesToRefundTx( | ||
jsonObject: AddSignaturesToRefundTxRequest | ||
): Promise<AddSignaturesToRefundTxResponse> { | ||
return this.client.getMethod('AddSignaturesToRefundTx')(jsonObject); | ||
} | ||
async CreateCet(jsonObject: CreateCetRequest): Promise<CreateCetResponse> { | ||
return this.client.getMethod('CreateCet')(jsonObject) | ||
return this.client.getMethod('CreateCet')(jsonObject); | ||
} | ||
async CreateClosingTransaction(jsonObject: CreateClosingTransactionRequest): Promise<CreateClosingTransactionResponse> { | ||
return this.client.getMethod('CreateClosingTransaction')(jsonObject) | ||
async CreateClosingTransaction( | ||
jsonObject: CreateClosingTransactionRequest | ||
): Promise<CreateClosingTransactionResponse> { | ||
return this.client.getMethod('CreateClosingTransaction')(jsonObject); | ||
} | ||
async CreateDlcTransactions(jsonObject: CreateDlcTransactionsRequest): Promise<CreateDlcTransactionsResponse> { | ||
return this.client.getMethod('CreateDlcTransactions')(jsonObject) | ||
async CreateDlcTransactions( | ||
jsonObject: CreateDlcTransactionsRequest | ||
): Promise<CreateDlcTransactionsResponse> { | ||
return this.client.getMethod('CreateDlcTransactions')(jsonObject); | ||
} | ||
async CreateFundTransaction(jsonObject: CreateFundTransactionRequest): Promise<CreateFundTransactionResponse> { | ||
return this.client.getMethod('CreateFundTransaction')(jsonObject) | ||
async CreateFundTransaction( | ||
jsonObject: CreateFundTransactionRequest | ||
): Promise<CreateFundTransactionResponse> { | ||
return this.client.getMethod('CreateFundTransaction')(jsonObject); | ||
} | ||
async CreateMutualClosingTransaction(jsonObject: CreateMutualClosingTransactionRequest): Promise<CreateMutualClosingTransactionResponse> { | ||
return this.client.getMethod('CreateMutualClosingTransaction')(jsonObject) | ||
async CreateMutualClosingTransaction( | ||
jsonObject: CreateMutualClosingTransactionRequest | ||
): Promise<CreateMutualClosingTransactionResponse> { | ||
return this.client.getMethod('CreateMutualClosingTransaction')(jsonObject); | ||
} | ||
async CreatePenaltyTransaction(jsonObject: CreatePenaltyTransactionRequest): Promise<CreatePenaltyTransactionResponse> { | ||
return this.client.getMethod('CreatePenaltyTransaction')(jsonObject) | ||
async CreatePenaltyTransaction( | ||
jsonObject: CreatePenaltyTransactionRequest | ||
): Promise<CreatePenaltyTransactionResponse> { | ||
return this.client.getMethod('CreatePenaltyTransaction')(jsonObject); | ||
} | ||
async CreateRefundTransaction(jsonObject: CreateRefundTransactionRequest): Promise<CreateRefundTransactionResponse> { | ||
return this.client.getMethod('CreateRefundTransaction')(jsonObject) | ||
async CreateRefundTransaction( | ||
jsonObject: CreateRefundTransactionRequest | ||
): Promise<CreateRefundTransactionResponse> { | ||
return this.client.getMethod('CreateRefundTransaction')(jsonObject); | ||
} | ||
async GetRawCetSignature(jsonObject: GetRawCetSignatureRequest): Promise<GetRawCetSignatureResponse> { | ||
return this.client.getMethod('GetRawCetSignature')(jsonObject) | ||
async GetRawCetSignature( | ||
jsonObject: GetRawCetSignatureRequest | ||
): Promise<GetRawCetSignatureResponse> { | ||
return this.client.getMethod('GetRawCetSignature')(jsonObject); | ||
} | ||
async GetRawCetSignatures(jsonObject: GetRawCetSignaturesRequest): Promise<GetRawCetSignaturesResponse> { | ||
return this.client.getMethod('GetRawCetSignatures')(jsonObject) | ||
async GetRawCetSignatures( | ||
jsonObject: GetRawCetSignaturesRequest | ||
): Promise<GetRawCetSignaturesResponse> { | ||
return this.client.getMethod('GetRawCetSignatures')(jsonObject); | ||
} | ||
async GetRawFundTxSignature(jsonObject: GetRawFundTxSignatureRequest): Promise<GetRawFundTxSignatureResponse> { | ||
return this.client.getMethod('GetRawFundTxSignature')(jsonObject) | ||
async GetRawFundTxSignature( | ||
jsonObject: GetRawFundTxSignatureRequest | ||
): Promise<GetRawFundTxSignatureResponse> { | ||
return this.client.getMethod('GetRawFundTxSignature')(jsonObject); | ||
} | ||
async GetRawMutualClosingTxSignature(jsonObject: GetRawMutualClosingTxSignatureRequest): Promise<GetRawMutualClosingTxSignatureResponse> { | ||
return this.client.getMethod('GetRawMutualClosingTxSignature')(jsonObject) | ||
async GetRawMutualClosingTxSignature( | ||
jsonObject: GetRawMutualClosingTxSignatureRequest | ||
): Promise<GetRawMutualClosingTxSignatureResponse> { | ||
return this.client.getMethod('GetRawMutualClosingTxSignature')(jsonObject); | ||
} | ||
async GetRawRefundTxSignature(jsonObject: GetRawRefundTxSignatureRequest): Promise<GetRawRefundTxSignatureResponse> { | ||
return this.client.getMethod('GetRawRefundTxSignature')(jsonObject) | ||
async GetRawRefundTxSignature( | ||
jsonObject: GetRawRefundTxSignatureRequest | ||
): Promise<GetRawRefundTxSignatureResponse> { | ||
return this.client.getMethod('GetRawRefundTxSignature')(jsonObject); | ||
} | ||
async GetSchnorrPublicNonce(jsonObject: GetSchnorrPublicNonceRequest): Promise<GetSchnorrPublicNonceResponse> { | ||
return this.client.getMethod('GetSchnorrPublicNonce')(jsonObject) | ||
async GetSchnorrPublicNonce( | ||
jsonObject: GetSchnorrPublicNonceRequest | ||
): Promise<GetSchnorrPublicNonceResponse> { | ||
return this.client.getMethod('GetSchnorrPublicNonce')(jsonObject); | ||
} | ||
async SchnorrSign(jsonObject: SchnorrSignRequest): Promise<SchnorrSignResponse> { | ||
return this.client.getMethod('SchnorrSign')(jsonObject) | ||
async SchnorrSign( | ||
jsonObject: SchnorrSignRequest | ||
): Promise<SchnorrSignResponse> { | ||
return this.client.getMethod('SchnorrSign')(jsonObject); | ||
} | ||
async SignClosingTransaction(jsonObject: SignClosingTransactionRequest): Promise<SignClosingTransactionResponse> { | ||
return this.client.getMethod('SignClosingTransaction')(jsonObject) | ||
async SignClosingTransaction( | ||
jsonObject: SignClosingTransactionRequest | ||
): Promise<SignClosingTransactionResponse> { | ||
return this.client.getMethod('SignClosingTransaction')(jsonObject); | ||
} | ||
async SignFundTransaction(jsonObject: SignFundTransactionRequest): Promise<SignFundTransactionResponse> { | ||
return this.client.getMethod('SignFundTransaction')(jsonObject) | ||
async SignFundTransaction( | ||
jsonObject: SignFundTransactionRequest | ||
): Promise<SignFundTransactionResponse> { | ||
return this.client.getMethod('SignFundTransaction')(jsonObject); | ||
} | ||
async VerifyCetSignature(jsonObject: VerifyCetSignatureRequest): Promise<VerifyCetSignatureResponse> { | ||
return this.client.getMethod('VerifyCetSignature')(jsonObject) | ||
async VerifyCetSignature( | ||
jsonObject: VerifyCetSignatureRequest | ||
): Promise<VerifyCetSignatureResponse> { | ||
return this.client.getMethod('VerifyCetSignature')(jsonObject); | ||
} | ||
async VerifyCetSignatures(jsonObject: VerifyCetSignaturesRequest): Promise<VerifyCetSignaturesResponse> { | ||
return this.client.getMethod('VerifyCetSignatures')(jsonObject) | ||
async VerifyCetSignatures( | ||
jsonObject: VerifyCetSignaturesRequest | ||
): Promise<VerifyCetSignaturesResponse> { | ||
return this.client.getMethod('VerifyCetSignatures')(jsonObject); | ||
} | ||
async VerifyFundTxSignature(jsonObject: VerifyFundTxSignatureRequest): Promise<VerifyFundTxSignatureResponse> { | ||
return this.client.getMethod('VerifyFundTxSignature')(jsonObject) | ||
async VerifyFundTxSignature( | ||
jsonObject: VerifyFundTxSignatureRequest | ||
): Promise<VerifyFundTxSignatureResponse> { | ||
return this.client.getMethod('VerifyFundTxSignature')(jsonObject); | ||
} | ||
async VerifyMutualClosingTxSignature(jsonObject: VerifyMutualClosingTxSignatureRequest): Promise<VerifyMutualClosingTxSignatureResponse> { | ||
return this.client.getMethod('VerifyMutualClosingTxSignature')(jsonObject) | ||
async VerifyMutualClosingTxSignature( | ||
jsonObject: VerifyMutualClosingTxSignatureRequest | ||
): Promise<VerifyMutualClosingTxSignatureResponse> { | ||
return this.client.getMethod('VerifyMutualClosingTxSignature')(jsonObject); | ||
} | ||
async VerifyRefundTxSignature(jsonObject: VerifyRefundTxSignatureRequest): Promise<VerifyRefundTxSignatureResponse> { | ||
return this.client.getMethod('VerifyRefundTxSignature')(jsonObject) | ||
async VerifyRefundTxSignature( | ||
jsonObject: VerifyRefundTxSignatureRequest | ||
): Promise<VerifyRefundTxSignatureResponse> { | ||
return this.client.getMethod('VerifyRefundTxSignature')(jsonObject); | ||
} | ||
} |
/// <reference path="Client.d.ts" /> | ||
import Client from './Client' | ||
import Client from './Client'; | ||
export default Client | ||
export default Client; |
@@ -1,2 +0,2 @@ | ||
import Client from './Client' | ||
import Client from './Client'; | ||
@@ -6,12 +6,32 @@ export default class Dlc { | ||
constructor (client?: Client) { | ||
this.client = client | ||
constructor(client?: Client) { | ||
this.client = client; | ||
} | ||
async buildSweepTransaction (externalChangeAddress: string, feePerByte: number, outputs: Output[], fixedInputs: Input[]) { | ||
return this.client.getMethod('buildSweepTransaction')(externalChangeAddress, feePerByte, outputs, fixedInputs) | ||
async buildSweepTransaction( | ||
externalChangeAddress: string, | ||
feePerByte: number, | ||
outputs: Output[], | ||
fixedInputs: Input[] | ||
) { | ||
return this.client.getMethod('buildSweepTransaction')( | ||
externalChangeAddress, | ||
feePerByte, | ||
outputs, | ||
fixedInputs | ||
); | ||
} | ||
async sendSweepTransaction (externalChangeAddress: string, feePerByte: number, outputs: Output[], fixedInputs: Input[]) { | ||
return this.client.getMethod('sendSweepTransaction')(externalChangeAddress, feePerByte, outputs, fixedInputs) | ||
async sendSweepTransaction( | ||
externalChangeAddress: string, | ||
feePerByte: number, | ||
outputs: Output[], | ||
fixedInputs: Input[] | ||
) { | ||
return this.client.getMethod('sendSweepTransaction')( | ||
externalChangeAddress, | ||
feePerByte, | ||
outputs, | ||
fixedInputs | ||
); | ||
} | ||
@@ -21,20 +41,20 @@ } | ||
interface Input { | ||
txid: string, | ||
vout: number, | ||
address: string, | ||
label: string, | ||
scriptPubKey: string, | ||
amount: number, | ||
confirmations: number, | ||
spendable: boolean, | ||
solvable: boolean, | ||
safe: boolean, | ||
satoshis: number, | ||
value: number, | ||
derivationPath: string | ||
txid: string; | ||
vout: number; | ||
address: string; | ||
label: string; | ||
scriptPubKey: string; | ||
amount: number; | ||
confirmations: number; | ||
spendable: boolean; | ||
solvable: boolean; | ||
safe: boolean; | ||
satoshis: number; | ||
value: number; | ||
derivationPath: string; | ||
} | ||
interface Output { | ||
to: string, | ||
value: number | ||
to: string; | ||
value: number; | ||
} |
{ | ||
"name": "@atomicfinance/client", | ||
"umdName": "Client", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "> TODO: description", | ||
@@ -21,4 +21,4 @@ "author": "Matthew Black <mblackmblackmblack@gmail.com>", | ||
"@liquality/errors": "^0.7.1", | ||
"cfd-dlc-js-wasm": "github:zpv/cfd-dlc-js-wasm", | ||
"cfd-js-wasm": "github:p2pderivatives/cfd-js-wasm#semver:^0.1.3", | ||
"cfd-dlc-js-wasm": "github:zpv/cfd-dlc-js-wasm#v1.0.0", | ||
"cfd-js-wasm": "github:p2pderivatives/cfd-js-wasm#semver:^0.1.6", | ||
"lodash": "^4.17.20" | ||
@@ -32,3 +32,3 @@ }, | ||
}, | ||
"gitHead": "68ced19507a8a68eca06a70d69e15dda838f9844" | ||
"gitHead": "21e1a3058c3acf93669ba73e438a4b0d45777ade" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 2 instances in 1 package
5095
3051825