turing-wallet-provider 1.0.10 → 1.0.11
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/types/providerTypes.d.ts +10 -205
- package/package.json +1 -1
|
@@ -1,98 +1,24 @@
|
|
|
1
1
|
export type PubKey = {
|
|
2
2
|
tbcPubKey: string;
|
|
3
|
-
// ordPubKey: string;
|
|
4
|
-
// identityPubKey: string;
|
|
5
3
|
};
|
|
4
|
+
|
|
6
5
|
export type Address = {
|
|
7
6
|
tbcAddress: string;
|
|
8
|
-
// ordAddress: string;
|
|
9
|
-
// identityAddress: string;
|
|
10
7
|
};
|
|
8
|
+
|
|
11
9
|
export type Balance = {
|
|
12
10
|
tbc: number;
|
|
13
|
-
// satoshis: number;
|
|
14
|
-
// usdInCents: number;
|
|
15
|
-
};
|
|
16
|
-
export type SocialProfile = {
|
|
17
|
-
displayName: string;
|
|
18
|
-
avatar: string;
|
|
19
|
-
};
|
|
20
|
-
export type OrdinalData = {
|
|
21
|
-
types?: string[];
|
|
22
|
-
insc?: Inscription;
|
|
23
|
-
map?: {
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
};
|
|
26
|
-
b?: File;
|
|
27
|
-
sigma?: Sigma[];
|
|
28
|
-
list?: Listing;
|
|
29
|
-
tbc20?: Tbc20;
|
|
30
|
-
lock?: Lock;
|
|
31
|
-
};
|
|
32
|
-
export type Lock = {
|
|
33
|
-
address: string;
|
|
34
|
-
until: number;
|
|
35
|
-
};
|
|
36
|
-
export type Sigma = {
|
|
37
|
-
algorithm: string;
|
|
38
|
-
address: string;
|
|
39
|
-
signature: string;
|
|
40
|
-
vin: number;
|
|
41
|
-
};
|
|
42
|
-
export type Listing = {
|
|
43
|
-
price: number;
|
|
44
|
-
payout: string;
|
|
45
|
-
};
|
|
46
|
-
export type Tbc20 = {
|
|
47
|
-
id?: string;
|
|
48
|
-
p: string;
|
|
49
|
-
op: string;
|
|
50
|
-
tick?: string;
|
|
51
|
-
amt: string;
|
|
52
|
-
status?: Tbc20Status;
|
|
53
|
-
};
|
|
54
|
-
export type Origin = {
|
|
55
|
-
outpoint: string;
|
|
56
|
-
data?: OrdinalData;
|
|
57
|
-
num?: number;
|
|
58
|
-
};
|
|
59
|
-
export declare enum Tbc20Status {
|
|
60
|
-
Invalid = -1,
|
|
61
|
-
Pending = 0,
|
|
62
|
-
Valid = 1
|
|
63
|
-
}
|
|
64
|
-
export type File = {
|
|
65
|
-
type: string;
|
|
66
|
-
size: number;
|
|
67
|
-
hash: string;
|
|
68
|
-
};
|
|
69
|
-
export type Inscription = {
|
|
70
|
-
json?: any;
|
|
71
|
-
text?: string;
|
|
72
|
-
words?: string[];
|
|
73
|
-
file: File;
|
|
74
|
-
};
|
|
75
|
-
export type Ordinal = {
|
|
76
|
-
txid: string;
|
|
77
|
-
vout: number;
|
|
78
|
-
outpoint: string;
|
|
79
|
-
satoshis: number;
|
|
80
|
-
owner: string;
|
|
81
|
-
script: string;
|
|
82
|
-
spend: string;
|
|
83
|
-
origin: Origin;
|
|
84
|
-
height: number;
|
|
85
|
-
idx: number;
|
|
86
|
-
data: OrdinalData;
|
|
87
11
|
};
|
|
12
|
+
|
|
88
13
|
export type SignedMessage = {
|
|
89
14
|
address: string;
|
|
90
15
|
pubKey: string;
|
|
91
16
|
sig: string;
|
|
92
17
|
message: string;
|
|
93
|
-
derivationTag: DerivationTag;
|
|
94
18
|
};
|
|
19
|
+
|
|
95
20
|
export type TransactionFlag = "P2PKH" | "COLLECTION_CREATE" | "NFT_CREATE" | "NFT_TRANSFER" | "FT_MINT" | "FT_TRANSFER" | "POOLNFT_MINT" | "POOLNFT_INIT" | "POOLNFT_LP_INCREASE" | "POOLNFT_LP_CONSUME" | "POOLNFT_SWAP_TO_TOKEN" | "POOLNFT_SWAP_TO_TBC" | "POOLNFT_MERGE" | "FTLP_MERGE";
|
|
21
|
+
|
|
96
22
|
export type SendTransaction = {
|
|
97
23
|
flag: TransactionFlag;
|
|
98
24
|
satoshis?: number;
|
|
@@ -107,135 +33,24 @@ export type SendTransaction = {
|
|
|
107
33
|
ft_amount?: number;
|
|
108
34
|
merge_times?: number;
|
|
109
35
|
};
|
|
110
|
-
|
|
111
|
-
address: string;
|
|
112
|
-
origin: string;
|
|
113
|
-
outpoint: string;
|
|
114
|
-
};
|
|
115
|
-
export type InternalTuringTags = {
|
|
116
|
-
label: "Turing";
|
|
117
|
-
id: "tbc";
|
|
118
|
-
domain: "";
|
|
119
|
-
meta: {};
|
|
120
|
-
} | {
|
|
121
|
-
label: "Turing";
|
|
122
|
-
id: "ord";
|
|
123
|
-
domain: "";
|
|
124
|
-
meta: {};
|
|
125
|
-
} | {
|
|
126
|
-
label: "Turing";
|
|
127
|
-
id: "identity";
|
|
128
|
-
domain: "";
|
|
129
|
-
meta: {};
|
|
130
|
-
};
|
|
131
|
-
export type DerivationTag = InternalTuringTags | {
|
|
132
|
-
label: string;
|
|
133
|
-
id: string;
|
|
134
|
-
domain: string;
|
|
135
|
-
meta?: Record<string, any>;
|
|
136
|
-
};
|
|
36
|
+
|
|
137
37
|
export type SignMessage = {
|
|
138
38
|
message: string;
|
|
139
39
|
encoding?: "utf8" | "hex" | "base64";
|
|
140
40
|
};
|
|
141
|
-
|
|
142
|
-
export type Broadcast = {
|
|
143
|
-
rawtx: string;
|
|
144
|
-
fund?: boolean;
|
|
145
|
-
};
|
|
146
|
-
export type PurchaseOrdinal = {
|
|
147
|
-
outpoint: string;
|
|
148
|
-
marketplaceRate?: number;
|
|
149
|
-
marketplaceAddress?: string;
|
|
150
|
-
};
|
|
41
|
+
|
|
151
42
|
export type Utxos = {
|
|
152
43
|
satoshis: number;
|
|
153
44
|
script: string;
|
|
154
45
|
txid: string;
|
|
155
46
|
vout: number;
|
|
156
47
|
};
|
|
157
|
-
|
|
158
|
-
* `SignatureRequest` contains required informations for a signer to sign a certain input of a transaction.
|
|
159
|
-
*/
|
|
160
|
-
export type SignatureRequest = {
|
|
161
|
-
prevTxid: string;
|
|
162
|
-
outputIndex: number;
|
|
163
|
-
/** The index of input to sign. */
|
|
164
|
-
inputIndex: number;
|
|
165
|
-
/** The previous output satoshis value of the input to spend. */
|
|
166
|
-
satoshis: number;
|
|
167
|
-
/** The address(es) of corresponding private key(s) required to sign the input. */
|
|
168
|
-
address: string | string[];
|
|
169
|
-
/** The previous output script of input, default value is a P2PKH locking script for the `address` if omitted. */
|
|
170
|
-
script?: string;
|
|
171
|
-
/** The sighash type, default value is `SIGHASH_ALL | SIGHASH_FORKID` if omitted. */
|
|
172
|
-
sigHashType?: number;
|
|
173
|
-
/**
|
|
174
|
-
* Index of the OP_CODESEPARATOR to split the previous output script at during verification.
|
|
175
|
-
* If undefined, the whole script is used.
|
|
176
|
-
* */
|
|
177
|
-
csIdx?: number;
|
|
178
|
-
/** The flag to distinguish the transaction.*/
|
|
179
|
-
flag: TransactionFlag;
|
|
180
|
-
};
|
|
181
|
-
/**
|
|
182
|
-
* `SignatureResponse` contains the signing result corresponding to a `SignatureRequest`.
|
|
183
|
-
*/
|
|
184
|
-
export type SignatureResponse = {
|
|
185
|
-
/** The index of input. */
|
|
186
|
-
inputIndex: number;
|
|
187
|
-
/** The signature.*/
|
|
188
|
-
sig: string;
|
|
189
|
-
/** The public key bound with the `sig`. */
|
|
190
|
-
pubKey: string;
|
|
191
|
-
/** The sighash type, default value is `SIGHASH_ALL | SIGHASH_FORKID` if omitted. */
|
|
192
|
-
sigHashType: number;
|
|
193
|
-
/** The index of the OP_CODESEPARATOR to split the previous output script at.*/
|
|
194
|
-
csIdx?: number;
|
|
195
|
-
};
|
|
196
|
-
/**
|
|
197
|
-
* `SendTbcResponse` contains the result of sendTbc.
|
|
198
|
-
*/
|
|
48
|
+
|
|
199
49
|
export type SendTransactionResponse = {
|
|
200
50
|
txid: string;
|
|
201
51
|
rawtx: string;
|
|
202
52
|
};
|
|
203
|
-
|
|
204
|
-
rawtx: string;
|
|
205
|
-
sigRequests: SignatureRequest[];
|
|
206
|
-
};
|
|
207
|
-
export type TaggedDerivationRequest = {
|
|
208
|
-
label: string;
|
|
209
|
-
id: string;
|
|
210
|
-
meta?: Record<string, any>;
|
|
211
|
-
};
|
|
212
|
-
export type TaggedDerivationResponse = {
|
|
213
|
-
address: string;
|
|
214
|
-
pubKey: string;
|
|
215
|
-
tag: DerivationTag;
|
|
216
|
-
};
|
|
217
|
-
export type MimeTypes = "text/plain" | "text/html" | "text/css" | "application/javascript" | "application/json" | "application/xml" | "image/jpeg" | "image/png" | "image/gif" | "image/svg+xml" | "audio/mpeg" | "audio/wav" | "audio/wave" | "video/mp4" | "application/pdf" | "application/msword" | "application/vnd.ms-excel" | "application/vnd.ms-powerpoint" | "application/zip" | "application/x-7z-compressed" | "application/x-gzip" | "application/x-tar" | "application/x-bzip2";
|
|
218
|
-
export type MAP = {
|
|
219
|
-
app: string;
|
|
220
|
-
type: string;
|
|
221
|
-
[prop: string]: string;
|
|
222
|
-
};
|
|
223
|
-
export type RawInscription = {
|
|
224
|
-
base64Data: string;
|
|
225
|
-
mimeType: MimeTypes;
|
|
226
|
-
map?: MAP;
|
|
227
|
-
};
|
|
228
|
-
export type InscribeRequest = {
|
|
229
|
-
address: string;
|
|
230
|
-
base64Data: string;
|
|
231
|
-
mimeType: MimeTypes;
|
|
232
|
-
map?: MAP;
|
|
233
|
-
satoshis?: number;
|
|
234
|
-
};
|
|
235
|
-
export type GetTaggedKeysRequest = {
|
|
236
|
-
label: string;
|
|
237
|
-
ids?: string[];
|
|
238
|
-
};
|
|
53
|
+
|
|
239
54
|
export type TuringProviderType = {
|
|
240
55
|
isReady: boolean;
|
|
241
56
|
connect: () => Promise<string | undefined>;
|
|
@@ -243,18 +58,8 @@ export type TuringProviderType = {
|
|
|
243
58
|
isConnected: () => Promise<boolean>;
|
|
244
59
|
getPubKey: () => Promise<PubKey | undefined>;
|
|
245
60
|
getAddress: () => Promise<Address | undefined>;
|
|
246
|
-
// getSocialProfile: () => Promise<SocialProfile | undefined>;
|
|
247
61
|
getBalance: () => Promise<Balance | undefined>;
|
|
248
|
-
// getOrdinals: () => Promise<Ordinal[] | undefined>;
|
|
249
62
|
sendTransaction: (params: SendTransaction[]) => Promise<SendTransactionResponse | undefined>;
|
|
250
|
-
// transferOrdinal: (params: TransferOrdinal) => Promise<string | undefined>;
|
|
251
|
-
// purchaseOrdinal: (params: PurchaseOrdinal) => Promise<string | undefined>;
|
|
252
63
|
signMessage: (params: SignMessage) => Promise<SignedMessage | undefined>;
|
|
253
|
-
// getSignatures: (params: GetSignatures) => Promise<SignatureResponse[] | undefined>;
|
|
254
|
-
broadcast: (params: Broadcast) => Promise<string | undefined>;
|
|
255
|
-
// getExchangeRate: () => Promise<number | undefined>;
|
|
256
64
|
getPaymentUtxos: () => Promise<Utxos[] | undefined>;
|
|
257
|
-
|
|
258
|
-
// getTaggedKeys: (params: GetTaggedKeysRequest) => Promise<TaggedDerivationResponse[] | undefined>;
|
|
259
|
-
// inscribe: (params: InscribeRequest[]) => Promise<SendTbcResponse | undefined>;
|
|
260
|
-
};
|
|
65
|
+
}
|