@solana/web3.js 0.98.0 → 1.0.1
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/README.md +10 -55
- package/lib/index.browser.esm.js +48 -24
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +101 -56
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +88 -64
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +42 -25
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -2
- package/lib/index.iife.min.js.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +27 -45
- package/src/message.ts +9 -12
- package/src/transaction.ts +2 -2
- package/src/util/guarded-array-utils.ts +37 -0
- package/src/validator-info.ts +5 -4
- package/bin/bpf-sdk-install.sh +0 -38
- package/bin/localnet.sh +0 -161
- package/bpf-sdk/LICENSE +0 -13
- package/bpf-sdk/c/README.md +0 -44
- package/bpf-sdk/c/bpf.ld +0 -20
- package/bpf-sdk/c/bpf.mk +0 -249
- package/bpf-sdk/c/inc/deserialize_deprecated.h +0 -115
- package/bpf-sdk/c/inc/solana_sdk.h +0 -669
- package/bpf-sdk/c/inc/stdio.h +0 -4
- package/bpf-sdk/c/inc/stdlib.h +0 -2
- package/bpf-sdk/c/inc/string.h +0 -7
- package/bpf-sdk/c/inc/sys/param.h +0 -1
- package/bpf-sdk/c/inc/wchar.h +0 -1
- package/bpf-sdk/env.sh +0 -39
- package/bpf-sdk/rust/bpf.ld +0 -20
- package/bpf-sdk/rust/build.sh +0 -21
- package/bpf-sdk/rust/clean.sh +0 -17
- package/bpf-sdk/rust/xargo-build.sh +0 -29
- package/bpf-sdk/scripts/dump.sh +0 -45
- package/bpf-sdk/scripts/install.sh +0 -178
- package/bpf-sdk/scripts/objcopy.sh +0 -6
- package/bpf-sdk/scripts/package.sh +0 -19
- package/bpf-sdk/scripts/strip.sh +0 -23
- package/bpf-sdk/version.txt +0 -2
- package/doc/assets/css/main.css +0 -2660
- package/doc/assets/images/icons.png +0 -0
- package/doc/assets/images/icons@2x.png +0 -0
- package/doc/assets/images/widgets.png +0 -0
- package/doc/assets/images/widgets@2x.png +0 -0
- package/doc/assets/js/main.js +0 -248
- package/doc/assets/js/search.js +0 -1
- package/doc/classes/account.html +0 -244
- package/doc/classes/authorized.html +0 -234
- package/doc/classes/bpfloader.html +0 -267
- package/doc/classes/connection.html +0 -2354
- package/doc/classes/loader.html +0 -275
- package/doc/classes/lockup.html +0 -250
- package/doc/classes/message.html +0 -326
- package/doc/classes/nonceaccount.html +0 -233
- package/doc/classes/publickey.html +0 -411
- package/doc/classes/secp256k1program.html +0 -308
- package/doc/classes/stakeinstruction.html +0 -403
- package/doc/classes/stakeprogram.html +0 -503
- package/doc/classes/systeminstruction.html +0 -563
- package/doc/classes/systemprogram.html +0 -503
- package/doc/classes/transaction.html +0 -688
- package/doc/classes/transactioninstruction.html +0 -240
- package/doc/classes/validatorinfo.html +0 -279
- package/doc/classes/voteaccount.html +0 -331
- package/doc/index.html +0 -640
- package/doc/interfaces/feecalculator.html +0 -166
- package/doc/modules.html +0 -4682
- package/examples/README.md +0 -10
- package/examples/account.html +0 -24
- package/examples/account.js +0 -10
- package/examples/bpf-c-noop/.gitignore +0 -1
- package/examples/bpf-c-noop/makefile +0 -1
- package/examples/bpf-c-noop/src/noop/noop.c +0 -19
- package/examples/bpf-rust-noop/.gitignore +0 -3
- package/examples/bpf-rust-noop/Cargo.toml +0 -23
- package/examples/bpf-rust-noop/Xargo.toml +0 -2
- package/examples/bpf-rust-noop/src/lib.rs +0 -70
- package/examples/get-balance.html +0 -37
- package/examples/get-balance.js +0 -18
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html class="default no-js">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
-
<title>BpfLoader | @solana/web3.js</title>
|
|
7
|
-
<meta name="description" content="Documentation for @solana/web3.js">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<link rel="stylesheet" href="../assets/css/main.css">
|
|
10
|
-
<script async src="../assets/js/search.js" id="search-script"></script>
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<header>
|
|
14
|
-
<div class="tsd-page-toolbar">
|
|
15
|
-
<div class="container">
|
|
16
|
-
<div class="table-wrap">
|
|
17
|
-
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
18
|
-
<div class="field">
|
|
19
|
-
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
20
|
-
<input id="tsd-search-field" type="text" />
|
|
21
|
-
</div>
|
|
22
|
-
<ul class="results">
|
|
23
|
-
<li class="state loading">Preparing search index...</li>
|
|
24
|
-
<li class="state failure">The search index is not available</li>
|
|
25
|
-
</ul>
|
|
26
|
-
<a href="../index.html" class="title">@solana/web3.js</a>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="table-cell" id="tsd-widgets">
|
|
29
|
-
<div id="tsd-filter">
|
|
30
|
-
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
31
|
-
<div class="tsd-filter-group">
|
|
32
|
-
<div class="tsd-select" id="tsd-filter-visibility">
|
|
33
|
-
<span class="tsd-select-label">All</span>
|
|
34
|
-
<ul class="tsd-select-list">
|
|
35
|
-
<li data-value="public">Public</li>
|
|
36
|
-
<li data-value="protected">Public/Protected</li>
|
|
37
|
-
<li data-value="private" class="selected">All</li>
|
|
38
|
-
</ul>
|
|
39
|
-
</div>
|
|
40
|
-
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
41
|
-
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
42
|
-
<input type="checkbox" id="tsd-filter-externals" checked />
|
|
43
|
-
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
<div class="tsd-page-title">
|
|
52
|
-
<div class="container">
|
|
53
|
-
<ul class="tsd-breadcrumb">
|
|
54
|
-
<li>
|
|
55
|
-
<a href="../modules.html">@solana/web3.js</a>
|
|
56
|
-
</li>
|
|
57
|
-
<li>
|
|
58
|
-
<a href="bpfloader.html">BpfLoader</a>
|
|
59
|
-
</li>
|
|
60
|
-
</ul>
|
|
61
|
-
<h1>Class BpfLoader</h1>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</header>
|
|
65
|
-
<div class="container container-main">
|
|
66
|
-
<div class="row">
|
|
67
|
-
<div class="col-8 col-content">
|
|
68
|
-
<section class="tsd-panel tsd-comment">
|
|
69
|
-
<div class="tsd-comment tsd-typography">
|
|
70
|
-
<div class="lead">
|
|
71
|
-
<p>Factory class for transactions to interact with a program loader</p>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
</section>
|
|
75
|
-
<section class="tsd-panel tsd-hierarchy">
|
|
76
|
-
<h3>Hierarchy</h3>
|
|
77
|
-
<ul class="tsd-hierarchy">
|
|
78
|
-
<li>
|
|
79
|
-
<span class="target">BpfLoader</span>
|
|
80
|
-
</li>
|
|
81
|
-
</ul>
|
|
82
|
-
</section>
|
|
83
|
-
<section class="tsd-panel-group tsd-index-group">
|
|
84
|
-
<h2>Index</h2>
|
|
85
|
-
<section class="tsd-panel tsd-index-panel">
|
|
86
|
-
<div class="tsd-index-content">
|
|
87
|
-
<section class="tsd-index-section ">
|
|
88
|
-
<h3>Constructors</h3>
|
|
89
|
-
<ul class="tsd-index-list">
|
|
90
|
-
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="bpfloader.html#constructor" class="tsd-kind-icon">constructor</a></li>
|
|
91
|
-
</ul>
|
|
92
|
-
</section>
|
|
93
|
-
<section class="tsd-index-section ">
|
|
94
|
-
<h3>Methods</h3>
|
|
95
|
-
<ul class="tsd-index-list">
|
|
96
|
-
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="bpfloader.html#getminnumsignatures" class="tsd-kind-icon">get<wbr>Min<wbr>Num<wbr>Signatures</a></li>
|
|
97
|
-
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="bpfloader.html#load" class="tsd-kind-icon">load</a></li>
|
|
98
|
-
</ul>
|
|
99
|
-
</section>
|
|
100
|
-
</div>
|
|
101
|
-
</section>
|
|
102
|
-
</section>
|
|
103
|
-
<section class="tsd-panel-group tsd-member-group ">
|
|
104
|
-
<h2>Constructors</h2>
|
|
105
|
-
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
|
|
106
|
-
<a name="constructor" class="tsd-anchor"></a>
|
|
107
|
-
<h3>constructor</h3>
|
|
108
|
-
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
|
|
109
|
-
<li class="tsd-signature tsd-kind-icon">new <wbr>Bpf<wbr>Loader<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="bpfloader.html" class="tsd-signature-type" data-tsd-kind="Class">BpfLoader</a></li>
|
|
110
|
-
</ul>
|
|
111
|
-
<ul class="tsd-descriptions">
|
|
112
|
-
<li class="tsd-description">
|
|
113
|
-
<aside class="tsd-sources">
|
|
114
|
-
</aside>
|
|
115
|
-
<h4 class="tsd-returns-title">Returns <a href="bpfloader.html" class="tsd-signature-type" data-tsd-kind="Class">BpfLoader</a></h4>
|
|
116
|
-
</li>
|
|
117
|
-
</ul>
|
|
118
|
-
</section>
|
|
119
|
-
</section>
|
|
120
|
-
<section class="tsd-panel-group tsd-member-group ">
|
|
121
|
-
<h2>Methods</h2>
|
|
122
|
-
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
123
|
-
<a name="getminnumsignatures" class="tsd-anchor"></a>
|
|
124
|
-
<h3><span class="tsd-flag ts-flagStatic">Static</span> get<wbr>Min<wbr>Num<wbr>Signatures</h3>
|
|
125
|
-
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
126
|
-
<li class="tsd-signature tsd-kind-icon">get<wbr>Min<wbr>Num<wbr>Signatures<span class="tsd-signature-symbol">(</span>dataLength<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
|
|
127
|
-
</ul>
|
|
128
|
-
<ul class="tsd-descriptions">
|
|
129
|
-
<li class="tsd-description">
|
|
130
|
-
<aside class="tsd-sources">
|
|
131
|
-
<ul>
|
|
132
|
-
<li>Defined in <a href="https://github.com/solana-labs/solana-web3.js/blob/d5b2a1b/src/bpf-loader.ts#L20">bpf-loader.ts:20</a></li>
|
|
133
|
-
</ul>
|
|
134
|
-
</aside>
|
|
135
|
-
<div class="tsd-comment tsd-typography">
|
|
136
|
-
<div class="lead">
|
|
137
|
-
<p>Minimum number of signatures required to load a program not including
|
|
138
|
-
retries</p>
|
|
139
|
-
</div>
|
|
140
|
-
<p>Can be used to calculate transaction fees</p>
|
|
141
|
-
</div>
|
|
142
|
-
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
143
|
-
<ul class="tsd-parameters">
|
|
144
|
-
<li>
|
|
145
|
-
<h5>dataLength: <span class="tsd-signature-type">number</span></h5>
|
|
146
|
-
</li>
|
|
147
|
-
</ul>
|
|
148
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
|
|
149
|
-
</li>
|
|
150
|
-
</ul>
|
|
151
|
-
</section>
|
|
152
|
-
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
153
|
-
<a name="load" class="tsd-anchor"></a>
|
|
154
|
-
<h3><span class="tsd-flag ts-flagStatic">Static</span> load</h3>
|
|
155
|
-
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
156
|
-
<li class="tsd-signature tsd-kind-icon">load<span class="tsd-signature-symbol">(</span>connection<span class="tsd-signature-symbol">: </span><a href="connection.html" class="tsd-signature-type" data-tsd-kind="Class">Connection</a>, payer<span class="tsd-signature-symbol">: </span><a href="account.html" class="tsd-signature-type" data-tsd-kind="Class">Account</a>, program<span class="tsd-signature-symbol">: </span><a href="account.html" class="tsd-signature-type" data-tsd-kind="Class">Account</a>, elf<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span>, loaderProgramId<span class="tsd-signature-symbol">: </span><a href="publickey.html" class="tsd-signature-type" data-tsd-kind="Class">PublicKey</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></li>
|
|
157
|
-
</ul>
|
|
158
|
-
<ul class="tsd-descriptions">
|
|
159
|
-
<li class="tsd-description">
|
|
160
|
-
<aside class="tsd-sources">
|
|
161
|
-
<ul>
|
|
162
|
-
<li>Defined in <a href="https://github.com/solana-labs/solana-web3.js/blob/d5b2a1b/src/bpf-loader.ts#L34">bpf-loader.ts:34</a></li>
|
|
163
|
-
</ul>
|
|
164
|
-
</aside>
|
|
165
|
-
<div class="tsd-comment tsd-typography">
|
|
166
|
-
<div class="lead">
|
|
167
|
-
<p>Load a BPF program</p>
|
|
168
|
-
</div>
|
|
169
|
-
</div>
|
|
170
|
-
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
171
|
-
<ul class="tsd-parameters">
|
|
172
|
-
<li>
|
|
173
|
-
<h5>connection: <a href="connection.html" class="tsd-signature-type" data-tsd-kind="Class">Connection</a></h5>
|
|
174
|
-
<div class="tsd-comment tsd-typography">
|
|
175
|
-
<p>The connection to use</p>
|
|
176
|
-
</div>
|
|
177
|
-
</li>
|
|
178
|
-
<li>
|
|
179
|
-
<h5>payer: <a href="account.html" class="tsd-signature-type" data-tsd-kind="Class">Account</a></h5>
|
|
180
|
-
<div class="tsd-comment tsd-typography">
|
|
181
|
-
<p>Account that will pay program loading fees</p>
|
|
182
|
-
</div>
|
|
183
|
-
</li>
|
|
184
|
-
<li>
|
|
185
|
-
<h5>program: <a href="account.html" class="tsd-signature-type" data-tsd-kind="Class">Account</a></h5>
|
|
186
|
-
<div class="tsd-comment tsd-typography">
|
|
187
|
-
<p>Account to load the program into</p>
|
|
188
|
-
</div>
|
|
189
|
-
</li>
|
|
190
|
-
<li>
|
|
191
|
-
<h5>elf: <span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5>
|
|
192
|
-
<div class="tsd-comment tsd-typography">
|
|
193
|
-
<p>The entire ELF containing the BPF program</p>
|
|
194
|
-
</div>
|
|
195
|
-
</li>
|
|
196
|
-
<li>
|
|
197
|
-
<h5>loaderProgramId: <a href="publickey.html" class="tsd-signature-type" data-tsd-kind="Class">PublicKey</a></h5>
|
|
198
|
-
<div class="tsd-comment tsd-typography">
|
|
199
|
-
<p>The program id of the BPF loader to use</p>
|
|
200
|
-
</div>
|
|
201
|
-
</li>
|
|
202
|
-
</ul>
|
|
203
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4>
|
|
204
|
-
<p>true if program was loaded successfully, false if program was already loaded</p>
|
|
205
|
-
</li>
|
|
206
|
-
</ul>
|
|
207
|
-
</section>
|
|
208
|
-
</section>
|
|
209
|
-
</div>
|
|
210
|
-
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
211
|
-
<nav class="tsd-navigation primary">
|
|
212
|
-
<ul>
|
|
213
|
-
<li class=" ">
|
|
214
|
-
<a href="../modules.html">Exports</a>
|
|
215
|
-
</li>
|
|
216
|
-
</ul>
|
|
217
|
-
</nav>
|
|
218
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
219
|
-
<ul class="before-current">
|
|
220
|
-
</ul>
|
|
221
|
-
<ul class="current">
|
|
222
|
-
<li class="current tsd-kind-class">
|
|
223
|
-
<a href="bpfloader.html" class="tsd-kind-icon">Bpf<wbr>Loader</a>
|
|
224
|
-
<ul>
|
|
225
|
-
<li class=" tsd-kind-constructor tsd-parent-kind-class">
|
|
226
|
-
<a href="bpfloader.html#constructor" class="tsd-kind-icon">constructor</a>
|
|
227
|
-
</li>
|
|
228
|
-
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
229
|
-
<a href="bpfloader.html#getminnumsignatures" class="tsd-kind-icon">get<wbr>Min<wbr>Num<wbr>Signatures</a>
|
|
230
|
-
</li>
|
|
231
|
-
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
232
|
-
<a href="bpfloader.html#load" class="tsd-kind-icon">load</a>
|
|
233
|
-
</li>
|
|
234
|
-
</ul>
|
|
235
|
-
</li>
|
|
236
|
-
</ul>
|
|
237
|
-
<ul class="after-current">
|
|
238
|
-
</ul>
|
|
239
|
-
</nav>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
</div>
|
|
243
|
-
<footer class="with-border-bottom">
|
|
244
|
-
<div class="container">
|
|
245
|
-
<h2>Legend</h2>
|
|
246
|
-
<div class="tsd-legend-group">
|
|
247
|
-
<ul class="tsd-legend">
|
|
248
|
-
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
249
|
-
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
|
|
250
|
-
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
251
|
-
</ul>
|
|
252
|
-
<ul class="tsd-legend">
|
|
253
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
254
|
-
</ul>
|
|
255
|
-
<ul class="tsd-legend">
|
|
256
|
-
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
|
|
257
|
-
</ul>
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
</footer>
|
|
261
|
-
<div class="container tsd-generator">
|
|
262
|
-
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
|
263
|
-
</div>
|
|
264
|
-
<div class="overlay"></div>
|
|
265
|
-
<script src="../assets/js/main.js"></script>
|
|
266
|
-
</body>
|
|
267
|
-
</html>
|