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