@bsv/sdk 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/primitives/PublicKey.js +6 -0
- package/dist/cjs/src/primitives/PublicKey.js.map +1 -1
- package/dist/cjs/src/script/templates/PushDrop.js +2 -2
- package/dist/cjs/src/script/templates/PushDrop.js.map +1 -1
- package/dist/cjs/src/transaction/Transaction.js +1 -5
- package/dist/cjs/src/transaction/Transaction.js.map +1 -1
- package/dist/cjs/src/wallet/CachedKeyDeriver.js +4 -4
- package/dist/cjs/src/wallet/CachedKeyDeriver.js.map +1 -1
- package/dist/cjs/src/wallet/KeyDeriver.js +5 -5
- package/dist/cjs/src/wallet/KeyDeriver.js.map +1 -1
- package/dist/cjs/src/wallet/ProtoWallet.js.map +1 -1
- package/dist/cjs/src/wallet/Wallet.interfaces.js +14 -0
- package/dist/cjs/src/wallet/Wallet.interfaces.js.map +1 -1
- package/dist/cjs/src/wallet/WalletClient.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/XDM.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/window.CWI.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/primitives/PublicKey.js +6 -0
- package/dist/esm/src/primitives/PublicKey.js.map +1 -1
- package/dist/esm/src/script/templates/PushDrop.js +2 -2
- package/dist/esm/src/script/templates/PushDrop.js.map +1 -1
- package/dist/esm/src/transaction/Transaction.js +1 -5
- package/dist/esm/src/transaction/Transaction.js.map +1 -1
- package/dist/esm/src/wallet/CachedKeyDeriver.js +4 -4
- package/dist/esm/src/wallet/CachedKeyDeriver.js.map +1 -1
- package/dist/esm/src/wallet/KeyDeriver.js +5 -5
- package/dist/esm/src/wallet/KeyDeriver.js.map +1 -1
- package/dist/esm/src/wallet/ProtoWallet.js.map +1 -1
- package/dist/esm/src/wallet/Wallet.interfaces.js +13 -1
- package/dist/esm/src/wallet/Wallet.interfaces.js.map +1 -1
- package/dist/esm/src/wallet/WalletClient.js.map +1 -1
- package/dist/esm/src/wallet/substrates/WalletWireProcessor.js.map +1 -1
- package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js.map +1 -1
- package/dist/esm/src/wallet/substrates/XDM.js.map +1 -1
- package/dist/esm/src/wallet/substrates/window.CWI.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/primitives/PublicKey.d.ts.map +1 -1
- package/dist/types/src/script/templates/PushDrop.d.ts +5 -4
- package/dist/types/src/script/templates/PushDrop.d.ts.map +1 -1
- package/dist/types/src/transaction/Transaction.d.ts +0 -1
- package/dist/types/src/transaction/Transaction.d.ts.map +1 -1
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts +9 -8
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts.map +1 -1
- package/dist/types/src/wallet/KeyDeriver.d.ts +10 -9
- package/dist/types/src/wallet/KeyDeriver.d.ts.map +1 -1
- package/dist/types/src/wallet/ProtoWallet.d.ts +10 -10
- package/dist/types/src/wallet/ProtoWallet.d.ts.map +1 -1
- package/dist/types/src/wallet/Wallet.interfaces.d.ts +30 -2
- package/dist/types/src/wallet/Wallet.interfaces.d.ts.map +1 -1
- package/dist/types/src/wallet/WalletClient.d.ts +10 -10
- package/dist/types/src/wallet/WalletClient.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/WalletWireProcessor.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts +10 -10
- package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/XDM.d.ts +10 -10
- package/dist/types/src/wallet/substrates/XDM.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/window.CWI.d.ts +10 -10
- package/dist/types/src/wallet/substrates/window.CWI.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/overlay-tools.md +21 -19
- package/docs/script.md +21 -19
- package/docs/transaction.md +4 -6
- package/docs/wallet.md +229 -196
- package/package.json +1 -1
- package/src/primitives/PublicKey.ts +17 -11
- package/src/primitives/__tests/PublicKey.test.ts +6 -0
- package/src/script/templates/PushDrop.ts +5 -4
- package/src/transaction/Transaction.ts +1 -5
- package/src/wallet/CachedKeyDeriver.ts +9 -8
- package/src/wallet/KeyDeriver.ts +11 -10
- package/src/wallet/ProtoWallet.ts +10 -9
- package/src/wallet/Wallet.interfaces.ts +32 -2
- package/src/wallet/WalletClient.ts +9 -9
- package/src/wallet/substrates/WalletWireProcessor.ts +3 -2
- package/src/wallet/substrates/WalletWireTransceiver.ts +11 -11
- package/src/wallet/substrates/XDM.ts +9 -9
- package/src/wallet/substrates/window.CWI.ts +9 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AcquireCertificateArgs, AcquireCertificateResult,
|
|
1
|
+
import { AcquireCertificateArgs, AcquireCertificateResult, SecurityLevel, Base64String, BasketStringUnder300Bytes, BEEF, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CertificateFieldNameUnder50Bytes, CreateActionArgs, CreateActionResult, DescriptionString5to50Bytes, DiscoverCertificatesResult, EntityIconURLStringMax500Bytes, EntityNameStringMax100Bytes, HexString, InternalizeActionArgs, ISOTimestampString, KeyIDStringUnder800Bytes, LabelStringUnder300Bytes, ListActionsArgs, ListActionsResult, ListCertificatesResult, ListOutputsArgs, ListOutputsResult, OriginatorDomainNameStringUnder250Bytes, OutpointString, OutputTagStringUnder300Bytes, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerMax10, PositiveIntegerOrZero, ProtocolString5To400Bytes, ProveCertificateArgs, ProveCertificateResult, PubKeyHex, SatoshiValue, SignActionArgs, SignActionResult, TXIDHexString, VersionString7To30Bytes, Wallet } from '../Wallet.interfaces.js'
|
|
2
2
|
import WalletWire from './WalletWire.js'
|
|
3
3
|
import Certificate from '../../auth/Certificate.js'
|
|
4
4
|
import { Utils } from '../../primitives/index.js'
|
|
@@ -908,7 +908,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
908
908
|
return `${txid}.${index}`
|
|
909
909
|
}
|
|
910
910
|
|
|
911
|
-
async getPublicKey(args: { seekPermission?: BooleanDefaultTrue, identityKey?: true, protocolID?: [
|
|
911
|
+
async getPublicKey(args: { seekPermission?: BooleanDefaultTrue, identityKey?: true, protocolID?: [SecurityLevel, ProtocolString5To400Bytes], keyID?: KeyIDStringUnder800Bytes, privileged?: BooleanDefaultFalse, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', forSelf?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ publicKey: PubKeyHex }> {
|
|
912
912
|
const paramWriter = new Utils.Writer()
|
|
913
913
|
paramWriter.writeUInt8(args.identityKey ? 1 : 0)
|
|
914
914
|
if (!args.identityKey) {
|
|
@@ -957,7 +957,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
|
|
960
|
-
async revealSpecificKeyLinkage(args: { counterparty: PubKeyHex, verifier: PubKeyHex, protocolID: [
|
|
960
|
+
async revealSpecificKeyLinkage(args: { counterparty: PubKeyHex, verifier: PubKeyHex, protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ prover: PubKeyHex, verifier: PubKeyHex, counterparty: PubKeyHex, protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, encryptedLinkage: Byte[], encryptedLinkageProof: Byte[], proofType: Byte }> {
|
|
961
961
|
const paramWriter = new Utils.Writer()
|
|
962
962
|
paramWriter.write(this.encodeKeyRelatedParams(args.protocolID, args.keyID, args.counterparty, args.privileged, args.privilegedReason))
|
|
963
963
|
paramWriter.write(Utils.toArray(args.verifier, 'hex'))
|
|
@@ -980,7 +980,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
980
980
|
prover,
|
|
981
981
|
verifier,
|
|
982
982
|
counterparty,
|
|
983
|
-
protocolID: [securityLevel as
|
|
983
|
+
protocolID: [securityLevel as SecurityLevel, protocol],
|
|
984
984
|
keyID,
|
|
985
985
|
encryptedLinkage,
|
|
986
986
|
encryptedLinkageProof,
|
|
@@ -988,7 +988,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
990
|
|
|
991
|
-
async encrypt(args: { seekPermission?: BooleanDefaultTrue, plaintext: Byte[], protocolID: [
|
|
991
|
+
async encrypt(args: { seekPermission?: BooleanDefaultTrue, plaintext: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ ciphertext: Byte[] }> {
|
|
992
992
|
const paramWriter = new Utils.Writer()
|
|
993
993
|
paramWriter.write(this.encodeKeyRelatedParams(args.protocolID, args.keyID, args.counterparty, args.privileged, args.privilegedReason))
|
|
994
994
|
paramWriter.writeVarIntNum(args.plaintext.length)
|
|
@@ -1000,7 +1000,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
|
|
1003
|
-
async decrypt(args: { seekPermission?: BooleanDefaultTrue, ciphertext: Byte[], protocolID: [
|
|
1003
|
+
async decrypt(args: { seekPermission?: BooleanDefaultTrue, ciphertext: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ plaintext: Byte[] }> {
|
|
1004
1004
|
const paramWriter = new Utils.Writer()
|
|
1005
1005
|
paramWriter.write(this.encodeKeyRelatedParams(args.protocolID, args.keyID, args.counterparty, args.privileged, args.privilegedReason))
|
|
1006
1006
|
paramWriter.writeVarIntNum(args.ciphertext.length)
|
|
@@ -1012,7 +1012,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
1014
|
|
|
1015
|
-
async createHmac(args: { seekPermission?: BooleanDefaultTrue, data: Byte[], protocolID: [
|
|
1015
|
+
async createHmac(args: { seekPermission?: BooleanDefaultTrue, data: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ hmac: Byte[] }> {
|
|
1016
1016
|
const paramWriter = new Utils.Writer()
|
|
1017
1017
|
paramWriter.write(this.encodeKeyRelatedParams(args.protocolID, args.keyID, args.counterparty, args.privileged, args.privilegedReason))
|
|
1018
1018
|
paramWriter.writeVarIntNum(args.data.length)
|
|
@@ -1024,7 +1024,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
|
-
async verifyHmac(args: { seekPermission?: BooleanDefaultTrue, data: Byte[], hmac: Byte[], protocolID: [
|
|
1027
|
+
async verifyHmac(args: { seekPermission?: BooleanDefaultTrue, data: Byte[], hmac: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ valid: true }> {
|
|
1028
1028
|
const paramWriter = new Utils.Writer()
|
|
1029
1029
|
paramWriter.write(this.encodeKeyRelatedParams(args.protocolID, args.keyID, args.counterparty, args.privileged, args.privilegedReason))
|
|
1030
1030
|
paramWriter.write(args.hmac)
|
|
@@ -1036,7 +1036,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
1036
1036
|
return { valid: true }
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
|
-
async createSignature(args: { seekPermission?: BooleanDefaultTrue, data?: Byte[], hashToDirectlySign?: Byte[], protocolID: [
|
|
1039
|
+
async createSignature(args: { seekPermission?: BooleanDefaultTrue, data?: Byte[], hashToDirectlySign?: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ signature: Byte[] }> {
|
|
1040
1040
|
const paramWriter = new Utils.Writer()
|
|
1041
1041
|
paramWriter.write(this.encodeKeyRelatedParams(args.protocolID, args.keyID, args.counterparty, args.privileged, args.privilegedReason))
|
|
1042
1042
|
if (typeof args.data === 'object') {
|
|
@@ -1054,7 +1054,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
1056
|
|
|
1057
|
-
async verifySignature(args: { seekPermission?: BooleanDefaultTrue, data?: Byte[], hashToDirectlyVerify?: Byte[], signature: Byte[], protocolID: [
|
|
1057
|
+
async verifySignature(args: { seekPermission?: BooleanDefaultTrue, data?: Byte[], hashToDirectlyVerify?: Byte[], signature: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', forSelf?: BooleanDefaultFalse, privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ valid: true }> {
|
|
1058
1058
|
const paramWriter = new Utils.Writer()
|
|
1059
1059
|
paramWriter.write(this.encodeKeyRelatedParams(args.protocolID, args.keyID, args.counterparty, args.privileged, args.privilegedReason))
|
|
1060
1060
|
if (typeof args.forSelf === 'boolean') {
|
|
@@ -1078,7 +1078,7 @@ export default class WalletWireTransceiver implements Wallet {
|
|
|
1078
1078
|
return { valid: true }
|
|
1079
1079
|
}
|
|
1080
1080
|
|
|
1081
|
-
private encodeKeyRelatedParams(protocolID: [
|
|
1081
|
+
private encodeKeyRelatedParams(protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: boolean, privilegedReason?: string): number[] {
|
|
1082
1082
|
const paramWriter = new Utils.Writer()
|
|
1083
1083
|
paramWriter.writeUInt8(protocolID[0])
|
|
1084
1084
|
const protocolAsArray = Utils.toArray(protocolID[1], 'utf8')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Base64String, BasketStringUnder300Bytes, BEEF, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, EntityIconURLStringMax500Bytes, EntityNameStringMax100Bytes, HexString, ISOTimestampString, KeyIDStringUnder800Bytes, LabelStringUnder300Bytes, OriginatorDomainNameStringUnder250Bytes, OutpointString, OutputTagStringUnder300Bytes, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerMax10, PositiveIntegerOrZero, ProtocolString5To400Bytes, PubKeyHex, SatoshiValue, TXIDHexString, VersionString7To30Bytes, Wallet } from '../Wallet.interfaces.js'
|
|
1
|
+
import { Base64String, BasketStringUnder300Bytes, BEEF, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, EntityIconURLStringMax500Bytes, EntityNameStringMax100Bytes, HexString, ISOTimestampString, KeyIDStringUnder800Bytes, LabelStringUnder300Bytes, OriginatorDomainNameStringUnder250Bytes, OutpointString, OutputTagStringUnder300Bytes, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerMax10, PositiveIntegerOrZero, ProtocolString5To400Bytes, PubKeyHex, SatoshiValue, SecurityLevel, TXIDHexString, VersionString7To30Bytes, Wallet } from '../Wallet.interfaces.js'
|
|
2
2
|
import { Utils, Random } from '../../primitives/index.js'
|
|
3
3
|
import { WalletError } from '../WalletError.js'
|
|
4
4
|
import { CallType } from 'mod.js'
|
|
@@ -71,7 +71,7 @@ export default class XDMSubstrate implements Wallet {
|
|
|
71
71
|
return await this.invoke('relinquishOutput', args)
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
async getPublicKey(args: { identityKey?: true, protocolID?: [
|
|
74
|
+
async getPublicKey(args: { identityKey?: true, protocolID?: [SecurityLevel, ProtocolString5To400Bytes], keyID?: KeyIDStringUnder800Bytes, privileged?: BooleanDefaultFalse, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', forSelf?: BooleanDefaultFalse }): Promise<{ publicKey: PubKeyHex }> {
|
|
75
75
|
return await this.invoke('getPublicKey', args)
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -79,31 +79,31 @@ export default class XDMSubstrate implements Wallet {
|
|
|
79
79
|
return await this.invoke('revealCounterpartyKeyLinkage', args)
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
async revealSpecificKeyLinkage(args: { counterparty: PubKeyHex, verifier: PubKeyHex, protocolID: [
|
|
82
|
+
async revealSpecificKeyLinkage(args: { counterparty: PubKeyHex, verifier: PubKeyHex, protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, privileged?: BooleanDefaultFalse }): Promise<{ prover: PubKeyHex, verifier: PubKeyHex, counterparty: PubKeyHex, protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, encryptedLinkage: Byte[], encryptedLinkageProof: Byte[], proofType: Byte }> {
|
|
83
83
|
return await this.invoke('revealSpecificKeyLinkage', args)
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
async encrypt(args: { plaintext: Byte[], protocolID: [
|
|
86
|
+
async encrypt(args: { plaintext: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }): Promise<{ ciphertext: Byte[] }> {
|
|
87
87
|
return await this.invoke('encrypt', args)
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
async decrypt(args: { ciphertext: Byte[], protocolID: [
|
|
90
|
+
async decrypt(args: { ciphertext: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }): Promise<{ plaintext: Byte[] }> {
|
|
91
91
|
return await this.invoke('decrypt', args)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
async createHmac(args: { data: Byte[], protocolID: [
|
|
94
|
+
async createHmac(args: { data: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }): Promise<{ hmac: Byte[] }> {
|
|
95
95
|
return await this.invoke('createHmac', args)
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
async verifyHmac(args: { data: Byte[], hmac: Byte[], protocolID: [
|
|
98
|
+
async verifyHmac(args: { data: Byte[], hmac: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }): Promise<{ valid: true }> {
|
|
99
99
|
return await this.invoke('verifyHmac', args)
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
async createSignature(args: { data?: Byte[], hashToDirectlySign?: Byte[], protocolID: [
|
|
102
|
+
async createSignature(args: { data?: Byte[], hashToDirectlySign?: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }): Promise<{ signature: Byte[] }> {
|
|
103
103
|
return await this.invoke('createSignature', args)
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
async verifySignature(args: { data?: Byte[], hashToDirectlyVerify?: Byte[], signature: Byte[], protocolID: [
|
|
106
|
+
async verifySignature(args: { data?: Byte[], hashToDirectlyVerify?: Byte[], signature: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', forSelf?: BooleanDefaultFalse, privileged?: BooleanDefaultFalse }): Promise<{ valid: true }> {
|
|
107
107
|
return await this.invoke('verifySignature', args)
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Base64String, BasketStringUnder300Bytes, BEEF, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, EntityIconURLStringMax500Bytes, EntityNameStringMax100Bytes, HexString, ISOTimestampString, KeyIDStringUnder800Bytes, LabelStringUnder300Bytes, OriginatorDomainNameStringUnder250Bytes, OutpointString, OutputTagStringUnder300Bytes, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerMax10, PositiveIntegerOrZero, ProtocolString5To400Bytes, PubKeyHex, SatoshiValue, TXIDHexString, VersionString7To30Bytes, Wallet } from '../Wallet.interfaces.js'
|
|
1
|
+
import { Base64String, BasketStringUnder300Bytes, BEEF, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, EntityIconURLStringMax500Bytes, EntityNameStringMax100Bytes, HexString, ISOTimestampString, KeyIDStringUnder800Bytes, LabelStringUnder300Bytes, OriginatorDomainNameStringUnder250Bytes, OutpointString, OutputTagStringUnder300Bytes, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerMax10, PositiveIntegerOrZero, ProtocolString5To400Bytes, PubKeyHex, SatoshiValue, SecurityLevel, TXIDHexString, VersionString7To30Bytes, Wallet } from '../Wallet.interfaces.js'
|
|
2
2
|
|
|
3
3
|
declare const window: {
|
|
4
4
|
CWI?: Wallet
|
|
@@ -47,7 +47,7 @@ export default class WindowCWISubstrate implements Wallet {
|
|
|
47
47
|
return this.CWI.relinquishOutput(args, originator)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
async getPublicKey(args: { identityKey?: true, protocolID?: [
|
|
50
|
+
async getPublicKey(args: { identityKey?: true, protocolID?: [SecurityLevel, ProtocolString5To400Bytes], keyID?: KeyIDStringUnder800Bytes, privileged?: BooleanDefaultFalse, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', forSelf?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ publicKey: PubKeyHex }> {
|
|
51
51
|
return this.CWI.getPublicKey(args, originator)
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -55,31 +55,31 @@ export default class WindowCWISubstrate implements Wallet {
|
|
|
55
55
|
return this.CWI.revealCounterpartyKeyLinkage(args, originator)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
async revealSpecificKeyLinkage(args: { counterparty: PubKeyHex, verifier: PubKeyHex, protocolID: [
|
|
58
|
+
async revealSpecificKeyLinkage(args: { counterparty: PubKeyHex, verifier: PubKeyHex, protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ prover: PubKeyHex, verifier: PubKeyHex, counterparty: PubKeyHex, protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, encryptedLinkage: Byte[], encryptedLinkageProof: Byte[], proofType: Byte }> {
|
|
59
59
|
return this.CWI.revealSpecificKeyLinkage(args, originator)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
async encrypt(args: { plaintext: Byte[], protocolID: [
|
|
62
|
+
async encrypt(args: { plaintext: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ ciphertext: Byte[] }> {
|
|
63
63
|
return this.CWI.encrypt(args, originator)
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
async decrypt(args: { ciphertext: Byte[], protocolID: [
|
|
66
|
+
async decrypt(args: { ciphertext: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ plaintext: Byte[] }> {
|
|
67
67
|
return this.CWI.decrypt(args, originator)
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
async createHmac(args: { data: Byte[], protocolID: [
|
|
70
|
+
async createHmac(args: { data: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ hmac: Byte[] }> {
|
|
71
71
|
return this.CWI.createHmac(args, originator)
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
async verifyHmac(args: { data: Byte[], hmac: Byte[], protocolID: [
|
|
74
|
+
async verifyHmac(args: { data: Byte[], hmac: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ valid: true }> {
|
|
75
75
|
return this.CWI.verifyHmac(args, originator)
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
async createSignature(args: { data?: Byte[], hashToDirectlySign?: Byte[], protocolID: [
|
|
78
|
+
async createSignature(args: { data?: Byte[], hashToDirectlySign?: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ signature: Byte[] }> {
|
|
79
79
|
return this.CWI.createSignature(args, originator)
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
async verifySignature(args: { data?: Byte[], hashToDirectlyVerify?: Byte[], signature: Byte[], protocolID: [
|
|
82
|
+
async verifySignature(args: { data?: Byte[], hashToDirectlyVerify?: Byte[], signature: Byte[], protocolID: [SecurityLevel, ProtocolString5To400Bytes], keyID: KeyIDStringUnder800Bytes, privilegedReason?: DescriptionString5to50Bytes, counterparty?: PubKeyHex | 'self' | 'anyone', forSelf?: BooleanDefaultFalse, privileged?: BooleanDefaultFalse }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{ valid: true }> {
|
|
83
83
|
return this.CWI.verifySignature(args, originator)
|
|
84
84
|
}
|
|
85
85
|
|