How to use the default function from long

Find comprehensive JavaScript long.default code examples handpicked from public code repositorys.

1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
    };
},
toJSON(message) {
    const obj = {};
    message.transactionId !== undefined &&
        (obj.transactionId = (message.transactionId || long_1.default.UZERO).toString());
    message.sender !== undefined && (obj.sender = message.sender);
    return obj;
},
fromPartial(object) {
fork icon10
star icon10
watch icon8

+ 111 other calls in file

44
45
46
47
48
49
50
51
__exportStar(require("./queryClient"), exports);
__exportStar(require("./registry"), exports);
exports.usk = __importStar(require("./usk"));
__exportStar(require("./utils"), exports);
if (minimal_1.util.Long !== long_1.default) {
    minimal_1.util.Long = long_1.default;
    (0, minimal_1.configure)();
}
fork icon10
star icon10
watch icon8

+ 2 other calls in file

290
291
292
293
294
295
296
297
298
299
    }
    return message;
},
fromJSON(object) {
    return {
        height: (0, helpers_1.isSet)(object.height) ? long_1.default.fromValue(object.height) : long_1.default.UZERO,
        validator: (0, helpers_1.isSet)(object.validator) ? String(object.validator) : "",
        denom: (0, helpers_1.isSet)(object.denom) ? String(object.denom) : "",
        snapshot: (0, helpers_1.isSet)(object.snapshot)
            ? alliance_1.RewardWeightChangeSnapshot.fromJSON(object.snapshot)
fork icon10
star icon10
watch icon8

+ 4 other calls in file

38
39
40
41
42
43
44
45
46
47
        delegatorAddress: "",
        validatorAddress: "",
        denom: "",
        shares: "",
        rewardHistory: [],
        lastRewardClaimHeight: long_1.default.UZERO,
    };
}
exports.Delegation = {
    encode(message, writer = _m0.Writer.create()) {
fork icon10
star icon10
watch icon8

+ 5 other calls in file

170
171
172
173
174
175
176
        return timestampFromJSON(o);
    }
}
exports.fromJsonTimestamp = fromJsonTimestamp;
function numberToLong(number) {
    return long_1.default.fromNumber(number);
}
fork icon10
star icon10
watch icon8

+ 6 other calls in file

34
35
36
37
38
39
40
41
42
43
    return message;
},
fromJSON(object) {
    const message = Object.assign({}, baseQueryGetTokenRequest);
    if (object.id !== undefined && object.id !== null) {
        message.id = long_1.default.fromString(object.id);
    }
    else {
        message.id = long_1.default.UZERO;
    }
fork icon1
star icon0
watch icon1

+ 17 other calls in file

4
5
6
7
8
9
10
11
12
13
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const minimal_1 = __importDefault(require("protobufjs/minimal"));
exports.protobufPackage = "google.protobuf";
const baseDuration = { seconds: long_1.default.ZERO, nanos: 0 };
exports.Duration = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (!message.seconds.isZero()) {
            writer.uint32(8).int64(message.seconds);
fork icon1
star icon0
watch icon1

+ 17 other calls in file

704
705
706
707
708
709
710
711
712
713
}
else {
    message.blockVersion = long_1.default.UZERO;
}
if (object.p2pVersion !== undefined && object.p2pVersion !== null) {
    message.p2pVersion = long_1.default.fromString(object.p2pVersion);
}
else {
    message.p2pVersion = long_1.default.UZERO;
}
fork icon1
star icon0
watch icon1

+ 347 other calls in file

5
6
7
8
9
10
11
12
13
14
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const minimal_1 = __importDefault(require("protobufjs/minimal"));
const keys_1 = require("../../tendermint/crypto/keys");
exports.protobufPackage = "tendermint.types";
const baseValidatorSet = { totalVotingPower: long_1.default.ZERO };
exports.ValidatorSet = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.validators) {
            exports.Validator.encode(v, writer.uint32(10).fork()).ldelim();
fork icon1
star icon0
watch icon1

+ 62 other calls in file

104
105
106
107
108
109
110
111
112
113
  message.timeoutHeight = client1.Height.fromJSON(object.timeoutHeight)
} else {
  message.timeoutHeight = undefined
}
if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) {
  message.timeoutTimestamp = long1.default.fromString(object.timeoutTimestamp)
} else {
  message.timeoutTimestamp = long1.default.UZERO
}
return message
fork icon0
star icon7
watch icon1

+ 8 other calls in file

333
334
335
336
337
338
339
340
341
342
            message.partSetHeader = undefined;
        }
        return message;
    },
};
const baseHeader = { chainId: "", height: long_1.default.ZERO };
exports.Header = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.version !== undefined) {
            types_1.Consensus.encode(message.version, writer.uint32(10).fork()).ldelim();
fork icon1
star icon0
watch icon1

+ 30 other calls in file

181
182
183
184
185
186
187
188
189
190
}
else {
    message.maxGas = long_1.default.ZERO;
}
if (object.timeIotaMs !== undefined && object.timeIotaMs !== null) {
    message.timeIotaMs = long_1.default.fromString(object.timeIotaMs);
}
else {
    message.timeIotaMs = long_1.default.ZERO;
}
fork icon1
star icon0
watch icon1

+ 40 other calls in file

25
26
27
28
29
30
31
32
33
34
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const long_1 = __importDefault(require("long"));
const LEB128 = __importStar(require("."));
const U64_MAX_VALUE = long_1.default.fromString("18446744073709551615");
const arr = new Array(1);
const num = -10309;
LEB128.setInt16(arr, num, 0);
console.log(arr);
fork icon0
star icon0
watch icon1

258
259
260
261
262
263
264
265
266
267
    buffer.writeByte(this.senderPublicKey[i]);
var recipient = long_1.default.fromString(this.type.canHaveRecipient() ? this.recipientId : "8150091319858025343", true);
buffer.writeInt64(recipient);
var amount = long_1.default.fromString(this.amountHQT, false);
buffer.writeInt64(amount);
var fee = long_1.default.fromString(this.feeHQT, false);
buffer.writeInt64(fee);
for (var i = 0; i < 64; i++)
    buffer.writeByte(this.signature ? this.signature[i] : 0);
buffer.writeInt(this.getFlags());
fork icon0
star icon0
watch icon1

+ 47 other calls in file