@snapshot-labs/snapshot.js 0.14.17 → 0.14.18
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/dist/snapshot.cjs.js +5 -42
- package/dist/snapshot.esm.js +5 -42
- package/dist/snapshot.min.js +1 -1
- package/dist/src/sign/types.d.ts +0 -18
- package/package.json +1 -1
- package/src/sign/index.ts +4 -8
- package/src/sign/types.ts +1 -40
package/dist/snapshot.cjs.js
CHANGED
|
@@ -4108,7 +4108,7 @@ const cancelProposal2Types = {
|
|
|
4108
4108
|
{ name: 'from', type: 'string' },
|
|
4109
4109
|
{ name: 'space', type: 'string' },
|
|
4110
4110
|
{ name: 'timestamp', type: 'uint64' },
|
|
4111
|
-
{ name: 'proposal', type: '
|
|
4111
|
+
{ name: 'proposal', type: 'string' }
|
|
4112
4112
|
]
|
|
4113
4113
|
};
|
|
4114
4114
|
const voteTypes = {
|
|
@@ -4147,42 +4147,6 @@ const voteStringTypes = {
|
|
|
4147
4147
|
{ name: 'metadata', type: 'string' }
|
|
4148
4148
|
]
|
|
4149
4149
|
};
|
|
4150
|
-
const vote2Types = {
|
|
4151
|
-
Vote: [
|
|
4152
|
-
{ name: 'from', type: 'string' },
|
|
4153
|
-
{ name: 'space', type: 'string' },
|
|
4154
|
-
{ name: 'timestamp', type: 'uint64' },
|
|
4155
|
-
{ name: 'proposal', type: 'bytes32' },
|
|
4156
|
-
{ name: 'choice', type: 'uint32' },
|
|
4157
|
-
{ name: 'reason', type: 'string' },
|
|
4158
|
-
{ name: 'app', type: 'string' },
|
|
4159
|
-
{ name: 'metadata', type: 'string' }
|
|
4160
|
-
]
|
|
4161
|
-
};
|
|
4162
|
-
const voteArray2Types = {
|
|
4163
|
-
Vote: [
|
|
4164
|
-
{ name: 'from', type: 'string' },
|
|
4165
|
-
{ name: 'space', type: 'string' },
|
|
4166
|
-
{ name: 'timestamp', type: 'uint64' },
|
|
4167
|
-
{ name: 'proposal', type: 'bytes32' },
|
|
4168
|
-
{ name: 'choice', type: 'uint32[]' },
|
|
4169
|
-
{ name: 'reason', type: 'string' },
|
|
4170
|
-
{ name: 'app', type: 'string' },
|
|
4171
|
-
{ name: 'metadata', type: 'string' }
|
|
4172
|
-
]
|
|
4173
|
-
};
|
|
4174
|
-
const voteString2Types = {
|
|
4175
|
-
Vote: [
|
|
4176
|
-
{ name: 'from', type: 'string' },
|
|
4177
|
-
{ name: 'space', type: 'string' },
|
|
4178
|
-
{ name: 'timestamp', type: 'uint64' },
|
|
4179
|
-
{ name: 'proposal', type: 'bytes32' },
|
|
4180
|
-
{ name: 'choice', type: 'string' },
|
|
4181
|
-
{ name: 'reason', type: 'string' },
|
|
4182
|
-
{ name: 'app', type: 'string' },
|
|
4183
|
-
{ name: 'metadata', type: 'string' }
|
|
4184
|
-
]
|
|
4185
|
-
};
|
|
4186
4150
|
const followTypes = {
|
|
4187
4151
|
Follow: [
|
|
4188
4152
|
{ name: 'from', type: 'address' },
|
|
@@ -4373,16 +4337,15 @@ class Client {
|
|
|
4373
4337
|
message.app = '';
|
|
4374
4338
|
if (!message.metadata)
|
|
4375
4339
|
message.metadata = '{}';
|
|
4376
|
-
|
|
4377
|
-
let type = type2 ? vote2Types : voteTypes;
|
|
4340
|
+
let type = voteTypes;
|
|
4378
4341
|
if (['approval', 'ranked-choice'].includes(message.type))
|
|
4379
|
-
type =
|
|
4342
|
+
type = voteArrayTypes;
|
|
4380
4343
|
if (!isShutter && ['quadratic', 'weighted'].includes(message.type)) {
|
|
4381
|
-
type =
|
|
4344
|
+
type = voteStringTypes;
|
|
4382
4345
|
message.choice = JSON.stringify(message.choice);
|
|
4383
4346
|
}
|
|
4384
4347
|
if (isShutter)
|
|
4385
|
-
type =
|
|
4348
|
+
type = voteStringTypes;
|
|
4386
4349
|
delete message.privacy;
|
|
4387
4350
|
// @ts-ignore
|
|
4388
4351
|
delete message.type;
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -4098,7 +4098,7 @@ const cancelProposal2Types = {
|
|
|
4098
4098
|
{ name: 'from', type: 'string' },
|
|
4099
4099
|
{ name: 'space', type: 'string' },
|
|
4100
4100
|
{ name: 'timestamp', type: 'uint64' },
|
|
4101
|
-
{ name: 'proposal', type: '
|
|
4101
|
+
{ name: 'proposal', type: 'string' }
|
|
4102
4102
|
]
|
|
4103
4103
|
};
|
|
4104
4104
|
const voteTypes = {
|
|
@@ -4137,42 +4137,6 @@ const voteStringTypes = {
|
|
|
4137
4137
|
{ name: 'metadata', type: 'string' }
|
|
4138
4138
|
]
|
|
4139
4139
|
};
|
|
4140
|
-
const vote2Types = {
|
|
4141
|
-
Vote: [
|
|
4142
|
-
{ name: 'from', type: 'string' },
|
|
4143
|
-
{ name: 'space', type: 'string' },
|
|
4144
|
-
{ name: 'timestamp', type: 'uint64' },
|
|
4145
|
-
{ name: 'proposal', type: 'bytes32' },
|
|
4146
|
-
{ name: 'choice', type: 'uint32' },
|
|
4147
|
-
{ name: 'reason', type: 'string' },
|
|
4148
|
-
{ name: 'app', type: 'string' },
|
|
4149
|
-
{ name: 'metadata', type: 'string' }
|
|
4150
|
-
]
|
|
4151
|
-
};
|
|
4152
|
-
const voteArray2Types = {
|
|
4153
|
-
Vote: [
|
|
4154
|
-
{ name: 'from', type: 'string' },
|
|
4155
|
-
{ name: 'space', type: 'string' },
|
|
4156
|
-
{ name: 'timestamp', type: 'uint64' },
|
|
4157
|
-
{ name: 'proposal', type: 'bytes32' },
|
|
4158
|
-
{ name: 'choice', type: 'uint32[]' },
|
|
4159
|
-
{ name: 'reason', type: 'string' },
|
|
4160
|
-
{ name: 'app', type: 'string' },
|
|
4161
|
-
{ name: 'metadata', type: 'string' }
|
|
4162
|
-
]
|
|
4163
|
-
};
|
|
4164
|
-
const voteString2Types = {
|
|
4165
|
-
Vote: [
|
|
4166
|
-
{ name: 'from', type: 'string' },
|
|
4167
|
-
{ name: 'space', type: 'string' },
|
|
4168
|
-
{ name: 'timestamp', type: 'uint64' },
|
|
4169
|
-
{ name: 'proposal', type: 'bytes32' },
|
|
4170
|
-
{ name: 'choice', type: 'string' },
|
|
4171
|
-
{ name: 'reason', type: 'string' },
|
|
4172
|
-
{ name: 'app', type: 'string' },
|
|
4173
|
-
{ name: 'metadata', type: 'string' }
|
|
4174
|
-
]
|
|
4175
|
-
};
|
|
4176
4140
|
const followTypes = {
|
|
4177
4141
|
Follow: [
|
|
4178
4142
|
{ name: 'from', type: 'address' },
|
|
@@ -4363,16 +4327,15 @@ class Client {
|
|
|
4363
4327
|
message.app = '';
|
|
4364
4328
|
if (!message.metadata)
|
|
4365
4329
|
message.metadata = '{}';
|
|
4366
|
-
|
|
4367
|
-
let type = type2 ? vote2Types : voteTypes;
|
|
4330
|
+
let type = voteTypes;
|
|
4368
4331
|
if (['approval', 'ranked-choice'].includes(message.type))
|
|
4369
|
-
type =
|
|
4332
|
+
type = voteArrayTypes;
|
|
4370
4333
|
if (!isShutter && ['quadratic', 'weighted'].includes(message.type)) {
|
|
4371
|
-
type =
|
|
4334
|
+
type = voteStringTypes;
|
|
4372
4335
|
message.choice = JSON.stringify(message.choice);
|
|
4373
4336
|
}
|
|
4374
4337
|
if (isShutter)
|
|
4375
|
-
type =
|
|
4338
|
+
type = voteStringTypes;
|
|
4376
4339
|
delete message.privacy;
|
|
4377
4340
|
// @ts-ignore
|
|
4378
4341
|
delete message.type;
|