@bsv/wallet-toolbox 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/client.md +1617 -113
- package/docs/monitor.md +52 -0
- package/docs/wallet.md +1617 -113
- package/out/src/monitor/Monitor.d.ts.map +1 -1
- package/out/src/monitor/Monitor.js +3 -0
- package/out/src/monitor/Monitor.js.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.d.ts +40 -0
- package/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskUnFail.js +145 -0
- package/out/src/monitor/tasks/TaskUnFail.js.map +1 -0
- package/out/src/sdk/types.d.ts +3 -1
- package/out/src/sdk/types.d.ts.map +1 -1
- package/out/src/sdk/types.js.map +1 -1
- package/out/src/storage/StorageKnex.js +1 -1
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.js +2 -2
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/monitor/Monitor.ts +3 -0
- package/src/monitor/tasks/TaskUnFail.ts +151 -0
- package/src/sdk/types.ts +3 -0
- package/src/storage/StorageKnex.ts +1 -1
- package/src/storage/StorageProvider.ts +2 -2
package/docs/client.md
CHANGED
|
@@ -14,61 +14,65 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
14
14
|
|
|
15
15
|
| | | |
|
|
16
16
|
| --- | --- | --- |
|
|
17
|
-
| [ArcConfig](#interface-arcconfig) | [
|
|
18
|
-
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [
|
|
19
|
-
| [AuthId](#interface-authid) | [
|
|
20
|
-
| [AuthPayload](#interface-authpayload) | [
|
|
21
|
-
| [BaseBlockHeader](#interface-baseblockheader) | [
|
|
22
|
-
| [BitailsConfig](#interface-bitailsconfig) | [
|
|
23
|
-
| [BitailsMerkleProof](#interface-bitailsmerkleproof) | [
|
|
24
|
-
| [BlockHeader](#interface-blockheader) | [
|
|
25
|
-
| [BsvExchangeRate](#interface-bsvexchangerate) | [
|
|
26
|
-
| [CertOpsWallet](#interface-certopswallet) | [
|
|
27
|
-
| [Certifier](#interface-certifier) | [
|
|
28
|
-
| [CommitNewTxResults](#interface-commitnewtxresults) | [
|
|
29
|
-
| [CompleteAuthResponse](#interface-completeauthresponse) | [
|
|
30
|
-
| [EntitySyncMap](#interface-entitysyncmap) | [
|
|
31
|
-
| [EntityTimeStamp](#interface-entitytimestamp) | [
|
|
32
|
-
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [
|
|
33
|
-
| [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [
|
|
34
|
-
| [FiatExchangeRates](#interface-fiatexchangerates) | [
|
|
35
|
-
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [
|
|
36
|
-
| [FindCertificatesArgs](#interface-findcertificatesargs) | [
|
|
37
|
-
| [FindCommissionsArgs](#interface-findcommissionsargs) | [
|
|
38
|
-
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [
|
|
39
|
-
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [
|
|
40
|
-
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [
|
|
41
|
-
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [
|
|
42
|
-
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [
|
|
43
|
-
| [FindOutputsArgs](#interface-findoutputsargs) | [
|
|
44
|
-
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [
|
|
45
|
-
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [
|
|
46
|
-
| [FindProvenTxsArgs](#interface-findproventxsargs) | [
|
|
47
|
-
| [FindSincePagedArgs](#interface-findsincepagedargs) | [
|
|
48
|
-
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [
|
|
49
|
-
| [FindTransactionsArgs](#interface-findtransactionsargs) | [
|
|
50
|
-
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [
|
|
51
|
-
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [
|
|
52
|
-
| [FindUsersArgs](#interface-findusersargs) | [
|
|
53
|
-
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [
|
|
54
|
-
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [
|
|
55
|
-
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [
|
|
56
|
-
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [
|
|
57
|
-
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [
|
|
58
|
-
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [
|
|
59
|
-
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [
|
|
60
|
-
| [GetMerklePathResult](#interface-getmerklepathresult) | [
|
|
61
|
-
| [GetRawTxResult](#interface-getrawtxresult) | [
|
|
62
|
-
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [
|
|
63
|
-
| [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [
|
|
64
|
-
| [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [
|
|
65
|
-
| [GetUtxoStatusResult](#interface-getutxostatusresult) | [
|
|
66
|
-
| [KeyPair](#interface-keypair) | [
|
|
67
|
-
| [
|
|
68
|
-
| [
|
|
69
|
-
| [
|
|
70
|
-
| [
|
|
71
|
-
| [
|
|
17
|
+
| [ArcConfig](#interface-arcconfig) | [PermissionsManagerConfig](#interface-permissionsmanagerconfig) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) |
|
|
18
|
+
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [PostBeefResult](#interface-postbeefresult) | [TableSettings](#interface-tablesettings) |
|
|
19
|
+
| [AuthId](#interface-authid) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TableSyncState](#interface-tablesyncstate) |
|
|
20
|
+
| [AuthPayload](#interface-authpayload) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TableTransaction](#interface-tabletransaction) |
|
|
21
|
+
| [BaseBlockHeader](#interface-baseblockheader) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TableTxLabel](#interface-tabletxlabel) |
|
|
22
|
+
| [BitailsConfig](#interface-bitailsconfig) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [TableTxLabelMap](#interface-tabletxlabelmap) |
|
|
23
|
+
| [BitailsMerkleProof](#interface-bitailsmerkleproof) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [TableUser](#interface-tableuser) |
|
|
24
|
+
| [BlockHeader](#interface-blockheader) | [PostTxsResult](#interface-posttxsresult) | [TaskPurgeParams](#interface-taskpurgeparams) |
|
|
25
|
+
| [BsvExchangeRate](#interface-bsvexchangerate) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [TrustSettings](#interface-trustsettings) |
|
|
26
|
+
| [CertOpsWallet](#interface-certopswallet) | [ProvenOrRawTx](#interface-provenorrawtx) | [TrxToken](#interface-trxtoken) |
|
|
27
|
+
| [Certifier](#interface-certifier) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
|
|
28
|
+
| [CommitNewTxResults](#interface-commitnewtxresults) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [TxScriptOffsets](#interface-txscriptoffsets) |
|
|
29
|
+
| [CompleteAuthResponse](#interface-completeauthresponse) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [UMPToken](#interface-umptoken) |
|
|
30
|
+
| [EntitySyncMap](#interface-entitysyncmap) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [UMPTokenInteractor](#interface-umptokeninteractor) |
|
|
31
|
+
| [EntityTimeStamp](#interface-entitytimestamp) | [PurgeParams](#interface-purgeparams) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
|
|
32
|
+
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [PurgeResults](#interface-purgeresults) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
|
|
33
|
+
| [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidAbortActionArgs](#interface-validabortactionargs) |
|
|
34
|
+
| [FiatExchangeRates](#interface-fiatexchangerates) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
|
|
35
|
+
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
|
|
36
|
+
| [FindCertificatesArgs](#interface-findcertificatesargs) | [SetupEnv](#interface-setupenv) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
|
|
37
|
+
| [FindCommissionsArgs](#interface-findcommissionsargs) | [SetupWallet](#interface-setupwallet) | [ValidBasketInsertion](#interface-validbasketinsertion) |
|
|
38
|
+
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [SetupWalletArgs](#interface-setupwalletargs) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
|
|
39
|
+
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [SetupWalletClient](#interface-setupwalletclient) | [ValidCreateActionInput](#interface-validcreateactioninput) |
|
|
40
|
+
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [SetupWalletClientArgs](#interface-setupwalletclientargs) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
|
|
41
|
+
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [SetupWalletKnex](#interface-setupwalletknex) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
|
|
42
|
+
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [SetupWalletKnexArgs](#interface-setupwalletknexargs) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
|
|
43
|
+
| [FindOutputsArgs](#interface-findoutputsargs) | [SetupWalletMySQLArgs](#interface-setupwalletmysqlargs) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
|
|
44
|
+
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [SetupWalletSQLiteArgs](#interface-setupwalletsqliteargs) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
|
|
45
|
+
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [StartAuthResponse](#interface-startauthresponse) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
|
|
46
|
+
| [FindProvenTxsArgs](#interface-findproventxsargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [ValidListActionsArgs](#interface-validlistactionsargs) |
|
|
47
|
+
| [FindSincePagedArgs](#interface-findsincepagedargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
|
|
48
|
+
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
|
|
49
|
+
| [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageFeeModel](#interface-storagefeemodel) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
|
|
50
|
+
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
|
|
51
|
+
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageIdentity](#interface-storageidentity) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
|
|
52
|
+
| [FindUsersArgs](#interface-findusersargs) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
|
|
53
|
+
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageKnexOptions](#interface-storageknexoptions) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
|
|
54
|
+
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [ValidSignActionArgs](#interface-validsignactionargs) |
|
|
55
|
+
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [ValidSignActionOptions](#interface-validsignactionoptions) |
|
|
56
|
+
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageProvenOrReq](#interface-storageprovenorreq) | [ValidWalletPayment](#interface-validwalletpayment) |
|
|
57
|
+
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [StorageProviderOptions](#interface-storageprovideroptions) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
|
|
58
|
+
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [StorageReaderOptions](#interface-storagereaderoptions) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
|
|
59
|
+
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [WalletArgs](#interface-walletargs) |
|
|
60
|
+
| [GetMerklePathResult](#interface-getmerklepathresult) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [WalletBalance](#interface-walletbalance) |
|
|
61
|
+
| [GetRawTxResult](#interface-getrawtxresult) | [SyncChunk](#interface-syncchunk) | [WalletPermissionsManagerCallbacks](#interface-walletpermissionsmanagercallbacks) |
|
|
62
|
+
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [SyncError](#interface-syncerror) | [WalletServices](#interface-walletservices) |
|
|
63
|
+
| [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [SyncMap](#interface-syncmap) | [WalletServicesOptions](#interface-walletservicesoptions) |
|
|
64
|
+
| [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [TableCertificate](#interface-tablecertificate) | [WalletSettings](#interface-walletsettings) |
|
|
65
|
+
| [GetUtxoStatusResult](#interface-getutxostatusresult) | [TableCertificateField](#interface-tablecertificatefield) | [WalletSettingsManagerConfig](#interface-walletsettingsmanagerconfig) |
|
|
66
|
+
| [KeyPair](#interface-keypair) | [TableCertificateX](#interface-tablecertificatex) | [WalletSigner](#interface-walletsigner) |
|
|
67
|
+
| [KeyPairAddress](#interface-keypairaddress) | [TableCommission](#interface-tablecommission) | [WalletStorage](#interface-walletstorage) |
|
|
68
|
+
| [MonitorDaemonSetup](#interface-monitordaemonsetup) | [TableMonitorEvent](#interface-tablemonitorevent) | [WalletStorageProvider](#interface-walletstorageprovider) |
|
|
69
|
+
| [MonitorOptions](#interface-monitoroptions) | [TableOutput](#interface-tableoutput) | [WalletStorageReader](#interface-walletstoragereader) |
|
|
70
|
+
| [OutPoint](#interface-outpoint) | [TableOutputBasket](#interface-tableoutputbasket) | [WalletStorageServerOptions](#interface-walletstorageserveroptions) |
|
|
71
|
+
| [Paged](#interface-paged) | [TableOutputTag](#interface-tableoutputtag) | [WalletStorageSync](#interface-walletstoragesync) |
|
|
72
|
+
| [PendingSignAction](#interface-pendingsignaction) | [TableOutputTagMap](#interface-tableoutputtagmap) | [WalletStorageSyncReader](#interface-walletstoragesyncreader) |
|
|
73
|
+
| [PendingStorageInput](#interface-pendingstorageinput) | [TableOutputX](#interface-tableoutputx) | [WalletStorageWriter](#interface-walletstoragewriter) |
|
|
74
|
+
| [PermissionRequest](#interface-permissionrequest) | [TableProvenTx](#interface-tableproventx) | [WalletTheme](#interface-wallettheme) |
|
|
75
|
+
| [PermissionToken](#interface-permissiontoken) | [TableProvenTxReq](#interface-tableproventxreq) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
72
76
|
|
|
73
77
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
74
78
|
|
|
@@ -1151,6 +1155,44 @@ export interface KeyPair {
|
|
|
1151
1155
|
|
|
1152
1156
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1153
1157
|
|
|
1158
|
+
---
|
|
1159
|
+
##### Interface: KeyPairAddress
|
|
1160
|
+
|
|
1161
|
+
A private key and associated public key and address.
|
|
1162
|
+
|
|
1163
|
+
```ts
|
|
1164
|
+
export interface KeyPairAddress {
|
|
1165
|
+
privateKey: PrivateKey;
|
|
1166
|
+
publicKey: PublicKey;
|
|
1167
|
+
address: string;
|
|
1168
|
+
}
|
|
1169
|
+
```
|
|
1170
|
+
|
|
1171
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1172
|
+
|
|
1173
|
+
---
|
|
1174
|
+
##### Interface: MonitorDaemonSetup
|
|
1175
|
+
|
|
1176
|
+
```ts
|
|
1177
|
+
export interface MonitorDaemonSetup {
|
|
1178
|
+
chain?: sdk.Chain;
|
|
1179
|
+
sqliteFilename?: string;
|
|
1180
|
+
mySQLConnection?: string;
|
|
1181
|
+
knexConfig?: Knex.Config;
|
|
1182
|
+
knex?: Knex<any, any[]>;
|
|
1183
|
+
storageKnexOptions?: StorageKnexOptions;
|
|
1184
|
+
storageProvider?: StorageProvider;
|
|
1185
|
+
storageManager?: WalletStorageManager;
|
|
1186
|
+
servicesOptions?: sdk.WalletServicesOptions;
|
|
1187
|
+
services?: Services;
|
|
1188
|
+
monitor?: Monitor;
|
|
1189
|
+
}
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [Services](./services.md#class-services), [StorageKnexOptions](./storage.md#interface-storageknexoptions), [StorageProvider](./storage.md#class-storageprovider), [WalletServicesOptions](./client.md#interface-walletservicesoptions), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
1193
|
+
|
|
1194
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1195
|
+
|
|
1154
1196
|
---
|
|
1155
1197
|
##### Interface: MonitorOptions
|
|
1156
1198
|
|
|
@@ -2123,6 +2165,378 @@ export interface ScriptTemplateUnlock {
|
|
|
2123
2165
|
|
|
2124
2166
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2125
2167
|
|
|
2168
|
+
---
|
|
2169
|
+
##### Interface: SetupEnv
|
|
2170
|
+
|
|
2171
|
+
`SetupEnv` provides a starting point for managing secrets that
|
|
2172
|
+
must not appear in source code.
|
|
2173
|
+
|
|
2174
|
+
The `makeEnv` and `getEnv` functions of the `Setup` and `SetupClient` classes
|
|
2175
|
+
provide an easy way to create and import these secrets and related properties.
|
|
2176
|
+
|
|
2177
|
+
```ts
|
|
2178
|
+
export interface SetupEnv {
|
|
2179
|
+
chain: sdk.Chain;
|
|
2180
|
+
identityKey: string;
|
|
2181
|
+
identityKey2: string;
|
|
2182
|
+
filePath: string | undefined;
|
|
2183
|
+
taalApiKey: string;
|
|
2184
|
+
devKeys: Record<string, string>;
|
|
2185
|
+
mySQLConnection: string;
|
|
2186
|
+
}
|
|
2187
|
+
```
|
|
2188
|
+
|
|
2189
|
+
See also: [Chain](./client.md#type-chain)
|
|
2190
|
+
|
|
2191
|
+
###### Property chain
|
|
2192
|
+
|
|
2193
|
+
The chan being accessed: 'main' for mainnet, 'test' for 'testnet'.
|
|
2194
|
+
|
|
2195
|
+
```ts
|
|
2196
|
+
chain: sdk.Chain
|
|
2197
|
+
```
|
|
2198
|
+
See also: [Chain](./client.md#type-chain)
|
|
2199
|
+
|
|
2200
|
+
###### Property devKeys
|
|
2201
|
+
|
|
2202
|
+
A map of public keys (identity keys, hex strings) to private keys (hex strings).
|
|
2203
|
+
|
|
2204
|
+
```ts
|
|
2205
|
+
devKeys: Record<string, string>
|
|
2206
|
+
```
|
|
2207
|
+
|
|
2208
|
+
###### Property filePath
|
|
2209
|
+
|
|
2210
|
+
Filepath to sqlite file to be used for identityKey wallet.
|
|
2211
|
+
|
|
2212
|
+
```ts
|
|
2213
|
+
filePath: string | undefined
|
|
2214
|
+
```
|
|
2215
|
+
|
|
2216
|
+
###### Property identityKey
|
|
2217
|
+
|
|
2218
|
+
The user's primary identity key (public key).
|
|
2219
|
+
|
|
2220
|
+
```ts
|
|
2221
|
+
identityKey: string
|
|
2222
|
+
```
|
|
2223
|
+
|
|
2224
|
+
###### Property identityKey2
|
|
2225
|
+
|
|
2226
|
+
A secondary identity key (public key), used to test exchanges with other users.
|
|
2227
|
+
|
|
2228
|
+
```ts
|
|
2229
|
+
identityKey2: string
|
|
2230
|
+
```
|
|
2231
|
+
|
|
2232
|
+
###### Property mySQLConnection
|
|
2233
|
+
|
|
2234
|
+
A MySQL connection string including user and password properties.
|
|
2235
|
+
Must be valid to make use of MySQL `Setup` class support.
|
|
2236
|
+
|
|
2237
|
+
```ts
|
|
2238
|
+
mySQLConnection: string
|
|
2239
|
+
```
|
|
2240
|
+
|
|
2241
|
+
###### Property taalApiKey
|
|
2242
|
+
|
|
2243
|
+
A vaild TAAL API key for use by `Services`
|
|
2244
|
+
|
|
2245
|
+
```ts
|
|
2246
|
+
taalApiKey: string
|
|
2247
|
+
```
|
|
2248
|
+
|
|
2249
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2250
|
+
|
|
2251
|
+
---
|
|
2252
|
+
##### Interface: SetupWallet
|
|
2253
|
+
|
|
2254
|
+
When creating a BRC-100 compatible `Wallet`, many components come into play.
|
|
2255
|
+
|
|
2256
|
+
All of the `createWallet` functions in the `Setup` and `SetupClient` classes return
|
|
2257
|
+
an object with direct access to each component to facilitate experimentation, testing
|
|
2258
|
+
and customization.
|
|
2259
|
+
|
|
2260
|
+
```ts
|
|
2261
|
+
export interface SetupWallet {
|
|
2262
|
+
rootKey: PrivateKey;
|
|
2263
|
+
identityKey: string;
|
|
2264
|
+
keyDeriver: KeyDeriver;
|
|
2265
|
+
chain: sdk.Chain;
|
|
2266
|
+
storage: WalletStorageManager;
|
|
2267
|
+
services: Services;
|
|
2268
|
+
monitor: Monitor;
|
|
2269
|
+
wallet: Wallet;
|
|
2270
|
+
}
|
|
2271
|
+
```
|
|
2272
|
+
|
|
2273
|
+
See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [Services](./services.md#class-services), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
2274
|
+
|
|
2275
|
+
###### Property chain
|
|
2276
|
+
|
|
2277
|
+
The chain ('main' or 'test') which the wallet accesses.
|
|
2278
|
+
|
|
2279
|
+
```ts
|
|
2280
|
+
chain: sdk.Chain
|
|
2281
|
+
```
|
|
2282
|
+
See also: [Chain](./client.md#type-chain)
|
|
2283
|
+
|
|
2284
|
+
###### Property identityKey
|
|
2285
|
+
|
|
2286
|
+
The pubilc key associated with the `rootKey` which also serves as the wallet's identity.
|
|
2287
|
+
|
|
2288
|
+
```ts
|
|
2289
|
+
identityKey: string
|
|
2290
|
+
```
|
|
2291
|
+
|
|
2292
|
+
###### Property keyDeriver
|
|
2293
|
+
|
|
2294
|
+
The `KeyDeriver` component used by the wallet for key derivation and cryptographic functions.
|
|
2295
|
+
|
|
2296
|
+
```ts
|
|
2297
|
+
keyDeriver: KeyDeriver
|
|
2298
|
+
```
|
|
2299
|
+
|
|
2300
|
+
###### Property monitor
|
|
2301
|
+
|
|
2302
|
+
The background task `Monitor` component available to the wallet to offload tasks
|
|
2303
|
+
that speed up wallet operations and maintain data integrity.
|
|
2304
|
+
|
|
2305
|
+
```ts
|
|
2306
|
+
monitor: Monitor
|
|
2307
|
+
```
|
|
2308
|
+
See also: [Monitor](./monitor.md#class-monitor)
|
|
2309
|
+
|
|
2310
|
+
###### Property rootKey
|
|
2311
|
+
|
|
2312
|
+
The rootKey of the `KeyDeriver`. The private key from which other keys are derived.
|
|
2313
|
+
|
|
2314
|
+
```ts
|
|
2315
|
+
rootKey: PrivateKey
|
|
2316
|
+
```
|
|
2317
|
+
|
|
2318
|
+
###### Property services
|
|
2319
|
+
|
|
2320
|
+
The network `Services` component which provides the wallet with access to external services hosted
|
|
2321
|
+
on the public network.
|
|
2322
|
+
|
|
2323
|
+
```ts
|
|
2324
|
+
services: Services
|
|
2325
|
+
```
|
|
2326
|
+
See also: [Services](./services.md#class-services)
|
|
2327
|
+
|
|
2328
|
+
###### Property storage
|
|
2329
|
+
|
|
2330
|
+
The `WalletStorageManager` that manages all the configured storage providers (active and backups)
|
|
2331
|
+
accessed by the wallet.
|
|
2332
|
+
|
|
2333
|
+
```ts
|
|
2334
|
+
storage: WalletStorageManager
|
|
2335
|
+
```
|
|
2336
|
+
See also: [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
2337
|
+
|
|
2338
|
+
###### Property wallet
|
|
2339
|
+
|
|
2340
|
+
The actual BRC-100 `Wallet` to which all the other properties and components contribute.
|
|
2341
|
+
|
|
2342
|
+
Note that internally, the wallet is itself linked to all these properties and components.
|
|
2343
|
+
They are included in this interface to facilitate access after wallet construction for
|
|
2344
|
+
experimentation, testing and customization. Any changes made to the configuration of these
|
|
2345
|
+
components after construction may disrupt the normal operation of the wallet.
|
|
2346
|
+
|
|
2347
|
+
```ts
|
|
2348
|
+
wallet: Wallet
|
|
2349
|
+
```
|
|
2350
|
+
See also: [Wallet](./client.md#class-wallet)
|
|
2351
|
+
|
|
2352
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2353
|
+
|
|
2354
|
+
---
|
|
2355
|
+
##### Interface: SetupWalletArgs
|
|
2356
|
+
|
|
2357
|
+
Arguments used by `createWallet` to construct a `SetupWallet`.
|
|
2358
|
+
|
|
2359
|
+
Extension `SetupWalletClientArgs` used by `createWalletClient` to construct a `SetupWalletClient`.
|
|
2360
|
+
|
|
2361
|
+
Extension `SetupWalletKnexArgs` used by `createWalletKnex` to construct a `SetupWalletKnex`.
|
|
2362
|
+
|
|
2363
|
+
Extension `SetupWalletMySQLArgs` used by `createWalletMySQL` to construct a `SetupWalletKnex`.
|
|
2364
|
+
|
|
2365
|
+
Extension `SetupWalletSQLiteArgs` used by `createWalletSQLite` to construct a `SetupWalletKnex`.
|
|
2366
|
+
|
|
2367
|
+
```ts
|
|
2368
|
+
export interface SetupWalletArgs {
|
|
2369
|
+
env: SetupEnv;
|
|
2370
|
+
rootKeyHex?: string;
|
|
2371
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
2372
|
+
active?: sdk.WalletStorageProvider;
|
|
2373
|
+
backups?: sdk.WalletStorageProvider[];
|
|
2374
|
+
}
|
|
2375
|
+
```
|
|
2376
|
+
|
|
2377
|
+
See also: [SetupEnv](./setup.md#interface-setupenv), [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
2378
|
+
|
|
2379
|
+
###### Property active
|
|
2380
|
+
|
|
2381
|
+
Optional. Active wallet storage. Can be added later.
|
|
2382
|
+
|
|
2383
|
+
```ts
|
|
2384
|
+
active?: sdk.WalletStorageProvider
|
|
2385
|
+
```
|
|
2386
|
+
See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
2387
|
+
|
|
2388
|
+
###### Property backups
|
|
2389
|
+
|
|
2390
|
+
Optional. One or more storage providers managed as backup destinations. Can be added later.
|
|
2391
|
+
|
|
2392
|
+
```ts
|
|
2393
|
+
backups?: sdk.WalletStorageProvider[]
|
|
2394
|
+
```
|
|
2395
|
+
See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
2396
|
+
|
|
2397
|
+
###### Property env
|
|
2398
|
+
|
|
2399
|
+
Configuration "secrets" typically obtained by `Setup.makeEnv` and `Setup.getEnv` functions.
|
|
2400
|
+
|
|
2401
|
+
```ts
|
|
2402
|
+
env: SetupEnv
|
|
2403
|
+
```
|
|
2404
|
+
See also: [SetupEnv](./setup.md#interface-setupenv)
|
|
2405
|
+
|
|
2406
|
+
###### Property privilegedKeyGetter
|
|
2407
|
+
|
|
2408
|
+
Optional. The privileged private key getter used to initialize the `PrivilegedKeyManager`.
|
|
2409
|
+
Defaults to undefined.
|
|
2410
|
+
|
|
2411
|
+
```ts
|
|
2412
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>
|
|
2413
|
+
```
|
|
2414
|
+
|
|
2415
|
+
###### Property rootKeyHex
|
|
2416
|
+
|
|
2417
|
+
Optional. The non-privileged private key used to initialize the `KeyDeriver` and determine the `identityKey`.
|
|
2418
|
+
Defaults to `env.devKeys[env.identityKey]
|
|
2419
|
+
|
|
2420
|
+
```ts
|
|
2421
|
+
rootKeyHex?: string
|
|
2422
|
+
```
|
|
2423
|
+
|
|
2424
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2425
|
+
|
|
2426
|
+
---
|
|
2427
|
+
##### Interface: SetupWalletClient
|
|
2428
|
+
|
|
2429
|
+
Extension `SetupWalletClient` of `SetupWallet` is returned by `createWalletClient`
|
|
2430
|
+
|
|
2431
|
+
```ts
|
|
2432
|
+
export interface SetupWalletClient extends SetupWallet {
|
|
2433
|
+
endpointUrl: string;
|
|
2434
|
+
}
|
|
2435
|
+
```
|
|
2436
|
+
|
|
2437
|
+
See also: [SetupWallet](./setup.md#interface-setupwallet)
|
|
2438
|
+
|
|
2439
|
+
###### Property endpointUrl
|
|
2440
|
+
|
|
2441
|
+
The endpoint URL of the service hosting the `StorageServer` JSON-RPC service to
|
|
2442
|
+
which a `StorageClient` instance is connected to function as
|
|
2443
|
+
the active storage provider of the wallet.
|
|
2444
|
+
|
|
2445
|
+
```ts
|
|
2446
|
+
endpointUrl: string
|
|
2447
|
+
```
|
|
2448
|
+
|
|
2449
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2450
|
+
|
|
2451
|
+
---
|
|
2452
|
+
##### Interface: SetupWalletClientArgs
|
|
2453
|
+
|
|
2454
|
+
Extension `SetupWalletClientArgs` of `SetupWalletArgs` is used by `createWalletClient`
|
|
2455
|
+
to construct a `SetupWalletClient`.
|
|
2456
|
+
|
|
2457
|
+
```ts
|
|
2458
|
+
export interface SetupWalletClientArgs extends SetupWalletArgs {
|
|
2459
|
+
endpointUrl?: string;
|
|
2460
|
+
}
|
|
2461
|
+
```
|
|
2462
|
+
|
|
2463
|
+
See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
|
|
2464
|
+
|
|
2465
|
+
###### Property endpointUrl
|
|
2466
|
+
|
|
2467
|
+
The endpoint URL of a service hosting the `StorageServer` JSON-RPC service to
|
|
2468
|
+
which a `StorageClient` instance should connect to function as
|
|
2469
|
+
the active storage provider of the newly created wallet.
|
|
2470
|
+
|
|
2471
|
+
```ts
|
|
2472
|
+
endpointUrl?: string
|
|
2473
|
+
```
|
|
2474
|
+
|
|
2475
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2476
|
+
|
|
2477
|
+
---
|
|
2478
|
+
##### Interface: SetupWalletKnex
|
|
2479
|
+
|
|
2480
|
+
```ts
|
|
2481
|
+
export interface SetupWalletKnex extends SetupWallet {
|
|
2482
|
+
activeStorage: StorageKnex;
|
|
2483
|
+
userId: number;
|
|
2484
|
+
rootKey: PrivateKey;
|
|
2485
|
+
identityKey: string;
|
|
2486
|
+
keyDeriver: KeyDeriver;
|
|
2487
|
+
chain: sdk.Chain;
|
|
2488
|
+
storage: WalletStorageManager;
|
|
2489
|
+
services: Services;
|
|
2490
|
+
monitor: Monitor;
|
|
2491
|
+
wallet: Wallet;
|
|
2492
|
+
}
|
|
2493
|
+
```
|
|
2494
|
+
|
|
2495
|
+
See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [Services](./services.md#class-services), [SetupWallet](./setup.md#interface-setupwallet), [StorageKnex](./storage.md#class-storageknex), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
2496
|
+
|
|
2497
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2498
|
+
|
|
2499
|
+
---
|
|
2500
|
+
##### Interface: SetupWalletKnexArgs
|
|
2501
|
+
|
|
2502
|
+
```ts
|
|
2503
|
+
export interface SetupWalletKnexArgs extends SetupWalletArgs {
|
|
2504
|
+
knex: Knex<any, any[]>;
|
|
2505
|
+
databaseName: string;
|
|
2506
|
+
}
|
|
2507
|
+
```
|
|
2508
|
+
|
|
2509
|
+
See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
|
|
2510
|
+
|
|
2511
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2512
|
+
|
|
2513
|
+
---
|
|
2514
|
+
##### Interface: SetupWalletMySQLArgs
|
|
2515
|
+
|
|
2516
|
+
```ts
|
|
2517
|
+
export interface SetupWalletMySQLArgs extends SetupWalletArgs {
|
|
2518
|
+
databaseName: string;
|
|
2519
|
+
}
|
|
2520
|
+
```
|
|
2521
|
+
|
|
2522
|
+
See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
|
|
2523
|
+
|
|
2524
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2525
|
+
|
|
2526
|
+
---
|
|
2527
|
+
##### Interface: SetupWalletSQLiteArgs
|
|
2528
|
+
|
|
2529
|
+
```ts
|
|
2530
|
+
export interface SetupWalletSQLiteArgs extends SetupWalletArgs {
|
|
2531
|
+
filePath: string;
|
|
2532
|
+
databaseName: string;
|
|
2533
|
+
}
|
|
2534
|
+
```
|
|
2535
|
+
|
|
2536
|
+
See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
|
|
2537
|
+
|
|
2538
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2539
|
+
|
|
2126
2540
|
---
|
|
2127
2541
|
##### Interface: StartAuthResponse
|
|
2128
2542
|
|
|
@@ -2368,6 +2782,27 @@ txid: string
|
|
|
2368
2782
|
|
|
2369
2783
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2370
2784
|
|
|
2785
|
+
---
|
|
2786
|
+
##### Interface: StorageKnexOptions
|
|
2787
|
+
|
|
2788
|
+
```ts
|
|
2789
|
+
export interface StorageKnexOptions extends StorageProviderOptions {
|
|
2790
|
+
knex: Knex;
|
|
2791
|
+
}
|
|
2792
|
+
```
|
|
2793
|
+
|
|
2794
|
+
See also: [StorageProviderOptions](./storage.md#interface-storageprovideroptions)
|
|
2795
|
+
|
|
2796
|
+
###### Property knex
|
|
2797
|
+
|
|
2798
|
+
Knex database interface initialized with valid connection configuration.
|
|
2799
|
+
|
|
2800
|
+
```ts
|
|
2801
|
+
knex: Knex
|
|
2802
|
+
```
|
|
2803
|
+
|
|
2804
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2805
|
+
|
|
2371
2806
|
---
|
|
2372
2807
|
##### Interface: StorageProcessActionArgs
|
|
2373
2808
|
|
|
@@ -4310,6 +4745,22 @@ See also: [AuthId](./client.md#interface-authid), [FindCertificatesArgs](./clien
|
|
|
4310
4745
|
|
|
4311
4746
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4312
4747
|
|
|
4748
|
+
---
|
|
4749
|
+
##### Interface: WalletStorageServerOptions
|
|
4750
|
+
|
|
4751
|
+
```ts
|
|
4752
|
+
export interface WalletStorageServerOptions {
|
|
4753
|
+
port: number;
|
|
4754
|
+
wallet: Wallet;
|
|
4755
|
+
monetize: boolean;
|
|
4756
|
+
calculateRequestPrice?: (req: Request) => number | Promise<number>;
|
|
4757
|
+
}
|
|
4758
|
+
```
|
|
4759
|
+
|
|
4760
|
+
See also: [Wallet](./client.md#class-wallet)
|
|
4761
|
+
|
|
4762
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4763
|
+
|
|
4313
4764
|
---
|
|
4314
4765
|
##### Interface: WalletStorageSync
|
|
4315
4766
|
|
|
@@ -4413,28 +4864,30 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4413
4864
|
|
|
4414
4865
|
| | | |
|
|
4415
4866
|
| --- | --- | --- |
|
|
4416
|
-
| [ARC](#class-arc) | [PersonaIDInteractor](#class-personaidinteractor) | [
|
|
4417
|
-
| [AuthMethodInteractor](#class-authmethodinteractor) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [
|
|
4418
|
-
| [Bitails](#class-bitails) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [
|
|
4419
|
-
| [CWIStyleWalletManager](#class-cwistylewalletmanager) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [
|
|
4420
|
-
| [EntityBase](#class-entitybase) | [ServiceCollection](#class-servicecollection) | [
|
|
4421
|
-
| [EntityCertificate](#class-entitycertificate) | [Services](#class-services) | [
|
|
4422
|
-
| [EntityCertificateField](#class-entitycertificatefield) | [
|
|
4423
|
-
| [EntityCommission](#class-entitycommission) | [
|
|
4424
|
-
| [EntityOutput](#class-entityoutput) | [
|
|
4425
|
-
| [EntityOutputBasket](#class-entityoutputbasket) | [
|
|
4426
|
-
| [EntityOutputTag](#class-entityoutputtag) | [
|
|
4427
|
-
| [EntityOutputTagMap](#class-entityoutputtagmap) | [
|
|
4428
|
-
| [EntityProvenTx](#class-entityproventx) | [
|
|
4429
|
-
| [EntityProvenTxReq](#class-entityproventxreq) | [
|
|
4430
|
-
| [EntitySyncState](#class-entitysyncstate) | [
|
|
4431
|
-
| [EntityTransaction](#class-entitytransaction) | [
|
|
4432
|
-
| [EntityTxLabel](#class-entitytxlabel) | [
|
|
4433
|
-
| [EntityTxLabelMap](#class-entitytxlabelmap) | [
|
|
4434
|
-
| [EntityUser](#class-entityuser) | [
|
|
4435
|
-
| [
|
|
4436
|
-
| [
|
|
4437
|
-
| [
|
|
4867
|
+
| [ARC](#class-arc) | [PersonaIDInteractor](#class-personaidinteractor) | [TwilioPhoneInteractor](#class-twiliophoneinteractor) |
|
|
4868
|
+
| [AuthMethodInteractor](#class-authmethodinteractor) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [WABClient](#class-wabclient) |
|
|
4869
|
+
| [Bitails](#class-bitails) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [WERR_BAD_REQUEST](#class-werr_bad_request) |
|
|
4870
|
+
| [CWIStyleWalletManager](#class-cwistylewalletmanager) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [WERR_BROADCAST_UNAVAILABLE](#class-werr_broadcast_unavailable) |
|
|
4871
|
+
| [EntityBase](#class-entitybase) | [ServiceCollection](#class-servicecollection) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) |
|
|
4872
|
+
| [EntityCertificate](#class-entitycertificate) | [Services](#class-services) | [WERR_INTERNAL](#class-werr_internal) |
|
|
4873
|
+
| [EntityCertificateField](#class-entitycertificatefield) | [Setup](#class-setup) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) |
|
|
4874
|
+
| [EntityCommission](#class-entitycommission) | [SimpleWalletManager](#class-simplewalletmanager) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
|
|
4875
|
+
| [EntityOutput](#class-entityoutput) | [StorageClient](#class-storageclient) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
|
|
4876
|
+
| [EntityOutputBasket](#class-entityoutputbasket) | [StorageKnex](#class-storageknex) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
|
|
4877
|
+
| [EntityOutputTag](#class-entityoutputtag) | [StorageProvider](#class-storageprovider) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
|
|
4878
|
+
| [EntityOutputTagMap](#class-entityoutputtagmap) | [StorageReader](#class-storagereader) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
|
|
4879
|
+
| [EntityProvenTx](#class-entityproventx) | [StorageReaderWriter](#class-storagereaderwriter) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
|
|
4880
|
+
| [EntityProvenTxReq](#class-entityproventxreq) | [StorageServer](#class-storageserver) | [WERR_UNAUTHORIZED](#class-werr_unauthorized) |
|
|
4881
|
+
| [EntitySyncState](#class-entitysyncstate) | [StorageSyncReader](#class-storagesyncreader) | [Wallet](#class-wallet) |
|
|
4882
|
+
| [EntityTransaction](#class-entitytransaction) | [TaskCheckForProofs](#class-taskcheckforproofs) | [WalletAuthenticationManager](#class-walletauthenticationmanager) |
|
|
4883
|
+
| [EntityTxLabel](#class-entitytxlabel) | [TaskClock](#class-taskclock) | [WalletError](#class-walleterror) |
|
|
4884
|
+
| [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskFailAbandoned](#class-taskfailabandoned) | [WalletMonitorTask](#class-walletmonitortask) |
|
|
4885
|
+
| [EntityUser](#class-entityuser) | [TaskNewHeader](#class-tasknewheader) | [WalletPermissionsManager](#class-walletpermissionsmanager) |
|
|
4886
|
+
| [KnexMigrations](#class-knexmigrations) | [TaskPurge](#class-taskpurge) | [WalletSettingsManager](#class-walletsettingsmanager) |
|
|
4887
|
+
| [MergeEntity](#class-mergeentity) | [TaskReviewStatus](#class-taskreviewstatus) | [WalletSigner](#class-walletsigner) |
|
|
4888
|
+
| [Monitor](#class-monitor) | [TaskSendWaiting](#class-tasksendwaiting) | [WalletStorageManager](#class-walletstoragemanager) |
|
|
4889
|
+
| [MonitorDaemon](#class-monitordaemon) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) | [WhatsOnChain](#class-whatsonchain) |
|
|
4890
|
+
| [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [TaskUnFail](#class-taskunfail) | |
|
|
4438
4891
|
|
|
4439
4892
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4440
4893
|
|
|
@@ -5870,6 +6323,76 @@ See also: [EntityBase](./storage.md#class-entitybase), [EntityStorage](./storage
|
|
|
5870
6323
|
|
|
5871
6324
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5872
6325
|
|
|
6326
|
+
---
|
|
6327
|
+
##### Class: KnexMigrations
|
|
6328
|
+
|
|
6329
|
+
```ts
|
|
6330
|
+
export class KnexMigrations implements MigrationSource<string> {
|
|
6331
|
+
migrations: Record<string, Migration> = {};
|
|
6332
|
+
constructor(public chain: sdk.Chain, public storageName: string, public storageIdentityKey: string, public maxOutputScriptLength: number)
|
|
6333
|
+
async getMigrations(): Promise<string[]>
|
|
6334
|
+
getMigrationName(migration: string)
|
|
6335
|
+
async getMigration(migration: string): Promise<Migration>
|
|
6336
|
+
async getLatestMigration(): Promise<string>
|
|
6337
|
+
static async latestMigration(): Promise<string>
|
|
6338
|
+
setupMigrations(chain: string, storageName: string, storageIdentityKey: string, maxOutputScriptLength: number): Record<string, Migration>
|
|
6339
|
+
static async dbtype(knex: Knex<any, any[]>): Promise<DBType> {
|
|
6340
|
+
try {
|
|
6341
|
+
const q = `SELECT
|
|
6342
|
+
CASE
|
|
6343
|
+
WHEN (SELECT VERSION() LIKE '%MariaDB%') = 1 THEN 'Unknown'
|
|
6344
|
+
WHEN (SELECT VERSION()) IS NOT NULL THEN 'MySQL'
|
|
6345
|
+
ELSE 'Unknown'
|
|
6346
|
+
END AS database_type;`;
|
|
6347
|
+
let r = await knex.raw(q);
|
|
6348
|
+
if (!r[0]["database_type"])
|
|
6349
|
+
r = r[0];
|
|
6350
|
+
if (r["rows"])
|
|
6351
|
+
r = r.rows;
|
|
6352
|
+
const dbtype: "SQLite" | "MySQL" | "Unknown" = r[0].database_type;
|
|
6353
|
+
if (dbtype === "Unknown")
|
|
6354
|
+
throw new sdk.WERR_NOT_IMPLEMENTED(`Attempting to create database on unsuported engine.`);
|
|
6355
|
+
return dbtype;
|
|
6356
|
+
}
|
|
6357
|
+
catch (eu: unknown) {
|
|
6358
|
+
const e = sdk.WalletError.fromUnknown(eu);
|
|
6359
|
+
if (e.code === "SQLITE_ERROR")
|
|
6360
|
+
return "SQLite";
|
|
6361
|
+
throw new sdk.WERR_NOT_IMPLEMENTED(`Attempting to create database on unsuported engine.`);
|
|
6362
|
+
}
|
|
6363
|
+
}
|
|
6364
|
+
}
|
|
6365
|
+
```
|
|
6366
|
+
|
|
6367
|
+
See also: [Chain](./client.md#type-chain), [DBType](./storage.md#type-dbtype), [WERR_NOT_IMPLEMENTED](./client.md#class-werr_not_implemented), [WalletError](./client.md#class-walleterror)
|
|
6368
|
+
|
|
6369
|
+
###### Constructor
|
|
6370
|
+
|
|
6371
|
+
```ts
|
|
6372
|
+
constructor(public chain: sdk.Chain, public storageName: string, public storageIdentityKey: string, public maxOutputScriptLength: number)
|
|
6373
|
+
```
|
|
6374
|
+
See also: [Chain](./client.md#type-chain)
|
|
6375
|
+
|
|
6376
|
+
Argument Details
|
|
6377
|
+
|
|
6378
|
+
+ **storageName**
|
|
6379
|
+
+ human readable name for this storage instance
|
|
6380
|
+
+ **maxOutputScriptLength**
|
|
6381
|
+
+ limit for scripts kept in outputs table, longer scripts will be pulled from rawTx
|
|
6382
|
+
|
|
6383
|
+
###### Method dbtype
|
|
6384
|
+
|
|
6385
|
+
```ts
|
|
6386
|
+
static async dbtype(knex: Knex<any, any[]>): Promise<DBType>
|
|
6387
|
+
```
|
|
6388
|
+
See also: [DBType](./storage.md#type-dbtype)
|
|
6389
|
+
|
|
6390
|
+
Returns
|
|
6391
|
+
|
|
6392
|
+
connected database engine variant
|
|
6393
|
+
|
|
6394
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6395
|
+
|
|
5873
6396
|
---
|
|
5874
6397
|
##### Class: MergeEntity
|
|
5875
6398
|
|
|
@@ -6025,6 +6548,28 @@ See also: [BlockHeader](./client.md#interface-blockheader)
|
|
|
6025
6548
|
|
|
6026
6549
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6027
6550
|
|
|
6551
|
+
---
|
|
6552
|
+
##### Class: MonitorDaemon
|
|
6553
|
+
|
|
6554
|
+
```ts
|
|
6555
|
+
export class MonitorDaemon {
|
|
6556
|
+
setup?: MonitorDaemonSetup;
|
|
6557
|
+
doneListening?: Promise<void>;
|
|
6558
|
+
doneTasks?: Promise<void>;
|
|
6559
|
+
stopDaemon: boolean = false;
|
|
6560
|
+
constructor(public args: MonitorDaemonSetup, public noRunTasks?: boolean)
|
|
6561
|
+
async createSetup(): Promise<void>
|
|
6562
|
+
async start(): Promise<void>
|
|
6563
|
+
async stop(): Promise<void>
|
|
6564
|
+
async destroy(): Promise<void>
|
|
6565
|
+
async runDaemon(): Promise<void>
|
|
6566
|
+
}
|
|
6567
|
+
```
|
|
6568
|
+
|
|
6569
|
+
See also: [MonitorDaemonSetup](./monitor.md#interface-monitordaemonsetup)
|
|
6570
|
+
|
|
6571
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6572
|
+
|
|
6028
6573
|
---
|
|
6029
6574
|
##### Class: OverlayUMPTokenInteractor
|
|
6030
6575
|
|
|
@@ -6329,7 +6874,454 @@ export class Services implements sdk.WalletServices {
|
|
|
6329
6874
|
}
|
|
6330
6875
|
```
|
|
6331
6876
|
|
|
6332
|
-
See also: [ARC](./services.md#class-arc), [Bitails](./services.md#class-bitails), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatExchangeRates](./client.md#interface-fiatexchangerates), [GetMerklePathResult](./client.md#interface-getmerklepathresult), [GetMerklePathService](./client.md#type-getmerklepathservice), [GetRawTxResult](./client.md#interface-getrawtxresult), [GetRawTxService](./client.md#type-getrawtxservice), [GetUtxoStatusOutputFormat](./client.md#type-getutxostatusoutputformat), [GetUtxoStatusResult](./client.md#interface-getutxostatusresult), [GetUtxoStatusService](./client.md#type-getutxostatusservice), [PostBeefResult](./client.md#interface-postbeefresult), [PostBeefService](./client.md#type-postbeefservice), [ServiceCollection](./services.md#class-servicecollection), [UpdateFiatExchangeRateService](./client.md#type-updatefiatexchangerateservice), [WalletServices](./client.md#interface-walletservices), [WalletServicesOptions](./client.md#interface-walletservicesoptions), [WhatsOnChain](./services.md#class-whatsonchain)
|
|
6877
|
+
See also: [ARC](./services.md#class-arc), [Bitails](./services.md#class-bitails), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatExchangeRates](./client.md#interface-fiatexchangerates), [GetMerklePathResult](./client.md#interface-getmerklepathresult), [GetMerklePathService](./client.md#type-getmerklepathservice), [GetRawTxResult](./client.md#interface-getrawtxresult), [GetRawTxService](./client.md#type-getrawtxservice), [GetUtxoStatusOutputFormat](./client.md#type-getutxostatusoutputformat), [GetUtxoStatusResult](./client.md#interface-getutxostatusresult), [GetUtxoStatusService](./client.md#type-getutxostatusservice), [PostBeefResult](./client.md#interface-postbeefresult), [PostBeefService](./client.md#type-postbeefservice), [ServiceCollection](./services.md#class-servicecollection), [UpdateFiatExchangeRateService](./client.md#type-updatefiatexchangerateservice), [WalletServices](./client.md#interface-walletservices), [WalletServicesOptions](./client.md#interface-walletservicesoptions), [WhatsOnChain](./services.md#class-whatsonchain)
|
|
6878
|
+
|
|
6879
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6880
|
+
|
|
6881
|
+
---
|
|
6882
|
+
##### Class: Setup
|
|
6883
|
+
|
|
6884
|
+
The 'Setup` class provides static setup functions to construct BRC-100 compatible
|
|
6885
|
+
wallets in a variety of configurations.
|
|
6886
|
+
|
|
6887
|
+
It serves as a starting point for experimentation and customization.
|
|
6888
|
+
|
|
6889
|
+
```ts
|
|
6890
|
+
export abstract class Setup {
|
|
6891
|
+
static noEnv(chain: sdk.Chain): boolean
|
|
6892
|
+
static makeEnv(): string {
|
|
6893
|
+
const testPrivKey1 = PrivateKey.fromRandom();
|
|
6894
|
+
const testIdentityKey1 = testPrivKey1.toPublicKey().toString();
|
|
6895
|
+
const testPrivKey2 = PrivateKey.fromRandom();
|
|
6896
|
+
const testIdentityKey2 = testPrivKey2.toPublicKey().toString();
|
|
6897
|
+
const mainPrivKey1 = PrivateKey.fromRandom();
|
|
6898
|
+
const mainIdentityKey1 = mainPrivKey1.toPublicKey().toString();
|
|
6899
|
+
const mainPrivKey2 = PrivateKey.fromRandom();
|
|
6900
|
+
const mainIdentityKey2 = mainPrivKey2.toPublicKey().toString();
|
|
6901
|
+
const log = `
|
|
6902
|
+
# .env file template for working with wallet-toolbox Setup functions.
|
|
6903
|
+
MY_TEST_IDENTITY = '${testIdentityKey1}'
|
|
6904
|
+
MY_TEST_IDENTITY2 = '${testIdentityKey2}'
|
|
6905
|
+
MY_MAIN_IDENTITY = '${mainIdentityKey1}'
|
|
6906
|
+
MY_MAIN_IDENTITY2 = '${mainIdentityKey2}'
|
|
6907
|
+
MAIN_TAAL_API_KEY='mainnet_9596de07e92300c6287e4393594ae39c'
|
|
6908
|
+
TEST_TAAL_API_KEY='testnet_0e6cf72133b43ea2d7861da2a38684e3'
|
|
6909
|
+
MYSQL_CONNECTION='{"port":3306,"host":"127.0.0.1","user":"root","password":"your_password","database":"your_database", "timezone": "Z"}'
|
|
6910
|
+
DEV_KEYS = '{
|
|
6911
|
+
"${testIdentityKey1}": "${testPrivKey1.toString()}",
|
|
6912
|
+
"${testIdentityKey2}": "${testPrivKey2.toString()}",
|
|
6913
|
+
"${mainIdentityKey1}": "${mainPrivKey1.toString()}",
|
|
6914
|
+
"${mainIdentityKey2}": "${mainPrivKey2.toString()}"
|
|
6915
|
+
}'
|
|
6916
|
+
`;
|
|
6917
|
+
console.log(log);
|
|
6918
|
+
return log;
|
|
6919
|
+
}
|
|
6920
|
+
static getEnv(chain: sdk.Chain): SetupEnv {
|
|
6921
|
+
const identityKey = chain === "main" ? process.env.MY_MAIN_IDENTITY : process.env.MY_TEST_IDENTITY;
|
|
6922
|
+
const identityKey2 = chain === "main" ? process.env.MY_MAIN_IDENTITY2 : process.env.MY_TEST_IDENTITY2;
|
|
6923
|
+
const filePath = chain === "main" ? process.env.MY_MAIN_FILEPATH : process.env.MY_TEST_FILEPATH;
|
|
6924
|
+
const DEV_KEYS = process.env.DEV_KEYS || "{}";
|
|
6925
|
+
const mySQLConnection = process.env.MYSQL_CONNECTION || "{}";
|
|
6926
|
+
const taalApiKey = verifyTruthy(chain === "main" ? process.env.MAIN_TAAL_API_KEY : process.env.TEST_TAAL_API_KEY, `.env value for '${chain.toUpperCase()}_TAAL_API_KEY' is required.`);
|
|
6927
|
+
if (!identityKey || !identityKey2)
|
|
6928
|
+
throw new sdk.WERR_INVALID_OPERATION(".env is not a valid SetupEnv configuration.");
|
|
6929
|
+
return {
|
|
6930
|
+
chain,
|
|
6931
|
+
identityKey,
|
|
6932
|
+
identityKey2,
|
|
6933
|
+
filePath,
|
|
6934
|
+
taalApiKey,
|
|
6935
|
+
devKeys: JSON.parse(DEV_KEYS) as Record<string, string>,
|
|
6936
|
+
mySQLConnection
|
|
6937
|
+
};
|
|
6938
|
+
}
|
|
6939
|
+
static async createWallet(args: SetupWalletArgs): Promise<SetupWallet> {
|
|
6940
|
+
const chain = args.env.chain;
|
|
6941
|
+
args.rootKeyHex ||= args.env.devKeys[args.env.identityKey];
|
|
6942
|
+
const rootKey = PrivateKey.fromHex(args.rootKeyHex);
|
|
6943
|
+
const identityKey = rootKey.toPublicKey().toString();
|
|
6944
|
+
const keyDeriver = new KeyDeriver(rootKey);
|
|
6945
|
+
const storage = new WalletStorageManager(identityKey, args.active, args.backups);
|
|
6946
|
+
if (storage.canMakeAvailable())
|
|
6947
|
+
await storage.makeAvailable();
|
|
6948
|
+
const serviceOptions = Services.createDefaultOptions(chain);
|
|
6949
|
+
serviceOptions.taalApiKey = args.env.taalApiKey;
|
|
6950
|
+
const services = new Services(serviceOptions);
|
|
6951
|
+
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
|
|
6952
|
+
const monitor = new Monitor(monopts);
|
|
6953
|
+
monitor.addDefaultTasks();
|
|
6954
|
+
const privilegedKeyManager = args.privilegedKeyGetter
|
|
6955
|
+
? new sdk.PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
6956
|
+
: undefined;
|
|
6957
|
+
const wallet = new Wallet({
|
|
6958
|
+
chain,
|
|
6959
|
+
keyDeriver,
|
|
6960
|
+
storage,
|
|
6961
|
+
services,
|
|
6962
|
+
monitor,
|
|
6963
|
+
privilegedKeyManager
|
|
6964
|
+
});
|
|
6965
|
+
const r: SetupWallet = {
|
|
6966
|
+
rootKey,
|
|
6967
|
+
identityKey,
|
|
6968
|
+
keyDeriver,
|
|
6969
|
+
chain,
|
|
6970
|
+
storage,
|
|
6971
|
+
services,
|
|
6972
|
+
monitor,
|
|
6973
|
+
wallet
|
|
6974
|
+
};
|
|
6975
|
+
return r;
|
|
6976
|
+
}
|
|
6977
|
+
static async createWalletClientNoEnv(args: {
|
|
6978
|
+
chain: sdk.Chain;
|
|
6979
|
+
rootKeyHex: string;
|
|
6980
|
+
storageUrl?: string;
|
|
6981
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
6982
|
+
}): Promise<Wallet>
|
|
6983
|
+
static async createWalletClient(args: SetupWalletClientArgs): Promise<SetupWalletClient> {
|
|
6984
|
+
const wo = await Setup.createWallet(args);
|
|
6985
|
+
const endpointUrl = args.endpointUrl || `https://${args.env.chain !== "main" ? "staging-" : ""}storage.babbage.systems`;
|
|
6986
|
+
const client = new StorageClient(wo.wallet, endpointUrl);
|
|
6987
|
+
await wo.storage.addWalletStorageProvider(client);
|
|
6988
|
+
await wo.storage.makeAvailable();
|
|
6989
|
+
return {
|
|
6990
|
+
...wo,
|
|
6991
|
+
endpointUrl
|
|
6992
|
+
};
|
|
6993
|
+
}
|
|
6994
|
+
static getKeyPair(priv?: string | PrivateKey): KeyPairAddress {
|
|
6995
|
+
if (priv === undefined)
|
|
6996
|
+
priv = PrivateKey.fromRandom();
|
|
6997
|
+
else if (typeof priv === "string")
|
|
6998
|
+
priv = new PrivateKey(priv, "hex");
|
|
6999
|
+
const pub = PublicKey.fromPrivateKey(priv);
|
|
7000
|
+
const address = pub.toAddress();
|
|
7001
|
+
return { privateKey: priv, publicKey: pub, address };
|
|
7002
|
+
}
|
|
7003
|
+
static getLockP2PKH(address: string): LockingScript {
|
|
7004
|
+
const p2pkh = new P2PKH();
|
|
7005
|
+
const lock = p2pkh.lock(address);
|
|
7006
|
+
return lock;
|
|
7007
|
+
}
|
|
7008
|
+
static getUnlockP2PKH(priv: PrivateKey, satoshis: number): sdk.ScriptTemplateUnlock {
|
|
7009
|
+
const p2pkh = new P2PKH();
|
|
7010
|
+
const lock = Setup.getLockP2PKH(Setup.getKeyPair(priv).address);
|
|
7011
|
+
const unlock = p2pkh.unlock(priv, "all", false, satoshis, lock);
|
|
7012
|
+
return unlock;
|
|
7013
|
+
}
|
|
7014
|
+
static createP2PKHOutputs(outputs: {
|
|
7015
|
+
address: string;
|
|
7016
|
+
satoshis: number;
|
|
7017
|
+
outputDescription?: string;
|
|
7018
|
+
basket?: string;
|
|
7019
|
+
tags?: string[];
|
|
7020
|
+
}[]): CreateActionOutput[] {
|
|
7021
|
+
const os: CreateActionOutput[] = [];
|
|
7022
|
+
const count = outputs.length;
|
|
7023
|
+
for (let i = 0; i < count; i++) {
|
|
7024
|
+
const o = outputs[i];
|
|
7025
|
+
os.push({
|
|
7026
|
+
basket: o.basket,
|
|
7027
|
+
tags: o.tags,
|
|
7028
|
+
satoshis: o.satoshis,
|
|
7029
|
+
lockingScript: Setup.getLockP2PKH(o.address).toHex(),
|
|
7030
|
+
outputDescription: o.outputDescription || `p2pkh ${i}`
|
|
7031
|
+
});
|
|
7032
|
+
}
|
|
7033
|
+
return os;
|
|
7034
|
+
}
|
|
7035
|
+
static async createP2PKHOutputsAction(wallet: WalletInterface, outputs: {
|
|
7036
|
+
address: string;
|
|
7037
|
+
satoshis: number;
|
|
7038
|
+
outputDescription?: string;
|
|
7039
|
+
basket?: string;
|
|
7040
|
+
tags?: string[];
|
|
7041
|
+
}[], options?: CreateActionOptions): Promise<{
|
|
7042
|
+
cr: CreateActionResult;
|
|
7043
|
+
outpoints: string[] | undefined;
|
|
7044
|
+
}> {
|
|
7045
|
+
const os = Setup.createP2PKHOutputs(outputs);
|
|
7046
|
+
const createArgs: CreateActionArgs = {
|
|
7047
|
+
description: `createP2PKHOutputs`,
|
|
7048
|
+
outputs: os,
|
|
7049
|
+
options: {
|
|
7050
|
+
...options,
|
|
7051
|
+
randomizeOutputs: false
|
|
7052
|
+
}
|
|
7053
|
+
};
|
|
7054
|
+
const cr = await wallet.createAction(createArgs);
|
|
7055
|
+
let outpoints: string[] | undefined;
|
|
7056
|
+
if (cr.txid) {
|
|
7057
|
+
outpoints = os.map((o, i) => `${cr.txid}.${i}`);
|
|
7058
|
+
}
|
|
7059
|
+
return { cr, outpoints };
|
|
7060
|
+
}
|
|
7061
|
+
static async fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, inputBEEF?: BEEF) {
|
|
7062
|
+
}
|
|
7063
|
+
static async createWalletKnex(args: SetupWalletKnexArgs): Promise<SetupWalletKnex> {
|
|
7064
|
+
const wo = await Setup.createWallet(args);
|
|
7065
|
+
const activeStorage = await Setup.createStorageKnex(args);
|
|
7066
|
+
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
7067
|
+
const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
7068
|
+
const userId = user.userId;
|
|
7069
|
+
const r: SetupWalletKnex = {
|
|
7070
|
+
...wo,
|
|
7071
|
+
activeStorage,
|
|
7072
|
+
userId
|
|
7073
|
+
};
|
|
7074
|
+
return r;
|
|
7075
|
+
}
|
|
7076
|
+
static async createStorageKnex(args: SetupWalletKnexArgs): Promise<StorageKnex>
|
|
7077
|
+
static createSQLiteKnex(filename: string): Knex {
|
|
7078
|
+
const config: Knex.Config = {
|
|
7079
|
+
client: "sqlite3",
|
|
7080
|
+
connection: { filename },
|
|
7081
|
+
useNullAsDefault: true
|
|
7082
|
+
};
|
|
7083
|
+
const knex = makeKnex(config);
|
|
7084
|
+
return knex;
|
|
7085
|
+
}
|
|
7086
|
+
static createMySQLKnex(connection: string, database?: string): Knex {
|
|
7087
|
+
const c: Knex.MySql2ConnectionConfig = JSON.parse(connection);
|
|
7088
|
+
if (database) {
|
|
7089
|
+
c.database = database;
|
|
7090
|
+
}
|
|
7091
|
+
const config: Knex.Config = {
|
|
7092
|
+
client: "mysql2",
|
|
7093
|
+
connection: c,
|
|
7094
|
+
useNullAsDefault: true,
|
|
7095
|
+
pool: { min: 0, max: 7, idleTimeoutMillis: 15000 }
|
|
7096
|
+
};
|
|
7097
|
+
const knex = makeKnex(config);
|
|
7098
|
+
return knex;
|
|
7099
|
+
}
|
|
7100
|
+
static async createWalletMySQL(args: SetupWalletMySQLArgs): Promise<SetupWalletKnex> {
|
|
7101
|
+
return await this.createWalletKnex({
|
|
7102
|
+
...args,
|
|
7103
|
+
knex: Setup.createMySQLKnex(args.env.mySQLConnection, args.databaseName)
|
|
7104
|
+
});
|
|
7105
|
+
}
|
|
7106
|
+
static async createWalletSQLite(args: SetupWalletSQLiteArgs): Promise<SetupWalletKnex> {
|
|
7107
|
+
return await this.createWalletKnex({
|
|
7108
|
+
...args,
|
|
7109
|
+
knex: Setup.createSQLiteKnex(args.filePath)
|
|
7110
|
+
});
|
|
7111
|
+
}
|
|
7112
|
+
}
|
|
7113
|
+
```
|
|
7114
|
+
|
|
7115
|
+
See also: [Chain](./client.md#type-chain), [KeyPairAddress](./setup.md#interface-keypairaddress), [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [ScriptTemplateUnlock](./client.md#interface-scripttemplateunlock), [Services](./services.md#class-services), [SetupEnv](./setup.md#interface-setupenv), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletArgs](./setup.md#interface-setupwalletargs), [SetupWalletClient](./setup.md#interface-setupwalletclient), [SetupWalletClientArgs](./setup.md#interface-setupwalletclientargs), [SetupWalletKnex](./setup.md#interface-setupwalletknex), [SetupWalletKnexArgs](./setup.md#interface-setupwalletknexargs), [SetupWalletMySQLArgs](./setup.md#interface-setupwalletmysqlargs), [SetupWalletSQLiteArgs](./setup.md#interface-setupwalletsqliteargs), [StorageClient](./storage.md#class-storageclient), [StorageKnex](./storage.md#class-storageknex), [WERR_INVALID_OPERATION](./client.md#class-werr_invalid_operation), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager), [createAction](./storage.md#function-createaction), [verifyTruthy](./client.md#function-verifytruthy)
|
|
7116
|
+
|
|
7117
|
+
###### Method createStorageKnex
|
|
7118
|
+
|
|
7119
|
+
```ts
|
|
7120
|
+
static async createStorageKnex(args: SetupWalletKnexArgs): Promise<StorageKnex>
|
|
7121
|
+
```
|
|
7122
|
+
See also: [SetupWalletKnexArgs](./setup.md#interface-setupwalletknexargs), [StorageKnex](./storage.md#class-storageknex)
|
|
7123
|
+
|
|
7124
|
+
Returns
|
|
7125
|
+
|
|
7126
|
+
- `Knex` based storage provider for a wallet. May be used for either active storage or backup storage.
|
|
7127
|
+
|
|
7128
|
+
###### Method createWallet
|
|
7129
|
+
|
|
7130
|
+
Create a `Wallet`. Storage can optionally be provided or configured later.
|
|
7131
|
+
|
|
7132
|
+
The following components are configured: KeyDeriver, WalletStorageManager, WalletService, WalletStorage.
|
|
7133
|
+
Optionally, PrivilegedKeyManager is also configured.
|
|
7134
|
+
|
|
7135
|
+
```ts
|
|
7136
|
+
static async createWallet(args: SetupWalletArgs): Promise<SetupWallet> {
|
|
7137
|
+
const chain = args.env.chain;
|
|
7138
|
+
args.rootKeyHex ||= args.env.devKeys[args.env.identityKey];
|
|
7139
|
+
const rootKey = PrivateKey.fromHex(args.rootKeyHex);
|
|
7140
|
+
const identityKey = rootKey.toPublicKey().toString();
|
|
7141
|
+
const keyDeriver = new KeyDeriver(rootKey);
|
|
7142
|
+
const storage = new WalletStorageManager(identityKey, args.active, args.backups);
|
|
7143
|
+
if (storage.canMakeAvailable())
|
|
7144
|
+
await storage.makeAvailable();
|
|
7145
|
+
const serviceOptions = Services.createDefaultOptions(chain);
|
|
7146
|
+
serviceOptions.taalApiKey = args.env.taalApiKey;
|
|
7147
|
+
const services = new Services(serviceOptions);
|
|
7148
|
+
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
|
|
7149
|
+
const monitor = new Monitor(monopts);
|
|
7150
|
+
monitor.addDefaultTasks();
|
|
7151
|
+
const privilegedKeyManager = args.privilegedKeyGetter
|
|
7152
|
+
? new sdk.PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
7153
|
+
: undefined;
|
|
7154
|
+
const wallet = new Wallet({
|
|
7155
|
+
chain,
|
|
7156
|
+
keyDeriver,
|
|
7157
|
+
storage,
|
|
7158
|
+
services,
|
|
7159
|
+
monitor,
|
|
7160
|
+
privilegedKeyManager
|
|
7161
|
+
});
|
|
7162
|
+
const r: SetupWallet = {
|
|
7163
|
+
rootKey,
|
|
7164
|
+
identityKey,
|
|
7165
|
+
keyDeriver,
|
|
7166
|
+
chain,
|
|
7167
|
+
storage,
|
|
7168
|
+
services,
|
|
7169
|
+
monitor,
|
|
7170
|
+
wallet
|
|
7171
|
+
};
|
|
7172
|
+
return r;
|
|
7173
|
+
}
|
|
7174
|
+
```
|
|
7175
|
+
See also: [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [Services](./services.md#class-services), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletArgs](./setup.md#interface-setupwalletargs), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
7176
|
+
|
|
7177
|
+
###### Method createWalletClientNoEnv
|
|
7178
|
+
|
|
7179
|
+
Setup a new `Wallet` without requiring a .env file.
|
|
7180
|
+
|
|
7181
|
+
```ts
|
|
7182
|
+
static async createWalletClientNoEnv(args: {
|
|
7183
|
+
chain: sdk.Chain;
|
|
7184
|
+
rootKeyHex: string;
|
|
7185
|
+
storageUrl?: string;
|
|
7186
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
7187
|
+
}): Promise<Wallet>
|
|
7188
|
+
```
|
|
7189
|
+
See also: [Chain](./client.md#type-chain), [Wallet](./client.md#class-wallet)
|
|
7190
|
+
|
|
7191
|
+
Argument Details
|
|
7192
|
+
|
|
7193
|
+
+ **args.chain**
|
|
7194
|
+
+ 'main' or 'test'
|
|
7195
|
+
+ **args.rootKeyHex**
|
|
7196
|
+
+ Root private key for wallet's key deriver.
|
|
7197
|
+
+ **args.storageUrl**
|
|
7198
|
+
+ Optional. `StorageClient` and `chain` compatible endpoint URL.
|
|
7199
|
+
+ **args.privilegedKeyGetter**
|
|
7200
|
+
+ Optional. Method that will return the privileged `PrivateKey`, on demand.
|
|
7201
|
+
|
|
7202
|
+
###### Method createWalletKnex
|
|
7203
|
+
|
|
7204
|
+
Adds `Knex` based storage to a `Wallet` configured by `Setup.createWalletOnly`
|
|
7205
|
+
|
|
7206
|
+
```ts
|
|
7207
|
+
static async createWalletKnex(args: SetupWalletKnexArgs): Promise<SetupWalletKnex> {
|
|
7208
|
+
const wo = await Setup.createWallet(args);
|
|
7209
|
+
const activeStorage = await Setup.createStorageKnex(args);
|
|
7210
|
+
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
7211
|
+
const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
7212
|
+
const userId = user.userId;
|
|
7213
|
+
const r: SetupWalletKnex = {
|
|
7214
|
+
...wo,
|
|
7215
|
+
activeStorage,
|
|
7216
|
+
userId
|
|
7217
|
+
};
|
|
7218
|
+
return r;
|
|
7219
|
+
}
|
|
7220
|
+
```
|
|
7221
|
+
See also: [Setup](./setup.md#class-setup), [SetupWalletKnex](./setup.md#interface-setupwalletknex), [SetupWalletKnexArgs](./setup.md#interface-setupwalletknexargs)
|
|
7222
|
+
|
|
7223
|
+
Argument Details
|
|
7224
|
+
|
|
7225
|
+
+ **args.knex**
|
|
7226
|
+
+ `Knex` object configured for either MySQL or SQLite database access.
|
|
7227
|
+
Schema will be created and migrated as needed.
|
|
7228
|
+
For MySQL, a schema corresponding to databaseName must exist with full access permissions.
|
|
7229
|
+
+ **args.databaseName**
|
|
7230
|
+
+ Name for this storage. For MySQL, the schema name within the MySQL instance.
|
|
7231
|
+
+ **args.chain**
|
|
7232
|
+
+ Which chain this wallet is on: 'main' or 'test'. Defaults to 'test'.
|
|
7233
|
+
|
|
7234
|
+
###### Method getEnv
|
|
7235
|
+
|
|
7236
|
+
Reads a .env file of the format created by `makeEnv`.
|
|
7237
|
+
|
|
7238
|
+
Returns values for designated `chain`.
|
|
7239
|
+
|
|
7240
|
+
Access private keys through the `devKeys` object: `devKeys[identityKey]`
|
|
7241
|
+
|
|
7242
|
+
```ts
|
|
7243
|
+
static getEnv(chain: sdk.Chain): SetupEnv {
|
|
7244
|
+
const identityKey = chain === "main" ? process.env.MY_MAIN_IDENTITY : process.env.MY_TEST_IDENTITY;
|
|
7245
|
+
const identityKey2 = chain === "main" ? process.env.MY_MAIN_IDENTITY2 : process.env.MY_TEST_IDENTITY2;
|
|
7246
|
+
const filePath = chain === "main" ? process.env.MY_MAIN_FILEPATH : process.env.MY_TEST_FILEPATH;
|
|
7247
|
+
const DEV_KEYS = process.env.DEV_KEYS || "{}";
|
|
7248
|
+
const mySQLConnection = process.env.MYSQL_CONNECTION || "{}";
|
|
7249
|
+
const taalApiKey = verifyTruthy(chain === "main" ? process.env.MAIN_TAAL_API_KEY : process.env.TEST_TAAL_API_KEY, `.env value for '${chain.toUpperCase()}_TAAL_API_KEY' is required.`);
|
|
7250
|
+
if (!identityKey || !identityKey2)
|
|
7251
|
+
throw new sdk.WERR_INVALID_OPERATION(".env is not a valid SetupEnv configuration.");
|
|
7252
|
+
return {
|
|
7253
|
+
chain,
|
|
7254
|
+
identityKey,
|
|
7255
|
+
identityKey2,
|
|
7256
|
+
filePath,
|
|
7257
|
+
taalApiKey,
|
|
7258
|
+
devKeys: JSON.parse(DEV_KEYS) as Record<string, string>,
|
|
7259
|
+
mySQLConnection
|
|
7260
|
+
};
|
|
7261
|
+
}
|
|
7262
|
+
```
|
|
7263
|
+
See also: [Chain](./client.md#type-chain), [SetupEnv](./setup.md#interface-setupenv), [WERR_INVALID_OPERATION](./client.md#class-werr_invalid_operation), [verifyTruthy](./client.md#function-verifytruthy)
|
|
7264
|
+
|
|
7265
|
+
Returns
|
|
7266
|
+
|
|
7267
|
+
with configuration environment secrets used by `Setup` functions.
|
|
7268
|
+
|
|
7269
|
+
Argument Details
|
|
7270
|
+
|
|
7271
|
+
+ **chain**
|
|
7272
|
+
+ Which chain to use: 'test' or 'main'
|
|
7273
|
+
|
|
7274
|
+
###### Method makeEnv
|
|
7275
|
+
|
|
7276
|
+
Creates content for .env file with some private keys, identity keys, sample API keys, and sample MySQL connection string.
|
|
7277
|
+
|
|
7278
|
+
Two new, random private keys are generated each time, with their associated public identity keys.
|
|
7279
|
+
|
|
7280
|
+
Loading secrets from a .env file is intended only for experimentation and getting started.
|
|
7281
|
+
Private keys should never be included directly in your source code.
|
|
7282
|
+
|
|
7283
|
+
```ts
|
|
7284
|
+
static makeEnv(): string {
|
|
7285
|
+
const testPrivKey1 = PrivateKey.fromRandom();
|
|
7286
|
+
const testIdentityKey1 = testPrivKey1.toPublicKey().toString();
|
|
7287
|
+
const testPrivKey2 = PrivateKey.fromRandom();
|
|
7288
|
+
const testIdentityKey2 = testPrivKey2.toPublicKey().toString();
|
|
7289
|
+
const mainPrivKey1 = PrivateKey.fromRandom();
|
|
7290
|
+
const mainIdentityKey1 = mainPrivKey1.toPublicKey().toString();
|
|
7291
|
+
const mainPrivKey2 = PrivateKey.fromRandom();
|
|
7292
|
+
const mainIdentityKey2 = mainPrivKey2.toPublicKey().toString();
|
|
7293
|
+
const log = `
|
|
7294
|
+
# .env file template for working with wallet-toolbox Setup functions.
|
|
7295
|
+
MY_TEST_IDENTITY = '${testIdentityKey1}'
|
|
7296
|
+
MY_TEST_IDENTITY2 = '${testIdentityKey2}'
|
|
7297
|
+
MY_MAIN_IDENTITY = '${mainIdentityKey1}'
|
|
7298
|
+
MY_MAIN_IDENTITY2 = '${mainIdentityKey2}'
|
|
7299
|
+
MAIN_TAAL_API_KEY='mainnet_9596de07e92300c6287e4393594ae39c'
|
|
7300
|
+
TEST_TAAL_API_KEY='testnet_0e6cf72133b43ea2d7861da2a38684e3'
|
|
7301
|
+
MYSQL_CONNECTION='{"port":3306,"host":"127.0.0.1","user":"root","password":"your_password","database":"your_database", "timezone": "Z"}'
|
|
7302
|
+
DEV_KEYS = '{
|
|
7303
|
+
"${testIdentityKey1}": "${testPrivKey1.toString()}",
|
|
7304
|
+
"${testIdentityKey2}": "${testPrivKey2.toString()}",
|
|
7305
|
+
"${mainIdentityKey1}": "${mainPrivKey1.toString()}",
|
|
7306
|
+
"${mainIdentityKey2}": "${mainPrivKey2.toString()}"
|
|
7307
|
+
}'
|
|
7308
|
+
`;
|
|
7309
|
+
console.log(log);
|
|
7310
|
+
return log;
|
|
7311
|
+
}
|
|
7312
|
+
```
|
|
7313
|
+
See also: [Setup](./setup.md#class-setup)
|
|
7314
|
+
|
|
7315
|
+
###### Method noEnv
|
|
7316
|
+
|
|
7317
|
+
```ts
|
|
7318
|
+
static noEnv(chain: sdk.Chain): boolean
|
|
7319
|
+
```
|
|
7320
|
+
See also: [Chain](./client.md#type-chain)
|
|
7321
|
+
|
|
7322
|
+
Returns
|
|
7323
|
+
|
|
7324
|
+
true if .env is not valid for chain
|
|
6333
7325
|
|
|
6334
7326
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6335
7327
|
|
|
@@ -7181,6 +8173,307 @@ See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
|
7181
8173
|
|
|
7182
8174
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7183
8175
|
|
|
8176
|
+
---
|
|
8177
|
+
##### Class: StorageKnex
|
|
8178
|
+
|
|
8179
|
+
```ts
|
|
8180
|
+
export class StorageKnex extends StorageProvider implements sdk.WalletStorageProvider {
|
|
8181
|
+
knex: Knex;
|
|
8182
|
+
constructor(options: StorageKnexOptions)
|
|
8183
|
+
async readSettings(): Promise<TableSettings>
|
|
8184
|
+
override async getProvenOrRawTx(txid: string, trx?: sdk.TrxToken): Promise<sdk.ProvenOrRawTx>
|
|
8185
|
+
dbTypeSubstring(source: string, fromOffset: number, forLength?: number)
|
|
8186
|
+
override async getRawTxOfKnownValidTransaction(txid?: string, offset?: number, length?: number, trx?: sdk.TrxToken): Promise<number[] | undefined>
|
|
8187
|
+
getProvenTxsForUserQuery(args: sdk.FindForUserSincePagedArgs): Knex.QueryBuilder
|
|
8188
|
+
override async getProvenTxsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableProvenTx[]>
|
|
8189
|
+
getProvenTxReqsForUserQuery(args: sdk.FindForUserSincePagedArgs): Knex.QueryBuilder
|
|
8190
|
+
override async getProvenTxReqsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableProvenTxReq[]>
|
|
8191
|
+
getTxLabelMapsForUserQuery(args: sdk.FindForUserSincePagedArgs): Knex.QueryBuilder
|
|
8192
|
+
override async getTxLabelMapsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableTxLabelMap[]>
|
|
8193
|
+
getOutputTagMapsForUserQuery(args: sdk.FindForUserSincePagedArgs): Knex.QueryBuilder
|
|
8194
|
+
override async getOutputTagMapsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableOutputTagMap[]>
|
|
8195
|
+
override async listActions(auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs): Promise<ListActionsResult>
|
|
8196
|
+
override async listOutputs(auth: sdk.AuthId, vargs: sdk.ValidListOutputsArgs): Promise<ListOutputsResult>
|
|
8197
|
+
override async insertProvenTx(tx: TableProvenTx, trx?: sdk.TrxToken): Promise<number>
|
|
8198
|
+
override async insertProvenTxReq(tx: TableProvenTxReq, trx?: sdk.TrxToken): Promise<number>
|
|
8199
|
+
override async insertUser(user: TableUser, trx?: sdk.TrxToken): Promise<number>
|
|
8200
|
+
override async insertCertificateAuth(auth: sdk.AuthId, certificate: TableCertificateX): Promise<number>
|
|
8201
|
+
override async insertCertificate(certificate: TableCertificateX, trx?: sdk.TrxToken): Promise<number>
|
|
8202
|
+
override async insertCertificateField(certificateField: TableCertificateField, trx?: sdk.TrxToken): Promise<void>
|
|
8203
|
+
override async insertOutputBasket(basket: TableOutputBasket, trx?: sdk.TrxToken): Promise<number>
|
|
8204
|
+
override async insertTransaction(tx: TableTransaction, trx?: sdk.TrxToken): Promise<number>
|
|
8205
|
+
override async insertCommission(commission: TableCommission, trx?: sdk.TrxToken): Promise<number>
|
|
8206
|
+
override async insertOutput(output: TableOutput, trx?: sdk.TrxToken): Promise<number>
|
|
8207
|
+
override async insertOutputTag(tag: TableOutputTag, trx?: sdk.TrxToken): Promise<number>
|
|
8208
|
+
override async insertOutputTagMap(tagMap: TableOutputTagMap, trx?: sdk.TrxToken): Promise<void>
|
|
8209
|
+
override async insertTxLabel(label: TableTxLabel, trx?: sdk.TrxToken): Promise<number>
|
|
8210
|
+
override async insertTxLabelMap(labelMap: TableTxLabelMap, trx?: sdk.TrxToken): Promise<void>
|
|
8211
|
+
override async insertMonitorEvent(event: TableMonitorEvent, trx?: sdk.TrxToken): Promise<number>
|
|
8212
|
+
override async insertSyncState(syncState: TableSyncState, trx?: sdk.TrxToken): Promise<number>
|
|
8213
|
+
override async updateCertificateField(certificateId: number, fieldName: string, update: Partial<TableCertificateField>, trx?: sdk.TrxToken): Promise<number>
|
|
8214
|
+
override async updateCertificate(id: number, update: Partial<TableCertificate>, trx?: sdk.TrxToken): Promise<number>
|
|
8215
|
+
override async updateCommission(id: number, update: Partial<TableCommission>, trx?: sdk.TrxToken): Promise<number>
|
|
8216
|
+
override async updateOutputBasket(id: number, update: Partial<TableOutputBasket>, trx?: sdk.TrxToken): Promise<number>
|
|
8217
|
+
override async updateOutput(id: number, update: Partial<TableOutput>, trx?: sdk.TrxToken): Promise<number>
|
|
8218
|
+
override async updateOutputTagMap(outputId: number, tagId: number, update: Partial<TableOutputTagMap>, trx?: sdk.TrxToken): Promise<number>
|
|
8219
|
+
override async updateOutputTag(id: number, update: Partial<TableOutputTag>, trx?: sdk.TrxToken): Promise<number>
|
|
8220
|
+
override async updateProvenTxReq(id: number | number[], update: Partial<TableProvenTxReq>, trx?: sdk.TrxToken): Promise<number>
|
|
8221
|
+
override async updateProvenTx(id: number, update: Partial<TableProvenTx>, trx?: sdk.TrxToken): Promise<number>
|
|
8222
|
+
override async updateSyncState(id: number, update: Partial<TableSyncState>, trx?: sdk.TrxToken): Promise<number>
|
|
8223
|
+
override async updateTransaction(id: number | number[], update: Partial<TableTransaction>, trx?: sdk.TrxToken): Promise<number>
|
|
8224
|
+
override async updateTxLabelMap(transactionId: number, txLabelId: number, update: Partial<TableTxLabelMap>, trx?: sdk.TrxToken): Promise<number>
|
|
8225
|
+
override async updateTxLabel(id: number, update: Partial<TableTxLabel>, trx?: sdk.TrxToken): Promise<number>
|
|
8226
|
+
override async updateUser(id: number, update: Partial<TableUser>, trx?: sdk.TrxToken): Promise<number>
|
|
8227
|
+
override async updateMonitorEvent(id: number, update: Partial<TableMonitorEvent>, trx?: sdk.TrxToken): Promise<number>
|
|
8228
|
+
setupQuery<T extends object>(table: string, args: sdk.FindPartialSincePagedArgs<T>): Knex.QueryBuilder
|
|
8229
|
+
findCertificateFieldsQuery(args: sdk.FindCertificateFieldsArgs): Knex.QueryBuilder
|
|
8230
|
+
findCertificatesQuery(args: sdk.FindCertificatesArgs): Knex.QueryBuilder
|
|
8231
|
+
findCommissionsQuery(args: sdk.FindCommissionsArgs): Knex.QueryBuilder
|
|
8232
|
+
findOutputBasketsQuery(args: sdk.FindOutputBasketsArgs): Knex.QueryBuilder
|
|
8233
|
+
findOutputsQuery(args: sdk.FindOutputsArgs, count?: boolean): Knex.QueryBuilder
|
|
8234
|
+
findOutputTagMapsQuery(args: sdk.FindOutputTagMapsArgs): Knex.QueryBuilder
|
|
8235
|
+
findOutputTagsQuery(args: sdk.FindOutputTagsArgs): Knex.QueryBuilder
|
|
8236
|
+
findProvenTxReqsQuery(args: sdk.FindProvenTxReqsArgs): Knex.QueryBuilder
|
|
8237
|
+
findProvenTxsQuery(args: sdk.FindProvenTxsArgs): Knex.QueryBuilder
|
|
8238
|
+
findSyncStatesQuery(args: sdk.FindSyncStatesArgs): Knex.QueryBuilder
|
|
8239
|
+
findTransactionsQuery(args: sdk.FindTransactionsArgs, count?: boolean): Knex.QueryBuilder
|
|
8240
|
+
findTxLabelMapsQuery(args: sdk.FindTxLabelMapsArgs): Knex.QueryBuilder
|
|
8241
|
+
findTxLabelsQuery(args: sdk.FindTxLabelsArgs): Knex.QueryBuilder
|
|
8242
|
+
findUsersQuery(args: sdk.FindUsersArgs): Knex.QueryBuilder
|
|
8243
|
+
findMonitorEventsQuery(args: sdk.FindMonitorEventsArgs): Knex.QueryBuilder
|
|
8244
|
+
override async findCertificatesAuth(auth: sdk.AuthId, args: sdk.FindCertificatesArgs): Promise<TableCertificateX[]>
|
|
8245
|
+
override async findOutputBasketsAuth(auth: sdk.AuthId, args: sdk.FindOutputBasketsArgs): Promise<TableOutputBasket[]>
|
|
8246
|
+
override async findOutputsAuth(auth: sdk.AuthId, args: sdk.FindOutputsArgs): Promise<TableOutput[]>
|
|
8247
|
+
override async findCertificateFields(args: sdk.FindCertificateFieldsArgs): Promise<TableCertificateField[]>
|
|
8248
|
+
override async findCertificates(args: sdk.FindCertificatesArgs): Promise<TableCertificateX[]>
|
|
8249
|
+
override async findCommissions(args: sdk.FindCommissionsArgs): Promise<TableCommission[]>
|
|
8250
|
+
override async findOutputBaskets(args: sdk.FindOutputBasketsArgs): Promise<TableOutputBasket[]>
|
|
8251
|
+
override async findOutputs(args: sdk.FindOutputsArgs): Promise<TableOutput[]>
|
|
8252
|
+
override async findOutputTagMaps(args: sdk.FindOutputTagMapsArgs): Promise<TableOutputTagMap[]>
|
|
8253
|
+
override async findOutputTags(args: sdk.FindOutputTagsArgs): Promise<TableOutputTag[]>
|
|
8254
|
+
override async findProvenTxReqs(args: sdk.FindProvenTxReqsArgs): Promise<TableProvenTxReq[]>
|
|
8255
|
+
override async findProvenTxs(args: sdk.FindProvenTxsArgs): Promise<TableProvenTx[]>
|
|
8256
|
+
override async findSyncStates(args: sdk.FindSyncStatesArgs): Promise<TableSyncState[]>
|
|
8257
|
+
override async findTransactions(args: sdk.FindTransactionsArgs): Promise<TableTransaction[]>
|
|
8258
|
+
override async findTxLabelMaps(args: sdk.FindTxLabelMapsArgs): Promise<TableTxLabelMap[]>
|
|
8259
|
+
override async findTxLabels(args: sdk.FindTxLabelsArgs): Promise<TableTxLabel[]>
|
|
8260
|
+
override async findUsers(args: sdk.FindUsersArgs): Promise<TableUser[]>
|
|
8261
|
+
override async findMonitorEvents(args: sdk.FindMonitorEventsArgs): Promise<TableMonitorEvent[]>
|
|
8262
|
+
async getCount<T extends object>(q: Knex.QueryBuilder<T, T[]>): Promise<number>
|
|
8263
|
+
override async countCertificateFields(args: sdk.FindCertificateFieldsArgs): Promise<number>
|
|
8264
|
+
override async countCertificates(args: sdk.FindCertificatesArgs): Promise<number>
|
|
8265
|
+
override async countCommissions(args: sdk.FindCommissionsArgs): Promise<number>
|
|
8266
|
+
override async countOutputBaskets(args: sdk.FindOutputBasketsArgs): Promise<number>
|
|
8267
|
+
override async countOutputs(args: sdk.FindOutputsArgs): Promise<number>
|
|
8268
|
+
override async countOutputTagMaps(args: sdk.FindOutputTagMapsArgs): Promise<number>
|
|
8269
|
+
override async countOutputTags(args: sdk.FindOutputTagsArgs): Promise<number>
|
|
8270
|
+
override async countProvenTxReqs(args: sdk.FindProvenTxReqsArgs): Promise<number>
|
|
8271
|
+
override async countProvenTxs(args: sdk.FindProvenTxsArgs): Promise<number>
|
|
8272
|
+
override async countSyncStates(args: sdk.FindSyncStatesArgs): Promise<number>
|
|
8273
|
+
override async countTransactions(args: sdk.FindTransactionsArgs): Promise<number>
|
|
8274
|
+
override async countTxLabelMaps(args: sdk.FindTxLabelMapsArgs): Promise<number>
|
|
8275
|
+
override async countTxLabels(args: sdk.FindTxLabelsArgs): Promise<number>
|
|
8276
|
+
override async countUsers(args: sdk.FindUsersArgs): Promise<number>
|
|
8277
|
+
override async countMonitorEvents(args: sdk.FindMonitorEventsArgs): Promise<number>
|
|
8278
|
+
override async destroy(): Promise<void>
|
|
8279
|
+
override async migrate(storageName: string, storageIdentityKey: string): Promise<string>
|
|
8280
|
+
override async dropAllData(): Promise<void>
|
|
8281
|
+
override async transaction<T>(scope: (trx: sdk.TrxToken) => Promise<T>, trx?: sdk.TrxToken): Promise<T>
|
|
8282
|
+
toDb(trx?: sdk.TrxToken)
|
|
8283
|
+
async validateRawTransaction(t: TableTransaction, trx?: sdk.TrxToken): Promise<void>
|
|
8284
|
+
async validateOutputScript(o: TableOutput, trx?: sdk.TrxToken): Promise<void>
|
|
8285
|
+
_verifiedReadyForDatabaseAccess: boolean = false;
|
|
8286
|
+
async verifyReadyForDatabaseAccess(trx?: sdk.TrxToken): Promise<DBType>
|
|
8287
|
+
validatePartialForUpdate<T extends sdk.EntityTimeStamp>(update: Partial<T>, dateFields?: string[], booleanFields?: string[]): Partial<T>
|
|
8288
|
+
async validateEntityForInsert<T extends sdk.EntityTimeStamp>(entity: T, trx?: sdk.TrxToken, dateFields?: string[], booleanFields?: string[]): Promise<any>
|
|
8289
|
+
override async getLabelsForTransactionId(transactionId?: number, trx?: sdk.TrxToken): Promise<TableTxLabel[]>
|
|
8290
|
+
async extendOutput(o: TableOutput, includeBasket = false, includeTags = false, trx?: sdk.TrxToken): Promise<TableOutputX>
|
|
8291
|
+
override async getTagsForOutputId(outputId: number, trx?: sdk.TrxToken): Promise<TableOutputTag[]>
|
|
8292
|
+
override async purgeData(params: sdk.PurgeParams, trx?: sdk.TrxToken): Promise<sdk.PurgeResults>
|
|
8293
|
+
override async reviewStatus(args: {
|
|
8294
|
+
agedLimit: Date;
|
|
8295
|
+
trx?: sdk.TrxToken;
|
|
8296
|
+
}): Promise<{
|
|
8297
|
+
log: string;
|
|
8298
|
+
}>
|
|
8299
|
+
async countChangeInputs(userId: number, basketId: number, excludeSending: boolean): Promise<number>
|
|
8300
|
+
async allocateChangeInput(userId: number, basketId: number, targetSatoshis: number, exactSatoshis: number | undefined, excludeSending: boolean, transactionId: number): Promise<TableOutput | undefined> {
|
|
8301
|
+
const status: sdk.TransactionStatus[] = ["completed", "unproven"];
|
|
8302
|
+
if (!excludeSending)
|
|
8303
|
+
status.push("sending");
|
|
8304
|
+
const statusText = status.map(s => `'${s}'`).join(",");
|
|
8305
|
+
const r: TableOutput | undefined = await this.knex.transaction(async (trx) => {
|
|
8306
|
+
const txStatusCondition = `AND (SELECT status FROM transactions WHERE outputs.transactionId = transactions.transactionId) in (${statusText})`;
|
|
8307
|
+
let outputId: number | undefined;
|
|
8308
|
+
const setOutputId = async (rawQuery: string): Promise<void> => {
|
|
8309
|
+
let oidr = await trx.raw(rawQuery);
|
|
8310
|
+
outputId = undefined;
|
|
8311
|
+
if (!oidr["outputId"] && oidr.length > 0)
|
|
8312
|
+
oidr = oidr[0];
|
|
8313
|
+
if (!oidr["outputId"] && oidr.length > 0)
|
|
8314
|
+
oidr = oidr[0];
|
|
8315
|
+
if (oidr["outputId"])
|
|
8316
|
+
outputId = Number(oidr["outputId"]);
|
|
8317
|
+
};
|
|
8318
|
+
if (exactSatoshis !== undefined) {
|
|
8319
|
+
await setOutputId(`
|
|
8320
|
+
SELECT outputId
|
|
8321
|
+
FROM outputs
|
|
8322
|
+
WHERE userId = ${userId}
|
|
8323
|
+
AND spendable = 1
|
|
8324
|
+
AND basketId = ${basketId}
|
|
8325
|
+
${txStatusCondition}
|
|
8326
|
+
AND satoshis = ${exactSatoshis}
|
|
8327
|
+
LIMIT 1;
|
|
8328
|
+
`);
|
|
8329
|
+
}
|
|
8330
|
+
if (outputId === undefined) {
|
|
8331
|
+
await setOutputId(`
|
|
8332
|
+
SELECT outputId
|
|
8333
|
+
FROM outputs
|
|
8334
|
+
WHERE userId = ${userId}
|
|
8335
|
+
AND spendable = 1
|
|
8336
|
+
AND basketId = ${basketId}
|
|
8337
|
+
${txStatusCondition}
|
|
8338
|
+
AND satoshis - ${targetSatoshis} = (
|
|
8339
|
+
SELECT MIN(satoshis - ${targetSatoshis})
|
|
8340
|
+
FROM outputs
|
|
8341
|
+
WHERE userId = ${userId}
|
|
8342
|
+
AND spendable = 1
|
|
8343
|
+
AND basketId = ${basketId}
|
|
8344
|
+
${txStatusCondition}
|
|
8345
|
+
AND satoshis - ${targetSatoshis} >= 0
|
|
8346
|
+
)
|
|
8347
|
+
LIMIT 1;
|
|
8348
|
+
`);
|
|
8349
|
+
}
|
|
8350
|
+
if (outputId === undefined) {
|
|
8351
|
+
await setOutputId(`
|
|
8352
|
+
SELECT outputId
|
|
8353
|
+
FROM outputs
|
|
8354
|
+
WHERE userId = ${userId}
|
|
8355
|
+
AND spendable = 1
|
|
8356
|
+
AND basketId = ${basketId}
|
|
8357
|
+
${txStatusCondition}
|
|
8358
|
+
AND satoshis - ${targetSatoshis} = (
|
|
8359
|
+
SELECT MAX(satoshis - ${targetSatoshis})
|
|
8360
|
+
FROM outputs
|
|
8361
|
+
WHERE userId = ${userId}
|
|
8362
|
+
AND spendable = 1
|
|
8363
|
+
AND basketId = ${basketId}
|
|
8364
|
+
${txStatusCondition}
|
|
8365
|
+
AND satoshis - ${targetSatoshis} < 0
|
|
8366
|
+
)
|
|
8367
|
+
LIMIT 1;
|
|
8368
|
+
`);
|
|
8369
|
+
}
|
|
8370
|
+
if (outputId === undefined)
|
|
8371
|
+
return undefined;
|
|
8372
|
+
await this.updateOutput(outputId, {
|
|
8373
|
+
spendable: false,
|
|
8374
|
+
spentBy: transactionId
|
|
8375
|
+
}, trx);
|
|
8376
|
+
const r = verifyTruthy(await this.findOutputById(outputId, trx));
|
|
8377
|
+
return r;
|
|
8378
|
+
});
|
|
8379
|
+
return r;
|
|
8380
|
+
}
|
|
8381
|
+
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[], booleanFields?: string[]): T
|
|
8382
|
+
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[], booleanFields?: string[]): T[]
|
|
8383
|
+
}
|
|
8384
|
+
```
|
|
8385
|
+
|
|
8386
|
+
See also: [AuthId](./client.md#interface-authid), [DBType](./storage.md#type-dbtype), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindPartialSincePagedArgs](./client.md#interface-findpartialsincepagedargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [ProvenOrRawTx](./client.md#interface-provenorrawtx), [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageKnexOptions](./storage.md#interface-storageknexoptions), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableOutputX](./storage.md#interface-tableoutputx), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TransactionStatus](./client.md#type-transactionstatus), [TrxToken](./client.md#interface-trxtoken), [ValidListActionsArgs](./client.md#interface-validlistactionsargs), [ValidListOutputsArgs](./client.md#interface-validlistoutputsargs), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [listActions](./storage.md#function-listactions), [listOutputs](./storage.md#function-listoutputs), [purgeData](./storage.md#function-purgedata), [reviewStatus](./storage.md#function-reviewstatus), [verifyTruthy](./client.md#function-verifytruthy)
|
|
8387
|
+
|
|
8388
|
+
###### Method allocateChangeInput
|
|
8389
|
+
|
|
8390
|
+
Finds closest matching available change output to use as input for new transaction.
|
|
8391
|
+
|
|
8392
|
+
Transactionally allocate the output such that
|
|
8393
|
+
|
|
8394
|
+
```ts
|
|
8395
|
+
async allocateChangeInput(userId: number, basketId: number, targetSatoshis: number, exactSatoshis: number | undefined, excludeSending: boolean, transactionId: number): Promise<TableOutput | undefined>
|
|
8396
|
+
```
|
|
8397
|
+
See also: [TableOutput](./storage.md#interface-tableoutput)
|
|
8398
|
+
|
|
8399
|
+
###### Method countChangeInputs
|
|
8400
|
+
|
|
8401
|
+
Finds closest matching available change output to use as input for new transaction.
|
|
8402
|
+
|
|
8403
|
+
Transactionally allocate the output such that
|
|
8404
|
+
|
|
8405
|
+
```ts
|
|
8406
|
+
async countChangeInputs(userId: number, basketId: number, excludeSending: boolean): Promise<number>
|
|
8407
|
+
```
|
|
8408
|
+
|
|
8409
|
+
###### Method toDb
|
|
8410
|
+
|
|
8411
|
+
Convert the standard optional `TrxToken` parameter into either a direct knex database instance,
|
|
8412
|
+
or a Knex.Transaction as appropriate.
|
|
8413
|
+
|
|
8414
|
+
```ts
|
|
8415
|
+
toDb(trx?: sdk.TrxToken)
|
|
8416
|
+
```
|
|
8417
|
+
See also: [TrxToken](./client.md#interface-trxtoken)
|
|
8418
|
+
|
|
8419
|
+
###### Method validateEntities
|
|
8420
|
+
|
|
8421
|
+
Helper to force uniform behavior across database engines.
|
|
8422
|
+
Use to process all arrays of records with time stamps retreived from database.
|
|
8423
|
+
|
|
8424
|
+
```ts
|
|
8425
|
+
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[], booleanFields?: string[]): T[]
|
|
8426
|
+
```
|
|
8427
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8428
|
+
|
|
8429
|
+
Returns
|
|
8430
|
+
|
|
8431
|
+
input `entities` array with contained values validated.
|
|
8432
|
+
|
|
8433
|
+
###### Method validateEntity
|
|
8434
|
+
|
|
8435
|
+
Helper to force uniform behavior across database engines.
|
|
8436
|
+
Use to process all individual records with time stamps retreived from database.
|
|
8437
|
+
|
|
8438
|
+
```ts
|
|
8439
|
+
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[], booleanFields?: string[]): T
|
|
8440
|
+
```
|
|
8441
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8442
|
+
|
|
8443
|
+
###### Method validateEntityForInsert
|
|
8444
|
+
|
|
8445
|
+
Helper to force uniform behavior across database engines.
|
|
8446
|
+
Use to process new entities being inserted into the database.
|
|
8447
|
+
|
|
8448
|
+
```ts
|
|
8449
|
+
async validateEntityForInsert<T extends sdk.EntityTimeStamp>(entity: T, trx?: sdk.TrxToken, dateFields?: string[], booleanFields?: string[]): Promise<any>
|
|
8450
|
+
```
|
|
8451
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp), [TrxToken](./client.md#interface-trxtoken)
|
|
8452
|
+
|
|
8453
|
+
###### Method validatePartialForUpdate
|
|
8454
|
+
|
|
8455
|
+
Helper to force uniform behavior across database engines.
|
|
8456
|
+
Use to process the update template for entities being updated.
|
|
8457
|
+
|
|
8458
|
+
```ts
|
|
8459
|
+
validatePartialForUpdate<T extends sdk.EntityTimeStamp>(update: Partial<T>, dateFields?: string[], booleanFields?: string[]): Partial<T>
|
|
8460
|
+
```
|
|
8461
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8462
|
+
|
|
8463
|
+
###### Method verifyReadyForDatabaseAccess
|
|
8464
|
+
|
|
8465
|
+
Make sure database is ready for access:
|
|
8466
|
+
|
|
8467
|
+
- dateScheme is known
|
|
8468
|
+
- foreign key constraints are enabled
|
|
8469
|
+
|
|
8470
|
+
```ts
|
|
8471
|
+
async verifyReadyForDatabaseAccess(trx?: sdk.TrxToken): Promise<DBType>
|
|
8472
|
+
```
|
|
8473
|
+
See also: [DBType](./storage.md#type-dbtype), [TrxToken](./client.md#interface-trxtoken)
|
|
8474
|
+
|
|
8475
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8476
|
+
|
|
7184
8477
|
---
|
|
7185
8478
|
##### Class: StorageProvider
|
|
7186
8479
|
|
|
@@ -7500,6 +8793,47 @@ See also: [AuthId](./client.md#interface-authid), [FindOutputTagMapsArgs](./clie
|
|
|
7500
8793
|
|
|
7501
8794
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7502
8795
|
|
|
8796
|
+
---
|
|
8797
|
+
##### Class: StorageServer
|
|
8798
|
+
|
|
8799
|
+
```ts
|
|
8800
|
+
export class StorageServer {
|
|
8801
|
+
constructor(storage: StorageProvider, options: WalletStorageServerOptions)
|
|
8802
|
+
public start(): void
|
|
8803
|
+
validateDate(date: Date | string | number): Date
|
|
8804
|
+
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[]): T
|
|
8805
|
+
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[]): T[]
|
|
8806
|
+
}
|
|
8807
|
+
```
|
|
8808
|
+
|
|
8809
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp), [StorageProvider](./storage.md#class-storageprovider), [WalletStorageServerOptions](./storage.md#interface-walletstorageserveroptions)
|
|
8810
|
+
|
|
8811
|
+
###### Method validateEntities
|
|
8812
|
+
|
|
8813
|
+
Helper to force uniform behavior across database engines.
|
|
8814
|
+
Use to process all arrays of records with time stamps retreived from database.
|
|
8815
|
+
|
|
8816
|
+
```ts
|
|
8817
|
+
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[]): T[]
|
|
8818
|
+
```
|
|
8819
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8820
|
+
|
|
8821
|
+
Returns
|
|
8822
|
+
|
|
8823
|
+
input `entities` array with contained values validated.
|
|
8824
|
+
|
|
8825
|
+
###### Method validateEntity
|
|
8826
|
+
|
|
8827
|
+
Helper to force uniform behavior across database engines.
|
|
8828
|
+
Use to process all individual records with time stamps retreived from database.
|
|
8829
|
+
|
|
8830
|
+
```ts
|
|
8831
|
+
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[]): T
|
|
8832
|
+
```
|
|
8833
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8834
|
+
|
|
8835
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8836
|
+
|
|
7503
8837
|
---
|
|
7504
8838
|
##### Class: StorageSyncReader
|
|
7505
8839
|
|
|
@@ -7786,6 +9120,57 @@ See also: [Monitor](./monitor.md#class-monitor), [WalletMonitorTask](./monitor.m
|
|
|
7786
9120
|
|
|
7787
9121
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7788
9122
|
|
|
9123
|
+
---
|
|
9124
|
+
##### Class: TaskUnFail
|
|
9125
|
+
|
|
9126
|
+
Setting provenTxReq status to 'unfail' when 'invalid' will attempt to find a merklePath, and if successful:
|
|
9127
|
+
|
|
9128
|
+
1. set the req status to 'unmined'
|
|
9129
|
+
2. set the referenced txs to 'unproven'
|
|
9130
|
+
3. determine if any inputs match user's existing outputs and if so update spentBy and spendable of those outputs.
|
|
9131
|
+
4. set the txs outputs to spendable
|
|
9132
|
+
|
|
9133
|
+
If it fails (to find a merklePath), returns the req status to 'invalid'.
|
|
9134
|
+
|
|
9135
|
+
```ts
|
|
9136
|
+
export class TaskUnFail extends WalletMonitorTask {
|
|
9137
|
+
static taskName = "UnFail";
|
|
9138
|
+
static checkNow = false;
|
|
9139
|
+
constructor(monitor: Monitor, public triggerMsecs = monitor.oneMinute * 10)
|
|
9140
|
+
trigger(nowMsecsSinceEpoch: number): {
|
|
9141
|
+
run: boolean;
|
|
9142
|
+
}
|
|
9143
|
+
async runTask(): Promise<string>
|
|
9144
|
+
async unfail(reqs: TableProvenTxReq[], indent = 0): Promise<{
|
|
9145
|
+
log: string;
|
|
9146
|
+
}>
|
|
9147
|
+
async unfailReq(req: EntityProvenTxReq, indent: number): Promise<string>
|
|
9148
|
+
}
|
|
9149
|
+
```
|
|
9150
|
+
|
|
9151
|
+
See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq), [Monitor](./monitor.md#class-monitor), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [WalletMonitorTask](./monitor.md#class-walletmonitortask)
|
|
9152
|
+
|
|
9153
|
+
###### Property checkNow
|
|
9154
|
+
|
|
9155
|
+
Set to true to trigger running this task
|
|
9156
|
+
|
|
9157
|
+
```ts
|
|
9158
|
+
static checkNow = false
|
|
9159
|
+
```
|
|
9160
|
+
|
|
9161
|
+
###### Method unfailReq
|
|
9162
|
+
|
|
9163
|
+
2. set the referenced txs to 'unproven'
|
|
9164
|
+
3. determine if any inputs match user's existing outputs and if so update spentBy and spendable of those outputs.
|
|
9165
|
+
4. set the txs outputs to spendable
|
|
9166
|
+
|
|
9167
|
+
```ts
|
|
9168
|
+
async unfailReq(req: EntityProvenTxReq, indent: number): Promise<string>
|
|
9169
|
+
```
|
|
9170
|
+
See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq)
|
|
9171
|
+
|
|
9172
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9173
|
+
|
|
7789
9174
|
---
|
|
7790
9175
|
##### Class: TwilioPhoneInteractor
|
|
7791
9176
|
|
|
@@ -9331,41 +10716,43 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
9331
10716
|
|
|
9332
10717
|
| | | |
|
|
9333
10718
|
| --- | --- | --- |
|
|
9334
|
-
| [acquireDirectCertificate](#function-acquiredirectcertificate) | [
|
|
9335
|
-
| [arcDefaultUrl](#function-arcdefaulturl) | [
|
|
9336
|
-
| [arraysEqual](#function-arraysequal) | [
|
|
9337
|
-
| [asArray](#function-asarray) | [
|
|
9338
|
-
| [
|
|
9339
|
-
| [
|
|
9340
|
-
| [
|
|
9341
|
-
| [
|
|
10719
|
+
| [acquireDirectCertificate](#function-acquiredirectcertificate) | [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [validateDiscoverByAttributesArgs](#function-validatediscoverbyattributesargs) |
|
|
10720
|
+
| [arcDefaultUrl](#function-arcdefaulturl) | [makeAtomicBeef](#function-makeatomicbeef) | [validateDiscoverByIdentityKeyArgs](#function-validatediscoverbyidentitykeyargs) |
|
|
10721
|
+
| [arraysEqual](#function-arraysequal) | [makeAtomicBeef](#function-makeatomicbeef) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
|
|
10722
|
+
| [asArray](#function-asarray) | [makeChangeLock](#function-makechangelock) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
|
|
10723
|
+
| [asArray](#function-asarray) | [maxDate](#function-maxdate) | [validateInteger](#function-validateinteger) |
|
|
10724
|
+
| [asBsvSdkPrivateKey](#function-asbsvsdkprivatekey) | [offsetPubKey](#function-offsetpubkey) | [validateInternalizeActionArgs](#function-validateinternalizeactionargs) |
|
|
10725
|
+
| [asBsvSdkPublickKey](#function-asbsvsdkpublickkey) | [optionalArraysEqual](#function-optionalarraysequal) | [validateInternalizeOutput](#function-validateinternalizeoutput) |
|
|
10726
|
+
| [asBsvSdkScript](#function-asbsvsdkscript) | [parseTxScriptOffsets](#function-parsetxscriptoffsets) | [validateListActionsArgs](#function-validatelistactionsargs) |
|
|
10727
|
+
| [asBsvSdkTx](#function-asbsvsdktx) | [parseWalletOutpoint](#function-parsewalletoutpoint) | [validateListCertificatesArgs](#function-validatelistcertificatesargs) |
|
|
10728
|
+
| [asBuffer](#function-asbuffer) | [processAction](#function-processaction) | [validateListOutputsArgs](#function-validatelistoutputsargs) |
|
|
10729
|
+
| [asString](#function-asstring) | [processAction](#function-processaction) | [validateOptionalInteger](#function-validateoptionalinteger) |
|
|
9342
10730
|
| [asString](#function-asstring) | [proveCertificate](#function-provecertificate) | [validateOptionalOutpointString](#function-validateoptionaloutpointstring) |
|
|
9343
|
-
| [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [
|
|
9344
|
-
| [buildSignableTransaction](#function-buildsignabletransaction) | [
|
|
9345
|
-
| [completeSignedTransaction](#function-completesignedtransaction) | [
|
|
9346
|
-
| [completeSignedTransaction](#function-completesignedtransaction) | [
|
|
9347
|
-
| [convertProofToMerklePath](#function-convertprooftomerklepath) | [
|
|
9348
|
-
| [createAction](#function-createaction) | [
|
|
9349
|
-
| [createAction](#function-createaction) | [
|
|
9350
|
-
| [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [
|
|
9351
|
-
| [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [
|
|
9352
|
-
| [createSyncMap](#function-createsyncmap) | [
|
|
9353
|
-
| [doubleSha256BE](#function-doublesha256be) | [
|
|
9354
|
-
| [doubleSha256HashLE](#function-doublesha256hashle) | [
|
|
9355
|
-
| [generateChangeSdk](#function-generatechangesdk) | [
|
|
9356
|
-
| [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [
|
|
9357
|
-
| [getBeefForTransaction](#function-getbeeffortransaction) | [
|
|
9358
|
-
| [getExchangeRatesIo](#function-getexchangeratesio) | [
|
|
9359
|
-
| [getIdentityKey](#function-getidentitykey) | [
|
|
9360
|
-
| [getSyncChunk](#function-getsyncchunk) | [
|
|
9361
|
-
| [internalizeAction](#function-internalizeaction) | [
|
|
9362
|
-
| [internalizeAction](#function-internalizeaction) | [
|
|
9363
|
-
| [isHexString](#function-ishexstring) | [
|
|
9364
|
-
| [isSpecOp](#function-isspecop) | [
|
|
9365
|
-
| [
|
|
9366
|
-
| [
|
|
9367
|
-
| [
|
|
9368
|
-
| [makeAtomicBeef](#function-makeatomicbeef) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) | |
|
|
10731
|
+
| [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [purgeData](#function-purgedata) | [validateOriginator](#function-validateoriginator) |
|
|
10732
|
+
| [buildSignableTransaction](#function-buildsignabletransaction) | [randomBytes](#function-randombytes) | [validateOutpointString](#function-validateoutpointstring) |
|
|
10733
|
+
| [completeSignedTransaction](#function-completesignedtransaction) | [randomBytesBase64](#function-randombytesbase64) | [validatePositiveIntegerOrZero](#function-validatepositiveintegerorzero) |
|
|
10734
|
+
| [completeSignedTransaction](#function-completesignedtransaction) | [randomBytesHex](#function-randombyteshex) | [validateProveCertificateArgs](#function-validateprovecertificateargs) |
|
|
10735
|
+
| [convertProofToMerklePath](#function-convertprooftomerklepath) | [reviewStatus](#function-reviewstatus) | [validateRelinquishCertificateArgs](#function-validaterelinquishcertificateargs) |
|
|
10736
|
+
| [createAction](#function-createaction) | [sha256Hash](#function-sha256hash) | [validateRelinquishOutputArgs](#function-validaterelinquishoutputargs) |
|
|
10737
|
+
| [createAction](#function-createaction) | [signAction](#function-signaction) | [validateSatoshis](#function-validatesatoshis) |
|
|
10738
|
+
| [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [stampLog](#function-stamplog) | [validateScriptHash](#function-validatescripthash) |
|
|
10739
|
+
| [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [stampLogFormat](#function-stamplogformat) | [validateSecondsSinceEpoch](#function-validatesecondssinceepoch) |
|
|
10740
|
+
| [createSyncMap](#function-createsyncmap) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) | [validateSignActionArgs](#function-validatesignactionargs) |
|
|
10741
|
+
| [doubleSha256BE](#function-doublesha256be) | [toWalletNetwork](#function-towalletnetwork) | [validateSignActionOptions](#function-validatesignactionoptions) |
|
|
10742
|
+
| [doubleSha256HashLE](#function-doublesha256hashle) | [transactionInputSize](#function-transactioninputsize) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
|
|
10743
|
+
| [generateChangeSdk](#function-generatechangesdk) | [transactionOutputSize](#function-transactionoutputsize) | [validateStringLength](#function-validatestringlength) |
|
|
10744
|
+
| [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [transactionSize](#function-transactionsize) | [validateWalletPayment](#function-validatewalletpayment) |
|
|
10745
|
+
| [getBeefForTransaction](#function-getbeeffortransaction) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) | [varUintSize](#function-varuintsize) |
|
|
10746
|
+
| [getExchangeRatesIo](#function-getexchangeratesio) | [updateExchangeratesapi](#function-updateexchangeratesapi) | [verifyHexString](#function-verifyhexstring) |
|
|
10747
|
+
| [getIdentityKey](#function-getidentitykey) | [validateAbortActionArgs](#function-validateabortactionargs) | [verifyId](#function-verifyid) |
|
|
10748
|
+
| [getSyncChunk](#function-getsyncchunk) | [validateAcquireCertificateArgs](#function-validateacquirecertificateargs) | [verifyInteger](#function-verifyinteger) |
|
|
10749
|
+
| [internalizeAction](#function-internalizeaction) | [validateAcquireDirectCertificateArgs](#function-validateacquiredirectcertificateargs) | [verifyNumber](#function-verifynumber) |
|
|
10750
|
+
| [internalizeAction](#function-internalizeaction) | [validateAcquireIssuanceCertificateArgs](#function-validateacquireissuancecertificateargs) | [verifyOne](#function-verifyone) |
|
|
10751
|
+
| [isHexString](#function-ishexstring) | [validateBasketInsertion](#function-validatebasketinsertion) | [verifyOneOrNone](#function-verifyoneornone) |
|
|
10752
|
+
| [isSpecOp](#function-isspecop) | [validateCreateActionArgs](#function-validatecreateactionargs) | [verifyOptionalHexString](#function-verifyoptionalhexstring) |
|
|
10753
|
+
| [listActions](#function-listactions) | [validateCreateActionInput](#function-validatecreateactioninput) | [verifyTruthy](#function-verifytruthy) |
|
|
10754
|
+
| [listCertificates](#function-listcertificates) | [validateCreateActionOptions](#function-validatecreateactionoptions) | [wait](#function-wait) |
|
|
10755
|
+
| [listOutputs](#function-listoutputs) | [validateCreateActionOutput](#function-validatecreateactionoutput) | |
|
|
9369
10756
|
|
|
9370
10757
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9371
10758
|
|
|
@@ -9412,6 +10799,15 @@ export function asArray(val: string | number[]): number[]
|
|
|
9412
10799
|
|
|
9413
10800
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9414
10801
|
|
|
10802
|
+
---
|
|
10803
|
+
##### Function: asArray
|
|
10804
|
+
|
|
10805
|
+
```ts
|
|
10806
|
+
export function asArray(val: Buffer | string | number[], encoding?: BufferEncoding): number[]
|
|
10807
|
+
```
|
|
10808
|
+
|
|
10809
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10810
|
+
|
|
9415
10811
|
---
|
|
9416
10812
|
##### Function: asBsvSdkPrivateKey
|
|
9417
10813
|
|
|
@@ -9480,6 +10876,37 @@ export function asBsvSdkTx(tx: HexString | number[] | Transaction): Transaction
|
|
|
9480
10876
|
|
|
9481
10877
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9482
10878
|
|
|
10879
|
+
---
|
|
10880
|
+
##### Function: asBuffer
|
|
10881
|
+
|
|
10882
|
+
Coerce a value to Buffer if currently encoded as a string or
|
|
10883
|
+
|
|
10884
|
+
```ts
|
|
10885
|
+
export function asBuffer(val: Buffer | string | number[], encoding?: BufferEncoding): Buffer {
|
|
10886
|
+
let b: Buffer;
|
|
10887
|
+
if (Buffer.isBuffer(val))
|
|
10888
|
+
b = val;
|
|
10889
|
+
else if (typeof val === "string")
|
|
10890
|
+
b = Buffer.from(val, encoding ?? "hex");
|
|
10891
|
+
else
|
|
10892
|
+
b = Buffer.from(val);
|
|
10893
|
+
return b;
|
|
10894
|
+
}
|
|
10895
|
+
```
|
|
10896
|
+
|
|
10897
|
+
Returns
|
|
10898
|
+
|
|
10899
|
+
input val if it is a Buffer or new Buffer from string val
|
|
10900
|
+
|
|
10901
|
+
Argument Details
|
|
10902
|
+
|
|
10903
|
+
+ **val**
|
|
10904
|
+
+ Buffer or string or number[]. If string, encoding param applies. If number[], Buffer.from constructor is used.
|
|
10905
|
+
+ **encoding**
|
|
10906
|
+
+ defaults to 'hex'. Only applies to val of type string
|
|
10907
|
+
|
|
10908
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10909
|
+
|
|
9483
10910
|
---
|
|
9484
10911
|
##### Function: asString
|
|
9485
10912
|
|
|
@@ -9504,6 +10931,32 @@ Argument Details
|
|
|
9504
10931
|
|
|
9505
10932
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9506
10933
|
|
|
10934
|
+
---
|
|
10935
|
+
##### Function: asString
|
|
10936
|
+
|
|
10937
|
+
Coerce a value to an encoded string if currently a Buffer or number[]
|
|
10938
|
+
|
|
10939
|
+
```ts
|
|
10940
|
+
export function asString(val: Buffer | string | number[], encoding?: BufferEncoding): string {
|
|
10941
|
+
if (Array.isArray(val))
|
|
10942
|
+
val = Buffer.from(val);
|
|
10943
|
+
return Buffer.isBuffer(val) ? val.toString(encoding ?? "hex") : val;
|
|
10944
|
+
}
|
|
10945
|
+
```
|
|
10946
|
+
|
|
10947
|
+
Returns
|
|
10948
|
+
|
|
10949
|
+
input val if it is a string; or if number[], first converted to Buffer then as Buffer; if Buffer encoded using `encoding`
|
|
10950
|
+
|
|
10951
|
+
Argument Details
|
|
10952
|
+
|
|
10953
|
+
+ **val**
|
|
10954
|
+
+ Buffer or string or number[]. If string, encoding param applies. If number[], Buffer.from constructor is used.
|
|
10955
|
+
+ **encoding**
|
|
10956
|
+
+ defaults to 'hex'
|
|
10957
|
+
|
|
10958
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10959
|
+
|
|
9507
10960
|
---
|
|
9508
10961
|
##### Function: attemptToPostReqsToNetwork
|
|
9509
10962
|
|
|
@@ -9868,6 +11321,17 @@ Argument Details
|
|
|
9868
11321
|
|
|
9869
11322
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9870
11323
|
|
|
11324
|
+
---
|
|
11325
|
+
##### Function: listActions
|
|
11326
|
+
|
|
11327
|
+
```ts
|
|
11328
|
+
export async function listActions(storage: StorageKnex, auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs): Promise<ListActionsResult>
|
|
11329
|
+
```
|
|
11330
|
+
|
|
11331
|
+
See also: [AuthId](./client.md#interface-authid), [StorageKnex](./storage.md#class-storageknex), [ValidListActionsArgs](./client.md#interface-validlistactionsargs)
|
|
11332
|
+
|
|
11333
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11334
|
+
|
|
9871
11335
|
---
|
|
9872
11336
|
##### Function: listCertificates
|
|
9873
11337
|
|
|
@@ -9879,6 +11343,17 @@ See also: [AuthId](./client.md#interface-authid), [StorageProvider](./storage.md
|
|
|
9879
11343
|
|
|
9880
11344
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9881
11345
|
|
|
11346
|
+
---
|
|
11347
|
+
##### Function: listOutputs
|
|
11348
|
+
|
|
11349
|
+
```ts
|
|
11350
|
+
export async function listOutputs(dsk: StorageKnex, auth: sdk.AuthId, vargs: sdk.ValidListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
|
|
11351
|
+
```
|
|
11352
|
+
|
|
11353
|
+
See also: [AuthId](./client.md#interface-authid), [StorageKnex](./storage.md#class-storageknex), [ValidListOutputsArgs](./client.md#interface-validlistoutputsargs)
|
|
11354
|
+
|
|
11355
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11356
|
+
|
|
9882
11357
|
---
|
|
9883
11358
|
##### Function: lockScriptWithKeyOffsetFromPubKey
|
|
9884
11359
|
|
|
@@ -10008,6 +11483,17 @@ See also: [AuthId](./client.md#interface-authid), [ValidProveCertificateArgs](./
|
|
|
10008
11483
|
|
|
10009
11484
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10010
11485
|
|
|
11486
|
+
---
|
|
11487
|
+
##### Function: purgeData
|
|
11488
|
+
|
|
11489
|
+
```ts
|
|
11490
|
+
export async function purgeData(storage: StorageKnex, params: sdk.PurgeParams, trx?: sdk.TrxToken): Promise<sdk.PurgeResults>
|
|
11491
|
+
```
|
|
11492
|
+
|
|
11493
|
+
See also: [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageKnex](./storage.md#class-storageknex), [TrxToken](./client.md#interface-trxtoken)
|
|
11494
|
+
|
|
11495
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11496
|
+
|
|
10011
11497
|
---
|
|
10012
11498
|
##### Function: randomBytes
|
|
10013
11499
|
|
|
@@ -10047,6 +11533,22 @@ count cryptographically secure random bytes as hex encoded string
|
|
|
10047
11533
|
|
|
10048
11534
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10049
11535
|
|
|
11536
|
+
---
|
|
11537
|
+
##### Function: reviewStatus
|
|
11538
|
+
|
|
11539
|
+
```ts
|
|
11540
|
+
export async function reviewStatus(storage: StorageKnex, args: {
|
|
11541
|
+
agedLimit: Date;
|
|
11542
|
+
trx?: sdk.TrxToken;
|
|
11543
|
+
}): Promise<{
|
|
11544
|
+
log: string;
|
|
11545
|
+
}>
|
|
11546
|
+
```
|
|
11547
|
+
|
|
11548
|
+
See also: [StorageKnex](./storage.md#class-storageknex), [TrxToken](./client.md#interface-trxtoken)
|
|
11549
|
+
|
|
11550
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11551
|
+
|
|
10050
11552
|
---
|
|
10051
11553
|
##### Function: sha256Hash
|
|
10052
11554
|
|
|
@@ -11017,8 +12519,10 @@ invalid: rawTx is structuraly invalid or was rejected by the network. Will never
|
|
|
11017
12519
|
|
|
11018
12520
|
completed: proven_txs record added, and notifications are complete.
|
|
11019
12521
|
|
|
12522
|
+
unfail: asigned to force review of a currently invalid ProvenTxReq.
|
|
12523
|
+
|
|
11020
12524
|
```ts
|
|
11021
|
-
export type ProvenTxReqStatus = "sending" | "unsent" | "nosend" | "unknown" | "nonfinal" | "unprocessed" | "unmined" | "callback" | "unconfirmed" | "completed" | "invalid" | "doubleSpend"
|
|
12525
|
+
export type ProvenTxReqStatus = "sending" | "unsent" | "nosend" | "unknown" | "nonfinal" | "unprocessed" | "unmined" | "callback" | "unconfirmed" | "completed" | "invalid" | "doubleSpend" | "unfail"
|
|
11022
12526
|
```
|
|
11023
12527
|
|
|
11024
12528
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|