@alephium/web3 2.0.0-rc.3 → 2.0.0
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/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/src/api/api-alephium.d.ts +19 -3
- package/dist/src/api/api-alephium.js +1 -1
- package/dist/src/utils/sign.js +1 -1
- package/package.json +2 -2
- package/src/api/api-alephium.ts +19 -2
- package/src/utils/sign.ts +1 -1
|
@@ -131,6 +131,7 @@ export interface BlockEntry {
|
|
|
131
131
|
/** @format hex-string */
|
|
132
132
|
target: string;
|
|
133
133
|
ghostUncles: GhostUncleBlockEntry[];
|
|
134
|
+
conflictedTxs?: string[];
|
|
134
135
|
}
|
|
135
136
|
/** BlockHeaderEntry */
|
|
136
137
|
export interface BlockHeaderEntry {
|
|
@@ -612,6 +613,20 @@ export interface Confirmed {
|
|
|
612
613
|
toGroupConfirmations: number;
|
|
613
614
|
type: string;
|
|
614
615
|
}
|
|
616
|
+
/** Conflicted */
|
|
617
|
+
export interface Conflicted {
|
|
618
|
+
/** @format block-hash */
|
|
619
|
+
blockHash: string;
|
|
620
|
+
/** @format int32 */
|
|
621
|
+
txIndex: number;
|
|
622
|
+
/** @format int32 */
|
|
623
|
+
chainConfirmations: number;
|
|
624
|
+
/** @format int32 */
|
|
625
|
+
fromGroupConfirmations: number;
|
|
626
|
+
/** @format int32 */
|
|
627
|
+
toGroupConfirmations: number;
|
|
628
|
+
type: string;
|
|
629
|
+
}
|
|
615
630
|
/** Constant */
|
|
616
631
|
export interface Constant {
|
|
617
632
|
name: string;
|
|
@@ -992,6 +1007,7 @@ export interface RichBlockEntry {
|
|
|
992
1007
|
/** @format hex-string */
|
|
993
1008
|
target: string;
|
|
994
1009
|
ghostUncles: GhostUncleBlockEntry[];
|
|
1010
|
+
conflictedTxs?: string[];
|
|
995
1011
|
}
|
|
996
1012
|
/** RichBlocksAndEventsPerTimeStampRange */
|
|
997
1013
|
export interface RichBlocksAndEventsPerTimeStampRange {
|
|
@@ -1241,7 +1257,7 @@ export interface TxNotFound {
|
|
|
1241
1257
|
type: string;
|
|
1242
1258
|
}
|
|
1243
1259
|
/** TxStatus */
|
|
1244
|
-
export type TxStatus = Confirmed | MemPooled | TxNotFound;
|
|
1260
|
+
export type TxStatus = Confirmed | Conflicted | MemPooled | TxNotFound;
|
|
1245
1261
|
/** UTXO */
|
|
1246
1262
|
export interface UTXO {
|
|
1247
1263
|
ref: OutputRef;
|
|
@@ -1427,7 +1443,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
1427
1443
|
}
|
|
1428
1444
|
/**
|
|
1429
1445
|
* @title Alephium API
|
|
1430
|
-
* @version 4.
|
|
1446
|
+
* @version 4.2.0
|
|
1431
1447
|
* @baseUrl ../
|
|
1432
1448
|
*/
|
|
1433
1449
|
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
@@ -2046,7 +2062,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2046
2062
|
fromGroup?: number;
|
|
2047
2063
|
/** @format int32 */
|
|
2048
2064
|
toGroup?: number;
|
|
2049
|
-
}, params?: RequestParams) => Promise<Confirmed | MemPooled | TxNotFound>;
|
|
2065
|
+
}, params?: RequestParams) => Promise<Confirmed | Conflicted | MemPooled | TxNotFound>;
|
|
2050
2066
|
/**
|
|
2051
2067
|
* No description
|
|
2052
2068
|
*
|
package/dist/src/utils/sign.js
CHANGED
|
@@ -59,7 +59,7 @@ necc.utils.hmacSha256Sync = (key, ...messages) => {
|
|
|
59
59
|
};
|
|
60
60
|
function checkKeyType(keyType) {
|
|
61
61
|
if (keyType !== 'default' && keyType !== 'bip340-schnorr' && keyType !== 'gl-secp256k1') {
|
|
62
|
-
throw new Error(`Invalid key type ${keyType}`);
|
|
62
|
+
throw new Error(`Invalid key type ${keyType}, only supports secp256k1 and schnorr for now`);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
// hash has to be 32 bytes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alephium/web3",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A JS/TS library to interact with the Alephium platform",
|
|
5
5
|
"license": "GPL",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"author": "Alephium dev <dev@alephium.org>",
|
|
35
35
|
"config": {
|
|
36
|
-
"alephium_version": "4.
|
|
36
|
+
"alephium_version": "4.2.0",
|
|
37
37
|
"explorer_backend_version": "2.3.2"
|
|
38
38
|
},
|
|
39
39
|
"type": "commonjs",
|
package/src/api/api-alephium.ts
CHANGED
|
@@ -155,6 +155,7 @@ export interface BlockEntry {
|
|
|
155
155
|
/** @format hex-string */
|
|
156
156
|
target: string
|
|
157
157
|
ghostUncles: GhostUncleBlockEntry[]
|
|
158
|
+
conflictedTxs?: string[]
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
/** BlockHeaderEntry */
|
|
@@ -686,6 +687,21 @@ export interface Confirmed {
|
|
|
686
687
|
type: string
|
|
687
688
|
}
|
|
688
689
|
|
|
690
|
+
/** Conflicted */
|
|
691
|
+
export interface Conflicted {
|
|
692
|
+
/** @format block-hash */
|
|
693
|
+
blockHash: string
|
|
694
|
+
/** @format int32 */
|
|
695
|
+
txIndex: number
|
|
696
|
+
/** @format int32 */
|
|
697
|
+
chainConfirmations: number
|
|
698
|
+
/** @format int32 */
|
|
699
|
+
fromGroupConfirmations: number
|
|
700
|
+
/** @format int32 */
|
|
701
|
+
toGroupConfirmations: number
|
|
702
|
+
type: string
|
|
703
|
+
}
|
|
704
|
+
|
|
689
705
|
/** Constant */
|
|
690
706
|
export interface Constant {
|
|
691
707
|
name: string
|
|
@@ -1121,6 +1137,7 @@ export interface RichBlockEntry {
|
|
|
1121
1137
|
/** @format hex-string */
|
|
1122
1138
|
target: string
|
|
1123
1139
|
ghostUncles: GhostUncleBlockEntry[]
|
|
1140
|
+
conflictedTxs?: string[]
|
|
1124
1141
|
}
|
|
1125
1142
|
|
|
1126
1143
|
/** RichBlocksAndEventsPerTimeStampRange */
|
|
@@ -1400,7 +1417,7 @@ export interface TxNotFound {
|
|
|
1400
1417
|
}
|
|
1401
1418
|
|
|
1402
1419
|
/** TxStatus */
|
|
1403
|
-
export type TxStatus = Confirmed | MemPooled | TxNotFound
|
|
1420
|
+
export type TxStatus = Confirmed | Conflicted | MemPooled | TxNotFound
|
|
1404
1421
|
|
|
1405
1422
|
/** UTXO */
|
|
1406
1423
|
export interface UTXO {
|
|
@@ -1760,7 +1777,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
1760
1777
|
|
|
1761
1778
|
/**
|
|
1762
1779
|
* @title Alephium API
|
|
1763
|
-
* @version 4.
|
|
1780
|
+
* @version 4.2.0
|
|
1764
1781
|
* @baseUrl ../
|
|
1765
1782
|
*/
|
|
1766
1783
|
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
package/src/utils/sign.ts
CHANGED
|
@@ -38,7 +38,7 @@ necc.utils.hmacSha256Sync = (key: Uint8Array, ...messages: Uint8Array[]): Uint8A
|
|
|
38
38
|
|
|
39
39
|
function checkKeyType(keyType: KeyType) {
|
|
40
40
|
if (keyType !== 'default' && keyType !== 'bip340-schnorr' && keyType !== 'gl-secp256k1') {
|
|
41
|
-
throw new Error(`Invalid key type ${keyType}`)
|
|
41
|
+
throw new Error(`Invalid key type ${keyType}, only supports secp256k1 and schnorr for now`)
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|