@bsv/wallet-toolbox 1.3.8 → 1.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/client.md +1363 -133
- package/docs/storage.md +16 -10
- package/docs/wallet.md +1349 -119
- package/out/src/Wallet.js.map +1 -1
- package/out/src/index.client.d.ts +2 -0
- package/out/src/index.client.d.ts.map +1 -1
- package/out/src/index.client.js +2 -0
- package/out/src/index.client.js.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +15 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.d.ts +5 -1
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +17 -13
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts +2 -0
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +48 -0
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/__test/adminStats.man.test.js.map +1 -1
- package/out/src/storage/index.all.d.ts +1 -0
- package/out/src/storage/index.all.d.ts.map +1 -1
- package/out/src/storage/index.all.js +1 -0
- package/out/src/storage/index.all.js.map +1 -1
- package/out/src/storage/index.client.d.ts +1 -0
- package/out/src/storage/index.client.d.ts.map +1 -1
- package/out/src/storage/index.client.js +1 -0
- package/out/src/storage/index.client.js.map +1 -1
- package/out/src/storage/remoting/StorageClient.d.ts +1 -1
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
- package/out/test/Wallet/local/localWallet2.man.test.js +58 -38
- package/out/test/Wallet/local/localWallet2.man.test.js.map +1 -1
- package/out/test/Wallet/support/operations.man.test.js +5 -3
- package/out/test/Wallet/support/operations.man.test.js.map +1 -1
- package/out/test/storage/idb/idbSpeed.test.js +1 -0
- package/out/test/storage/idb/idbSpeed.test.js.map +1 -1
- package/out/test/storage/idb/update.test.js +8 -8
- package/out/test/storage/idb/update.test.js.map +1 -1
- package/out/test/utils/localWalletMethods.d.ts +7 -2
- package/out/test/utils/localWalletMethods.d.ts.map +1 -1
- package/out/test/utils/localWalletMethods.js +19 -0
- package/out/test/utils/localWalletMethods.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Wallet.ts +2 -2
- package/src/index.client.ts +2 -0
- package/src/sdk/WalletStorage.interfaces.ts +17 -0
- package/src/storage/StorageIdb.ts +18 -14
- package/src/storage/WalletStorageManager.ts +50 -0
- package/src/storage/__test/adminStats.man.test.ts +8 -8
- package/src/storage/index.all.ts +1 -0
- package/src/storage/index.client.ts +1 -0
- package/src/storage/remoting/StorageClient.ts +1 -1
- package/test/Wallet/local/localWallet2.man.test.ts +66 -42
- package/test/Wallet/support/operations.man.test.ts +5 -3
- package/test/storage/idb/idbSpeed.test.ts +2 -0
- package/test/storage/idb/update.test.ts +8 -9
- package/test/utils/localWalletMethods.ts +34 -2
package/docs/client.md
CHANGED
|
@@ -14,65 +14,69 @@ 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
|
-
| [BaseBlockHeader](#interface-baseblockheader) | [
|
|
23
|
-
| [BitailsConfig](#interface-bitailsconfig) | [
|
|
24
|
-
| [BitailsMerkleProof](#interface-bitailsmerkleproof) | [
|
|
25
|
-
| [BlockHeader](#interface-blockheader) | [
|
|
26
|
-
| [BlockHeader](#interface-blockheader) | [
|
|
27
|
-
| [BsvExchangeRate](#interface-bsvexchangerate) | [
|
|
28
|
-
| [CertOpsWallet](#interface-certopswallet) | [
|
|
29
|
-
| [Certifier](#interface-certifier) | [
|
|
30
|
-
| [CommitNewTxResults](#interface-commitnewtxresults) | [
|
|
31
|
-
| [CompleteAuthResponse](#interface-completeauthresponse) | [
|
|
32
|
-
| [CreateActionResultX](#interface-createactionresultx) | [
|
|
33
|
-
| [EntitySyncMap](#interface-entitysyncmap) | [
|
|
34
|
-
| [EntityTimeStamp](#interface-entitytimestamp) | [
|
|
35
|
-
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [
|
|
36
|
-
| [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [
|
|
37
|
-
| [FiatExchangeRates](#interface-fiatexchangerates) | [
|
|
38
|
-
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [
|
|
39
|
-
| [FindCertificatesArgs](#interface-findcertificatesargs) | [
|
|
40
|
-
| [FindCommissionsArgs](#interface-findcommissionsargs) | [
|
|
41
|
-
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [
|
|
42
|
-
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [
|
|
43
|
-
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [
|
|
44
|
-
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [
|
|
45
|
-
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [
|
|
46
|
-
| [FindOutputsArgs](#interface-findoutputsargs) | [
|
|
47
|
-
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [
|
|
48
|
-
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [
|
|
49
|
-
| [FindProvenTxsArgs](#interface-findproventxsargs) | [
|
|
50
|
-
| [FindSincePagedArgs](#interface-findsincepagedargs) | [
|
|
51
|
-
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [
|
|
52
|
-
| [FindTransactionsArgs](#interface-findtransactionsargs) | [
|
|
53
|
-
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [
|
|
54
|
-
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [
|
|
55
|
-
| [FindUsersArgs](#interface-findusersargs) | [
|
|
56
|
-
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [
|
|
57
|
-
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [
|
|
58
|
-
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [
|
|
59
|
-
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [
|
|
60
|
-
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [
|
|
61
|
-
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [
|
|
62
|
-
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [
|
|
63
|
-
| [GetMerklePathResult](#interface-getmerklepathresult) | [
|
|
64
|
-
| [GetRawTxResult](#interface-getrawtxresult) | [
|
|
65
|
-
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [
|
|
66
|
-
| [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [
|
|
67
|
-
| [GetScriptHashHistory](#interface-getscripthashhistory) | [
|
|
68
|
-
| [GetScriptHashHistoryResult](#interface-getscripthashhistoryresult) | [
|
|
69
|
-
| [GetStatusForTxidsResult](#interface-getstatusfortxidsresult) | [
|
|
70
|
-
| [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [
|
|
71
|
-
| [GetUtxoStatusResult](#interface-getutxostatusresult) | [
|
|
72
|
-
| [KeyPair](#interface-keypair) | [
|
|
73
|
-
| [
|
|
74
|
-
| [
|
|
75
|
-
| [
|
|
17
|
+
| [ArcConfig](#interface-arcconfig) | [PendingSignAction](#interface-pendingsignaction) | [TableOutputX](#interface-tableoutputx) |
|
|
18
|
+
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [PendingStorageInput](#interface-pendingstorageinput) | [TableProvenTx](#interface-tableproventx) |
|
|
19
|
+
| [AuthId](#interface-authid) | [PermissionRequest](#interface-permissionrequest) | [TableProvenTxReq](#interface-tableproventxreq) |
|
|
20
|
+
| [AuthPayload](#interface-authpayload) | [PermissionToken](#interface-permissiontoken) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) |
|
|
21
|
+
| [BaseBlockHeader](#interface-baseblockheader) | [PermissionsManagerConfig](#interface-permissionsmanagerconfig) | [TableSettings](#interface-tablesettings) |
|
|
22
|
+
| [BaseBlockHeader](#interface-baseblockheader) | [PostBeefResult](#interface-postbeefresult) | [TableSyncState](#interface-tablesyncstate) |
|
|
23
|
+
| [BitailsConfig](#interface-bitailsconfig) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TableTransaction](#interface-tabletransaction) |
|
|
24
|
+
| [BitailsMerkleProof](#interface-bitailsmerkleproof) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TableTxLabel](#interface-tabletxlabel) |
|
|
25
|
+
| [BlockHeader](#interface-blockheader) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TableTxLabelMap](#interface-tabletxlabelmap) |
|
|
26
|
+
| [BlockHeader](#interface-blockheader) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [TableUser](#interface-tableuser) |
|
|
27
|
+
| [BsvExchangeRate](#interface-bsvexchangerate) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [TaskPurgeParams](#interface-taskpurgeparams) |
|
|
28
|
+
| [CertOpsWallet](#interface-certopswallet) | [PostTxsResult](#interface-posttxsresult) | [TrustSettings](#interface-trustsettings) |
|
|
29
|
+
| [Certifier](#interface-certifier) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [TrxToken](#interface-trxtoken) |
|
|
30
|
+
| [CommitNewTxResults](#interface-commitnewtxresults) | [Profile](#interface-profile) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
|
|
31
|
+
| [CompleteAuthResponse](#interface-completeauthresponse) | [ProvenOrRawTx](#interface-provenorrawtx) | [TxScriptOffsets](#interface-txscriptoffsets) |
|
|
32
|
+
| [CreateActionResultX](#interface-createactionresultx) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [UMPToken](#interface-umptoken) |
|
|
33
|
+
| [EntitySyncMap](#interface-entitysyncmap) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [UMPTokenInteractor](#interface-umptokeninteractor) |
|
|
34
|
+
| [EntityTimeStamp](#interface-entitytimestamp) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
|
|
35
|
+
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
|
|
36
|
+
| [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [PurgeParams](#interface-purgeparams) | [ValidAbortActionArgs](#interface-validabortactionargs) |
|
|
37
|
+
| [FiatExchangeRates](#interface-fiatexchangerates) | [PurgeResults](#interface-purgeresults) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
|
|
38
|
+
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
|
|
39
|
+
| [FindCertificatesArgs](#interface-findcertificatesargs) | [ReviewActionResult](#interface-reviewactionresult) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
|
|
40
|
+
| [FindCommissionsArgs](#interface-findcommissionsargs) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [ValidBasketInsertion](#interface-validbasketinsertion) |
|
|
41
|
+
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
|
|
42
|
+
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [SetupClientWalletArgs](#interface-setupclientwalletargs) | [ValidCreateActionInput](#interface-validcreateactioninput) |
|
|
43
|
+
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [SetupClientWalletClientArgs](#interface-setupclientwalletclientargs) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
|
|
44
|
+
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [SetupWallet](#interface-setupwallet) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
|
|
45
|
+
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [SetupWalletClient](#interface-setupwalletclient) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
|
|
46
|
+
| [FindOutputsArgs](#interface-findoutputsargs) | [SetupWalletIdb](#interface-setupwalletidb) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
|
|
47
|
+
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [SetupWalletIdbArgs](#interface-setupwalletidbargs) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
|
|
48
|
+
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [SignActionResultX](#interface-signactionresultx) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
|
|
49
|
+
| [FindProvenTxsArgs](#interface-findproventxsargs) | [StartAuthResponse](#interface-startauthresponse) | [ValidListActionsArgs](#interface-validlistactionsargs) |
|
|
50
|
+
| [FindSincePagedArgs](#interface-findsincepagedargs) | [StatusForTxidResult](#interface-statusfortxidresult) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
|
|
51
|
+
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageAdminStats](#interface-storageadminstats) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
|
|
52
|
+
| [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
|
|
53
|
+
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
|
|
54
|
+
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
|
|
55
|
+
| [FindUsersArgs](#interface-findusersargs) | [StorageFeeModel](#interface-storagefeemodel) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
|
|
56
|
+
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
|
|
57
|
+
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageIdbOptions](#interface-storageidboptions) | [ValidSignActionArgs](#interface-validsignactionargs) |
|
|
58
|
+
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageIdbSchema](#interface-storageidbschema) | [ValidSignActionOptions](#interface-validsignactionoptions) |
|
|
59
|
+
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageIdentity](#interface-storageidentity) | [ValidWalletPayment](#interface-validwalletpayment) |
|
|
60
|
+
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
|
|
61
|
+
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
|
|
62
|
+
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [WalletArgs](#interface-walletargs) |
|
|
63
|
+
| [GetMerklePathResult](#interface-getmerklepathresult) | [StorageProvenOrReq](#interface-storageprovenorreq) | [WalletBalance](#interface-walletbalance) |
|
|
64
|
+
| [GetRawTxResult](#interface-getrawtxresult) | [StorageProviderOptions](#interface-storageprovideroptions) | [WalletPermissionsManagerCallbacks](#interface-walletpermissionsmanagercallbacks) |
|
|
65
|
+
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [StorageReaderOptions](#interface-storagereaderoptions) | [WalletServices](#interface-walletservices) |
|
|
66
|
+
| [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [WalletServicesOptions](#interface-walletservicesoptions) |
|
|
67
|
+
| [GetScriptHashHistory](#interface-getscripthashhistory) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [WalletSettings](#interface-walletsettings) |
|
|
68
|
+
| [GetScriptHashHistoryResult](#interface-getscripthashhistoryresult) | [SyncChunk](#interface-syncchunk) | [WalletSettingsManagerConfig](#interface-walletsettingsmanagerconfig) |
|
|
69
|
+
| [GetStatusForTxidsResult](#interface-getstatusfortxidsresult) | [SyncError](#interface-syncerror) | [WalletSigner](#interface-walletsigner) |
|
|
70
|
+
| [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [SyncMap](#interface-syncmap) | [WalletStorage](#interface-walletstorage) |
|
|
71
|
+
| [GetUtxoStatusResult](#interface-getutxostatusresult) | [TableCertificate](#interface-tablecertificate) | [WalletStorageInfo](#interface-walletstorageinfo) |
|
|
72
|
+
| [KeyPair](#interface-keypair) | [TableCertificateField](#interface-tablecertificatefield) | [WalletStorageProvider](#interface-walletstorageprovider) |
|
|
73
|
+
| [KeyPairAddress](#interface-keypairaddress) | [TableCertificateX](#interface-tablecertificatex) | [WalletStorageReader](#interface-walletstoragereader) |
|
|
74
|
+
| [ListActionsSpecOp](#interface-listactionsspecop) | [TableCommission](#interface-tablecommission) | [WalletStorageSync](#interface-walletstoragesync) |
|
|
75
|
+
| [ListOutputsSpecOp](#interface-listoutputsspecop) | [TableMonitorEvent](#interface-tablemonitorevent) | [WalletStorageSyncReader](#interface-walletstoragesyncreader) |
|
|
76
|
+
| [LiveBlockHeader](#interface-liveblockheader) | [TableOutput](#interface-tableoutput) | [WalletStorageWriter](#interface-walletstoragewriter) |
|
|
77
|
+
| [MonitorOptions](#interface-monitoroptions) | [TableOutputBasket](#interface-tableoutputbasket) | [WalletTheme](#interface-wallettheme) |
|
|
78
|
+
| [OutPoint](#interface-outpoint) | [TableOutputTag](#interface-tableoutputtag) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
79
|
+
| [Paged](#interface-paged) | [TableOutputTagMap](#interface-tableoutputtagmap) | |
|
|
76
80
|
|
|
77
81
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
78
82
|
|
|
@@ -1370,6 +1374,85 @@ export interface KeyPair {
|
|
|
1370
1374
|
|
|
1371
1375
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1372
1376
|
|
|
1377
|
+
---
|
|
1378
|
+
##### Interface: KeyPairAddress
|
|
1379
|
+
|
|
1380
|
+
```ts
|
|
1381
|
+
export interface KeyPairAddress {
|
|
1382
|
+
privateKey: PrivateKey;
|
|
1383
|
+
publicKey: PublicKey;
|
|
1384
|
+
address: string;
|
|
1385
|
+
}
|
|
1386
|
+
```
|
|
1387
|
+
|
|
1388
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1389
|
+
|
|
1390
|
+
---
|
|
1391
|
+
##### Interface: ListActionsSpecOp
|
|
1392
|
+
|
|
1393
|
+
```ts
|
|
1394
|
+
export interface ListActionsSpecOp {
|
|
1395
|
+
name: string;
|
|
1396
|
+
labelsToIntercept?: string[];
|
|
1397
|
+
setStatusFilter?: () => sdk.TransactionStatus[];
|
|
1398
|
+
postProcess?: (s: StorageProvider, auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs, specOpLabels: string[], txs: Partial<TableTransaction>[]) => Promise<void>;
|
|
1399
|
+
}
|
|
1400
|
+
```
|
|
1401
|
+
|
|
1402
|
+
See also: [AuthId](./client.md#interface-authid), [StorageProvider](./storage.md#class-storageprovider), [TableTransaction](./storage.md#interface-tabletransaction), [TransactionStatus](./client.md#type-transactionstatus), [ValidListActionsArgs](./client.md#interface-validlistactionsargs)
|
|
1403
|
+
|
|
1404
|
+
###### Property labelsToIntercept
|
|
1405
|
+
|
|
1406
|
+
undefined to intercept no labels from vargs,
|
|
1407
|
+
empty array to intercept all labels,
|
|
1408
|
+
or an explicit array of labels to intercept.
|
|
1409
|
+
|
|
1410
|
+
```ts
|
|
1411
|
+
labelsToIntercept?: string[]
|
|
1412
|
+
```
|
|
1413
|
+
|
|
1414
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1415
|
+
|
|
1416
|
+
---
|
|
1417
|
+
##### Interface: ListOutputsSpecOp
|
|
1418
|
+
|
|
1419
|
+
```ts
|
|
1420
|
+
export interface ListOutputsSpecOp {
|
|
1421
|
+
name: string;
|
|
1422
|
+
useBasket?: string;
|
|
1423
|
+
ignoreLimit?: boolean;
|
|
1424
|
+
includeOutputScripts?: boolean;
|
|
1425
|
+
includeSpent?: boolean;
|
|
1426
|
+
resultFromTags?: (s: StorageProvider, auth: sdk.AuthId, vargs: ValidListOutputsArgs, specOpTags: string[]) => Promise<ListOutputsResult>;
|
|
1427
|
+
resultFromOutputs?: (s: StorageProvider, auth: sdk.AuthId, vargs: ValidListOutputsArgs, specOpTags: string[], outputs: TableOutput[]) => Promise<ListOutputsResult>;
|
|
1428
|
+
filterOutputs?: (s: StorageProvider, auth: sdk.AuthId, vargs: ValidListOutputsArgs, specOpTags: string[], outputs: TableOutput[]) => Promise<TableOutput[]>;
|
|
1429
|
+
tagsToIntercept?: string[];
|
|
1430
|
+
tagsParamsCount?: number;
|
|
1431
|
+
}
|
|
1432
|
+
```
|
|
1433
|
+
|
|
1434
|
+
See also: [AuthId](./client.md#interface-authid), [StorageProvider](./storage.md#class-storageprovider), [TableOutput](./storage.md#interface-tableoutput), [ValidListOutputsArgs](./client.md#interface-validlistoutputsargs)
|
|
1435
|
+
|
|
1436
|
+
###### Property tagsParamsCount
|
|
1437
|
+
|
|
1438
|
+
How many positional tags to intercept.
|
|
1439
|
+
|
|
1440
|
+
```ts
|
|
1441
|
+
tagsParamsCount?: number
|
|
1442
|
+
```
|
|
1443
|
+
|
|
1444
|
+
###### Property tagsToIntercept
|
|
1445
|
+
|
|
1446
|
+
undefined to intercept no tags from vargs,
|
|
1447
|
+
empty array to intercept all tags,
|
|
1448
|
+
or an explicit array of tags to intercept.
|
|
1449
|
+
|
|
1450
|
+
```ts
|
|
1451
|
+
tagsToIntercept?: string[]
|
|
1452
|
+
```
|
|
1453
|
+
|
|
1454
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1455
|
+
|
|
1373
1456
|
---
|
|
1374
1457
|
##### Interface: LiveBlockHeader
|
|
1375
1458
|
|
|
@@ -2517,6 +2600,254 @@ export interface ScriptTemplateUnlock {
|
|
|
2517
2600
|
|
|
2518
2601
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2519
2602
|
|
|
2603
|
+
---
|
|
2604
|
+
##### Interface: SetupClientWalletArgs
|
|
2605
|
+
|
|
2606
|
+
Arguments used by `createWallet` to construct a `SetupWallet`.
|
|
2607
|
+
|
|
2608
|
+
Extension `SetupWalletClientArgs` used by `createWalletClient` to construct a `SetupWalletClient`.
|
|
2609
|
+
|
|
2610
|
+
Extension `SetupWalletIdbArgs` used by `createWalletIdb` to construct a `SetupWalletIdb`.
|
|
2611
|
+
|
|
2612
|
+
```ts
|
|
2613
|
+
export interface SetupClientWalletArgs {
|
|
2614
|
+
chain: sdk.Chain;
|
|
2615
|
+
rootKeyHex: string;
|
|
2616
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
2617
|
+
active?: sdk.WalletStorageProvider;
|
|
2618
|
+
backups?: sdk.WalletStorageProvider[];
|
|
2619
|
+
taalApiKey?: string;
|
|
2620
|
+
}
|
|
2621
|
+
```
|
|
2622
|
+
|
|
2623
|
+
See also: [Chain](./client.md#type-chain), [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
2624
|
+
|
|
2625
|
+
###### Property active
|
|
2626
|
+
|
|
2627
|
+
Optional. Active wallet storage. Can be added later.
|
|
2628
|
+
|
|
2629
|
+
```ts
|
|
2630
|
+
active?: sdk.WalletStorageProvider
|
|
2631
|
+
```
|
|
2632
|
+
See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
2633
|
+
|
|
2634
|
+
###### Property backups
|
|
2635
|
+
|
|
2636
|
+
Optional. One or more storage providers managed as backup destinations. Can be added later.
|
|
2637
|
+
|
|
2638
|
+
```ts
|
|
2639
|
+
backups?: sdk.WalletStorageProvider[]
|
|
2640
|
+
```
|
|
2641
|
+
See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
2642
|
+
|
|
2643
|
+
###### Property privilegedKeyGetter
|
|
2644
|
+
|
|
2645
|
+
Optional. The privileged private key getter used to initialize the `PrivilegedKeyManager`.
|
|
2646
|
+
Defaults to undefined.
|
|
2647
|
+
|
|
2648
|
+
```ts
|
|
2649
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>
|
|
2650
|
+
```
|
|
2651
|
+
|
|
2652
|
+
###### Property rootKeyHex
|
|
2653
|
+
|
|
2654
|
+
The non-privileged private key used to initialize the `KeyDeriver` and determine the `identityKey`.
|
|
2655
|
+
|
|
2656
|
+
```ts
|
|
2657
|
+
rootKeyHex: string
|
|
2658
|
+
```
|
|
2659
|
+
|
|
2660
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2661
|
+
|
|
2662
|
+
---
|
|
2663
|
+
##### Interface: SetupClientWalletClientArgs
|
|
2664
|
+
|
|
2665
|
+
Extension `SetupWalletClientArgs` of `SetupWalletArgs` is used by `createWalletClient`
|
|
2666
|
+
to construct a `SetupWalletClient`.
|
|
2667
|
+
|
|
2668
|
+
```ts
|
|
2669
|
+
export interface SetupClientWalletClientArgs extends SetupClientWalletArgs {
|
|
2670
|
+
endpointUrl?: string;
|
|
2671
|
+
}
|
|
2672
|
+
```
|
|
2673
|
+
|
|
2674
|
+
See also: [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs)
|
|
2675
|
+
|
|
2676
|
+
###### Property endpointUrl
|
|
2677
|
+
|
|
2678
|
+
The endpoint URL of a service hosting the `StorageServer` JSON-RPC service to
|
|
2679
|
+
which a `StorageClient` instance should connect to function as
|
|
2680
|
+
the active storage provider of the newly created wallet.
|
|
2681
|
+
|
|
2682
|
+
```ts
|
|
2683
|
+
endpointUrl?: string
|
|
2684
|
+
```
|
|
2685
|
+
|
|
2686
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2687
|
+
|
|
2688
|
+
---
|
|
2689
|
+
##### Interface: SetupWallet
|
|
2690
|
+
|
|
2691
|
+
When creating a BRC-100 compatible `Wallet`, many components come into play.
|
|
2692
|
+
|
|
2693
|
+
All of the `createWallet` functions in the `Setup` and `SetupClient` classes return
|
|
2694
|
+
an object with direct access to each component to facilitate experimentation, testing
|
|
2695
|
+
and customization.
|
|
2696
|
+
|
|
2697
|
+
```ts
|
|
2698
|
+
export interface SetupWallet {
|
|
2699
|
+
rootKey: PrivateKey;
|
|
2700
|
+
identityKey: string;
|
|
2701
|
+
keyDeriver: KeyDeriver;
|
|
2702
|
+
chain: sdk.Chain;
|
|
2703
|
+
storage: WalletStorageManager;
|
|
2704
|
+
services: Services;
|
|
2705
|
+
monitor: Monitor;
|
|
2706
|
+
wallet: Wallet;
|
|
2707
|
+
}
|
|
2708
|
+
```
|
|
2709
|
+
|
|
2710
|
+
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)
|
|
2711
|
+
|
|
2712
|
+
###### Property chain
|
|
2713
|
+
|
|
2714
|
+
The chain ('main' or 'test') which the wallet accesses.
|
|
2715
|
+
|
|
2716
|
+
```ts
|
|
2717
|
+
chain: sdk.Chain
|
|
2718
|
+
```
|
|
2719
|
+
See also: [Chain](./client.md#type-chain)
|
|
2720
|
+
|
|
2721
|
+
###### Property identityKey
|
|
2722
|
+
|
|
2723
|
+
The pubilc key associated with the `rootKey` which also serves as the wallet's identity.
|
|
2724
|
+
|
|
2725
|
+
```ts
|
|
2726
|
+
identityKey: string
|
|
2727
|
+
```
|
|
2728
|
+
|
|
2729
|
+
###### Property keyDeriver
|
|
2730
|
+
|
|
2731
|
+
The `KeyDeriver` component used by the wallet for key derivation and cryptographic functions.
|
|
2732
|
+
|
|
2733
|
+
```ts
|
|
2734
|
+
keyDeriver: KeyDeriver
|
|
2735
|
+
```
|
|
2736
|
+
|
|
2737
|
+
###### Property monitor
|
|
2738
|
+
|
|
2739
|
+
The background task `Monitor` component available to the wallet to offload tasks
|
|
2740
|
+
that speed up wallet operations and maintain data integrity.
|
|
2741
|
+
|
|
2742
|
+
```ts
|
|
2743
|
+
monitor: Monitor
|
|
2744
|
+
```
|
|
2745
|
+
See also: [Monitor](./monitor.md#class-monitor)
|
|
2746
|
+
|
|
2747
|
+
###### Property rootKey
|
|
2748
|
+
|
|
2749
|
+
The rootKey of the `KeyDeriver`. The private key from which other keys are derived.
|
|
2750
|
+
|
|
2751
|
+
```ts
|
|
2752
|
+
rootKey: PrivateKey
|
|
2753
|
+
```
|
|
2754
|
+
|
|
2755
|
+
###### Property services
|
|
2756
|
+
|
|
2757
|
+
The network `Services` component which provides the wallet with access to external services hosted
|
|
2758
|
+
on the public network.
|
|
2759
|
+
|
|
2760
|
+
```ts
|
|
2761
|
+
services: Services
|
|
2762
|
+
```
|
|
2763
|
+
See also: [Services](./services.md#class-services)
|
|
2764
|
+
|
|
2765
|
+
###### Property storage
|
|
2766
|
+
|
|
2767
|
+
The `WalletStorageManager` that manages all the configured storage providers (active and backups)
|
|
2768
|
+
accessed by the wallet.
|
|
2769
|
+
|
|
2770
|
+
```ts
|
|
2771
|
+
storage: WalletStorageManager
|
|
2772
|
+
```
|
|
2773
|
+
See also: [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
2774
|
+
|
|
2775
|
+
###### Property wallet
|
|
2776
|
+
|
|
2777
|
+
The actual BRC-100 `Wallet` to which all the other properties and components contribute.
|
|
2778
|
+
|
|
2779
|
+
Note that internally, the wallet is itself linked to all these properties and components.
|
|
2780
|
+
They are included in this interface to facilitate access after wallet construction for
|
|
2781
|
+
experimentation, testing and customization. Any changes made to the configuration of these
|
|
2782
|
+
components after construction may disrupt the normal operation of the wallet.
|
|
2783
|
+
|
|
2784
|
+
```ts
|
|
2785
|
+
wallet: Wallet
|
|
2786
|
+
```
|
|
2787
|
+
See also: [Wallet](./client.md#class-wallet)
|
|
2788
|
+
|
|
2789
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2790
|
+
|
|
2791
|
+
---
|
|
2792
|
+
##### Interface: SetupWalletClient
|
|
2793
|
+
|
|
2794
|
+
Extension `SetupWalletClient` of `SetupWallet` is returned by `createWalletClient`
|
|
2795
|
+
|
|
2796
|
+
```ts
|
|
2797
|
+
export interface SetupWalletClient extends SetupWallet {
|
|
2798
|
+
endpointUrl: string;
|
|
2799
|
+
}
|
|
2800
|
+
```
|
|
2801
|
+
|
|
2802
|
+
See also: [SetupWallet](./setup.md#interface-setupwallet)
|
|
2803
|
+
|
|
2804
|
+
###### Property endpointUrl
|
|
2805
|
+
|
|
2806
|
+
The endpoint URL of the service hosting the `StorageServer` JSON-RPC service to
|
|
2807
|
+
which a `StorageClient` instance is connected to function as
|
|
2808
|
+
the active storage provider of the wallet.
|
|
2809
|
+
|
|
2810
|
+
```ts
|
|
2811
|
+
endpointUrl: string
|
|
2812
|
+
```
|
|
2813
|
+
|
|
2814
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2815
|
+
|
|
2816
|
+
---
|
|
2817
|
+
##### Interface: SetupWalletIdb
|
|
2818
|
+
|
|
2819
|
+
```ts
|
|
2820
|
+
export interface SetupWalletIdb extends SetupWallet {
|
|
2821
|
+
activeStorage: StorageIdb;
|
|
2822
|
+
userId: number;
|
|
2823
|
+
rootKey: PrivateKey;
|
|
2824
|
+
identityKey: string;
|
|
2825
|
+
keyDeriver: KeyDeriver;
|
|
2826
|
+
chain: sdk.Chain;
|
|
2827
|
+
storage: WalletStorageManager;
|
|
2828
|
+
services: Services;
|
|
2829
|
+
monitor: Monitor;
|
|
2830
|
+
wallet: Wallet;
|
|
2831
|
+
}
|
|
2832
|
+
```
|
|
2833
|
+
|
|
2834
|
+
See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [Services](./services.md#class-services), [SetupWallet](./setup.md#interface-setupwallet), [StorageIdb](./storage.md#class-storageidb), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
2835
|
+
|
|
2836
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2837
|
+
|
|
2838
|
+
---
|
|
2839
|
+
##### Interface: SetupWalletIdbArgs
|
|
2840
|
+
|
|
2841
|
+
```ts
|
|
2842
|
+
export interface SetupWalletIdbArgs extends SetupClientWalletArgs {
|
|
2843
|
+
databaseName: string;
|
|
2844
|
+
}
|
|
2845
|
+
```
|
|
2846
|
+
|
|
2847
|
+
See also: [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs)
|
|
2848
|
+
|
|
2849
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2850
|
+
|
|
2520
2851
|
---
|
|
2521
2852
|
##### Interface: SignActionResultX
|
|
2522
2853
|
|
|
@@ -2820,6 +3151,175 @@ trustSelf?: "known"
|
|
|
2820
3151
|
|
|
2821
3152
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2822
3153
|
|
|
3154
|
+
---
|
|
3155
|
+
##### Interface: StorageIdbOptions
|
|
3156
|
+
|
|
3157
|
+
```ts
|
|
3158
|
+
export interface StorageIdbOptions extends StorageProviderOptions {
|
|
3159
|
+
}
|
|
3160
|
+
```
|
|
3161
|
+
|
|
3162
|
+
See also: [StorageProviderOptions](./storage.md#interface-storageprovideroptions)
|
|
3163
|
+
|
|
3164
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3165
|
+
|
|
3166
|
+
---
|
|
3167
|
+
##### Interface: StorageIdbSchema
|
|
3168
|
+
|
|
3169
|
+
```ts
|
|
3170
|
+
export interface StorageIdbSchema {
|
|
3171
|
+
certificates: {
|
|
3172
|
+
key: number;
|
|
3173
|
+
value: TableCertificate;
|
|
3174
|
+
indexes: {
|
|
3175
|
+
userId: number;
|
|
3176
|
+
userId_type_certifier_serialNumber: [
|
|
3177
|
+
number,
|
|
3178
|
+
Base64String,
|
|
3179
|
+
PubKeyHex,
|
|
3180
|
+
Base64String
|
|
3181
|
+
];
|
|
3182
|
+
};
|
|
3183
|
+
};
|
|
3184
|
+
certificateFields: {
|
|
3185
|
+
key: number;
|
|
3186
|
+
value: TableCertificateField;
|
|
3187
|
+
indexes: {
|
|
3188
|
+
userId: number;
|
|
3189
|
+
certificateId: number;
|
|
3190
|
+
};
|
|
3191
|
+
};
|
|
3192
|
+
commissions: {
|
|
3193
|
+
key: number;
|
|
3194
|
+
value: TableCommission;
|
|
3195
|
+
indexes: {
|
|
3196
|
+
userId: number;
|
|
3197
|
+
transactionId: number;
|
|
3198
|
+
};
|
|
3199
|
+
};
|
|
3200
|
+
monitorEvents: {
|
|
3201
|
+
key: number;
|
|
3202
|
+
value: TableMonitorEvent;
|
|
3203
|
+
};
|
|
3204
|
+
outputs: {
|
|
3205
|
+
key: number;
|
|
3206
|
+
value: TableOutput;
|
|
3207
|
+
indexes: {
|
|
3208
|
+
userId: number;
|
|
3209
|
+
transactionId: number;
|
|
3210
|
+
basketId: number;
|
|
3211
|
+
spentBy: string;
|
|
3212
|
+
transactionId_vout_userId: [
|
|
3213
|
+
number,
|
|
3214
|
+
number,
|
|
3215
|
+
number
|
|
3216
|
+
];
|
|
3217
|
+
};
|
|
3218
|
+
};
|
|
3219
|
+
outputBaskets: {
|
|
3220
|
+
key: number;
|
|
3221
|
+
value: TableOutputBasket;
|
|
3222
|
+
indexes: {
|
|
3223
|
+
userId: number;
|
|
3224
|
+
name_userId: [
|
|
3225
|
+
string,
|
|
3226
|
+
number
|
|
3227
|
+
];
|
|
3228
|
+
};
|
|
3229
|
+
};
|
|
3230
|
+
outputTags: {
|
|
3231
|
+
key: number;
|
|
3232
|
+
value: TableOutputTag;
|
|
3233
|
+
indexes: {
|
|
3234
|
+
userId: number;
|
|
3235
|
+
tag_userId: [
|
|
3236
|
+
string,
|
|
3237
|
+
number
|
|
3238
|
+
];
|
|
3239
|
+
};
|
|
3240
|
+
};
|
|
3241
|
+
outputTagMaps: {
|
|
3242
|
+
key: number;
|
|
3243
|
+
value: TableOutputTagMap;
|
|
3244
|
+
indexes: {
|
|
3245
|
+
outputTagId: number;
|
|
3246
|
+
outputId: number;
|
|
3247
|
+
};
|
|
3248
|
+
};
|
|
3249
|
+
provenTxs: {
|
|
3250
|
+
key: number;
|
|
3251
|
+
value: TableProvenTx;
|
|
3252
|
+
indexes: {
|
|
3253
|
+
txid: HexString;
|
|
3254
|
+
};
|
|
3255
|
+
};
|
|
3256
|
+
provenTxReqs: {
|
|
3257
|
+
key: number;
|
|
3258
|
+
value: TableProvenTxReq;
|
|
3259
|
+
indexes: {
|
|
3260
|
+
provenTxId: number;
|
|
3261
|
+
txid: HexString;
|
|
3262
|
+
status: ProvenTxReqStatus;
|
|
3263
|
+
batch: string;
|
|
3264
|
+
};
|
|
3265
|
+
};
|
|
3266
|
+
syncStates: {
|
|
3267
|
+
key: number;
|
|
3268
|
+
value: TableSyncState;
|
|
3269
|
+
indexes: {
|
|
3270
|
+
userId: number;
|
|
3271
|
+
refNum: string;
|
|
3272
|
+
status: SyncStatus;
|
|
3273
|
+
};
|
|
3274
|
+
};
|
|
3275
|
+
settings: {
|
|
3276
|
+
key: number;
|
|
3277
|
+
value: TableSettings;
|
|
3278
|
+
indexes: Record<string, never>;
|
|
3279
|
+
};
|
|
3280
|
+
transactions: {
|
|
3281
|
+
key: number;
|
|
3282
|
+
value: TableTransaction;
|
|
3283
|
+
indexes: {
|
|
3284
|
+
userId: number;
|
|
3285
|
+
provenTxId: number;
|
|
3286
|
+
reference: string;
|
|
3287
|
+
status: TransactionStatus;
|
|
3288
|
+
};
|
|
3289
|
+
};
|
|
3290
|
+
txLabels: {
|
|
3291
|
+
key: number;
|
|
3292
|
+
value: TableTxLabel;
|
|
3293
|
+
indexes: {
|
|
3294
|
+
userId: number;
|
|
3295
|
+
label_userId: [
|
|
3296
|
+
string,
|
|
3297
|
+
number
|
|
3298
|
+
];
|
|
3299
|
+
};
|
|
3300
|
+
};
|
|
3301
|
+
txLabelMaps: {
|
|
3302
|
+
key: number;
|
|
3303
|
+
value: TableTxLabelMap;
|
|
3304
|
+
indexes: {
|
|
3305
|
+
transactionId: number;
|
|
3306
|
+
txLabelId: number;
|
|
3307
|
+
};
|
|
3308
|
+
};
|
|
3309
|
+
users: {
|
|
3310
|
+
key: number;
|
|
3311
|
+
value: TableUser;
|
|
3312
|
+
indexes: {
|
|
3313
|
+
identityKey: string;
|
|
3314
|
+
};
|
|
3315
|
+
};
|
|
3316
|
+
}
|
|
3317
|
+
```
|
|
3318
|
+
|
|
3319
|
+
See also: [ProvenTxReqStatus](./client.md#type-proventxreqstatus), [SyncStatus](./client.md#type-syncstatus), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [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), [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)
|
|
3320
|
+
|
|
3321
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3322
|
+
|
|
2823
3323
|
---
|
|
2824
3324
|
##### Interface: StorageIdentity
|
|
2825
3325
|
|
|
@@ -4822,10 +5322,11 @@ export interface WalletStorage {
|
|
|
4822
5322
|
insertCertificate(certificate: TableCertificateX): Promise<number>;
|
|
4823
5323
|
relinquishCertificate(args: RelinquishCertificateArgs): Promise<number>;
|
|
4824
5324
|
relinquishOutput(args: RelinquishOutputArgs): Promise<number>;
|
|
5325
|
+
getStores(): WalletStorageInfo[];
|
|
4825
5326
|
}
|
|
4826
5327
|
```
|
|
4827
5328
|
|
|
4828
|
-
See also: [AuthId](./client.md#interface-authid), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableUser](./storage.md#interface-tableuser), [ValidCreateActionArgs](./client.md#interface-validcreateactionargs), [ValidListCertificatesArgs](./client.md#interface-validlistcertificatesargs), [WalletServices](./client.md#interface-walletservices), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction)
|
|
5329
|
+
See also: [AuthId](./client.md#interface-authid), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableUser](./storage.md#interface-tableuser), [ValidCreateActionArgs](./client.md#interface-validcreateactionargs), [ValidListCertificatesArgs](./client.md#interface-validlistcertificatesargs), [WalletServices](./client.md#interface-walletservices), [WalletStorageInfo](./client.md#interface-walletstorageinfo), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction)
|
|
4829
5330
|
|
|
4830
5331
|
###### Method isStorageProvider
|
|
4831
5332
|
|
|
@@ -4839,6 +5340,27 @@ false
|
|
|
4839
5340
|
|
|
4840
5341
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4841
5342
|
|
|
5343
|
+
---
|
|
5344
|
+
##### Interface: WalletStorageInfo
|
|
5345
|
+
|
|
5346
|
+
Snapshot of the current state of a storage provider configured for an `WalletStorageManager`.
|
|
5347
|
+
|
|
5348
|
+
```ts
|
|
5349
|
+
export interface WalletStorageInfo {
|
|
5350
|
+
isActive: boolean;
|
|
5351
|
+
isEnabled: boolean;
|
|
5352
|
+
isBackup: boolean;
|
|
5353
|
+
isConflicting: boolean;
|
|
5354
|
+
userId: number;
|
|
5355
|
+
storageIdentityKey: string;
|
|
5356
|
+
storageName: string;
|
|
5357
|
+
storageClass: string;
|
|
5358
|
+
endpointURL?: string;
|
|
5359
|
+
}
|
|
5360
|
+
```
|
|
5361
|
+
|
|
5362
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5363
|
+
|
|
4842
5364
|
---
|
|
4843
5365
|
##### Interface: WalletStorageProvider
|
|
4844
5366
|
|
|
@@ -4991,29 +5513,30 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4991
5513
|
|
|
4992
5514
|
| | | |
|
|
4993
5515
|
| --- | --- | --- |
|
|
4994
|
-
| [ARC](#class-arc) | [
|
|
4995
|
-
| [AuthMethodInteractor](#class-authmethodinteractor) | [
|
|
4996
|
-
| [Bitails](#class-bitails) | [
|
|
4997
|
-
| [CWIStyleWalletManager](#class-cwistylewalletmanager) | [
|
|
4998
|
-
| [EntityBase](#class-entitybase) | [
|
|
5516
|
+
| [ARC](#class-arc) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [WERR_BAD_REQUEST](#class-werr_bad_request) |
|
|
5517
|
+
| [AuthMethodInteractor](#class-authmethodinteractor) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [WERR_BROADCAST_UNAVAILABLE](#class-werr_broadcast_unavailable) |
|
|
5518
|
+
| [Bitails](#class-bitails) | [ServiceCollection](#class-servicecollection) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) |
|
|
5519
|
+
| [CWIStyleWalletManager](#class-cwistylewalletmanager) | [Services](#class-services) | [WERR_INTERNAL](#class-werr_internal) |
|
|
5520
|
+
| [EntityBase](#class-entitybase) | [SetupClient](#class-setupclient) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) |
|
|
4999
5521
|
| [EntityCertificate](#class-entitycertificate) | [SimpleWalletManager](#class-simplewalletmanager) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
|
|
5000
5522
|
| [EntityCertificateField](#class-entitycertificatefield) | [StorageClient](#class-storageclient) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
|
|
5001
|
-
| [EntityCommission](#class-entitycommission) | [
|
|
5002
|
-
| [EntityOutput](#class-entityoutput) | [
|
|
5003
|
-
| [EntityOutputBasket](#class-entityoutputbasket) | [
|
|
5004
|
-
| [EntityOutputTag](#class-entityoutputtag) | [
|
|
5005
|
-
| [EntityOutputTagMap](#class-entityoutputtagmap) | [
|
|
5006
|
-
| [EntityProvenTx](#class-entityproventx) | [
|
|
5007
|
-
| [EntityProvenTxReq](#class-entityproventxreq) | [
|
|
5008
|
-
| [EntitySyncState](#class-entitysyncstate) | [
|
|
5009
|
-
| [EntityTransaction](#class-entitytransaction) | [
|
|
5010
|
-
| [EntityTxLabel](#class-entitytxlabel) | [
|
|
5011
|
-
| [EntityTxLabelMap](#class-entitytxlabelmap) | [
|
|
5012
|
-
| [EntityUser](#class-entityuser) | [
|
|
5013
|
-
| [MergeEntity](#class-mergeentity) | [
|
|
5014
|
-
| [Monitor](#class-monitor) | [
|
|
5015
|
-
| [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [
|
|
5016
|
-
| [PersonaIDInteractor](#class-personaidinteractor) | [
|
|
5523
|
+
| [EntityCommission](#class-entitycommission) | [StorageIdb](#class-storageidb) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
|
|
5524
|
+
| [EntityOutput](#class-entityoutput) | [StorageProvider](#class-storageprovider) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
|
|
5525
|
+
| [EntityOutputBasket](#class-entityoutputbasket) | [StorageReader](#class-storagereader) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
|
|
5526
|
+
| [EntityOutputTag](#class-entityoutputtag) | [StorageReaderWriter](#class-storagereaderwriter) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
|
|
5527
|
+
| [EntityOutputTagMap](#class-entityoutputtagmap) | [StorageSyncReader](#class-storagesyncreader) | [WERR_REVIEW_ACTIONS](#class-werr_review_actions) |
|
|
5528
|
+
| [EntityProvenTx](#class-entityproventx) | [TaskCheckForProofs](#class-taskcheckforproofs) | [WERR_UNAUTHORIZED](#class-werr_unauthorized) |
|
|
5529
|
+
| [EntityProvenTxReq](#class-entityproventxreq) | [TaskCheckNoSends](#class-taskchecknosends) | [Wallet](#class-wallet) |
|
|
5530
|
+
| [EntitySyncState](#class-entitysyncstate) | [TaskClock](#class-taskclock) | [WalletAuthenticationManager](#class-walletauthenticationmanager) |
|
|
5531
|
+
| [EntityTransaction](#class-entitytransaction) | [TaskFailAbandoned](#class-taskfailabandoned) | [WalletError](#class-walleterror) |
|
|
5532
|
+
| [EntityTxLabel](#class-entitytxlabel) | [TaskNewHeader](#class-tasknewheader) | [WalletMonitorTask](#class-walletmonitortask) |
|
|
5533
|
+
| [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskPurge](#class-taskpurge) | [WalletPermissionsManager](#class-walletpermissionsmanager) |
|
|
5534
|
+
| [EntityUser](#class-entityuser) | [TaskReviewStatus](#class-taskreviewstatus) | [WalletSettingsManager](#class-walletsettingsmanager) |
|
|
5535
|
+
| [MergeEntity](#class-mergeentity) | [TaskSendWaiting](#class-tasksendwaiting) | [WalletSigner](#class-walletsigner) |
|
|
5536
|
+
| [Monitor](#class-monitor) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) | [WalletStorageManager](#class-walletstoragemanager) |
|
|
5537
|
+
| [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [TaskUnFail](#class-taskunfail) | [WhatsOnChain](#class-whatsonchain) |
|
|
5538
|
+
| [PersonaIDInteractor](#class-personaidinteractor) | [TwilioPhoneInteractor](#class-twiliophoneinteractor) | |
|
|
5539
|
+
| [PrivilegedKeyManager](#class-privilegedkeymanager) | [WABClient](#class-wabclient) | |
|
|
5017
5540
|
|
|
5018
5541
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5019
5542
|
|
|
@@ -6932,6 +7455,272 @@ Argument Details
|
|
|
6932
7455
|
|
|
6933
7456
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6934
7457
|
|
|
7458
|
+
---
|
|
7459
|
+
##### Class: SetupClient
|
|
7460
|
+
|
|
7461
|
+
The 'Setup` class provides static setup functions to construct BRC-100 compatible
|
|
7462
|
+
wallets in a variety of configurations.
|
|
7463
|
+
|
|
7464
|
+
It serves as a starting point for experimentation and customization.
|
|
7465
|
+
|
|
7466
|
+
```ts
|
|
7467
|
+
export abstract class SetupClient {
|
|
7468
|
+
static async createWallet(args: SetupClientWalletArgs): Promise<SetupWallet> {
|
|
7469
|
+
const chain = args.chain;
|
|
7470
|
+
const rootKey = PrivateKey.fromHex(args.rootKeyHex);
|
|
7471
|
+
const identityKey = rootKey.toPublicKey().toString();
|
|
7472
|
+
const keyDeriver = new KeyDeriver(rootKey);
|
|
7473
|
+
const storage = new WalletStorageManager(identityKey, args.active, args.backups);
|
|
7474
|
+
if (storage.canMakeAvailable())
|
|
7475
|
+
await storage.makeAvailable();
|
|
7476
|
+
const serviceOptions = Services.createDefaultOptions(chain);
|
|
7477
|
+
serviceOptions.taalApiKey = args.taalApiKey;
|
|
7478
|
+
const services = new Services(serviceOptions);
|
|
7479
|
+
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
|
|
7480
|
+
const monitor = new Monitor(monopts);
|
|
7481
|
+
monitor.addDefaultTasks();
|
|
7482
|
+
const privilegedKeyManager = args.privilegedKeyGetter
|
|
7483
|
+
? new sdk.PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
7484
|
+
: undefined;
|
|
7485
|
+
const wallet = new Wallet({
|
|
7486
|
+
chain,
|
|
7487
|
+
keyDeriver,
|
|
7488
|
+
storage,
|
|
7489
|
+
services,
|
|
7490
|
+
monitor,
|
|
7491
|
+
privilegedKeyManager
|
|
7492
|
+
});
|
|
7493
|
+
const r: SetupWallet = {
|
|
7494
|
+
rootKey,
|
|
7495
|
+
identityKey,
|
|
7496
|
+
keyDeriver,
|
|
7497
|
+
chain,
|
|
7498
|
+
storage,
|
|
7499
|
+
services,
|
|
7500
|
+
monitor,
|
|
7501
|
+
wallet
|
|
7502
|
+
};
|
|
7503
|
+
return r;
|
|
7504
|
+
}
|
|
7505
|
+
static async createWalletClientNoEnv(args: {
|
|
7506
|
+
chain: sdk.Chain;
|
|
7507
|
+
rootKeyHex: string;
|
|
7508
|
+
storageUrl?: string;
|
|
7509
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
7510
|
+
}): Promise<Wallet>
|
|
7511
|
+
static async createWalletClient(args: SetupClientWalletClientArgs): Promise<SetupWalletClient> {
|
|
7512
|
+
const wo = await SetupClient.createWallet(args);
|
|
7513
|
+
const endpointUrl = args.endpointUrl || `https://${args.chain !== "main" ? "staging-" : ""}storage.babbage.systems`;
|
|
7514
|
+
const client = new StorageClient(wo.wallet, endpointUrl);
|
|
7515
|
+
await wo.storage.addWalletStorageProvider(client);
|
|
7516
|
+
await wo.storage.makeAvailable();
|
|
7517
|
+
return {
|
|
7518
|
+
...wo,
|
|
7519
|
+
endpointUrl
|
|
7520
|
+
};
|
|
7521
|
+
}
|
|
7522
|
+
static getKeyPair(priv?: string | PrivateKey): KeyPairAddress {
|
|
7523
|
+
if (priv === undefined)
|
|
7524
|
+
priv = PrivateKey.fromRandom();
|
|
7525
|
+
else if (typeof priv === "string")
|
|
7526
|
+
priv = new PrivateKey(priv, "hex");
|
|
7527
|
+
const pub = PublicKey.fromPrivateKey(priv);
|
|
7528
|
+
const address = pub.toAddress();
|
|
7529
|
+
return { privateKey: priv, publicKey: pub, address };
|
|
7530
|
+
}
|
|
7531
|
+
static getLockP2PKH(address: string): LockingScript {
|
|
7532
|
+
const p2pkh = new P2PKH();
|
|
7533
|
+
const lock = p2pkh.lock(address);
|
|
7534
|
+
return lock;
|
|
7535
|
+
}
|
|
7536
|
+
static getUnlockP2PKH(priv: PrivateKey, satoshis: number): sdk.ScriptTemplateUnlock {
|
|
7537
|
+
const p2pkh = new P2PKH();
|
|
7538
|
+
const lock = SetupClient.getLockP2PKH(SetupClient.getKeyPair(priv).address);
|
|
7539
|
+
const unlock = p2pkh.unlock(priv, "all", false, satoshis, lock);
|
|
7540
|
+
return unlock;
|
|
7541
|
+
}
|
|
7542
|
+
static createP2PKHOutputs(outputs: {
|
|
7543
|
+
address: string;
|
|
7544
|
+
satoshis: number;
|
|
7545
|
+
outputDescription?: string;
|
|
7546
|
+
basket?: string;
|
|
7547
|
+
tags?: string[];
|
|
7548
|
+
}[]): CreateActionOutput[] {
|
|
7549
|
+
const os: CreateActionOutput[] = [];
|
|
7550
|
+
const count = outputs.length;
|
|
7551
|
+
for (let i = 0; i < count; i++) {
|
|
7552
|
+
const o = outputs[i];
|
|
7553
|
+
os.push({
|
|
7554
|
+
basket: o.basket,
|
|
7555
|
+
tags: o.tags,
|
|
7556
|
+
satoshis: o.satoshis,
|
|
7557
|
+
lockingScript: SetupClient.getLockP2PKH(o.address).toHex(),
|
|
7558
|
+
outputDescription: o.outputDescription || `p2pkh ${i}`
|
|
7559
|
+
});
|
|
7560
|
+
}
|
|
7561
|
+
return os;
|
|
7562
|
+
}
|
|
7563
|
+
static async createP2PKHOutputsAction(wallet: WalletInterface, outputs: {
|
|
7564
|
+
address: string;
|
|
7565
|
+
satoshis: number;
|
|
7566
|
+
outputDescription?: string;
|
|
7567
|
+
basket?: string;
|
|
7568
|
+
tags?: string[];
|
|
7569
|
+
}[], options?: CreateActionOptions): Promise<{
|
|
7570
|
+
cr: CreateActionResult;
|
|
7571
|
+
outpoints: string[] | undefined;
|
|
7572
|
+
}> {
|
|
7573
|
+
const os = SetupClient.createP2PKHOutputs(outputs);
|
|
7574
|
+
const createArgs: CreateActionArgs = {
|
|
7575
|
+
description: `createP2PKHOutputs`,
|
|
7576
|
+
outputs: os,
|
|
7577
|
+
options: {
|
|
7578
|
+
...options,
|
|
7579
|
+
randomizeOutputs: false
|
|
7580
|
+
}
|
|
7581
|
+
};
|
|
7582
|
+
const cr = await wallet.createAction(createArgs);
|
|
7583
|
+
let outpoints: string[] | undefined;
|
|
7584
|
+
if (cr.txid) {
|
|
7585
|
+
outpoints = os.map((o, i) => `${cr.txid}.${i}`);
|
|
7586
|
+
}
|
|
7587
|
+
return { cr, outpoints };
|
|
7588
|
+
}
|
|
7589
|
+
static async fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, inputBEEF?: BEEF) {
|
|
7590
|
+
}
|
|
7591
|
+
static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb> {
|
|
7592
|
+
const wo = await SetupClient.createWallet(args);
|
|
7593
|
+
const activeStorage = await SetupClient.createStorageIdb(args);
|
|
7594
|
+
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
7595
|
+
const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
7596
|
+
const userId = user.userId;
|
|
7597
|
+
const r: SetupWalletIdb = {
|
|
7598
|
+
...wo,
|
|
7599
|
+
activeStorage,
|
|
7600
|
+
userId
|
|
7601
|
+
};
|
|
7602
|
+
return r;
|
|
7603
|
+
}
|
|
7604
|
+
static async createStorageIdb(args: SetupWalletIdbArgs): Promise<StorageIdb>
|
|
7605
|
+
}
|
|
7606
|
+
```
|
|
7607
|
+
|
|
7608
|
+
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), [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs), [SetupClientWalletClientArgs](./setup.md#interface-setupclientwalletclientargs), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletClient](./setup.md#interface-setupwalletclient), [SetupWalletIdb](./setup.md#interface-setupwalletidb), [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs), [StorageClient](./storage.md#class-storageclient), [StorageIdb](./storage.md#class-storageidb), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager), [createAction](./storage.md#function-createaction)
|
|
7609
|
+
|
|
7610
|
+
###### Method createStorageIdb
|
|
7611
|
+
|
|
7612
|
+
```ts
|
|
7613
|
+
static async createStorageIdb(args: SetupWalletIdbArgs): Promise<StorageIdb>
|
|
7614
|
+
```
|
|
7615
|
+
See also: [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs), [StorageIdb](./storage.md#class-storageidb)
|
|
7616
|
+
|
|
7617
|
+
Returns
|
|
7618
|
+
|
|
7619
|
+
- `Knex` based storage provider for a wallet. May be used for either active storage or backup storage.
|
|
7620
|
+
|
|
7621
|
+
###### Method createWallet
|
|
7622
|
+
|
|
7623
|
+
Create a `Wallet`. Storage can optionally be provided or configured later.
|
|
7624
|
+
|
|
7625
|
+
The following components are configured: KeyDeriver, WalletStorageManager, WalletService, WalletStorage.
|
|
7626
|
+
Optionally, PrivilegedKeyManager is also configured.
|
|
7627
|
+
|
|
7628
|
+
```ts
|
|
7629
|
+
static async createWallet(args: SetupClientWalletArgs): Promise<SetupWallet> {
|
|
7630
|
+
const chain = args.chain;
|
|
7631
|
+
const rootKey = PrivateKey.fromHex(args.rootKeyHex);
|
|
7632
|
+
const identityKey = rootKey.toPublicKey().toString();
|
|
7633
|
+
const keyDeriver = new KeyDeriver(rootKey);
|
|
7634
|
+
const storage = new WalletStorageManager(identityKey, args.active, args.backups);
|
|
7635
|
+
if (storage.canMakeAvailable())
|
|
7636
|
+
await storage.makeAvailable();
|
|
7637
|
+
const serviceOptions = Services.createDefaultOptions(chain);
|
|
7638
|
+
serviceOptions.taalApiKey = args.taalApiKey;
|
|
7639
|
+
const services = new Services(serviceOptions);
|
|
7640
|
+
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
|
|
7641
|
+
const monitor = new Monitor(monopts);
|
|
7642
|
+
monitor.addDefaultTasks();
|
|
7643
|
+
const privilegedKeyManager = args.privilegedKeyGetter
|
|
7644
|
+
? new sdk.PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
7645
|
+
: undefined;
|
|
7646
|
+
const wallet = new Wallet({
|
|
7647
|
+
chain,
|
|
7648
|
+
keyDeriver,
|
|
7649
|
+
storage,
|
|
7650
|
+
services,
|
|
7651
|
+
monitor,
|
|
7652
|
+
privilegedKeyManager
|
|
7653
|
+
});
|
|
7654
|
+
const r: SetupWallet = {
|
|
7655
|
+
rootKey,
|
|
7656
|
+
identityKey,
|
|
7657
|
+
keyDeriver,
|
|
7658
|
+
chain,
|
|
7659
|
+
storage,
|
|
7660
|
+
services,
|
|
7661
|
+
monitor,
|
|
7662
|
+
wallet
|
|
7663
|
+
};
|
|
7664
|
+
return r;
|
|
7665
|
+
}
|
|
7666
|
+
```
|
|
7667
|
+
See also: [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [Services](./services.md#class-services), [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs), [SetupWallet](./setup.md#interface-setupwallet), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
7668
|
+
|
|
7669
|
+
###### Method createWalletClientNoEnv
|
|
7670
|
+
|
|
7671
|
+
Setup a new `Wallet` without requiring a .env file.
|
|
7672
|
+
|
|
7673
|
+
```ts
|
|
7674
|
+
static async createWalletClientNoEnv(args: {
|
|
7675
|
+
chain: sdk.Chain;
|
|
7676
|
+
rootKeyHex: string;
|
|
7677
|
+
storageUrl?: string;
|
|
7678
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
7679
|
+
}): Promise<Wallet>
|
|
7680
|
+
```
|
|
7681
|
+
See also: [Chain](./client.md#type-chain), [Wallet](./client.md#class-wallet)
|
|
7682
|
+
|
|
7683
|
+
Argument Details
|
|
7684
|
+
|
|
7685
|
+
+ **args.chain**
|
|
7686
|
+
+ 'main' or 'test'
|
|
7687
|
+
+ **args.rootKeyHex**
|
|
7688
|
+
+ Root private key for wallet's key deriver.
|
|
7689
|
+
+ **args.storageUrl**
|
|
7690
|
+
+ Optional. `StorageClient` and `chain` compatible endpoint URL.
|
|
7691
|
+
+ **args.privilegedKeyGetter**
|
|
7692
|
+
+ Optional. Method that will return the privileged `PrivateKey`, on demand.
|
|
7693
|
+
|
|
7694
|
+
###### Method createWalletIdb
|
|
7695
|
+
|
|
7696
|
+
Adds `indexedDB` based storage to a `Wallet` configured by `SetupClient.createWalletOnly`
|
|
7697
|
+
|
|
7698
|
+
```ts
|
|
7699
|
+
static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb> {
|
|
7700
|
+
const wo = await SetupClient.createWallet(args);
|
|
7701
|
+
const activeStorage = await SetupClient.createStorageIdb(args);
|
|
7702
|
+
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
7703
|
+
const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
7704
|
+
const userId = user.userId;
|
|
7705
|
+
const r: SetupWalletIdb = {
|
|
7706
|
+
...wo,
|
|
7707
|
+
activeStorage,
|
|
7708
|
+
userId
|
|
7709
|
+
};
|
|
7710
|
+
return r;
|
|
7711
|
+
}
|
|
7712
|
+
```
|
|
7713
|
+
See also: [SetupClient](./setup.md#class-setupclient), [SetupWalletIdb](./setup.md#interface-setupwalletidb), [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs)
|
|
7714
|
+
|
|
7715
|
+
Argument Details
|
|
7716
|
+
|
|
7717
|
+
+ **args.databaseName**
|
|
7718
|
+
+ Name for this storage. For MySQL, the schema name within the MySQL instance.
|
|
7719
|
+
+ **args.chain**
|
|
7720
|
+
+ Which chain this wallet is on: 'main' or 'test'. Defaults to 'test'.
|
|
7721
|
+
|
|
7722
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7723
|
+
|
|
6935
7724
|
---
|
|
6936
7725
|
##### Class: SimpleWalletManager
|
|
6937
7726
|
|
|
@@ -7172,6 +7961,7 @@ For details of the API implemented, follow the "See also" link for the `WalletSt
|
|
|
7172
7961
|
|
|
7173
7962
|
```ts
|
|
7174
7963
|
export class StorageClient implements sdk.WalletStorageProvider {
|
|
7964
|
+
readonly endpointUrl: string;
|
|
7175
7965
|
public settings?: TableSettings;
|
|
7176
7966
|
constructor(wallet: WalletInterface, endpointUrl: string)
|
|
7177
7967
|
isStorageProvider(): boolean
|
|
@@ -7780,6 +8570,268 @@ See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
|
7780
8570
|
|
|
7781
8571
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7782
8572
|
|
|
8573
|
+
---
|
|
8574
|
+
##### Class: StorageIdb
|
|
8575
|
+
|
|
8576
|
+
This class implements the `StorageProvider` interface using IndexedDB,
|
|
8577
|
+
via the promises wrapper package `idb`.
|
|
8578
|
+
|
|
8579
|
+
```ts
|
|
8580
|
+
export class StorageIdb extends StorageProvider implements sdk.WalletStorageProvider {
|
|
8581
|
+
dbName: string;
|
|
8582
|
+
db?: IDBPDatabase<StorageIdbSchema>;
|
|
8583
|
+
constructor(options: StorageIdbOptions)
|
|
8584
|
+
async migrate(storageName: string, storageIdentityKey: string): Promise<string>
|
|
8585
|
+
async verifyDB(storageName?: string, storageIdentityKey?: string): Promise<IDBPDatabase<StorageIdbSchema>>
|
|
8586
|
+
toDbTrx(stores: string[], mode: "readonly" | "readwrite", trx?: sdk.TrxToken): IDBPTransaction<StorageIdbSchema, string[], "readwrite" | "readonly">
|
|
8587
|
+
async readSettings(trx?: sdk.TrxToken): Promise<TableSettings>
|
|
8588
|
+
async initDB(storageName?: string, storageIdentityKey?: string): Promise<IDBPDatabase<StorageIdbSchema>>
|
|
8589
|
+
async reviewStatus(args: {
|
|
8590
|
+
agedLimit: Date;
|
|
8591
|
+
trx?: sdk.TrxToken;
|
|
8592
|
+
}): Promise<{
|
|
8593
|
+
log: string;
|
|
8594
|
+
}>
|
|
8595
|
+
async purgeData(params: sdk.PurgeParams, trx?: sdk.TrxToken): Promise<sdk.PurgeResults>
|
|
8596
|
+
async allocateChangeInput(userId: number, basketId: number, targetSatoshis: number, exactSatoshis: number | undefined, excludeSending: boolean, transactionId: number): Promise<TableOutput | undefined>
|
|
8597
|
+
async getProvenOrRawTx(txid: string, trx?: sdk.TrxToken): Promise<sdk.ProvenOrRawTx>
|
|
8598
|
+
async getRawTxOfKnownValidTransaction(txid?: string, offset?: number, length?: number, trx?: sdk.TrxToken): Promise<number[] | undefined>
|
|
8599
|
+
async getLabelsForTransactionId(transactionId?: number, trx?: sdk.TrxToken): Promise<TableTxLabel[]>
|
|
8600
|
+
async getTagsForOutputId(outputId: number, trx?: sdk.TrxToken): Promise<TableOutputTag[]>
|
|
8601
|
+
async listActions(auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs): Promise<ListActionsResult>
|
|
8602
|
+
async listOutputs(auth: sdk.AuthId, vargs: sdk.ValidListOutputsArgs): Promise<ListOutputsResult>
|
|
8603
|
+
async countChangeInputs(userId: number, basketId: number, excludeSending: boolean): Promise<number>
|
|
8604
|
+
async findCertificatesAuth(auth: sdk.AuthId, args: sdk.FindCertificatesArgs): Promise<TableCertificateX[]>
|
|
8605
|
+
async findOutputBasketsAuth(auth: sdk.AuthId, args: sdk.FindOutputBasketsArgs): Promise<TableOutputBasket[]>
|
|
8606
|
+
async findOutputsAuth(auth: sdk.AuthId, args: sdk.FindOutputsArgs): Promise<TableOutput[]>
|
|
8607
|
+
async insertCertificateAuth(auth: sdk.AuthId, certificate: TableCertificateX): Promise<number>
|
|
8608
|
+
async dropAllData(): Promise<void>
|
|
8609
|
+
async filterOutputTagMaps(args: sdk.FindOutputTagMapsArgs, filtered: (v: TableOutputTagMap) => void, userId?: number): Promise<void>
|
|
8610
|
+
async findOutputTagMaps(args: sdk.FindOutputTagMapsArgs): Promise<TableOutputTagMap[]>
|
|
8611
|
+
async filterProvenTxReqs(args: sdk.FindProvenTxReqsArgs, filtered: (v: TableProvenTxReq) => void, userId?: number): Promise<void>
|
|
8612
|
+
async findProvenTxReqs(args: sdk.FindProvenTxReqsArgs): Promise<TableProvenTxReq[]>
|
|
8613
|
+
async filterProvenTxs(args: sdk.FindProvenTxsArgs, filtered: (v: TableProvenTx) => void, userId?: number): Promise<void>
|
|
8614
|
+
async findProvenTxs(args: sdk.FindProvenTxsArgs): Promise<TableProvenTx[]>
|
|
8615
|
+
async filterTxLabelMaps(args: sdk.FindTxLabelMapsArgs, filtered: (v: TableTxLabelMap) => void, userId?: number): Promise<void>
|
|
8616
|
+
async findTxLabelMaps(args: sdk.FindTxLabelMapsArgs): Promise<TableTxLabelMap[]>
|
|
8617
|
+
async countOutputTagMaps(args: sdk.FindOutputTagMapsArgs): Promise<number>
|
|
8618
|
+
async countProvenTxReqs(args: sdk.FindProvenTxReqsArgs): Promise<number>
|
|
8619
|
+
async countProvenTxs(args: sdk.FindProvenTxsArgs): Promise<number>
|
|
8620
|
+
async countTxLabelMaps(args: sdk.FindTxLabelMapsArgs): Promise<number>
|
|
8621
|
+
async insertCertificate(certificate: TableCertificateX, trx?: sdk.TrxToken): Promise<number>
|
|
8622
|
+
async insertCertificateField(certificateField: TableCertificateField, trx?: sdk.TrxToken): Promise<void>
|
|
8623
|
+
async insertCommission(commission: TableCommission, trx?: sdk.TrxToken): Promise<number>
|
|
8624
|
+
async insertMonitorEvent(event: TableMonitorEvent, trx?: sdk.TrxToken): Promise<number>
|
|
8625
|
+
async insertOutput(output: TableOutput, trx?: sdk.TrxToken): Promise<number>
|
|
8626
|
+
async insertOutputBasket(basket: TableOutputBasket, trx?: sdk.TrxToken): Promise<number>
|
|
8627
|
+
async insertOutputTag(tag: TableOutputTag, trx?: sdk.TrxToken): Promise<number>
|
|
8628
|
+
async insertOutputTagMap(tagMap: TableOutputTagMap, trx?: sdk.TrxToken): Promise<void>
|
|
8629
|
+
async insertProvenTx(tx: TableProvenTx, trx?: sdk.TrxToken): Promise<number>
|
|
8630
|
+
async insertProvenTxReq(tx: TableProvenTxReq, trx?: sdk.TrxToken): Promise<number>
|
|
8631
|
+
async insertSyncState(syncState: TableSyncState, trx?: sdk.TrxToken): Promise<number>
|
|
8632
|
+
async insertTransaction(tx: TableTransaction, trx?: sdk.TrxToken): Promise<number>
|
|
8633
|
+
async insertTxLabel(label: TableTxLabel, trx?: sdk.TrxToken): Promise<number>
|
|
8634
|
+
async insertTxLabelMap(labelMap: TableTxLabelMap, trx?: sdk.TrxToken): Promise<void>
|
|
8635
|
+
async insertUser(user: TableUser, trx?: sdk.TrxToken): Promise<number>
|
|
8636
|
+
async updateIdb<T>(id: number | number[], update: Partial<T>, keyProp: string, storeName: string, trx?: sdk.TrxToken): Promise<number>
|
|
8637
|
+
async updateIdbKey<T>(key: (number | string)[], update: Partial<T>, keyProps: string[], storeName: string, trx?: sdk.TrxToken): Promise<number>
|
|
8638
|
+
async updateCertificate(id: number, update: Partial<TableCertificate>, trx?: sdk.TrxToken): Promise<number>
|
|
8639
|
+
async updateCertificateField(certificateId: number, fieldName: string, update: Partial<TableCertificateField>, trx?: sdk.TrxToken): Promise<number>
|
|
8640
|
+
async updateCommission(id: number, update: Partial<TableCommission>, trx?: sdk.TrxToken): Promise<number>
|
|
8641
|
+
async updateMonitorEvent(id: number, update: Partial<TableMonitorEvent>, trx?: sdk.TrxToken): Promise<number>
|
|
8642
|
+
async updateOutput(id: number, update: Partial<TableOutput>, trx?: sdk.TrxToken): Promise<number>
|
|
8643
|
+
async updateOutputBasket(id: number, update: Partial<TableOutputBasket>, trx?: sdk.TrxToken): Promise<number>
|
|
8644
|
+
async updateOutputTag(id: number, update: Partial<TableOutputTag>, trx?: sdk.TrxToken): Promise<number>
|
|
8645
|
+
async updateProvenTx(id: number, update: Partial<TableProvenTx>, trx?: sdk.TrxToken): Promise<number>
|
|
8646
|
+
async updateProvenTxReq(id: number | number[], update: Partial<TableProvenTxReq>, trx?: sdk.TrxToken): Promise<number>
|
|
8647
|
+
async updateSyncState(id: number, update: Partial<TableSyncState>, trx?: sdk.TrxToken): Promise<number>
|
|
8648
|
+
async updateTransaction(id: number | number[], update: Partial<TableTransaction>, trx?: sdk.TrxToken): Promise<number>
|
|
8649
|
+
async updateTxLabel(id: number, update: Partial<TableTxLabel>, trx?: sdk.TrxToken): Promise<number>
|
|
8650
|
+
async updateUser(id: number, update: Partial<TableUser>, trx?: sdk.TrxToken): Promise<number>
|
|
8651
|
+
async updateOutputTagMap(outputId: number, tagId: number, update: Partial<TableOutputTagMap>, trx?: sdk.TrxToken): Promise<number>
|
|
8652
|
+
async updateTxLabelMap(transactionId: number, txLabelId: number, update: Partial<TableTxLabelMap>, trx?: sdk.TrxToken): Promise<number>
|
|
8653
|
+
async destroy(): Promise<void>
|
|
8654
|
+
allStores: string[] = [
|
|
8655
|
+
"certificates",
|
|
8656
|
+
"certificate_fields",
|
|
8657
|
+
"commissions",
|
|
8658
|
+
"monitor_events",
|
|
8659
|
+
"outputs",
|
|
8660
|
+
"output_baskets",
|
|
8661
|
+
"output_tags",
|
|
8662
|
+
"output_tags_map",
|
|
8663
|
+
"proven_txs",
|
|
8664
|
+
"proven_tx_reqs",
|
|
8665
|
+
"sync_states",
|
|
8666
|
+
"transactions",
|
|
8667
|
+
"tx_labels",
|
|
8668
|
+
"tx_labels_map",
|
|
8669
|
+
"users"
|
|
8670
|
+
];
|
|
8671
|
+
async transaction<T>(scope: (trx: sdk.TrxToken) => Promise<T>, trx?: sdk.TrxToken): Promise<T>
|
|
8672
|
+
async filterCertificateFields(args: sdk.FindCertificateFieldsArgs, filtered: (v: TableCertificateField) => void): Promise<void>
|
|
8673
|
+
async findCertificateFields(args: sdk.FindCertificateFieldsArgs): Promise<TableCertificateField[]>
|
|
8674
|
+
async filterCertificates(args: sdk.FindCertificatesArgs, filtered: (v: TableCertificateX) => void): Promise<void>
|
|
8675
|
+
async findCertificates(args: sdk.FindCertificatesArgs): Promise<TableCertificateX[]>
|
|
8676
|
+
async filterCommissions(args: sdk.FindCommissionsArgs, filtered: (v: TableCommission) => void): Promise<void>
|
|
8677
|
+
async findCommissions(args: sdk.FindCommissionsArgs): Promise<TableCommission[]>
|
|
8678
|
+
async filterMonitorEvents(args: sdk.FindMonitorEventsArgs, filtered: (v: TableMonitorEvent) => void): Promise<void>
|
|
8679
|
+
async findMonitorEvents(args: sdk.FindMonitorEventsArgs): Promise<TableMonitorEvent[]>
|
|
8680
|
+
async filterOutputBaskets(args: sdk.FindOutputBasketsArgs, filtered: (v: TableOutputBasket) => void): Promise<void>
|
|
8681
|
+
async findOutputBaskets(args: sdk.FindOutputBasketsArgs): Promise<TableOutputBasket[]>
|
|
8682
|
+
async filterOutputs(args: sdk.FindOutputsArgs, filtered: (v: TableOutput) => void, tagIds?: number[], isQueryModeAll?: boolean): Promise<void>
|
|
8683
|
+
async findOutputs(args: sdk.FindOutputsArgs, tagIds?: number[], isQueryModeAll?: boolean): Promise<TableOutput[]>
|
|
8684
|
+
async filterOutputTags(args: sdk.FindOutputTagsArgs, filtered: (v: TableOutputTag) => void): Promise<void>
|
|
8685
|
+
async findOutputTags(args: sdk.FindOutputTagsArgs): Promise<TableOutputTag[]>
|
|
8686
|
+
async filterSyncStates(args: sdk.FindSyncStatesArgs, filtered: (v: TableSyncState) => void): Promise<void>
|
|
8687
|
+
async findSyncStates(args: sdk.FindSyncStatesArgs): Promise<TableSyncState[]>
|
|
8688
|
+
async filterTransactions(args: sdk.FindTransactionsArgs, filtered: (v: TableTransaction) => void, labelIds?: number[], isQueryModeAll?: boolean): Promise<void>
|
|
8689
|
+
async findTransactions(args: sdk.FindTransactionsArgs, labelIds?: number[], isQueryModeAll?: boolean): Promise<TableTransaction[]>
|
|
8690
|
+
async filterTxLabels(args: sdk.FindTxLabelsArgs, filtered: (v: TableTxLabel) => void): Promise<void>
|
|
8691
|
+
async findTxLabels(args: sdk.FindTxLabelsArgs): Promise<TableTxLabel[]>
|
|
8692
|
+
async filterUsers(args: sdk.FindUsersArgs, filtered: (v: TableUser) => void): Promise<void>
|
|
8693
|
+
async findUsers(args: sdk.FindUsersArgs): Promise<TableUser[]>
|
|
8694
|
+
async countCertificateFields(args: sdk.FindCertificateFieldsArgs): Promise<number>
|
|
8695
|
+
async countCertificates(args: sdk.FindCertificatesArgs): Promise<number>
|
|
8696
|
+
async countCommissions(args: sdk.FindCommissionsArgs): Promise<number>
|
|
8697
|
+
async countMonitorEvents(args: sdk.FindMonitorEventsArgs): Promise<number>
|
|
8698
|
+
async countOutputBaskets(args: sdk.FindOutputBasketsArgs): Promise<number>
|
|
8699
|
+
async countOutputs(args: sdk.FindOutputsArgs, tagIds?: number[], isQueryModeAll?: boolean): Promise<number>
|
|
8700
|
+
async countOutputTags(args: sdk.FindOutputTagsArgs): Promise<number>
|
|
8701
|
+
async countSyncStates(args: sdk.FindSyncStatesArgs): Promise<number>
|
|
8702
|
+
async countTransactions(args: sdk.FindTransactionsArgs, labelIds?: number[], isQueryModeAll?: boolean): Promise<number>
|
|
8703
|
+
async countTxLabels(args: sdk.FindTxLabelsArgs): Promise<number>
|
|
8704
|
+
async countUsers(args: sdk.FindUsersArgs): Promise<number>
|
|
8705
|
+
async getProvenTxsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableProvenTx[]>
|
|
8706
|
+
async getProvenTxReqsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableProvenTxReq[]>
|
|
8707
|
+
async getTxLabelMapsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableTxLabelMap[]>
|
|
8708
|
+
async getOutputTagMapsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableOutputTagMap[]>
|
|
8709
|
+
async verifyReadyForDatabaseAccess(trx?: sdk.TrxToken): Promise<DBType>
|
|
8710
|
+
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[], booleanFields?: string[]): T
|
|
8711
|
+
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[], booleanFields?: string[]): T[]
|
|
8712
|
+
validatePartialForUpdate<T extends sdk.EntityTimeStamp>(update: Partial<T>, dateFields?: string[], booleanFields?: string[]): Partial<T>
|
|
8713
|
+
async validateEntityForInsert<T extends sdk.EntityTimeStamp>(entity: T, trx?: sdk.TrxToken, dateFields?: string[], booleanFields?: string[]): Promise<any>
|
|
8714
|
+
async validateRawTransaction(t: TableTransaction, trx?: sdk.TrxToken): Promise<void>
|
|
8715
|
+
async adminStats(adminIdentityKey: string): Promise<StorageAdminStats>
|
|
8716
|
+
}
|
|
8717
|
+
```
|
|
8718
|
+
|
|
8719
|
+
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), [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), [StorageAdminStats](./storage.md#interface-storageadminstats), [StorageIdbOptions](./storage.md#interface-storageidboptions), [StorageIdbSchema](./storage.md#interface-storageidbschema), [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), [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), [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)
|
|
8720
|
+
|
|
8721
|
+
###### Method allocateChangeInput
|
|
8722
|
+
|
|
8723
|
+
Proceeds in three stages:
|
|
8724
|
+
1. Find an output that exactly funds the transaction (if exactSatoshis is not undefined).
|
|
8725
|
+
2. Find an output that overfunds by the least amount (targetSatoshis).
|
|
8726
|
+
3. Find an output that comes as close to funding as possible (targetSatoshis).
|
|
8727
|
+
4. Return undefined if no output is found.
|
|
8728
|
+
|
|
8729
|
+
Outputs must belong to userId and basketId and have spendable true.
|
|
8730
|
+
Their corresponding transaction must have status of 'completed', 'unproven', or 'sending' (if excludeSending is false).
|
|
8731
|
+
|
|
8732
|
+
```ts
|
|
8733
|
+
async allocateChangeInput(userId: number, basketId: number, targetSatoshis: number, exactSatoshis: number | undefined, excludeSending: boolean, transactionId: number): Promise<TableOutput | undefined>
|
|
8734
|
+
```
|
|
8735
|
+
See also: [TableOutput](./storage.md#interface-tableoutput)
|
|
8736
|
+
|
|
8737
|
+
Returns
|
|
8738
|
+
|
|
8739
|
+
next funding output to add to transaction or undefined if there are none.
|
|
8740
|
+
|
|
8741
|
+
###### Method migrate
|
|
8742
|
+
|
|
8743
|
+
This method must be called at least once before any other method accesses the database,
|
|
8744
|
+
and each time the schema may have updated.
|
|
8745
|
+
|
|
8746
|
+
If the database has already been created in this context, `storageName` and `storageIdentityKey`
|
|
8747
|
+
are ignored.
|
|
8748
|
+
|
|
8749
|
+
```ts
|
|
8750
|
+
async migrate(storageName: string, storageIdentityKey: string): Promise<string>
|
|
8751
|
+
```
|
|
8752
|
+
|
|
8753
|
+
###### Method readSettings
|
|
8754
|
+
|
|
8755
|
+
Called by `makeAvailable` to return storage `TableSettings`.
|
|
8756
|
+
Since this is the first async method that must be called by all clients,
|
|
8757
|
+
it is where async initialization occurs.
|
|
8758
|
+
|
|
8759
|
+
After initialization, cached settings are returned.
|
|
8760
|
+
|
|
8761
|
+
```ts
|
|
8762
|
+
async readSettings(trx?: sdk.TrxToken): Promise<TableSettings>
|
|
8763
|
+
```
|
|
8764
|
+
See also: [TableSettings](./storage.md#interface-tablesettings), [TrxToken](./client.md#interface-trxtoken)
|
|
8765
|
+
|
|
8766
|
+
###### Method toDbTrx
|
|
8767
|
+
|
|
8768
|
+
Convert the standard optional `TrxToken` parameter into either a direct knex database instance,
|
|
8769
|
+
or a Knex.Transaction as appropriate.
|
|
8770
|
+
|
|
8771
|
+
```ts
|
|
8772
|
+
toDbTrx(stores: string[], mode: "readonly" | "readwrite", trx?: sdk.TrxToken): IDBPTransaction<StorageIdbSchema, string[], "readwrite" | "readonly">
|
|
8773
|
+
```
|
|
8774
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema), [TrxToken](./client.md#interface-trxtoken)
|
|
8775
|
+
|
|
8776
|
+
###### Method validateEntities
|
|
8777
|
+
|
|
8778
|
+
Helper to force uniform behavior across database engines.
|
|
8779
|
+
Use to process all arrays of records with time stamps retreived from database.
|
|
8780
|
+
|
|
8781
|
+
```ts
|
|
8782
|
+
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[], booleanFields?: string[]): T[]
|
|
8783
|
+
```
|
|
8784
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8785
|
+
|
|
8786
|
+
Returns
|
|
8787
|
+
|
|
8788
|
+
input `entities` array with contained values validated.
|
|
8789
|
+
|
|
8790
|
+
###### Method validateEntity
|
|
8791
|
+
|
|
8792
|
+
Helper to force uniform behavior across database engines.
|
|
8793
|
+
Use to process all individual records with time stamps or number[] retreived from database.
|
|
8794
|
+
|
|
8795
|
+
```ts
|
|
8796
|
+
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[], booleanFields?: string[]): T
|
|
8797
|
+
```
|
|
8798
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8799
|
+
|
|
8800
|
+
###### Method validateEntityForInsert
|
|
8801
|
+
|
|
8802
|
+
Helper to force uniform behavior across database engines.
|
|
8803
|
+
Use to process new entities being inserted into the database.
|
|
8804
|
+
|
|
8805
|
+
```ts
|
|
8806
|
+
async validateEntityForInsert<T extends sdk.EntityTimeStamp>(entity: T, trx?: sdk.TrxToken, dateFields?: string[], booleanFields?: string[]): Promise<any>
|
|
8807
|
+
```
|
|
8808
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp), [TrxToken](./client.md#interface-trxtoken)
|
|
8809
|
+
|
|
8810
|
+
###### Method validatePartialForUpdate
|
|
8811
|
+
|
|
8812
|
+
Helper to force uniform behavior across database engines.
|
|
8813
|
+
Use to process the update template for entities being updated.
|
|
8814
|
+
|
|
8815
|
+
```ts
|
|
8816
|
+
validatePartialForUpdate<T extends sdk.EntityTimeStamp>(update: Partial<T>, dateFields?: string[], booleanFields?: string[]): Partial<T>
|
|
8817
|
+
```
|
|
8818
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8819
|
+
|
|
8820
|
+
###### Method verifyDB
|
|
8821
|
+
|
|
8822
|
+
Following initial database initialization, this method verfies that db is ready for use.
|
|
8823
|
+
|
|
8824
|
+
```ts
|
|
8825
|
+
async verifyDB(storageName?: string, storageIdentityKey?: string): Promise<IDBPDatabase<StorageIdbSchema>>
|
|
8826
|
+
```
|
|
8827
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
8828
|
+
|
|
8829
|
+
Throws
|
|
8830
|
+
|
|
8831
|
+
`WERR_INVALID_OPERATION` if the database has not been initialized by a call to `migrate`.
|
|
8832
|
+
|
|
8833
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8834
|
+
|
|
7783
8835
|
---
|
|
7784
8836
|
##### Class: StorageProvider
|
|
7785
8837
|
|
|
@@ -8903,8 +9955,8 @@ export class Wallet implements WalletInterface, ProtoWallet {
|
|
|
8903
9955
|
async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
|
|
8904
9956
|
async discoverByIdentityKey(args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
8905
9957
|
async discoverByAttributes(args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
8906
|
-
verifyReturnedTxidOnly(beef: Beef): Beef
|
|
8907
|
-
verifyReturnedTxidOnlyAtomicBEEF(beef: AtomicBEEF): AtomicBEEF
|
|
9958
|
+
verifyReturnedTxidOnly(beef: Beef, knownTxids?: string[]): Beef
|
|
9959
|
+
verifyReturnedTxidOnlyAtomicBEEF(beef: AtomicBEEF, knownTxids?: string[]): AtomicBEEF
|
|
8908
9960
|
verifyReturnedTxidOnlyBEEF(beef: BEEF): BEEF
|
|
8909
9961
|
async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
|
|
8910
9962
|
async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
|
|
@@ -9872,10 +10924,12 @@ export class WalletStorageManager implements sdk.WalletStorage {
|
|
|
9872
10924
|
}>
|
|
9873
10925
|
async updateBackups(activeSync?: sdk.WalletStorageSync): Promise<string>
|
|
9874
10926
|
async setActive(storageIdentityKey: string): Promise<string>
|
|
10927
|
+
getStoreEndpointURL(store: ManagedStorage): string | undefined
|
|
10928
|
+
getStores(): sdk.WalletStorageInfo[]
|
|
9875
10929
|
}
|
|
9876
10930
|
```
|
|
9877
10931
|
|
|
9878
|
-
See also: [AuthId](./client.md#interface-authid), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableUser](./storage.md#interface-tableuser), [ValidCreateActionArgs](./client.md#interface-validcreateactionargs), [ValidListActionsArgs](./client.md#interface-validlistactionsargs), [ValidListCertificatesArgs](./client.md#interface-validlistcertificatesargs), [ValidListOutputsArgs](./client.md#interface-validlistoutputsargs), [WalletServices](./client.md#interface-walletservices), [WalletStorage](./client.md#interface-walletstorage), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [WalletStorageReader](./client.md#interface-walletstoragereader), [WalletStorageSync](./client.md#interface-walletstoragesync), [WalletStorageSyncReader](./client.md#interface-walletstoragesyncreader), [WalletStorageWriter](./client.md#interface-walletstoragewriter), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction)
|
|
10932
|
+
See also: [AuthId](./client.md#interface-authid), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableUser](./storage.md#interface-tableuser), [ValidCreateActionArgs](./client.md#interface-validcreateactionargs), [ValidListActionsArgs](./client.md#interface-validlistactionsargs), [ValidListCertificatesArgs](./client.md#interface-validlistcertificatesargs), [ValidListOutputsArgs](./client.md#interface-validlistoutputsargs), [WalletServices](./client.md#interface-walletservices), [WalletStorage](./client.md#interface-walletstorage), [WalletStorageInfo](./client.md#interface-walletstorageinfo), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [WalletStorageReader](./client.md#interface-walletstoragereader), [WalletStorageSync](./client.md#interface-walletstoragesync), [WalletStorageSyncReader](./client.md#interface-walletstoragesyncreader), [WalletStorageWriter](./client.md#interface-walletstoragewriter), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction)
|
|
9879
10933
|
|
|
9880
10934
|
###### Property _active
|
|
9881
10935
|
|
|
@@ -10154,8 +11208,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10154
11208
|
|
|
10155
11209
|
| | | |
|
|
10156
11210
|
| --- | --- | --- |
|
|
10157
|
-
| [acquireDirectCertificate](#function-acquiredirectcertificate) | [
|
|
10158
|
-
| [arcDefaultUrl](#function-arcdefaulturl) | [
|
|
11211
|
+
| [acquireDirectCertificate](#function-acquiredirectcertificate) | [listCertificates](#function-listcertificates) | [validateCreateActionOutput](#function-validatecreateactionoutput) |
|
|
11212
|
+
| [arcDefaultUrl](#function-arcdefaulturl) | [listOutputsIdb](#function-listoutputsidb) | [validateDiscoverByAttributesArgs](#function-validatediscoverbyattributesargs) |
|
|
10159
11213
|
| [arraysEqual](#function-arraysequal) | [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [validateDiscoverByIdentityKeyArgs](#function-validatediscoverbyidentitykeyargs) |
|
|
10160
11214
|
| [asArray](#function-asarray) | [makeAtomicBeef](#function-makeatomicbeef) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
|
|
10161
11215
|
| [asBsvSdkPrivateKey](#function-asbsvsdkprivatekey) | [makeAtomicBeef](#function-makeatomicbeef) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
|
|
@@ -10168,29 +11222,31 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10168
11222
|
| [completeSignedTransaction](#function-completesignedtransaction) | [processAction](#function-processaction) | [validateOptionalInteger](#function-validateoptionalinteger) |
|
|
10169
11223
|
| [completeSignedTransaction](#function-completesignedtransaction) | [processAction](#function-processaction) | [validateOptionalOutpointString](#function-validateoptionaloutpointstring) |
|
|
10170
11224
|
| [convertProofToMerklePath](#function-convertprooftomerklepath) | [proveCertificate](#function-provecertificate) | [validateOriginator](#function-validateoriginator) |
|
|
10171
|
-
| [createAction](#function-createaction) | [
|
|
10172
|
-
| [createAction](#function-createaction) | [
|
|
10173
|
-
| [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [
|
|
10174
|
-
| [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [
|
|
10175
|
-
| [createSyncMap](#function-createsyncmap) | [
|
|
10176
|
-
| [doubleSha256BE](#function-doublesha256be) | [
|
|
10177
|
-
| [doubleSha256HashLE](#function-doublesha256hashle) | [
|
|
10178
|
-
| [generateChangeSdk](#function-generatechangesdk) | [
|
|
10179
|
-
| [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [
|
|
10180
|
-
| [getBeefForTransaction](#function-getbeeffortransaction) | [
|
|
10181
|
-
| [getExchangeRatesIo](#function-getexchangeratesio) | [
|
|
10182
|
-
| [getIdentityKey](#function-getidentitykey) | [
|
|
10183
|
-
| [getProofs](#function-getproofs) | [
|
|
10184
|
-
| [getSyncChunk](#function-getsyncchunk) | [
|
|
10185
|
-
| [internalizeAction](#function-internalizeaction) | [
|
|
10186
|
-
| [internalizeAction](#function-internalizeaction) | [
|
|
10187
|
-
| [isBaseBlockHeader](#function-isbaseblockheader) | [
|
|
10188
|
-
| [isBlockHeader](#function-isblockheader) | [
|
|
10189
|
-
| [isCreateActionSpecOp](#function-iscreateactionspecop) | [
|
|
10190
|
-
| [isHexString](#function-ishexstring) | [
|
|
10191
|
-
| [isListActionsSpecOp](#function-islistactionsspecop) | [
|
|
10192
|
-
| [isListOutputsSpecOp](#function-islistoutputsspecop) | [
|
|
10193
|
-
| [isLive](#function-islive) | [
|
|
11225
|
+
| [createAction](#function-createaction) | [purgeDataIdb](#function-purgedataidb) | [validateOutpointString](#function-validateoutpointstring) |
|
|
11226
|
+
| [createAction](#function-createaction) | [randomBytes](#function-randombytes) | [validatePositiveIntegerOrZero](#function-validatepositiveintegerorzero) |
|
|
11227
|
+
| [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [randomBytesBase64](#function-randombytesbase64) | [validateProveCertificateArgs](#function-validateprovecertificateargs) |
|
|
11228
|
+
| [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [randomBytesHex](#function-randombyteshex) | [validateRelinquishCertificateArgs](#function-validaterelinquishcertificateargs) |
|
|
11229
|
+
| [createSyncMap](#function-createsyncmap) | [reviewStatusIdb](#function-reviewstatusidb) | [validateRelinquishOutputArgs](#function-validaterelinquishoutputargs) |
|
|
11230
|
+
| [doubleSha256BE](#function-doublesha256be) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) | [validateSatoshis](#function-validatesatoshis) |
|
|
11231
|
+
| [doubleSha256HashLE](#function-doublesha256hashle) | [sha256Hash](#function-sha256hash) | [validateScriptHash](#function-validatescripthash) |
|
|
11232
|
+
| [generateChangeSdk](#function-generatechangesdk) | [signAction](#function-signaction) | [validateSecondsSinceEpoch](#function-validatesecondssinceepoch) |
|
|
11233
|
+
| [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [stampLog](#function-stamplog) | [validateSignActionArgs](#function-validatesignactionargs) |
|
|
11234
|
+
| [getBeefForTransaction](#function-getbeeffortransaction) | [stampLogFormat](#function-stamplogformat) | [validateSignActionOptions](#function-validatesignactionoptions) |
|
|
11235
|
+
| [getExchangeRatesIo](#function-getexchangeratesio) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
|
|
11236
|
+
| [getIdentityKey](#function-getidentitykey) | [toWalletNetwork](#function-towalletnetwork) | [validateStringLength](#function-validatestringlength) |
|
|
11237
|
+
| [getProofs](#function-getproofs) | [transactionInputSize](#function-transactioninputsize) | [validateWalletPayment](#function-validatewalletpayment) |
|
|
11238
|
+
| [getSyncChunk](#function-getsyncchunk) | [transactionOutputSize](#function-transactionoutputsize) | [varUintSize](#function-varuintsize) |
|
|
11239
|
+
| [internalizeAction](#function-internalizeaction) | [transactionSize](#function-transactionsize) | [verifyHexString](#function-verifyhexstring) |
|
|
11240
|
+
| [internalizeAction](#function-internalizeaction) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) | [verifyId](#function-verifyid) |
|
|
11241
|
+
| [isBaseBlockHeader](#function-isbaseblockheader) | [updateExchangeratesapi](#function-updateexchangeratesapi) | [verifyInteger](#function-verifyinteger) |
|
|
11242
|
+
| [isBlockHeader](#function-isblockheader) | [validateAbortActionArgs](#function-validateabortactionargs) | [verifyNumber](#function-verifynumber) |
|
|
11243
|
+
| [isCreateActionSpecOp](#function-iscreateactionspecop) | [validateAcquireCertificateArgs](#function-validateacquirecertificateargs) | [verifyOne](#function-verifyone) |
|
|
11244
|
+
| [isHexString](#function-ishexstring) | [validateAcquireDirectCertificateArgs](#function-validateacquiredirectcertificateargs) | [verifyOneOrNone](#function-verifyoneornone) |
|
|
11245
|
+
| [isListActionsSpecOp](#function-islistactionsspecop) | [validateAcquireIssuanceCertificateArgs](#function-validateacquireissuancecertificateargs) | [verifyOptionalHexString](#function-verifyoptionalhexstring) |
|
|
11246
|
+
| [isListOutputsSpecOp](#function-islistoutputsspecop) | [validateBasketInsertion](#function-validatebasketinsertion) | [verifyTruthy](#function-verifytruthy) |
|
|
11247
|
+
| [isLive](#function-islive) | [validateCreateActionArgs](#function-validatecreateactionargs) | [wait](#function-wait) |
|
|
11248
|
+
| [isLiveBlockHeader](#function-isliveblockheader) | [validateCreateActionInput](#function-validatecreateactioninput) | |
|
|
11249
|
+
| [listActionsIdb](#function-listactionsidb) | [validateCreateActionOptions](#function-validatecreateactionoptions) | |
|
|
10194
11250
|
|
|
10195
11251
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10196
11252
|
|
|
@@ -10396,10 +11452,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10396
11452
|
##### Function: createAction
|
|
10397
11453
|
|
|
10398
11454
|
```ts
|
|
10399
|
-
export async function createAction(
|
|
11455
|
+
export async function createAction(wallet: Wallet, auth: sdk.AuthId, vargs: sdk.ValidCreateActionArgs): Promise<CreateActionResultX>
|
|
10400
11456
|
```
|
|
10401
11457
|
|
|
10402
|
-
See also: [AuthId](./client.md#interface-authid), [
|
|
11458
|
+
See also: [AuthId](./client.md#interface-authid), [CreateActionResultX](./client.md#interface-createactionresultx), [ValidCreateActionArgs](./client.md#interface-validcreateactionargs), [Wallet](./client.md#class-wallet)
|
|
10403
11459
|
|
|
10404
11460
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10405
11461
|
|
|
@@ -10407,10 +11463,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10407
11463
|
##### Function: createAction
|
|
10408
11464
|
|
|
10409
11465
|
```ts
|
|
10410
|
-
export async function createAction(
|
|
11466
|
+
export async function createAction(storage: StorageProvider, auth: sdk.AuthId, vargs: sdk.ValidCreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<sdk.StorageCreateActionResult>
|
|
10411
11467
|
```
|
|
10412
11468
|
|
|
10413
|
-
See also: [AuthId](./client.md#interface-authid), [
|
|
11469
|
+
See also: [AuthId](./client.md#interface-authid), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageProvider](./storage.md#class-storageprovider), [ValidCreateActionArgs](./client.md#interface-validcreateactionargs)
|
|
10414
11470
|
|
|
10415
11471
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10416
11472
|
|
|
@@ -10650,13 +11706,13 @@ When the transaction already exists, the description is updated. The isOutgoing
|
|
|
10650
11706
|
|
|
10651
11707
|
"wallet payment" Merge Rules:
|
|
10652
11708
|
1. Targetting an existing change "default" basket output results in a no-op. No error. No alterations made.
|
|
10653
|
-
2. Targetting a previously "custom" non-change output converts it into a change output. This alters the transaction's `
|
|
11709
|
+
2. Targetting a previously "custom" non-change output converts it into a change output. This alters the transaction's `amount`, and the wallet balance.
|
|
10654
11710
|
|
|
10655
11711
|
```ts
|
|
10656
|
-
export async function internalizeAction(
|
|
11712
|
+
export async function internalizeAction(wallet: Wallet, auth: sdk.AuthId, args: InternalizeActionArgs): Promise<InternalizeActionResult>
|
|
10657
11713
|
```
|
|
10658
11714
|
|
|
10659
|
-
See also: [AuthId](./client.md#interface-authid), [
|
|
11715
|
+
See also: [AuthId](./client.md#interface-authid), [Wallet](./client.md#class-wallet)
|
|
10660
11716
|
|
|
10661
11717
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10662
11718
|
|
|
@@ -10686,13 +11742,13 @@ When the transaction already exists, the description is updated. The isOutgoing
|
|
|
10686
11742
|
|
|
10687
11743
|
"wallet payment" Merge Rules:
|
|
10688
11744
|
1. Targetting an existing change "default" basket output results in a no-op. No error. No alterations made.
|
|
10689
|
-
2. Targetting a previously "custom" non-change output converts it into a change output. This alters the transaction's `
|
|
11745
|
+
2. Targetting a previously "custom" non-change output converts it into a change output. This alters the transaction's `satoshis`, and the wallet balance.
|
|
10690
11746
|
|
|
10691
11747
|
```ts
|
|
10692
|
-
export async function internalizeAction(
|
|
11748
|
+
export async function internalizeAction(storage: StorageProvider, auth: sdk.AuthId, args: InternalizeActionArgs): Promise<InternalizeActionResult>
|
|
10693
11749
|
```
|
|
10694
11750
|
|
|
10695
|
-
See also: [AuthId](./client.md#interface-authid), [
|
|
11751
|
+
See also: [AuthId](./client.md#interface-authid), [StorageProvider](./storage.md#class-storageprovider)
|
|
10696
11752
|
|
|
10697
11753
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10698
11754
|
|
|
@@ -10819,6 +11875,17 @@ See also: [BaseBlockHeader](./services.md#interface-baseblockheader), [BlockHead
|
|
|
10819
11875
|
|
|
10820
11876
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10821
11877
|
|
|
11878
|
+
---
|
|
11879
|
+
##### Function: listActionsIdb
|
|
11880
|
+
|
|
11881
|
+
```ts
|
|
11882
|
+
export async function listActionsIdb(storage: StorageIdb, auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs): Promise<ListActionsResult>
|
|
11883
|
+
```
|
|
11884
|
+
|
|
11885
|
+
See also: [AuthId](./client.md#interface-authid), [StorageIdb](./storage.md#class-storageidb), [ValidListActionsArgs](./client.md#interface-validlistactionsargs)
|
|
11886
|
+
|
|
11887
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11888
|
+
|
|
10822
11889
|
---
|
|
10823
11890
|
##### Function: listCertificates
|
|
10824
11891
|
|
|
@@ -10830,6 +11897,17 @@ See also: [AuthId](./client.md#interface-authid), [StorageProvider](./storage.md
|
|
|
10830
11897
|
|
|
10831
11898
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10832
11899
|
|
|
11900
|
+
---
|
|
11901
|
+
##### Function: listOutputsIdb
|
|
11902
|
+
|
|
11903
|
+
```ts
|
|
11904
|
+
export async function listOutputsIdb(storage: StorageIdb, auth: sdk.AuthId, vargs: sdk.ValidListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
|
|
11905
|
+
```
|
|
11906
|
+
|
|
11907
|
+
See also: [AuthId](./client.md#interface-authid), [StorageIdb](./storage.md#class-storageidb), [ValidListOutputsArgs](./client.md#interface-validlistoutputsargs)
|
|
11908
|
+
|
|
11909
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11910
|
+
|
|
10833
11911
|
---
|
|
10834
11912
|
##### Function: lockScriptWithKeyOffsetFromPubKey
|
|
10835
11913
|
|
|
@@ -10930,10 +12008,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10930
12008
|
##### Function: processAction
|
|
10931
12009
|
|
|
10932
12010
|
```ts
|
|
10933
|
-
export async function processAction(
|
|
12011
|
+
export async function processAction(prior: PendingSignAction | undefined, wallet: Wallet, auth: sdk.AuthId, vargs: sdk.ValidProcessActionArgs): Promise<sdk.StorageProcessActionResults>
|
|
10934
12012
|
```
|
|
10935
12013
|
|
|
10936
|
-
See also: [AuthId](./client.md#interface-authid), [
|
|
12014
|
+
See also: [AuthId](./client.md#interface-authid), [PendingSignAction](./client.md#interface-pendingsignaction), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [ValidProcessActionArgs](./client.md#interface-validprocessactionargs), [Wallet](./client.md#class-wallet)
|
|
10937
12015
|
|
|
10938
12016
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10939
12017
|
|
|
@@ -10941,10 +12019,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10941
12019
|
##### Function: processAction
|
|
10942
12020
|
|
|
10943
12021
|
```ts
|
|
10944
|
-
export async function processAction(
|
|
12022
|
+
export async function processAction(storage: StorageProvider, auth: sdk.AuthId, args: sdk.StorageProcessActionArgs): Promise<sdk.StorageProcessActionResults>
|
|
10945
12023
|
```
|
|
10946
12024
|
|
|
10947
|
-
See also: [AuthId](./client.md#interface-authid), [
|
|
12025
|
+
See also: [AuthId](./client.md#interface-authid), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [StorageProvider](./storage.md#class-storageprovider)
|
|
10948
12026
|
|
|
10949
12027
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10950
12028
|
|
|
@@ -10959,6 +12037,17 @@ See also: [AuthId](./client.md#interface-authid), [ValidProveCertificateArgs](./
|
|
|
10959
12037
|
|
|
10960
12038
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10961
12039
|
|
|
12040
|
+
---
|
|
12041
|
+
##### Function: purgeDataIdb
|
|
12042
|
+
|
|
12043
|
+
```ts
|
|
12044
|
+
export async function purgeDataIdb(storage: StorageIdb, params: sdk.PurgeParams, trx?: sdk.TrxToken): Promise<sdk.PurgeResults>
|
|
12045
|
+
```
|
|
12046
|
+
|
|
12047
|
+
See also: [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageIdb](./storage.md#class-storageidb), [TrxToken](./client.md#interface-trxtoken)
|
|
12048
|
+
|
|
12049
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
12050
|
+
|
|
10962
12051
|
---
|
|
10963
12052
|
##### Function: randomBytes
|
|
10964
12053
|
|
|
@@ -10998,6 +12087,28 @@ count cryptographically secure random bytes as hex encoded string
|
|
|
10998
12087
|
|
|
10999
12088
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11000
12089
|
|
|
12090
|
+
---
|
|
12091
|
+
##### Function: reviewStatusIdb
|
|
12092
|
+
|
|
12093
|
+
Looks for unpropagated state:
|
|
12094
|
+
|
|
12095
|
+
1. set transactions to 'failed' if not already failed and provenTxReq with matching txid has status of 'invalid'.
|
|
12096
|
+
2. sets transactions to 'completed' if provenTx with matching txid exists and current provenTxId is null.
|
|
12097
|
+
3. sets outputs to spendable true, spentBy undefined if spentBy is a transaction with status 'failed'.
|
|
12098
|
+
|
|
12099
|
+
```ts
|
|
12100
|
+
export async function reviewStatusIdb(storage: StorageIdb, args: {
|
|
12101
|
+
agedLimit: Date;
|
|
12102
|
+
trx?: sdk.TrxToken;
|
|
12103
|
+
}): Promise<{
|
|
12104
|
+
log: string;
|
|
12105
|
+
}>
|
|
12106
|
+
```
|
|
12107
|
+
|
|
12108
|
+
See also: [StorageIdb](./storage.md#class-storageidb), [TrxToken](./client.md#interface-trxtoken)
|
|
12109
|
+
|
|
12110
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
12111
|
+
|
|
11001
12112
|
---
|
|
11002
12113
|
##### Function: setDisableDoubleSpendCheckForTest
|
|
11003
12114
|
|
|
@@ -12119,16 +13230,17 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
12119
13230
|
|
|
12120
13231
|
| | |
|
|
12121
13232
|
| --- | --- |
|
|
12122
|
-
| [DEFAULT_PROFILE_ID](#variable-default_profile_id) | [
|
|
12123
|
-
| [DEFAULT_SETTINGS](#variable-default_settings) | [
|
|
12124
|
-
| [PBKDF2_NUM_ROUNDS](#variable-pbkdf2_num_rounds) | [
|
|
12125
|
-
| [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) | [
|
|
12126
|
-
| [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) | [
|
|
12127
|
-
| [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) | [
|
|
12128
|
-
| [brc29ProtocolID](#variable-brc29protocolid) | [
|
|
12129
|
-
| [
|
|
12130
|
-
| [
|
|
12131
|
-
| [
|
|
13233
|
+
| [DEFAULT_PROFILE_ID](#variable-default_profile_id) | [parseResults](#variable-parseresults) |
|
|
13234
|
+
| [DEFAULT_SETTINGS](#variable-default_settings) | [queryOverlay](#variable-queryoverlay) |
|
|
13235
|
+
| [PBKDF2_NUM_ROUNDS](#variable-pbkdf2_num_rounds) | [specOpFailedActions](#variable-specopfailedactions) |
|
|
13236
|
+
| [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) | [specOpInvalidChange](#variable-specopinvalidchange) |
|
|
13237
|
+
| [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) | [specOpNoSendActions](#variable-specopnosendactions) |
|
|
13238
|
+
| [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) | [specOpSetWalletChangeParams](#variable-specopsetwalletchangeparams) |
|
|
13239
|
+
| [brc29ProtocolID](#variable-brc29protocolid) | [specOpThrowReviewActions](#variable-specopthrowreviewactions) |
|
|
13240
|
+
| [getBasketToSpecOp](#variable-getbaskettospecop) | [specOpWalletBalance](#variable-specopwalletbalance) |
|
|
13241
|
+
| [getLabelToSpecOp](#variable-getlabeltospecop) | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
|
|
13242
|
+
| [maxPossibleSatoshis](#variable-maxpossiblesatoshis) | [transformVerifiableCertificatesWithTrust](#variable-transformverifiablecertificateswithtrust) |
|
|
13243
|
+
| [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) | |
|
|
12132
13244
|
|
|
12133
13245
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
12134
13246
|
|
|
@@ -12244,6 +13356,124 @@ brc29ProtocolID: WalletProtocol = [2, "3241645161d8"]
|
|
|
12244
13356
|
|
|
12245
13357
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
12246
13358
|
|
|
13359
|
+
---
|
|
13360
|
+
##### Variable: getBasketToSpecOp
|
|
13361
|
+
|
|
13362
|
+
```ts
|
|
13363
|
+
getBasketToSpecOp: () => Record<string, ListOutputsSpecOp> = () => {
|
|
13364
|
+
return {
|
|
13365
|
+
[sdk.specOpWalletBalance]: {
|
|
13366
|
+
name: "totalOutputsIsWalletBalance",
|
|
13367
|
+
useBasket: "default",
|
|
13368
|
+
ignoreLimit: true,
|
|
13369
|
+
resultFromOutputs: async (s: StorageProvider, auth: sdk.AuthId, vargs: ValidListOutputsArgs, specOpTags: string[], outputs: TableOutput[]): Promise<ListOutputsResult> => {
|
|
13370
|
+
let totalOutputs = 0;
|
|
13371
|
+
for (const o of outputs)
|
|
13372
|
+
totalOutputs += o.satoshis;
|
|
13373
|
+
return { totalOutputs, outputs: [] };
|
|
13374
|
+
}
|
|
13375
|
+
},
|
|
13376
|
+
[sdk.specOpInvalidChange]: {
|
|
13377
|
+
name: "invalidChangeOutputs",
|
|
13378
|
+
useBasket: "default",
|
|
13379
|
+
ignoreLimit: true,
|
|
13380
|
+
includeOutputScripts: true,
|
|
13381
|
+
includeSpent: false,
|
|
13382
|
+
tagsToIntercept: ["release", "all"],
|
|
13383
|
+
filterOutputs: async (s: StorageProvider, auth: sdk.AuthId, vargs: ValidListOutputsArgs, specOpTags: string[], outputs: TableOutput[]): Promise<TableOutput[]> => {
|
|
13384
|
+
const filteredOutputs: TableOutput[] = [];
|
|
13385
|
+
const services = s.getServices();
|
|
13386
|
+
for (const o of outputs) {
|
|
13387
|
+
await s.validateOutputScript(o);
|
|
13388
|
+
let ok: boolean | undefined = false;
|
|
13389
|
+
if (o.lockingScript && o.lockingScript.length > 0) {
|
|
13390
|
+
ok = await services.isUtxo(o);
|
|
13391
|
+
}
|
|
13392
|
+
else {
|
|
13393
|
+
ok = undefined;
|
|
13394
|
+
}
|
|
13395
|
+
if (ok === false) {
|
|
13396
|
+
filteredOutputs.push(o);
|
|
13397
|
+
}
|
|
13398
|
+
}
|
|
13399
|
+
if (specOpTags.indexOf("release") >= 0) {
|
|
13400
|
+
for (const o of filteredOutputs) {
|
|
13401
|
+
await s.updateOutput(o.outputId, { spendable: false });
|
|
13402
|
+
o.spendable = false;
|
|
13403
|
+
}
|
|
13404
|
+
}
|
|
13405
|
+
return filteredOutputs;
|
|
13406
|
+
}
|
|
13407
|
+
},
|
|
13408
|
+
[sdk.specOpSetWalletChangeParams]: {
|
|
13409
|
+
name: "setWalletChangeParams",
|
|
13410
|
+
tagsParamsCount: 2,
|
|
13411
|
+
resultFromTags: async (s: StorageProvider, auth: sdk.AuthId, vargs: ValidListOutputsArgs, specOpTags: string[]): Promise<ListOutputsResult> => {
|
|
13412
|
+
if (specOpTags.length !== 2)
|
|
13413
|
+
throw new sdk.WERR_INVALID_PARAMETER("numberOfDesiredUTXOs and minimumDesiredUTXOValue", "valid");
|
|
13414
|
+
const numberOfDesiredUTXOs: number = verifyInteger(Number(specOpTags[0]));
|
|
13415
|
+
const minimumDesiredUTXOValue: number = verifyInteger(Number(specOpTags[1]));
|
|
13416
|
+
const basket = verifyOne(await s.findOutputBaskets({
|
|
13417
|
+
partial: { userId: verifyId(auth.userId), name: "default" }
|
|
13418
|
+
}));
|
|
13419
|
+
await s.updateOutputBasket(basket.basketId, {
|
|
13420
|
+
numberOfDesiredUTXOs,
|
|
13421
|
+
minimumDesiredUTXOValue
|
|
13422
|
+
});
|
|
13423
|
+
return { totalOutputs: 0, outputs: [] };
|
|
13424
|
+
}
|
|
13425
|
+
}
|
|
13426
|
+
};
|
|
13427
|
+
}
|
|
13428
|
+
```
|
|
13429
|
+
|
|
13430
|
+
See also: [AuthId](./client.md#interface-authid), [ListOutputsSpecOp](./storage.md#interface-listoutputsspecop), [StorageProvider](./storage.md#class-storageprovider), [TableOutput](./storage.md#interface-tableoutput), [ValidListOutputsArgs](./client.md#interface-validlistoutputsargs), [WERR_INVALID_PARAMETER](./client.md#class-werr_invalid_parameter), [specOpInvalidChange](./client.md#variable-specopinvalidchange), [specOpSetWalletChangeParams](./client.md#variable-specopsetwalletchangeparams), [specOpWalletBalance](./client.md#variable-specopwalletbalance), [verifyId](./client.md#function-verifyid), [verifyInteger](./client.md#function-verifyinteger), [verifyOne](./client.md#function-verifyone)
|
|
13431
|
+
|
|
13432
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
13433
|
+
|
|
13434
|
+
---
|
|
13435
|
+
##### Variable: getLabelToSpecOp
|
|
13436
|
+
|
|
13437
|
+
```ts
|
|
13438
|
+
getLabelToSpecOp: () => Record<string, ListActionsSpecOp> = () => {
|
|
13439
|
+
return {
|
|
13440
|
+
[sdk.specOpNoSendActions]: {
|
|
13441
|
+
name: "noSendActions",
|
|
13442
|
+
labelsToIntercept: ["abort"],
|
|
13443
|
+
setStatusFilter: () => ["nosend"],
|
|
13444
|
+
postProcess: async (s: StorageProvider, auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs, specOpLabels: string[], txs: Partial<TableTransaction>[]): Promise<void> => {
|
|
13445
|
+
if (specOpLabels.indexOf("abort") >= 0) {
|
|
13446
|
+
for (const tx of txs) {
|
|
13447
|
+
if (tx.status === "nosend") {
|
|
13448
|
+
await s.abortAction(auth, { reference: tx.reference! });
|
|
13449
|
+
tx.status = "failed";
|
|
13450
|
+
}
|
|
13451
|
+
}
|
|
13452
|
+
}
|
|
13453
|
+
}
|
|
13454
|
+
},
|
|
13455
|
+
[sdk.specOpFailedActions]: {
|
|
13456
|
+
name: "failedActions",
|
|
13457
|
+
labelsToIntercept: ["unfail"],
|
|
13458
|
+
setStatusFilter: () => ["failed"],
|
|
13459
|
+
postProcess: async (s: StorageProvider, auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs, specOpLabels: string[], txs: Partial<TableTransaction>[]): Promise<void> => {
|
|
13460
|
+
if (specOpLabels.indexOf("unfail") >= 0) {
|
|
13461
|
+
for (const tx of txs) {
|
|
13462
|
+
if (tx.status === "failed") {
|
|
13463
|
+
await s.updateTransaction(tx.transactionId!, { status: "unfail" });
|
|
13464
|
+
}
|
|
13465
|
+
}
|
|
13466
|
+
}
|
|
13467
|
+
}
|
|
13468
|
+
}
|
|
13469
|
+
};
|
|
13470
|
+
}
|
|
13471
|
+
```
|
|
13472
|
+
|
|
13473
|
+
See also: [AuthId](./client.md#interface-authid), [ListActionsSpecOp](./storage.md#interface-listactionsspecop), [StorageProvider](./storage.md#class-storageprovider), [TableTransaction](./storage.md#interface-tabletransaction), [ValidListActionsArgs](./client.md#interface-validlistactionsargs), [specOpFailedActions](./client.md#variable-specopfailedactions), [specOpNoSendActions](./client.md#variable-specopnosendactions)
|
|
13474
|
+
|
|
13475
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
13476
|
+
|
|
12247
13477
|
---
|
|
12248
13478
|
##### Variable: maxPossibleSatoshis
|
|
12249
13479
|
|