starknet 4.17.0 → 4.18.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 +20 -0
- package/README.md +2 -10
- package/dist/index.d.ts +27 -9
- package/dist/index.global.js +30 -13
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +30 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -1
- package/.babelrc +0 -6
- package/.commitlintrc +0 -22
- package/.eslintignore +0 -2
- package/.eslintrc +0 -28
- package/.prettierrc +0 -6
- package/.releaserc +0 -28
- package/CODE_OF_CONDUCT.md +0 -128
- package/CONTRIBUTING.md +0 -52
- package/__mocks__/Account.json +0 -25486
- package/__mocks__/ERC20.json +0 -40027
- package/__mocks__/TestDapp.json +0 -12962
- package/__mocks__/contract.json +0 -33191
- package/__mocks__/l1l2_compiled.json +0 -10107
- package/__mocks__/multicall.json +0 -8139
- package/__mocks__/naming_compiled.json +0 -53283
- package/__mocks__/starknetId_compiled.json +0 -44703
- package/__mocks__/typedDataExample.json +0 -35
- package/__mocks__/typedDataSessionExample.json +0 -42
- package/__mocks__/typedDataStructArrayExample.json +0 -44
- package/__tests__/account.test.ts +0 -345
- package/__tests__/contract.test.ts +0 -249
- package/__tests__/defaultProvider.test.ts +0 -177
- package/__tests__/fixtures.ts +0 -84
- package/__tests__/jest.setup.ts +0 -30
- package/__tests__/rpcProvider.test.ts +0 -132
- package/__tests__/sequencerProvider.test.ts +0 -123
- package/__tests__/utils/__snapshots__/ellipticalCurve.test.ts.snap +0 -5
- package/__tests__/utils/__snapshots__/utils.browser.test.ts.snap +0 -5
- package/__tests__/utils/__snapshots__/utils.test.ts.snap +0 -5
- package/__tests__/utils/address.test.ts +0 -45
- package/__tests__/utils/ellipticalCurve.test.ts +0 -91
- package/__tests__/utils/merkle.test.ts +0 -256
- package/__tests__/utils/shortString.test.ts +0 -22
- package/__tests__/utils/starknetId.test.ts +0 -53
- package/__tests__/utils/transactionHash.test.ts +0 -17
- package/__tests__/utils/typedData.test.ts +0 -223
- package/__tests__/utils/uint256.test.ts +0 -32
- package/__tests__/utils/utils.browser.test.ts +0 -29
- package/__tests__/utils/utils.test.ts +0 -141
- package/img/logo.svg +0 -17
- package/index.d.ts +0 -2683
- package/index.global.js +0 -23192
- package/index.global.js.map +0 -1
- package/index.js +0 -4910
- package/index.js.map +0 -1
- package/index.mjs +0 -4852
- package/index.mjs.map +0 -1
- package/src/account/default.ts +0 -501
- package/src/account/index.ts +0 -2
- package/src/account/interface.ts +0 -309
- package/src/constants.ts +0 -2065
- package/src/contract/contractFactory.ts +0 -88
- package/src/contract/default.ts +0 -425
- package/src/contract/index.ts +0 -3
- package/src/contract/interface.ts +0 -106
- package/src/index.ts +0 -26
- package/src/provider/default.ts +0 -187
- package/src/provider/errors.ts +0 -14
- package/src/provider/index.ts +0 -9
- package/src/provider/interface.ts +0 -281
- package/src/provider/rpc.ts +0 -482
- package/src/provider/sequencer.ts +0 -523
- package/src/provider/utils.ts +0 -100
- package/src/signer/default.ts +0 -99
- package/src/signer/index.ts +0 -2
- package/src/signer/interface.ts +0 -77
- package/src/types/account.ts +0 -43
- package/src/types/api/index.ts +0 -10
- package/src/types/api/openrpc.ts +0 -607
- package/src/types/api/rpc.ts +0 -45
- package/src/types/api/sequencer.ts +0 -369
- package/src/types/contract.ts +0 -5
- package/src/types/index.ts +0 -8
- package/src/types/lib.ts +0 -143
- package/src/types/provider.ts +0 -134
- package/src/types/signer.ts +0 -24
- package/src/utils/address.ts +0 -44
- package/src/utils/calldata.ts +0 -250
- package/src/utils/ellipticCurve.ts +0 -120
- package/src/utils/encode.ts +0 -66
- package/src/utils/events.ts +0 -32
- package/src/utils/fetchPonyfill.ts +0 -5
- package/src/utils/hash.ts +0 -235
- package/src/utils/json.ts +0 -15
- package/src/utils/merkle.ts +0 -69
- package/src/utils/number.ts +0 -98
- package/src/utils/provider.ts +0 -28
- package/src/utils/responseParser/index.ts +0 -28
- package/src/utils/responseParser/rpc.ts +0 -70
- package/src/utils/responseParser/sequencer.ts +0 -135
- package/src/utils/shortString.ts +0 -21
- package/src/utils/stark.ts +0 -57
- package/src/utils/starknetId.ts +0 -116
- package/src/utils/transaction.ts +0 -56
- package/src/utils/typedData/index.ts +0 -247
- package/src/utils/typedData/types.ts +0 -37
- package/src/utils/typedData/utils.ts +0 -16
- package/src/utils/uint256.ts +0 -32
- package/src/utils/url.ts +0 -53
- package/tsconfig.eslint.json +0 -4
- package/tsup.config.ts +0 -9
- package/www/README.md +0 -41
- package/www/babel.config.js +0 -3
- package/www/code-examples/account.js +0 -65
- package/www/code-examples/amm.js +0 -44
- package/www/code-examples/erc20.js +0 -13
- package/www/code-examples/package-lock.json +0 -336
- package/www/code-examples/package.json +0 -15
- package/www/docs/API/_category_.json +0 -5
- package/www/docs/API/account.md +0 -463
- package/www/docs/API/changelog.md +0 -15
- package/www/docs/API/contract.md +0 -135
- package/www/docs/API/contractFactory.md +0 -45
- package/www/docs/API/index.md +0 -3
- package/www/docs/API/provider.md +0 -725
- package/www/docs/API/signer.md +0 -105
- package/www/docs/API/utils.md +0 -374
- package/www/docusaurus.config.js +0 -130
- package/www/guides/account.md +0 -140
- package/www/guides/cra.md +0 -3
- package/www/guides/erc20.md +0 -163
- package/www/guides/intro.md +0 -63
- package/www/package-lock.json +0 -20405
- package/www/package.json +0 -43
- package/www/sidebars.js +0 -31
- package/www/src/components/HomepageFeatures/index.tsx +0 -67
- package/www/src/components/HomepageFeatures/styles.module.css +0 -10
- package/www/src/css/custom.css +0 -39
- package/www/src/pages/index.module.css +0 -23
- package/www/src/pages/index.tsx +0 -40
- package/www/src/pages/markdown-page.md +0 -7
- package/www/static/.nojekyll +0 -0
- package/www/static/img/docusaurus.png +0 -0
- package/www/static/img/favicon.ico +0 -0
- package/www/static/img/logo.svg +0 -17
- package/www/static/img/starknet-1.png +0 -0
- package/www/static/img/starknet-2.png +0 -0
- package/www/static/img/starknet-3.png +0 -0
- package/www/static/img/tutorial/docsVersionDropdown.png +0 -0
- package/www/static/img/tutorial/localeDropdown.png +0 -0
package/src/provider/default.ts
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { StarknetChainId } from '../constants';
|
|
2
|
-
import {
|
|
3
|
-
Call,
|
|
4
|
-
CallContractResponse,
|
|
5
|
-
ContractClass,
|
|
6
|
-
DeclareContractResponse,
|
|
7
|
-
DeclareContractTransaction,
|
|
8
|
-
DeployAccountContractTransaction,
|
|
9
|
-
DeployContractResponse,
|
|
10
|
-
EstimateFeeResponse,
|
|
11
|
-
GetBlockResponse,
|
|
12
|
-
GetCodeResponse,
|
|
13
|
-
GetTransactionReceiptResponse,
|
|
14
|
-
GetTransactionResponse,
|
|
15
|
-
Invocation,
|
|
16
|
-
InvocationsDetailsWithNonce,
|
|
17
|
-
InvokeFunctionResponse,
|
|
18
|
-
Status,
|
|
19
|
-
} from '../types';
|
|
20
|
-
import { BigNumberish } from '../utils/number';
|
|
21
|
-
import { ProviderInterface } from './interface';
|
|
22
|
-
import { RpcProvider, RpcProviderOptions } from './rpc';
|
|
23
|
-
import { SequencerProvider, SequencerProviderOptions } from './sequencer';
|
|
24
|
-
import { BlockIdentifier } from './utils';
|
|
25
|
-
|
|
26
|
-
export interface ProviderOptions {
|
|
27
|
-
sequencer?: SequencerProviderOptions;
|
|
28
|
-
rpc?: RpcProviderOptions;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class Provider implements ProviderInterface {
|
|
32
|
-
private provider!: ProviderInterface;
|
|
33
|
-
|
|
34
|
-
constructor(providerOrOptions?: ProviderOptions | ProviderInterface) {
|
|
35
|
-
if (providerOrOptions instanceof Provider) {
|
|
36
|
-
// providerOrOptions is Provider
|
|
37
|
-
this.provider = providerOrOptions.provider;
|
|
38
|
-
} else if (
|
|
39
|
-
providerOrOptions instanceof RpcProvider ||
|
|
40
|
-
providerOrOptions instanceof SequencerProvider
|
|
41
|
-
) {
|
|
42
|
-
// providerOrOptions is SequencerProvider or RpcProvider
|
|
43
|
-
this.provider = <ProviderInterface>providerOrOptions;
|
|
44
|
-
} else if (providerOrOptions && 'rpc' in providerOrOptions) {
|
|
45
|
-
// providerOrOptions is rpc option
|
|
46
|
-
this.provider = new RpcProvider(<RpcProviderOptions>providerOrOptions.rpc);
|
|
47
|
-
} else if (providerOrOptions && 'sequencer' in providerOrOptions) {
|
|
48
|
-
// providerOrOptions is sequencer option
|
|
49
|
-
this.provider = new SequencerProvider(<SequencerProviderOptions>providerOrOptions.sequencer);
|
|
50
|
-
} else {
|
|
51
|
-
// providerOrOptions is none, create SequencerProvider as default
|
|
52
|
-
this.provider = new SequencerProvider();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
public get chainId(): StarknetChainId {
|
|
57
|
-
return this.provider.chainId;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public async getChainId(): Promise<StarknetChainId> {
|
|
61
|
-
return this.provider.getChainId();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public async getBlock(blockIdentifier: BlockIdentifier): Promise<GetBlockResponse> {
|
|
65
|
-
return this.provider.getBlock(blockIdentifier);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public async getClassAt(
|
|
69
|
-
contractAddress: string,
|
|
70
|
-
blockIdentifier?: BlockIdentifier
|
|
71
|
-
): Promise<ContractClass> {
|
|
72
|
-
return this.provider.getClassAt(contractAddress, blockIdentifier);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public async getClassHashAt(
|
|
76
|
-
contractAddress: string,
|
|
77
|
-
blockIdentifier: BlockIdentifier
|
|
78
|
-
): Promise<string> {
|
|
79
|
-
return this.provider.getClassHashAt(contractAddress, blockIdentifier);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
public getClassByHash(classHash: string): Promise<ContractClass> {
|
|
83
|
-
return this.provider.getClassByHash(classHash);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
public async getEstimateFee(
|
|
87
|
-
invocationWithTxType: Invocation,
|
|
88
|
-
invocationDetails: InvocationsDetailsWithNonce,
|
|
89
|
-
blockIdentifier: BlockIdentifier
|
|
90
|
-
): Promise<EstimateFeeResponse> {
|
|
91
|
-
return this.provider.getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
public async getInvokeEstimateFee(
|
|
95
|
-
invocationWithTxType: Invocation,
|
|
96
|
-
invocationDetails: InvocationsDetailsWithNonce,
|
|
97
|
-
blockIdentifier?: BlockIdentifier
|
|
98
|
-
): Promise<EstimateFeeResponse> {
|
|
99
|
-
return this.provider.getInvokeEstimateFee(
|
|
100
|
-
invocationWithTxType,
|
|
101
|
-
invocationDetails,
|
|
102
|
-
blockIdentifier
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
public async getNonceForAddress(
|
|
107
|
-
contractAddress: string,
|
|
108
|
-
blockIdentifier?: BlockIdentifier
|
|
109
|
-
): Promise<BigNumberish> {
|
|
110
|
-
return this.provider.getNonceForAddress(contractAddress, blockIdentifier);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
public async getStorageAt(
|
|
114
|
-
contractAddress: string,
|
|
115
|
-
key: BigNumberish,
|
|
116
|
-
blockIdentifier?: BlockIdentifier
|
|
117
|
-
): Promise<BigNumberish> {
|
|
118
|
-
return this.provider.getStorageAt(contractAddress, key, blockIdentifier);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
public async getTransaction(txHash: BigNumberish): Promise<GetTransactionResponse> {
|
|
122
|
-
return this.provider.getTransaction(txHash);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
public async getTransactionReceipt(txHash: BigNumberish): Promise<GetTransactionReceiptResponse> {
|
|
126
|
-
return this.provider.getTransactionReceipt(txHash);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
public async callContract(
|
|
130
|
-
request: Call,
|
|
131
|
-
blockIdentifier?: BlockIdentifier
|
|
132
|
-
): Promise<CallContractResponse> {
|
|
133
|
-
return this.provider.callContract(request, blockIdentifier);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
public async invokeFunction(
|
|
137
|
-
functionInvocation: Invocation,
|
|
138
|
-
details: InvocationsDetailsWithNonce
|
|
139
|
-
): Promise<InvokeFunctionResponse> {
|
|
140
|
-
return this.provider.invokeFunction(functionInvocation, details);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
public async deployAccountContract(
|
|
144
|
-
payload: DeployAccountContractTransaction,
|
|
145
|
-
details: InvocationsDetailsWithNonce
|
|
146
|
-
): Promise<DeployContractResponse> {
|
|
147
|
-
return this.provider.deployAccountContract(payload, details);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
public async declareContract(
|
|
151
|
-
transaction: DeclareContractTransaction,
|
|
152
|
-
details: InvocationsDetailsWithNonce
|
|
153
|
-
): Promise<DeclareContractResponse> {
|
|
154
|
-
return this.provider.declareContract(transaction, details);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
public async getDeclareEstimateFee(
|
|
158
|
-
transaction: DeclareContractTransaction,
|
|
159
|
-
details: InvocationsDetailsWithNonce,
|
|
160
|
-
blockIdentifier?: BlockIdentifier
|
|
161
|
-
): Promise<EstimateFeeResponse> {
|
|
162
|
-
return this.provider.getDeclareEstimateFee(transaction, details, blockIdentifier);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
public getDeployAccountEstimateFee(
|
|
166
|
-
transaction: DeployAccountContractTransaction,
|
|
167
|
-
details: InvocationsDetailsWithNonce,
|
|
168
|
-
blockIdentifier?: BlockIdentifier
|
|
169
|
-
): Promise<EstimateFeeResponse> {
|
|
170
|
-
return this.provider.getDeployAccountEstimateFee(transaction, details, blockIdentifier);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
public async getCode(
|
|
174
|
-
contractAddress: string,
|
|
175
|
-
blockIdentifier?: BlockIdentifier
|
|
176
|
-
): Promise<GetCodeResponse> {
|
|
177
|
-
return this.provider.getCode(contractAddress, blockIdentifier);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
public async waitForTransaction(
|
|
181
|
-
txHash: BigNumberish,
|
|
182
|
-
retryInterval?: number,
|
|
183
|
-
successStates?: Array<Status>
|
|
184
|
-
): Promise<GetTransactionReceiptResponse> {
|
|
185
|
-
return this.provider.waitForTransaction(txHash, retryInterval, successStates);
|
|
186
|
-
}
|
|
187
|
-
}
|
package/src/provider/errors.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import { CustomError } from 'ts-custom-error';
|
|
3
|
-
|
|
4
|
-
export class GatewayError extends CustomError {
|
|
5
|
-
constructor(message: string, public errorCode: string) {
|
|
6
|
-
super(message);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export class HttpError extends CustomError {
|
|
11
|
-
constructor(message: string, public errorCode: number) {
|
|
12
|
-
super(message);
|
|
13
|
-
}
|
|
14
|
-
}
|
package/src/provider/index.ts
DELETED
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { StarknetChainId } from '../constants';
|
|
2
|
-
import type {
|
|
3
|
-
Call,
|
|
4
|
-
CallContractResponse,
|
|
5
|
-
ContractClass,
|
|
6
|
-
DeclareContractResponse,
|
|
7
|
-
DeclareContractTransaction,
|
|
8
|
-
DeployAccountContractPayload,
|
|
9
|
-
DeployAccountContractTransaction,
|
|
10
|
-
DeployContractResponse,
|
|
11
|
-
EstimateFeeResponse,
|
|
12
|
-
GetBlockResponse,
|
|
13
|
-
GetCodeResponse,
|
|
14
|
-
GetTransactionReceiptResponse,
|
|
15
|
-
GetTransactionResponse,
|
|
16
|
-
Invocation,
|
|
17
|
-
InvocationsDetailsWithNonce,
|
|
18
|
-
InvokeFunctionResponse,
|
|
19
|
-
Status,
|
|
20
|
-
} from '../types';
|
|
21
|
-
import type { BigNumberish } from '../utils/number';
|
|
22
|
-
import { BlockIdentifier } from './utils';
|
|
23
|
-
|
|
24
|
-
export abstract class ProviderInterface {
|
|
25
|
-
public abstract chainId: StarknetChainId;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Gets the Starknet chain Id
|
|
29
|
-
*
|
|
30
|
-
* @returns the chain Id
|
|
31
|
-
*/
|
|
32
|
-
public abstract getChainId(): Promise<StarknetChainId>;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Calls a function on the StarkNet contract.
|
|
36
|
-
*
|
|
37
|
-
* @param call transaction to be called
|
|
38
|
-
* @param blockIdentifier block identifier
|
|
39
|
-
* @returns the result of the function on the smart contract.
|
|
40
|
-
*/
|
|
41
|
-
public abstract callContract(
|
|
42
|
-
call: Call,
|
|
43
|
-
blockIdentifier?: BlockIdentifier
|
|
44
|
-
): Promise<CallContractResponse>;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Gets the block information
|
|
48
|
-
*
|
|
49
|
-
* @param blockIdentifier block identifier
|
|
50
|
-
* @returns the block object
|
|
51
|
-
*/
|
|
52
|
-
public abstract getBlock(blockIdentifier: BlockIdentifier): Promise<GetBlockResponse>;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated The method should not be used
|
|
56
|
-
*/
|
|
57
|
-
public abstract getCode(
|
|
58
|
-
contractAddress: string,
|
|
59
|
-
blockIdentifier?: BlockIdentifier
|
|
60
|
-
): Promise<GetCodeResponse>;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Gets the contract class of the deployed contract.
|
|
64
|
-
*
|
|
65
|
-
* @param contractAddress - contract address
|
|
66
|
-
* @param blockIdentifier - block identifier
|
|
67
|
-
* @returns Contract class of compiled contract
|
|
68
|
-
*/
|
|
69
|
-
public abstract getClassAt(
|
|
70
|
-
contractAddress: string,
|
|
71
|
-
blockIdentifier?: BlockIdentifier
|
|
72
|
-
): Promise<ContractClass>;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Returns the class hash deployed under the given address.
|
|
76
|
-
*
|
|
77
|
-
* @param contractAddress - contract address
|
|
78
|
-
* @param blockIdentifier - block identifier
|
|
79
|
-
* @returns Class hash
|
|
80
|
-
*/
|
|
81
|
-
public abstract getClassHashAt(
|
|
82
|
-
contractAddress: string,
|
|
83
|
-
blockIdentifier?: BlockIdentifier
|
|
84
|
-
): Promise<string>;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Returns the contract class deployed under the given class hash.
|
|
88
|
-
*
|
|
89
|
-
* @param classHash - class hash
|
|
90
|
-
* @returns Contract class of compiled contract
|
|
91
|
-
*/
|
|
92
|
-
public abstract getClassByHash(classHash: string): Promise<ContractClass>;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Gets the nonce of a contract with respect to a specific block
|
|
96
|
-
*
|
|
97
|
-
* @param contractAddress - contract address
|
|
98
|
-
* @returns the hex nonce
|
|
99
|
-
*/
|
|
100
|
-
public abstract getNonceForAddress(
|
|
101
|
-
contractAddress: string,
|
|
102
|
-
blockIdentifier?: BlockIdentifier
|
|
103
|
-
): Promise<BigNumberish>;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Gets the contract's storage variable at a specific key.
|
|
107
|
-
*
|
|
108
|
-
* @param contractAddress
|
|
109
|
-
* @param key - from getStorageVarAddress('<STORAGE_VARIABLE_NAME>') (WIP)
|
|
110
|
-
* @param blockIdentifier - block identifier
|
|
111
|
-
* @returns the value of the storage variable
|
|
112
|
-
*/
|
|
113
|
-
public abstract getStorageAt(
|
|
114
|
-
contractAddress: string,
|
|
115
|
-
key: BigNumberish,
|
|
116
|
-
blockIdentifier?: BlockIdentifier
|
|
117
|
-
): Promise<BigNumberish>;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Gets the transaction information from a tx id.
|
|
121
|
-
*
|
|
122
|
-
* @param txHash
|
|
123
|
-
* @returns the transaction object { transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? }
|
|
124
|
-
*/
|
|
125
|
-
public abstract getTransaction(transactionHash: BigNumberish): Promise<GetTransactionResponse>;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Gets the transaction receipt from a tx hash.
|
|
129
|
-
*
|
|
130
|
-
* @param txHash
|
|
131
|
-
* @returns the transaction receipt object
|
|
132
|
-
*/
|
|
133
|
-
public abstract getTransactionReceipt(
|
|
134
|
-
transactionHash: BigNumberish
|
|
135
|
-
): Promise<GetTransactionReceiptResponse>;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Deploys a given compiled Account contract (json) to starknet
|
|
139
|
-
*
|
|
140
|
-
* @param payload payload to be deployed containing:
|
|
141
|
-
* - compiled contract code
|
|
142
|
-
* - constructor calldata
|
|
143
|
-
* - address salt
|
|
144
|
-
* @returns a confirmation of sending a transaction on the starknet contract
|
|
145
|
-
*/
|
|
146
|
-
public abstract deployAccountContract(
|
|
147
|
-
payload: DeployAccountContractPayload,
|
|
148
|
-
details: InvocationsDetailsWithNonce
|
|
149
|
-
): Promise<DeployContractResponse>;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Invokes a function on starknet
|
|
153
|
-
* @deprecated This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class
|
|
154
|
-
*
|
|
155
|
-
* @param invocation the invocation object containing:
|
|
156
|
-
* - contractAddress - the address of the contract
|
|
157
|
-
* - entrypoint - the entrypoint of the contract
|
|
158
|
-
* - calldata - (defaults to []) the calldata
|
|
159
|
-
* - signature - (defaults to []) the signature
|
|
160
|
-
* @param details - optional details containing:
|
|
161
|
-
* - nonce - optional nonce
|
|
162
|
-
* - version - optional version
|
|
163
|
-
* - maxFee - optional maxFee
|
|
164
|
-
* @returns response from addTransaction
|
|
165
|
-
*/
|
|
166
|
-
public abstract invokeFunction(
|
|
167
|
-
invocation: Invocation,
|
|
168
|
-
details: InvocationsDetailsWithNonce
|
|
169
|
-
): Promise<InvokeFunctionResponse>;
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Declares a given compiled contract (json) to starknet
|
|
173
|
-
* @param transaction transaction payload to be deployed containing:
|
|
174
|
-
* - compiled contract code
|
|
175
|
-
* - sender address
|
|
176
|
-
* - signature
|
|
177
|
-
* @param details Invocation Details containing:
|
|
178
|
-
* - nonce
|
|
179
|
-
* - optional version
|
|
180
|
-
* - optional maxFee
|
|
181
|
-
* @returns a confirmation of sending a transaction on the starknet contract
|
|
182
|
-
*/
|
|
183
|
-
public abstract declareContract(
|
|
184
|
-
transaction: DeclareContractTransaction,
|
|
185
|
-
details: InvocationsDetailsWithNonce
|
|
186
|
-
): Promise<DeclareContractResponse>;
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Estimates the fee for a given INVOKE transaction
|
|
190
|
-
* @deprecated Please use getInvokeEstimateFee or getDeclareEstimateFee instead. Should not be used outside of Account class
|
|
191
|
-
*
|
|
192
|
-
* @param invocation the invocation object containing:
|
|
193
|
-
* - contractAddress - the address of the contract
|
|
194
|
-
* - entrypoint - the entrypoint of the contract
|
|
195
|
-
* - calldata - (defaults to []) the calldata
|
|
196
|
-
* - signature - (defaults to []) the signature
|
|
197
|
-
* @param blockIdentifier - block identifier
|
|
198
|
-
* @param details - optional details containing:
|
|
199
|
-
* - nonce - optional nonce
|
|
200
|
-
* - version - optional version
|
|
201
|
-
* @returns the estimated fee
|
|
202
|
-
*/
|
|
203
|
-
public abstract getEstimateFee(
|
|
204
|
-
invocation: Invocation,
|
|
205
|
-
details: InvocationsDetailsWithNonce,
|
|
206
|
-
blockIdentifier: BlockIdentifier
|
|
207
|
-
): Promise<EstimateFeeResponse>;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Estimates the fee for a given INVOKE transaction
|
|
211
|
-
*
|
|
212
|
-
* @param invocation the invocation object containing:
|
|
213
|
-
* - contractAddress - the address of the contract
|
|
214
|
-
* - entrypoint - the entrypoint of the contract
|
|
215
|
-
* - calldata - (defaults to []) the calldata
|
|
216
|
-
* - signature - (defaults to []) the signature
|
|
217
|
-
* @param blockIdentifier - block identifier
|
|
218
|
-
* @param details - optional details containing:
|
|
219
|
-
* - nonce - optional nonce
|
|
220
|
-
* - version - optional version
|
|
221
|
-
* @returns the estimated fee
|
|
222
|
-
*/
|
|
223
|
-
public abstract getInvokeEstimateFee(
|
|
224
|
-
invocation: Invocation,
|
|
225
|
-
details: InvocationsDetailsWithNonce,
|
|
226
|
-
blockIdentifier?: BlockIdentifier
|
|
227
|
-
): Promise<EstimateFeeResponse>;
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Estimates the fee for a given DECLARE transaction
|
|
231
|
-
*
|
|
232
|
-
* @param transaction transaction payload to be declared containing:
|
|
233
|
-
* - compiled contract code
|
|
234
|
-
* - sender address
|
|
235
|
-
* - signature - (defaults to []) the signature
|
|
236
|
-
* @param details - optional details containing:
|
|
237
|
-
* - nonce
|
|
238
|
-
* - version - optional version
|
|
239
|
-
* - optional maxFee
|
|
240
|
-
* @param blockIdentifier - block identifier
|
|
241
|
-
* @returns the estimated fee
|
|
242
|
-
*/
|
|
243
|
-
public abstract getDeclareEstimateFee(
|
|
244
|
-
transaction: DeclareContractTransaction,
|
|
245
|
-
details: InvocationsDetailsWithNonce,
|
|
246
|
-
blockIdentifier?: BlockIdentifier
|
|
247
|
-
): Promise<EstimateFeeResponse>;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Estimates the fee for a given DEPLOY_ACCOUNT transaction
|
|
251
|
-
*
|
|
252
|
-
* @param transaction transaction payload to be deployed containing:
|
|
253
|
-
* - classHash
|
|
254
|
-
* - constructorCalldata
|
|
255
|
-
* - addressSalt
|
|
256
|
-
* - signature - (defaults to []) the signature
|
|
257
|
-
* @param details - optional details containing:
|
|
258
|
-
* - nonce
|
|
259
|
-
* - version - optional version
|
|
260
|
-
* - optional maxFee
|
|
261
|
-
* @param blockIdentifier - block identifier
|
|
262
|
-
* @returns the estimated fee
|
|
263
|
-
*/
|
|
264
|
-
public abstract getDeployAccountEstimateFee(
|
|
265
|
-
transaction: DeployAccountContractTransaction,
|
|
266
|
-
details: InvocationsDetailsWithNonce,
|
|
267
|
-
blockIdentifier?: BlockIdentifier
|
|
268
|
-
): Promise<EstimateFeeResponse>;
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Wait for the transaction to be accepted
|
|
272
|
-
* @param txHash - transaction hash
|
|
273
|
-
* @param retryInterval - retry interval
|
|
274
|
-
* @return GetTransactionReceiptResponse
|
|
275
|
-
*/
|
|
276
|
-
public abstract waitForTransaction(
|
|
277
|
-
txHash: BigNumberish,
|
|
278
|
-
retryInterval?: number,
|
|
279
|
-
successStates?: Array<Status>
|
|
280
|
-
): Promise<GetTransactionReceiptResponse>;
|
|
281
|
-
}
|