@gitopia/gitopiajs 0.0.4 → 0.0.6

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.
Files changed (310) hide show
  1. package/dist/LICENSE +21 -0
  2. package/dist/amino/amino.d.ts +1 -0
  3. package/dist/amino/amino.js +2 -0
  4. package/dist/amino/bundle.d.ts +1 -0
  5. package/dist/amino/bundle.js +41 -0
  6. package/dist/binary.d.ts +130 -0
  7. package/dist/binary.js +371 -0
  8. package/dist/cosmos/bank/v1beta1/bank.d.ts +407 -0
  9. package/dist/cosmos/bank/v1beta1/bank.js +664 -0
  10. package/dist/cosmos/bank/v1beta1/query.d.ts +1062 -0
  11. package/dist/cosmos/bank/v1beta1/query.js +1759 -0
  12. package/dist/cosmos/bank/v1beta1/query.lcd.d.ts +19 -0
  13. package/dist/cosmos/bank/v1beta1/query.lcd.js +173 -0
  14. package/dist/cosmos/bank/v1beta1/query.rpc.Query.d.ts +106 -0
  15. package/dist/cosmos/bank/v1beta1/query.rpc.Query.js +123 -0
  16. package/dist/cosmos/base/query/v1beta1/pagination.d.ts +190 -0
  17. package/dist/cosmos/base/query/v1beta1/pagination.js +204 -0
  18. package/dist/cosmos/base/v1beta1/coin.d.ts +193 -0
  19. package/dist/cosmos/base/v1beta1/coin.js +306 -0
  20. package/dist/cosmos/bundle.d.ts +2311 -0
  21. package/dist/cosmos/bundle.js +134 -0
  22. package/dist/cosmos/client.d.ts +84 -0
  23. package/dist/cosmos/client.js +65 -0
  24. package/dist/cosmos/feegrant/v1beta1/feegrant.d.ts +245 -0
  25. package/dist/cosmos/feegrant/v1beta1/feegrant.js +456 -0
  26. package/dist/cosmos/feegrant/v1beta1/query.d.ts +258 -0
  27. package/dist/cosmos/feegrant/v1beta1/query.js +487 -0
  28. package/dist/cosmos/feegrant/v1beta1/query.lcd.d.ts +11 -0
  29. package/dist/cosmos/feegrant/v1beta1/query.lcd.js +44 -0
  30. package/dist/cosmos/feegrant/v1beta1/query.rpc.Query.d.ts +28 -0
  31. package/dist/cosmos/feegrant/v1beta1/query.rpc.Query.js +47 -0
  32. package/dist/cosmos/gov/v1beta1/gov.d.ts +571 -0
  33. package/dist/cosmos/gov/v1beta1/gov.js +1122 -0
  34. package/dist/cosmos/gov/v1beta1/query.d.ts +636 -0
  35. package/dist/cosmos/gov/v1beta1/query.js +1264 -0
  36. package/dist/cosmos/gov/v1beta1/query.lcd.d.ts +16 -0
  37. package/dist/cosmos/gov/v1beta1/query.lcd.js +87 -0
  38. package/dist/cosmos/gov/v1beta1/query.rpc.Query.d.ts +44 -0
  39. package/dist/cosmos/gov/v1beta1/query.rpc.Query.js +92 -0
  40. package/dist/cosmos/group/v1/query.d.ts +1097 -0
  41. package/dist/cosmos/group/v1/query.js +2182 -0
  42. package/dist/cosmos/group/v1/query.lcd.d.ts +22 -0
  43. package/dist/cosmos/group/v1/query.lcd.js +158 -0
  44. package/dist/cosmos/group/v1/query.rpc.Query.d.ts +78 -0
  45. package/dist/cosmos/group/v1/query.rpc.Query.js +148 -0
  46. package/dist/cosmos/group/v1/tx.amino.d.ts +73 -0
  47. package/dist/cosmos/group/v1/tx.amino.js +77 -0
  48. package/dist/cosmos/group/v1/tx.d.ts +1198 -0
  49. package/dist/cosmos/group/v1/tx.js +2362 -0
  50. package/dist/cosmos/group/v1/tx.registry.d.ts +180 -0
  51. package/dist/cosmos/group/v1/tx.registry.js +271 -0
  52. package/dist/cosmos/group/v1/tx.rpc.msg.d.ts +51 -0
  53. package/dist/cosmos/group/v1/tx.rpc.msg.js +96 -0
  54. package/dist/cosmos/group/v1/types.d.ts +873 -0
  55. package/dist/cosmos/group/v1/types.js +1495 -0
  56. package/dist/cosmos/msg/v1/msg.d.ts +1 -0
  57. package/dist/cosmos/msg/v1/msg.js +2 -0
  58. package/dist/cosmos/query/v1/query.d.ts +1 -0
  59. package/dist/cosmos/query/v1/query.js +2 -0
  60. package/dist/cosmos/rpc.query.d.ts +59 -0
  61. package/dist/cosmos/rpc.query.js +60 -0
  62. package/dist/cosmos/rpc.tx.d.ts +10 -0
  63. package/dist/cosmos/rpc.tx.js +44 -0
  64. package/dist/cosmos/upgrade/v1beta1/upgrade.d.ts +278 -0
  65. package/dist/cosmos/upgrade/v1beta1/upgrade.js +382 -0
  66. package/dist/cosmos_proto/bundle.d.ts +32 -0
  67. package/dist/cosmos_proto/bundle.js +41 -0
  68. package/dist/cosmos_proto/cosmos.d.ts +171 -0
  69. package/dist/cosmos_proto/cosmos.js +221 -0
  70. package/dist/esm/amino/amino.js +1 -0
  71. package/dist/esm/amino/bundle.js +5 -0
  72. package/dist/esm/binary.js +366 -0
  73. package/dist/esm/cosmos/bank/v1beta1/bank.js +661 -0
  74. package/dist/esm/cosmos/bank/v1beta1/query.js +1756 -0
  75. package/dist/esm/cosmos/bank/v1beta1/query.lcd.js +169 -0
  76. package/dist/esm/cosmos/bank/v1beta1/query.rpc.Query.js +118 -0
  77. package/dist/esm/cosmos/base/query/v1beta1/pagination.js +201 -0
  78. package/dist/esm/cosmos/base/v1beta1/coin.js +303 -0
  79. package/dist/esm/cosmos/bundle.js +98 -0
  80. package/dist/esm/cosmos/client.js +27 -0
  81. package/dist/esm/cosmos/feegrant/v1beta1/feegrant.js +450 -0
  82. package/dist/esm/cosmos/feegrant/v1beta1/query.js +484 -0
  83. package/dist/esm/cosmos/feegrant/v1beta1/query.lcd.js +40 -0
  84. package/dist/esm/cosmos/feegrant/v1beta1/query.rpc.Query.js +42 -0
  85. package/dist/esm/cosmos/gov/v1beta1/gov.js +1112 -0
  86. package/dist/esm/cosmos/gov/v1beta1/query.js +1261 -0
  87. package/dist/esm/cosmos/gov/v1beta1/query.lcd.js +83 -0
  88. package/dist/esm/cosmos/gov/v1beta1/query.rpc.Query.js +87 -0
  89. package/dist/esm/cosmos/group/v1/query.js +2179 -0
  90. package/dist/esm/cosmos/group/v1/query.lcd.js +154 -0
  91. package/dist/esm/cosmos/group/v1/query.rpc.Query.js +143 -0
  92. package/dist/esm/cosmos/group/v1/tx.amino.js +74 -0
  93. package/dist/esm/cosmos/group/v1/tx.js +2354 -0
  94. package/dist/esm/cosmos/group/v1/tx.registry.js +267 -0
  95. package/dist/esm/cosmos/group/v1/tx.rpc.msg.js +92 -0
  96. package/dist/esm/cosmos/group/v1/types.js +1483 -0
  97. package/dist/esm/cosmos/msg/v1/msg.js +1 -0
  98. package/dist/esm/cosmos/query/v1/query.js +1 -0
  99. package/dist/esm/cosmos/rpc.query.js +23 -0
  100. package/dist/esm/cosmos/rpc.tx.js +7 -0
  101. package/dist/esm/cosmos/upgrade/v1beta1/upgrade.js +379 -0
  102. package/dist/esm/cosmos_proto/bundle.js +5 -0
  103. package/dist/esm/cosmos_proto/cosmos.js +216 -0
  104. package/dist/esm/gitopia/bundle.js +95 -0
  105. package/dist/esm/gitopia/client.js +32 -0
  106. package/dist/esm/gitopia/custom-lcd-client.js +50 -0
  107. package/dist/esm/gitopia/gitopia/gitopia/attachment.js +101 -0
  108. package/dist/esm/gitopia/gitopia/gitopia/bounty.js +255 -0
  109. package/dist/esm/gitopia/gitopia/gitopia/branch.js +137 -0
  110. package/dist/esm/gitopia/gitopia/gitopia/comment.js +488 -0
  111. package/dist/esm/gitopia/gitopia/gitopia/dao.js +451 -0
  112. package/dist/esm/gitopia/gitopia/gitopia/exercised_amount.js +78 -0
  113. package/dist/esm/gitopia/gitopia/gitopia/genesis.js +460 -0
  114. package/dist/esm/gitopia/gitopia/gitopia/issue.js +323 -0
  115. package/dist/esm/gitopia/gitopia/gitopia/params.js +293 -0
  116. package/dist/esm/gitopia/gitopia/gitopia/pullRequest.js +565 -0
  117. package/dist/esm/gitopia/gitopia/gitopia/query.js +7351 -0
  118. package/dist/esm/gitopia/gitopia/gitopia/query.lcd.js +452 -0
  119. package/dist/esm/gitopia/gitopia/gitopia/query.rpc.Query.js +453 -0
  120. package/dist/esm/gitopia/gitopia/gitopia/reaction.js +123 -0
  121. package/dist/esm/gitopia/gitopia/gitopia/release.js +225 -0
  122. package/dist/esm/gitopia/gitopia/gitopia/repository.js +1200 -0
  123. package/dist/esm/gitopia/gitopia/gitopia/tag.js +125 -0
  124. package/dist/esm/gitopia/gitopia/gitopia/task.js +197 -0
  125. package/dist/esm/gitopia/gitopia/gitopia/tx.amino.js +464 -0
  126. package/dist/esm/gitopia/gitopia/gitopia/tx.js +14679 -0
  127. package/dist/esm/gitopia/gitopia/gitopia/tx.registry.js +1671 -0
  128. package/dist/esm/gitopia/gitopia/gitopia/tx.rpc.msg.js +560 -0
  129. package/dist/esm/gitopia/gitopia/gitopia/user.js +340 -0
  130. package/dist/esm/gitopia/gitopia/gitopia/whois.js +146 -0
  131. package/dist/esm/gitopia/gitopia/offchain/offchain.js +144 -0
  132. package/dist/esm/gitopia/gitopia/rewards/genesis.js +82 -0
  133. package/dist/esm/gitopia/gitopia/rewards/params.js +81 -0
  134. package/dist/esm/gitopia/gitopia/rewards/pool.js +191 -0
  135. package/dist/esm/gitopia/gitopia/rewards/query.js +654 -0
  136. package/dist/esm/gitopia/gitopia/rewards/query.lcd.js +40 -0
  137. package/dist/esm/gitopia/gitopia/rewards/query.rpc.Query.js +53 -0
  138. package/dist/esm/gitopia/gitopia/rewards/rewards.js +191 -0
  139. package/dist/esm/gitopia/gitopia/rewards/task.js +176 -0
  140. package/dist/esm/gitopia/gitopia/rewards/tx.amino.js +19 -0
  141. package/dist/esm/gitopia/gitopia/rewards/tx.js +525 -0
  142. package/dist/esm/gitopia/gitopia/rewards/tx.registry.js +69 -0
  143. package/dist/esm/gitopia/gitopia/rewards/tx.rpc.msg.js +26 -0
  144. package/dist/esm/gitopia/rpc.query.js +29 -0
  145. package/dist/esm/gitopia/rpc.tx.js +13 -0
  146. package/dist/esm/gogoproto/bundle.js +5 -0
  147. package/dist/esm/gogoproto/gogo.js +1 -0
  148. package/dist/esm/google/api/annotations.js +1 -0
  149. package/dist/esm/google/api/http.js +329 -0
  150. package/dist/esm/google/bundle.js +14 -0
  151. package/dist/esm/google/protobuf/any.js +74 -0
  152. package/dist/esm/google/protobuf/descriptor.js +4848 -0
  153. package/dist/esm/google/protobuf/duration.js +71 -0
  154. package/dist/esm/google/protobuf/timestamp.js +68 -0
  155. package/dist/esm/helpers.js +131 -0
  156. package/dist/esm/ibc/applications/transfer/v1/query.js +847 -0
  157. package/dist/esm/ibc/applications/transfer/v1/query.lcd.js +70 -0
  158. package/dist/esm/ibc/applications/transfer/v1/query.rpc.Query.js +71 -0
  159. package/dist/esm/ibc/applications/transfer/v1/transfer.js +164 -0
  160. package/dist/esm/ibc/applications/transfer/v1/tx.amino.js +9 -0
  161. package/dist/esm/ibc/applications/transfer/v1/tx.js +226 -0
  162. package/dist/esm/ibc/applications/transfer/v1/tx.registry.js +33 -0
  163. package/dist/esm/ibc/applications/transfer/v1/tx.rpc.msg.js +14 -0
  164. package/dist/esm/ibc/bundle.js +44 -0
  165. package/dist/esm/ibc/client.js +29 -0
  166. package/dist/esm/ibc/core/client/v1/client.js +611 -0
  167. package/dist/esm/ibc/rpc.query.js +30 -0
  168. package/dist/esm/ibc/rpc.tx.js +14 -0
  169. package/dist/esm/index.js +19 -0
  170. package/dist/esm/utf8.js +137 -0
  171. package/dist/esm/varint.js +408 -0
  172. package/dist/gitopia/bundle.d.ts +6123 -0
  173. package/dist/gitopia/bundle.js +131 -0
  174. package/dist/gitopia/client.d.ts +492 -0
  175. package/dist/gitopia/client.js +70 -0
  176. package/dist/gitopia/custom-lcd-client.d.ts +31 -0
  177. package/dist/gitopia/custom-lcd-client.js +87 -0
  178. package/dist/gitopia/gitopia/gitopia/attachment.d.ts +39 -0
  179. package/dist/gitopia/gitopia/gitopia/attachment.js +104 -0
  180. package/dist/gitopia/gitopia/gitopia/bounty.d.ts +79 -0
  181. package/dist/gitopia/gitopia/gitopia/bounty.js +262 -0
  182. package/dist/gitopia/gitopia/gitopia/branch.d.ts +48 -0
  183. package/dist/gitopia/gitopia/gitopia/branch.js +140 -0
  184. package/dist/gitopia/gitopia/gitopia/comment.d.ts +125 -0
  185. package/dist/gitopia/gitopia/gitopia/comment.js +495 -0
  186. package/dist/gitopia/gitopia/gitopia/dao.d.ts +160 -0
  187. package/dist/gitopia/gitopia/gitopia/dao.js +454 -0
  188. package/dist/gitopia/gitopia/gitopia/exercised_amount.d.ts +34 -0
  189. package/dist/gitopia/gitopia/gitopia/exercised_amount.js +81 -0
  190. package/dist/gitopia/gitopia/gitopia/genesis.d.ts +143 -0
  191. package/dist/gitopia/gitopia/gitopia/genesis.js +463 -0
  192. package/dist/gitopia/gitopia/gitopia/issue.d.ts +88 -0
  193. package/dist/gitopia/gitopia/gitopia/issue.js +328 -0
  194. package/dist/gitopia/gitopia/gitopia/params.d.ts +115 -0
  195. package/dist/gitopia/gitopia/gitopia/params.js +296 -0
  196. package/dist/gitopia/gitopia/gitopia/pullRequest.d.ts +177 -0
  197. package/dist/gitopia/gitopia/gitopia/pullRequest.js +570 -0
  198. package/dist/gitopia/gitopia/gitopia/query.d.ts +3130 -0
  199. package/dist/gitopia/gitopia/gitopia/query.js +7355 -0
  200. package/dist/gitopia/gitopia/gitopia/query.lcd.d.ts +54 -0
  201. package/dist/gitopia/gitopia/gitopia/query.lcd.js +456 -0
  202. package/dist/gitopia/gitopia/gitopia/query.rpc.Query.d.ts +188 -0
  203. package/dist/gitopia/gitopia/gitopia/query.rpc.Query.js +458 -0
  204. package/dist/gitopia/gitopia/gitopia/reaction.d.ts +42 -0
  205. package/dist/gitopia/gitopia/gitopia/reaction.js +128 -0
  206. package/dist/gitopia/gitopia/gitopia/release.d.ts +70 -0
  207. package/dist/gitopia/gitopia/gitopia/release.js +228 -0
  208. package/dist/gitopia/gitopia/gitopia/repository.d.ts +424 -0
  209. package/dist/gitopia/gitopia/gitopia/repository.js +1207 -0
  210. package/dist/gitopia/gitopia/gitopia/tag.d.ts +45 -0
  211. package/dist/gitopia/gitopia/gitopia/tag.js +128 -0
  212. package/dist/gitopia/gitopia/gitopia/task.d.ts +64 -0
  213. package/dist/gitopia/gitopia/gitopia/task.js +204 -0
  214. package/dist/gitopia/gitopia/gitopia/tx.amino.d.ts +463 -0
  215. package/dist/gitopia/gitopia/gitopia/tx.amino.js +467 -0
  216. package/dist/gitopia/gitopia/gitopia/tx.d.ts +6246 -0
  217. package/dist/gitopia/gitopia/gitopia/tx.js +14687 -0
  218. package/dist/gitopia/gitopia/gitopia/tx.registry.d.ts +1116 -0
  219. package/dist/gitopia/gitopia/gitopia/tx.registry.js +1675 -0
  220. package/dist/gitopia/gitopia/gitopia/tx.rpc.msg.d.ts +200 -0
  221. package/dist/gitopia/gitopia/gitopia/tx.rpc.msg.js +564 -0
  222. package/dist/gitopia/gitopia/gitopia/user.d.ts +104 -0
  223. package/dist/gitopia/gitopia/gitopia/user.js +343 -0
  224. package/dist/gitopia/gitopia/gitopia/whois.d.ts +51 -0
  225. package/dist/gitopia/gitopia/gitopia/whois.js +151 -0
  226. package/dist/gitopia/gitopia/offchain/offchain.d.ts +74 -0
  227. package/dist/gitopia/gitopia/offchain/offchain.js +147 -0
  228. package/dist/gitopia/gitopia/rewards/genesis.d.ts +40 -0
  229. package/dist/gitopia/gitopia/rewards/genesis.js +85 -0
  230. package/dist/gitopia/gitopia/rewards/params.d.ts +37 -0
  231. package/dist/gitopia/gitopia/rewards/params.js +84 -0
  232. package/dist/gitopia/gitopia/rewards/pool.d.ts +59 -0
  233. package/dist/gitopia/gitopia/rewards/pool.js +196 -0
  234. package/dist/gitopia/gitopia/rewards/query.d.ts +294 -0
  235. package/dist/gitopia/gitopia/rewards/query.js +657 -0
  236. package/dist/gitopia/gitopia/rewards/query.lcd.d.ts +12 -0
  237. package/dist/gitopia/gitopia/rewards/query.lcd.js +44 -0
  238. package/dist/gitopia/gitopia/rewards/query.rpc.Query.d.ts +28 -0
  239. package/dist/gitopia/gitopia/rewards/query.rpc.Query.js +58 -0
  240. package/dist/gitopia/gitopia/rewards/rewards.d.ts +79 -0
  241. package/dist/gitopia/gitopia/rewards/rewards.js +194 -0
  242. package/dist/gitopia/gitopia/rewards/task.d.ts +54 -0
  243. package/dist/gitopia/gitopia/rewards/task.js +181 -0
  244. package/dist/gitopia/gitopia/rewards/tx.amino.d.ts +18 -0
  245. package/dist/gitopia/gitopia/rewards/tx.amino.js +22 -0
  246. package/dist/gitopia/gitopia/rewards/tx.d.ts +242 -0
  247. package/dist/gitopia/gitopia/rewards/tx.js +528 -0
  248. package/dist/gitopia/gitopia/rewards/tx.registry.d.ts +48 -0
  249. package/dist/gitopia/gitopia/rewards/tx.registry.js +73 -0
  250. package/dist/gitopia/gitopia/rewards/tx.rpc.msg.d.ts +19 -0
  251. package/dist/gitopia/gitopia/rewards/tx.rpc.msg.js +30 -0
  252. package/dist/gitopia/rpc.query.d.ts +117 -0
  253. package/dist/gitopia/rpc.query.js +66 -0
  254. package/dist/gitopia/rpc.tx.d.ts +16 -0
  255. package/dist/gitopia/rpc.tx.js +50 -0
  256. package/dist/gogoproto/bundle.d.ts +1 -0
  257. package/dist/gogoproto/bundle.js +41 -0
  258. package/dist/gogoproto/gogo.d.ts +1 -0
  259. package/dist/gogoproto/gogo.js +2 -0
  260. package/dist/google/api/annotations.d.ts +1 -0
  261. package/dist/google/api/annotations.js +2 -0
  262. package/dist/google/api/http.d.ts +1049 -0
  263. package/dist/google/api/http.js +332 -0
  264. package/dist/google/bundle.d.ts +525 -0
  265. package/dist/google/bundle.js +50 -0
  266. package/dist/google/protobuf/any.d.ts +358 -0
  267. package/dist/google/protobuf/any.js +77 -0
  268. package/dist/google/protobuf/descriptor.d.ts +3178 -0
  269. package/dist/google/protobuf/descriptor.js +4886 -0
  270. package/dist/google/protobuf/duration.d.ts +223 -0
  271. package/dist/google/protobuf/duration.js +74 -0
  272. package/dist/google/protobuf/timestamp.d.ts +314 -0
  273. package/dist/google/protobuf/timestamp.js +71 -0
  274. package/dist/helpers.d.ts +82 -0
  275. package/dist/helpers.js +146 -0
  276. package/dist/ibc/applications/transfer/v1/query.d.ts +479 -0
  277. package/dist/ibc/applications/transfer/v1/query.js +850 -0
  278. package/dist/ibc/applications/transfer/v1/query.lcd.d.ts +14 -0
  279. package/dist/ibc/applications/transfer/v1/query.lcd.js +74 -0
  280. package/dist/ibc/applications/transfer/v1/query.rpc.Query.d.ts +36 -0
  281. package/dist/ibc/applications/transfer/v1/query.rpc.Query.js +76 -0
  282. package/dist/ibc/applications/transfer/v1/transfer.d.ts +123 -0
  283. package/dist/ibc/applications/transfer/v1/transfer.js +167 -0
  284. package/dist/ibc/applications/transfer/v1/tx.amino.d.ts +8 -0
  285. package/dist/ibc/applications/transfer/v1/tx.amino.js +12 -0
  286. package/dist/ibc/applications/transfer/v1/tx.d.ts +132 -0
  287. package/dist/ibc/applications/transfer/v1/tx.js +229 -0
  288. package/dist/ibc/applications/transfer/v1/tx.registry.d.ts +24 -0
  289. package/dist/ibc/applications/transfer/v1/tx.registry.js +37 -0
  290. package/dist/ibc/applications/transfer/v1/tx.rpc.msg.d.ts +12 -0
  291. package/dist/ibc/applications/transfer/v1/tx.rpc.msg.js +18 -0
  292. package/dist/ibc/bundle.d.ts +450 -0
  293. package/dist/ibc/bundle.js +80 -0
  294. package/dist/ibc/client.d.ts +22 -0
  295. package/dist/ibc/client.js +67 -0
  296. package/dist/ibc/core/client/v1/client.d.ts +408 -0
  297. package/dist/ibc/core/client/v1/client.js +614 -0
  298. package/dist/ibc/rpc.query.d.ts +73 -0
  299. package/dist/ibc/rpc.query.js +67 -0
  300. package/dist/ibc/rpc.tx.d.ts +17 -0
  301. package/dist/ibc/rpc.tx.js +51 -0
  302. package/dist/index.d.ts +18 -0
  303. package/dist/index.js +35 -0
  304. package/dist/package.json +49 -0
  305. package/dist/utf8.d.ts +27 -0
  306. package/dist/utf8.js +141 -0
  307. package/dist/varint.d.ts +105 -0
  308. package/dist/varint.js +426 -0
  309. package/package.json +11 -8
  310. package/CHANGELOG.md +0 -8
