starknet 3.18.0 → 3.19.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/CHANGELOG.md +65 -0
- package/README.md +1 -0
- package/__mocks__/typedDataStructArrayExample.json +44 -0
- package/__tests__/account.test.ts +11 -56
- package/__tests__/contract.test.ts +11 -49
- package/__tests__/defaultProvider.test.ts +321 -0
- package/__tests__/fixtures.ts +32 -11
- package/__tests__/rpcProvider.test.ts +17 -0
- package/__tests__/sequencerProvider.test.ts +45 -0
- package/__tests__/utils/typedData.test.ts +24 -0
- package/account/default.d.ts +54 -77
- package/account/default.js +271 -596
- package/account/index.js +18 -31
- package/account/interface.d.ts +66 -95
- package/account/interface.js +20 -30
- package/constants.d.ts +17 -19
- package/constants.js +2038 -2059
- package/contract/contractFactory.d.ts +25 -29
- package/contract/contractFactory.js +94 -210
- package/contract/default.d.ts +117 -146
- package/contract/default.js +582 -776
- package/contract/index.js +19 -32
- package/contract/interface.d.ts +72 -92
- package/contract/interface.js +6 -5
- package/dist/account/default.d.ts +5 -9
- package/dist/account/default.js +35 -169
- package/dist/account/interface.d.ts +3 -15
- package/dist/contract/contractFactory.js +4 -4
- package/dist/contract/default.d.ts +3 -3
- package/dist/contract/default.js +3 -2
- package/dist/contract/interface.d.ts +2 -2
- package/dist/provider/default.d.ts +18 -134
- package/dist/provider/default.js +47 -410
- package/dist/provider/index.d.ts +2 -0
- package/dist/provider/index.js +2 -0
- package/dist/provider/interface.d.ts +45 -50
- package/dist/provider/rpc.d.ts +57 -0
- package/dist/provider/rpc.js +364 -0
- package/dist/provider/sequencer.d.ts +66 -0
- package/dist/provider/sequencer.js +443 -0
- package/dist/types/account.d.ts +2 -3
- package/dist/types/api/index.d.ts +16 -0
- package/dist/types/api/index.js +18 -0
- package/dist/types/api/rpc.d.ts +221 -0
- package/dist/types/{api.js → api/rpc.js} +0 -0
- package/dist/types/api/sequencer.d.ts +289 -0
- package/dist/types/api/sequencer.js +2 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.js +15 -1
- package/dist/types/lib.d.ts +3 -1
- package/dist/types/provider.d.ts +86 -0
- package/dist/types/provider.js +2 -0
- package/dist/utils/provider.d.ts +4 -0
- package/dist/utils/provider.js +38 -0
- package/dist/utils/responseParser/index.d.ts +11 -0
- package/dist/utils/responseParser/index.js +9 -0
- package/dist/utils/responseParser/rpc.d.ts +13 -0
- package/dist/utils/responseParser/rpc.js +96 -0
- package/dist/utils/responseParser/sequencer.d.ts +13 -0
- package/dist/utils/responseParser/sequencer.js +124 -0
- package/dist/utils/typedData/index.js +14 -0
- package/index.js +42 -75
- package/package.json +1 -1
- package/provider/default.d.ts +21 -175
- package/provider/default.js +139 -703
- package/provider/errors.d.ts +4 -4
- package/provider/errors.js +30 -40
- package/provider/index.d.ts +2 -0
- package/provider/index.js +22 -33
- package/provider/interface.d.ts +104 -131
- package/provider/interface.js +6 -5
- package/provider/rpc.d.ts +57 -0
- package/provider/rpc.js +364 -0
- package/provider/sequencer.d.ts +66 -0
- package/provider/sequencer.js +443 -0
- package/provider/utils.d.ts +7 -9
- package/provider/utils.js +39 -44
- package/signer/default.d.ts +5 -9
- package/signer/default.js +72 -177
- package/signer/index.js +18 -31
- package/signer/interface.d.ts +29 -33
- package/signer/interface.js +6 -5
- package/src/account/default.ts +26 -146
- package/src/account/interface.ts +5 -20
- package/src/contract/contractFactory.ts +3 -6
- package/src/contract/default.ts +6 -4
- package/src/contract/interface.ts +2 -2
- package/src/provider/default.ts +63 -394
- package/src/provider/index.ts +2 -0
- package/src/provider/interface.ts +68 -63
- package/src/provider/rpc.ts +300 -0
- package/src/provider/sequencer.ts +384 -0
- package/src/types/account.ts +2 -3
- package/src/types/api/index.ts +17 -0
- package/src/types/api/rpc.ts +247 -0
- package/src/types/api/sequencer.ts +331 -0
- package/src/types/index.ts +3 -1
- package/src/types/lib.ts +3 -1
- package/src/types/provider.ts +108 -0
- package/src/utils/provider.ts +28 -0
- package/src/utils/responseParser/index.ts +28 -0
- package/src/utils/responseParser/rpc.ts +93 -0
- package/src/utils/responseParser/sequencer.ts +127 -0
- package/src/utils/typedData/index.ts +18 -0
- package/types/account.d.ts +5 -7
- package/types/account.js +2 -2
- package/types/api/index.d.ts +16 -0
- package/types/api/index.js +18 -0
- package/types/api/rpc.d.ts +221 -0
- package/types/api/rpc.js +2 -0
- package/types/api/sequencer.d.ts +289 -0
- package/types/api/sequencer.js +2 -0
- package/types/contract.d.ts +1 -1
- package/types/contract.js +2 -2
- package/types/index.d.ts +3 -1
- package/types/index.js +35 -34
- package/types/lib.d.ts +36 -41
- package/types/lib.js +2 -2
- package/types/provider.d.ts +86 -0
- package/types/provider.js +2 -0
- package/types/signer.d.ts +2 -2
- package/types/signer.js +2 -2
- package/utils/address.js +26 -37
- package/utils/ellipticCurve.d.ts +1 -6
- package/utils/ellipticCurve.js +73 -137
- package/utils/encode.js +49 -85
- package/utils/hash.d.ts +4 -31
- package/utils/hash.js +76 -141
- package/utils/json.d.ts +13 -45
- package/utils/json.js +15 -22
- package/utils/number.d.ts +2 -9
- package/utils/number.js +47 -81
- package/utils/provider.d.ts +4 -0
- package/utils/provider.js +38 -0
- package/utils/responseParser/index.d.ts +11 -0
- package/utils/responseParser/index.js +9 -0
- package/utils/responseParser/rpc.d.ts +13 -0
- package/utils/responseParser/rpc.js +96 -0
- package/utils/responseParser/sequencer.d.ts +13 -0
- package/utils/responseParser/sequencer.js +124 -0
- package/utils/shortString.js +13 -21
- package/utils/stark.d.ts +0 -1
- package/utils/stark.js +59 -93
- package/utils/transaction.d.ts +3 -6
- package/utils/transaction.js +50 -81
- package/utils/typedData/index.d.ts +3 -15
- package/utils/typedData/index.js +109 -157
- package/utils/typedData/types.d.ts +9 -9
- package/utils/typedData/types.js +2 -2
- package/utils/typedData/utils.js +6 -6
- package/utils/uint256.d.ts +5 -5
- package/utils/uint256.js +16 -26
- package/www/docs/API/account.md +3 -4
- package/www/docs/API/contract.md +2 -2
- package/www/docs/API/contractFactory.md +2 -2
- package/www/docs/API/provider.md +185 -74
- package/www/guides/account.md +1 -8
- package/www/guides/erc20.md +3 -0
- package/__tests__/provider.test.ts +0 -168
- package/dist/types/api.d.ts +0 -261
- package/src/types/api.ts +0 -303
- package/types/api.d.ts +0 -287
- package/types/api.js +0 -2
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CallContractResponse,
|
|
3
|
+
DeclareContractResponse,
|
|
4
|
+
DeployContractResponse,
|
|
5
|
+
EstimateFeeResponse,
|
|
6
|
+
GetBlockResponse,
|
|
7
|
+
GetTransactionReceiptResponse,
|
|
8
|
+
GetTransactionResponse,
|
|
9
|
+
InvokeFunctionResponse,
|
|
10
|
+
} from '../../types';
|
|
11
|
+
import { Sequencer } from '../../types/api';
|
|
12
|
+
import { toBN } from '../number';
|
|
13
|
+
import { ResponseParser } from '.';
|
|
14
|
+
|
|
15
|
+
export class SequencerAPIResponseParser extends ResponseParser {
|
|
16
|
+
public parseGetBlockResponse(res: Sequencer.GetBlockResponse): GetBlockResponse {
|
|
17
|
+
return {
|
|
18
|
+
accepted_time: res.timestamp,
|
|
19
|
+
block_hash: res.block_hash,
|
|
20
|
+
block_number: res.block_number,
|
|
21
|
+
gas_price: res.gas_price,
|
|
22
|
+
new_root: res.state_root,
|
|
23
|
+
old_root: undefined,
|
|
24
|
+
parent_hash: res.parent_block_hash,
|
|
25
|
+
sequencer: res.sequencer_address,
|
|
26
|
+
status: res.status,
|
|
27
|
+
transactions: Object.values(res.transactions)
|
|
28
|
+
.map((value) => 'transaction_hash' in value && value.transaction_hash)
|
|
29
|
+
.filter(Boolean) as Array<string>,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public parseGetTransactionResponse(
|
|
34
|
+
res: Sequencer.GetTransactionResponse
|
|
35
|
+
): GetTransactionResponse {
|
|
36
|
+
return {
|
|
37
|
+
calldata: 'calldata' in res.transaction ? (res.transaction.calldata as Array<string>) : [],
|
|
38
|
+
contract_address:
|
|
39
|
+
'contract_address' in res.transaction ? res.transaction.contract_address : undefined,
|
|
40
|
+
contract_class:
|
|
41
|
+
'contract_class' in res.transaction ? (res.transaction.contract_class as any) : undefined,
|
|
42
|
+
entry_point_selector:
|
|
43
|
+
'entry_point_selector' in res.transaction
|
|
44
|
+
? res.transaction.entry_point_selector
|
|
45
|
+
: undefined,
|
|
46
|
+
max_fee: 'max_fee' in res.transaction ? (res.transaction.max_fee as string) : undefined,
|
|
47
|
+
nonce: res.transaction.nonce as string,
|
|
48
|
+
sender_address:
|
|
49
|
+
'sender_address' in res.transaction
|
|
50
|
+
? (res.transaction.sender_address as string)
|
|
51
|
+
: undefined,
|
|
52
|
+
signature: 'signature' in res.transaction ? res.transaction.signature : undefined,
|
|
53
|
+
transaction_hash:
|
|
54
|
+
'transaction_hash' in res.transaction ? res.transaction.transaction_hash : undefined,
|
|
55
|
+
version: 'version' in res.transaction ? (res.transaction.version as string) : undefined,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public parseGetTransactionReceiptResponse(
|
|
60
|
+
res: Sequencer.TransactionReceiptResponse
|
|
61
|
+
): GetTransactionReceiptResponse {
|
|
62
|
+
return {
|
|
63
|
+
transaction_hash: res.transaction_hash,
|
|
64
|
+
actual_fee: 'actual_fee' in res ? res.actual_fee : undefined,
|
|
65
|
+
status: res.status,
|
|
66
|
+
status_data: undefined,
|
|
67
|
+
messages_sent: res.l2_to_l1_messages as any, // TODO: parse
|
|
68
|
+
events: res.events as any,
|
|
69
|
+
l1_origin_message: undefined,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public parseFeeEstimateResponse(res: Sequencer.EstimateFeeResponse): EstimateFeeResponse {
|
|
74
|
+
if ('overall_fee' in res) {
|
|
75
|
+
let gasInfo = {};
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
gasInfo = {
|
|
79
|
+
gas_consumed: toBN(res.gas_usage),
|
|
80
|
+
gas_price: toBN(res.gas_price),
|
|
81
|
+
};
|
|
82
|
+
} catch {
|
|
83
|
+
// do nothing
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
overall_fee: toBN(res.overall_fee),
|
|
88
|
+
...gasInfo,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
overall_fee: toBN(res.amount),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public parseCallContractResponse(res: Sequencer.CallContractResponse): CallContractResponse {
|
|
97
|
+
return {
|
|
98
|
+
result: res.result,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public parseInvokeFunctionResponse(
|
|
103
|
+
res: Sequencer.AddTransactionResponse
|
|
104
|
+
): InvokeFunctionResponse {
|
|
105
|
+
return {
|
|
106
|
+
transaction_hash: res.transaction_hash,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
public parseDeployContractResponse(
|
|
111
|
+
res: Sequencer.AddTransactionResponse
|
|
112
|
+
): DeployContractResponse {
|
|
113
|
+
return {
|
|
114
|
+
transaction_hash: res.transaction_hash,
|
|
115
|
+
contract_address: res.address as string,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public parseDeclareContractResponse(
|
|
120
|
+
res: Sequencer.AddTransactionResponse
|
|
121
|
+
): DeclareContractResponse {
|
|
122
|
+
return {
|
|
123
|
+
transaction_hash: res.transaction_hash,
|
|
124
|
+
class_hash: res.class_hash as string,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -36,6 +36,12 @@ export const getDependencies = (
|
|
|
36
36
|
throw new Error('Typed data does not match JSON schema');
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
// Include pointers (struct arrays)
|
|
40
|
+
if (type[type.length - 1] === '*') {
|
|
41
|
+
// eslint-disable-next-line no-param-reassign
|
|
42
|
+
type = type.slice(0, -1);
|
|
43
|
+
}
|
|
44
|
+
|
|
39
45
|
if (dependencies.includes(type)) {
|
|
40
46
|
return dependencies;
|
|
41
47
|
}
|
|
@@ -102,6 +108,18 @@ const encodeValue = (typedData: TypedData, type: string, data: unknown): [string
|
|
|
102
108
|
return [type, getStructHash(typedData, type, data as Record<string, unknown>)];
|
|
103
109
|
}
|
|
104
110
|
|
|
111
|
+
if (
|
|
112
|
+
Object.keys(typedData.types)
|
|
113
|
+
.map((x) => `${x}*`)
|
|
114
|
+
.includes(type)
|
|
115
|
+
) {
|
|
116
|
+
const structHashes: string[] = (data as unknown[]).map((struct) => {
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
118
|
+
return getStructHash(typedData, type.slice(0, -1), struct as Record<string, unknown>);
|
|
119
|
+
});
|
|
120
|
+
return [type, computeHashOnElements(structHashes)];
|
|
121
|
+
}
|
|
122
|
+
|
|
105
123
|
if (type === 'felt*') {
|
|
106
124
|
return ['felt*', computeHashOnElements(data as string[])];
|
|
107
125
|
}
|
package/types/account.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import BN from 'bn.js';
|
|
2
|
-
|
|
3
2
|
import { BlockIdentifier } from '../provider/utils';
|
|
4
3
|
import { BigNumberish } from '../utils/number';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
suggestedMaxFee: BN;
|
|
4
|
+
import { EstimateFeeResponse } from './provider';
|
|
5
|
+
export interface EstimateFee extends EstimateFeeResponse {
|
|
6
|
+
suggestedMaxFee: BN;
|
|
9
7
|
}
|
|
10
8
|
export interface EstimateFeeDetails {
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
nonce?: BigNumberish;
|
|
10
|
+
blockIdentifier?: BlockIdentifier;
|
|
13
11
|
}
|
package/types/account.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BigNumberish } from '../../utils/number';
|
|
2
|
+
import { Signature } from '../lib';
|
|
3
|
+
export declare type RawArgs = {
|
|
4
|
+
[inputName: string]: string | string[] | {
|
|
5
|
+
type: 'struct';
|
|
6
|
+
[k: string]: BigNumberish;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare type Calldata = string[];
|
|
10
|
+
export declare type Overrides = {
|
|
11
|
+
maxFee?: BigNumberish;
|
|
12
|
+
nonce?: BigNumberish;
|
|
13
|
+
signature?: Signature;
|
|
14
|
+
};
|
|
15
|
+
export * from './sequencer';
|
|
16
|
+
export * from './rpc';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./sequencer"), exports);
|
|
18
|
+
__exportStar(require("./rpc"), exports);
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { StarknetChainId } from '../../constants';
|
|
2
|
+
import { Status } from '../lib';
|
|
3
|
+
export declare namespace RPC {
|
|
4
|
+
export type Response = {
|
|
5
|
+
id: number;
|
|
6
|
+
result: any;
|
|
7
|
+
jsonrpc: string;
|
|
8
|
+
error?: {
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type AddTransactionResponse = {
|
|
14
|
+
transaction_hash: string;
|
|
15
|
+
};
|
|
16
|
+
export type GetClassResponse = {
|
|
17
|
+
program: string;
|
|
18
|
+
entry_point_by_type: any;
|
|
19
|
+
};
|
|
20
|
+
export type DeclareResponse = {
|
|
21
|
+
transaction_hash: string;
|
|
22
|
+
class_hash: string;
|
|
23
|
+
};
|
|
24
|
+
export type EstimateFeeResponse = {
|
|
25
|
+
overall_fee: number;
|
|
26
|
+
gas_consumed: number;
|
|
27
|
+
gas_price: number;
|
|
28
|
+
};
|
|
29
|
+
export type GetBlockResponse = {
|
|
30
|
+
block_hash: string;
|
|
31
|
+
parent_hash: string;
|
|
32
|
+
block_number: number;
|
|
33
|
+
status: Status;
|
|
34
|
+
sequencer: string;
|
|
35
|
+
new_root: string;
|
|
36
|
+
old_root: string;
|
|
37
|
+
accepted_time: number;
|
|
38
|
+
gas_price: string;
|
|
39
|
+
transactions: string[];
|
|
40
|
+
};
|
|
41
|
+
export type GetCodeResponse = {
|
|
42
|
+
bytecode: string[];
|
|
43
|
+
abi: string;
|
|
44
|
+
};
|
|
45
|
+
export type GetStorageAtResponse = string;
|
|
46
|
+
export type GetTransactionReceiptResponse = {
|
|
47
|
+
txn_hash: string;
|
|
48
|
+
actual_fee: string;
|
|
49
|
+
status: Status;
|
|
50
|
+
status_data: string;
|
|
51
|
+
messages_sent: Array<MessageToL1>;
|
|
52
|
+
l1_origin_message: MessageToL2;
|
|
53
|
+
events: Array<StarknetEvent>;
|
|
54
|
+
};
|
|
55
|
+
interface CommonTransactionProperties {
|
|
56
|
+
txn_hash: string;
|
|
57
|
+
max_fee: string;
|
|
58
|
+
version: string;
|
|
59
|
+
nonce: string;
|
|
60
|
+
signature: Array<string>;
|
|
61
|
+
}
|
|
62
|
+
export interface InvokeTransactionResponse extends CommonTransactionProperties {
|
|
63
|
+
contract_address?: string;
|
|
64
|
+
entry_point_selector?: string;
|
|
65
|
+
calldata?: Array<string>;
|
|
66
|
+
}
|
|
67
|
+
export interface DeclareTransactionResponse extends CommonTransactionProperties {
|
|
68
|
+
contract_class?: GetClassResponse;
|
|
69
|
+
sender_address?: string;
|
|
70
|
+
}
|
|
71
|
+
export type GetTransactionResponse = InvokeTransactionResponse & DeclareTransactionResponse;
|
|
72
|
+
export type GetTransactionCountResponse = number;
|
|
73
|
+
export type GetBlockNumberResponse = number;
|
|
74
|
+
export type GetSyncingStatsResponse = {
|
|
75
|
+
starting_block_hash: string;
|
|
76
|
+
starting_block_num: string;
|
|
77
|
+
current_block_hash: string;
|
|
78
|
+
current_block_num: string;
|
|
79
|
+
highest_block_hash: string;
|
|
80
|
+
highest_block_num: string;
|
|
81
|
+
} | boolean;
|
|
82
|
+
export type EventFilter = {
|
|
83
|
+
fromBlock: string;
|
|
84
|
+
toBlock: string;
|
|
85
|
+
address: string;
|
|
86
|
+
keys: string[];
|
|
87
|
+
page_size: number;
|
|
88
|
+
page_number: number;
|
|
89
|
+
};
|
|
90
|
+
export type GetEventsResponse = {
|
|
91
|
+
events: StarknetEmittedEvent[];
|
|
92
|
+
page_number: number;
|
|
93
|
+
is_last_page: number;
|
|
94
|
+
};
|
|
95
|
+
export type DeployContractResponse = {
|
|
96
|
+
transaction_hash: string;
|
|
97
|
+
contract_address: string;
|
|
98
|
+
};
|
|
99
|
+
export type StarknetEvent = {
|
|
100
|
+
from_address: string;
|
|
101
|
+
keys: string[];
|
|
102
|
+
data: string[];
|
|
103
|
+
};
|
|
104
|
+
export type StarknetEmittedEvent = {
|
|
105
|
+
event: StarknetEvent;
|
|
106
|
+
block_hash: string;
|
|
107
|
+
block_number: number;
|
|
108
|
+
transaction_hash: string;
|
|
109
|
+
};
|
|
110
|
+
export type MessageToL1 = {
|
|
111
|
+
to_address: string;
|
|
112
|
+
payload: string[];
|
|
113
|
+
};
|
|
114
|
+
export type MessageToL2 = {
|
|
115
|
+
from_address: string;
|
|
116
|
+
payload: string[];
|
|
117
|
+
};
|
|
118
|
+
export type Methods = {
|
|
119
|
+
starknet_getBlockByHash: {
|
|
120
|
+
QUERY: never;
|
|
121
|
+
REQUEST: any[];
|
|
122
|
+
RESPONSE: GetBlockResponse;
|
|
123
|
+
};
|
|
124
|
+
starknet_getBlockByNumber: {
|
|
125
|
+
QUERY: never;
|
|
126
|
+
REQUEST: any[];
|
|
127
|
+
RESPONSE: GetBlockResponse;
|
|
128
|
+
};
|
|
129
|
+
starknet_getStorageAt: {
|
|
130
|
+
QUERY: never;
|
|
131
|
+
REQUEST: any[];
|
|
132
|
+
RESPONSE: GetStorageAtResponse;
|
|
133
|
+
};
|
|
134
|
+
starknet_getTransactionByHash: {
|
|
135
|
+
QUERY: never;
|
|
136
|
+
REQUEST: any[];
|
|
137
|
+
RESPONSE: GetTransactionResponse;
|
|
138
|
+
};
|
|
139
|
+
starknet_getTransactionByBlockHashAndIndex: {
|
|
140
|
+
QUERY: never;
|
|
141
|
+
REQUEST: any[];
|
|
142
|
+
RESPONSE: GetTransactionResponse;
|
|
143
|
+
};
|
|
144
|
+
starknet_getTransactionByBlockNumberAndIndex: {
|
|
145
|
+
QUERY: never;
|
|
146
|
+
REQUEST: any[];
|
|
147
|
+
RESPONSE: GetTransactionResponse;
|
|
148
|
+
};
|
|
149
|
+
starknet_getTransactionReceipt: {
|
|
150
|
+
QUERY: never;
|
|
151
|
+
REQUEST: any[];
|
|
152
|
+
RESPONSE: GetTransactionReceiptResponse;
|
|
153
|
+
};
|
|
154
|
+
starknet_getBlockTransactionCountByHash: {
|
|
155
|
+
QUERY: never;
|
|
156
|
+
REQUEST: any[];
|
|
157
|
+
RESPONSE: GetTransactionCountResponse;
|
|
158
|
+
};
|
|
159
|
+
starknet_getBlockTransactionCountByNumber: {
|
|
160
|
+
QUERY: never;
|
|
161
|
+
REQUEST: any[];
|
|
162
|
+
RESPONSE: GetTransactionCountResponse;
|
|
163
|
+
};
|
|
164
|
+
starknet_getCode: {
|
|
165
|
+
QUERY: never;
|
|
166
|
+
REQUEST: any[];
|
|
167
|
+
RESPONSE: GetCodeResponse;
|
|
168
|
+
};
|
|
169
|
+
starknet_call: {
|
|
170
|
+
QUERY: never;
|
|
171
|
+
REQUEST: any[];
|
|
172
|
+
RESPONSE: string[];
|
|
173
|
+
};
|
|
174
|
+
starknet_estimateFee: {
|
|
175
|
+
QUERY: never;
|
|
176
|
+
REQUEST: any[];
|
|
177
|
+
RESPONSE: EstimateFeeResponse;
|
|
178
|
+
};
|
|
179
|
+
starknet_blockNumber: {
|
|
180
|
+
QUERY: never;
|
|
181
|
+
REQUEST: any[];
|
|
182
|
+
RESPONSE: GetBlockNumberResponse;
|
|
183
|
+
};
|
|
184
|
+
starknet_chainId: {
|
|
185
|
+
QUERY: never;
|
|
186
|
+
REQUEST: any[];
|
|
187
|
+
RESPONSE: StarknetChainId;
|
|
188
|
+
};
|
|
189
|
+
starknet_syncing: {
|
|
190
|
+
QUERY: never;
|
|
191
|
+
REQUEST: any[];
|
|
192
|
+
RESPONSE: GetSyncingStatsResponse;
|
|
193
|
+
};
|
|
194
|
+
starknet_getEvents: {
|
|
195
|
+
QUERY: never;
|
|
196
|
+
REQUEST: any[];
|
|
197
|
+
RESPONSE: GetEventsResponse;
|
|
198
|
+
};
|
|
199
|
+
starknet_addInvokeTransaction: {
|
|
200
|
+
QUERY: never;
|
|
201
|
+
REQUEST: any[];
|
|
202
|
+
RESPONSE: AddTransactionResponse;
|
|
203
|
+
};
|
|
204
|
+
starknet_addDeployTransaction: {
|
|
205
|
+
QUERY: never;
|
|
206
|
+
REQUEST: any[];
|
|
207
|
+
RESPONSE: DeployContractResponse;
|
|
208
|
+
};
|
|
209
|
+
starknet_addDeclareTransaction: {
|
|
210
|
+
QUERY: never;
|
|
211
|
+
REQUEST: any[];
|
|
212
|
+
RESPONSE: DeclareResponse;
|
|
213
|
+
};
|
|
214
|
+
starknet_getClassAt: {
|
|
215
|
+
QUERY: never;
|
|
216
|
+
REQUEST: any[];
|
|
217
|
+
RESPONSE: any;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
export {};
|
|
221
|
+
}
|
package/types/api/rpc.js
ADDED