@gitopia/gitopiajs 0.0.2 → 0.0.4
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/package.json +3 -3
- package/dist/LICENSE +0 -21
- package/dist/amino/amino.d.ts +0 -1
- package/dist/amino/amino.js +0 -2
- package/dist/amino/bundle.d.ts +0 -1
- package/dist/amino/bundle.js +0 -41
- package/dist/binary.d.ts +0 -130
- package/dist/binary.js +0 -371
- package/dist/cosmos/bank/v1beta1/bank.d.ts +0 -407
- package/dist/cosmos/bank/v1beta1/bank.js +0 -664
- package/dist/cosmos/bank/v1beta1/query.d.ts +0 -1062
- package/dist/cosmos/bank/v1beta1/query.js +0 -1759
- package/dist/cosmos/bank/v1beta1/query.lcd.d.ts +0 -19
- package/dist/cosmos/bank/v1beta1/query.lcd.js +0 -173
- package/dist/cosmos/bank/v1beta1/query.rpc.Query.d.ts +0 -106
- package/dist/cosmos/bank/v1beta1/query.rpc.Query.js +0 -123
- package/dist/cosmos/base/query/v1beta1/pagination.d.ts +0 -190
- package/dist/cosmos/base/query/v1beta1/pagination.js +0 -204
- package/dist/cosmos/base/v1beta1/coin.d.ts +0 -193
- package/dist/cosmos/base/v1beta1/coin.js +0 -306
- package/dist/cosmos/bundle.d.ts +0 -2311
- package/dist/cosmos/bundle.js +0 -134
- package/dist/cosmos/client.d.ts +0 -84
- package/dist/cosmos/client.js +0 -65
- package/dist/cosmos/feegrant/v1beta1/feegrant.d.ts +0 -245
- package/dist/cosmos/feegrant/v1beta1/feegrant.js +0 -456
- package/dist/cosmos/feegrant/v1beta1/query.d.ts +0 -258
- package/dist/cosmos/feegrant/v1beta1/query.js +0 -487
- package/dist/cosmos/feegrant/v1beta1/query.lcd.d.ts +0 -11
- package/dist/cosmos/feegrant/v1beta1/query.lcd.js +0 -44
- package/dist/cosmos/feegrant/v1beta1/query.rpc.Query.d.ts +0 -28
- package/dist/cosmos/feegrant/v1beta1/query.rpc.Query.js +0 -47
- package/dist/cosmos/gov/v1beta1/gov.d.ts +0 -571
- package/dist/cosmos/gov/v1beta1/gov.js +0 -1122
- package/dist/cosmos/gov/v1beta1/query.d.ts +0 -636
- package/dist/cosmos/gov/v1beta1/query.js +0 -1264
- package/dist/cosmos/gov/v1beta1/query.lcd.d.ts +0 -16
- package/dist/cosmos/gov/v1beta1/query.lcd.js +0 -87
- package/dist/cosmos/gov/v1beta1/query.rpc.Query.d.ts +0 -44
- package/dist/cosmos/gov/v1beta1/query.rpc.Query.js +0 -92
- package/dist/cosmos/group/v1/query.d.ts +0 -1097
- package/dist/cosmos/group/v1/query.js +0 -2182
- package/dist/cosmos/group/v1/query.lcd.d.ts +0 -22
- package/dist/cosmos/group/v1/query.lcd.js +0 -158
- package/dist/cosmos/group/v1/query.rpc.Query.d.ts +0 -78
- package/dist/cosmos/group/v1/query.rpc.Query.js +0 -148
- package/dist/cosmos/group/v1/tx.amino.d.ts +0 -73
- package/dist/cosmos/group/v1/tx.amino.js +0 -77
- package/dist/cosmos/group/v1/tx.d.ts +0 -1198
- package/dist/cosmos/group/v1/tx.js +0 -2362
- package/dist/cosmos/group/v1/tx.registry.d.ts +0 -180
- package/dist/cosmos/group/v1/tx.registry.js +0 -271
- package/dist/cosmos/group/v1/tx.rpc.msg.d.ts +0 -51
- package/dist/cosmos/group/v1/tx.rpc.msg.js +0 -96
- package/dist/cosmos/group/v1/types.d.ts +0 -873
- package/dist/cosmos/group/v1/types.js +0 -1495
- package/dist/cosmos/msg/v1/msg.d.ts +0 -1
- package/dist/cosmos/msg/v1/msg.js +0 -2
- package/dist/cosmos/query/v1/query.d.ts +0 -1
- package/dist/cosmos/query/v1/query.js +0 -2
- package/dist/cosmos/rpc.query.d.ts +0 -59
- package/dist/cosmos/rpc.query.js +0 -60
- package/dist/cosmos/rpc.tx.d.ts +0 -10
- package/dist/cosmos/rpc.tx.js +0 -44
- package/dist/cosmos/upgrade/v1beta1/upgrade.d.ts +0 -278
- package/dist/cosmos/upgrade/v1beta1/upgrade.js +0 -382
- package/dist/cosmos_proto/bundle.d.ts +0 -32
- package/dist/cosmos_proto/bundle.js +0 -41
- package/dist/cosmos_proto/cosmos.d.ts +0 -171
- package/dist/cosmos_proto/cosmos.js +0 -221
- package/dist/esm/amino/amino.js +0 -1
- package/dist/esm/amino/bundle.js +0 -5
- package/dist/esm/binary.js +0 -366
- package/dist/esm/cosmos/bank/v1beta1/bank.js +0 -661
- package/dist/esm/cosmos/bank/v1beta1/query.js +0 -1756
- package/dist/esm/cosmos/bank/v1beta1/query.lcd.js +0 -169
- package/dist/esm/cosmos/bank/v1beta1/query.rpc.Query.js +0 -118
- package/dist/esm/cosmos/base/query/v1beta1/pagination.js +0 -201
- package/dist/esm/cosmos/base/v1beta1/coin.js +0 -303
- package/dist/esm/cosmos/bundle.js +0 -98
- package/dist/esm/cosmos/client.js +0 -27
- package/dist/esm/cosmos/feegrant/v1beta1/feegrant.js +0 -450
- package/dist/esm/cosmos/feegrant/v1beta1/query.js +0 -484
- package/dist/esm/cosmos/feegrant/v1beta1/query.lcd.js +0 -40
- package/dist/esm/cosmos/feegrant/v1beta1/query.rpc.Query.js +0 -42
- package/dist/esm/cosmos/gov/v1beta1/gov.js +0 -1112
- package/dist/esm/cosmos/gov/v1beta1/query.js +0 -1261
- package/dist/esm/cosmos/gov/v1beta1/query.lcd.js +0 -83
- package/dist/esm/cosmos/gov/v1beta1/query.rpc.Query.js +0 -87
- package/dist/esm/cosmos/group/v1/query.js +0 -2179
- package/dist/esm/cosmos/group/v1/query.lcd.js +0 -154
- package/dist/esm/cosmos/group/v1/query.rpc.Query.js +0 -143
- package/dist/esm/cosmos/group/v1/tx.amino.js +0 -74
- package/dist/esm/cosmos/group/v1/tx.js +0 -2354
- package/dist/esm/cosmos/group/v1/tx.registry.js +0 -267
- package/dist/esm/cosmos/group/v1/tx.rpc.msg.js +0 -92
- package/dist/esm/cosmos/group/v1/types.js +0 -1483
- package/dist/esm/cosmos/msg/v1/msg.js +0 -1
- package/dist/esm/cosmos/query/v1/query.js +0 -1
- package/dist/esm/cosmos/rpc.query.js +0 -23
- package/dist/esm/cosmos/rpc.tx.js +0 -7
- package/dist/esm/cosmos/upgrade/v1beta1/upgrade.js +0 -379
- package/dist/esm/cosmos_proto/bundle.js +0 -5
- package/dist/esm/cosmos_proto/cosmos.js +0 -216
- package/dist/esm/gitopia/bundle.js +0 -95
- package/dist/esm/gitopia/client.js +0 -32
- package/dist/esm/gitopia/custom-lcd-client.js +0 -50
- package/dist/esm/gitopia/gitopia/gitopia/attachment.js +0 -101
- package/dist/esm/gitopia/gitopia/gitopia/bounty.js +0 -255
- package/dist/esm/gitopia/gitopia/gitopia/branch.js +0 -137
- package/dist/esm/gitopia/gitopia/gitopia/comment.js +0 -488
- package/dist/esm/gitopia/gitopia/gitopia/dao.js +0 -451
- package/dist/esm/gitopia/gitopia/gitopia/exercised_amount.js +0 -78
- package/dist/esm/gitopia/gitopia/gitopia/genesis.js +0 -460
- package/dist/esm/gitopia/gitopia/gitopia/issue.js +0 -323
- package/dist/esm/gitopia/gitopia/gitopia/params.js +0 -293
- package/dist/esm/gitopia/gitopia/gitopia/pullRequest.js +0 -565
- package/dist/esm/gitopia/gitopia/gitopia/query.js +0 -7351
- package/dist/esm/gitopia/gitopia/gitopia/query.lcd.js +0 -452
- package/dist/esm/gitopia/gitopia/gitopia/query.rpc.Query.js +0 -453
- package/dist/esm/gitopia/gitopia/gitopia/reaction.js +0 -123
- package/dist/esm/gitopia/gitopia/gitopia/release.js +0 -225
- package/dist/esm/gitopia/gitopia/gitopia/repository.js +0 -1200
- package/dist/esm/gitopia/gitopia/gitopia/tag.js +0 -125
- package/dist/esm/gitopia/gitopia/gitopia/task.js +0 -197
- package/dist/esm/gitopia/gitopia/gitopia/tx.amino.js +0 -464
- package/dist/esm/gitopia/gitopia/gitopia/tx.js +0 -14679
- package/dist/esm/gitopia/gitopia/gitopia/tx.registry.js +0 -1671
- package/dist/esm/gitopia/gitopia/gitopia/tx.rpc.msg.js +0 -560
- package/dist/esm/gitopia/gitopia/gitopia/user.js +0 -340
- package/dist/esm/gitopia/gitopia/gitopia/whois.js +0 -146
- package/dist/esm/gitopia/gitopia/offchain/offchain.js +0 -144
- package/dist/esm/gitopia/gitopia/rewards/genesis.js +0 -82
- package/dist/esm/gitopia/gitopia/rewards/params.js +0 -81
- package/dist/esm/gitopia/gitopia/rewards/pool.js +0 -191
- package/dist/esm/gitopia/gitopia/rewards/query.js +0 -654
- package/dist/esm/gitopia/gitopia/rewards/query.lcd.js +0 -40
- package/dist/esm/gitopia/gitopia/rewards/query.rpc.Query.js +0 -53
- package/dist/esm/gitopia/gitopia/rewards/rewards.js +0 -191
- package/dist/esm/gitopia/gitopia/rewards/task.js +0 -176
- package/dist/esm/gitopia/gitopia/rewards/tx.amino.js +0 -19
- package/dist/esm/gitopia/gitopia/rewards/tx.js +0 -525
- package/dist/esm/gitopia/gitopia/rewards/tx.registry.js +0 -69
- package/dist/esm/gitopia/gitopia/rewards/tx.rpc.msg.js +0 -26
- package/dist/esm/gitopia/rpc.query.js +0 -29
- package/dist/esm/gitopia/rpc.tx.js +0 -13
- package/dist/esm/gogoproto/bundle.js +0 -5
- package/dist/esm/gogoproto/gogo.js +0 -1
- package/dist/esm/google/api/annotations.js +0 -1
- package/dist/esm/google/api/http.js +0 -329
- package/dist/esm/google/bundle.js +0 -14
- package/dist/esm/google/protobuf/any.js +0 -74
- package/dist/esm/google/protobuf/descriptor.js +0 -4848
- package/dist/esm/google/protobuf/duration.js +0 -71
- package/dist/esm/google/protobuf/timestamp.js +0 -68
- package/dist/esm/helpers.js +0 -129
- package/dist/esm/ibc/applications/transfer/v1/query.js +0 -847
- package/dist/esm/ibc/applications/transfer/v1/query.lcd.js +0 -70
- package/dist/esm/ibc/applications/transfer/v1/query.rpc.Query.js +0 -71
- package/dist/esm/ibc/applications/transfer/v1/transfer.js +0 -164
- package/dist/esm/ibc/applications/transfer/v1/tx.amino.js +0 -9
- package/dist/esm/ibc/applications/transfer/v1/tx.js +0 -226
- package/dist/esm/ibc/applications/transfer/v1/tx.registry.js +0 -33
- package/dist/esm/ibc/applications/transfer/v1/tx.rpc.msg.js +0 -14
- package/dist/esm/ibc/bundle.js +0 -44
- package/dist/esm/ibc/client.js +0 -29
- package/dist/esm/ibc/core/client/v1/client.js +0 -611
- package/dist/esm/ibc/rpc.query.js +0 -30
- package/dist/esm/ibc/rpc.tx.js +0 -14
- package/dist/esm/index.js +0 -19
- package/dist/esm/utf8.js +0 -137
- package/dist/esm/varint.js +0 -408
- package/dist/gitopia/bundle.d.ts +0 -6123
- package/dist/gitopia/bundle.js +0 -131
- package/dist/gitopia/client.d.ts +0 -492
- package/dist/gitopia/client.js +0 -70
- package/dist/gitopia/custom-lcd-client.d.ts +0 -31
- package/dist/gitopia/custom-lcd-client.js +0 -87
- package/dist/gitopia/gitopia/gitopia/attachment.d.ts +0 -39
- package/dist/gitopia/gitopia/gitopia/attachment.js +0 -104
- package/dist/gitopia/gitopia/gitopia/bounty.d.ts +0 -79
- package/dist/gitopia/gitopia/gitopia/bounty.js +0 -262
- package/dist/gitopia/gitopia/gitopia/branch.d.ts +0 -48
- package/dist/gitopia/gitopia/gitopia/branch.js +0 -140
- package/dist/gitopia/gitopia/gitopia/comment.d.ts +0 -125
- package/dist/gitopia/gitopia/gitopia/comment.js +0 -495
- package/dist/gitopia/gitopia/gitopia/dao.d.ts +0 -160
- package/dist/gitopia/gitopia/gitopia/dao.js +0 -454
- package/dist/gitopia/gitopia/gitopia/exercised_amount.d.ts +0 -34
- package/dist/gitopia/gitopia/gitopia/exercised_amount.js +0 -81
- package/dist/gitopia/gitopia/gitopia/genesis.d.ts +0 -143
- package/dist/gitopia/gitopia/gitopia/genesis.js +0 -463
- package/dist/gitopia/gitopia/gitopia/issue.d.ts +0 -88
- package/dist/gitopia/gitopia/gitopia/issue.js +0 -328
- package/dist/gitopia/gitopia/gitopia/params.d.ts +0 -115
- package/dist/gitopia/gitopia/gitopia/params.js +0 -296
- package/dist/gitopia/gitopia/gitopia/pullRequest.d.ts +0 -177
- package/dist/gitopia/gitopia/gitopia/pullRequest.js +0 -570
- package/dist/gitopia/gitopia/gitopia/query.d.ts +0 -3130
- package/dist/gitopia/gitopia/gitopia/query.js +0 -7355
- package/dist/gitopia/gitopia/gitopia/query.lcd.d.ts +0 -54
- package/dist/gitopia/gitopia/gitopia/query.lcd.js +0 -456
- package/dist/gitopia/gitopia/gitopia/query.rpc.Query.d.ts +0 -188
- package/dist/gitopia/gitopia/gitopia/query.rpc.Query.js +0 -458
- package/dist/gitopia/gitopia/gitopia/reaction.d.ts +0 -42
- package/dist/gitopia/gitopia/gitopia/reaction.js +0 -128
- package/dist/gitopia/gitopia/gitopia/release.d.ts +0 -70
- package/dist/gitopia/gitopia/gitopia/release.js +0 -228
- package/dist/gitopia/gitopia/gitopia/repository.d.ts +0 -424
- package/dist/gitopia/gitopia/gitopia/repository.js +0 -1207
- package/dist/gitopia/gitopia/gitopia/tag.d.ts +0 -45
- package/dist/gitopia/gitopia/gitopia/tag.js +0 -128
- package/dist/gitopia/gitopia/gitopia/task.d.ts +0 -64
- package/dist/gitopia/gitopia/gitopia/task.js +0 -204
- package/dist/gitopia/gitopia/gitopia/tx.amino.d.ts +0 -463
- package/dist/gitopia/gitopia/gitopia/tx.amino.js +0 -467
- package/dist/gitopia/gitopia/gitopia/tx.d.ts +0 -6246
- package/dist/gitopia/gitopia/gitopia/tx.js +0 -14687
- package/dist/gitopia/gitopia/gitopia/tx.registry.d.ts +0 -1116
- package/dist/gitopia/gitopia/gitopia/tx.registry.js +0 -1675
- package/dist/gitopia/gitopia/gitopia/tx.rpc.msg.d.ts +0 -200
- package/dist/gitopia/gitopia/gitopia/tx.rpc.msg.js +0 -564
- package/dist/gitopia/gitopia/gitopia/user.d.ts +0 -104
- package/dist/gitopia/gitopia/gitopia/user.js +0 -343
- package/dist/gitopia/gitopia/gitopia/whois.d.ts +0 -51
- package/dist/gitopia/gitopia/gitopia/whois.js +0 -151
- package/dist/gitopia/gitopia/offchain/offchain.d.ts +0 -74
- package/dist/gitopia/gitopia/offchain/offchain.js +0 -147
- package/dist/gitopia/gitopia/rewards/genesis.d.ts +0 -40
- package/dist/gitopia/gitopia/rewards/genesis.js +0 -85
- package/dist/gitopia/gitopia/rewards/params.d.ts +0 -37
- package/dist/gitopia/gitopia/rewards/params.js +0 -84
- package/dist/gitopia/gitopia/rewards/pool.d.ts +0 -59
- package/dist/gitopia/gitopia/rewards/pool.js +0 -196
- package/dist/gitopia/gitopia/rewards/query.d.ts +0 -294
- package/dist/gitopia/gitopia/rewards/query.js +0 -657
- package/dist/gitopia/gitopia/rewards/query.lcd.d.ts +0 -12
- package/dist/gitopia/gitopia/rewards/query.lcd.js +0 -44
- package/dist/gitopia/gitopia/rewards/query.rpc.Query.d.ts +0 -28
- package/dist/gitopia/gitopia/rewards/query.rpc.Query.js +0 -58
- package/dist/gitopia/gitopia/rewards/rewards.d.ts +0 -79
- package/dist/gitopia/gitopia/rewards/rewards.js +0 -194
- package/dist/gitopia/gitopia/rewards/task.d.ts +0 -54
- package/dist/gitopia/gitopia/rewards/task.js +0 -181
- package/dist/gitopia/gitopia/rewards/tx.amino.d.ts +0 -18
- package/dist/gitopia/gitopia/rewards/tx.amino.js +0 -22
- package/dist/gitopia/gitopia/rewards/tx.d.ts +0 -242
- package/dist/gitopia/gitopia/rewards/tx.js +0 -528
- package/dist/gitopia/gitopia/rewards/tx.registry.d.ts +0 -48
- package/dist/gitopia/gitopia/rewards/tx.registry.js +0 -73
- package/dist/gitopia/gitopia/rewards/tx.rpc.msg.d.ts +0 -19
- package/dist/gitopia/gitopia/rewards/tx.rpc.msg.js +0 -30
- package/dist/gitopia/rpc.query.d.ts +0 -117
- package/dist/gitopia/rpc.query.js +0 -66
- package/dist/gitopia/rpc.tx.d.ts +0 -16
- package/dist/gitopia/rpc.tx.js +0 -50
- package/dist/gogoproto/bundle.d.ts +0 -1
- package/dist/gogoproto/bundle.js +0 -41
- package/dist/gogoproto/gogo.d.ts +0 -1
- package/dist/gogoproto/gogo.js +0 -2
- package/dist/google/api/annotations.d.ts +0 -1
- package/dist/google/api/annotations.js +0 -2
- package/dist/google/api/http.d.ts +0 -1049
- package/dist/google/api/http.js +0 -332
- package/dist/google/bundle.d.ts +0 -525
- package/dist/google/bundle.js +0 -50
- package/dist/google/protobuf/any.d.ts +0 -358
- package/dist/google/protobuf/any.js +0 -77
- package/dist/google/protobuf/descriptor.d.ts +0 -3178
- package/dist/google/protobuf/descriptor.js +0 -4886
- package/dist/google/protobuf/duration.d.ts +0 -223
- package/dist/google/protobuf/duration.js +0 -74
- package/dist/google/protobuf/timestamp.d.ts +0 -314
- package/dist/google/protobuf/timestamp.js +0 -71
- package/dist/helpers.d.ts +0 -82
- package/dist/helpers.js +0 -144
- package/dist/ibc/applications/transfer/v1/query.d.ts +0 -479
- package/dist/ibc/applications/transfer/v1/query.js +0 -850
- package/dist/ibc/applications/transfer/v1/query.lcd.d.ts +0 -14
- package/dist/ibc/applications/transfer/v1/query.lcd.js +0 -74
- package/dist/ibc/applications/transfer/v1/query.rpc.Query.d.ts +0 -36
- package/dist/ibc/applications/transfer/v1/query.rpc.Query.js +0 -76
- package/dist/ibc/applications/transfer/v1/transfer.d.ts +0 -123
- package/dist/ibc/applications/transfer/v1/transfer.js +0 -167
- package/dist/ibc/applications/transfer/v1/tx.amino.d.ts +0 -8
- package/dist/ibc/applications/transfer/v1/tx.amino.js +0 -12
- package/dist/ibc/applications/transfer/v1/tx.d.ts +0 -132
- package/dist/ibc/applications/transfer/v1/tx.js +0 -229
- package/dist/ibc/applications/transfer/v1/tx.registry.d.ts +0 -24
- package/dist/ibc/applications/transfer/v1/tx.registry.js +0 -37
- package/dist/ibc/applications/transfer/v1/tx.rpc.msg.d.ts +0 -12
- package/dist/ibc/applications/transfer/v1/tx.rpc.msg.js +0 -18
- package/dist/ibc/bundle.d.ts +0 -450
- package/dist/ibc/bundle.js +0 -80
- package/dist/ibc/client.d.ts +0 -22
- package/dist/ibc/client.js +0 -67
- package/dist/ibc/core/client/v1/client.d.ts +0 -408
- package/dist/ibc/core/client/v1/client.js +0 -614
- package/dist/ibc/rpc.query.d.ts +0 -73
- package/dist/ibc/rpc.query.js +0 -67
- package/dist/ibc/rpc.tx.d.ts +0 -17
- package/dist/ibc/rpc.tx.js +0 -51
- package/dist/index.d.ts +0 -18
- package/dist/index.js +0 -35
- package/dist/package.json +0 -46
- package/dist/utf8.d.ts +0 -27
- package/dist/utf8.js +0 -141
- package/dist/varint.d.ts +0 -105
- package/dist/varint.js +0 -426
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitopia/gitopiajs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"author": "Faza Mahamood <faza@gitopia.org>",
|
|
5
5
|
"description": "js client library for gitopia protocol",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "index.js",
|
|
7
7
|
"module": "esm/index.js",
|
|
8
8
|
"types": "index.d.ts",
|
|
9
9
|
"homepage": "https://gitopia.com/gitopia/gitopiajs",
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
},
|
|
44
44
|
"keywords": [],
|
|
45
45
|
"gitHead": "9881fb7f3da56c24e402ebb3283a6370874b8bba"
|
|
46
|
-
}
|
|
46
|
+
}
|
package/dist/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Faza Mahamood <faza@gitopia.org>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/amino/amino.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/amino/amino.js
DELETED
package/dist/amino/bundle.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const amino: {};
|
package/dist/amino/bundle.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.amino = void 0;
|
|
37
|
-
//@ts-nocheck
|
|
38
|
-
const _0 = __importStar(require("./amino"));
|
|
39
|
-
exports.amino = {
|
|
40
|
-
..._0
|
|
41
|
-
};
|
package/dist/binary.d.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.0
|
|
3
|
-
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
4
|
-
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
|
|
5
|
-
*/
|
|
6
|
-
export declare enum WireType {
|
|
7
|
-
Varint = 0,
|
|
8
|
-
Fixed64 = 1,
|
|
9
|
-
Bytes = 2,
|
|
10
|
-
Fixed32 = 5
|
|
11
|
-
}
|
|
12
|
-
export interface IBinaryReader {
|
|
13
|
-
buf: Uint8Array;
|
|
14
|
-
pos: number;
|
|
15
|
-
type: number;
|
|
16
|
-
len: number;
|
|
17
|
-
tag(): [number, WireType, number];
|
|
18
|
-
skip(length?: number): this;
|
|
19
|
-
skipType(wireType: number): this;
|
|
20
|
-
uint32(): number;
|
|
21
|
-
int32(): number;
|
|
22
|
-
sint32(): number;
|
|
23
|
-
fixed32(): number;
|
|
24
|
-
sfixed32(): number;
|
|
25
|
-
int64(): bigint;
|
|
26
|
-
uint64(): bigint;
|
|
27
|
-
sint64(): bigint;
|
|
28
|
-
fixed64(): bigint;
|
|
29
|
-
sfixed64(): bigint;
|
|
30
|
-
float(): number;
|
|
31
|
-
double(): number;
|
|
32
|
-
bool(): boolean;
|
|
33
|
-
bytes(): Uint8Array;
|
|
34
|
-
string(): string;
|
|
35
|
-
}
|
|
36
|
-
export declare class BinaryReader implements IBinaryReader {
|
|
37
|
-
buf: Uint8Array;
|
|
38
|
-
pos: number;
|
|
39
|
-
type: number;
|
|
40
|
-
len: number;
|
|
41
|
-
assertBounds(): void;
|
|
42
|
-
constructor(buf?: ArrayLike<number>);
|
|
43
|
-
tag(): [number, WireType, number];
|
|
44
|
-
skip(length?: number): this;
|
|
45
|
-
skipType(wireType: number): this;
|
|
46
|
-
uint32(): number;
|
|
47
|
-
int32(): number;
|
|
48
|
-
sint32(): number;
|
|
49
|
-
fixed32(): number;
|
|
50
|
-
sfixed32(): number;
|
|
51
|
-
int64(): bigint;
|
|
52
|
-
uint64(): bigint;
|
|
53
|
-
sint64(): bigint;
|
|
54
|
-
fixed64(): bigint;
|
|
55
|
-
sfixed64(): bigint;
|
|
56
|
-
float(): number;
|
|
57
|
-
double(): number;
|
|
58
|
-
bool(): boolean;
|
|
59
|
-
bytes(): Uint8Array;
|
|
60
|
-
string(): string;
|
|
61
|
-
}
|
|
62
|
-
export interface IBinaryWriter {
|
|
63
|
-
len: number;
|
|
64
|
-
head: IOp;
|
|
65
|
-
tail: IOp;
|
|
66
|
-
states: State | null;
|
|
67
|
-
finish(): Uint8Array;
|
|
68
|
-
fork(): IBinaryWriter;
|
|
69
|
-
reset(): IBinaryWriter;
|
|
70
|
-
ldelim(): IBinaryWriter;
|
|
71
|
-
tag(fieldNo: number, type: WireType): IBinaryWriter;
|
|
72
|
-
uint32(value: number): IBinaryWriter;
|
|
73
|
-
int32(value: number): IBinaryWriter;
|
|
74
|
-
sint32(value: number): IBinaryWriter;
|
|
75
|
-
int64(value: string | number | bigint): IBinaryWriter;
|
|
76
|
-
uint64: (value: string | number | bigint) => IBinaryWriter;
|
|
77
|
-
sint64(value: string | number | bigint): IBinaryWriter;
|
|
78
|
-
fixed64(value: string | number | bigint): IBinaryWriter;
|
|
79
|
-
sfixed64: (value: string | number | bigint) => IBinaryWriter;
|
|
80
|
-
bool(value: boolean): IBinaryWriter;
|
|
81
|
-
fixed32(value: number): IBinaryWriter;
|
|
82
|
-
sfixed32: (value: number) => IBinaryWriter;
|
|
83
|
-
float(value: number): IBinaryWriter;
|
|
84
|
-
double(value: number): IBinaryWriter;
|
|
85
|
-
bytes(value: Uint8Array): IBinaryWriter;
|
|
86
|
-
string(value: string): IBinaryWriter;
|
|
87
|
-
}
|
|
88
|
-
interface IOp {
|
|
89
|
-
len: number;
|
|
90
|
-
next?: IOp;
|
|
91
|
-
proceed(buf: Uint8Array | number[], pos: number): void;
|
|
92
|
-
}
|
|
93
|
-
declare class State {
|
|
94
|
-
head: IOp;
|
|
95
|
-
tail: IOp;
|
|
96
|
-
len: number;
|
|
97
|
-
next: State | null;
|
|
98
|
-
constructor(writer: BinaryWriter);
|
|
99
|
-
}
|
|
100
|
-
export declare class BinaryWriter implements IBinaryWriter {
|
|
101
|
-
len: number;
|
|
102
|
-
head: IOp;
|
|
103
|
-
tail: IOp;
|
|
104
|
-
states: State | null;
|
|
105
|
-
constructor();
|
|
106
|
-
static create(): BinaryWriter;
|
|
107
|
-
static alloc(size: number): Uint8Array | number[];
|
|
108
|
-
private _push;
|
|
109
|
-
finish(): Uint8Array;
|
|
110
|
-
fork(): BinaryWriter;
|
|
111
|
-
reset(): BinaryWriter;
|
|
112
|
-
ldelim(): BinaryWriter;
|
|
113
|
-
tag(fieldNo: number, type: WireType): BinaryWriter;
|
|
114
|
-
uint32(value: number): BinaryWriter;
|
|
115
|
-
int32(value: number): BinaryWriter;
|
|
116
|
-
sint32(value: number): BinaryWriter;
|
|
117
|
-
int64(value: string | number | bigint): BinaryWriter;
|
|
118
|
-
uint64: (value: string | number | bigint) => BinaryWriter;
|
|
119
|
-
sint64(value: string | number | bigint): BinaryWriter;
|
|
120
|
-
fixed64(value: string | number | bigint): BinaryWriter;
|
|
121
|
-
sfixed64: (value: string | number | bigint) => BinaryWriter;
|
|
122
|
-
bool(value: boolean): BinaryWriter;
|
|
123
|
-
fixed32(value: number): BinaryWriter;
|
|
124
|
-
sfixed32: (value: number) => BinaryWriter;
|
|
125
|
-
float(value: number): BinaryWriter;
|
|
126
|
-
double(value: number): BinaryWriter;
|
|
127
|
-
bytes(value: Uint8Array): BinaryWriter;
|
|
128
|
-
string(value: string): BinaryWriter;
|
|
129
|
-
}
|
|
130
|
-
export {};
|
package/dist/binary.js
DELETED
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//@ts-nocheck
|
|
3
|
-
/**
|
|
4
|
-
* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.0
|
|
5
|
-
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
6
|
-
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.BinaryWriter = exports.BinaryReader = exports.WireType = void 0;
|
|
10
|
-
// Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
|
11
|
-
// Redistribution and use in source and binary forms, with or without
|
|
12
|
-
// modification, are permitted provided that the following conditions are
|
|
13
|
-
// met:
|
|
14
|
-
// * Redistributions of source code must retain the above copyright
|
|
15
|
-
// notice, this list of conditions and the following disclaimer.
|
|
16
|
-
// * Redistributions in binary form must reproduce the above copyright
|
|
17
|
-
// notice, this list of conditions and the following disclaimer in the
|
|
18
|
-
// documentation and/or other materials provided with the distribution.
|
|
19
|
-
// * Neither the name of its author, nor the names of its contributors
|
|
20
|
-
// may be used to endorse or promote products derived from this software
|
|
21
|
-
// without specific prior written permission.
|
|
22
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
23
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
25
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
26
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
27
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
28
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
29
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
30
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
-
// ---
|
|
34
|
-
// Code generated by the command line utilities is owned by the owner
|
|
35
|
-
// of the input file used when generating it. This code is not
|
|
36
|
-
// standalone and requires a support library to be linked with it. This
|
|
37
|
-
// support library is itself covered by the above license.
|
|
38
|
-
const utf8_1 = require("./utf8");
|
|
39
|
-
const varint_1 = require("./varint");
|
|
40
|
-
var WireType;
|
|
41
|
-
(function (WireType) {
|
|
42
|
-
WireType[WireType["Varint"] = 0] = "Varint";
|
|
43
|
-
WireType[WireType["Fixed64"] = 1] = "Fixed64";
|
|
44
|
-
WireType[WireType["Bytes"] = 2] = "Bytes";
|
|
45
|
-
WireType[WireType["Fixed32"] = 5] = "Fixed32";
|
|
46
|
-
})(WireType || (exports.WireType = WireType = {}));
|
|
47
|
-
class BinaryReader {
|
|
48
|
-
buf;
|
|
49
|
-
pos;
|
|
50
|
-
type;
|
|
51
|
-
len;
|
|
52
|
-
assertBounds() {
|
|
53
|
-
if (this.pos > this.len)
|
|
54
|
-
throw new RangeError("premature EOF");
|
|
55
|
-
}
|
|
56
|
-
constructor(buf) {
|
|
57
|
-
this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0);
|
|
58
|
-
this.pos = 0;
|
|
59
|
-
this.type = 0;
|
|
60
|
-
this.len = this.buf.length;
|
|
61
|
-
}
|
|
62
|
-
tag() {
|
|
63
|
-
const tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7;
|
|
64
|
-
if (fieldNo <= 0 || wireType < 0 || wireType > 5)
|
|
65
|
-
throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType);
|
|
66
|
-
return [fieldNo, wireType, tag];
|
|
67
|
-
}
|
|
68
|
-
skip(length) {
|
|
69
|
-
if (typeof length === "number") {
|
|
70
|
-
if (this.pos + length > this.len)
|
|
71
|
-
throw indexOutOfRange(this, length);
|
|
72
|
-
this.pos += length;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
do {
|
|
76
|
-
if (this.pos >= this.len)
|
|
77
|
-
throw indexOutOfRange(this);
|
|
78
|
-
} while (this.buf[this.pos++] & 128);
|
|
79
|
-
}
|
|
80
|
-
return this;
|
|
81
|
-
}
|
|
82
|
-
skipType(wireType) {
|
|
83
|
-
switch (wireType) {
|
|
84
|
-
case WireType.Varint:
|
|
85
|
-
this.skip();
|
|
86
|
-
break;
|
|
87
|
-
case WireType.Fixed64:
|
|
88
|
-
this.skip(8);
|
|
89
|
-
break;
|
|
90
|
-
case WireType.Bytes:
|
|
91
|
-
this.skip(this.uint32());
|
|
92
|
-
break;
|
|
93
|
-
case 3:
|
|
94
|
-
while ((wireType = this.uint32() & 7) !== 4) {
|
|
95
|
-
this.skipType(wireType);
|
|
96
|
-
}
|
|
97
|
-
break;
|
|
98
|
-
case WireType.Fixed32:
|
|
99
|
-
this.skip(4);
|
|
100
|
-
break;
|
|
101
|
-
/* istanbul ignore next */
|
|
102
|
-
default:
|
|
103
|
-
throw Error("invalid wire type " + wireType + " at offset " + this.pos);
|
|
104
|
-
}
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
uint32() {
|
|
108
|
-
return varint_1.varint32read.bind(this)();
|
|
109
|
-
}
|
|
110
|
-
int32() {
|
|
111
|
-
return this.uint32() | 0;
|
|
112
|
-
}
|
|
113
|
-
sint32() {
|
|
114
|
-
const num = this.uint32();
|
|
115
|
-
return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding
|
|
116
|
-
}
|
|
117
|
-
fixed32() {
|
|
118
|
-
const val = (0, varint_1.readUInt32)(this.buf, this.pos);
|
|
119
|
-
this.pos += 4;
|
|
120
|
-
return val;
|
|
121
|
-
}
|
|
122
|
-
sfixed32() {
|
|
123
|
-
const val = (0, varint_1.readInt32)(this.buf, this.pos);
|
|
124
|
-
this.pos += 4;
|
|
125
|
-
return val;
|
|
126
|
-
}
|
|
127
|
-
int64() {
|
|
128
|
-
const [lo, hi] = varint_1.varint64read.bind(this)();
|
|
129
|
-
return BigInt((0, varint_1.int64ToString)(lo, hi));
|
|
130
|
-
}
|
|
131
|
-
uint64() {
|
|
132
|
-
const [lo, hi] = varint_1.varint64read.bind(this)();
|
|
133
|
-
return BigInt((0, varint_1.uInt64ToString)(lo, hi));
|
|
134
|
-
}
|
|
135
|
-
sint64() {
|
|
136
|
-
let [lo, hi] = varint_1.varint64read.bind(this)();
|
|
137
|
-
// zig zag
|
|
138
|
-
[lo, hi] = (0, varint_1.zzDecode)(lo, hi);
|
|
139
|
-
return BigInt((0, varint_1.int64ToString)(lo, hi));
|
|
140
|
-
}
|
|
141
|
-
fixed64() {
|
|
142
|
-
const lo = this.sfixed32();
|
|
143
|
-
const hi = this.sfixed32();
|
|
144
|
-
return BigInt((0, varint_1.uInt64ToString)(lo, hi));
|
|
145
|
-
}
|
|
146
|
-
sfixed64() {
|
|
147
|
-
const lo = this.sfixed32();
|
|
148
|
-
const hi = this.sfixed32();
|
|
149
|
-
return BigInt((0, varint_1.int64ToString)(lo, hi));
|
|
150
|
-
}
|
|
151
|
-
float() {
|
|
152
|
-
throw new Error("float not supported");
|
|
153
|
-
}
|
|
154
|
-
double() {
|
|
155
|
-
throw new Error("double not supported");
|
|
156
|
-
}
|
|
157
|
-
bool() {
|
|
158
|
-
const [lo, hi] = varint_1.varint64read.bind(this)();
|
|
159
|
-
return lo !== 0 || hi !== 0;
|
|
160
|
-
}
|
|
161
|
-
bytes() {
|
|
162
|
-
const len = this.uint32(), start = this.pos;
|
|
163
|
-
this.pos += len;
|
|
164
|
-
this.assertBounds();
|
|
165
|
-
return this.buf.subarray(start, start + len);
|
|
166
|
-
}
|
|
167
|
-
string() {
|
|
168
|
-
const bytes = this.bytes();
|
|
169
|
-
return (0, utf8_1.utf8Read)(bytes, 0, bytes.length);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
exports.BinaryReader = BinaryReader;
|
|
173
|
-
class Op {
|
|
174
|
-
fn;
|
|
175
|
-
len;
|
|
176
|
-
val;
|
|
177
|
-
next;
|
|
178
|
-
constructor(fn, len, val) {
|
|
179
|
-
this.fn = fn;
|
|
180
|
-
this.len = len;
|
|
181
|
-
this.val = val;
|
|
182
|
-
}
|
|
183
|
-
proceed(buf, pos) {
|
|
184
|
-
if (this.fn) {
|
|
185
|
-
this.fn(this.val, buf, pos);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
class State {
|
|
190
|
-
head;
|
|
191
|
-
tail;
|
|
192
|
-
len;
|
|
193
|
-
next;
|
|
194
|
-
constructor(writer) {
|
|
195
|
-
this.head = writer.head;
|
|
196
|
-
this.tail = writer.tail;
|
|
197
|
-
this.len = writer.len;
|
|
198
|
-
this.next = writer.states;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
class BinaryWriter {
|
|
202
|
-
len = 0;
|
|
203
|
-
head;
|
|
204
|
-
tail;
|
|
205
|
-
states;
|
|
206
|
-
constructor() {
|
|
207
|
-
this.head = new Op(null, 0, 0);
|
|
208
|
-
this.tail = this.head;
|
|
209
|
-
this.states = null;
|
|
210
|
-
}
|
|
211
|
-
static create() {
|
|
212
|
-
return new BinaryWriter();
|
|
213
|
-
}
|
|
214
|
-
static alloc(size) {
|
|
215
|
-
if (typeof Uint8Array !== "undefined") {
|
|
216
|
-
return pool((size) => new Uint8Array(size), Uint8Array.prototype.subarray)(size);
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
return new Array(size);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
_push(fn, len, val) {
|
|
223
|
-
this.tail = this.tail.next = new Op(fn, len, val);
|
|
224
|
-
this.len += len;
|
|
225
|
-
return this;
|
|
226
|
-
}
|
|
227
|
-
finish() {
|
|
228
|
-
let head = this.head.next, pos = 0;
|
|
229
|
-
const buf = BinaryWriter.alloc(this.len);
|
|
230
|
-
while (head) {
|
|
231
|
-
head.proceed(buf, pos);
|
|
232
|
-
pos += head.len;
|
|
233
|
-
head = head.next;
|
|
234
|
-
}
|
|
235
|
-
return buf;
|
|
236
|
-
}
|
|
237
|
-
fork() {
|
|
238
|
-
this.states = new State(this);
|
|
239
|
-
this.head = this.tail = new Op(null, 0, 0);
|
|
240
|
-
this.len = 0;
|
|
241
|
-
return this;
|
|
242
|
-
}
|
|
243
|
-
reset() {
|
|
244
|
-
if (this.states) {
|
|
245
|
-
this.head = this.states.head;
|
|
246
|
-
this.tail = this.states.tail;
|
|
247
|
-
this.len = this.states.len;
|
|
248
|
-
this.states = this.states.next;
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
this.head = this.tail = new Op(null, 0, 0);
|
|
252
|
-
this.len = 0;
|
|
253
|
-
}
|
|
254
|
-
return this;
|
|
255
|
-
}
|
|
256
|
-
ldelim() {
|
|
257
|
-
const head = this.head, tail = this.tail, len = this.len;
|
|
258
|
-
this.reset().uint32(len);
|
|
259
|
-
if (len) {
|
|
260
|
-
this.tail.next = head.next; // skip noop
|
|
261
|
-
this.tail = tail;
|
|
262
|
-
this.len += len;
|
|
263
|
-
}
|
|
264
|
-
return this;
|
|
265
|
-
}
|
|
266
|
-
tag(fieldNo, type) {
|
|
267
|
-
return this.uint32(((fieldNo << 3) | type) >>> 0);
|
|
268
|
-
}
|
|
269
|
-
uint32(value) {
|
|
270
|
-
this.len += (this.tail = this.tail.next =
|
|
271
|
-
new Op(varint_1.writeVarint32, (value = value >>> 0) < 128
|
|
272
|
-
? 1
|
|
273
|
-
: value < 16384
|
|
274
|
-
? 2
|
|
275
|
-
: value < 2097152
|
|
276
|
-
? 3
|
|
277
|
-
: value < 268435456
|
|
278
|
-
? 4
|
|
279
|
-
: 5, value)).len;
|
|
280
|
-
return this;
|
|
281
|
-
}
|
|
282
|
-
int32(value) {
|
|
283
|
-
return value < 0
|
|
284
|
-
? this._push(varint_1.writeVarint64, 10, (0, varint_1.int64FromString)(value.toString())) // 10 bytes per spec
|
|
285
|
-
: this.uint32(value);
|
|
286
|
-
}
|
|
287
|
-
sint32(value) {
|
|
288
|
-
return this.uint32(((value << 1) ^ (value >> 31)) >>> 0);
|
|
289
|
-
}
|
|
290
|
-
int64(value) {
|
|
291
|
-
const { lo, hi } = (0, varint_1.int64FromString)(value.toString());
|
|
292
|
-
return this._push(varint_1.writeVarint64, (0, varint_1.int64Length)(lo, hi), { lo, hi });
|
|
293
|
-
}
|
|
294
|
-
// uint64 is the same with int64
|
|
295
|
-
uint64 = BinaryWriter.prototype.int64;
|
|
296
|
-
sint64(value) {
|
|
297
|
-
let { lo, hi } = (0, varint_1.int64FromString)(value.toString());
|
|
298
|
-
// zig zag
|
|
299
|
-
[lo, hi] = (0, varint_1.zzEncode)(lo, hi);
|
|
300
|
-
return this._push(varint_1.writeVarint64, (0, varint_1.int64Length)(lo, hi), { lo, hi });
|
|
301
|
-
}
|
|
302
|
-
fixed64(value) {
|
|
303
|
-
const { lo, hi } = (0, varint_1.int64FromString)(value.toString());
|
|
304
|
-
return this._push(varint_1.writeFixed32, 4, lo)._push(varint_1.writeFixed32, 4, hi);
|
|
305
|
-
}
|
|
306
|
-
// sfixed64 is the same with fixed64
|
|
307
|
-
sfixed64 = BinaryWriter.prototype.fixed64;
|
|
308
|
-
bool(value) {
|
|
309
|
-
return this._push(varint_1.writeByte, 1, value ? 1 : 0);
|
|
310
|
-
}
|
|
311
|
-
fixed32(value) {
|
|
312
|
-
return this._push(varint_1.writeFixed32, 4, value >>> 0);
|
|
313
|
-
}
|
|
314
|
-
// sfixed32 is the same with fixed32
|
|
315
|
-
sfixed32 = BinaryWriter.prototype.fixed32;
|
|
316
|
-
float(value) {
|
|
317
|
-
throw new Error("float not supported" + value);
|
|
318
|
-
}
|
|
319
|
-
double(value) {
|
|
320
|
-
throw new Error("double not supported" + value);
|
|
321
|
-
}
|
|
322
|
-
bytes(value) {
|
|
323
|
-
const len = value.length >>> 0;
|
|
324
|
-
if (!len)
|
|
325
|
-
return this._push(varint_1.writeByte, 1, 0);
|
|
326
|
-
return this.uint32(len)._push(writeBytes, len, value);
|
|
327
|
-
}
|
|
328
|
-
string(value) {
|
|
329
|
-
const len = (0, utf8_1.utf8Length)(value);
|
|
330
|
-
return len
|
|
331
|
-
? this.uint32(len)._push(utf8_1.utf8Write, len, value)
|
|
332
|
-
: this._push(varint_1.writeByte, 1, 0);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
exports.BinaryWriter = BinaryWriter;
|
|
336
|
-
function writeBytes(val, buf, pos) {
|
|
337
|
-
if (typeof Uint8Array !== "undefined") {
|
|
338
|
-
buf.set(val, pos);
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
for (let i = 0; i < val.length; ++i)
|
|
342
|
-
buf[pos + i] = val[i];
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
function pool(alloc, slice, size) {
|
|
346
|
-
const SIZE = size || 8192;
|
|
347
|
-
const MAX = SIZE >>> 1;
|
|
348
|
-
let slab = null;
|
|
349
|
-
let offset = SIZE;
|
|
350
|
-
return function pool_alloc(size) {
|
|
351
|
-
if (size < 1 || size > MAX)
|
|
352
|
-
return alloc(size);
|
|
353
|
-
if (offset + size > SIZE) {
|
|
354
|
-
slab = alloc(SIZE);
|
|
355
|
-
offset = 0;
|
|
356
|
-
}
|
|
357
|
-
const buf = slice.call(slab, offset, (offset += size));
|
|
358
|
-
if (offset & 7)
|
|
359
|
-
// align to 32 bit
|
|
360
|
-
offset = (offset | 7) + 1;
|
|
361
|
-
return buf;
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
function indexOutOfRange(reader, writeLength) {
|
|
365
|
-
return RangeError("index out of range: " +
|
|
366
|
-
reader.pos +
|
|
367
|
-
" + " +
|
|
368
|
-
(writeLength || 1) +
|
|
369
|
-
" > " +
|
|
370
|
-
reader.len);
|
|
371
|
-
}
|