@atomiqlabs/chain-starknet 4.0.0-dev.16 → 4.0.0-dev.18
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.
|
@@ -12,6 +12,8 @@ class Rpc08ChannelWithRetries extends starknet_1.RPC08.RpcChannel {
|
|
|
12
12
|
return (0, Utils_1.tryWithRetries)(() => super.fetchEndpoint(method, params), this.retryPolicy, e => {
|
|
13
13
|
if (!e.message.startsWith("RPC: "))
|
|
14
14
|
return false;
|
|
15
|
+
if (e.message.includes("Unsupported method"))
|
|
16
|
+
return true;
|
|
15
17
|
const arr = e.message.split("\n");
|
|
16
18
|
const errorCode = parseInt(arr[arr.length - 1]);
|
|
17
19
|
if (isNaN(errorCode))
|
|
@@ -32,6 +34,8 @@ class Rpc09ChannelWithRetries extends starknet_1.RPC09.RpcChannel {
|
|
|
32
34
|
return (0, Utils_1.tryWithRetries)(() => super.fetchEndpoint(method, params), this.retryPolicy, e => {
|
|
33
35
|
if (!e.message.startsWith("RPC: "))
|
|
34
36
|
return false;
|
|
37
|
+
if (e.message.includes("Unsupported method"))
|
|
38
|
+
return true;
|
|
35
39
|
const arr = e.message.split("\n");
|
|
36
40
|
const errorCode = parseInt(arr[arr.length - 1]);
|
|
37
41
|
if (isNaN(errorCode))
|
|
@@ -57,7 +57,7 @@ class StarknetSpvWithdrawalData extends base_1.SpvWithdrawalTransactionData {
|
|
|
57
57
|
];
|
|
58
58
|
}
|
|
59
59
|
getFrontingId() {
|
|
60
|
-
const txHashU256 = starknet_1.cairo.uint256(base_1.BigIntBufferUtils.fromBuffer(buffer_1.Buffer.from(this.btcTx.txid), "le"));
|
|
60
|
+
const txHashU256 = starknet_1.cairo.uint256(base_1.BigIntBufferUtils.fromBuffer(buffer_1.Buffer.from(this.btcTx.txid, "hex"), "le"));
|
|
61
61
|
let frontingId = starknet_1.hash.computePoseidonHashOnElements([
|
|
62
62
|
txHashU256.low,
|
|
63
63
|
txHashU256.high,
|
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@ export class Rpc08ChannelWithRetries extends RPC08.RpcChannel {
|
|
|
21
21
|
protected fetchEndpoint(method: any, params?: any): Promise<any> {
|
|
22
22
|
return tryWithRetries(() => super.fetchEndpoint(method, params), this.retryPolicy, e => {
|
|
23
23
|
if(!e.message.startsWith("RPC: ")) return false;
|
|
24
|
+
if(e.message.includes("Unsupported method")) return true;
|
|
24
25
|
const arr = e.message.split("\n");
|
|
25
26
|
const errorCode = parseInt(arr[arr.length-1]);
|
|
26
27
|
if(isNaN(errorCode)) return false;
|
|
@@ -47,6 +48,7 @@ export class Rpc09ChannelWithRetries extends RPC09.RpcChannel {
|
|
|
47
48
|
protected fetchEndpoint(method: any, params?: any): Promise<any> {
|
|
48
49
|
return tryWithRetries(() => super.fetchEndpoint(method, params), this.retryPolicy, e => {
|
|
49
50
|
if(!e.message.startsWith("RPC: ")) return false;
|
|
51
|
+
if(e.message.includes("Unsupported method")) return true;
|
|
50
52
|
const arr = e.message.split("\n");
|
|
51
53
|
const errorCode = parseInt(arr[arr.length-1]);
|
|
52
54
|
if(isNaN(errorCode)) return false;
|
|
@@ -64,7 +64,7 @@ export class StarknetSpvWithdrawalData extends SpvWithdrawalTransactionData {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
getFrontingId(): string {
|
|
67
|
-
const txHashU256 = cairo.uint256(BigIntBufferUtils.fromBuffer(Buffer.from(this.btcTx.txid), "le"));
|
|
67
|
+
const txHashU256 = cairo.uint256(BigIntBufferUtils.fromBuffer(Buffer.from(this.btcTx.txid, "hex"), "le"));
|
|
68
68
|
let frontingId = hash.computePoseidonHashOnElements([
|
|
69
69
|
txHashU256.low,
|
|
70
70
|
txHashU256.high,
|