@bsv/sdk 1.4.15 → 1.4.18
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/mod.js +1 -0
- package/dist/cjs/mod.js.map +1 -1
- package/dist/cjs/package.json +9 -9
- package/dist/cjs/src/kvstore/LocalKVStore.js +279 -0
- package/dist/cjs/src/kvstore/LocalKVStore.js.map +1 -0
- package/dist/cjs/src/kvstore/index.js +9 -0
- package/dist/cjs/src/kvstore/index.js.map +1 -0
- package/dist/cjs/src/wallet/WERR_REVIEW_ACTIONS.js +29 -0
- package/dist/cjs/src/wallet/WERR_REVIEW_ACTIONS.js.map +1 -0
- package/dist/cjs/src/wallet/WalletError.js +4 -3
- package/dist/cjs/src/wallet/WalletError.js.map +1 -1
- package/dist/cjs/src/wallet/index.js +4 -1
- package/dist/cjs/src/wallet/index.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js +13 -6
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/mod.js +1 -0
- package/dist/esm/mod.js.map +1 -1
- package/dist/esm/src/kvstore/LocalKVStore.js +273 -0
- package/dist/esm/src/kvstore/LocalKVStore.js.map +1 -0
- package/dist/esm/src/kvstore/index.js +2 -0
- package/dist/esm/src/kvstore/index.js.map +1 -0
- package/dist/esm/src/wallet/WERR_REVIEW_ACTIONS.js +31 -0
- package/dist/esm/src/wallet/WERR_REVIEW_ACTIONS.js.map +1 -0
- package/dist/esm/src/wallet/WalletError.js +3 -2
- package/dist/esm/src/wallet/WalletError.js.map +1 -1
- package/dist/esm/src/wallet/index.js +2 -0
- package/dist/esm/src/wallet/index.js.map +1 -1
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js +13 -6
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/mod.d.ts +1 -0
- package/dist/types/mod.d.ts.map +1 -1
- package/dist/types/src/kvstore/LocalKVStore.d.ts +85 -0
- package/dist/types/src/kvstore/LocalKVStore.d.ts.map +1 -0
- package/dist/types/src/kvstore/index.d.ts +2 -0
- package/dist/types/src/kvstore/index.d.ts.map +1 -0
- package/dist/types/src/wallet/WERR_REVIEW_ACTIONS.d.ts +23 -0
- package/dist/types/src/wallet/WERR_REVIEW_ACTIONS.d.ts.map +1 -0
- package/dist/types/src/wallet/Wallet.interfaces.d.ts +22 -0
- package/dist/types/src/wallet/Wallet.interfaces.d.ts.map +1 -1
- package/dist/types/src/wallet/WalletError.d.ts +4 -3
- package/dist/types/src/wallet/WalletError.d.ts.map +1 -1
- package/dist/types/src/wallet/index.d.ts +1 -0
- package/dist/types/src/wallet/index.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/HTTPWalletJSON.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/identity.md +225 -0
- package/docs/kvstore.md +133 -0
- package/docs/registry.md +383 -0
- package/docs/transaction.md +3 -3
- package/docs/wallet.md +146 -38
- package/mod.ts +2 -1
- package/package.json +19 -9
- package/src/kvstore/LocalKVStore.ts +287 -0
- package/src/kvstore/__tests/LocalKVStore.test.ts +614 -0
- package/src/kvstore/index.ts +1 -0
- package/src/wallet/WERR_REVIEW_ACTIONS.ts +30 -0
- package/src/wallet/Wallet.interfaces.ts +24 -0
- package/src/wallet/WalletError.ts +4 -2
- package/src/wallet/index.ts +2 -0
- package/src/wallet/substrates/HTTPWalletJSON.ts +12 -6
- package/docs/wallet-substrates.md +0 -1194
package/docs/identity.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# API
|
|
2
|
+
|
|
3
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4
|
+
|
|
5
|
+
## Interfaces
|
|
6
|
+
|
|
7
|
+
| |
|
|
8
|
+
| --- |
|
|
9
|
+
| [DisplayableIdentity](#interface-displayableidentity) |
|
|
10
|
+
| [IdentityClientOptions](#interface-identityclientoptions) |
|
|
11
|
+
|
|
12
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
### Interface: DisplayableIdentity
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
export interface DisplayableIdentity {
|
|
20
|
+
name: string;
|
|
21
|
+
avatarURL: string;
|
|
22
|
+
abbreviatedKey: string;
|
|
23
|
+
identityKey: string;
|
|
24
|
+
badgeIconURL: string;
|
|
25
|
+
badgeLabel: string;
|
|
26
|
+
badgeClickURL: string;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
### Interface: IdentityClientOptions
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
export interface IdentityClientOptions {
|
|
37
|
+
protocolID: WalletProtocol;
|
|
38
|
+
keyID: string;
|
|
39
|
+
tokenAmount: number;
|
|
40
|
+
outputIndex: number;
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
45
|
+
|
|
46
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
## Classes
|
|
50
|
+
|
|
51
|
+
### Class: IdentityClient
|
|
52
|
+
|
|
53
|
+
IdentityClient lets you discover who others are, and let the world know who you are.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
export class IdentityClient {
|
|
57
|
+
constructor(wallet?: WalletInterface, private readonly options = DEFAULT_IDENTITY_CLIENT_OPTIONS, private readonly originator?: OriginatorDomainNameStringUnder250Bytes)
|
|
58
|
+
async publiclyRevealAttributes(certificate: WalletCertificate, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<BroadcastResponse | BroadcastFailure>
|
|
59
|
+
async resolveByIdentityKey(args: DiscoverByIdentityKeyArgs): Promise<DisplayableIdentity[]>
|
|
60
|
+
async resolveByAttributes(args: DiscoverByAttributesArgs): Promise<DisplayableIdentity[]>
|
|
61
|
+
static parseIdentity(identityToParse: IdentityCertificate): DisplayableIdentity
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [DEFAULT_IDENTITY_CLIENT_OPTIONS](./identity.md#variable-default_identity_client_options), [DiscoverByAttributesArgs](./wallet.md#interface-discoverbyattributesargs), [DiscoverByIdentityKeyArgs](./wallet.md#interface-discoverbyidentitykeyargs), [DisplayableIdentity](./identity.md#interface-displayableidentity), [IdentityCertificate](./wallet.md#interface-identitycertificate), [OriginatorDomainNameStringUnder250Bytes](./wallet.md#type-originatordomainnamestringunder250bytes), [WalletCertificate](./wallet.md#interface-walletcertificate), [WalletInterface](./wallet.md#interface-walletinterface)
|
|
66
|
+
|
|
67
|
+
#### Method parseIdentity
|
|
68
|
+
|
|
69
|
+
TODO: Implement once revocation overlay is created
|
|
70
|
+
Remove public certificate revelation from overlay services by spending the identity token
|
|
71
|
+
|
|
72
|
+
Parse out identity and certifier attributes to display from an IdentityCertificate
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
static parseIdentity(identityToParse: IdentityCertificate): DisplayableIdentity
|
|
76
|
+
```
|
|
77
|
+
See also: [DisplayableIdentity](./identity.md#interface-displayableidentity), [IdentityCertificate](./wallet.md#interface-identitycertificate)
|
|
78
|
+
|
|
79
|
+
Returns
|
|
80
|
+
|
|
81
|
+
- IdentityToDisplay
|
|
82
|
+
|
|
83
|
+
Argument Details
|
|
84
|
+
|
|
85
|
+
+ **serialNumber**
|
|
86
|
+
+ Unique serial number of the certificate to revoke revelation
|
|
87
|
+
+ **identityToParse**
|
|
88
|
+
+ The Identity Certificate to parse
|
|
89
|
+
|
|
90
|
+
#### Method publiclyRevealAttributes
|
|
91
|
+
|
|
92
|
+
Publicly reveals selected fields from a given certificate by creating a publicly verifiable certificate.
|
|
93
|
+
The publicly revealed certificate is included in a blockchain transaction and broadcast to a federated overlay node.
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
async publiclyRevealAttributes(certificate: WalletCertificate, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<BroadcastResponse | BroadcastFailure>
|
|
97
|
+
```
|
|
98
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [WalletCertificate](./wallet.md#interface-walletcertificate)
|
|
99
|
+
|
|
100
|
+
Returns
|
|
101
|
+
|
|
102
|
+
A promise that resolves with the broadcast result from the overlay network.
|
|
103
|
+
|
|
104
|
+
Argument Details
|
|
105
|
+
|
|
106
|
+
+ **certificate**
|
|
107
|
+
+ The master certificate to selectively reveal.
|
|
108
|
+
+ **fieldsToReveal**
|
|
109
|
+
+ An array of certificate field names to reveal. Only these fields will be included in the public certificate.
|
|
110
|
+
|
|
111
|
+
Throws
|
|
112
|
+
|
|
113
|
+
Throws an error if the certificate is invalid, the fields cannot be revealed, or if the broadcast fails.
|
|
114
|
+
|
|
115
|
+
#### Method resolveByAttributes
|
|
116
|
+
|
|
117
|
+
Resolves displayable identity certificates by specific identity attributes, issued by a trusted entity.
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
async resolveByAttributes(args: DiscoverByAttributesArgs): Promise<DisplayableIdentity[]>
|
|
121
|
+
```
|
|
122
|
+
See also: [DiscoverByAttributesArgs](./wallet.md#interface-discoverbyattributesargs), [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
123
|
+
|
|
124
|
+
Returns
|
|
125
|
+
|
|
126
|
+
The promise resolves to displayable identities.
|
|
127
|
+
|
|
128
|
+
Argument Details
|
|
129
|
+
|
|
130
|
+
+ **args**
|
|
131
|
+
+ Attributes and optional parameters used to discover certificates.
|
|
132
|
+
|
|
133
|
+
#### Method resolveByIdentityKey
|
|
134
|
+
|
|
135
|
+
Resolves displayable identity certificates, issued to a given identity key by a trusted certifier.
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
async resolveByIdentityKey(args: DiscoverByIdentityKeyArgs): Promise<DisplayableIdentity[]>
|
|
139
|
+
```
|
|
140
|
+
See also: [DiscoverByIdentityKeyArgs](./wallet.md#interface-discoverbyidentitykeyargs), [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
141
|
+
|
|
142
|
+
Returns
|
|
143
|
+
|
|
144
|
+
The promise resolves to displayable identities.
|
|
145
|
+
|
|
146
|
+
Argument Details
|
|
147
|
+
|
|
148
|
+
+ **args**
|
|
149
|
+
+ Arguments for requesting the discovery based on the identity key.
|
|
150
|
+
|
|
151
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
## Functions
|
|
155
|
+
|
|
156
|
+
## Types
|
|
157
|
+
|
|
158
|
+
## Enums
|
|
159
|
+
|
|
160
|
+
## Variables
|
|
161
|
+
|
|
162
|
+
| |
|
|
163
|
+
| --- |
|
|
164
|
+
| [DEFAULT_IDENTITY_CLIENT_OPTIONS](#variable-default_identity_client_options) |
|
|
165
|
+
| [KNOWN_IDENTITY_TYPES](#variable-known_identity_types) |
|
|
166
|
+
| [defaultIdentity](#variable-defaultidentity) |
|
|
167
|
+
|
|
168
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### Variable: DEFAULT_IDENTITY_CLIENT_OPTIONS
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
DEFAULT_IDENTITY_CLIENT_OPTIONS: IdentityClientOptions = {
|
|
176
|
+
protocolID: [1, "identity"],
|
|
177
|
+
keyID: "1",
|
|
178
|
+
tokenAmount: 1,
|
|
179
|
+
outputIndex: 0
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
See also: [IdentityClientOptions](./identity.md#interface-identityclientoptions)
|
|
184
|
+
|
|
185
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
### Variable: KNOWN_IDENTITY_TYPES
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
KNOWN_IDENTITY_TYPES = {
|
|
192
|
+
identiCert: "z40BOInXkI8m7f/wBrv4MJ09bZfzZbTj2fJqCtONqCY=",
|
|
193
|
+
discordCert: "2TgqRC35B1zehGmB21xveZNc7i5iqHc0uxMb+1NMPW4=",
|
|
194
|
+
phoneCert: "mffUklUzxbHr65xLohn0hRL0Tq2GjW1GYF/OPfzqJ6A=",
|
|
195
|
+
xCert: "vdDWvftf1H+5+ZprUw123kjHlywH+v20aPQTuXgMpNc=",
|
|
196
|
+
registrant: "YoPsbfR6YQczjzPdHCoGC7nJsOdPQR50+SYqcWpJ0y0=",
|
|
197
|
+
emailCert: "exOl3KM0dIJ04EW5pZgbZmPag6MdJXd3/a1enmUU/BA=",
|
|
198
|
+
anyone: "mfkOMfLDQmrr3SBxBQ5WeE+6Hy3VJRFq6w4A5Ljtlis=",
|
|
199
|
+
self: "Hkge6X5JRxt1cWXtHLCrSTg6dCVTxjQJJ48iOYd7n3g=",
|
|
200
|
+
coolCert: "AGfk/WrT1eBDXpz3mcw386Zww2HmqcIn3uY6x4Af1eo="
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
### Variable: defaultIdentity
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
defaultIdentity: DisplayableIdentity = {
|
|
211
|
+
name: "Unknown Identity",
|
|
212
|
+
avatarURL: "XUUB8bbn9fEthk15Ge3zTQXypUShfC94vFjp65v7u5CQ8qkpxzst",
|
|
213
|
+
identityKey: "",
|
|
214
|
+
abbreviatedKey: "",
|
|
215
|
+
badgeIconURL: "XUUV39HVPkpmMzYNTx7rpKzJvXfeiVyQWg2vfSpjBAuhunTCA9uG",
|
|
216
|
+
badgeLabel: "Not verified by anyone you trust.",
|
|
217
|
+
badgeClickURL: "https://projectbabbage.com/docs/unknown-identity"
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
See also: [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
222
|
+
|
|
223
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
224
|
+
|
|
225
|
+
---
|
package/docs/kvstore.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# API
|
|
2
|
+
|
|
3
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4
|
+
|
|
5
|
+
## Interfaces
|
|
6
|
+
|
|
7
|
+
## Classes
|
|
8
|
+
|
|
9
|
+
### Class: LocalKVStore
|
|
10
|
+
|
|
11
|
+
Implements a key-value storage system backed by transaction outputs managed by a wallet.
|
|
12
|
+
Each key-value pair is represented by a PushDrop token output in a specific context (basket).
|
|
13
|
+
Allows setting, getting, and removing key-value pairs, with optional encryption.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
export default class LocalKVStore {
|
|
17
|
+
constructor(wallet: WalletInterface = new WalletClient(), context = "kvstore-default", encrypt = true, originator?: string)
|
|
18
|
+
async get(key: string, defaultValue: string | undefined = undefined): Promise<string | undefined>
|
|
19
|
+
async set(key: string, value: string): Promise<OutpointString>
|
|
20
|
+
async remove(key: string): Promise<string[]>
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
See also: [OutpointString](./wallet.md#type-outpointstring), [WalletClient](./wallet.md#class-walletclient), [WalletInterface](./wallet.md#interface-walletinterface), [encrypt](./messages.md#variable-encrypt)
|
|
25
|
+
|
|
26
|
+
#### Constructor
|
|
27
|
+
|
|
28
|
+
Creates an instance of the localKVStore.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
constructor(wallet: WalletInterface = new WalletClient(), context = "kvstore-default", encrypt = true, originator?: string)
|
|
32
|
+
```
|
|
33
|
+
See also: [WalletClient](./wallet.md#class-walletclient), [WalletInterface](./wallet.md#interface-walletinterface), [encrypt](./messages.md#variable-encrypt)
|
|
34
|
+
|
|
35
|
+
Argument Details
|
|
36
|
+
|
|
37
|
+
+ **wallet**
|
|
38
|
+
+ The wallet interface to use. Defaults to a new WalletClient instance.
|
|
39
|
+
+ **context**
|
|
40
|
+
+ The context (basket) for namespacing keys. Defaults to 'kvstore-default'.
|
|
41
|
+
+ **encrypt**
|
|
42
|
+
+ Whether to encrypt values. Defaults to true.
|
|
43
|
+
+ **originator**
|
|
44
|
+
+ — An originator to use with PushDrop and the wallet, if provided.
|
|
45
|
+
|
|
46
|
+
Throws
|
|
47
|
+
|
|
48
|
+
If the context is missing or empty.
|
|
49
|
+
|
|
50
|
+
#### Method get
|
|
51
|
+
|
|
52
|
+
Retrieves the value associated with a given key.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
async get(key: string, defaultValue: string | undefined = undefined): Promise<string | undefined>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
|
|
60
|
+
A promise that resolves to the value as a string,
|
|
61
|
+
the defaultValue if the key is not found, or undefined if no defaultValue is provided.
|
|
62
|
+
|
|
63
|
+
Argument Details
|
|
64
|
+
|
|
65
|
+
+ **key**
|
|
66
|
+
+ The key to retrieve the value for.
|
|
67
|
+
+ **defaultValue**
|
|
68
|
+
+ The value to return if the key is not found.
|
|
69
|
+
|
|
70
|
+
Throws
|
|
71
|
+
|
|
72
|
+
If too many outputs are found for the key (ambiguous state).
|
|
73
|
+
|
|
74
|
+
If the found output's locking script cannot be decoded or represents an invalid token format.
|
|
75
|
+
|
|
76
|
+
#### Method remove
|
|
77
|
+
|
|
78
|
+
Removes the key-value pair associated with the given key.
|
|
79
|
+
It finds the existing output(s) for the key and spends them without creating a new output.
|
|
80
|
+
If multiple outputs exist, they are all spent in the same transaction.
|
|
81
|
+
If the key does not exist, it does nothing.
|
|
82
|
+
If signing the removal transaction fails, it relinquishes the original outputs instead of spending.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
async remove(key: string): Promise<string[]>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Returns
|
|
89
|
+
|
|
90
|
+
A promise that resolves to the txids of the removal transactions if successful.
|
|
91
|
+
|
|
92
|
+
Argument Details
|
|
93
|
+
|
|
94
|
+
+ **key**
|
|
95
|
+
+ The key to remove.
|
|
96
|
+
|
|
97
|
+
#### Method set
|
|
98
|
+
|
|
99
|
+
Sets or updates the value associated with a given key.
|
|
100
|
+
If the key already exists (one or more outputs found), it spends the existing output(s)
|
|
101
|
+
and creates a new one with the updated value. If multiple outputs exist for the key,
|
|
102
|
+
they are collapsed into a single new output.
|
|
103
|
+
If the key does not exist, it creates a new output.
|
|
104
|
+
Handles encryption if enabled.
|
|
105
|
+
If signing the update/collapse transaction fails, it relinquishes the original outputs and starts over with a new chain.
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
async set(key: string, value: string): Promise<OutpointString>
|
|
109
|
+
```
|
|
110
|
+
See also: [OutpointString](./wallet.md#type-outpointstring)
|
|
111
|
+
|
|
112
|
+
Returns
|
|
113
|
+
|
|
114
|
+
A promise that resolves to the outpoint string (txid.vout) of the new or updated token output.
|
|
115
|
+
|
|
116
|
+
Argument Details
|
|
117
|
+
|
|
118
|
+
+ **key**
|
|
119
|
+
+ The key to set or update.
|
|
120
|
+
+ **value**
|
|
121
|
+
+ The value to associate with the key.
|
|
122
|
+
|
|
123
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
## Functions
|
|
127
|
+
|
|
128
|
+
## Types
|
|
129
|
+
|
|
130
|
+
## Enums
|
|
131
|
+
|
|
132
|
+
## Variables
|
|
133
|
+
|