@sparkdreamnft/sparkdreamjs 0.0.40 → 0.0.42

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.
@@ -1,5 +1,5 @@
1
1
  import { Params, ParamsAmino, FederationOperationalParams, FederationOperationalParamsAmino } from "./params";
2
- import { PeerType, PeerPolicy, PeerPolicyAmino, FederatedContentStatus, JuryVerdict } from "./types";
2
+ import { PeerType, PeerPolicy, PeerPolicyAmino, ContentRef, ContentRefAmino, FederatedContentStatus, JuryVerdict } from "./types";
3
3
  import { ChainIdentity, ChainIdentityAmino } from "../../identity/v1/chain_identity";
4
4
  import { BinaryReader, BinaryWriter } from "../../../binary";
5
5
  import { DeepPartial } from "../../../helpers";
@@ -79,6 +79,14 @@ export interface MsgRegisterPeer {
79
79
  * metadata so wallets render <SYMBOL>.ibc instead of ibc/<hash>.
80
80
  */
81
81
  peerIdentity?: ChainIdentity;
82
+ /**
83
+ * ibc_transfer_channel_id is this chain's end of the ICS-20 `transfer`
84
+ * channel to the peer. Optional. Distinct from ibc_channel_id, which is
85
+ * the `federation` port channel: the two are opened separately and
86
+ * rarely share a number. Voucher metadata for peer_identity is keyed on
87
+ * this channel and is skipped when it is empty.
88
+ */
89
+ ibcTransferChannelId: string;
82
90
  }