@@ -0,0 +1,223 @@
1
+ import { BinaryReader, BinaryWriter } from "../../binary";
2
+ /**
3
+ * A Duration represents a signed, fixed-length span of time represented
4
+ * as a count of seconds and fractions of seconds at nanosecond
5
+ * resolution. It is independent of any calendar and concepts like "day"
6
+ * or "month". It is related to Timestamp in that the difference between
7
+ * two Timestamp values is a Duration and it can be added or subtracted
8
+ * from a Timestamp. Range is approximately +-10,000 years.
9
+ *
10
+ * # Examples
11
+ *
12
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
13
+ *
14
+ * Timestamp start = ...;
15
+ * Timestamp end = ...;
16
+ * Duration duration = ...;
17
+ *
18
+ * duration.seconds = end.seconds - start.seconds;
19
+ * duration.nanos = end.nanos - start.nanos;
20
+ *
21
+ * if (duration.seconds < 0 && duration.nanos > 0) {
22
+ * duration.seconds += 1;
23
+ * duration.nanos -= 1000000000;
24
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
25
+ * duration.seconds -= 1;
26
+ * duration.nanos += 1000000000;
27
+ * }
28
+ *
29
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
30
+ *
31
+ * Timestamp start = ...;
32
+ * Duration duration = ...;
33
+ * Timestamp end = ...;
34
+ *
35
+ * end.seconds = start.seconds + duration.seconds;
36
+ * end.nanos = start.nanos + duration.nanos;
37
+ *
38
+ * if (end.nanos < 0) {
39
+ * end.seconds -= 1;
40
+ * end.nanos += 1000000000;
41
+ * } else if (end.nanos >= 1000000000) {
42
+ * end.seconds += 1;
43
+ * end.nanos -= 1000000000;
44
+ * }
45
+ *
46
+ * Example 3: Compute Duration from datetime.timedelta in Python.
47
+ *
48
+ * td = datetime.timedelta(days=3, minutes=10)
49
+ * duration = Duration()
50
+ * duration.FromTimedelta(td)
51
+ *
52
+ * # JSON Mapping
53
+ *
54
+ * In JSON format, the Duration type is encoded as a string rather than an
55
+ * object, where the string ends in the suffix "s" (indicating seconds) and
56
+ * is preceded by the number of seconds, with nanoseconds expressed as
57
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
58
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
59
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
60
+ * microsecond should be expressed in JSON format as "3.000001s".
61
+ */
62
+ export interface Duration {
63
+ /**
64
+ * Signed seconds of the span of time. Must be from -315,576,000,000
65
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
66
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
67
+ */
68
+ seconds: bigint;
69
+ /**
70
+ * Signed fractions of a second at nanosecond resolution of the span
71
+ * of time. Durations less than one second are represented with a 0
72
+ * `seconds` field and a positive or negative `nanos` field. For durations
73
+ * of one second or more, a non-zero value for the `nanos` field must be
74
+ * of the same sign as the `seconds` field. Must be from -999,999,999
75
+ * to +999,999,999 inclusive.
76
+ */
77
+ nanos: number;
78
+ }
79
+ export interface DurationProtoMsg {
80
+ typeUrl: "/google.protobuf.Duration";
81
+ value: Uint8Array;
82
+ }
83
+ /**
84
+ * A Duration represents a signed, fixed-length span of time represented
85
+ * as a count of seconds and fractions of seconds at nanosecond
86
+ * resolution. It is independent of any calendar and concepts like "day"
87
+ * or "month". It is related to Timestamp in that the difference between
88
+ * two Timestamp values is a Duration and it can be added or subtracted
89
+ * from a Timestamp. Range is approximately +-10,000 years.
90
+ *
91
+ * # Examples
92
+ *
93
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
94
+ *
95
+ * Timestamp start = ...;
96
+ * Timestamp end = ...;
97
+ * Duration duration = ...;
98
+ *
99
+ * duration.seconds = end.seconds - start.seconds;
100
+ * duration.nanos = end.nanos - start.nanos;
101
+ *
102
+ * if (duration.seconds < 0 && duration.nanos > 0) {
103
+ * duration.seconds += 1;
104
+ * duration.nanos -= 1000000000;
105
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
106
+ * duration.seconds -= 1;
107
+ * duration.nanos += 1000000000;
108
+ * }
109
+ *
110
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
111
+ *
112
+ * Timestamp start = ...;
113
+ * Duration duration = ...;
114
+ * Timestamp end = ...;
115
+ *
116
+ * end.seconds = start.seconds + duration.seconds;
117
+ * end.nanos = start.nanos + duration.nanos;
118
+ *
119
+ * if (end.nanos < 0) {
120
+ * end.seconds -= 1;
121
+ * end.nanos += 1000000000;
122
+ * } else if (end.nanos >= 1000000000) {
123
+ * end.seconds += 1;
124
+ * end.nanos -= 1000000000;
125
+ * }
126
+ *
127
+ * Example 3: Compute Duration from datetime.timedelta in Python.
128
+ *
129
+ * td = datetime.timedelta(days=3, minutes=10)
130
+ * duration = Duration()
131
+ * duration.FromTimedelta(td)
132
+ *
133
+ * # JSON Mapping
134
+ *
135
+ * In JSON format, the Duration type is encoded as a string rather than an
136
+ * object, where the string ends in the suffix "s" (indicating seconds) and
137
+ * is preceded by the number of seconds, with nanoseconds expressed as
138
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
139
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
140
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
141
+ * microsecond should be expressed in JSON format as "3.000001s".
142
+ */
143
+ export type DurationAmino = string;
144
+ export interface DurationAminoMsg {
145
+ type: "/google.protobuf.Duration";
146
+ value: DurationAmino;
147
+ }
148
+ /**
149
+ * A Duration represents a signed, fixed-length span of time represented
150
+ * as a count of seconds and fractions of seconds at nanosecond
151
+ * resolution. It is independent of any calendar and concepts like "day"
152
+ * or "month". It is related to Timestamp in that the difference between
153
+ * two Timestamp values is a Duration and it can be added or subtracted
154
+ * from a Timestamp. Range is approximately +-10,000 years.
155
+ *
156
+ * # Examples
157
+ *
158
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
159
+ *
160
+ * Timestamp start = ...;
161
+ * Timestamp end = ...;
162
+ * Duration duration = ...;
163
+ *
164
+ * duration.seconds = end.seconds - start.seconds;
165
+ * duration.nanos = end.nanos - start.nanos;
166
+ *
167
+ * if (duration.seconds < 0 && duration.nanos > 0) {
168
+ * duration.seconds += 1;
169
+ * duration.nanos -= 1000000000;
170
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
171
+ * duration.seconds -= 1;
172
+ * duration.nanos += 1000000000;
173
+ * }
174
+ *
175
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
176
+ *
177
+ * Timestamp start = ...;
178
+ * Duration duration = ...;
179
+ * Timestamp end = ...;
180
+ *
181
+ * end.seconds = start.seconds + duration.seconds;
182
+ * end.nanos = start.nanos + duration.nanos;
183
+ *
184
+ * if (end.nanos < 0) {
185
+ * end.seconds -= 1;
186
+ * end.nanos += 1000000000;
187
+ * } else if (end.nanos >= 1000000000) {
188
+ * end.seconds += 1;
189
+ * end.nanos -= 1000000000;
190
+ * }
191
+ *
192
+ * Example 3: Compute Duration from datetime.timedelta in Python.
193
+ *
194
+ * td = datetime.timedelta(days=3, minutes=10)
195
+ * duration = Duration()
196
+ * duration.FromTimedelta(td)
197
+ *
198
+ * # JSON Mapping
199
+ *
200
+ * In JSON format, the Duration type is encoded as a string rather than an
201
+ * object, where the string ends in the suffix "s" (indicating seconds) and
202
+ * is preceded by the number of seconds, with nanoseconds expressed as
203
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
204
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
205
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
206
+ * microsecond should be expressed in JSON format as "3.000001s".
207
+ */
208
+ export interface DurationSDKType {
209
+ seconds: bigint;
210
+ nanos: number;
211
+ }
212
+ export declare const Duration: {
213
+ typeUrl: string;
214
+ encode(message: Duration, writer?: BinaryWriter): BinaryWriter;
215
+ decode(input: BinaryReader | Uint8Array, length?: number): Duration;
216
+ fromPartial(object: Partial<Duration>): Duration;
217
+ fromAmino(object: DurationAmino): Duration;
218
+ toAmino(message: Duration): DurationAmino;
219
+ fromAminoMsg(object: DurationAminoMsg): Duration;
220
+ fromProtoMsg(message: DurationProtoMsg): Duration;
221
+ toProto(message: Duration): Uint8Array;
222
+ toProtoMsg(message: Duration): DurationProtoMsg;
223
+ };
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Duration = void 0;
4
+ //@ts-nocheck
5
+ const binary_1 = require("../../binary");
6
+ function createBaseDuration() {
7
+ return {
8
+ seconds: BigInt(0),
9
+ nanos: 0
10
+ };
11
+ }
12
+ exports.Duration = {
13
+ typeUrl: "/google.protobuf.Duration",
14
+ encode(message, writer = binary_1.BinaryWriter.create()) {
15
+ if (message.seconds !== BigInt(0)) {
16
+ writer.uint32(8).int64(message.seconds);
17
+ }
18
+ if (message.nanos !== 0) {
19
+ writer.uint32(16).int32(message.nanos);
20
+ }
21
+ return writer;
22
+ },
23
+ decode(input, length) {
24
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
25
+ let end = length === undefined ? reader.len : reader.pos + length;
26
+ const message = createBaseDuration();
27
+ while (reader.pos < end) {
28
+ const tag = reader.uint32();
29
+ switch (tag >>> 3) {
30
+ case 1:
31
+ message.seconds = reader.int64();
32
+ break;
33
+ case 2:
34
+ message.nanos = reader.int32();
35
+ break;
36
+ default:
37
+ reader.skipType(tag & 7);
38
+ break;
39
+ }
40
+ }
41
+ return message;
42
+ },
43
+ fromPartial(object) {
44
+ const message = createBaseDuration();
45
+ message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0);
46
+ message.nanos = object.nanos ?? 0;
47
+ return message;
48
+ },
49
+ fromAmino(object) {
50
+ const value = BigInt(object);
51
+ return {
52
+ seconds: value / BigInt("1000000000"),
53
+ nanos: Number(value % BigInt("1000000000"))
54
+ };
55
+ },
56
+ toAmino(message) {
57
+ return (message.seconds * BigInt("1000000000") + BigInt(message.nanos)).toString();
58
+ },
59
+ fromAminoMsg(object) {
60
+ return exports.Duration.fromAmino(object.value);
61
+ },
62
+ fromProtoMsg(message) {
63
+ return exports.Duration.decode(message.value);
64
+ },
65
+ toProto(message) {
66
+ return exports.Duration.encode(message).finish();
67
+ },
68
+ toProtoMsg(message) {
69
+ return {
70
+ typeUrl: "/google.protobuf.Duration",
71
+ value: exports.Duration.encode(message).finish()
72
+ };
73
+ }
74
+ };
@@ -0,0 +1,314 @@
1
+ import { BinaryReader, BinaryWriter } from "../../binary";
2
+ /**
3
+ * A Timestamp represents a point in time independent of any time zone or local
4
+ * calendar, encoded as a count of seconds and fractions of seconds at
5
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
6
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
7
+ * Gregorian calendar backwards to year one.
8
+ *
9
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
10
+ * second table is needed for interpretation, using a [24-hour linear
11
+ * smear](https://developers.google.com/time/smear).
12
+ *
13
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
14
+ * restricting to that range, we ensure that we can convert to and from [RFC
15
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
16
+ *
17
+ * # Examples
18
+ *
19
+ * Example 1: Compute Timestamp from POSIX `time()`.
20
+ *
21
+ * Timestamp timestamp;
22
+ * timestamp.set_seconds(time(NULL));
23
+ * timestamp.set_nanos(0);
24
+ *
25
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
26
+ *
27
+ * struct timeval tv;
28
+ * gettimeofday(&tv, NULL);
29
+ *
30
+ * Timestamp timestamp;
31
+ * timestamp.set_seconds(tv.tv_sec);
32
+ * timestamp.set_nanos(tv.tv_usec * 1000);
33
+ *
34
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
35
+ *
36
+ * FILETIME ft;
37
+ * GetSystemTimeAsFileTime(&ft);
38
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
39
+ *
40
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
41
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
42
+ * Timestamp timestamp;
43
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
44
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
45
+ *
46
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
47
+ *
48
+ * long millis = System.currentTimeMillis();
49
+ *
50
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
51
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
52
+ *
53
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
54
+ *
55
+ * Instant now = Instant.now();
56
+ *
57
+ * Timestamp timestamp =
58
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
59
+ * .setNanos(now.getNano()).build();
60
+ *
61
+ * Example 6: Compute Timestamp from current time in Python.
62
+ *
63
+ * timestamp = Timestamp()
64
+ * timestamp.GetCurrentTime()
65
+ *
66
+ * # JSON Mapping
67
+ *
68
+ * In JSON format, the Timestamp type is encoded as a string in the
69
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
70
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
71
+ * where {year} is always expressed using four digits while {month}, {day},
72
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
73
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
74
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
75
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
76
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
77
+ * able to accept both UTC and other timezones (as indicated by an offset).
78
+ *
79
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
80
+ * 01:30 UTC on January 15, 2017.
81
+ *
82
+ * In JavaScript, one can convert a Date object to this format using the
83
+ * standard
84
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
85
+ * method. In Python, a standard `datetime.datetime` object can be converted
86
+ * to this format using
87
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
88
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
89
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
90
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
91
+ * ) to obtain a formatter capable of generating timestamps in this format.
92
+ */
93
+ export interface Timestamp {
94
+ /**
95
+ * Represents seconds of UTC time since Unix epoch
96
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
97
+ * 9999-12-31T23:59:59Z inclusive.
98
+ */
99
+ seconds: bigint;
100
+ /**
101
+ * Non-negative fractions of a second at nanosecond resolution. Negative
102
+ * second values with fractions must still have non-negative nanos values
103
+ * that count forward in time. Must be from 0 to 999,999,999
104
+ * inclusive.
105
+ */
106
+ nanos: number;
107
+ }
108
+ export interface TimestampProtoMsg {
109
+ typeUrl: "/google.protobuf.Timestamp";
110
+ value: Uint8Array;
111
+ }
112
+ /**
113
+ * A Timestamp represents a point in time independent of any time zone or local
114
+ * calendar, encoded as a count of seconds and fractions of seconds at
115
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
116
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
117
+ * Gregorian calendar backwards to year one.
118
+ *
119
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
120
+ * second table is needed for interpretation, using a [24-hour linear
121
+ * smear](https://developers.google.com/time/smear).
122
+ *
123
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
124
+ * restricting to that range, we ensure that we can convert to and from [RFC
125
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
126
+ *
127
+ * # Examples
128
+ *
129
+ * Example 1: Compute Timestamp from POSIX `time()`.
130
+ *
131
+ * Timestamp timestamp;
132
+ * timestamp.set_seconds(time(NULL));
133
+ * timestamp.set_nanos(0);
134
+ *
135
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
136
+ *
137
+ * struct timeval tv;
138
+ * gettimeofday(&tv, NULL);
139
+ *
140
+ * Timestamp timestamp;
141
+ * timestamp.set_seconds(tv.tv_sec);
142
+ * timestamp.set_nanos(tv.tv_usec * 1000);
143
+ *
144
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
145
+ *
146
+ * FILETIME ft;
147
+ * GetSystemTimeAsFileTime(&ft);
148
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
149
+ *
150
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
151
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
152
+ * Timestamp timestamp;
153
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
154
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
155
+ *
156
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
157
+ *
158
+ * long millis = System.currentTimeMillis();
159
+ *
160
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
161
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
162
+ *
163
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
164
+ *
165
+ * Instant now = Instant.now();
166
+ *
167
+ * Timestamp timestamp =
168
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
169
+ * .setNanos(now.getNano()).build();
170
+ *
171
+ * Example 6: Compute Timestamp from current time in Python.
172
+ *
173
+ * timestamp = Timestamp()
174
+ * timestamp.GetCurrentTime()
175
+ *
176
+ * # JSON Mapping
177
+ *
178
+ * In JSON format, the Timestamp type is encoded as a string in the
179
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
180
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
181
+ * where {year} is always expressed using four digits while {month}, {day},
182
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
183
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
184
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
185
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
186
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
187
+ * able to accept both UTC and other timezones (as indicated by an offset).
188
+ *
189
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
190
+ * 01:30 UTC on January 15, 2017.
191
+ *
192
+ * In JavaScript, one can convert a Date object to this format using the
193
+ * standard
194
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
195
+ * method. In Python, a standard `datetime.datetime` object can be converted
196
+ * to this format using
197
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
198
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
199
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
200
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
201
+ * ) to obtain a formatter capable of generating timestamps in this format.
202
+ */
203
+ export type TimestampAmino = string;
204
+ export interface TimestampAminoMsg {
205
+ type: "/google.protobuf.Timestamp";
206
+ value: TimestampAmino;
207
+ }
208
+ /**
209
+ * A Timestamp represents a point in time independent of any time zone or local
210
+ * calendar, encoded as a count of seconds and fractions of seconds at
211
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
212
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
213
+ * Gregorian calendar backwards to year one.
214
+ *
215
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
216
+ * second table is needed for interpretation, using a [24-hour linear
217
+ * smear](https://developers.google.com/time/smear).
218
+ *
219
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
220
+ * restricting to that range, we ensure that we can convert to and from [RFC
221
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
222
+ *
223
+ * # Examples
224
+ *
225
+ * Example 1: Compute Timestamp from POSIX `time()`.
226
+ *
227
+ * Timestamp timestamp;
228
+ * timestamp.set_seconds(time(NULL));
229
+ * timestamp.set_nanos(0);
230
+ *
231
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
232
+ *
233
+ * struct timeval tv;
234
+ * gettimeofday(&tv, NULL);
235
+ *
236
+ * Timestamp timestamp;
237
+ * timestamp.set_seconds(tv.tv_sec);
238
+ * timestamp.set_nanos(tv.tv_usec * 1000);
239
+ *
240
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
241
+ *
242
+ * FILETIME ft;
243
+ * GetSystemTimeAsFileTime(&ft);
244
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
245
+ *
246
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
247
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
248
+ * Timestamp timestamp;
249
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
250
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
251
+ *
252
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
253
+ *
254
+ * long millis = System.currentTimeMillis();
255
+ *
256
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
257
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
258
+ *
259
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
260
+ *
261
+ * Instant now = Instant.now();
262
+ *
263
+ * Timestamp timestamp =
264
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
265
+ * .setNanos(now.getNano()).build();
266
+ *
267
+ * Example 6: Compute Timestamp from current time in Python.
268
+ *
269
+ * timestamp = Timestamp()
270
+ * timestamp.GetCurrentTime()
271
+ *
272
+ * # JSON Mapping
273
+ *
274
+ * In JSON format, the Timestamp type is encoded as a string in the
275
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
276
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
277
+ * where {year} is always expressed using four digits while {month}, {day},
278
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
279
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
280
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
281
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
282
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
283
+ * able to accept both UTC and other timezones (as indicated by an offset).
284
+ *
285
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
286
+ * 01:30 UTC on January 15, 2017.
287
+ *
288
+ * In JavaScript, one can convert a Date object to this format using the
289
+ * standard
290
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
291
+ * method. In Python, a standard `datetime.datetime` object can be converted
292
+ * to this format using
293
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
294
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
295
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
296
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
297
+ * ) to obtain a formatter capable of generating timestamps in this format.
298
+ */
299
+ export interface TimestampSDKType {
300
+ seconds: bigint;
301
+ nanos: number;
302
+ }
303
+ export declare const Timestamp: {
304
+ typeUrl: string;
305
+ encode(message: Timestamp, writer?: BinaryWriter): BinaryWriter;
306
+ decode(input: BinaryReader | Uint8Array, length?: number): Timestamp;
307
+ fromPartial(object: Partial<Timestamp>): Timestamp;
308
+ fromAmino(object: TimestampAmino): Timestamp;
309
+ toAmino(message: Timestamp): TimestampAmino;
310
+ fromAminoMsg(object: TimestampAminoMsg): Timestamp;
311
+ fromProtoMsg(message: TimestampProtoMsg): Timestamp;
312
+ toProto(message: Timestamp): Uint8Array;
313
+ toProtoMsg(message: Timestamp): TimestampProtoMsg;
314
+ };
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Timestamp = void 0;
4
+ //@ts-nocheck
5
+ const binary_1 = require("../../binary");
6
+ const helpers_1 = require("../../helpers");
7
+ function createBaseTimestamp() {
8
+ return {
9
+ seconds: BigInt(0),
10
+ nanos: 0
11
+ };
12
+ }
13
+ exports.Timestamp = {
14
+ typeUrl: "/google.protobuf.Timestamp",
15
+ encode(message, writer = binary_1.BinaryWriter.create()) {
16
+ if (message.seconds !== BigInt(0)) {
17
+ writer.uint32(8).int64(message.seconds);
18
+ }
19
+ if (message.nanos !== 0) {
20
+ writer.uint32(16).int32(message.nanos);
21
+ }
22
+ return writer;
23
+ },
24
+ decode(input, length) {
25
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
26
+ let end = length === undefined ? reader.len : reader.pos + length;
27
+ const message = createBaseTimestamp();
28
+ while (reader.pos < end) {
29
+ const tag = reader.uint32();
30
+ switch (tag >>> 3) {
31
+ case 1:
32
+ message.seconds = reader.int64();
33
+ break;
34
+ case 2:
35
+ message.nanos = reader.int32();
36
+ break;
37
+ default:
38
+ reader.skipType(tag & 7);
39
+ break;
40
+ }
41
+ }
42
+ return message;
43
+ },
44
+ fromPartial(object) {
45
+ const message = createBaseTimestamp();
46
+ message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0);
47
+ message.nanos = object.nanos ?? 0;
48
+ return message;
49
+ },
50
+ fromAmino(object) {
51
+ return (0, helpers_1.fromJsonTimestamp)(object);
52
+ },
53
+ toAmino(message) {
54
+ return (0, helpers_1.fromTimestamp)(message).toISOString().replace(/\.\d+Z$/, "Z");
55
+ },
56
+ fromAminoMsg(object) {
57
+ return exports.Timestamp.fromAmino(object.value);
58
+ },
59
+ fromProtoMsg(message) {
60
+ return exports.Timestamp.decode(message.value);
61
+ },
62
+ toProto(message) {
63
+ return exports.Timestamp.encode(message).finish();
64
+ },
65
+ toProtoMsg(message) {
66
+ return {
67
+ typeUrl: "/google.protobuf.Timestamp",
68
+ value: exports.Timestamp.encode(message).finish()
69
+ };
70
+ }
71
+ };