Skip to content

Commit a4c19ad

Browse files
author
Sean Han
committed
fix(.gitignore): remove docs from gitignore
1 parent 730f605 commit a4c19ad

File tree

3 files changed

+236
-13
lines changed

3 files changed

+236
-13
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,11 @@ jobs:
2626
needs: [build-and-test]
2727
steps:
2828
- uses: actions/checkout@v2
29-
with:
30-
token: ${{ secrets.GITHUB_TOKEN }}
3129
- uses: actions/setup-node@v2
3230
with:
3331
node-version: lts/*
3432
- run: npm ci
35-
- name: 'Generate TypeDocs'
36-
run: npm run docs
37-
- name: 'Commit & Push TypeDocs'
38-
run: |
39-
git config --global user.name 'Sean Han'
40-
git config --global user.email '[email protected]'
41-
git add --force -- docs/README.md
42-
git commit -m "docs(gh-action): autogenerated typedocs"
43-
git push
33+
- run: npm run docs
4434
- uses: actions/download-artifact@v2
4535
with:
4636
name: build

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ dist
33
npm-debug.log
44
.env
55
.DS_Store
6-
7-
docs/README.md
86
.eslintcache

docs/README.md

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
StarkNet.js Docs
2+
3+
# StarkNet.js Docs
4+
5+
## Table of contents
6+
7+
### Functions
8+
9+
- [addTransaction](README.md#addtransaction)
10+
- [callContract](README.md#callcontract)
11+
- [compressProgram](README.md#compressprogram)
12+
- [deployContract](README.md#deploycontract)
13+
- [getBlock](README.md#getblock)
14+
- [getCode](README.md#getcode)
15+
- [getContractAddresses](README.md#getcontractaddresses)
16+
- [getStorageAt](README.md#getstorageat)
17+
- [getTransaction](README.md#gettransaction)
18+
- [getTransactionStatus](README.md#gettransactionstatus)
19+
20+
## Functions
21+
22+
### addTransaction
23+
24+
**addTransaction**(`tx`): `Promise`<`AddTransactionResponse`\>
25+
26+
Invoke a function on the starknet contract
27+
28+
[Reference](https://github.com/starkware-libs/cairo-lang/blob/f464ec4797361b6be8989e36e02ec690e74ef285/src/starkware/starknet/services/api/gateway/gateway_client.py#L13-L17)
29+
30+
#### Parameters
31+
32+
| Name | Type | Description |
33+
| :--- | :------------ | :------------------------------ |
34+
| `tx` | `Transaction` | transaction to be invoked (WIP) |
35+
36+
#### Returns
37+
38+
`Promise`<`AddTransactionResponse`\>
39+
40+
a confirmation of invoking a function on the starknet contract
41+
42+
---
43+
44+
### callContract
45+
46+
**callContract**(`invokeTx`, `blockId`): `Promise`<`object`\>
47+
48+
Calls a function on the StarkNet contract.
49+
50+
[Reference](https://github.com/starkware-libs/cairo-lang/blob/f464ec4797361b6be8989e36e02ec690e74ef285/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L17-L25)
51+
52+
#### Parameters
53+
54+
| Name | Type | Description |
55+
| :--------- | :------- | :------------------------------ |
56+
| `invokeTx` | `object` | transaction to be invoked (WIP) |
57+
| `blockId` | `number` | |
58+
59+
#### Returns
60+
61+
`Promise`<`object`\>
62+
63+
the result of the function on the smart contract.
64+
65+
---
66+
67+
### compressProgram
68+
69+
**compressProgram**(`jsonProgram`): `CompressedProgram`
70+
71+
Function to compress compiled cairo program
72+
73+
[Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/services/api/gateway/transaction.py#L54-L58)
74+
75+
#### Parameters
76+
77+
| Name | Type | Description |
78+
| :------------ | :------------------- | :------------------------------------------------ |
79+
| `jsonProgram` | `string` \| `object` | json file representing the compiled cairo program |
80+
81+
#### Returns
82+
83+
`CompressedProgram`
84+
85+
Compressed cairo program
86+
87+
---
88+
89+
### deployContract
90+
91+
**deployContract**(`contract`, `address?`): `Promise`<`AddTransactionResponse`\>
92+
93+
Deploys a given compiled contract (json) to starknet
94+
95+
#### Parameters
96+
97+
| Name | Type | Description |
98+
| :--------- | :----------------------------- | :------------------------------------------------------------------------------------------------- |
99+
| `contract` | `string` \| `CompiledContract` | a json object containing the compiled contract |
100+
| `address` | `string` | (optional, defaults to a random address) the address where the contract should be deployed (alpha) |
101+
102+
#### Returns
103+
104+
`Promise`<`AddTransactionResponse`\>
105+
106+
a confirmation of sending a transaction on the starknet contract
107+
108+
---
109+
110+
### getBlock
111+
112+
**getBlock**(`blockId`): `Promise`<`GetBlockResponse`\>
113+
114+
Gets the block information from a block ID.
115+
116+
[Reference](https://github.com/starkware-libs/cairo-lang/blob/f464ec4797361b6be8989e36e02ec690e74ef285/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L27-L31)
117+
118+
#### Parameters
119+
120+
| Name | Type |
121+
| :-------- | :------- |
122+
| `blockId` | `number` |
123+
124+
#### Returns
125+
126+
`Promise`<`GetBlockResponse`\>
127+
128+
the block object { block_id, previous_block_id, state_root, status, timestamp, transaction_receipts, transactions }
129+
130+
---
131+
132+
### getCode
133+
134+
**getCode**(`contractAddress`, `blockId`): `Promise`<`GetCode`\>
135+
136+
Gets the code of the deployed contract.
137+
138+
[Reference](https://github.com/starkware-libs/cairo-lang/blob/f464ec4797361b6be8989e36e02ec690e74ef285/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L33-L36)
139+
140+
#### Parameters
141+
142+
| Name | Type |
143+
| :---------------- | :------- |
144+
| `contractAddress` | `string` |
145+
| `blockId` | `number` |
146+
147+
#### Returns
148+
149+
`Promise`<`GetCode`\>
150+
151+
Bytecode and ABI of compiled contract
152+
153+
---
154+
155+
### getContractAddresses
156+
157+
**getContractAddresses**(): `Promise`<`GetContractAddressesResponse`\>
158+
159+
Gets the smart contract address on the goerli testnet.
160+
161+
[Reference](https://github.com/starkware-libs/cairo-lang/blob/f464ec4797361b6be8989e36e02ec690e74ef285/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L13-L15)
162+
163+
#### Returns
164+
165+
`Promise`<`GetContractAddressesResponse`\>
166+
167+
starknet smart contract addresses
168+
169+
---
170+
171+
### getStorageAt
172+
173+
**getStorageAt**(`contractAddress`, `key`, `blockId`): `Promise`<`object`\>
174+
175+
Gets the contract's storage variable at a specific key.
176+
177+
[Reference](https://github.com/starkware-libs/cairo-lang/blob/f464ec4797361b6be8989e36e02ec690e74ef285/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L38-L46)
178+
179+
#### Parameters
180+
181+
| Name | Type | Description |
182+
| :---------------- | :------- | :--------------------------------------------------------- |
183+
| `contractAddress` | `string` | |
184+
| `key` | `number` | from getStorageVarAddress('<STORAGE_VARIABLE_NAME>') (WIP) |
185+
| `blockId` | `number` | |
186+
187+
#### Returns
188+
189+
`Promise`<`object`\>
190+
191+
the value of the storage variable
192+
193+
---
194+
195+
### getTransaction
196+
197+
**getTransaction**(`txId`): `Promise`<`GetTransactionResponse`\>
198+
199+
Gets the transaction information from a tx id.
200+
201+
[Reference](https://github.com/starkware-libs/cairo-lang/blob/f464ec4797361b6be8989e36e02ec690e74ef285/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L54-L58)
202+
203+
#### Parameters
204+
205+
| Name | Type |
206+
| :----- | :------- |
207+
| `txId` | `number` |
208+
209+
#### Returns
210+
211+
`Promise`<`GetTransactionResponse`\>
212+
213+
the transacton object { transaction_id, status, transaction, block_id?, block_number?, transaction_index?, transaction_failure_reason? }
214+
215+
---
216+
217+
### getTransactionStatus
218+
219+
**getTransactionStatus**(`txId`): `Promise`<`GetTransactionStatusResponse`\>
220+
221+
Gets the status of a transaction.
222+
223+
[Reference](https://github.com/starkware-libs/cairo-lang/blob/f464ec4797361b6be8989e36e02ec690e74ef285/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L48-L52)
224+
225+
#### Parameters
226+
227+
| Name | Type |
228+
| :----- | :------- |
229+
| `txId` | `number` |
230+
231+
#### Returns
232+
233+
`Promise`<`GetTransactionStatusResponse`\>
234+
235+
the transaction status object { block_id, tx_status: NOT_RECEIVED | RECEIVED | PENDING | REJECTED | ACCEPTED_ONCHAIN }

0 commit comments

Comments
 (0)