@vordium/sdk 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OUTCOME_WORDS = void 0;
4
+ // GENERATED from the shared outcome word file (sha256 dc1376362841a1bd9e4870c3471b9a0a7b4f1246ab6736a5f42a10747422920f). Do not edit by hand: regenerate it.
5
+ /** The words of an action whose outcome is not yet known: {action: {state: {text, next}}}. Placeholders in
6
+ * braces are filled by the caller. */
7
+ exports.OUTCOME_WORDS = {
8
+ "headline": {
9
+ "pending_checking": "Pending — checking"
10
+ },
11
+ "limit_s": 120,
12
+ "actions": {
13
+ "order": {
14
+ "pending_checking": {
15
+ "text": "Pending — checking. Your order was sent but the answer was lost. Checking the network for it.",
16
+ "next": "Do not place it again. This takes up to 2 minutes."
17
+ },
18
+ "applied": {
19
+ "text": "{order_words}. Found on the network at block {height}.",
20
+ "next": ""
21
+ },
22
+ "refused": {
23
+ "text": "Not placed: {meaning}.",
24
+ "next": "{action}"
25
+ },
26
+ "not_applied": {
27
+ "text": "Not placed. The network did not take it, and its time to apply has passed.",
28
+ "next": "You can place it again."
29
+ },
30
+ "still_unknown": {
31
+ "text": "Still not known after 2 minutes. It was not sent again and may still apply.",
32
+ "next": "Check your open orders before you place it again."
33
+ }
34
+ },
35
+ "cancel": {
36
+ "pending_checking": {
37
+ "text": "Pending — checking. Your cancel was sent but the answer was lost. Checking whether the order is gone.",
38
+ "next": "Wait. This takes up to 2 minutes."
39
+ },
40
+ "applied": {
41
+ "text": "Cancelled. The order is off the book.",
42
+ "next": ""
43
+ },
44
+ "applied_other": {
45
+ "text": "Filled before the cancel.",
46
+ "next": "Check your position."
47
+ },
48
+ "refused": {
49
+ "text": "Not cancelled: {meaning}.",
50
+ "next": "{action}"
51
+ },
52
+ "still_unknown": {
53
+ "text": "Still not known after 2 minutes. The order is still on the book.",
54
+ "next": "You can cancel it again: cancelling twice has no extra effect."
55
+ },
56
+ "still_unknown_gone": {
57
+ "text": "Still not known after 2 minutes. The order is off the book: it was cancelled or filled.",
58
+ "next": "Check your position."
59
+ },
60
+ "still_unknown_unread": {
61
+ "text": "Still not known after 2 minutes. The network's reads did not answer.",
62
+ "next": "You can cancel it again: cancelling twice has no extra effect."
63
+ }
64
+ },
65
+ "cancel_all": {
66
+ "pending_checking": {
67
+ "text": "Pending — checking. Cancel all was sent but the answer was lost. Checking your open orders.",
68
+ "next": "Wait. This takes up to 2 minutes."
69
+ },
70
+ "applied": {
71
+ "text": "All {n} orders cancelled.",
72
+ "next": ""
73
+ },
74
+ "applied_other": {
75
+ "text": "{n} of {m} cancelled; {k} filled first.",
76
+ "next": ""
77
+ },
78
+ "refused": {
79
+ "text": "Not cancelled: {meaning}.",
80
+ "next": ""
81
+ },
82
+ "still_unknown": {
83
+ "text": "Still not known after 2 minutes. {n} orders are still open.",
84
+ "next": "Check your open orders; cancel what is still open."
85
+ },
86
+ "still_unknown_unread": {
87
+ "text": "Still not known after 2 minutes. The network's reads did not answer.",
88
+ "next": "Check your open orders; cancel what is still open."
89
+ }
90
+ },
91
+ "close_all": {
92
+ "pending_checking": {
93
+ "text": "Pending — checking. The closes were sent but the answers were lost. Checking your positions.",
94
+ "next": "Wait. This takes up to 2 minutes."
95
+ },
96
+ "applied": {
97
+ "text": "{n} positions closed.",
98
+ "next": ""
99
+ },
100
+ "applied_other": {
101
+ "text": "{n} of {m} closed. {k} still open.",
102
+ "next": "Close them on the trading page."
103
+ },
104
+ "refused": {
105
+ "text": "Not closed: {meaning}.",
106
+ "next": ""
107
+ },
108
+ "still_unknown": {
109
+ "text": "Still not known after 2 minutes. {n} positions are still open.",
110
+ "next": "Close what is still open on the trading page."
111
+ }
112
+ },
113
+ "revoke": {
114
+ "pending_checking": {
115
+ "text": "Pending — checking. The revoke was sent. Checking that the agent is revoked.",
116
+ "next": "Wait. This takes up to 2 minutes."
117
+ },
118
+ "applied": {
119
+ "text": "Agent revoked at block {height}. {m} orders cancelled.",
120
+ "next": ""
121
+ },
122
+ "refused": {
123
+ "text": "Not revoked: {meaning}.",
124
+ "next": ""
125
+ },
126
+ "still_unknown": {
127
+ "text": "Still not known after 2 minutes. The agent is still live.",
128
+ "next": "You can revoke again: it has no extra effect."
129
+ },
130
+ "still_unknown_unread": {
131
+ "text": "Still not known after 2 minutes. The network's reads did not answer.",
132
+ "next": "You can revoke again: it has no extra effect."
133
+ }
134
+ },
135
+ "stop": {
136
+ "pending_checking": {
137
+ "text": "Pending — checking. The stop was sent. Checking that your trading key and agents are stopped.",
138
+ "next": "Wait. This takes up to 2 minutes."
139
+ },
140
+ "applied": {
141
+ "text": "Stopped on the network: no trading key, no live agent, no open order.",
142
+ "next": ""
143
+ },
144
+ "applied_other": {
145
+ "text": "Your trading key and every agent are stopped. {n} orders your wallet placed itself stay open.",
146
+ "next": ""
147
+ },
148
+ "refused": {
149
+ "text": "Not stopped: {meaning}.",
150
+ "next": ""
151
+ },
152
+ "not_applied": {
153
+ "text": "Not stopped. That signature has passed its time to apply.",
154
+ "next": "Press Stop everything now again."
155
+ },
156
+ "still_unknown": {
157
+ "text": "Still not known after 2 minutes. {what_is_live}.",
158
+ "next": "You can stop again: it has no extra effect."
159
+ }
160
+ }
161
+ },
162
+ "resend_while_pending": {
163
+ "order": null,
164
+ "cancel": "Send the same cancel again",
165
+ "cancel_all": null,
166
+ "close_all": null,
167
+ "revoke": "Send the same revoke again",
168
+ "stop": "Send the same stop again"
169
+ },
170
+ "check_again": "Check again",
171
+ "place_as_new": "Place as a new order"
172
+ };
package/dist/cjs/pins.js CHANGED
@@ -12,6 +12,9 @@ exports.PINS = Object.freeze({
12
12
  });
13
13
  /** The network reports a chain id or genesis other than its pin. Nothing was signed. */
14
14
  class PinMismatch extends errors_js_1.NetworkMismatch {
15
+ /** When the reason is the signed release record: its code (`expired`, `rollback`, `not_served`, `unsigned`,
16
+ * `bad_signature`, `not_listed`, …), else null. */
17
+ recordCode = null;
15
18
  constructor(message) {
16
19
  super(message);
17
20
  this.name = 'PinMismatch';
@@ -20,6 +23,8 @@ class PinMismatch extends errors_js_1.NetworkMismatch {
20
23
  exports.PinMismatch = PinMismatch;
21
24
  /** The network is not a named network and carries no pin. It can be read; nothing is signed for it. */
22
25
  class UnpinnedNetwork extends errors_js_1.NetworkMismatch {
26
+ /** When the reason is the signed release record (a network named only by its chain id): its code, else null. */
27
+ recordCode = null;
23
28
  constructor(message) {
24
29
  super(message);
25
30
  this.name = 'UnpinnedNetwork';