83
91
  export interface MsgRegisterPeerProtoMsg {
84
92
  typeUrl: "/sparkdream.federation.v1.MsgRegisterPeer";
@@ -112,6 +120,14 @@ export interface MsgRegisterPeerAmino {
112
120
  * metadata so wallets render <SYMBOL>.ibc instead of ibc/<hash>.
113
121
  */
114
122
  peer_identity?: ChainIdentityAmino;
123
+ /**
124
+ * ibc_transfer_channel_id is this chain's end of the ICS-20 `transfer`
125
+ * channel to the peer. Optional. Distinct from ibc_channel_id, which is
126
+ * the `federation` port channel: the two are opened separately and
127
+ * rarely share a number. Voucher metadata for peer_identity is keyed on
128
+ * this channel and is skipped when it is empty.
129
+ */
130
+ ibc_transfer_channel_id?: string;
115
131
  }
116
132
  export interface MsgRegisterPeerAminoMsg {
117
133
  type: "sparkdream/x/federation/MsgRegisterPeer";
@@ -487,6 +503,13 @@ export interface MsgSubmitFederatedContent {
487
503
  protocolMetadata: Uint8Array;
488
504
  remoteCreatedAt: bigint;
489
505
  contentHash: Uint8Array;
506
+ /**
507
+ * supersedes marks this submission as a new version of an earlier record
508
+ * the same operator anchored for the same peer and content_uri (an edit
509
+ * at the source). A PENDING_VERIFICATION predecessor is retired to
510
+ * SUPERSEDED; one already past verification only gains the forward link.
511
+ */
512
+ supersedes?: ContentRef;
490
513
  }
491
514
  export interface MsgSubmitFederatedContentProtoMsg {
492
515
  typeUrl: "/sparkdream.federation.v1.MsgSubmitFederatedContent";
@@ -510,6 +533,13 @@ export interface MsgSubmitFederatedContentAmino {
510
533
  protocol_metadata?: string;
511
534
  remote_created_at?: string;
512
535
  content_hash?: string;
536
+ /**
537
+ * supersedes marks this submission as a new version of an earlier record
538
+ * the same operator anchored for the same peer and content_uri (an edit
539
+ * at the source). A PENDING_VERIFICATION predecessor is retired to
540
+ * SUPERSEDED; one already past verification only gains the forward link.
541
+ */
542
+ supersedes?: ContentRefAmino;
513
543
  }
514
544
  export interface MsgSubmitFederatedContentAminoMsg {
515
545
  type: "sparkdream/x/federation/MsgSubmitFederatedContent";
@@ -158,7 +158,8 @@ function createBaseMsgRegisterPeer() {
158
158
  ibcChannelId: "",
159
159
  metadata: "",
160
160
  controllerGroup: "",
161
- peerIdentity: undefined
161
+ peerIdentity: undefined,
162
+ ibcTransferChannelId: ""
162
163
  };
163
164
  }
164
165
  /**
@@ -194,6 +195,9 @@ exports.MsgRegisterPeer = {
194
195
  if (message.peerIdentity !== undefined) {
195
196
  chain_identity_1.ChainIdentity.encode(message.peerIdentity, writer.uint32(66).fork()).ldelim();
196
197
  }
198
+ if (message.ibcTransferChannelId !== "") {
199
+ writer.uint32(74).string(message.ibcTransferChannelId);
200
+ }
197
201
  return writer;
198
202
  },
199
203
  decode(input, length) {
@@ -227,6 +231,9 @@ exports.MsgRegisterPeer = {
227
231
  case 8:
228
232
  message.peerIdentity = chain_identity_1.ChainIdentity.decode(reader, reader.uint32());
229
233
  break;
234
+ case 9:
235
+ message.ibcTransferChannelId = reader.string();
236
+ break;
230
237
  default:
231
238
  reader.skipType(tag & 7);
232
239
  break;
@@ -244,6 +251,7 @@ exports.MsgRegisterPeer = {
244
251
  message.metadata = object.metadata ?? "";
245
252
  message.controllerGroup = object.controllerGroup ?? "";
246
253
  message.peerIdentity = object.peerIdentity !== undefined && object.peerIdentity !== null ? chain_identity_1.ChainIdentity.fromPartial(object.peerIdentity) : undefined;
254
+ message.ibcTransferChannelId = object.ibcTransferChannelId ?? "";
247
255
  return message;
248
256
  },
249
257
  fromAmino(object) {
@@ -272,6 +280,9 @@ exports.MsgRegisterPeer = {
272
280
  if (object.peer_identity !== undefined && object.peer_identity !== null) {
273
281
  message.peerIdentity = chain_identity_1.ChainIdentity.fromAmino(object.peer_identity);
274
282
  }
283
+ if (object.ibc_transfer_channel_id !== undefined && object.ibc_transfer_channel_id !== null) {
284
+ message.ibcTransferChannelId = object.ibc_transfer_channel_id;
285
+ }
275
286
  return message;
276
287
  },
277
288
  toAmino(message) {
@@ -284,6 +295,7 @@ exports.MsgRegisterPeer = {
284
295
  obj.metadata = message.metadata === "" ? undefined : message.metadata;
285
296
  obj.controller_group = message.controllerGroup === "" ? undefined : message.controllerGroup;
286
297
  obj.peer_identity = message.peerIdentity ? chain_identity_1.ChainIdentity.toAmino(message.peerIdentity) : undefined;
298
+ obj.ibc_transfer_channel_id = message.ibcTransferChannelId === "" ? undefined : message.ibcTransferChannelId;
287
299
  return obj;
288
300
  },
289
301
  fromAminoMsg(object) {
@@ -1329,7 +1341,8 @@ function createBaseMsgSubmitFederatedContent() {
1329
1341
  contentUri: "",
1330
1342
  protocolMetadata: new Uint8Array(),
1331
1343
  remoteCreatedAt: BigInt(0),
1332
- contentHash: new Uint8Array()
1344
+ contentHash: new Uint8Array(),
1345
+ supersedes: undefined
1333
1346
  };
1334
1347
  }
1335
1348
  /**
@@ -1377,6 +1390,9 @@ exports.MsgSubmitFederatedContent = {
1377
1390
  if (message.contentHash.length !== 0) {
1378
1391
  writer.uint32(98).bytes(message.contentHash);
1379
1392
  }
1393
+ if (message.supersedes !== undefined) {
1394
+ types_1.ContentRef.encode(message.supersedes, writer.uint32(106).fork()).ldelim();
1395
+ }
1380
1396
  return writer;
1381
1397
  },
1382
1398
  decode(input, length) {
@@ -1422,6 +1438,9 @@ exports.MsgSubmitFederatedContent = {
1422
1438
  case 12:
1423
1439
  message.contentHash = reader.bytes();
1424
1440
  break;
1441
+ case 13:
1442
+ message.supersedes = types_1.ContentRef.decode(reader, reader.uint32());
1443
+ break;
1425
1444
  default:
1426
1445
  reader.skipType(tag & 7);
1427
1446
  break;
@@ -1443,6 +1462,7 @@ exports.MsgSubmitFederatedContent = {
1443
1462
  message.protocolMetadata = object.protocolMetadata ?? new Uint8Array();
1444
1463
  message.remoteCreatedAt = object.remoteCreatedAt !== undefined && object.remoteCreatedAt !== null ? BigInt(object.remoteCreatedAt.toString()) : BigInt(0);
1445
1464
  message.contentHash = object.contentHash ?? new Uint8Array();
1465
+ message.supersedes = object.supersedes !== undefined && object.supersedes !== null ? types_1.ContentRef.fromPartial(object.supersedes) : undefined;
1446
1466
  return message;
1447
1467
  },
1448
1468
  fromAmino(object) {
@@ -1483,6 +1503,9 @@ exports.MsgSubmitFederatedContent = {
1483
1503
  if (object.content_hash !== undefined && object.content_hash !== null) {
1484
1504
  message.contentHash = (0, helpers_1.bytesFromBase64)(object.content_hash);
1485
1505
  }
1506
+ if (object.supersedes !== undefined && object.supersedes !== null) {
1507
+ message.supersedes = types_1.ContentRef.fromAmino(object.supersedes);
1508
+ }
1486
1509
  return message;
1487
1510
  },
1488
1511
  toAmino(message) {
@@ -1499,6 +1522,7 @@ exports.MsgSubmitFederatedContent = {
1499
1522
  obj.protocol_metadata = message.protocolMetadata ? (0, helpers_1.base64FromBytes)(message.protocolMetadata) : undefined;
1500
1523
  obj.remote_created_at = message.remoteCreatedAt !== BigInt(0) ? message.remoteCreatedAt?.toString() : undefined;
1501
1524
  obj.content_hash = message.contentHash ? (0, helpers_1.base64FromBytes)(message.contentHash) : undefined;
1525
+ obj.supersedes = message.supersedes ? types_1.ContentRef.toAmino(message.supersedes) : undefined;
1502
1526
  return obj;
1503
1527
  },
1504
1528
  fromAminoMsg(object) {
@@ -57,6 +57,30 @@ export declare enum FederatedContentStatus {
57
57
  FEDERATED_CONTENT_STATUS_DISPUTED = 4,
58
58
  FEDERATED_CONTENT_STATUS_CHALLENGED = 5,
59
59
  FEDERATED_CONTENT_STATUS_REJECTED = 6,
60
+ /**
61
+ * FEDERATED_CONTENT_STATUS_UNRESOLVED - UNRESOLVED is system-assigned: the arbiter resolution window expired
62
+ * without quorum, so no finding was ever made about the content. It is
63
+ * terminal, deliberately excluded from MsgModerateContent (OpsComm
64
+ * moderates HIDDEN/ACTIVE/VERIFIED/REJECTED, not system states), and
65
+ * was chosen over reverting to PENDING_VERIFICATION because a revived
66
+ * record would have no VerificationWindow queue entry and a verification
67
+ * deadline already in the past — unverifiable and unreapable until
68
+ * content_ttl. Local state only: FederatedContentStatus never crosses
69
+ * the IBC wire (see packet_wire_compat_test.go).
70
+ */
71
+ FEDERATED_CONTENT_STATUS_UNRESOLVED = 7,
72
+ /**
73
+ * FEDERATED_CONTENT_STATUS_SUPERSEDED - SUPERSEDED is system-assigned: the submitting operator anchored a newer
74
+ * version of the same content_uri (an edit) while this record was still
75
+ * PENDING_VERIFICATION. The anchored version no longer exists at the
76
+ * source, so no verifier can ever confirm it; retiring it here keeps it
77
+ * out of the verification-expiry sweep, which would otherwise count it
78
+ * against an honest operator as unverified. Terminal and excluded from
79
+ * MsgModerateContent for the same reason as UNRESOLVED: moderating it
80
+ * could manufacture a VERIFIED status for bytes nobody verified. Local
81
+ * state only; never crosses the IBC wire.
82
+ */
83
+ FEDERATED_CONTENT_STATUS_SUPERSEDED = 8,
60
84
  UNRECOGNIZED = -1
61
85
  }
62
86
  export declare const FederatedContentStatusAmino: typeof FederatedContentStatus;
@@ -150,6 +174,12 @@ export interface Peer {
150
174
  * peers registered via MsgRegisterPeer with --peer-identity.
151
175
  */
152
176
  peerIdentity?: ChainIdentity;
177
+ /**
178
+ * ibc_transfer_channel_id is this chain's end of the ICS-20 `transfer`
179
+ * channel to the peer, as supplied at registration. Empty when the peer
180
+ * has no transfer channel. Voucher metadata (spec §9.2) is keyed on it.
181
+ */
182
+ ibcTransferChannelId: string;
153
183
  }
154
184
  export interface PeerProtoMsg {
155
185
  typeUrl: "/sparkdream.federation.v1.Peer";
@@ -191,6 +221,12 @@ export interface PeerAmino {
191
221
  * peers registered via MsgRegisterPeer with --peer-identity.
192
222
  */
193
223
  peer_identity?: ChainIdentityAmino;
224
+ /**
225
+ * ibc_transfer_channel_id is this chain's end of the ICS-20 `transfer`
226
+ * channel to the peer, as supplied at registration. Empty when the peer
227
+ * has no transfer channel. Voucher metadata (spec §9.2) is keyed on it.
228
+ */
229
+ ibc_transfer_channel_id?: string;
194
230
  }
195
231
  export interface PeerAminoMsg {
196
232
  type: "/sparkdream.federation.v1.Peer";
@@ -222,6 +258,16 @@ export interface PeerPolicy {
222
258
  */
223
259
  requireReview: boolean;
224
260
  blockedIdentities: string[];
261
+ /**
262
+ * content_hosts lists hostnames, beyond the peer id itself, that may
263
+ * appear in an inbound content_uri. ActivityPub peers only. An instance
264
+ * whose AS2 ids live on a different host than its account domain (a
265
+ * WEB_DOMAIN split) lists that host here; otherwise leave it empty and
266
+ * only the peer id's own host is accepted. Without the check a bridge
267
+ * bonded for one peer could anchor another instance's posts under this
268
+ * peer's name.
269
+ */
270
+ contentHosts: string[];
225
271
  }
226
272
  export interface PeerPolicyProtoMsg {
227
273
  typeUrl: "/sparkdream.federation.v1.PeerPolicy";
@@ -253,6 +299,16 @@ export interface PeerPolicyAmino {
253
299
  */
254
300
  require_review?: boolean;
255
301
  blocked_identities?: string[];
302
+ /**
303
+ * content_hosts lists hostnames, beyond the peer id itself, that may
304
+ * appear in an inbound content_uri. ActivityPub peers only. An instance
305
+ * whose AS2 ids live on a different host than its account domain (a
306
+ * WEB_DOMAIN split) lists that host here; otherwise leave it empty and
307
+ * only the peer id's own host is accepted. Without the check a bridge
308
+ * bonded for one peer could anchor another instance's posts under this
309
+ * peer's name.
310
+ */
311
+ content_hosts?: string[];
256
312
  }
257
313
  export interface PeerPolicyAminoMsg {
258
314
  type: "/sparkdream.federation.v1.PeerPolicy";
@@ -415,6 +471,19 @@ export interface VerificationRecord {
415
471
  * clears it back to UNSPECIFIED, deferring resolution to the jury path.
416
472
  */
417
473
  pendingVerifierVerdict: PendingVerifierVerdict;
474
+ /**
475
+ * commitment_released records that CommittedAmount was already given
476
+ * back to the verifier's available bond via x/rep ReleaseBond. The
477
+ * flag exists because the alternative — inferring from Outcome —
478
+ * cannot distinguish an upheld challenge (SlashBond already freed the
479
+ * commitment; a second release would silently eat a different
480
+ * concurrent commitment, since ReleaseBond is saturating) from the
481
+ * paths that owe a release, and the record outlives the content
482
+ * (pruneExpiredContent drops Content but never VerificationRecords).
483
+ * True means released; false means either not yet resolved or freed
484
+ * by SlashBond on the upheld path.
485
+ */
486
+ commitmentReleased: boolean;
418
487
  }
419
488
  export interface VerificationRecordProtoMsg {
420
489
  typeUrl: "/sparkdream.federation.v1.VerificationRecord";
@@ -455,6 +524,19 @@ export interface VerificationRecordAmino {
455
524
  * clears it back to UNSPECIFIED, deferring resolution to the jury path.
456
525
  */
457
526
  pending_verifier_verdict?: PendingVerifierVerdict;
527
+ /**
528
+ * commitment_released records that CommittedAmount was already given
529
+ * back to the verifier's available bond via x/rep ReleaseBond. The
530
+ * flag exists because the alternative — inferring from Outcome —
531
+ * cannot distinguish an upheld challenge (SlashBond already freed the
532
+ * commitment; a second release would silently eat a different
533
+ * concurrent commitment, since ReleaseBond is saturating) from the
534
+ * paths that owe a release, and the record outlives the content
535
+ * (pruneExpiredContent drops Content but never VerificationRecords).
536
+ * True means released; false means either not yet resolved or freed
537
+ * by SlashBond on the upheld path.
538
+ */
539
+ commitment_released?: boolean;
458
540
  }
459
541
  export interface VerificationRecordAminoMsg {
460
542
  type: "/sparkdream.federation.v1.VerificationRecord";
@@ -603,6 +685,17 @@ export interface FederatedContent {
603
685
  status: FederatedContentStatus;
604
686
  expiresAt: bigint;
605
687
  contentHash: Uint8Array;
688
+ /**
689
+ * supersedes names the earlier record of the same content_uri that this
690
+ * one replaces (an edit). Unset for a first version.
691
+ */
692
+ supersedes?: ContentRef;
693
+ /**
694
+ * superseded_by is the id of the newer record that replaced this one,
695
+ * 0 while none has. A successor is always allocated after its
696
+ * predecessor, so it is never content id 0 and 0 is unambiguous here.
697
+ */
698
+ supersededBy: bigint;
606
699
  }
607
700
  export interface FederatedContentProtoMsg {
608
701
  typeUrl: "/sparkdream.federation.v1.FederatedContent";
@@ -631,11 +724,52 @@ export interface FederatedContentAmino {
631
724
  status?: FederatedContentStatus;
632
725
  expires_at?: string;
633
726
  content_hash?: string;
727
+ /**
728
+ * supersedes names the earlier record of the same content_uri that this
729
+ * one replaces (an edit). Unset for a first version.
730
+ */
731
+ supersedes?: ContentRefAmino;
732
+ /**
733
+ * superseded_by is the id of the newer record that replaced this one,
734
+ * 0 while none has. A successor is always allocated after its
735
+ * predecessor, so it is never content id 0 and 0 is unambiguous here.
736
+ */
737
+ superseded_by?: string;
634
738
  }
635
739
  export interface FederatedContentAminoMsg {
636
740
  type: "/sparkdream.federation.v1.FederatedContent";
637
741
  value: FederatedContentAmino;
638
742
  }
743
+ /**
744
+ * ContentRef points at a FederatedContent record. A message rather than a
745
+ * bare uint64 because content ids start at 0: a nil ref is "none", which
746
+ * a zero id could not express.
747
+ * @name ContentRef
748
+ * @package sparkdream.federation.v1
749
+ * @see proto type: sparkdream.federation.v1.ContentRef
750
+ */
751
+ export interface ContentRef {
752
+ contentId: bigint;
753
+ }
754
+ export interface ContentRefProtoMsg {
755
+ typeUrl: "/sparkdream.federation.v1.ContentRef";
756
+ value: Uint8Array;
757
+ }
758
+ /**
759
+ * ContentRef points at a FederatedContent record. A message rather than a
760
+ * bare uint64 because content ids start at 0: a nil ref is "none", which
761
+ * a zero id could not express.
762
+ * @name ContentRefAmino
763
+ * @package sparkdream.federation.v1
764
+ * @see proto type: sparkdream.federation.v1.ContentRef
765
+ */
766
+ export interface ContentRefAmino {
767
+ content_id?: string;
768
+ }
769
+ export interface ContentRefAminoMsg {
770
+ type: "/sparkdream.federation.v1.ContentRef";
771
+ value: ContentRefAmino;
772
+ }
639
773
  /**
640
774
  * IdentityLink maps a local address to a remote identity on a federation peer.
641
775
  * @name IdentityLink
@@ -1008,6 +1142,26 @@ export declare const FederatedContent: {
1008
1142
  toProto(message: FederatedContent): Uint8Array;
1009
1143
  toProtoMsg(message: FederatedContent): FederatedContentProtoMsg;
1010
1144
  };
1145
+ /**
1146
+ * ContentRef points at a FederatedContent record. A message rather than a
1147
+ * bare uint64 because content ids start at 0: a nil ref is "none", which
1148
+ * a zero id could not express.
1149
+ * @name ContentRef
1150
+ * @package sparkdream.federation.v1
1151
+ * @see proto type: sparkdream.federation.v1.ContentRef
1152
+ */
1153
+ export declare const ContentRef: {
1154
+ typeUrl: string;
1155
+ encode(message: ContentRef, writer?: BinaryWriter): BinaryWriter;
1156
+ decode(input: BinaryReader | Uint8Array, length?: number): ContentRef;
1157
+ fromPartial(object: DeepPartial<ContentRef>): ContentRef;
1158
+ fromAmino(object: ContentRefAmino): ContentRef;
1159
+ toAmino(message: ContentRef): ContentRefAmino;
1160
+ fromAminoMsg(object: ContentRefAminoMsg): ContentRef;
1161
+ fromProtoMsg(message: ContentRefProtoMsg): ContentRef;
1162
+ toProto(message: ContentRef): Uint8Array;
1163
+ toProtoMsg(message: ContentRef): ContentRefProtoMsg;
1164
+ };
1011
1165
  /**
1012
1166
  * IdentityLink maps a local address to a remote identity on a federation peer.
1013
1167
  * @name IdentityLink