@bsv/sdk 2.0.9 → 2.0.10
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/dist/cjs/package.json +1 -1
- package/dist/cjs/src/auth/certificates/Certificate.js +1 -1
- package/dist/cjs/src/auth/certificates/Certificate.js.map +1 -1
- package/dist/cjs/src/primitives/BigNumber.js +4 -5
- package/dist/cjs/src/primitives/BigNumber.js.map +1 -1
- package/dist/cjs/src/script/OP.js +22 -16
- package/dist/cjs/src/script/OP.js.map +1 -1
- package/dist/cjs/src/script/Spend.js +21 -78
- package/dist/cjs/src/script/Spend.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/auth/certificates/Certificate.js +1 -1
- package/dist/esm/src/auth/certificates/Certificate.js.map +1 -1
- package/dist/esm/src/primitives/BigNumber.js +4 -5
- package/dist/esm/src/primitives/BigNumber.js.map +1 -1
- package/dist/esm/src/script/OP.js +22 -16
- package/dist/esm/src/script/OP.js.map +1 -1
- package/dist/esm/src/script/Spend.js +21 -78
- package/dist/esm/src/script/Spend.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/primitives/BigNumber.d.ts.map +1 -1
- package/dist/types/src/script/OP.d.ts +9 -7
- package/dist/types/src/script/OP.d.ts.map +1 -1
- package/dist/types/src/script/Spend.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +3 -3
- package/dist/umd/bundle.js.map +1 -1
- package/docs/reference/script.md +76 -0
- package/docs/reference/transaction.md +63 -6
- package/docs/reference/wallet.md +285 -1094
- package/package.json +1 -1
- package/src/auth/certificates/Certificate.ts +1 -1
- package/src/primitives/BigNumber.ts +4 -5
- package/src/primitives/__tests/BigNumber.constructor.test.ts +3 -3
- package/src/script/OP.ts +21 -16
- package/src/script/Spend.ts +21 -28
- package/src/script/__tests/Chronicle.test.ts +39 -103
- package/src/script/__tests/ChronicleOpcodes.test.ts +548 -0
package/docs/reference/wallet.md
CHANGED
|
@@ -2198,14 +2198,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
2198
2198
|
|
|
2199
2199
|
| | |
|
|
2200
2200
|
| --- | --- |
|
|
2201
|
-
| [CachedKeyDeriver](#class-cachedkeyderiver) | [
|
|
2202
|
-
| [HTTPWalletJSON](#class-httpwalletjson) | [
|
|
2203
|
-
| [HTTPWalletWire](#class-httpwalletwire) | [
|
|
2201
|
+
| [CachedKeyDeriver](#class-cachedkeyderiver) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
|
|
2202
|
+
| [HTTPWalletJSON](#class-httpwalletjson) | [WERR_REVIEW_ACTIONS](#class-werr_review_actions) |
|
|
2203
|
+
| [HTTPWalletWire](#class-httpwalletwire) | [WalletClient](#class-walletclient) |
|
|
2204
|
+
| [InvokableWalletBase](#class-invokablewalletbase) | [WalletError](#class-walleterror) |
|
|
2204
2205
|
| [KeyDeriver](#class-keyderiver) | [WalletWireProcessor](#class-walletwireprocessor) |
|
|
2205
2206
|
| [ProtoWallet](#class-protowallet) | [WalletWireTransceiver](#class-walletwiretransceiver) |
|
|
2206
2207
|
| [ReactNativeWebView](#class-reactnativewebview) | [WindowCWISubstrate](#class-windowcwisubstrate) |
|
|
2207
2208
|
| [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) | [XDMSubstrate](#class-xdmsubstrate) |
|
|
2208
|
-
| [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) | |
|
|
2209
2209
|
|
|
2210
2210
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2211
2211
|
|
|
@@ -2633,6 +2633,53 @@ See also: [WalletWire](./wallet.md#interface-walletwire)
|
|
|
2633
2633
|
|
|
2634
2634
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2635
2635
|
|
|
2636
|
+
---
|
|
2637
|
+
### Class: InvokableWalletBase
|
|
2638
|
+
|
|
2639
|
+
Abstract base class for WalletInterface substrates that delegate all
|
|
2640
|
+
wallet method calls through an `invoke` transport mechanism.
|
|
2641
|
+
|
|
2642
|
+
Subclasses only need to implement the `invoke` method to provide
|
|
2643
|
+
the specific transport (e.g. XDM postMessage, ReactNative bridge).
|
|
2644
|
+
|
|
2645
|
+
```ts
|
|
2646
|
+
export abstract class InvokableWalletBase implements WalletInterface {
|
|
2647
|
+
abstract invoke(call: CallType, args: any): Promise<any>;
|
|
2648
|
+
async createAction(args: CreateActionArgs): Promise<CreateActionResult>
|
|
2649
|
+
async signAction(args: SignActionArgs): Promise<SignActionResult>
|
|
2650
|
+
async abortAction(args: AbortActionArgs): Promise<AbortActionResult>
|
|
2651
|
+
async listActions(args: ListActionsArgs): Promise<ListActionsResult>
|
|
2652
|
+
async internalizeAction(args: InternalizeActionArgs): Promise<InternalizeActionResult>
|
|
2653
|
+
async listOutputs(args: ListOutputsArgs): Promise<ListOutputsResult>
|
|
2654
|
+
async relinquishOutput(args: RelinquishOutputArgs): Promise<RelinquishOutputResult>
|
|
2655
|
+
async getPublicKey(args: GetPublicKeyArgs): Promise<GetPublicKeyResult>
|
|
2656
|
+
async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs): Promise<RevealCounterpartyKeyLinkageResult>
|
|
2657
|
+
async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs): Promise<RevealSpecificKeyLinkageResult>
|
|
2658
|
+
async encrypt(args: WalletEncryptArgs): Promise<WalletEncryptResult>
|
|
2659
|
+
async decrypt(args: WalletDecryptArgs): Promise<WalletDecryptResult>
|
|
2660
|
+
async createHmac(args: CreateHmacArgs): Promise<CreateHmacResult>
|
|
2661
|
+
async verifyHmac(args: VerifyHmacArgs): Promise<VerifyHmacResult>
|
|
2662
|
+
async createSignature(args: CreateSignatureArgs): Promise<CreateSignatureResult>
|
|
2663
|
+
async verifySignature(args: VerifySignatureArgs): Promise<VerifySignatureResult>
|
|
2664
|
+
async acquireCertificate(args: AcquireCertificateArgs): Promise<AcquireCertificateResult>
|
|
2665
|
+
async listCertificates(args: ListCertificatesArgs): Promise<ListCertificatesResult>
|
|
2666
|
+
async proveCertificate(args: ProveCertificateArgs): Promise<ProveCertificateResult>
|
|
2667
|
+
async relinquishCertificate(args: RelinquishCertificateArgs): Promise<RelinquishCertificateResult>
|
|
2668
|
+
async discoverByIdentityKey(args: DiscoverByIdentityKeyArgs): Promise<DiscoverCertificatesResult>
|
|
2669
|
+
async discoverByAttributes(args: DiscoverByAttributesArgs): Promise<DiscoverCertificatesResult>
|
|
2670
|
+
async isAuthenticated(args: {}): Promise<AuthenticatedResult>
|
|
2671
|
+
async waitForAuthentication(args: {}): Promise<AuthenticatedResult>
|
|
2672
|
+
async getHeight(args: {}): Promise<GetHeightResult>
|
|
2673
|
+
async getHeaderForHeight(args: GetHeaderArgs): Promise<GetHeaderResult>
|
|
2674
|
+
async getNetwork(args: {}): Promise<GetNetworkResult>
|
|
2675
|
+
async getVersion(args: {}): Promise<GetVersionResult>
|
|
2676
|
+
}
|
|
2677
|
+
```
|
|
2678
|
+
|
|
2679
|
+
See also: [AbortActionArgs](./wallet.md#interface-abortactionargs), [AbortActionResult](./wallet.md#interface-abortactionresult), [AcquireCertificateArgs](./wallet.md#interface-acquirecertificateargs), [AcquireCertificateResult](./wallet.md#type-acquirecertificateresult), [AuthenticatedResult](./wallet.md#interface-authenticatedresult), [CallType](./wallet.md#type-calltype), [CreateActionArgs](./wallet.md#interface-createactionargs), [CreateActionResult](./wallet.md#interface-createactionresult), [CreateHmacArgs](./wallet.md#interface-createhmacargs), [CreateHmacResult](./wallet.md#interface-createhmacresult), [CreateSignatureArgs](./wallet.md#interface-createsignatureargs), [CreateSignatureResult](./wallet.md#interface-createsignatureresult), [DiscoverByAttributesArgs](./wallet.md#interface-discoverbyattributesargs), [DiscoverByIdentityKeyArgs](./wallet.md#interface-discoverbyidentitykeyargs), [DiscoverCertificatesResult](./wallet.md#interface-discovercertificatesresult), [GetHeaderArgs](./wallet.md#interface-getheaderargs), [GetHeaderResult](./wallet.md#interface-getheaderresult), [GetHeightResult](./wallet.md#interface-getheightresult), [GetNetworkResult](./wallet.md#interface-getnetworkresult), [GetPublicKeyArgs](./wallet.md#interface-getpublickeyargs), [GetPublicKeyResult](./wallet.md#interface-getpublickeyresult), [GetVersionResult](./wallet.md#interface-getversionresult), [InternalizeActionArgs](./wallet.md#interface-internalizeactionargs), [InternalizeActionResult](./wallet.md#interface-internalizeactionresult), [ListActionsArgs](./wallet.md#interface-listactionsargs), [ListActionsResult](./wallet.md#interface-listactionsresult), [ListCertificatesArgs](./wallet.md#interface-listcertificatesargs), [ListCertificatesResult](./wallet.md#interface-listcertificatesresult), [ListOutputsArgs](./wallet.md#interface-listoutputsargs), [ListOutputsResult](./wallet.md#interface-listoutputsresult), [ProveCertificateArgs](./wallet.md#interface-provecertificateargs), [ProveCertificateResult](./wallet.md#interface-provecertificateresult), [RelinquishCertificateArgs](./wallet.md#interface-relinquishcertificateargs), [RelinquishCertificateResult](./wallet.md#interface-relinquishcertificateresult), [RelinquishOutputArgs](./wallet.md#interface-relinquishoutputargs), [RelinquishOutputResult](./wallet.md#interface-relinquishoutputresult), [RevealCounterpartyKeyLinkageArgs](./wallet.md#interface-revealcounterpartykeylinkageargs), [RevealCounterpartyKeyLinkageResult](./wallet.md#interface-revealcounterpartykeylinkageresult), [RevealSpecificKeyLinkageArgs](./wallet.md#interface-revealspecifickeylinkageargs), [RevealSpecificKeyLinkageResult](./wallet.md#interface-revealspecifickeylinkageresult), [SignActionArgs](./wallet.md#interface-signactionargs), [SignActionResult](./wallet.md#interface-signactionresult), [VerifyHmacArgs](./wallet.md#interface-verifyhmacargs), [VerifyHmacResult](./wallet.md#interface-verifyhmacresult), [VerifySignatureArgs](./wallet.md#interface-verifysignatureargs), [VerifySignatureResult](./wallet.md#interface-verifysignatureresult), [WalletDecryptArgs](./wallet.md#interface-walletdecryptargs), [WalletDecryptResult](./wallet.md#interface-walletdecryptresult), [WalletEncryptArgs](./wallet.md#interface-walletencryptargs), [WalletEncryptResult](./wallet.md#interface-walletencryptresult), [WalletInterface](./wallet.md#interface-walletinterface), [decrypt](./messages.md#variable-decrypt), [encrypt](./messages.md#variable-encrypt)
|
|
2680
|
+
|
|
2681
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2682
|
+
|
|
2636
2683
|
---
|
|
2637
2684
|
### Class: KeyDeriver
|
|
2638
2685
|
|
|
@@ -2821,167 +2868,118 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
2821
2868
|
Facilitates wallet operations over cross-document messaging.
|
|
2822
2869
|
|
|
2823
2870
|
```ts
|
|
2824
|
-
export default class ReactNativeWebView
|
|
2871
|
+
export default class ReactNativeWebView extends InvokableWalletBase {
|
|
2825
2872
|
constructor(domain: string = "*")
|
|
2826
2873
|
async invoke(call: CallType, args: any): Promise<any>
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2874
|
+
}
|
|
2875
|
+
```
|
|
2876
|
+
|
|
2877
|
+
See also: [CallType](./wallet.md#type-calltype), [InvokableWalletBase](./wallet.md#class-invokablewalletbase)
|
|
2878
|
+
|
|
2879
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2880
|
+
|
|
2881
|
+
---
|
|
2882
|
+
### Class: WERR_INSUFFICIENT_FUNDS
|
|
2883
|
+
|
|
2884
|
+
Insufficient funds in the available inputs to cover the cost of the required outputs
|
|
2885
|
+
and the transaction fee (${moreSatoshisNeeded} more satoshis are needed,
|
|
2886
|
+
for a total of ${totalSatoshisNeeded}), plus whatever would be required in order
|
|
2887
|
+
to pay the fee to unlock and spend the outputs used to provide the additional satoshis.
|
|
2888
|
+
|
|
2889
|
+
```ts
|
|
2890
|
+
export class WERR_INSUFFICIENT_FUNDS extends Error {
|
|
2891
|
+
code: number;
|
|
2892
|
+
isError: boolean = true;
|
|
2893
|
+
constructor(public totalSatoshisNeeded: number, public moreSatoshisNeeded: number)
|
|
2894
|
+
}
|
|
2895
|
+
```
|
|
2896
|
+
|
|
2897
|
+
#### Constructor
|
|
2898
|
+
|
|
2899
|
+
```ts
|
|
2900
|
+
constructor(public totalSatoshisNeeded: number, public moreSatoshisNeeded: number)
|
|
2901
|
+
```
|
|
2902
|
+
|
|
2903
|
+
Argument Details
|
|
2904
|
+
|
|
2905
|
+
+ **totalSatoshisNeeded**
|
|
2906
|
+
+ Total satoshis required to fund transactions after net of required inputs and outputs.
|
|
2907
|
+
+ **moreSatoshisNeeded**
|
|
2908
|
+
+ Shortfall on total satoshis required to fund transactions after net of required inputs and outputs.
|
|
2909
|
+
|
|
2910
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2911
|
+
|
|
2912
|
+
---
|
|
2913
|
+
### Class: WERR_INVALID_PARAMETER
|
|
2914
|
+
|
|
2915
|
+
The ${parameter} parameter is invalid.
|
|
2916
|
+
|
|
2917
|
+
This is an example of an error object with a custom property `parameter` and templated `message`.
|
|
2918
|
+
|
|
2919
|
+
```ts
|
|
2920
|
+
export class WERR_INVALID_PARAMETER extends Error {
|
|
2921
|
+
code: number;
|
|
2922
|
+
isError: boolean = true;
|
|
2923
|
+
constructor(public parameter: string, mustBe?: string)
|
|
2924
|
+
}
|
|
2925
|
+
```
|
|
2926
|
+
|
|
2927
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2928
|
+
|
|
2929
|
+
---
|
|
2930
|
+
### Class: WERR_REVIEW_ACTIONS
|
|
2931
|
+
|
|
2932
|
+
When a `createAction` or `signAction` is completed in undelayed mode (`acceptDelayedBroadcast`: false),
|
|
2933
|
+
any unsucccessful result will return the results by way of this exception to ensure attention is
|
|
2934
|
+
paid to processing errors.
|
|
2935
|
+
|
|
2936
|
+
```ts
|
|
2937
|
+
export class WERR_REVIEW_ACTIONS extends Error {
|
|
2938
|
+
code: number;
|
|
2939
|
+
isError: boolean = true;
|
|
2940
|
+
constructor(public reviewActionResults: ReviewActionResult[], public sendWithResults: SendWithResult[], public txid?: TXIDHexString, public tx?: AtomicBEEF, public noSendChange?: OutpointString[])
|
|
2941
|
+
}
|
|
2942
|
+
```
|
|
2943
|
+
|
|
2944
|
+
See also: [AtomicBEEF](./wallet.md#type-atomicbeef), [OutpointString](./wallet.md#type-outpointstring), [ReviewActionResult](./wallet.md#interface-reviewactionresult), [SendWithResult](./wallet.md#interface-sendwithresult), [TXIDHexString](./wallet.md#type-txidhexstring)
|
|
2945
|
+
|
|
2946
|
+
#### Constructor
|
|
2947
|
+
|
|
2948
|
+
All parameters correspond to their comparable `createAction` or `signSction` results
|
|
2949
|
+
with the exception of `reviewActionResults`;
|
|
2950
|
+
which contains more details, particularly for double spend results.
|
|
2951
|
+
|
|
2952
|
+
```ts
|
|
2953
|
+
constructor(public reviewActionResults: ReviewActionResult[], public sendWithResults: SendWithResult[], public txid?: TXIDHexString, public tx?: AtomicBEEF, public noSendChange?: OutpointString[])
|
|
2954
|
+
```
|
|
2955
|
+
See also: [AtomicBEEF](./wallet.md#type-atomicbeef), [OutpointString](./wallet.md#type-outpointstring), [ReviewActionResult](./wallet.md#interface-reviewactionresult), [SendWithResult](./wallet.md#interface-sendwithresult), [TXIDHexString](./wallet.md#type-txidhexstring)
|
|
2956
|
+
|
|
2957
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2958
|
+
|
|
2959
|
+
---
|
|
2960
|
+
### Class: WalletClient
|
|
2961
|
+
|
|
2962
|
+
The SDK is how applications communicate with wallets over a communications substrate.
|
|
2963
|
+
|
|
2964
|
+
```ts
|
|
2965
|
+
export default class WalletClient implements WalletInterface {
|
|
2966
|
+
public substrate: "auto" | WalletInterface;
|
|
2967
|
+
originator?: OriginatorDomainNameStringUnder250Bytes;
|
|
2968
|
+
constructor(substrate: "auto" | "Cicada" | "XDM" | "window.CWI" | "json-api" | "react-native" | "secure-json-api" | WalletInterface = "auto", originator?: OriginatorDomainNameStringUnder250Bytes)
|
|
2969
|
+
async connectToSubstrate(): Promise<void>
|
|
2970
|
+
async createAction(args: CreateActionArgs): Promise<CreateActionResult>
|
|
2971
|
+
async signAction(args: SignActionArgs): Promise<SignActionResult>
|
|
2893
2972
|
async abortAction(args: {
|
|
2894
2973
|
reference: Base64String;
|
|
2895
2974
|
}): Promise<{
|
|
2896
2975
|
aborted: true;
|
|
2897
2976
|
}>
|
|
2898
|
-
async listActions(args:
|
|
2899
|
-
|
|
2900
|
-
labelQueryMode?: "any" | "all";
|
|
2901
|
-
includeLabels?: BooleanDefaultFalse;
|
|
2902
|
-
includeInputs?: BooleanDefaultFalse;
|
|
2903
|
-
includeInputSourceLockingScripts?: BooleanDefaultFalse;
|
|
2904
|
-
includeInputUnlockingScripts?: BooleanDefaultFalse;
|
|
2905
|
-
includeOutputs?: BooleanDefaultFalse;
|
|
2906
|
-
includeOutputLockingScripts?: BooleanDefaultFalse;
|
|
2907
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
2908
|
-
offset?: PositiveIntegerOrZero;
|
|
2909
|
-
}): Promise<{
|
|
2910
|
-
totalActions: PositiveIntegerOrZero;
|
|
2911
|
-
actions: Array<{
|
|
2912
|
-
txid: TXIDHexString;
|
|
2913
|
-
satoshis: SatoshiValue;
|
|
2914
|
-
status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
|
|
2915
|
-
isOutgoing: boolean;
|
|
2916
|
-
description: DescriptionString5to50Bytes;
|
|
2917
|
-
labels?: LabelStringUnder300Bytes[];
|
|
2918
|
-
version: PositiveIntegerOrZero;
|
|
2919
|
-
lockTime: PositiveIntegerOrZero;
|
|
2920
|
-
inputs?: Array<{
|
|
2921
|
-
sourceOutpoint: OutpointString;
|
|
2922
|
-
sourceSatoshis: SatoshiValue;
|
|
2923
|
-
sourceLockingScript?: HexString;
|
|
2924
|
-
unlockingScript?: HexString;
|
|
2925
|
-
inputDescription: DescriptionString5to50Bytes;
|
|
2926
|
-
sequenceNumber: PositiveIntegerOrZero;
|
|
2927
|
-
}>;
|
|
2928
|
-
outputs?: Array<{
|
|
2929
|
-
outputIndex: PositiveIntegerOrZero;
|
|
2930
|
-
satoshis: SatoshiValue;
|
|
2931
|
-
lockingScript?: HexString;
|
|
2932
|
-
spendable: boolean;
|
|
2933
|
-
outputDescription: DescriptionString5to50Bytes;
|
|
2934
|
-
basket: BasketStringUnder300Bytes;
|
|
2935
|
-
tags: OutputTagStringUnder300Bytes[];
|
|
2936
|
-
customInstructions?: string;
|
|
2937
|
-
}>;
|
|
2938
|
-
}>;
|
|
2939
|
-
}>
|
|
2940
|
-
async internalizeAction(args: {
|
|
2941
|
-
tx: BEEF;
|
|
2942
|
-
outputs: Array<{
|
|
2943
|
-
outputIndex: PositiveIntegerOrZero;
|
|
2944
|
-
protocol: "wallet payment" | "basket insertion";
|
|
2945
|
-
paymentRemittance?: {
|
|
2946
|
-
derivationPrefix: Base64String;
|
|
2947
|
-
derivationSuffix: Base64String;
|
|
2948
|
-
senderIdentityKey: PubKeyHex;
|
|
2949
|
-
};
|
|
2950
|
-
insertionRemittance?: {
|
|
2951
|
-
basket: BasketStringUnder300Bytes;
|
|
2952
|
-
customInstructions?: string;
|
|
2953
|
-
tags?: OutputTagStringUnder300Bytes[];
|
|
2954
|
-
};
|
|
2955
|
-
}>;
|
|
2956
|
-
description: DescriptionString5to50Bytes;
|
|
2957
|
-
labels?: LabelStringUnder300Bytes[];
|
|
2958
|
-
}): Promise<{
|
|
2977
|
+
async listActions(args: ListActionsArgs): Promise<ListActionsResult>
|
|
2978
|
+
async internalizeAction(args: InternalizeActionArgs): Promise<{
|
|
2959
2979
|
accepted: true;
|
|
2960
2980
|
}>
|
|
2961
|
-
async listOutputs(args:
|
|
2962
|
-
|
|
2963
|
-
tags?: OutputTagStringUnder300Bytes[];
|
|
2964
|
-
tagQueryMode?: "all" | "any";
|
|
2965
|
-
include?: "locking scripts" | "entire transactions";
|
|
2966
|
-
includeCustomInstructions?: BooleanDefaultFalse;
|
|
2967
|
-
includeTags?: BooleanDefaultFalse;
|
|
2968
|
-
includeLabels?: BooleanDefaultFalse;
|
|
2969
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
2970
|
-
offset?: PositiveIntegerOrZero;
|
|
2971
|
-
}): Promise<{
|
|
2972
|
-
totalOutputs: PositiveIntegerOrZero;
|
|
2973
|
-
outputs: Array<{
|
|
2974
|
-
outpoint: OutpointString;
|
|
2975
|
-
satoshis: SatoshiValue;
|
|
2976
|
-
lockingScript?: HexString;
|
|
2977
|
-
tx?: BEEF;
|
|
2978
|
-
spendable: boolean;
|
|
2979
|
-
customInstructions?: string;
|
|
2980
|
-
tags?: OutputTagStringUnder300Bytes[];
|
|
2981
|
-
labels?: LabelStringUnder300Bytes[];
|
|
2982
|
-
}>;
|
|
2983
|
-
}>
|
|
2984
|
-
async relinquishOutput(args: {
|
|
2981
|
+
async listOutputs(args: ListOutputsArgs): Promise<ListOutputsResult>
|
|
2982
|
+
async relinquishOutput(args: {
|
|
2985
2983
|
basket: BasketStringUnder300Bytes;
|
|
2986
2984
|
output: OutpointString;
|
|
2987
2985
|
}): Promise<{
|
|
@@ -3120,27 +3118,7 @@ export default class ReactNativeWebView implements WalletInterface {
|
|
|
3120
3118
|
}): Promise<{
|
|
3121
3119
|
valid: true;
|
|
3122
3120
|
}>
|
|
3123
|
-
async acquireCertificate(args:
|
|
3124
|
-
type: Base64String;
|
|
3125
|
-
subject: PubKeyHex;
|
|
3126
|
-
serialNumber: Base64String;
|
|
3127
|
-
revocationOutpoint: OutpointString;
|
|
3128
|
-
signature: HexString;
|
|
3129
|
-
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3130
|
-
certifier: PubKeyHex;
|
|
3131
|
-
keyringRevealer: PubKeyHex | "certifier";
|
|
3132
|
-
keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3133
|
-
acquisitionProtocol: "direct" | "issuance";
|
|
3134
|
-
certifierUrl?: string;
|
|
3135
|
-
}): Promise<{
|
|
3136
|
-
type: Base64String;
|
|
3137
|
-
subject: PubKeyHex;
|
|
3138
|
-
serialNumber: Base64String;
|
|
3139
|
-
certifier: PubKeyHex;
|
|
3140
|
-
revocationOutpoint: OutpointString;
|
|
3141
|
-
signature: HexString;
|
|
3142
|
-
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3143
|
-
}>
|
|
3121
|
+
async acquireCertificate(args: AcquireCertificateArgs): Promise<AcquireCertificateResult>
|
|
3144
3122
|
async listCertificates(args: {
|
|
3145
3123
|
certifiers: PubKeyHex[];
|
|
3146
3124
|
types: Base64String[];
|
|
@@ -3148,35 +3126,8 @@ export default class ReactNativeWebView implements WalletInterface {
|
|
|
3148
3126
|
offset?: PositiveIntegerOrZero;
|
|
3149
3127
|
privileged?: BooleanDefaultFalse;
|
|
3150
3128
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
3151
|
-
}): Promise<
|
|
3152
|
-
|
|
3153
|
-
certificates: Array<{
|
|
3154
|
-
type: Base64String;
|
|
3155
|
-
subject: PubKeyHex;
|
|
3156
|
-
serialNumber: Base64String;
|
|
3157
|
-
certifier: PubKeyHex;
|
|
3158
|
-
revocationOutpoint: OutpointString;
|
|
3159
|
-
signature: HexString;
|
|
3160
|
-
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3161
|
-
}>;
|
|
3162
|
-
}>
|
|
3163
|
-
async proveCertificate(args: {
|
|
3164
|
-
certificate: {
|
|
3165
|
-
type: Base64String;
|
|
3166
|
-
subject: PubKeyHex;
|
|
3167
|
-
serialNumber: Base64String;
|
|
3168
|
-
certifier: PubKeyHex;
|
|
3169
|
-
revocationOutpoint: OutpointString;
|
|
3170
|
-
signature: HexString;
|
|
3171
|
-
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3172
|
-
};
|
|
3173
|
-
fieldsToReveal: CertificateFieldNameUnder50Bytes[];
|
|
3174
|
-
verifier: PubKeyHex;
|
|
3175
|
-
privileged?: BooleanDefaultFalse;
|
|
3176
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3177
|
-
}): Promise<{
|
|
3178
|
-
keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3179
|
-
}>
|
|
3129
|
+
}): Promise<ListCertificatesResult>
|
|
3130
|
+
async proveCertificate(args: ProveCertificateArgs): Promise<ProveCertificateResult>
|
|
3180
3131
|
async relinquishCertificate(args: {
|
|
3181
3132
|
type: Base64String;
|
|
3182
3133
|
serialNumber: Base64String;
|
|
@@ -3188,57 +3139,17 @@ export default class ReactNativeWebView implements WalletInterface {
|
|
|
3188
3139
|
identityKey: PubKeyHex;
|
|
3189
3140
|
limit?: PositiveIntegerDefault10Max10000;
|
|
3190
3141
|
offset?: PositiveIntegerOrZero;
|
|
3191
|
-
}): Promise<
|
|
3192
|
-
totalCertificates: PositiveIntegerOrZero;
|
|
3193
|
-
certificates: Array<{
|
|
3194
|
-
type: Base64String;
|
|
3195
|
-
subject: PubKeyHex;
|
|
3196
|
-
serialNumber: Base64String;
|
|
3197
|
-
certifier: PubKeyHex;
|
|
3198
|
-
revocationOutpoint: OutpointString;
|
|
3199
|
-
signature: HexString;
|
|
3200
|
-
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3201
|
-
certifierInfo: {
|
|
3202
|
-
name: EntityNameStringMax100Bytes;
|
|
3203
|
-
iconUrl: EntityIconURLStringMax500Bytes;
|
|
3204
|
-
description: DescriptionString5to50Bytes;
|
|
3205
|
-
trust: PositiveIntegerMax10;
|
|
3206
|
-
};
|
|
3207
|
-
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3208
|
-
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3209
|
-
}>;
|
|
3210
|
-
}>
|
|
3142
|
+
}): Promise<DiscoverCertificatesResult>
|
|
3211
3143
|
async discoverByAttributes(args: {
|
|
3212
3144
|
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3213
3145
|
limit?: PositiveIntegerDefault10Max10000;
|
|
3214
3146
|
offset?: PositiveIntegerOrZero;
|
|
3215
|
-
}): Promise<
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
type: Base64String;
|
|
3219
|
-
subject: PubKeyHex;
|
|
3220
|
-
serialNumber: Base64String;
|
|
3221
|
-
certifier: PubKeyHex;
|
|
3222
|
-
revocationOutpoint: OutpointString;
|
|
3223
|
-
signature: HexString;
|
|
3224
|
-
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3225
|
-
certifierInfo: {
|
|
3226
|
-
name: EntityNameStringMax100Bytes;
|
|
3227
|
-
iconUrl: EntityIconURLStringMax500Bytes;
|
|
3228
|
-
description: DescriptionString5to50Bytes;
|
|
3229
|
-
trust: PositiveIntegerMax10;
|
|
3230
|
-
};
|
|
3231
|
-
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3232
|
-
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3233
|
-
}>;
|
|
3234
|
-
}>
|
|
3235
|
-
async isAuthenticated(args: {}): Promise<{
|
|
3236
|
-
authenticated: true;
|
|
3237
|
-
}>
|
|
3238
|
-
async waitForAuthentication(args: {}): Promise<{
|
|
3147
|
+
}): Promise<DiscoverCertificatesResult>
|
|
3148
|
+
async isAuthenticated(args: object = {}): Promise<AuthenticatedResult>
|
|
3149
|
+
async waitForAuthentication(args: object = {}): Promise<{
|
|
3239
3150
|
authenticated: true;
|
|
3240
3151
|
}>
|
|
3241
|
-
async getHeight(args: {}): Promise<{
|
|
3152
|
+
async getHeight(args: object = {}): Promise<{
|
|
3242
3153
|
height: PositiveInteger;
|
|
3243
3154
|
}>
|
|
3244
3155
|
async getHeaderForHeight(args: {
|
|
@@ -3246,746 +3157,87 @@ export default class ReactNativeWebView implements WalletInterface {
|
|
|
3246
3157
|
}): Promise<{
|
|
3247
3158
|
header: HexString;
|
|
3248
3159
|
}>
|
|
3249
|
-
async getNetwork(args: {}): Promise<{
|
|
3160
|
+
async getNetwork(args: object = {}): Promise<{
|
|
3250
3161
|
network: "mainnet" | "testnet";
|
|
3251
3162
|
}>
|
|
3252
|
-
async getVersion(args: {}): Promise<{
|
|
3163
|
+
async getVersion(args: object = {}): Promise<{
|
|
3253
3164
|
version: VersionString7To30Bytes;
|
|
3254
3165
|
}>
|
|
3255
3166
|
}
|
|
3256
3167
|
```
|
|
3257
3168
|
|
|
3258
|
-
See also: [
|
|
3259
|
-
|
|
3260
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3261
|
-
|
|
3262
|
-
---
|
|
3263
|
-
### Class: WERR_INSUFFICIENT_FUNDS
|
|
3264
|
-
|
|
3265
|
-
Insufficient funds in the available inputs to cover the cost of the required outputs
|
|
3266
|
-
and the transaction fee (${moreSatoshisNeeded} more satoshis are needed,
|
|
3267
|
-
for a total of ${totalSatoshisNeeded}), plus whatever would be required in order
|
|
3268
|
-
to pay the fee to unlock and spend the outputs used to provide the additional satoshis.
|
|
3269
|
-
|
|
3270
|
-
```ts
|
|
3271
|
-
export class WERR_INSUFFICIENT_FUNDS extends Error {
|
|
3272
|
-
code: number;
|
|
3273
|
-
isError: boolean = true;
|
|
3274
|
-
constructor(public totalSatoshisNeeded: number, public moreSatoshisNeeded: number)
|
|
3275
|
-
}
|
|
3276
|
-
```
|
|
3277
|
-
|
|
3278
|
-
#### Constructor
|
|
3279
|
-
|
|
3280
|
-
```ts
|
|
3281
|
-
constructor(public totalSatoshisNeeded: number, public moreSatoshisNeeded: number)
|
|
3282
|
-
```
|
|
3283
|
-
|
|
3284
|
-
Argument Details
|
|
3285
|
-
|
|
3286
|
-
+ **totalSatoshisNeeded**
|
|
3287
|
-
+ Total satoshis required to fund transactions after net of required inputs and outputs.
|
|
3288
|
-
+ **moreSatoshisNeeded**
|
|
3289
|
-
+ Shortfall on total satoshis required to fund transactions after net of required inputs and outputs.
|
|
3169
|
+
See also: [AcquireCertificateArgs](./wallet.md#interface-acquirecertificateargs), [AcquireCertificateResult](./wallet.md#type-acquirecertificateresult), [AuthenticatedResult](./wallet.md#interface-authenticatedresult), [Base64String](./wallet.md#type-base64string), [BasketStringUnder300Bytes](./wallet.md#type-basketstringunder300bytes), [BooleanDefaultFalse](./wallet.md#type-booleandefaultfalse), [Byte](./wallet.md#type-byte), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [CreateActionArgs](./wallet.md#interface-createactionargs), [CreateActionResult](./wallet.md#interface-createactionresult), [DescriptionString5to50Bytes](./wallet.md#type-descriptionstring5to50bytes), [DiscoverCertificatesResult](./wallet.md#interface-discovercertificatesresult), [HexString](./wallet.md#type-hexstring), [ISOTimestampString](./wallet.md#type-isotimestampstring), [InternalizeActionArgs](./wallet.md#interface-internalizeactionargs), [KeyIDStringUnder800Bytes](./wallet.md#type-keyidstringunder800bytes), [ListActionsArgs](./wallet.md#interface-listactionsargs), [ListActionsResult](./wallet.md#interface-listactionsresult), [ListCertificatesResult](./wallet.md#interface-listcertificatesresult), [ListOutputsArgs](./wallet.md#interface-listoutputsargs), [ListOutputsResult](./wallet.md#interface-listoutputsresult), [OriginatorDomainNameStringUnder250Bytes](./wallet.md#type-originatordomainnamestringunder250bytes), [OutpointString](./wallet.md#type-outpointstring), [PositiveInteger](./wallet.md#type-positiveinteger), [PositiveIntegerDefault10Max10000](./wallet.md#type-positiveintegerdefault10max10000), [PositiveIntegerOrZero](./wallet.md#type-positiveintegerorzero), [ProtocolString5To400Bytes](./wallet.md#type-protocolstring5to400bytes), [ProveCertificateArgs](./wallet.md#interface-provecertificateargs), [ProveCertificateResult](./wallet.md#interface-provecertificateresult), [PubKeyHex](./wallet.md#type-pubkeyhex), [SecurityLevel](./wallet.md#type-securitylevel), [SignActionArgs](./wallet.md#interface-signactionargs), [SignActionResult](./wallet.md#interface-signactionresult), [VersionString7To30Bytes](./wallet.md#type-versionstring7to30bytes), [WalletInterface](./wallet.md#interface-walletinterface), [decrypt](./messages.md#variable-decrypt), [encrypt](./messages.md#variable-encrypt)
|
|
3290
3170
|
|
|
3291
3171
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3292
3172
|
|
|
3293
3173
|
---
|
|
3294
|
-
### Class:
|
|
3295
|
-
|
|
3296
|
-
The ${parameter} parameter is invalid.
|
|
3297
|
-
|
|
3298
|
-
This is an example of an error object with a custom property `parameter` and templated `message`.
|
|
3174
|
+
### Class: WalletError
|
|
3299
3175
|
|
|
3300
3176
|
```ts
|
|
3301
|
-
export class
|
|
3177
|
+
export class WalletError extends Error {
|
|
3302
3178
|
code: number;
|
|
3303
3179
|
isError: boolean = true;
|
|
3304
|
-
constructor(
|
|
3180
|
+
constructor(message: string, code = 1, stack?: string)
|
|
3181
|
+
static unknownToJson(error: any): string
|
|
3305
3182
|
}
|
|
3306
3183
|
```
|
|
3307
3184
|
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
---
|
|
3311
|
-
### Class: WERR_REVIEW_ACTIONS
|
|
3312
|
-
|
|
3313
|
-
When a `createAction` or `signAction` is completed in undelayed mode (`acceptDelayedBroadcast`: false),
|
|
3314
|
-
any unsucccessful result will return the results by way of this exception to ensure attention is
|
|
3315
|
-
paid to processing errors.
|
|
3316
|
-
|
|
3317
|
-
```ts
|
|
3318
|
-
export class WERR_REVIEW_ACTIONS extends Error {
|
|
3319
|
-
code: number;
|
|
3320
|
-
isError: boolean = true;
|
|
3321
|
-
constructor(public reviewActionResults: ReviewActionResult[], public sendWithResults: SendWithResult[], public txid?: TXIDHexString, public tx?: AtomicBEEF, public noSendChange?: OutpointString[])
|
|
3322
|
-
}
|
|
3323
|
-
```
|
|
3185
|
+
#### Method unknownToJson
|
|
3324
3186
|
|
|
3325
|
-
|
|
3187
|
+
Safely serializes a WalletError (including special cases), Error or unknown error to JSON.
|
|
3326
3188
|
|
|
3327
|
-
|
|
3189
|
+
Safely means avoiding deep, large, circular issues.
|
|
3328
3190
|
|
|
3329
|
-
|
|
3330
|
-
with the exception of `reviewActionResults`;
|
|
3331
|
-
which contains more details, particularly for double spend results.
|
|
3191
|
+
Example deserialization can be found in HTTPWalletJSON.ts of bsv ts-sdk.
|
|
3332
3192
|
|
|
3333
3193
|
```ts
|
|
3334
|
-
|
|
3335
|
-
```
|
|
3336
|
-
See also: [AtomicBEEF](./wallet.md#type-atomicbeef), [OutpointString](./wallet.md#type-outpointstring), [ReviewActionResult](./wallet.md#interface-reviewactionresult), [SendWithResult](./wallet.md#interface-sendwithresult), [TXIDHexString](./wallet.md#type-txidhexstring)
|
|
3337
|
-
|
|
3338
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3339
|
-
|
|
3340
|
-
---
|
|
3341
|
-
### Class: WalletClient
|
|
3342
|
-
|
|
3343
|
-
The SDK is how applications communicate with wallets over a communications substrate.
|
|
3344
|
-
|
|
3345
|
-
```ts
|
|
3346
|
-
export default class WalletClient implements WalletInterface {
|
|
3347
|
-
public substrate: "auto" | WalletInterface;
|
|
3348
|
-
originator?: OriginatorDomainNameStringUnder250Bytes;
|
|
3349
|
-
constructor(substrate: "auto" | "Cicada" | "XDM" | "window.CWI" | "json-api" | "react-native" | "secure-json-api" | WalletInterface = "auto", originator?: OriginatorDomainNameStringUnder250Bytes)
|
|
3350
|
-
async connectToSubstrate(): Promise<void>
|
|
3351
|
-
async createAction(args: CreateActionArgs): Promise<CreateActionResult>
|
|
3352
|
-
async signAction(args: SignActionArgs): Promise<SignActionResult>
|
|
3353
|
-
async abortAction(args: {
|
|
3354
|
-
reference: Base64String;
|
|
3355
|
-
}): Promise<{
|
|
3356
|
-
aborted: true;
|
|
3357
|
-
}>
|
|
3358
|
-
async listActions(args: ListActionsArgs): Promise<ListActionsResult>
|
|
3359
|
-
async internalizeAction(args: InternalizeActionArgs): Promise<{
|
|
3360
|
-
accepted: true;
|
|
3361
|
-
}>
|
|
3362
|
-
async listOutputs(args: ListOutputsArgs): Promise<ListOutputsResult>
|
|
3363
|
-
async relinquishOutput(args: {
|
|
3364
|
-
basket: BasketStringUnder300Bytes;
|
|
3365
|
-
output: OutpointString;
|
|
3366
|
-
}): Promise<{
|
|
3367
|
-
relinquished: true;
|
|
3368
|
-
}>
|
|
3369
|
-
async getPublicKey(args: {
|
|
3370
|
-
identityKey?: true;
|
|
3371
|
-
protocolID?: [
|
|
3372
|
-
SecurityLevel,
|
|
3373
|
-
ProtocolString5To400Bytes
|
|
3374
|
-
];
|
|
3375
|
-
keyID?: KeyIDStringUnder800Bytes;
|
|
3376
|
-
privileged?: BooleanDefaultFalse;
|
|
3377
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3378
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3379
|
-
forSelf?: BooleanDefaultFalse;
|
|
3380
|
-
}): Promise<{
|
|
3381
|
-
publicKey: PubKeyHex;
|
|
3382
|
-
}>
|
|
3383
|
-
async revealCounterpartyKeyLinkage(args: {
|
|
3384
|
-
counterparty: PubKeyHex;
|
|
3385
|
-
verifier: PubKeyHex;
|
|
3386
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3387
|
-
privileged?: BooleanDefaultFalse;
|
|
3388
|
-
}): Promise<{
|
|
3389
|
-
prover: PubKeyHex;
|
|
3390
|
-
verifier: PubKeyHex;
|
|
3391
|
-
counterparty: PubKeyHex;
|
|
3392
|
-
revelationTime: ISOTimestampString;
|
|
3393
|
-
encryptedLinkage: Byte[];
|
|
3394
|
-
encryptedLinkageProof: Byte[];
|
|
3395
|
-
}>
|
|
3396
|
-
async revealSpecificKeyLinkage(args: {
|
|
3397
|
-
counterparty: PubKeyHex;
|
|
3398
|
-
verifier: PubKeyHex;
|
|
3399
|
-
protocolID: [
|
|
3400
|
-
SecurityLevel,
|
|
3401
|
-
ProtocolString5To400Bytes
|
|
3402
|
-
];
|
|
3403
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3404
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3405
|
-
privileged?: BooleanDefaultFalse;
|
|
3406
|
-
}): Promise<{
|
|
3407
|
-
prover: PubKeyHex;
|
|
3408
|
-
verifier: PubKeyHex;
|
|
3409
|
-
counterparty: PubKeyHex;
|
|
3410
|
-
protocolID: [
|
|
3411
|
-
SecurityLevel,
|
|
3412
|
-
ProtocolString5To400Bytes
|
|
3413
|
-
];
|
|
3414
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3415
|
-
encryptedLinkage: Byte[];
|
|
3416
|
-
encryptedLinkageProof: Byte[];
|
|
3417
|
-
proofType: Byte;
|
|
3418
|
-
}>
|
|
3419
|
-
async encrypt(args: {
|
|
3420
|
-
plaintext: Byte[];
|
|
3421
|
-
protocolID: [
|
|
3422
|
-
SecurityLevel,
|
|
3423
|
-
ProtocolString5To400Bytes
|
|
3424
|
-
];
|
|
3425
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3426
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3427
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3428
|
-
privileged?: BooleanDefaultFalse;
|
|
3429
|
-
}): Promise<{
|
|
3430
|
-
ciphertext: Byte[];
|
|
3431
|
-
}>
|
|
3432
|
-
async decrypt(args: {
|
|
3433
|
-
ciphertext: Byte[];
|
|
3434
|
-
protocolID: [
|
|
3435
|
-
SecurityLevel,
|
|
3436
|
-
ProtocolString5To400Bytes
|
|
3437
|
-
];
|
|
3438
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3439
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3440
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3441
|
-
privileged?: BooleanDefaultFalse;
|
|
3442
|
-
}): Promise<{
|
|
3443
|
-
plaintext: Byte[];
|
|
3444
|
-
}>
|
|
3445
|
-
async createHmac(args: {
|
|
3446
|
-
data: Byte[];
|
|
3447
|
-
protocolID: [
|
|
3448
|
-
SecurityLevel,
|
|
3449
|
-
ProtocolString5To400Bytes
|
|
3450
|
-
];
|
|
3451
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3452
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3453
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3454
|
-
privileged?: BooleanDefaultFalse;
|
|
3455
|
-
}): Promise<{
|
|
3456
|
-
hmac: Byte[];
|
|
3457
|
-
}>
|
|
3458
|
-
async verifyHmac(args: {
|
|
3459
|
-
data: Byte[];
|
|
3460
|
-
hmac: Byte[];
|
|
3461
|
-
protocolID: [
|
|
3462
|
-
SecurityLevel,
|
|
3463
|
-
ProtocolString5To400Bytes
|
|
3464
|
-
];
|
|
3465
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3466
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3467
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3468
|
-
privileged?: BooleanDefaultFalse;
|
|
3469
|
-
}): Promise<{
|
|
3470
|
-
valid: true;
|
|
3471
|
-
}>
|
|
3472
|
-
async createSignature(args: {
|
|
3473
|
-
data?: Byte[];
|
|
3474
|
-
hashToDirectlySign?: Byte[];
|
|
3475
|
-
protocolID: [
|
|
3476
|
-
SecurityLevel,
|
|
3477
|
-
ProtocolString5To400Bytes
|
|
3478
|
-
];
|
|
3479
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3480
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3481
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3482
|
-
privileged?: BooleanDefaultFalse;
|
|
3483
|
-
}): Promise<{
|
|
3484
|
-
signature: Byte[];
|
|
3485
|
-
}>
|
|
3486
|
-
async verifySignature(args: {
|
|
3487
|
-
data?: Byte[];
|
|
3488
|
-
hashToDirectlyVerify?: Byte[];
|
|
3489
|
-
signature: Byte[];
|
|
3490
|
-
protocolID: [
|
|
3491
|
-
SecurityLevel,
|
|
3492
|
-
ProtocolString5To400Bytes
|
|
3493
|
-
];
|
|
3494
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3495
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3496
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3497
|
-
forSelf?: BooleanDefaultFalse;
|
|
3498
|
-
privileged?: BooleanDefaultFalse;
|
|
3499
|
-
}): Promise<{
|
|
3500
|
-
valid: true;
|
|
3501
|
-
}>
|
|
3502
|
-
async acquireCertificate(args: AcquireCertificateArgs): Promise<AcquireCertificateResult>
|
|
3503
|
-
async listCertificates(args: {
|
|
3504
|
-
certifiers: PubKeyHex[];
|
|
3505
|
-
types: Base64String[];
|
|
3506
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
3507
|
-
offset?: PositiveIntegerOrZero;
|
|
3508
|
-
privileged?: BooleanDefaultFalse;
|
|
3509
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3510
|
-
}): Promise<ListCertificatesResult>
|
|
3511
|
-
async proveCertificate(args: ProveCertificateArgs): Promise<ProveCertificateResult>
|
|
3512
|
-
async relinquishCertificate(args: {
|
|
3513
|
-
type: Base64String;
|
|
3514
|
-
serialNumber: Base64String;
|
|
3515
|
-
certifier: PubKeyHex;
|
|
3516
|
-
}): Promise<{
|
|
3517
|
-
relinquished: true;
|
|
3518
|
-
}>
|
|
3519
|
-
async discoverByIdentityKey(args: {
|
|
3520
|
-
identityKey: PubKeyHex;
|
|
3521
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
3522
|
-
offset?: PositiveIntegerOrZero;
|
|
3523
|
-
}): Promise<DiscoverCertificatesResult>
|
|
3524
|
-
async discoverByAttributes(args: {
|
|
3525
|
-
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3526
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
3527
|
-
offset?: PositiveIntegerOrZero;
|
|
3528
|
-
}): Promise<DiscoverCertificatesResult>
|
|
3529
|
-
async isAuthenticated(args: object = {}): Promise<AuthenticatedResult>
|
|
3530
|
-
async waitForAuthentication(args: object = {}): Promise<{
|
|
3531
|
-
authenticated: true;
|
|
3532
|
-
}>
|
|
3533
|
-
async getHeight(args: object = {}): Promise<{
|
|
3534
|
-
height: PositiveInteger;
|
|
3535
|
-
}>
|
|
3536
|
-
async getHeaderForHeight(args: {
|
|
3537
|
-
height: PositiveInteger;
|
|
3538
|
-
}): Promise<{
|
|
3539
|
-
header: HexString;
|
|
3540
|
-
}>
|
|
3541
|
-
async getNetwork(args: object = {}): Promise<{
|
|
3542
|
-
network: "mainnet" | "testnet";
|
|
3543
|
-
}>
|
|
3544
|
-
async getVersion(args: object = {}): Promise<{
|
|
3545
|
-
version: VersionString7To30Bytes;
|
|
3546
|
-
}>
|
|
3547
|
-
}
|
|
3548
|
-
```
|
|
3549
|
-
|
|
3550
|
-
See also: [AcquireCertificateArgs](./wallet.md#interface-acquirecertificateargs), [AcquireCertificateResult](./wallet.md#type-acquirecertificateresult), [AuthenticatedResult](./wallet.md#interface-authenticatedresult), [Base64String](./wallet.md#type-base64string), [BasketStringUnder300Bytes](./wallet.md#type-basketstringunder300bytes), [BooleanDefaultFalse](./wallet.md#type-booleandefaultfalse), [Byte](./wallet.md#type-byte), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [CreateActionArgs](./wallet.md#interface-createactionargs), [CreateActionResult](./wallet.md#interface-createactionresult), [DescriptionString5to50Bytes](./wallet.md#type-descriptionstring5to50bytes), [DiscoverCertificatesResult](./wallet.md#interface-discovercertificatesresult), [HexString](./wallet.md#type-hexstring), [ISOTimestampString](./wallet.md#type-isotimestampstring), [InternalizeActionArgs](./wallet.md#interface-internalizeactionargs), [KeyIDStringUnder800Bytes](./wallet.md#type-keyidstringunder800bytes), [ListActionsArgs](./wallet.md#interface-listactionsargs), [ListActionsResult](./wallet.md#interface-listactionsresult), [ListCertificatesResult](./wallet.md#interface-listcertificatesresult), [ListOutputsArgs](./wallet.md#interface-listoutputsargs), [ListOutputsResult](./wallet.md#interface-listoutputsresult), [OriginatorDomainNameStringUnder250Bytes](./wallet.md#type-originatordomainnamestringunder250bytes), [OutpointString](./wallet.md#type-outpointstring), [PositiveInteger](./wallet.md#type-positiveinteger), [PositiveIntegerDefault10Max10000](./wallet.md#type-positiveintegerdefault10max10000), [PositiveIntegerOrZero](./wallet.md#type-positiveintegerorzero), [ProtocolString5To400Bytes](./wallet.md#type-protocolstring5to400bytes), [ProveCertificateArgs](./wallet.md#interface-provecertificateargs), [ProveCertificateResult](./wallet.md#interface-provecertificateresult), [PubKeyHex](./wallet.md#type-pubkeyhex), [SecurityLevel](./wallet.md#type-securitylevel), [SignActionArgs](./wallet.md#interface-signactionargs), [SignActionResult](./wallet.md#interface-signactionresult), [VersionString7To30Bytes](./wallet.md#type-versionstring7to30bytes), [WalletInterface](./wallet.md#interface-walletinterface), [decrypt](./messages.md#variable-decrypt), [encrypt](./messages.md#variable-encrypt)
|
|
3551
|
-
|
|
3552
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3553
|
-
|
|
3554
|
-
---
|
|
3555
|
-
### Class: WalletError
|
|
3556
|
-
|
|
3557
|
-
```ts
|
|
3558
|
-
export class WalletError extends Error {
|
|
3559
|
-
code: number;
|
|
3560
|
-
isError: boolean = true;
|
|
3561
|
-
constructor(message: string, code = 1, stack?: string)
|
|
3562
|
-
static unknownToJson(error: any): string
|
|
3563
|
-
}
|
|
3564
|
-
```
|
|
3565
|
-
|
|
3566
|
-
#### Method unknownToJson
|
|
3567
|
-
|
|
3568
|
-
Safely serializes a WalletError (including special cases), Error or unknown error to JSON.
|
|
3569
|
-
|
|
3570
|
-
Safely means avoiding deep, large, circular issues.
|
|
3571
|
-
|
|
3572
|
-
Example deserialization can be found in HTTPWalletJSON.ts of bsv ts-sdk.
|
|
3573
|
-
|
|
3574
|
-
```ts
|
|
3575
|
-
static unknownToJson(error: any): string
|
|
3194
|
+
static unknownToJson(error: any): string
|
|
3576
3195
|
```
|
|
3577
3196
|
|
|
3578
3197
|
Returns
|
|
3579
|
-
|
|
3580
|
-
stringified JSON representation of the error such that it can be deserialized to a WalletError.
|
|
3581
|
-
|
|
3582
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3583
|
-
|
|
3584
|
-
---
|
|
3585
|
-
### Class: WalletWireProcessor
|
|
3586
|
-
|
|
3587
|
-
Processes incoming wallet calls received over a wallet wire, with a given wallet.
|
|
3588
|
-
|
|
3589
|
-
```ts
|
|
3590
|
-
export default class WalletWireProcessor implements WalletWire {
|
|
3591
|
-
wallet: WalletInterface;
|
|
3592
|
-
constructor(wallet: WalletInterface)
|
|
3593
|
-
async transmitToWallet(message: number[]): Promise<number[]>
|
|
3594
|
-
}
|
|
3595
|
-
```
|
|
3596
|
-
|
|
3597
|
-
See also: [WalletInterface](./wallet.md#interface-walletinterface), [WalletWire](./wallet.md#interface-walletwire)
|
|
3598
|
-
|
|
3599
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3600
|
-
|
|
3601
|
-
---
|
|
3602
|
-
### Class: WalletWireTransceiver
|
|
3603
|
-
|
|
3604
|
-
A way to make remote calls to a wallet over a wallet wire.
|
|
3605
|
-
|
|
3606
|
-
```ts
|
|
3607
|
-
export default class WalletWireTransceiver implements WalletInterface {
|
|
3608
|
-
wire: WalletWire;
|
|
3609
|
-
constructor(wire: WalletWire)
|
|
3610
|
-
async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
|
|
3611
|
-
async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
|
|
3612
|
-
async abortAction(args: {
|
|
3613
|
-
reference: Base64String;
|
|
3614
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3615
|
-
aborted: true;
|
|
3616
|
-
}>
|
|
3617
|
-
async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>
|
|
3618
|
-
async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3619
|
-
accepted: true;
|
|
3620
|
-
}>
|
|
3621
|
-
async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
|
|
3622
|
-
async relinquishOutput(args: {
|
|
3623
|
-
basket: BasketStringUnder300Bytes;
|
|
3624
|
-
output: OutpointString;
|
|
3625
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3626
|
-
relinquished: true;
|
|
3627
|
-
}>
|
|
3628
|
-
async getPublicKey(args: {
|
|
3629
|
-
seekPermission?: BooleanDefaultTrue;
|
|
3630
|
-
identityKey?: true;
|
|
3631
|
-
protocolID?: [
|
|
3632
|
-
SecurityLevel,
|
|
3633
|
-
ProtocolString5To400Bytes
|
|
3634
|
-
];
|
|
3635
|
-
keyID?: KeyIDStringUnder800Bytes;
|
|
3636
|
-
privileged?: BooleanDefaultFalse;
|
|
3637
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3638
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3639
|
-
forSelf?: BooleanDefaultFalse;
|
|
3640
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3641
|
-
publicKey: PubKeyHex;
|
|
3642
|
-
}>
|
|
3643
|
-
async revealCounterpartyKeyLinkage(args: {
|
|
3644
|
-
counterparty: PubKeyHex;
|
|
3645
|
-
verifier: PubKeyHex;
|
|
3646
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3647
|
-
privileged?: BooleanDefaultFalse;
|
|
3648
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3649
|
-
prover: PubKeyHex;
|
|
3650
|
-
verifier: PubKeyHex;
|
|
3651
|
-
counterparty: PubKeyHex;
|
|
3652
|
-
revelationTime: ISOTimestampString;
|
|
3653
|
-
encryptedLinkage: Byte[];
|
|
3654
|
-
encryptedLinkageProof: number[];
|
|
3655
|
-
}>
|
|
3656
|
-
async revealSpecificKeyLinkage(args: {
|
|
3657
|
-
counterparty: PubKeyHex;
|
|
3658
|
-
verifier: PubKeyHex;
|
|
3659
|
-
protocolID: [
|
|
3660
|
-
SecurityLevel,
|
|
3661
|
-
ProtocolString5To400Bytes
|
|
3662
|
-
];
|
|
3663
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3664
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3665
|
-
privileged?: BooleanDefaultFalse;
|
|
3666
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3667
|
-
prover: PubKeyHex;
|
|
3668
|
-
verifier: PubKeyHex;
|
|
3669
|
-
counterparty: PubKeyHex;
|
|
3670
|
-
protocolID: [
|
|
3671
|
-
SecurityLevel,
|
|
3672
|
-
ProtocolString5To400Bytes
|
|
3673
|
-
];
|
|
3674
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3675
|
-
encryptedLinkage: Byte[];
|
|
3676
|
-
encryptedLinkageProof: Byte[];
|
|
3677
|
-
proofType: Byte;
|
|
3678
|
-
}>
|
|
3679
|
-
async encrypt(args: {
|
|
3680
|
-
seekPermission?: BooleanDefaultTrue;
|
|
3681
|
-
plaintext: Byte[];
|
|
3682
|
-
protocolID: [
|
|
3683
|
-
SecurityLevel,
|
|
3684
|
-
ProtocolString5To400Bytes
|
|
3685
|
-
];
|
|
3686
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3687
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3688
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3689
|
-
privileged?: BooleanDefaultFalse;
|
|
3690
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3691
|
-
ciphertext: Byte[];
|
|
3692
|
-
}>
|
|
3693
|
-
async decrypt(args: {
|
|
3694
|
-
seekPermission?: BooleanDefaultTrue;
|
|
3695
|
-
ciphertext: Byte[];
|
|
3696
|
-
protocolID: [
|
|
3697
|
-
SecurityLevel,
|
|
3698
|
-
ProtocolString5To400Bytes
|
|
3699
|
-
];
|
|
3700
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3701
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3702
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3703
|
-
privileged?: BooleanDefaultFalse;
|
|
3704
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3705
|
-
plaintext: Byte[];
|
|
3706
|
-
}>
|
|
3707
|
-
async createHmac(args: {
|
|
3708
|
-
seekPermission?: BooleanDefaultTrue;
|
|
3709
|
-
data: Byte[];
|
|
3710
|
-
protocolID: [
|
|
3711
|
-
SecurityLevel,
|
|
3712
|
-
ProtocolString5To400Bytes
|
|
3713
|
-
];
|
|
3714
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3715
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3716
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3717
|
-
privileged?: BooleanDefaultFalse;
|
|
3718
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3719
|
-
hmac: Byte[];
|
|
3720
|
-
}>
|
|
3721
|
-
async verifyHmac(args: {
|
|
3722
|
-
seekPermission?: BooleanDefaultTrue;
|
|
3723
|
-
data: Byte[];
|
|
3724
|
-
hmac: Byte[];
|
|
3725
|
-
protocolID: [
|
|
3726
|
-
SecurityLevel,
|
|
3727
|
-
ProtocolString5To400Bytes
|
|
3728
|
-
];
|
|
3729
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3730
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3731
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3732
|
-
privileged?: BooleanDefaultFalse;
|
|
3733
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3734
|
-
valid: true;
|
|
3735
|
-
}>
|
|
3736
|
-
async createSignature(args: {
|
|
3737
|
-
seekPermission?: BooleanDefaultTrue;
|
|
3738
|
-
data?: Byte[];
|
|
3739
|
-
hashToDirectlySign?: Byte[];
|
|
3740
|
-
protocolID: [
|
|
3741
|
-
SecurityLevel,
|
|
3742
|
-
ProtocolString5To400Bytes
|
|
3743
|
-
];
|
|
3744
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3745
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3746
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3747
|
-
privileged?: BooleanDefaultFalse;
|
|
3748
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3749
|
-
signature: Byte[];
|
|
3750
|
-
}>
|
|
3751
|
-
async verifySignature(args: {
|
|
3752
|
-
seekPermission?: BooleanDefaultTrue;
|
|
3753
|
-
data?: Byte[];
|
|
3754
|
-
hashToDirectlyVerify?: Byte[];
|
|
3755
|
-
signature: Byte[];
|
|
3756
|
-
protocolID: [
|
|
3757
|
-
SecurityLevel,
|
|
3758
|
-
ProtocolString5To400Bytes
|
|
3759
|
-
];
|
|
3760
|
-
keyID: KeyIDStringUnder800Bytes;
|
|
3761
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3762
|
-
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3763
|
-
forSelf?: BooleanDefaultFalse;
|
|
3764
|
-
privileged?: BooleanDefaultFalse;
|
|
3765
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3766
|
-
valid: true;
|
|
3767
|
-
}>
|
|
3768
|
-
async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>
|
|
3769
|
-
async listCertificates(args: {
|
|
3770
|
-
certifiers: PubKeyHex[];
|
|
3771
|
-
types: Base64String[];
|
|
3772
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
3773
|
-
offset?: PositiveIntegerOrZero;
|
|
3774
|
-
privileged?: BooleanDefaultFalse;
|
|
3775
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
3776
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
|
|
3777
|
-
async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
|
|
3778
|
-
async relinquishCertificate(args: {
|
|
3779
|
-
type: Base64String;
|
|
3780
|
-
serialNumber: Base64String;
|
|
3781
|
-
certifier: PubKeyHex;
|
|
3782
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3783
|
-
relinquished: true;
|
|
3784
|
-
}>
|
|
3785
|
-
async discoverByIdentityKey(args: {
|
|
3786
|
-
seekPermission?: BooleanDefaultTrue;
|
|
3787
|
-
identityKey: PubKeyHex;
|
|
3788
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
3789
|
-
offset?: PositiveIntegerOrZero;
|
|
3790
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
3791
|
-
async discoverByAttributes(args: {
|
|
3792
|
-
seekPermission?: BooleanDefaultTrue;
|
|
3793
|
-
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3794
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
3795
|
-
offset?: PositiveIntegerOrZero;
|
|
3796
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
3797
|
-
async isAuthenticated(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3798
|
-
authenticated: true;
|
|
3799
|
-
}>
|
|
3800
|
-
async waitForAuthentication(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3801
|
-
authenticated: true;
|
|
3802
|
-
}>
|
|
3803
|
-
async getHeight(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3804
|
-
height: PositiveInteger;
|
|
3805
|
-
}>
|
|
3806
|
-
async getHeaderForHeight(args: {
|
|
3807
|
-
height: PositiveInteger;
|
|
3808
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3809
|
-
header: HexString;
|
|
3810
|
-
}>
|
|
3811
|
-
async getNetwork(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3812
|
-
network: "mainnet" | "testnet";
|
|
3813
|
-
}>
|
|
3814
|
-
async getVersion(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3815
|
-
version: VersionString7To30Bytes;
|
|
3816
|
-
}>
|
|
3817
|
-
}
|
|
3818
|
-
```
|
|
3819
|
-
|
|
3820
|
-
See also: [AcquireCertificateArgs](./wallet.md#interface-acquirecertificateargs), [AcquireCertificateResult](./wallet.md#type-acquirecertificateresult), [Base64String](./wallet.md#type-base64string), [BasketStringUnder300Bytes](./wallet.md#type-basketstringunder300bytes), [BooleanDefaultFalse](./wallet.md#type-booleandefaultfalse), [BooleanDefaultTrue](./wallet.md#type-booleandefaulttrue), [Byte](./wallet.md#type-byte), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [CreateActionArgs](./wallet.md#interface-createactionargs), [CreateActionResult](./wallet.md#interface-createactionresult), [DescriptionString5to50Bytes](./wallet.md#type-descriptionstring5to50bytes), [DiscoverCertificatesResult](./wallet.md#interface-discovercertificatesresult), [HexString](./wallet.md#type-hexstring), [ISOTimestampString](./wallet.md#type-isotimestampstring), [InternalizeActionArgs](./wallet.md#interface-internalizeactionargs), [KeyIDStringUnder800Bytes](./wallet.md#type-keyidstringunder800bytes), [ListActionsArgs](./wallet.md#interface-listactionsargs), [ListActionsResult](./wallet.md#interface-listactionsresult), [ListCertificatesResult](./wallet.md#interface-listcertificatesresult), [ListOutputsArgs](./wallet.md#interface-listoutputsargs), [ListOutputsResult](./wallet.md#interface-listoutputsresult), [OriginatorDomainNameStringUnder250Bytes](./wallet.md#type-originatordomainnamestringunder250bytes), [OutpointString](./wallet.md#type-outpointstring), [PositiveInteger](./wallet.md#type-positiveinteger), [PositiveIntegerDefault10Max10000](./wallet.md#type-positiveintegerdefault10max10000), [PositiveIntegerOrZero](./wallet.md#type-positiveintegerorzero), [ProtocolString5To400Bytes](./wallet.md#type-protocolstring5to400bytes), [ProveCertificateArgs](./wallet.md#interface-provecertificateargs), [ProveCertificateResult](./wallet.md#interface-provecertificateresult), [PubKeyHex](./wallet.md#type-pubkeyhex), [SecurityLevel](./wallet.md#type-securitylevel), [SignActionArgs](./wallet.md#interface-signactionargs), [SignActionResult](./wallet.md#interface-signactionresult), [VersionString7To30Bytes](./wallet.md#type-versionstring7to30bytes), [WalletInterface](./wallet.md#interface-walletinterface), [WalletWire](./wallet.md#interface-walletwire), [decrypt](./messages.md#variable-decrypt), [encrypt](./messages.md#variable-encrypt)
|
|
3821
|
-
|
|
3822
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3823
|
-
|
|
3824
|
-
---
|
|
3825
|
-
### Class: WindowCWISubstrate
|
|
3826
|
-
|
|
3827
|
-
Facilitates wallet operations over the window.CWI interface.
|
|
3828
|
-
|
|
3829
|
-
```ts
|
|
3830
|
-
export default class WindowCWISubstrate implements WalletInterface {
|
|
3831
|
-
constructor()
|
|
3832
|
-
async createAction(args: {
|
|
3833
|
-
description: DescriptionString5to50Bytes;
|
|
3834
|
-
inputs?: Array<{
|
|
3835
|
-
tx?: BEEF;
|
|
3836
|
-
outpoint: OutpointString;
|
|
3837
|
-
unlockingScript?: HexString;
|
|
3838
|
-
unlockingScriptLength?: PositiveInteger;
|
|
3839
|
-
inputDescription: DescriptionString5to50Bytes;
|
|
3840
|
-
sequenceNumber?: PositiveIntegerOrZero;
|
|
3841
|
-
}>;
|
|
3842
|
-
outputs?: Array<{
|
|
3843
|
-
lockingScript: HexString;
|
|
3844
|
-
satoshis: SatoshiValue;
|
|
3845
|
-
outputDescription: DescriptionString5to50Bytes;
|
|
3846
|
-
basket?: BasketStringUnder300Bytes;
|
|
3847
|
-
customInstructions?: string;
|
|
3848
|
-
tags?: OutputTagStringUnder300Bytes[];
|
|
3849
|
-
}>;
|
|
3850
|
-
lockTime?: PositiveIntegerOrZero;
|
|
3851
|
-
version?: PositiveIntegerOrZero;
|
|
3852
|
-
labels?: LabelStringUnder300Bytes[];
|
|
3853
|
-
options?: {
|
|
3854
|
-
signAndProcess?: BooleanDefaultTrue;
|
|
3855
|
-
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
3856
|
-
trustSelf?: "known";
|
|
3857
|
-
knownTxids?: TXIDHexString[];
|
|
3858
|
-
returnTXIDOnly?: BooleanDefaultFalse;
|
|
3859
|
-
noSend?: BooleanDefaultFalse;
|
|
3860
|
-
noSendChange?: OutpointString[];
|
|
3861
|
-
sendWith?: TXIDHexString[];
|
|
3862
|
-
};
|
|
3863
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3864
|
-
txid?: TXIDHexString;
|
|
3865
|
-
tx?: BEEF;
|
|
3866
|
-
noSendChange?: OutpointString[];
|
|
3867
|
-
sendWithResults?: Array<{
|
|
3868
|
-
txid: TXIDHexString;
|
|
3869
|
-
status: "unproven" | "sending" | "failed";
|
|
3870
|
-
}>;
|
|
3871
|
-
signableTransaction?: {
|
|
3872
|
-
tx: BEEF;
|
|
3873
|
-
reference: Base64String;
|
|
3874
|
-
};
|
|
3875
|
-
}>
|
|
3876
|
-
async signAction(args: {
|
|
3877
|
-
spends: Record<PositiveIntegerOrZero, {
|
|
3878
|
-
unlockingScript: HexString;
|
|
3879
|
-
sequenceNumber?: PositiveIntegerOrZero;
|
|
3880
|
-
}>;
|
|
3881
|
-
reference: Base64String;
|
|
3882
|
-
options?: {
|
|
3883
|
-
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
3884
|
-
returnTXIDOnly?: BooleanDefaultFalse;
|
|
3885
|
-
noSend?: BooleanDefaultFalse;
|
|
3886
|
-
noSendChange?: OutpointString[];
|
|
3887
|
-
sendWith: TXIDHexString[];
|
|
3888
|
-
};
|
|
3889
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3890
|
-
txid?: TXIDHexString;
|
|
3891
|
-
tx?: BEEF;
|
|
3892
|
-
noSendChange?: OutpointString[];
|
|
3893
|
-
sendWithResults?: Array<{
|
|
3894
|
-
txid: TXIDHexString;
|
|
3895
|
-
status: "unproven" | "sending" | "failed";
|
|
3896
|
-
}>;
|
|
3897
|
-
}>
|
|
3898
|
-
async abortAction(args: {
|
|
3899
|
-
reference: Base64String;
|
|
3900
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3901
|
-
aborted: true;
|
|
3902
|
-
}>
|
|
3903
|
-
async listActions(args: {
|
|
3904
|
-
labels: LabelStringUnder300Bytes[];
|
|
3905
|
-
labelQueryMode?: "any" | "all";
|
|
3906
|
-
includeLabels?: BooleanDefaultFalse;
|
|
3907
|
-
includeInputs?: BooleanDefaultFalse;
|
|
3908
|
-
includeInputSourceLockingScripts?: BooleanDefaultFalse;
|
|
3909
|
-
includeInputUnlockingScripts?: BooleanDefaultFalse;
|
|
3910
|
-
includeOutputs?: BooleanDefaultFalse;
|
|
3911
|
-
includeOutputLockingScripts?: BooleanDefaultFalse;
|
|
3912
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
3913
|
-
offset?: PositiveIntegerOrZero;
|
|
3914
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3915
|
-
totalActions: PositiveIntegerOrZero;
|
|
3916
|
-
actions: Array<{
|
|
3917
|
-
txid: TXIDHexString;
|
|
3918
|
-
satoshis: SatoshiValue;
|
|
3919
|
-
status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal" | "failed";
|
|
3920
|
-
isOutgoing: boolean;
|
|
3921
|
-
description: DescriptionString5to50Bytes;
|
|
3922
|
-
labels?: LabelStringUnder300Bytes[];
|
|
3923
|
-
version: PositiveIntegerOrZero;
|
|
3924
|
-
lockTime: PositiveIntegerOrZero;
|
|
3925
|
-
inputs?: Array<{
|
|
3926
|
-
sourceOutpoint: OutpointString;
|
|
3927
|
-
sourceSatoshis: SatoshiValue;
|
|
3928
|
-
sourceLockingScript?: HexString;
|
|
3929
|
-
unlockingScript?: HexString;
|
|
3930
|
-
inputDescription: DescriptionString5to50Bytes;
|
|
3931
|
-
sequenceNumber: PositiveIntegerOrZero;
|
|
3932
|
-
}>;
|
|
3933
|
-
outputs?: Array<{
|
|
3934
|
-
outputIndex: PositiveIntegerOrZero;
|
|
3935
|
-
satoshis: SatoshiValue;
|
|
3936
|
-
lockingScript?: HexString;
|
|
3937
|
-
spendable: boolean;
|
|
3938
|
-
outputDescription: DescriptionString5to50Bytes;
|
|
3939
|
-
basket: BasketStringUnder300Bytes;
|
|
3940
|
-
tags: OutputTagStringUnder300Bytes[];
|
|
3941
|
-
customInstructions?: string;
|
|
3942
|
-
}>;
|
|
3943
|
-
}>;
|
|
3944
|
-
}>
|
|
3945
|
-
async internalizeAction(args: {
|
|
3946
|
-
tx: BEEF;
|
|
3947
|
-
outputs: Array<{
|
|
3948
|
-
outputIndex: PositiveIntegerOrZero;
|
|
3949
|
-
protocol: "wallet payment" | "basket insertion";
|
|
3950
|
-
paymentRemittance?: {
|
|
3951
|
-
derivationPrefix: Base64String;
|
|
3952
|
-
derivationSuffix: Base64String;
|
|
3953
|
-
senderIdentityKey: PubKeyHex;
|
|
3954
|
-
};
|
|
3955
|
-
insertionRemittance?: {
|
|
3956
|
-
basket: BasketStringUnder300Bytes;
|
|
3957
|
-
customInstructions?: string;
|
|
3958
|
-
tags?: OutputTagStringUnder300Bytes[];
|
|
3959
|
-
};
|
|
3960
|
-
}>;
|
|
3961
|
-
description: DescriptionString5to50Bytes;
|
|
3962
|
-
labels?: LabelStringUnder300Bytes[];
|
|
3198
|
+
|
|
3199
|
+
stringified JSON representation of the error such that it can be deserialized to a WalletError.
|
|
3200
|
+
|
|
3201
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3202
|
+
|
|
3203
|
+
---
|
|
3204
|
+
### Class: WalletWireProcessor
|
|
3205
|
+
|
|
3206
|
+
Processes incoming wallet calls received over a wallet wire, with a given wallet.
|
|
3207
|
+
|
|
3208
|
+
```ts
|
|
3209
|
+
export default class WalletWireProcessor implements WalletWire {
|
|
3210
|
+
wallet: WalletInterface;
|
|
3211
|
+
constructor(wallet: WalletInterface)
|
|
3212
|
+
async transmitToWallet(message: number[]): Promise<number[]>
|
|
3213
|
+
}
|
|
3214
|
+
```
|
|
3215
|
+
|
|
3216
|
+
See also: [WalletInterface](./wallet.md#interface-walletinterface), [WalletWire](./wallet.md#interface-walletwire)
|
|
3217
|
+
|
|
3218
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3219
|
+
|
|
3220
|
+
---
|
|
3221
|
+
### Class: WalletWireTransceiver
|
|
3222
|
+
|
|
3223
|
+
A way to make remote calls to a wallet over a wallet wire.
|
|
3224
|
+
|
|
3225
|
+
```ts
|
|
3226
|
+
export default class WalletWireTransceiver implements WalletInterface {
|
|
3227
|
+
wire: WalletWire;
|
|
3228
|
+
constructor(wire: WalletWire)
|
|
3229
|
+
async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
|
|
3230
|
+
async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
|
|
3231
|
+
async abortAction(args: {
|
|
3232
|
+
reference: Base64String;
|
|
3963
3233
|
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3964
|
-
|
|
3234
|
+
aborted: true;
|
|
3965
3235
|
}>
|
|
3966
|
-
async
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
tagQueryMode?: "all" | "any";
|
|
3970
|
-
include?: "locking scripts" | "entire transactions";
|
|
3971
|
-
includeCustomInstructions?: BooleanDefaultFalse;
|
|
3972
|
-
includeTags?: BooleanDefaultFalse;
|
|
3973
|
-
includeLabels?: BooleanDefaultFalse;
|
|
3974
|
-
limit?: PositiveIntegerDefault10Max10000;
|
|
3975
|
-
offset?: PositiveIntegerOrZero;
|
|
3976
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3977
|
-
totalOutputs: PositiveIntegerOrZero;
|
|
3978
|
-
outputs: Array<{
|
|
3979
|
-
outpoint: OutpointString;
|
|
3980
|
-
satoshis: SatoshiValue;
|
|
3981
|
-
lockingScript?: HexString;
|
|
3982
|
-
tx?: BEEF;
|
|
3983
|
-
spendable: boolean;
|
|
3984
|
-
customInstructions?: string;
|
|
3985
|
-
tags?: OutputTagStringUnder300Bytes[];
|
|
3986
|
-
labels?: LabelStringUnder300Bytes[];
|
|
3987
|
-
}>;
|
|
3236
|
+
async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>
|
|
3237
|
+
async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3238
|
+
accepted: true;
|
|
3988
3239
|
}>
|
|
3240
|
+
async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
|
|
3989
3241
|
async relinquishOutput(args: {
|
|
3990
3242
|
basket: BasketStringUnder300Bytes;
|
|
3991
3243
|
output: OutpointString;
|
|
@@ -3993,6 +3245,7 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
3993
3245
|
relinquished: true;
|
|
3994
3246
|
}>
|
|
3995
3247
|
async getPublicKey(args: {
|
|
3248
|
+
seekPermission?: BooleanDefaultTrue;
|
|
3996
3249
|
identityKey?: true;
|
|
3997
3250
|
protocolID?: [
|
|
3998
3251
|
SecurityLevel,
|
|
@@ -4017,7 +3270,7 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4017
3270
|
counterparty: PubKeyHex;
|
|
4018
3271
|
revelationTime: ISOTimestampString;
|
|
4019
3272
|
encryptedLinkage: Byte[];
|
|
4020
|
-
encryptedLinkageProof:
|
|
3273
|
+
encryptedLinkageProof: number[];
|
|
4021
3274
|
}>
|
|
4022
3275
|
async revealSpecificKeyLinkage(args: {
|
|
4023
3276
|
counterparty: PubKeyHex;
|
|
@@ -4043,6 +3296,7 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4043
3296
|
proofType: Byte;
|
|
4044
3297
|
}>
|
|
4045
3298
|
async encrypt(args: {
|
|
3299
|
+
seekPermission?: BooleanDefaultTrue;
|
|
4046
3300
|
plaintext: Byte[];
|
|
4047
3301
|
protocolID: [
|
|
4048
3302
|
SecurityLevel,
|
|
@@ -4056,6 +3310,7 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4056
3310
|
ciphertext: Byte[];
|
|
4057
3311
|
}>
|
|
4058
3312
|
async decrypt(args: {
|
|
3313
|
+
seekPermission?: BooleanDefaultTrue;
|
|
4059
3314
|
ciphertext: Byte[];
|
|
4060
3315
|
protocolID: [
|
|
4061
3316
|
SecurityLevel,
|
|
@@ -4069,6 +3324,7 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4069
3324
|
plaintext: Byte[];
|
|
4070
3325
|
}>
|
|
4071
3326
|
async createHmac(args: {
|
|
3327
|
+
seekPermission?: BooleanDefaultTrue;
|
|
4072
3328
|
data: Byte[];
|
|
4073
3329
|
protocolID: [
|
|
4074
3330
|
SecurityLevel,
|
|
@@ -4082,6 +3338,7 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4082
3338
|
hmac: Byte[];
|
|
4083
3339
|
}>
|
|
4084
3340
|
async verifyHmac(args: {
|
|
3341
|
+
seekPermission?: BooleanDefaultTrue;
|
|
4085
3342
|
data: Byte[];
|
|
4086
3343
|
hmac: Byte[];
|
|
4087
3344
|
protocolID: [
|
|
@@ -4096,6 +3353,7 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4096
3353
|
valid: true;
|
|
4097
3354
|
}>
|
|
4098
3355
|
async createSignature(args: {
|
|
3356
|
+
seekPermission?: BooleanDefaultTrue;
|
|
4099
3357
|
data?: Byte[];
|
|
4100
3358
|
hashToDirectlySign?: Byte[];
|
|
4101
3359
|
protocolID: [
|
|
@@ -4110,6 +3368,7 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4110
3368
|
signature: Byte[];
|
|
4111
3369
|
}>
|
|
4112
3370
|
async verifySignature(args: {
|
|
3371
|
+
seekPermission?: BooleanDefaultTrue;
|
|
4113
3372
|
data?: Byte[];
|
|
4114
3373
|
hashToDirectlyVerify?: Byte[];
|
|
4115
3374
|
signature: Byte[];
|
|
@@ -4125,27 +3384,7 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4125
3384
|
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4126
3385
|
valid: true;
|
|
4127
3386
|
}>
|
|
4128
|
-
async acquireCertificate(args:
|
|
4129
|
-
type: Base64String;
|
|
4130
|
-
subject: PubKeyHex;
|
|
4131
|
-
serialNumber: Base64String;
|
|
4132
|
-
revocationOutpoint: OutpointString;
|
|
4133
|
-
signature: HexString;
|
|
4134
|
-
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
4135
|
-
certifier: PubKeyHex;
|
|
4136
|
-
keyringRevealer: PubKeyHex | "certifier";
|
|
4137
|
-
keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
4138
|
-
acquisitionProtocol: "direct" | "issuance";
|
|
4139
|
-
certifierUrl?: string;
|
|
4140
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4141
|
-
type: Base64String;
|
|
4142
|
-
subject: PubKeyHex;
|
|
4143
|
-
serialNumber: Base64String;
|
|
4144
|
-
certifier: PubKeyHex;
|
|
4145
|
-
revocationOutpoint: OutpointString;
|
|
4146
|
-
signature: HexString;
|
|
4147
|
-
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
4148
|
-
}>
|
|
3387
|
+
async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>
|
|
4149
3388
|
async listCertificates(args: {
|
|
4150
3389
|
certifiers: PubKeyHex[];
|
|
4151
3390
|
types: Base64String[];
|
|
@@ -4153,35 +3392,8 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4153
3392
|
offset?: PositiveIntegerOrZero;
|
|
4154
3393
|
privileged?: BooleanDefaultFalse;
|
|
4155
3394
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4156
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<
|
|
4157
|
-
|
|
4158
|
-
certificates: Array<{
|
|
4159
|
-
type: Base64String;
|
|
4160
|
-
subject: PubKeyHex;
|
|
4161
|
-
serialNumber: Base64String;
|
|
4162
|
-
certifier: PubKeyHex;
|
|
4163
|
-
revocationOutpoint: OutpointString;
|
|
4164
|
-
signature: HexString;
|
|
4165
|
-
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
4166
|
-
}>;
|
|
4167
|
-
}>
|
|
4168
|
-
async proveCertificate(args: {
|
|
4169
|
-
certificate: {
|
|
4170
|
-
type: Base64String;
|
|
4171
|
-
subject: PubKeyHex;
|
|
4172
|
-
serialNumber: Base64String;
|
|
4173
|
-
certifier: PubKeyHex;
|
|
4174
|
-
revocationOutpoint: OutpointString;
|
|
4175
|
-
signature: HexString;
|
|
4176
|
-
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
4177
|
-
};
|
|
4178
|
-
fieldsToReveal: CertificateFieldNameUnder50Bytes[];
|
|
4179
|
-
verifier: PubKeyHex;
|
|
4180
|
-
privileged?: BooleanDefaultFalse;
|
|
4181
|
-
privilegedReason?: DescriptionString5to50Bytes;
|
|
4182
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4183
|
-
keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
4184
|
-
}>
|
|
3395
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
|
|
3396
|
+
async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
|
|
4185
3397
|
async relinquishCertificate(args: {
|
|
4186
3398
|
type: Base64String;
|
|
4187
3399
|
serialNumber: Base64String;
|
|
@@ -4190,60 +3402,24 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4190
3402
|
relinquished: true;
|
|
4191
3403
|
}>
|
|
4192
3404
|
async discoverByIdentityKey(args: {
|
|
3405
|
+
seekPermission?: BooleanDefaultTrue;
|
|
4193
3406
|
identityKey: PubKeyHex;
|
|
4194
3407
|
limit?: PositiveIntegerDefault10Max10000;
|
|
4195
3408
|
offset?: PositiveIntegerOrZero;
|
|
4196
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<
|
|
4197
|
-
totalCertificates: PositiveIntegerOrZero;
|
|
4198
|
-
certificates: Array<{
|
|
4199
|
-
type: Base64String;
|
|
4200
|
-
subject: PubKeyHex;
|
|
4201
|
-
serialNumber: Base64String;
|
|
4202
|
-
certifier: PubKeyHex;
|
|
4203
|
-
revocationOutpoint: OutpointString;
|
|
4204
|
-
signature: HexString;
|
|
4205
|
-
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
4206
|
-
certifierInfo: {
|
|
4207
|
-
name: EntityNameStringMax100Bytes;
|
|
4208
|
-
iconUrl: EntityIconURLStringMax500Bytes;
|
|
4209
|
-
description: DescriptionString5to50Bytes;
|
|
4210
|
-
trust: PositiveIntegerMax10;
|
|
4211
|
-
};
|
|
4212
|
-
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
4213
|
-
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
4214
|
-
}>;
|
|
4215
|
-
}>
|
|
3409
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
4216
3410
|
async discoverByAttributes(args: {
|
|
3411
|
+
seekPermission?: BooleanDefaultTrue;
|
|
4217
3412
|
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
4218
3413
|
limit?: PositiveIntegerDefault10Max10000;
|
|
4219
3414
|
offset?: PositiveIntegerOrZero;
|
|
4220
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<
|
|
4221
|
-
|
|
4222
|
-
certificates: Array<{
|
|
4223
|
-
type: Base64String;
|
|
4224
|
-
subject: PubKeyHex;
|
|
4225
|
-
serialNumber: Base64String;
|
|
4226
|
-
certifier: PubKeyHex;
|
|
4227
|
-
revocationOutpoint: OutpointString;
|
|
4228
|
-
signature: HexString;
|
|
4229
|
-
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
4230
|
-
certifierInfo: {
|
|
4231
|
-
name: EntityNameStringMax100Bytes;
|
|
4232
|
-
iconUrl: EntityIconURLStringMax500Bytes;
|
|
4233
|
-
description: DescriptionString5to50Bytes;
|
|
4234
|
-
trust: PositiveIntegerMax10;
|
|
4235
|
-
};
|
|
4236
|
-
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
4237
|
-
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
4238
|
-
}>;
|
|
4239
|
-
}>
|
|
4240
|
-
async isAuthenticated(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
3415
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
3416
|
+
async isAuthenticated(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4241
3417
|
authenticated: true;
|
|
4242
3418
|
}>
|
|
4243
|
-
async waitForAuthentication(args:
|
|
3419
|
+
async waitForAuthentication(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4244
3420
|
authenticated: true;
|
|
4245
3421
|
}>
|
|
4246
|
-
async getHeight(args:
|
|
3422
|
+
async getHeight(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4247
3423
|
height: PositiveInteger;
|
|
4248
3424
|
}>
|
|
4249
3425
|
async getHeaderForHeight(args: {
|
|
@@ -4251,28 +3427,27 @@ export default class WindowCWISubstrate implements WalletInterface {
|
|
|
4251
3427
|
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4252
3428
|
header: HexString;
|
|
4253
3429
|
}>
|
|
4254
|
-
async getNetwork(args:
|
|
3430
|
+
async getNetwork(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4255
3431
|
network: "mainnet" | "testnet";
|
|
4256
3432
|
}>
|
|
4257
|
-
async getVersion(args:
|
|
3433
|
+
async getVersion(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4258
3434
|
version: VersionString7To30Bytes;
|
|
4259
3435
|
}>
|
|
4260
3436
|
}
|
|
4261
3437
|
```
|
|
4262
3438
|
|
|
4263
|
-
See also: [
|
|
3439
|
+
See also: [AcquireCertificateArgs](./wallet.md#interface-acquirecertificateargs), [AcquireCertificateResult](./wallet.md#type-acquirecertificateresult), [Base64String](./wallet.md#type-base64string), [BasketStringUnder300Bytes](./wallet.md#type-basketstringunder300bytes), [BooleanDefaultFalse](./wallet.md#type-booleandefaultfalse), [BooleanDefaultTrue](./wallet.md#type-booleandefaulttrue), [Byte](./wallet.md#type-byte), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [CreateActionArgs](./wallet.md#interface-createactionargs), [CreateActionResult](./wallet.md#interface-createactionresult), [DescriptionString5to50Bytes](./wallet.md#type-descriptionstring5to50bytes), [DiscoverCertificatesResult](./wallet.md#interface-discovercertificatesresult), [HexString](./wallet.md#type-hexstring), [ISOTimestampString](./wallet.md#type-isotimestampstring), [InternalizeActionArgs](./wallet.md#interface-internalizeactionargs), [KeyIDStringUnder800Bytes](./wallet.md#type-keyidstringunder800bytes), [ListActionsArgs](./wallet.md#interface-listactionsargs), [ListActionsResult](./wallet.md#interface-listactionsresult), [ListCertificatesResult](./wallet.md#interface-listcertificatesresult), [ListOutputsArgs](./wallet.md#interface-listoutputsargs), [ListOutputsResult](./wallet.md#interface-listoutputsresult), [OriginatorDomainNameStringUnder250Bytes](./wallet.md#type-originatordomainnamestringunder250bytes), [OutpointString](./wallet.md#type-outpointstring), [PositiveInteger](./wallet.md#type-positiveinteger), [PositiveIntegerDefault10Max10000](./wallet.md#type-positiveintegerdefault10max10000), [PositiveIntegerOrZero](./wallet.md#type-positiveintegerorzero), [ProtocolString5To400Bytes](./wallet.md#type-protocolstring5to400bytes), [ProveCertificateArgs](./wallet.md#interface-provecertificateargs), [ProveCertificateResult](./wallet.md#interface-provecertificateresult), [PubKeyHex](./wallet.md#type-pubkeyhex), [SecurityLevel](./wallet.md#type-securitylevel), [SignActionArgs](./wallet.md#interface-signactionargs), [SignActionResult](./wallet.md#interface-signactionresult), [VersionString7To30Bytes](./wallet.md#type-versionstring7to30bytes), [WalletInterface](./wallet.md#interface-walletinterface), [WalletWire](./wallet.md#interface-walletwire), [decrypt](./messages.md#variable-decrypt), [encrypt](./messages.md#variable-encrypt)
|
|
4264
3440
|
|
|
4265
3441
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4266
3442
|
|
|
4267
3443
|
---
|
|
4268
|
-
### Class:
|
|
3444
|
+
### Class: WindowCWISubstrate
|
|
4269
3445
|
|
|
4270
|
-
Facilitates wallet operations over
|
|
3446
|
+
Facilitates wallet operations over the window.CWI interface.
|
|
4271
3447
|
|
|
4272
3448
|
```ts
|
|
4273
|
-
export default class
|
|
4274
|
-
constructor(
|
|
4275
|
-
async invoke(call: CallType, args: any): Promise<any>
|
|
3449
|
+
export default class WindowCWISubstrate implements WalletInterface {
|
|
3450
|
+
constructor()
|
|
4276
3451
|
async createAction(args: {
|
|
4277
3452
|
description: DescriptionString5to50Bytes;
|
|
4278
3453
|
inputs?: Array<{
|
|
@@ -4304,7 +3479,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4304
3479
|
noSendChange?: OutpointString[];
|
|
4305
3480
|
sendWith?: TXIDHexString[];
|
|
4306
3481
|
};
|
|
4307
|
-
}): Promise<{
|
|
3482
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4308
3483
|
txid?: TXIDHexString;
|
|
4309
3484
|
tx?: BEEF;
|
|
4310
3485
|
noSendChange?: OutpointString[];
|
|
@@ -4330,7 +3505,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4330
3505
|
noSendChange?: OutpointString[];
|
|
4331
3506
|
sendWith: TXIDHexString[];
|
|
4332
3507
|
};
|
|
4333
|
-
}): Promise<{
|
|
3508
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4334
3509
|
txid?: TXIDHexString;
|
|
4335
3510
|
tx?: BEEF;
|
|
4336
3511
|
noSendChange?: OutpointString[];
|
|
@@ -4341,7 +3516,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4341
3516
|
}>
|
|
4342
3517
|
async abortAction(args: {
|
|
4343
3518
|
reference: Base64String;
|
|
4344
|
-
}): Promise<{
|
|
3519
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4345
3520
|
aborted: true;
|
|
4346
3521
|
}>
|
|
4347
3522
|
async listActions(args: {
|
|
@@ -4355,12 +3530,12 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4355
3530
|
includeOutputLockingScripts?: BooleanDefaultFalse;
|
|
4356
3531
|
limit?: PositiveIntegerDefault10Max10000;
|
|
4357
3532
|
offset?: PositiveIntegerOrZero;
|
|
4358
|
-
}): Promise<{
|
|
3533
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4359
3534
|
totalActions: PositiveIntegerOrZero;
|
|
4360
3535
|
actions: Array<{
|
|
4361
3536
|
txid: TXIDHexString;
|
|
4362
3537
|
satoshis: SatoshiValue;
|
|
4363
|
-
status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
|
|
3538
|
+
status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal" | "failed";
|
|
4364
3539
|
isOutgoing: boolean;
|
|
4365
3540
|
description: DescriptionString5to50Bytes;
|
|
4366
3541
|
labels?: LabelStringUnder300Bytes[];
|
|
@@ -4404,7 +3579,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4404
3579
|
}>;
|
|
4405
3580
|
description: DescriptionString5to50Bytes;
|
|
4406
3581
|
labels?: LabelStringUnder300Bytes[];
|
|
4407
|
-
}): Promise<{
|
|
3582
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4408
3583
|
accepted: true;
|
|
4409
3584
|
}>
|
|
4410
3585
|
async listOutputs(args: {
|
|
@@ -4417,7 +3592,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4417
3592
|
includeLabels?: BooleanDefaultFalse;
|
|
4418
3593
|
limit?: PositiveIntegerDefault10Max10000;
|
|
4419
3594
|
offset?: PositiveIntegerOrZero;
|
|
4420
|
-
}): Promise<{
|
|
3595
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4421
3596
|
totalOutputs: PositiveIntegerOrZero;
|
|
4422
3597
|
outputs: Array<{
|
|
4423
3598
|
outpoint: OutpointString;
|
|
@@ -4433,7 +3608,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4433
3608
|
async relinquishOutput(args: {
|
|
4434
3609
|
basket: BasketStringUnder300Bytes;
|
|
4435
3610
|
output: OutpointString;
|
|
4436
|
-
}): Promise<{
|
|
3611
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4437
3612
|
relinquished: true;
|
|
4438
3613
|
}>
|
|
4439
3614
|
async getPublicKey(args: {
|
|
@@ -4447,7 +3622,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4447
3622
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4448
3623
|
counterparty?: PubKeyHex | "self" | "anyone";
|
|
4449
3624
|
forSelf?: BooleanDefaultFalse;
|
|
4450
|
-
}): Promise<{
|
|
3625
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4451
3626
|
publicKey: PubKeyHex;
|
|
4452
3627
|
}>
|
|
4453
3628
|
async revealCounterpartyKeyLinkage(args: {
|
|
@@ -4455,7 +3630,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4455
3630
|
verifier: PubKeyHex;
|
|
4456
3631
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4457
3632
|
privileged?: BooleanDefaultFalse;
|
|
4458
|
-
}): Promise<{
|
|
3633
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4459
3634
|
prover: PubKeyHex;
|
|
4460
3635
|
verifier: PubKeyHex;
|
|
4461
3636
|
counterparty: PubKeyHex;
|
|
@@ -4473,7 +3648,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4473
3648
|
keyID: KeyIDStringUnder800Bytes;
|
|
4474
3649
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4475
3650
|
privileged?: BooleanDefaultFalse;
|
|
4476
|
-
}): Promise<{
|
|
3651
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4477
3652
|
prover: PubKeyHex;
|
|
4478
3653
|
verifier: PubKeyHex;
|
|
4479
3654
|
counterparty: PubKeyHex;
|
|
@@ -4496,7 +3671,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4496
3671
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4497
3672
|
counterparty?: PubKeyHex | "self" | "anyone";
|
|
4498
3673
|
privileged?: BooleanDefaultFalse;
|
|
4499
|
-
}): Promise<{
|
|
3674
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4500
3675
|
ciphertext: Byte[];
|
|
4501
3676
|
}>
|
|
4502
3677
|
async decrypt(args: {
|
|
@@ -4509,7 +3684,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4509
3684
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4510
3685
|
counterparty?: PubKeyHex | "self" | "anyone";
|
|
4511
3686
|
privileged?: BooleanDefaultFalse;
|
|
4512
|
-
}): Promise<{
|
|
3687
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4513
3688
|
plaintext: Byte[];
|
|
4514
3689
|
}>
|
|
4515
3690
|
async createHmac(args: {
|
|
@@ -4522,7 +3697,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4522
3697
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4523
3698
|
counterparty?: PubKeyHex | "self" | "anyone";
|
|
4524
3699
|
privileged?: BooleanDefaultFalse;
|
|
4525
|
-
}): Promise<{
|
|
3700
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4526
3701
|
hmac: Byte[];
|
|
4527
3702
|
}>
|
|
4528
3703
|
async verifyHmac(args: {
|
|
@@ -4536,7 +3711,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4536
3711
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4537
3712
|
counterparty?: PubKeyHex | "self" | "anyone";
|
|
4538
3713
|
privileged?: BooleanDefaultFalse;
|
|
4539
|
-
}): Promise<{
|
|
3714
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4540
3715
|
valid: true;
|
|
4541
3716
|
}>
|
|
4542
3717
|
async createSignature(args: {
|
|
@@ -4550,7 +3725,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4550
3725
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4551
3726
|
counterparty?: PubKeyHex | "self" | "anyone";
|
|
4552
3727
|
privileged?: BooleanDefaultFalse;
|
|
4553
|
-
}): Promise<{
|
|
3728
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4554
3729
|
signature: Byte[];
|
|
4555
3730
|
}>
|
|
4556
3731
|
async verifySignature(args: {
|
|
@@ -4566,7 +3741,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4566
3741
|
counterparty?: PubKeyHex | "self" | "anyone";
|
|
4567
3742
|
forSelf?: BooleanDefaultFalse;
|
|
4568
3743
|
privileged?: BooleanDefaultFalse;
|
|
4569
|
-
}): Promise<{
|
|
3744
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4570
3745
|
valid: true;
|
|
4571
3746
|
}>
|
|
4572
3747
|
async acquireCertificate(args: {
|
|
@@ -4581,7 +3756,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4581
3756
|
keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
4582
3757
|
acquisitionProtocol: "direct" | "issuance";
|
|
4583
3758
|
certifierUrl?: string;
|
|
4584
|
-
}): Promise<{
|
|
3759
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4585
3760
|
type: Base64String;
|
|
4586
3761
|
subject: PubKeyHex;
|
|
4587
3762
|
serialNumber: Base64String;
|
|
@@ -4597,7 +3772,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4597
3772
|
offset?: PositiveIntegerOrZero;
|
|
4598
3773
|
privileged?: BooleanDefaultFalse;
|
|
4599
3774
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4600
|
-
}): Promise<{
|
|
3775
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4601
3776
|
totalCertificates: PositiveIntegerOrZero;
|
|
4602
3777
|
certificates: Array<{
|
|
4603
3778
|
type: Base64String;
|
|
@@ -4623,21 +3798,21 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4623
3798
|
verifier: PubKeyHex;
|
|
4624
3799
|
privileged?: BooleanDefaultFalse;
|
|
4625
3800
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
4626
|
-
}): Promise<{
|
|
3801
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4627
3802
|
keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
4628
3803
|
}>
|
|
4629
3804
|
async relinquishCertificate(args: {
|
|
4630
3805
|
type: Base64String;
|
|
4631
3806
|
serialNumber: Base64String;
|
|
4632
3807
|
certifier: PubKeyHex;
|
|
4633
|
-
}): Promise<{
|
|
3808
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4634
3809
|
relinquished: true;
|
|
4635
3810
|
}>
|
|
4636
3811
|
async discoverByIdentityKey(args: {
|
|
4637
3812
|
identityKey: PubKeyHex;
|
|
4638
3813
|
limit?: PositiveIntegerDefault10Max10000;
|
|
4639
3814
|
offset?: PositiveIntegerOrZero;
|
|
4640
|
-
}): Promise<{
|
|
3815
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4641
3816
|
totalCertificates: PositiveIntegerOrZero;
|
|
4642
3817
|
certificates: Array<{
|
|
4643
3818
|
type: Base64String;
|
|
@@ -4661,7 +3836,7 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4661
3836
|
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
4662
3837
|
limit?: PositiveIntegerDefault10Max10000;
|
|
4663
3838
|
offset?: PositiveIntegerOrZero;
|
|
4664
|
-
}): Promise<{
|
|
3839
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4665
3840
|
totalCertificates: PositiveIntegerOrZero;
|
|
4666
3841
|
certificates: Array<{
|
|
4667
3842
|
type: Base64String;
|
|
@@ -4681,30 +3856,46 @@ export default class XDMSubstrate implements WalletInterface {
|
|
|
4681
3856
|
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
4682
3857
|
}>;
|
|
4683
3858
|
}>
|
|
4684
|
-
async isAuthenticated(args:
|
|
3859
|
+
async isAuthenticated(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4685
3860
|
authenticated: true;
|
|
4686
3861
|
}>
|
|
4687
|
-
async waitForAuthentication(args:
|
|
3862
|
+
async waitForAuthentication(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4688
3863
|
authenticated: true;
|
|
4689
3864
|
}>
|
|
4690
|
-
async getHeight(args:
|
|
3865
|
+
async getHeight(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4691
3866
|
height: PositiveInteger;
|
|
4692
3867
|
}>
|
|
4693
3868
|
async getHeaderForHeight(args: {
|
|
4694
3869
|
height: PositiveInteger;
|
|
4695
|
-
}): Promise<{
|
|
3870
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4696
3871
|
header: HexString;
|
|
4697
3872
|
}>
|
|
4698
|
-
async getNetwork(args:
|
|
3873
|
+
async getNetwork(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4699
3874
|
network: "mainnet" | "testnet";
|
|
4700
3875
|
}>
|
|
4701
|
-
async getVersion(args:
|
|
3876
|
+
async getVersion(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
4702
3877
|
version: VersionString7To30Bytes;
|
|
4703
3878
|
}>
|
|
4704
3879
|
}
|
|
4705
3880
|
```
|
|
4706
3881
|
|
|
4707
|
-
See also: [BEEF](./wallet.md#type-beef), [Base64String](./wallet.md#type-base64string), [BasketStringUnder300Bytes](./wallet.md#type-basketstringunder300bytes), [BooleanDefaultFalse](./wallet.md#type-booleandefaultfalse), [BooleanDefaultTrue](./wallet.md#type-booleandefaulttrue), [Byte](./wallet.md#type-byte), [
|
|
3882
|
+
See also: [BEEF](./wallet.md#type-beef), [Base64String](./wallet.md#type-base64string), [BasketStringUnder300Bytes](./wallet.md#type-basketstringunder300bytes), [BooleanDefaultFalse](./wallet.md#type-booleandefaultfalse), [BooleanDefaultTrue](./wallet.md#type-booleandefaulttrue), [Byte](./wallet.md#type-byte), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [DescriptionString5to50Bytes](./wallet.md#type-descriptionstring5to50bytes), [EntityIconURLStringMax500Bytes](./wallet.md#type-entityiconurlstringmax500bytes), [EntityNameStringMax100Bytes](./wallet.md#type-entitynamestringmax100bytes), [HexString](./wallet.md#type-hexstring), [ISOTimestampString](./wallet.md#type-isotimestampstring), [KeyIDStringUnder800Bytes](./wallet.md#type-keyidstringunder800bytes), [LabelStringUnder300Bytes](./wallet.md#type-labelstringunder300bytes), [OriginatorDomainNameStringUnder250Bytes](./wallet.md#type-originatordomainnamestringunder250bytes), [OutpointString](./wallet.md#type-outpointstring), [OutputTagStringUnder300Bytes](./wallet.md#type-outputtagstringunder300bytes), [PositiveInteger](./wallet.md#type-positiveinteger), [PositiveIntegerDefault10Max10000](./wallet.md#type-positiveintegerdefault10max10000), [PositiveIntegerMax10](./wallet.md#type-positiveintegermax10), [PositiveIntegerOrZero](./wallet.md#type-positiveintegerorzero), [ProtocolString5To400Bytes](./wallet.md#type-protocolstring5to400bytes), [PubKeyHex](./wallet.md#type-pubkeyhex), [SatoshiValue](./wallet.md#type-satoshivalue), [SecurityLevel](./wallet.md#type-securitylevel), [TXIDHexString](./wallet.md#type-txidhexstring), [VersionString7To30Bytes](./wallet.md#type-versionstring7to30bytes), [WalletInterface](./wallet.md#interface-walletinterface), [decrypt](./messages.md#variable-decrypt), [encrypt](./messages.md#variable-encrypt)
|
|
3883
|
+
|
|
3884
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3885
|
+
|
|
3886
|
+
---
|
|
3887
|
+
### Class: XDMSubstrate
|
|
3888
|
+
|
|
3889
|
+
Facilitates wallet operations over cross-document messaging.
|
|
3890
|
+
|
|
3891
|
+
```ts
|
|
3892
|
+
export default class XDMSubstrate extends InvokableWalletBase {
|
|
3893
|
+
constructor(domain: string = "*")
|
|
3894
|
+
async invoke(call: CallType, args: any): Promise<any>
|
|
3895
|
+
}
|
|
3896
|
+
```
|
|
3897
|
+
|
|
3898
|
+
See also: [CallType](./wallet.md#type-calltype), [InvokableWalletBase](./wallet.md#class-invokablewalletbase)
|
|
4708
3899
|
|
|
4709
3900
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4710
3901
|
|