@farcaster/hub-web 0.4.1 → 0.4.2
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/index.d.ts +5430 -1145
- package/dist/index.js +562 -427
- package/dist/index.mjs +561 -427
- package/package.json +5 -5
package/dist/index.js
CHANGED
@@ -2682,6 +2682,7 @@ __export(src_exports, {
|
|
2682
2682
|
HubServiceGetSyncStatusDesc: () => HubServiceGetSyncStatusDesc,
|
2683
2683
|
HubServiceGetUserDataByFidDesc: () => HubServiceGetUserDataByFidDesc,
|
2684
2684
|
HubServiceGetUserDataDesc: () => HubServiceGetUserDataDesc,
|
2685
|
+
HubServiceGetUserNameProofsByFidDesc: () => HubServiceGetUserNameProofsByFidDesc,
|
2685
2686
|
HubServiceGetUsernameProofDesc: () => HubServiceGetUsernameProofDesc,
|
2686
2687
|
HubServiceGetVerificationDesc: () => HubServiceGetVerificationDesc,
|
2687
2688
|
HubServiceGetVerificationsByFidDesc: () => HubServiceGetVerificationsByFidDesc,
|
@@ -2939,8 +2940,211 @@ function isSet(value) {
|
|
2939
2940
|
|
2940
2941
|
// src/generated/message.ts
|
2941
2942
|
init_cjs_shims();
|
2943
|
+
var import_long3 = __toESM(require_long());
|
2944
|
+
var import_minimal3 = __toESM(require_minimal2());
|
2945
|
+
|
2946
|
+
// src/generated/username_proof.ts
|
2947
|
+
init_cjs_shims();
|
2942
2948
|
var import_long2 = __toESM(require_long());
|
2943
2949
|
var import_minimal2 = __toESM(require_minimal2());
|
2950
|
+
function userNameTypeFromJSON(object) {
|
2951
|
+
switch (object) {
|
2952
|
+
case 0:
|
2953
|
+
case "USERNAME_TYPE_NONE":
|
2954
|
+
return 0 /* USERNAME_TYPE_NONE */;
|
2955
|
+
case 1:
|
2956
|
+
case "USERNAME_TYPE_FNAME":
|
2957
|
+
return 1 /* USERNAME_TYPE_FNAME */;
|
2958
|
+
case 2:
|
2959
|
+
case "USERNAME_TYPE_ENS_L1":
|
2960
|
+
return 2 /* USERNAME_TYPE_ENS_L1 */;
|
2961
|
+
default:
|
2962
|
+
throw new tsProtoGlobalThis2.Error("Unrecognized enum value " + object + " for enum UserNameType");
|
2963
|
+
}
|
2964
|
+
}
|
2965
|
+
function userNameTypeToJSON(object) {
|
2966
|
+
switch (object) {
|
2967
|
+
case 0 /* USERNAME_TYPE_NONE */:
|
2968
|
+
return "USERNAME_TYPE_NONE";
|
2969
|
+
case 1 /* USERNAME_TYPE_FNAME */:
|
2970
|
+
return "USERNAME_TYPE_FNAME";
|
2971
|
+
case 2 /* USERNAME_TYPE_ENS_L1 */:
|
2972
|
+
return "USERNAME_TYPE_ENS_L1";
|
2973
|
+
default:
|
2974
|
+
throw new tsProtoGlobalThis2.Error("Unrecognized enum value " + object + " for enum UserNameType");
|
2975
|
+
}
|
2976
|
+
}
|
2977
|
+
function createBaseUserNameProof() {
|
2978
|
+
return {
|
2979
|
+
timestamp: 0,
|
2980
|
+
name: new Uint8Array(),
|
2981
|
+
owner: new Uint8Array(),
|
2982
|
+
signature: new Uint8Array(),
|
2983
|
+
fid: 0,
|
2984
|
+
type: 0
|
2985
|
+
};
|
2986
|
+
}
|
2987
|
+
var UserNameProof = {
|
2988
|
+
encode(message, writer = import_minimal2.default.Writer.create()) {
|
2989
|
+
if (message.timestamp !== 0) {
|
2990
|
+
writer.uint32(8).uint64(message.timestamp);
|
2991
|
+
}
|
2992
|
+
if (message.name.length !== 0) {
|
2993
|
+
writer.uint32(18).bytes(message.name);
|
2994
|
+
}
|
2995
|
+
if (message.owner.length !== 0) {
|
2996
|
+
writer.uint32(26).bytes(message.owner);
|
2997
|
+
}
|
2998
|
+
if (message.signature.length !== 0) {
|
2999
|
+
writer.uint32(34).bytes(message.signature);
|
3000
|
+
}
|
3001
|
+
if (message.fid !== 0) {
|
3002
|
+
writer.uint32(40).uint64(message.fid);
|
3003
|
+
}
|
3004
|
+
if (message.type !== 0) {
|
3005
|
+
writer.uint32(48).int32(message.type);
|
3006
|
+
}
|
3007
|
+
return writer;
|
3008
|
+
},
|
3009
|
+
decode(input, length) {
|
3010
|
+
const reader = input instanceof import_minimal2.default.Reader ? input : import_minimal2.default.Reader.create(input);
|
3011
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
3012
|
+
const message = createBaseUserNameProof();
|
3013
|
+
while (reader.pos < end) {
|
3014
|
+
const tag = reader.uint32();
|
3015
|
+
switch (tag >>> 3) {
|
3016
|
+
case 1:
|
3017
|
+
if (tag != 8) {
|
3018
|
+
break;
|
3019
|
+
}
|
3020
|
+
message.timestamp = longToNumber2(reader.uint64());
|
3021
|
+
continue;
|
3022
|
+
case 2:
|
3023
|
+
if (tag != 18) {
|
3024
|
+
break;
|
3025
|
+
}
|
3026
|
+
message.name = reader.bytes();
|
3027
|
+
continue;
|
3028
|
+
case 3:
|
3029
|
+
if (tag != 26) {
|
3030
|
+
break;
|
3031
|
+
}
|
3032
|
+
message.owner = reader.bytes();
|
3033
|
+
continue;
|
3034
|
+
case 4:
|
3035
|
+
if (tag != 34) {
|
3036
|
+
break;
|
3037
|
+
}
|
3038
|
+
message.signature = reader.bytes();
|
3039
|
+
continue;
|
3040
|
+
case 5:
|
3041
|
+
if (tag != 40) {
|
3042
|
+
break;
|
3043
|
+
}
|
3044
|
+
message.fid = longToNumber2(reader.uint64());
|
3045
|
+
continue;
|
3046
|
+
case 6:
|
3047
|
+
if (tag != 48) {
|
3048
|
+
break;
|
3049
|
+
}
|
3050
|
+
message.type = reader.int32();
|
3051
|
+
continue;
|
3052
|
+
}
|
3053
|
+
if ((tag & 7) == 4 || tag == 0) {
|
3054
|
+
break;
|
3055
|
+
}
|
3056
|
+
reader.skipType(tag & 7);
|
3057
|
+
}
|
3058
|
+
return message;
|
3059
|
+
},
|
3060
|
+
fromJSON(object) {
|
3061
|
+
return {
|
3062
|
+
timestamp: isSet2(object.timestamp) ? Number(object.timestamp) : 0,
|
3063
|
+
name: isSet2(object.name) ? bytesFromBase642(object.name) : new Uint8Array(),
|
3064
|
+
owner: isSet2(object.owner) ? bytesFromBase642(object.owner) : new Uint8Array(),
|
3065
|
+
signature: isSet2(object.signature) ? bytesFromBase642(object.signature) : new Uint8Array(),
|
3066
|
+
fid: isSet2(object.fid) ? Number(object.fid) : 0,
|
3067
|
+
type: isSet2(object.type) ? userNameTypeFromJSON(object.type) : 0
|
3068
|
+
};
|
3069
|
+
},
|
3070
|
+
toJSON(message) {
|
3071
|
+
const obj = {};
|
3072
|
+
message.timestamp !== void 0 && (obj.timestamp = Math.round(message.timestamp));
|
3073
|
+
message.name !== void 0 && (obj.name = base64FromBytes2(message.name !== void 0 ? message.name : new Uint8Array()));
|
3074
|
+
message.owner !== void 0 && (obj.owner = base64FromBytes2(message.owner !== void 0 ? message.owner : new Uint8Array()));
|
3075
|
+
message.signature !== void 0 && (obj.signature = base64FromBytes2(message.signature !== void 0 ? message.signature : new Uint8Array()));
|
3076
|
+
message.fid !== void 0 && (obj.fid = Math.round(message.fid));
|
3077
|
+
message.type !== void 0 && (obj.type = userNameTypeToJSON(message.type));
|
3078
|
+
return obj;
|
3079
|
+
},
|
3080
|
+
create(base) {
|
3081
|
+
return UserNameProof.fromPartial(base != null ? base : {});
|
3082
|
+
},
|
3083
|
+
fromPartial(object) {
|
3084
|
+
var _a, _b, _c, _d, _e, _f;
|
3085
|
+
const message = createBaseUserNameProof();
|
3086
|
+
message.timestamp = (_a = object.timestamp) != null ? _a : 0;
|
3087
|
+
message.name = (_b = object.name) != null ? _b : new Uint8Array();
|
3088
|
+
message.owner = (_c = object.owner) != null ? _c : new Uint8Array();
|
3089
|
+
message.signature = (_d = object.signature) != null ? _d : new Uint8Array();
|
3090
|
+
message.fid = (_e = object.fid) != null ? _e : 0;
|
3091
|
+
message.type = (_f = object.type) != null ? _f : 0;
|
3092
|
+
return message;
|
3093
|
+
}
|
3094
|
+
};
|
3095
|
+
var tsProtoGlobalThis2 = (() => {
|
3096
|
+
if (typeof globalThis !== "undefined") {
|
3097
|
+
return globalThis;
|
3098
|
+
}
|
3099
|
+
if (typeof self !== "undefined") {
|
3100
|
+
return self;
|
3101
|
+
}
|
3102
|
+
if (typeof window !== "undefined") {
|
3103
|
+
return window;
|
3104
|
+
}
|
3105
|
+
if (typeof global !== "undefined") {
|
3106
|
+
return global;
|
3107
|
+
}
|
3108
|
+
throw "Unable to locate global object";
|
3109
|
+
})();
|
3110
|
+
function bytesFromBase642(b64) {
|
3111
|
+
if (tsProtoGlobalThis2.Buffer) {
|
3112
|
+
return Uint8Array.from(tsProtoGlobalThis2.Buffer.from(b64, "base64"));
|
3113
|
+
} else {
|
3114
|
+
const bin = tsProtoGlobalThis2.atob(b64);
|
3115
|
+
const arr = new Uint8Array(bin.length);
|
3116
|
+
for (let i = 0; i < bin.length; ++i) {
|
3117
|
+
arr[i] = bin.charCodeAt(i);
|
3118
|
+
}
|
3119
|
+
return arr;
|
3120
|
+
}
|
3121
|
+
}
|
3122
|
+
function base64FromBytes2(arr) {
|
3123
|
+
if (tsProtoGlobalThis2.Buffer) {
|
3124
|
+
return tsProtoGlobalThis2.Buffer.from(arr).toString("base64");
|
3125
|
+
} else {
|
3126
|
+
const bin = [];
|
3127
|
+
arr.forEach((byte) => {
|
3128
|
+
bin.push(String.fromCharCode(byte));
|
3129
|
+
});
|
3130
|
+
return tsProtoGlobalThis2.btoa(bin.join(""));
|
3131
|
+
}
|
3132
|
+
}
|
3133
|
+
function longToNumber2(long) {
|
3134
|
+
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
3135
|
+
throw new tsProtoGlobalThis2.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
3136
|
+
}
|
3137
|
+
return long.toNumber();
|
3138
|
+
}
|
3139
|
+
if (import_minimal2.default.util.Long !== import_long2.default) {
|
3140
|
+
import_minimal2.default.util.Long = import_long2.default;
|
3141
|
+
import_minimal2.default.configure();
|
3142
|
+
}
|
3143
|
+
function isSet2(value) {
|
3144
|
+
return value !== null && value !== void 0;
|
3145
|
+
}
|
3146
|
+
|
3147
|
+
// src/generated/message.ts
|
2944
3148
|
function hashSchemeFromJSON(object) {
|
2945
3149
|
switch (object) {
|
2946
3150
|
case 0:
|
@@ -2950,7 +3154,7 @@ function hashSchemeFromJSON(object) {
|
|
2950
3154
|
case "HASH_SCHEME_BLAKE3":
|
2951
3155
|
return 1 /* BLAKE3 */;
|
2952
3156
|
default:
|
2953
|
-
throw new
|
3157
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum HashScheme");
|
2954
3158
|
}
|
2955
3159
|
}
|
2956
3160
|
function hashSchemeToJSON(object) {
|
@@ -2960,7 +3164,7 @@ function hashSchemeToJSON(object) {
|
|
2960
3164
|
case 1 /* BLAKE3 */:
|
2961
3165
|
return "HASH_SCHEME_BLAKE3";
|
2962
3166
|
default:
|
2963
|
-
throw new
|
3167
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum HashScheme");
|
2964
3168
|
}
|
2965
3169
|
}
|
2966
3170
|
function signatureSchemeFromJSON(object) {
|
@@ -2975,7 +3179,7 @@ function signatureSchemeFromJSON(object) {
|
|
2975
3179
|
case "SIGNATURE_SCHEME_EIP712":
|
2976
3180
|
return 2 /* EIP712 */;
|
2977
3181
|
default:
|
2978
|
-
throw new
|
3182
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum SignatureScheme");
|
2979
3183
|
}
|
2980
3184
|
}
|
2981
3185
|
function signatureSchemeToJSON(object) {
|
@@ -2987,7 +3191,7 @@ function signatureSchemeToJSON(object) {
|
|
2987
3191
|
case 2 /* EIP712 */:
|
2988
3192
|
return "SIGNATURE_SCHEME_EIP712";
|
2989
3193
|
default:
|
2990
|
-
throw new
|
3194
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum SignatureScheme");
|
2991
3195
|
}
|
2992
3196
|
}
|
2993
3197
|
function messageTypeFromJSON(object) {
|
@@ -3028,8 +3232,11 @@ function messageTypeFromJSON(object) {
|
|
3028
3232
|
case 11:
|
3029
3233
|
case "MESSAGE_TYPE_USER_DATA_ADD":
|
3030
3234
|
return 11 /* USER_DATA_ADD */;
|
3235
|
+
case 12:
|
3236
|
+
case "MESSAGE_TYPE_USERNAME_PROOF":
|
3237
|
+
return 12 /* USERNAME_PROOF */;
|
3031
3238
|
default:
|
3032
|
-
throw new
|
3239
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum MessageType");
|
3033
3240
|
}
|
3034
3241
|
}
|
3035
3242
|
function messageTypeToJSON(object) {
|
@@ -3058,8 +3265,10 @@ function messageTypeToJSON(object) {
|
|
3058
3265
|
return "MESSAGE_TYPE_SIGNER_REMOVE";
|
3059
3266
|
case 11 /* USER_DATA_ADD */:
|
3060
3267
|
return "MESSAGE_TYPE_USER_DATA_ADD";
|
3268
|
+
case 12 /* USERNAME_PROOF */:
|
3269
|
+
return "MESSAGE_TYPE_USERNAME_PROOF";
|
3061
3270
|
default:
|
3062
|
-
throw new
|
3271
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum MessageType");
|
3063
3272
|
}
|
3064
3273
|
}
|
3065
3274
|
function farcasterNetworkFromJSON(object) {
|
@@ -3077,7 +3286,7 @@ function farcasterNetworkFromJSON(object) {
|
|
3077
3286
|
case "FARCASTER_NETWORK_DEVNET":
|
3078
3287
|
return 3 /* DEVNET */;
|
3079
3288
|
default:
|
3080
|
-
throw new
|
3289
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum FarcasterNetwork");
|
3081
3290
|
}
|
3082
3291
|
}
|
3083
3292
|
function farcasterNetworkToJSON(object) {
|
@@ -3091,7 +3300,7 @@ function farcasterNetworkToJSON(object) {
|
|
3091
3300
|
case 3 /* DEVNET */:
|
3092
3301
|
return "FARCASTER_NETWORK_DEVNET";
|
3093
3302
|
default:
|
3094
|
-
throw new
|
3303
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum FarcasterNetwork");
|
3095
3304
|
}
|
3096
3305
|
}
|
3097
3306
|
function userDataTypeFromJSON(object) {
|
@@ -3112,10 +3321,10 @@ function userDataTypeFromJSON(object) {
|
|
3112
3321
|
case "USER_DATA_TYPE_URL":
|
3113
3322
|
return 5 /* URL */;
|
3114
3323
|
case 6:
|
3115
|
-
case "
|
3116
|
-
return 6 /*
|
3324
|
+
case "USER_DATA_TYPE_USERNAME":
|
3325
|
+
return 6 /* USERNAME */;
|
3117
3326
|
default:
|
3118
|
-
throw new
|
3327
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum UserDataType");
|
3119
3328
|
}
|
3120
3329
|
}
|
3121
3330
|
function userDataTypeToJSON(object) {
|
@@ -3130,10 +3339,10 @@ function userDataTypeToJSON(object) {
|
|
3130
3339
|
return "USER_DATA_TYPE_BIO";
|
3131
3340
|
case 5 /* URL */:
|
3132
3341
|
return "USER_DATA_TYPE_URL";
|
3133
|
-
case 6 /*
|
3134
|
-
return "
|
3342
|
+
case 6 /* USERNAME */:
|
3343
|
+
return "USER_DATA_TYPE_USERNAME";
|
3135
3344
|
default:
|
3136
|
-
throw new
|
3345
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum UserDataType");
|
3137
3346
|
}
|
3138
3347
|
}
|
3139
3348
|
function reactionTypeFromJSON(object) {
|
@@ -3148,7 +3357,7 @@ function reactionTypeFromJSON(object) {
|
|
3148
3357
|
case "REACTION_TYPE_RECAST":
|
3149
3358
|
return 2 /* RECAST */;
|
3150
3359
|
default:
|
3151
|
-
throw new
|
3360
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum ReactionType");
|
3152
3361
|
}
|
3153
3362
|
}
|
3154
3363
|
function reactionTypeToJSON(object) {
|
@@ -3160,7 +3369,7 @@ function reactionTypeToJSON(object) {
|
|
3160
3369
|
case 2 /* RECAST */:
|
3161
3370
|
return "REACTION_TYPE_RECAST";
|
3162
3371
|
default:
|
3163
|
-
throw new
|
3372
|
+
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum ReactionType");
|
3164
3373
|
}
|
3165
3374
|
}
|
3166
3375
|
function createBaseMessage() {
|
@@ -3174,7 +3383,7 @@ function createBaseMessage() {
|
|
3174
3383
|
};
|
3175
3384
|
}
|
3176
3385
|
var Message = {
|
3177
|
-
encode(message, writer =
|
3386
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
3178
3387
|
if (message.data !== void 0) {
|
3179
3388
|
MessageData.encode(message.data, writer.uint32(10).fork()).ldelim();
|
3180
3389
|
}
|
@@ -3196,7 +3405,7 @@ var Message = {
|
|
3196
3405
|
return writer;
|
3197
3406
|
},
|
3198
3407
|
decode(input, length) {
|
3199
|
-
const reader = input instanceof
|
3408
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
3200
3409
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
3201
3410
|
const message = createBaseMessage();
|
3202
3411
|
while (reader.pos < end) {
|
@@ -3248,22 +3457,22 @@ var Message = {
|
|
3248
3457
|
},
|
3249
3458
|
fromJSON(object) {
|
3250
3459
|
return {
|
3251
|
-
data:
|
3252
|
-
hash:
|
3253
|
-
hashScheme:
|
3254
|
-
signature:
|
3255
|
-
signatureScheme:
|
3256
|
-
signer:
|
3460
|
+
data: isSet3(object.data) ? MessageData.fromJSON(object.data) : void 0,
|
3461
|
+
hash: isSet3(object.hash) ? bytesFromBase643(object.hash) : new Uint8Array(),
|
3462
|
+
hashScheme: isSet3(object.hashScheme) ? hashSchemeFromJSON(object.hashScheme) : 0,
|
3463
|
+
signature: isSet3(object.signature) ? bytesFromBase643(object.signature) : new Uint8Array(),
|
3464
|
+
signatureScheme: isSet3(object.signatureScheme) ? signatureSchemeFromJSON(object.signatureScheme) : 0,
|
3465
|
+
signer: isSet3(object.signer) ? bytesFromBase643(object.signer) : new Uint8Array()
|
3257
3466
|
};
|
3258
3467
|
},
|
3259
3468
|
toJSON(message) {
|
3260
3469
|
const obj = {};
|
3261
3470
|
message.data !== void 0 && (obj.data = message.data ? MessageData.toJSON(message.data) : void 0);
|
3262
|
-
message.hash !== void 0 && (obj.hash =
|
3471
|
+
message.hash !== void 0 && (obj.hash = base64FromBytes3(message.hash !== void 0 ? message.hash : new Uint8Array()));
|
3263
3472
|
message.hashScheme !== void 0 && (obj.hashScheme = hashSchemeToJSON(message.hashScheme));
|
3264
|
-
message.signature !== void 0 && (obj.signature =
|
3473
|
+
message.signature !== void 0 && (obj.signature = base64FromBytes3(message.signature !== void 0 ? message.signature : new Uint8Array()));
|
3265
3474
|
message.signatureScheme !== void 0 && (obj.signatureScheme = signatureSchemeToJSON(message.signatureScheme));
|
3266
|
-
message.signer !== void 0 && (obj.signer =
|
3475
|
+
message.signer !== void 0 && (obj.signer = base64FromBytes3(message.signer !== void 0 ? message.signer : new Uint8Array()));
|
3267
3476
|
return obj;
|
3268
3477
|
},
|
3269
3478
|
create(base) {
|
@@ -3295,11 +3504,12 @@ function createBaseMessageData() {
|
|
3295
3504
|
signerAddBody: void 0,
|
3296
3505
|
userDataBody: void 0,
|
3297
3506
|
signerRemoveBody: void 0,
|
3298
|
-
linkBody: void 0
|
3507
|
+
linkBody: void 0,
|
3508
|
+
usernameProofBody: void 0
|
3299
3509
|
};
|
3300
3510
|
}
|
3301
3511
|
var MessageData = {
|
3302
|
-
encode(message, writer =
|
3512
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
3303
3513
|
if (message.type !== 0) {
|
3304
3514
|
writer.uint32(8).int32(message.type);
|
3305
3515
|
}
|
@@ -3339,10 +3549,13 @@ var MessageData = {
|
|
3339
3549
|
if (message.linkBody !== void 0) {
|
3340
3550
|
LinkBody.encode(message.linkBody, writer.uint32(114).fork()).ldelim();
|
3341
3551
|
}
|
3552
|
+
if (message.usernameProofBody !== void 0) {
|
3553
|
+
UserNameProof.encode(message.usernameProofBody, writer.uint32(122).fork()).ldelim();
|
3554
|
+
}
|
3342
3555
|
return writer;
|
3343
3556
|
},
|
3344
3557
|
decode(input, length) {
|
3345
|
-
const reader = input instanceof
|
3558
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
3346
3559
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
3347
3560
|
const message = createBaseMessageData();
|
3348
3561
|
while (reader.pos < end) {
|
@@ -3358,7 +3571,7 @@ var MessageData = {
|
|
3358
3571
|
if (tag != 16) {
|
3359
3572
|
break;
|
3360
3573
|
}
|
3361
|
-
message.fid =
|
3574
|
+
message.fid = longToNumber3(reader.uint64());
|
3362
3575
|
continue;
|
3363
3576
|
case 3:
|
3364
3577
|
if (tag != 24) {
|
@@ -3426,6 +3639,12 @@ var MessageData = {
|
|
3426
3639
|
}
|
3427
3640
|
message.linkBody = LinkBody.decode(reader, reader.uint32());
|
3428
3641
|
continue;
|
3642
|
+
case 15:
|
3643
|
+
if (tag != 122) {
|
3644
|
+
break;
|
3645
|
+
}
|
3646
|
+
message.usernameProofBody = UserNameProof.decode(reader, reader.uint32());
|
3647
|
+
continue;
|
3429
3648
|
}
|
3430
3649
|
if ((tag & 7) == 4 || tag == 0) {
|
3431
3650
|
break;
|
@@ -3436,19 +3655,20 @@ var MessageData = {
|
|
3436
3655
|
},
|
3437
3656
|
fromJSON(object) {
|
3438
3657
|
return {
|
3439
|
-
type:
|
3440
|
-
fid:
|
3441
|
-
timestamp:
|
3442
|
-
network:
|
3443
|
-
castAddBody:
|
3444
|
-
castRemoveBody:
|
3445
|
-
reactionBody:
|
3446
|
-
verificationAddEthAddressBody:
|
3447
|
-
verificationRemoveBody:
|
3448
|
-
signerAddBody:
|
3449
|
-
userDataBody:
|
3450
|
-
signerRemoveBody:
|
3451
|
-
linkBody:
|
3658
|
+
type: isSet3(object.type) ? messageTypeFromJSON(object.type) : 0,
|
3659
|
+
fid: isSet3(object.fid) ? Number(object.fid) : 0,
|
3660
|
+
timestamp: isSet3(object.timestamp) ? Number(object.timestamp) : 0,
|
3661
|
+
network: isSet3(object.network) ? farcasterNetworkFromJSON(object.network) : 0,
|
3662
|
+
castAddBody: isSet3(object.castAddBody) ? CastAddBody.fromJSON(object.castAddBody) : void 0,
|
3663
|
+
castRemoveBody: isSet3(object.castRemoveBody) ? CastRemoveBody.fromJSON(object.castRemoveBody) : void 0,
|
3664
|
+
reactionBody: isSet3(object.reactionBody) ? ReactionBody.fromJSON(object.reactionBody) : void 0,
|
3665
|
+
verificationAddEthAddressBody: isSet3(object.verificationAddEthAddressBody) ? VerificationAddEthAddressBody.fromJSON(object.verificationAddEthAddressBody) : void 0,
|
3666
|
+
verificationRemoveBody: isSet3(object.verificationRemoveBody) ? VerificationRemoveBody.fromJSON(object.verificationRemoveBody) : void 0,
|
3667
|
+
signerAddBody: isSet3(object.signerAddBody) ? SignerAddBody.fromJSON(object.signerAddBody) : void 0,
|
3668
|
+
userDataBody: isSet3(object.userDataBody) ? UserDataBody.fromJSON(object.userDataBody) : void 0,
|
3669
|
+
signerRemoveBody: isSet3(object.signerRemoveBody) ? SignerRemoveBody.fromJSON(object.signerRemoveBody) : void 0,
|
3670
|
+
linkBody: isSet3(object.linkBody) ? LinkBody.fromJSON(object.linkBody) : void 0,
|
3671
|
+
usernameProofBody: isSet3(object.usernameProofBody) ? UserNameProof.fromJSON(object.usernameProofBody) : void 0
|
3452
3672
|
};
|
3453
3673
|
},
|
3454
3674
|
toJSON(message) {
|
@@ -3466,6 +3686,7 @@ var MessageData = {
|
|
3466
3686
|
message.userDataBody !== void 0 && (obj.userDataBody = message.userDataBody ? UserDataBody.toJSON(message.userDataBody) : void 0);
|
3467
3687
|
message.signerRemoveBody !== void 0 && (obj.signerRemoveBody = message.signerRemoveBody ? SignerRemoveBody.toJSON(message.signerRemoveBody) : void 0);
|
3468
3688
|
message.linkBody !== void 0 && (obj.linkBody = message.linkBody ? LinkBody.toJSON(message.linkBody) : void 0);
|
3689
|
+
message.usernameProofBody !== void 0 && (obj.usernameProofBody = message.usernameProofBody ? UserNameProof.toJSON(message.usernameProofBody) : void 0);
|
3469
3690
|
return obj;
|
3470
3691
|
},
|
3471
3692
|
create(base) {
|
@@ -3487,6 +3708,7 @@ var MessageData = {
|
|
3487
3708
|
message.userDataBody = object.userDataBody !== void 0 && object.userDataBody !== null ? UserDataBody.fromPartial(object.userDataBody) : void 0;
|
3488
3709
|
message.signerRemoveBody = object.signerRemoveBody !== void 0 && object.signerRemoveBody !== null ? SignerRemoveBody.fromPartial(object.signerRemoveBody) : void 0;
|
3489
3710
|
message.linkBody = object.linkBody !== void 0 && object.linkBody !== null ? LinkBody.fromPartial(object.linkBody) : void 0;
|
3711
|
+
message.usernameProofBody = object.usernameProofBody !== void 0 && object.usernameProofBody !== null ? UserNameProof.fromPartial(object.usernameProofBody) : void 0;
|
3490
3712
|
return message;
|
3491
3713
|
}
|
3492
3714
|
};
|
@@ -3494,7 +3716,7 @@ function createBaseSignerAddBody() {
|
|
3494
3716
|
return { signer: new Uint8Array(), name: void 0 };
|
3495
3717
|
}
|
3496
3718
|
var SignerAddBody = {
|
3497
|
-
encode(message, writer =
|
3719
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
3498
3720
|
if (message.signer.length !== 0) {
|
3499
3721
|
writer.uint32(10).bytes(message.signer);
|
3500
3722
|
}
|
@@ -3504,7 +3726,7 @@ var SignerAddBody = {
|
|
3504
3726
|
return writer;
|
3505
3727
|
},
|
3506
3728
|
decode(input, length) {
|
3507
|
-
const reader = input instanceof
|
3729
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
3508
3730
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
3509
3731
|
const message = createBaseSignerAddBody();
|
3510
3732
|
while (reader.pos < end) {
|
@@ -3532,13 +3754,13 @@ var SignerAddBody = {
|
|
3532
3754
|
},
|
3533
3755
|
fromJSON(object) {
|
3534
3756
|
return {
|
3535
|
-
signer:
|
3536
|
-
name:
|
3757
|
+
signer: isSet3(object.signer) ? bytesFromBase643(object.signer) : new Uint8Array(),
|
3758
|
+
name: isSet3(object.name) ? String(object.name) : void 0
|
3537
3759
|
};
|
3538
3760
|
},
|
3539
3761
|
toJSON(message) {
|
3540
3762
|
const obj = {};
|
3541
|
-
message.signer !== void 0 && (obj.signer =
|
3763
|
+
message.signer !== void 0 && (obj.signer = base64FromBytes3(message.signer !== void 0 ? message.signer : new Uint8Array()));
|
3542
3764
|
message.name !== void 0 && (obj.name = message.name);
|
3543
3765
|
return obj;
|
3544
3766
|
},
|
@@ -3557,14 +3779,14 @@ function createBaseSignerRemoveBody() {
|
|
3557
3779
|
return { signer: new Uint8Array() };
|
3558
3780
|
}
|
3559
3781
|
var SignerRemoveBody = {
|
3560
|
-
encode(message, writer =
|
3782
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
3561
3783
|
if (message.signer.length !== 0) {
|
3562
3784
|
writer.uint32(10).bytes(message.signer);
|
3563
3785
|
}
|
3564
3786
|
return writer;
|
3565
3787
|
},
|
3566
3788
|
decode(input, length) {
|
3567
|
-
const reader = input instanceof
|
3789
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
3568
3790
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
3569
3791
|
const message = createBaseSignerRemoveBody();
|
3570
3792
|
while (reader.pos < end) {
|
@@ -3585,11 +3807,11 @@ var SignerRemoveBody = {
|
|
3585
3807
|
return message;
|
3586
3808
|
},
|
3587
3809
|
fromJSON(object) {
|
3588
|
-
return { signer:
|
3810
|
+
return { signer: isSet3(object.signer) ? bytesFromBase643(object.signer) : new Uint8Array() };
|
3589
3811
|
},
|
3590
3812
|
toJSON(message) {
|
3591
3813
|
const obj = {};
|
3592
|
-
message.signer !== void 0 && (obj.signer =
|
3814
|
+
message.signer !== void 0 && (obj.signer = base64FromBytes3(message.signer !== void 0 ? message.signer : new Uint8Array()));
|
3593
3815
|
return obj;
|
3594
3816
|
},
|
3595
3817
|
create(base) {
|
@@ -3606,7 +3828,7 @@ function createBaseUserDataBody() {
|
|
3606
3828
|
return { type: 0, value: "" };
|
3607
3829
|
}
|
3608
3830
|
var UserDataBody = {
|
3609
|
-
encode(message, writer =
|
3831
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
3610
3832
|
if (message.type !== 0) {
|
3611
3833
|
writer.uint32(8).int32(message.type);
|
3612
3834
|
}
|
@@ -3616,7 +3838,7 @@ var UserDataBody = {
|
|
3616
3838
|
return writer;
|
3617
3839
|
},
|
3618
3840
|
decode(input, length) {
|
3619
|
-
const reader = input instanceof
|
3841
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
3620
3842
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
3621
3843
|
const message = createBaseUserDataBody();
|
3622
3844
|
while (reader.pos < end) {
|
@@ -3644,8 +3866,8 @@ var UserDataBody = {
|
|
3644
3866
|
},
|
3645
3867
|
fromJSON(object) {
|
3646
3868
|
return {
|
3647
|
-
type:
|
3648
|
-
value:
|
3869
|
+
type: isSet3(object.type) ? userDataTypeFromJSON(object.type) : 0,
|
3870
|
+
value: isSet3(object.value) ? String(object.value) : ""
|
3649
3871
|
};
|
3650
3872
|
},
|
3651
3873
|
toJSON(message) {
|
@@ -3669,7 +3891,7 @@ function createBaseEmbed() {
|
|
3669
3891
|
return { url: void 0, castId: void 0 };
|
3670
3892
|
}
|
3671
3893
|
var Embed = {
|
3672
|
-
encode(message, writer =
|
3894
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
3673
3895
|
if (message.url !== void 0) {
|
3674
3896
|
writer.uint32(10).string(message.url);
|
3675
3897
|
}
|
@@ -3679,7 +3901,7 @@ var Embed = {
|
|
3679
3901
|
return writer;
|
3680
3902
|
},
|
3681
3903
|
decode(input, length) {
|
3682
|
-
const reader = input instanceof
|
3904
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
3683
3905
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
3684
3906
|
const message = createBaseEmbed();
|
3685
3907
|
while (reader.pos < end) {
|
@@ -3707,8 +3929,8 @@ var Embed = {
|
|
3707
3929
|
},
|
3708
3930
|
fromJSON(object) {
|
3709
3931
|
return {
|
3710
|
-
url:
|
3711
|
-
castId:
|
3932
|
+
url: isSet3(object.url) ? String(object.url) : void 0,
|
3933
|
+
castId: isSet3(object.castId) ? CastId.fromJSON(object.castId) : void 0
|
3712
3934
|
};
|
3713
3935
|
},
|
3714
3936
|
toJSON(message) {
|
@@ -3740,7 +3962,7 @@ function createBaseCastAddBody() {
|
|
3740
3962
|
};
|
3741
3963
|
}
|
3742
3964
|
var CastAddBody = {
|
3743
|
-
encode(message, writer =
|
3965
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
3744
3966
|
for (const v of message.embedsDeprecated) {
|
3745
3967
|
writer.uint32(10).string(v);
|
3746
3968
|
}
|
@@ -3769,7 +3991,7 @@ var CastAddBody = {
|
|
3769
3991
|
return writer;
|
3770
3992
|
},
|
3771
3993
|
decode(input, length) {
|
3772
|
-
const reader = input instanceof
|
3994
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
3773
3995
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
3774
3996
|
const message = createBaseCastAddBody();
|
3775
3997
|
while (reader.pos < end) {
|
@@ -3783,13 +4005,13 @@ var CastAddBody = {
|
|
3783
4005
|
continue;
|
3784
4006
|
case 2:
|
3785
4007
|
if (tag == 16) {
|
3786
|
-
message.mentions.push(
|
4008
|
+
message.mentions.push(longToNumber3(reader.uint64()));
|
3787
4009
|
continue;
|
3788
4010
|
}
|
3789
4011
|
if (tag == 18) {
|
3790
4012
|
const end2 = reader.uint32() + reader.pos;
|
3791
4013
|
while (reader.pos < end2) {
|
3792
|
-
message.mentions.push(
|
4014
|
+
message.mentions.push(longToNumber3(reader.uint64()));
|
3793
4015
|
}
|
3794
4016
|
continue;
|
3795
4017
|
}
|
@@ -3843,9 +4065,9 @@ var CastAddBody = {
|
|
3843
4065
|
return {
|
3844
4066
|
embedsDeprecated: Array.isArray(object == null ? void 0 : object.embedsDeprecated) ? object.embedsDeprecated.map((e) => String(e)) : [],
|
3845
4067
|
mentions: Array.isArray(object == null ? void 0 : object.mentions) ? object.mentions.map((e) => Number(e)) : [],
|
3846
|
-
parentCastId:
|
3847
|
-
parentUrl:
|
3848
|
-
text:
|
4068
|
+
parentCastId: isSet3(object.parentCastId) ? CastId.fromJSON(object.parentCastId) : void 0,
|
4069
|
+
parentUrl: isSet3(object.parentUrl) ? String(object.parentUrl) : void 0,
|
4070
|
+
text: isSet3(object.text) ? String(object.text) : "",
|
3849
4071
|
mentionsPositions: Array.isArray(object == null ? void 0 : object.mentionsPositions) ? object.mentionsPositions.map((e) => Number(e)) : [],
|
3850
4072
|
embeds: Array.isArray(object == null ? void 0 : object.embeds) ? object.embeds.map((e) => Embed.fromJSON(e)) : []
|
3851
4073
|
};
|
@@ -3897,14 +4119,14 @@ function createBaseCastRemoveBody() {
|
|
3897
4119
|
return { targetHash: new Uint8Array() };
|
3898
4120
|
}
|
3899
4121
|
var CastRemoveBody = {
|
3900
|
-
encode(message, writer =
|
4122
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
3901
4123
|
if (message.targetHash.length !== 0) {
|
3902
4124
|
writer.uint32(10).bytes(message.targetHash);
|
3903
4125
|
}
|
3904
4126
|
return writer;
|
3905
4127
|
},
|
3906
4128
|
decode(input, length) {
|
3907
|
-
const reader = input instanceof
|
4129
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
3908
4130
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
3909
4131
|
const message = createBaseCastRemoveBody();
|
3910
4132
|
while (reader.pos < end) {
|
@@ -3925,11 +4147,11 @@ var CastRemoveBody = {
|
|
3925
4147
|
return message;
|
3926
4148
|
},
|
3927
4149
|
fromJSON(object) {
|
3928
|
-
return { targetHash:
|
4150
|
+
return { targetHash: isSet3(object.targetHash) ? bytesFromBase643(object.targetHash) : new Uint8Array() };
|
3929
4151
|
},
|
3930
4152
|
toJSON(message) {
|
3931
4153
|
const obj = {};
|
3932
|
-
message.targetHash !== void 0 && (obj.targetHash =
|
4154
|
+
message.targetHash !== void 0 && (obj.targetHash = base64FromBytes3(message.targetHash !== void 0 ? message.targetHash : new Uint8Array()));
|
3933
4155
|
return obj;
|
3934
4156
|
},
|
3935
4157
|
create(base) {
|
@@ -3946,7 +4168,7 @@ function createBaseCastId() {
|
|
3946
4168
|
return { fid: 0, hash: new Uint8Array() };
|
3947
4169
|
}
|
3948
4170
|
var CastId = {
|
3949
|
-
encode(message, writer =
|
4171
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
3950
4172
|
if (message.fid !== 0) {
|
3951
4173
|
writer.uint32(8).uint64(message.fid);
|
3952
4174
|
}
|
@@ -3956,7 +4178,7 @@ var CastId = {
|
|
3956
4178
|
return writer;
|
3957
4179
|
},
|
3958
4180
|
decode(input, length) {
|
3959
|
-
const reader = input instanceof
|
4181
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
3960
4182
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
3961
4183
|
const message = createBaseCastId();
|
3962
4184
|
while (reader.pos < end) {
|
@@ -3966,7 +4188,7 @@ var CastId = {
|
|
3966
4188
|
if (tag != 8) {
|
3967
4189
|
break;
|
3968
4190
|
}
|
3969
|
-
message.fid =
|
4191
|
+
message.fid = longToNumber3(reader.uint64());
|
3970
4192
|
continue;
|
3971
4193
|
case 2:
|
3972
4194
|
if (tag != 18) {
|
@@ -3984,14 +4206,14 @@ var CastId = {
|
|
3984
4206
|
},
|
3985
4207
|
fromJSON(object) {
|
3986
4208
|
return {
|
3987
|
-
fid:
|
3988
|
-
hash:
|
4209
|
+
fid: isSet3(object.fid) ? Number(object.fid) : 0,
|
4210
|
+
hash: isSet3(object.hash) ? bytesFromBase643(object.hash) : new Uint8Array()
|
3989
4211
|
};
|
3990
4212
|
},
|
3991
4213
|
toJSON(message) {
|
3992
4214
|
const obj = {};
|
3993
4215
|
message.fid !== void 0 && (obj.fid = Math.round(message.fid));
|
3994
|
-
message.hash !== void 0 && (obj.hash =
|
4216
|
+
message.hash !== void 0 && (obj.hash = base64FromBytes3(message.hash !== void 0 ? message.hash : new Uint8Array()));
|
3995
4217
|
return obj;
|
3996
4218
|
},
|
3997
4219
|
create(base) {
|
@@ -4009,7 +4231,7 @@ function createBaseReactionBody() {
|
|
4009
4231
|
return { type: 0, targetCastId: void 0, targetUrl: void 0 };
|
4010
4232
|
}
|
4011
4233
|
var ReactionBody = {
|
4012
|
-
encode(message, writer =
|
4234
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
4013
4235
|
if (message.type !== 0) {
|
4014
4236
|
writer.uint32(8).int32(message.type);
|
4015
4237
|
}
|
@@ -4022,7 +4244,7 @@ var ReactionBody = {
|
|
4022
4244
|
return writer;
|
4023
4245
|
},
|
4024
4246
|
decode(input, length) {
|
4025
|
-
const reader = input instanceof
|
4247
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
4026
4248
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
4027
4249
|
const message = createBaseReactionBody();
|
4028
4250
|
while (reader.pos < end) {
|
@@ -4056,9 +4278,9 @@ var ReactionBody = {
|
|
4056
4278
|
},
|
4057
4279
|
fromJSON(object) {
|
4058
4280
|
return {
|
4059
|
-
type:
|
4060
|
-
targetCastId:
|
4061
|
-
targetUrl:
|
4281
|
+
type: isSet3(object.type) ? reactionTypeFromJSON(object.type) : 0,
|
4282
|
+
targetCastId: isSet3(object.targetCastId) ? CastId.fromJSON(object.targetCastId) : void 0,
|
4283
|
+
targetUrl: isSet3(object.targetUrl) ? String(object.targetUrl) : void 0
|
4062
4284
|
};
|
4063
4285
|
},
|
4064
4286
|
toJSON(message) {
|
@@ -4084,7 +4306,7 @@ function createBaseVerificationAddEthAddressBody() {
|
|
4084
4306
|
return { address: new Uint8Array(), ethSignature: new Uint8Array(), blockHash: new Uint8Array() };
|
4085
4307
|
}
|
4086
4308
|
var VerificationAddEthAddressBody = {
|
4087
|
-
encode(message, writer =
|
4309
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
4088
4310
|
if (message.address.length !== 0) {
|
4089
4311
|
writer.uint32(10).bytes(message.address);
|
4090
4312
|
}
|
@@ -4097,7 +4319,7 @@ var VerificationAddEthAddressBody = {
|
|
4097
4319
|
return writer;
|
4098
4320
|
},
|
4099
4321
|
decode(input, length) {
|
4100
|
-
const reader = input instanceof
|
4322
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
4101
4323
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
4102
4324
|
const message = createBaseVerificationAddEthAddressBody();
|
4103
4325
|
while (reader.pos < end) {
|
@@ -4131,18 +4353,18 @@ var VerificationAddEthAddressBody = {
|
|
4131
4353
|
},
|
4132
4354
|
fromJSON(object) {
|
4133
4355
|
return {
|
4134
|
-
address:
|
4135
|
-
ethSignature:
|
4136
|
-
blockHash:
|
4356
|
+
address: isSet3(object.address) ? bytesFromBase643(object.address) : new Uint8Array(),
|
4357
|
+
ethSignature: isSet3(object.ethSignature) ? bytesFromBase643(object.ethSignature) : new Uint8Array(),
|
4358
|
+
blockHash: isSet3(object.blockHash) ? bytesFromBase643(object.blockHash) : new Uint8Array()
|
4137
4359
|
};
|
4138
4360
|
},
|
4139
4361
|
toJSON(message) {
|
4140
4362
|
const obj = {};
|
4141
|
-
message.address !== void 0 && (obj.address =
|
4142
|
-
message.ethSignature !== void 0 && (obj.ethSignature =
|
4363
|
+
message.address !== void 0 && (obj.address = base64FromBytes3(message.address !== void 0 ? message.address : new Uint8Array()));
|
4364
|
+
message.ethSignature !== void 0 && (obj.ethSignature = base64FromBytes3(
|
4143
4365
|
message.ethSignature !== void 0 ? message.ethSignature : new Uint8Array()
|
4144
4366
|
));
|
4145
|
-
message.blockHash !== void 0 && (obj.blockHash =
|
4367
|
+
message.blockHash !== void 0 && (obj.blockHash = base64FromBytes3(message.blockHash !== void 0 ? message.blockHash : new Uint8Array()));
|
4146
4368
|
return obj;
|
4147
4369
|
},
|
4148
4370
|
create(base) {
|
@@ -4161,14 +4383,14 @@ function createBaseVerificationRemoveBody() {
|
|
4161
4383
|
return { address: new Uint8Array() };
|
4162
4384
|
}
|
4163
4385
|
var VerificationRemoveBody = {
|
4164
|
-
encode(message, writer =
|
4386
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
4165
4387
|
if (message.address.length !== 0) {
|
4166
4388
|
writer.uint32(10).bytes(message.address);
|
4167
4389
|
}
|
4168
4390
|
return writer;
|
4169
4391
|
},
|
4170
4392
|
decode(input, length) {
|
4171
|
-
const reader = input instanceof
|
4393
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
4172
4394
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
4173
4395
|
const message = createBaseVerificationRemoveBody();
|
4174
4396
|
while (reader.pos < end) {
|
@@ -4189,11 +4411,11 @@ var VerificationRemoveBody = {
|
|
4189
4411
|
return message;
|
4190
4412
|
},
|
4191
4413
|
fromJSON(object) {
|
4192
|
-
return { address:
|
4414
|
+
return { address: isSet3(object.address) ? bytesFromBase643(object.address) : new Uint8Array() };
|
4193
4415
|
},
|
4194
4416
|
toJSON(message) {
|
4195
4417
|
const obj = {};
|
4196
|
-
message.address !== void 0 && (obj.address =
|
4418
|
+
message.address !== void 0 && (obj.address = base64FromBytes3(message.address !== void 0 ? message.address : new Uint8Array()));
|
4197
4419
|
return obj;
|
4198
4420
|
},
|
4199
4421
|
create(base) {
|
@@ -4210,7 +4432,7 @@ function createBaseLinkBody() {
|
|
4210
4432
|
return { type: "", displayTimestamp: void 0, targetFid: void 0 };
|
4211
4433
|
}
|
4212
4434
|
var LinkBody = {
|
4213
|
-
encode(message, writer =
|
4435
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
4214
4436
|
if (message.type !== "") {
|
4215
4437
|
writer.uint32(10).string(message.type);
|
4216
4438
|
}
|
@@ -4223,7 +4445,7 @@ var LinkBody = {
|
|
4223
4445
|
return writer;
|
4224
4446
|
},
|
4225
4447
|
decode(input, length) {
|
4226
|
-
const reader = input instanceof
|
4448
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
4227
4449
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
4228
4450
|
const message = createBaseLinkBody();
|
4229
4451
|
while (reader.pos < end) {
|
@@ -4245,228 +4467,7 @@ var LinkBody = {
|
|
4245
4467
|
if (tag != 24) {
|
4246
4468
|
break;
|
4247
4469
|
}
|
4248
|
-
message.targetFid =
|
4249
|
-
continue;
|
4250
|
-
}
|
4251
|
-
if ((tag & 7) == 4 || tag == 0) {
|
4252
|
-
break;
|
4253
|
-
}
|
4254
|
-
reader.skipType(tag & 7);
|
4255
|
-
}
|
4256
|
-
return message;
|
4257
|
-
},
|
4258
|
-
fromJSON(object) {
|
4259
|
-
return {
|
4260
|
-
type: isSet2(object.type) ? String(object.type) : "",
|
4261
|
-
displayTimestamp: isSet2(object.displayTimestamp) ? Number(object.displayTimestamp) : void 0,
|
4262
|
-
targetFid: isSet2(object.targetFid) ? Number(object.targetFid) : void 0
|
4263
|
-
};
|
4264
|
-
},
|
4265
|
-
toJSON(message) {
|
4266
|
-
const obj = {};
|
4267
|
-
message.type !== void 0 && (obj.type = message.type);
|
4268
|
-
message.displayTimestamp !== void 0 && (obj.displayTimestamp = Math.round(message.displayTimestamp));
|
4269
|
-
message.targetFid !== void 0 && (obj.targetFid = Math.round(message.targetFid));
|
4270
|
-
return obj;
|
4271
|
-
},
|
4272
|
-
create(base) {
|
4273
|
-
return LinkBody.fromPartial(base != null ? base : {});
|
4274
|
-
},
|
4275
|
-
fromPartial(object) {
|
4276
|
-
var _a, _b, _c;
|
4277
|
-
const message = createBaseLinkBody();
|
4278
|
-
message.type = (_a = object.type) != null ? _a : "";
|
4279
|
-
message.displayTimestamp = (_b = object.displayTimestamp) != null ? _b : void 0;
|
4280
|
-
message.targetFid = (_c = object.targetFid) != null ? _c : void 0;
|
4281
|
-
return message;
|
4282
|
-
}
|
4283
|
-
};
|
4284
|
-
var tsProtoGlobalThis2 = (() => {
|
4285
|
-
if (typeof globalThis !== "undefined") {
|
4286
|
-
return globalThis;
|
4287
|
-
}
|
4288
|
-
if (typeof self !== "undefined") {
|
4289
|
-
return self;
|
4290
|
-
}
|
4291
|
-
if (typeof window !== "undefined") {
|
4292
|
-
return window;
|
4293
|
-
}
|
4294
|
-
if (typeof global !== "undefined") {
|
4295
|
-
return global;
|
4296
|
-
}
|
4297
|
-
throw "Unable to locate global object";
|
4298
|
-
})();
|
4299
|
-
function bytesFromBase642(b64) {
|
4300
|
-
if (tsProtoGlobalThis2.Buffer) {
|
4301
|
-
return Uint8Array.from(tsProtoGlobalThis2.Buffer.from(b64, "base64"));
|
4302
|
-
} else {
|
4303
|
-
const bin = tsProtoGlobalThis2.atob(b64);
|
4304
|
-
const arr = new Uint8Array(bin.length);
|
4305
|
-
for (let i = 0; i < bin.length; ++i) {
|
4306
|
-
arr[i] = bin.charCodeAt(i);
|
4307
|
-
}
|
4308
|
-
return arr;
|
4309
|
-
}
|
4310
|
-
}
|
4311
|
-
function base64FromBytes2(arr) {
|
4312
|
-
if (tsProtoGlobalThis2.Buffer) {
|
4313
|
-
return tsProtoGlobalThis2.Buffer.from(arr).toString("base64");
|
4314
|
-
} else {
|
4315
|
-
const bin = [];
|
4316
|
-
arr.forEach((byte) => {
|
4317
|
-
bin.push(String.fromCharCode(byte));
|
4318
|
-
});
|
4319
|
-
return tsProtoGlobalThis2.btoa(bin.join(""));
|
4320
|
-
}
|
4321
|
-
}
|
4322
|
-
function longToNumber2(long) {
|
4323
|
-
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
4324
|
-
throw new tsProtoGlobalThis2.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
4325
|
-
}
|
4326
|
-
return long.toNumber();
|
4327
|
-
}
|
4328
|
-
if (import_minimal2.default.util.Long !== import_long2.default) {
|
4329
|
-
import_minimal2.default.util.Long = import_long2.default;
|
4330
|
-
import_minimal2.default.configure();
|
4331
|
-
}
|
4332
|
-
function isSet2(value) {
|
4333
|
-
return value !== null && value !== void 0;
|
4334
|
-
}
|
4335
|
-
|
4336
|
-
// src/generated/name_registry_event.ts
|
4337
|
-
init_cjs_shims();
|
4338
|
-
var import_minimal3 = __toESM(require_minimal2());
|
4339
|
-
function nameRegistryEventTypeFromJSON(object) {
|
4340
|
-
switch (object) {
|
4341
|
-
case 0:
|
4342
|
-
case "NAME_REGISTRY_EVENT_TYPE_NONE":
|
4343
|
-
return 0 /* NONE */;
|
4344
|
-
case 1:
|
4345
|
-
case "NAME_REGISTRY_EVENT_TYPE_TRANSFER":
|
4346
|
-
return 1 /* TRANSFER */;
|
4347
|
-
case 2:
|
4348
|
-
case "NAME_REGISTRY_EVENT_TYPE_RENEW":
|
4349
|
-
return 2 /* RENEW */;
|
4350
|
-
default:
|
4351
|
-
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum NameRegistryEventType");
|
4352
|
-
}
|
4353
|
-
}
|
4354
|
-
function nameRegistryEventTypeToJSON(object) {
|
4355
|
-
switch (object) {
|
4356
|
-
case 0 /* NONE */:
|
4357
|
-
return "NAME_REGISTRY_EVENT_TYPE_NONE";
|
4358
|
-
case 1 /* TRANSFER */:
|
4359
|
-
return "NAME_REGISTRY_EVENT_TYPE_TRANSFER";
|
4360
|
-
case 2 /* RENEW */:
|
4361
|
-
return "NAME_REGISTRY_EVENT_TYPE_RENEW";
|
4362
|
-
default:
|
4363
|
-
throw new tsProtoGlobalThis3.Error("Unrecognized enum value " + object + " for enum NameRegistryEventType");
|
4364
|
-
}
|
4365
|
-
}
|
4366
|
-
function createBaseNameRegistryEvent() {
|
4367
|
-
return {
|
4368
|
-
blockNumber: 0,
|
4369
|
-
blockHash: new Uint8Array(),
|
4370
|
-
transactionHash: new Uint8Array(),
|
4371
|
-
logIndex: 0,
|
4372
|
-
fname: new Uint8Array(),
|
4373
|
-
from: new Uint8Array(),
|
4374
|
-
to: new Uint8Array(),
|
4375
|
-
type: 0,
|
4376
|
-
expiry: 0
|
4377
|
-
};
|
4378
|
-
}
|
4379
|
-
var NameRegistryEvent = {
|
4380
|
-
encode(message, writer = import_minimal3.default.Writer.create()) {
|
4381
|
-
if (message.blockNumber !== 0) {
|
4382
|
-
writer.uint32(8).uint32(message.blockNumber);
|
4383
|
-
}
|
4384
|
-
if (message.blockHash.length !== 0) {
|
4385
|
-
writer.uint32(18).bytes(message.blockHash);
|
4386
|
-
}
|
4387
|
-
if (message.transactionHash.length !== 0) {
|
4388
|
-
writer.uint32(26).bytes(message.transactionHash);
|
4389
|
-
}
|
4390
|
-
if (message.logIndex !== 0) {
|
4391
|
-
writer.uint32(32).uint32(message.logIndex);
|
4392
|
-
}
|
4393
|
-
if (message.fname.length !== 0) {
|
4394
|
-
writer.uint32(42).bytes(message.fname);
|
4395
|
-
}
|
4396
|
-
if (message.from.length !== 0) {
|
4397
|
-
writer.uint32(50).bytes(message.from);
|
4398
|
-
}
|
4399
|
-
if (message.to.length !== 0) {
|
4400
|
-
writer.uint32(58).bytes(message.to);
|
4401
|
-
}
|
4402
|
-
if (message.type !== 0) {
|
4403
|
-
writer.uint32(64).int32(message.type);
|
4404
|
-
}
|
4405
|
-
if (message.expiry !== 0) {
|
4406
|
-
writer.uint32(72).uint32(message.expiry);
|
4407
|
-
}
|
4408
|
-
return writer;
|
4409
|
-
},
|
4410
|
-
decode(input, length) {
|
4411
|
-
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
4412
|
-
let end = length === void 0 ? reader.len : reader.pos + length;
|
4413
|
-
const message = createBaseNameRegistryEvent();
|
4414
|
-
while (reader.pos < end) {
|
4415
|
-
const tag = reader.uint32();
|
4416
|
-
switch (tag >>> 3) {
|
4417
|
-
case 1:
|
4418
|
-
if (tag != 8) {
|
4419
|
-
break;
|
4420
|
-
}
|
4421
|
-
message.blockNumber = reader.uint32();
|
4422
|
-
continue;
|
4423
|
-
case 2:
|
4424
|
-
if (tag != 18) {
|
4425
|
-
break;
|
4426
|
-
}
|
4427
|
-
message.blockHash = reader.bytes();
|
4428
|
-
continue;
|
4429
|
-
case 3:
|
4430
|
-
if (tag != 26) {
|
4431
|
-
break;
|
4432
|
-
}
|
4433
|
-
message.transactionHash = reader.bytes();
|
4434
|
-
continue;
|
4435
|
-
case 4:
|
4436
|
-
if (tag != 32) {
|
4437
|
-
break;
|
4438
|
-
}
|
4439
|
-
message.logIndex = reader.uint32();
|
4440
|
-
continue;
|
4441
|
-
case 5:
|
4442
|
-
if (tag != 42) {
|
4443
|
-
break;
|
4444
|
-
}
|
4445
|
-
message.fname = reader.bytes();
|
4446
|
-
continue;
|
4447
|
-
case 6:
|
4448
|
-
if (tag != 50) {
|
4449
|
-
break;
|
4450
|
-
}
|
4451
|
-
message.from = reader.bytes();
|
4452
|
-
continue;
|
4453
|
-
case 7:
|
4454
|
-
if (tag != 58) {
|
4455
|
-
break;
|
4456
|
-
}
|
4457
|
-
message.to = reader.bytes();
|
4458
|
-
continue;
|
4459
|
-
case 8:
|
4460
|
-
if (tag != 64) {
|
4461
|
-
break;
|
4462
|
-
}
|
4463
|
-
message.type = reader.int32();
|
4464
|
-
continue;
|
4465
|
-
case 9:
|
4466
|
-
if (tag != 72) {
|
4467
|
-
break;
|
4468
|
-
}
|
4469
|
-
message.expiry = reader.uint32();
|
4470
|
+
message.targetFid = longToNumber3(reader.uint64());
|
4470
4471
|
continue;
|
4471
4472
|
}
|
4472
4473
|
if ((tag & 7) == 4 || tag == 0) {
|
@@ -4478,47 +4479,27 @@ var NameRegistryEvent = {
|
|
4478
4479
|
},
|
4479
4480
|
fromJSON(object) {
|
4480
4481
|
return {
|
4481
|
-
|
4482
|
-
|
4483
|
-
|
4484
|
-
logIndex: isSet3(object.logIndex) ? Number(object.logIndex) : 0,
|
4485
|
-
fname: isSet3(object.fname) ? bytesFromBase643(object.fname) : new Uint8Array(),
|
4486
|
-
from: isSet3(object.from) ? bytesFromBase643(object.from) : new Uint8Array(),
|
4487
|
-
to: isSet3(object.to) ? bytesFromBase643(object.to) : new Uint8Array(),
|
4488
|
-
type: isSet3(object.type) ? nameRegistryEventTypeFromJSON(object.type) : 0,
|
4489
|
-
expiry: isSet3(object.expiry) ? Number(object.expiry) : 0
|
4482
|
+
type: isSet3(object.type) ? String(object.type) : "",
|
4483
|
+
displayTimestamp: isSet3(object.displayTimestamp) ? Number(object.displayTimestamp) : void 0,
|
4484
|
+
targetFid: isSet3(object.targetFid) ? Number(object.targetFid) : void 0
|
4490
4485
|
};
|
4491
4486
|
},
|
4492
4487
|
toJSON(message) {
|
4493
4488
|
const obj = {};
|
4494
|
-
message.
|
4495
|
-
message.
|
4496
|
-
message.
|
4497
|
-
message.transactionHash !== void 0 ? message.transactionHash : new Uint8Array()
|
4498
|
-
));
|
4499
|
-
message.logIndex !== void 0 && (obj.logIndex = Math.round(message.logIndex));
|
4500
|
-
message.fname !== void 0 && (obj.fname = base64FromBytes3(message.fname !== void 0 ? message.fname : new Uint8Array()));
|
4501
|
-
message.from !== void 0 && (obj.from = base64FromBytes3(message.from !== void 0 ? message.from : new Uint8Array()));
|
4502
|
-
message.to !== void 0 && (obj.to = base64FromBytes3(message.to !== void 0 ? message.to : new Uint8Array()));
|
4503
|
-
message.type !== void 0 && (obj.type = nameRegistryEventTypeToJSON(message.type));
|
4504
|
-
message.expiry !== void 0 && (obj.expiry = Math.round(message.expiry));
|
4489
|
+
message.type !== void 0 && (obj.type = message.type);
|
4490
|
+
message.displayTimestamp !== void 0 && (obj.displayTimestamp = Math.round(message.displayTimestamp));
|
4491
|
+
message.targetFid !== void 0 && (obj.targetFid = Math.round(message.targetFid));
|
4505
4492
|
return obj;
|
4506
4493
|
},
|
4507
4494
|
create(base) {
|
4508
|
-
return
|
4495
|
+
return LinkBody.fromPartial(base != null ? base : {});
|
4509
4496
|
},
|
4510
4497
|
fromPartial(object) {
|
4511
|
-
var _a, _b, _c
|
4512
|
-
const message =
|
4513
|
-
message.
|
4514
|
-
message.
|
4515
|
-
message.
|
4516
|
-
message.logIndex = (_d = object.logIndex) != null ? _d : 0;
|
4517
|
-
message.fname = (_e = object.fname) != null ? _e : new Uint8Array();
|
4518
|
-
message.from = (_f = object.from) != null ? _f : new Uint8Array();
|
4519
|
-
message.to = (_g = object.to) != null ? _g : new Uint8Array();
|
4520
|
-
message.type = (_h = object.type) != null ? _h : 0;
|
4521
|
-
message.expiry = (_i = object.expiry) != null ? _i : 0;
|
4498
|
+
var _a, _b, _c;
|
4499
|
+
const message = createBaseLinkBody();
|
4500
|
+
message.type = (_a = object.type) != null ? _a : "";
|
4501
|
+
message.displayTimestamp = (_b = object.displayTimestamp) != null ? _b : void 0;
|
4502
|
+
message.targetFid = (_c = object.targetFid) != null ? _c : void 0;
|
4522
4503
|
return message;
|
4523
4504
|
}
|
4524
4505
|
};
|
@@ -4560,72 +4541,98 @@ function base64FromBytes3(arr) {
|
|
4560
4541
|
return tsProtoGlobalThis3.btoa(bin.join(""));
|
4561
4542
|
}
|
4562
4543
|
}
|
4544
|
+
function longToNumber3(long) {
|
4545
|
+
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
4546
|
+
throw new tsProtoGlobalThis3.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
4547
|
+
}
|
4548
|
+
return long.toNumber();
|
4549
|
+
}
|
4550
|
+
if (import_minimal3.default.util.Long !== import_long3.default) {
|
4551
|
+
import_minimal3.default.util.Long = import_long3.default;
|
4552
|
+
import_minimal3.default.configure();
|
4553
|
+
}
|
4563
4554
|
function isSet3(value) {
|
4564
4555
|
return value !== null && value !== void 0;
|
4565
4556
|
}
|
4566
4557
|
|
4567
|
-
// src/generated/
|
4558
|
+
// src/generated/name_registry_event.ts
|
4568
4559
|
init_cjs_shims();
|
4569
|
-
var import_long3 = __toESM(require_long());
|
4570
4560
|
var import_minimal4 = __toESM(require_minimal2());
|
4571
|
-
function
|
4561
|
+
function nameRegistryEventTypeFromJSON(object) {
|
4572
4562
|
switch (object) {
|
4573
4563
|
case 0:
|
4574
|
-
case "
|
4575
|
-
return 0 /*
|
4564
|
+
case "NAME_REGISTRY_EVENT_TYPE_NONE":
|
4565
|
+
return 0 /* NONE */;
|
4576
4566
|
case 1:
|
4577
|
-
case "
|
4578
|
-
return 1 /*
|
4567
|
+
case "NAME_REGISTRY_EVENT_TYPE_TRANSFER":
|
4568
|
+
return 1 /* TRANSFER */;
|
4569
|
+
case 2:
|
4570
|
+
case "NAME_REGISTRY_EVENT_TYPE_RENEW":
|
4571
|
+
return 2 /* RENEW */;
|
4579
4572
|
default:
|
4580
|
-
throw new tsProtoGlobalThis4.Error("Unrecognized enum value " + object + " for enum
|
4573
|
+
throw new tsProtoGlobalThis4.Error("Unrecognized enum value " + object + " for enum NameRegistryEventType");
|
4581
4574
|
}
|
4582
4575
|
}
|
4583
|
-
function
|
4576
|
+
function nameRegistryEventTypeToJSON(object) {
|
4584
4577
|
switch (object) {
|
4585
|
-
case 0 /*
|
4586
|
-
return "
|
4587
|
-
case 1 /*
|
4588
|
-
return "
|
4578
|
+
case 0 /* NONE */:
|
4579
|
+
return "NAME_REGISTRY_EVENT_TYPE_NONE";
|
4580
|
+
case 1 /* TRANSFER */:
|
4581
|
+
return "NAME_REGISTRY_EVENT_TYPE_TRANSFER";
|
4582
|
+
case 2 /* RENEW */:
|
4583
|
+
return "NAME_REGISTRY_EVENT_TYPE_RENEW";
|
4589
4584
|
default:
|
4590
|
-
throw new tsProtoGlobalThis4.Error("Unrecognized enum value " + object + " for enum
|
4585
|
+
throw new tsProtoGlobalThis4.Error("Unrecognized enum value " + object + " for enum NameRegistryEventType");
|
4591
4586
|
}
|
4592
4587
|
}
|
4593
|
-
function
|
4588
|
+
function createBaseNameRegistryEvent() {
|
4594
4589
|
return {
|
4595
|
-
|
4596
|
-
|
4597
|
-
|
4598
|
-
|
4599
|
-
|
4600
|
-
|
4590
|
+
blockNumber: 0,
|
4591
|
+
blockHash: new Uint8Array(),
|
4592
|
+
transactionHash: new Uint8Array(),
|
4593
|
+
logIndex: 0,
|
4594
|
+
fname: new Uint8Array(),
|
4595
|
+
from: new Uint8Array(),
|
4596
|
+
to: new Uint8Array(),
|
4597
|
+
type: 0,
|
4598
|
+
expiry: 0
|
4601
4599
|
};
|
4602
4600
|
}
|
4603
|
-
var
|
4601
|
+
var NameRegistryEvent = {
|
4604
4602
|
encode(message, writer = import_minimal4.default.Writer.create()) {
|
4605
|
-
if (message.
|
4606
|
-
writer.uint32(8).
|
4603
|
+
if (message.blockNumber !== 0) {
|
4604
|
+
writer.uint32(8).uint32(message.blockNumber);
|
4607
4605
|
}
|
4608
|
-
if (message.
|
4609
|
-
writer.uint32(18).bytes(message.
|
4606
|
+
if (message.blockHash.length !== 0) {
|
4607
|
+
writer.uint32(18).bytes(message.blockHash);
|
4610
4608
|
}
|
4611
|
-
if (message.
|
4612
|
-
writer.uint32(26).bytes(message.
|
4609
|
+
if (message.transactionHash.length !== 0) {
|
4610
|
+
writer.uint32(26).bytes(message.transactionHash);
|
4613
4611
|
}
|
4614
|
-
if (message.
|
4615
|
-
writer.uint32(
|
4612
|
+
if (message.logIndex !== 0) {
|
4613
|
+
writer.uint32(32).uint32(message.logIndex);
|
4616
4614
|
}
|
4617
|
-
if (message.
|
4618
|
-
writer.uint32(
|
4615
|
+
if (message.fname.length !== 0) {
|
4616
|
+
writer.uint32(42).bytes(message.fname);
|
4617
|
+
}
|
4618
|
+
if (message.from.length !== 0) {
|
4619
|
+
writer.uint32(50).bytes(message.from);
|
4620
|
+
}
|
4621
|
+
if (message.to.length !== 0) {
|
4622
|
+
writer.uint32(58).bytes(message.to);
|
4619
4623
|
}
|
4620
4624
|
if (message.type !== 0) {
|
4621
|
-
writer.uint32(
|
4625
|
+
writer.uint32(64).int32(message.type);
|
4626
|
+
}
|
4627
|
+
if (message.expiry !== 0) {
|
4628
|
+
writer.uint32(72).uint32(message.expiry);
|
4622
4629
|
}
|
4623
4630
|
return writer;
|
4624
4631
|
},
|
4625
4632
|
decode(input, length) {
|
4626
4633
|
const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
|
4627
4634
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
4628
|
-
const message =
|
4635
|
+
const message = createBaseNameRegistryEvent();
|
4629
4636
|
while (reader.pos < end) {
|
4630
4637
|
const tag = reader.uint32();
|
4631
4638
|
switch (tag >>> 3) {
|
@@ -4633,38 +4640,56 @@ var UserNameProof = {
|
|
4633
4640
|
if (tag != 8) {
|
4634
4641
|
break;
|
4635
4642
|
}
|
4636
|
-
message.
|
4643
|
+
message.blockNumber = reader.uint32();
|
4637
4644
|
continue;
|
4638
4645
|
case 2:
|
4639
4646
|
if (tag != 18) {
|
4640
4647
|
break;
|
4641
4648
|
}
|
4642
|
-
message.
|
4649
|
+
message.blockHash = reader.bytes();
|
4643
4650
|
continue;
|
4644
4651
|
case 3:
|
4645
4652
|
if (tag != 26) {
|
4646
4653
|
break;
|
4647
4654
|
}
|
4648
|
-
message.
|
4655
|
+
message.transactionHash = reader.bytes();
|
4649
4656
|
continue;
|
4650
4657
|
case 4:
|
4651
|
-
if (tag !=
|
4658
|
+
if (tag != 32) {
|
4652
4659
|
break;
|
4653
4660
|
}
|
4654
|
-
message.
|
4661
|
+
message.logIndex = reader.uint32();
|
4655
4662
|
continue;
|
4656
4663
|
case 5:
|
4657
|
-
if (tag !=
|
4664
|
+
if (tag != 42) {
|
4658
4665
|
break;
|
4659
4666
|
}
|
4660
|
-
message.
|
4667
|
+
message.fname = reader.bytes();
|
4661
4668
|
continue;
|
4662
4669
|
case 6:
|
4663
|
-
if (tag !=
|
4670
|
+
if (tag != 50) {
|
4671
|
+
break;
|
4672
|
+
}
|
4673
|
+
message.from = reader.bytes();
|
4674
|
+
continue;
|
4675
|
+
case 7:
|
4676
|
+
if (tag != 58) {
|
4677
|
+
break;
|
4678
|
+
}
|
4679
|
+
message.to = reader.bytes();
|
4680
|
+
continue;
|
4681
|
+
case 8:
|
4682
|
+
if (tag != 64) {
|
4664
4683
|
break;
|
4665
4684
|
}
|
4666
4685
|
message.type = reader.int32();
|
4667
4686
|
continue;
|
4687
|
+
case 9:
|
4688
|
+
if (tag != 72) {
|
4689
|
+
break;
|
4690
|
+
}
|
4691
|
+
message.expiry = reader.uint32();
|
4692
|
+
continue;
|
4668
4693
|
}
|
4669
4694
|
if ((tag & 7) == 4 || tag == 0) {
|
4670
4695
|
break;
|
@@ -4675,36 +4700,47 @@ var UserNameProof = {
|
|
4675
4700
|
},
|
4676
4701
|
fromJSON(object) {
|
4677
4702
|
return {
|
4678
|
-
|
4679
|
-
|
4680
|
-
|
4681
|
-
|
4682
|
-
|
4683
|
-
|
4703
|
+
blockNumber: isSet4(object.blockNumber) ? Number(object.blockNumber) : 0,
|
4704
|
+
blockHash: isSet4(object.blockHash) ? bytesFromBase644(object.blockHash) : new Uint8Array(),
|
4705
|
+
transactionHash: isSet4(object.transactionHash) ? bytesFromBase644(object.transactionHash) : new Uint8Array(),
|
4706
|
+
logIndex: isSet4(object.logIndex) ? Number(object.logIndex) : 0,
|
4707
|
+
fname: isSet4(object.fname) ? bytesFromBase644(object.fname) : new Uint8Array(),
|
4708
|
+
from: isSet4(object.from) ? bytesFromBase644(object.from) : new Uint8Array(),
|
4709
|
+
to: isSet4(object.to) ? bytesFromBase644(object.to) : new Uint8Array(),
|
4710
|
+
type: isSet4(object.type) ? nameRegistryEventTypeFromJSON(object.type) : 0,
|
4711
|
+
expiry: isSet4(object.expiry) ? Number(object.expiry) : 0
|
4684
4712
|
};
|
4685
4713
|
},
|
4686
4714
|
toJSON(message) {
|
4687
4715
|
const obj = {};
|
4688
|
-
message.
|
4689
|
-
message.
|
4690
|
-
message.
|
4691
|
-
|
4692
|
-
|
4693
|
-
message.
|
4716
|
+
message.blockNumber !== void 0 && (obj.blockNumber = Math.round(message.blockNumber));
|
4717
|
+
message.blockHash !== void 0 && (obj.blockHash = base64FromBytes4(message.blockHash !== void 0 ? message.blockHash : new Uint8Array()));
|
4718
|
+
message.transactionHash !== void 0 && (obj.transactionHash = base64FromBytes4(
|
4719
|
+
message.transactionHash !== void 0 ? message.transactionHash : new Uint8Array()
|
4720
|
+
));
|
4721
|
+
message.logIndex !== void 0 && (obj.logIndex = Math.round(message.logIndex));
|
4722
|
+
message.fname !== void 0 && (obj.fname = base64FromBytes4(message.fname !== void 0 ? message.fname : new Uint8Array()));
|
4723
|
+
message.from !== void 0 && (obj.from = base64FromBytes4(message.from !== void 0 ? message.from : new Uint8Array()));
|
4724
|
+
message.to !== void 0 && (obj.to = base64FromBytes4(message.to !== void 0 ? message.to : new Uint8Array()));
|
4725
|
+
message.type !== void 0 && (obj.type = nameRegistryEventTypeToJSON(message.type));
|
4726
|
+
message.expiry !== void 0 && (obj.expiry = Math.round(message.expiry));
|
4694
4727
|
return obj;
|
4695
4728
|
},
|
4696
4729
|
create(base) {
|
4697
|
-
return
|
4730
|
+
return NameRegistryEvent.fromPartial(base != null ? base : {});
|
4698
4731
|
},
|
4699
4732
|
fromPartial(object) {
|
4700
|
-
var _a, _b, _c, _d, _e, _f;
|
4701
|
-
const message =
|
4702
|
-
message.
|
4703
|
-
message.
|
4704
|
-
message.
|
4705
|
-
message.
|
4706
|
-
message.
|
4707
|
-
message.
|
4733
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
4734
|
+
const message = createBaseNameRegistryEvent();
|
4735
|
+
message.blockNumber = (_a = object.blockNumber) != null ? _a : 0;
|
4736
|
+
message.blockHash = (_b = object.blockHash) != null ? _b : new Uint8Array();
|
4737
|
+
message.transactionHash = (_c = object.transactionHash) != null ? _c : new Uint8Array();
|
4738
|
+
message.logIndex = (_d = object.logIndex) != null ? _d : 0;
|
4739
|
+
message.fname = (_e = object.fname) != null ? _e : new Uint8Array();
|
4740
|
+
message.from = (_f = object.from) != null ? _f : new Uint8Array();
|
4741
|
+
message.to = (_g = object.to) != null ? _g : new Uint8Array();
|
4742
|
+
message.type = (_h = object.type) != null ? _h : 0;
|
4743
|
+
message.expiry = (_i = object.expiry) != null ? _i : 0;
|
4708
4744
|
return message;
|
4709
4745
|
}
|
4710
4746
|
};
|
@@ -4746,16 +4782,6 @@ function base64FromBytes4(arr) {
|
|
4746
4782
|
return tsProtoGlobalThis4.btoa(bin.join(""));
|
4747
4783
|
}
|
4748
4784
|
}
|
4749
|
-
function longToNumber3(long) {
|
4750
|
-
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
4751
|
-
throw new tsProtoGlobalThis4.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
4752
|
-
}
|
4753
|
-
return long.toNumber();
|
4754
|
-
}
|
4755
|
-
if (import_minimal4.default.util.Long !== import_long3.default) {
|
4756
|
-
import_minimal4.default.util.Long = import_long3.default;
|
4757
|
-
import_minimal4.default.configure();
|
4758
|
-
}
|
4759
4785
|
function isSet4(value) {
|
4760
4786
|
return value !== null && value !== void 0;
|
4761
4787
|
}
|
@@ -5072,7 +5098,12 @@ var MergeNameRegistryEventBody = {
|
|
5072
5098
|
}
|
5073
5099
|
};
|
5074
5100
|
function createBaseMergeUserNameProofBody() {
|
5075
|
-
return {
|
5101
|
+
return {
|
5102
|
+
usernameProof: void 0,
|
5103
|
+
deletedUsernameProof: void 0,
|
5104
|
+
usernameProofMessage: void 0,
|
5105
|
+
deletedUsernameProofMessage: void 0
|
5106
|
+
};
|
5076
5107
|
}
|
5077
5108
|
var MergeUserNameProofBody = {
|
5078
5109
|
encode(message, writer = import_minimal5.default.Writer.create()) {
|
@@ -5082,6 +5113,12 @@ var MergeUserNameProofBody = {
|
|
5082
5113
|
if (message.deletedUsernameProof !== void 0) {
|
5083
5114
|
UserNameProof.encode(message.deletedUsernameProof, writer.uint32(18).fork()).ldelim();
|
5084
5115
|
}
|
5116
|
+
if (message.usernameProofMessage !== void 0) {
|
5117
|
+
Message.encode(message.usernameProofMessage, writer.uint32(26).fork()).ldelim();
|
5118
|
+
}
|
5119
|
+
if (message.deletedUsernameProofMessage !== void 0) {
|
5120
|
+
Message.encode(message.deletedUsernameProofMessage, writer.uint32(34).fork()).ldelim();
|
5121
|
+
}
|
5085
5122
|
return writer;
|
5086
5123
|
},
|
5087
5124
|
decode(input, length) {
|
@@ -5103,6 +5140,18 @@ var MergeUserNameProofBody = {
|
|
5103
5140
|
}
|
5104
5141
|
message.deletedUsernameProof = UserNameProof.decode(reader, reader.uint32());
|
5105
5142
|
continue;
|
5143
|
+
case 3:
|
5144
|
+
if (tag != 26) {
|
5145
|
+
break;
|
5146
|
+
}
|
5147
|
+
message.usernameProofMessage = Message.decode(reader, reader.uint32());
|
5148
|
+
continue;
|
5149
|
+
case 4:
|
5150
|
+
if (tag != 34) {
|
5151
|
+
break;
|
5152
|
+
}
|
5153
|
+
message.deletedUsernameProofMessage = Message.decode(reader, reader.uint32());
|
5154
|
+
continue;
|
5106
5155
|
}
|
5107
5156
|
if ((tag & 7) == 4 || tag == 0) {
|
5108
5157
|
break;
|
@@ -5114,13 +5163,17 @@ var MergeUserNameProofBody = {
|
|
5114
5163
|
fromJSON(object) {
|
5115
5164
|
return {
|
5116
5165
|
usernameProof: isSet5(object.usernameProof) ? UserNameProof.fromJSON(object.usernameProof) : void 0,
|
5117
|
-
deletedUsernameProof: isSet5(object.deletedUsernameProof) ? UserNameProof.fromJSON(object.deletedUsernameProof) : void 0
|
5166
|
+
deletedUsernameProof: isSet5(object.deletedUsernameProof) ? UserNameProof.fromJSON(object.deletedUsernameProof) : void 0,
|
5167
|
+
usernameProofMessage: isSet5(object.usernameProofMessage) ? Message.fromJSON(object.usernameProofMessage) : void 0,
|
5168
|
+
deletedUsernameProofMessage: isSet5(object.deletedUsernameProofMessage) ? Message.fromJSON(object.deletedUsernameProofMessage) : void 0
|
5118
5169
|
};
|
5119
5170
|
},
|
5120
5171
|
toJSON(message) {
|
5121
5172
|
const obj = {};
|
5122
5173
|
message.usernameProof !== void 0 && (obj.usernameProof = message.usernameProof ? UserNameProof.toJSON(message.usernameProof) : void 0);
|
5123
5174
|
message.deletedUsernameProof !== void 0 && (obj.deletedUsernameProof = message.deletedUsernameProof ? UserNameProof.toJSON(message.deletedUsernameProof) : void 0);
|
5175
|
+
message.usernameProofMessage !== void 0 && (obj.usernameProofMessage = message.usernameProofMessage ? Message.toJSON(message.usernameProofMessage) : void 0);
|
5176
|
+
message.deletedUsernameProofMessage !== void 0 && (obj.deletedUsernameProofMessage = message.deletedUsernameProofMessage ? Message.toJSON(message.deletedUsernameProofMessage) : void 0);
|
5124
5177
|
return obj;
|
5125
5178
|
},
|
5126
5179
|
create(base) {
|
@@ -5130,6 +5183,8 @@ var MergeUserNameProofBody = {
|
|
5130
5183
|
const message = createBaseMergeUserNameProofBody();
|
5131
5184
|
message.usernameProof = object.usernameProof !== void 0 && object.usernameProof !== null ? UserNameProof.fromPartial(object.usernameProof) : void 0;
|
5132
5185
|
message.deletedUsernameProof = object.deletedUsernameProof !== void 0 && object.deletedUsernameProof !== null ? UserNameProof.fromPartial(object.deletedUsernameProof) : void 0;
|
5186
|
+
message.usernameProofMessage = object.usernameProofMessage !== void 0 && object.usernameProofMessage !== null ? Message.fromPartial(object.usernameProofMessage) : void 0;
|
5187
|
+
message.deletedUsernameProofMessage = object.deletedUsernameProofMessage !== void 0 && object.deletedUsernameProofMessage !== null ? Message.fromPartial(object.deletedUsernameProofMessage) : void 0;
|
5133
5188
|
return message;
|
5134
5189
|
}
|
5135
5190
|
};
|
@@ -7114,6 +7169,59 @@ var UsernameProofRequest = {
|
|
7114
7169
|
return message;
|
7115
7170
|
}
|
7116
7171
|
};
|
7172
|
+
function createBaseUsernameProofsResponse() {
|
7173
|
+
return { proofs: [] };
|
7174
|
+
}
|
7175
|
+
var UsernameProofsResponse = {
|
7176
|
+
encode(message, writer = import_minimal6.default.Writer.create()) {
|
7177
|
+
for (const v of message.proofs) {
|
7178
|
+
UserNameProof.encode(v, writer.uint32(10).fork()).ldelim();
|
7179
|
+
}
|
7180
|
+
return writer;
|
7181
|
+
},
|
7182
|
+
decode(input, length) {
|
7183
|
+
const reader = input instanceof import_minimal6.default.Reader ? input : import_minimal6.default.Reader.create(input);
|
7184
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
7185
|
+
const message = createBaseUsernameProofsResponse();
|
7186
|
+
while (reader.pos < end) {
|
7187
|
+
const tag = reader.uint32();
|
7188
|
+
switch (tag >>> 3) {
|
7189
|
+
case 1:
|
7190
|
+
if (tag != 10) {
|
7191
|
+
break;
|
7192
|
+
}
|
7193
|
+
message.proofs.push(UserNameProof.decode(reader, reader.uint32()));
|
7194
|
+
continue;
|
7195
|
+
}
|
7196
|
+
if ((tag & 7) == 4 || tag == 0) {
|
7197
|
+
break;
|
7198
|
+
}
|
7199
|
+
reader.skipType(tag & 7);
|
7200
|
+
}
|
7201
|
+
return message;
|
7202
|
+
},
|
7203
|
+
fromJSON(object) {
|
7204
|
+
return { proofs: Array.isArray(object == null ? void 0 : object.proofs) ? object.proofs.map((e) => UserNameProof.fromJSON(e)) : [] };
|
7205
|
+
},
|
7206
|
+
toJSON(message) {
|
7207
|
+
const obj = {};
|
7208
|
+
if (message.proofs) {
|
7209
|
+
obj.proofs = message.proofs.map((e) => e ? UserNameProof.toJSON(e) : void 0);
|
7210
|
+
} else {
|
7211
|
+
obj.proofs = [];
|
7212
|
+
}
|
7213
|
+
return obj;
|
7214
|
+
},
|
7215
|
+
create(base) {
|
7216
|
+
return UsernameProofsResponse.fromPartial(base != null ? base : {});
|
7217
|
+
},
|
7218
|
+
fromPartial(object) {
|
7219
|
+
var _a;
|
7220
|
+
const message = createBaseUsernameProofsResponse();
|
7221
|
+
message.proofs = ((_a = object.proofs) == null ? void 0 : _a.map((e) => UserNameProof.fromPartial(e))) || [];
|
7222
|
+
return message;
|
7223
|
+
}
|
7224
|
+
};
|
7117
7225
|
function createBaseVerificationRequest() {
|
7118
7226
|
return { fid: 0, address: new Uint8Array() };
|
7119
7227
|
}
|
@@ -7683,6 +7791,7 @@ var HubServiceClientImpl = class {
|
|
7683
7791
|
this.getUserDataByFid = this.getUserDataByFid.bind(this);
|
7684
7792
|
this.getNameRegistryEvent = this.getNameRegistryEvent.bind(this);
|
7685
7793
|
this.getUsernameProof = this.getUsernameProof.bind(this);
|
7794
|
+
this.getUserNameProofsByFid = this.getUserNameProofsByFid.bind(this);
|
7686
7795
|
this.getVerification = this.getVerification.bind(this);
|
7687
7796
|
this.getVerificationsByFid = this.getVerificationsByFid.bind(this);
|
7688
7797
|
this.getSigner = this.getSigner.bind(this);
|
@@ -7751,6 +7860,9 @@ var HubServiceClientImpl = class {
|
|
7751
7860
|
getUsernameProof(request, metadata) {
|
7752
7861
|
return this.rpc.unary(HubServiceGetUsernameProofDesc, UsernameProofRequest.fromPartial(request), metadata);
|
7753
7862
|
}
|
7863
|
+
getUserNameProofsByFid(request, metadata) {
|
7864
|
+
return this.rpc.unary(HubServiceGetUserNameProofsByFidDesc, FidRequest.fromPartial(request), metadata);
|
7865
|
+
}
|
7754
7866
|
getVerification(request, metadata) {
|
7755
7867
|
return this.rpc.unary(HubServiceGetVerificationDesc, VerificationRequest.fromPartial(request), metadata);
|
7756
7868
|
}
|
@@ -8153,6 +8265,28 @@ var HubServiceGetUsernameProofDesc = {
|
|
8153
8265
|
}
|
8154
8266
|
}
|
8155
8267
|
};
|
8268
|
+
var HubServiceGetUserNameProofsByFidDesc = {
|
8269
|
+
methodName: "GetUserNameProofsByFid",
|
8270
|
+
service: HubServiceDesc,
|
8271
|
+
requestStream: false,
|
8272
|
+
responseStream: false,
|
8273
|
+
requestType: {
|
8274
|
+
serializeBinary() {
|
8275
|
+
return FidRequest.encode(this).finish();
|
8276
|
+
}
|
8277
|
+
},
|
8278
|
+
responseType: {
|
8279
|
+
deserializeBinary(data) {
|
8280
|
+
const value = UsernameProofsResponse.decode(data);
|
8281
|
+
return {
|
8282
|
+
...value,
|
8283
|
+
toObject() {
|
8284
|
+
return value;
|
8285
|
+
}
|
8286
|
+
};
|
8287
|
+
}
|
8288
|
+
}
|
8289
|
+
};
|
8156
8290
|
var HubServiceGetVerificationDesc = {
|
8157
8291
|
methodName: "GetVerification",
|
8158
8292
|
service: HubServiceDesc,
|
@@ -9271,7 +9405,7 @@ var fromServiceError = (err2) => {
|
|
9271
9405
|
var _a;
|
9272
9406
|
let context = err2["message"];
|
9273
9407
|
if (err2.code === 2 && context === "Response closed without headers") {
|
9274
|
-
context =
|
9408
|
+
context = `Connection failed: please check that the hub\u2019s address, ports and authentication config are correct. ${context}`;
|
9275
9409
|
return new import_core.HubError("unavailable", context);
|
9276
9410
|
}
|
9277
9411
|
return new import_core.HubError(((_a = err2.metadata) == null ? void 0 : _a.get("errcode")[0]) || grpcCodeToHubErrorCode(err2.code), context);
|
@@ -9361,6 +9495,7 @@ var getAuthMetadata = (username, password) => {
|
|
9361
9495
|
HubServiceGetSyncStatusDesc,
|
9362
9496
|
HubServiceGetUserDataByFidDesc,
|
9363
9497
|
HubServiceGetUserDataDesc,
|
9498
|
+
HubServiceGetUserNameProofsByFidDesc,
|
9364
9499
|
HubServiceGetUsernameProofDesc,
|
9365
9500
|
HubServiceGetVerificationDesc,
|
9366
9501
|
HubServiceGetVerificationsByFidDesc,
|