@axelar-network/axelarjs-types
Advanced tools
Comparing version 0.28.0-alpha.4 to 0.28.0-alpha.5
@@ -37,2 +37,20 @@ import Long from "long"; | ||
} | ||
export interface GeneralMessageWithToken { | ||
id: string; | ||
chain: string; | ||
sender: string; | ||
destinationChain: string; | ||
receiver: string; | ||
payloadHash: Uint8Array; | ||
asset?: Coin; | ||
status: GeneralMessageWithToken_Status; | ||
} | ||
export declare enum GeneralMessageWithToken_Status { | ||
STATUS_UNSPECIFIED = 0, | ||
STATUS_APPROVED = 1, | ||
STATUS_EXECUTED = 2, | ||
UNRECOGNIZED = -1 | ||
} | ||
export declare function generalMessageWithToken_StatusFromJSON(object: any): GeneralMessageWithToken_Status; | ||
export declare function generalMessageWithToken_StatusToJSON(object: GeneralMessageWithToken_Status): string; | ||
export declare const IBCTransfer: { | ||
@@ -231,2 +249,36 @@ encode(message: IBCTransfer, writer?: _m0.Writer): _m0.Writer; | ||
}; | ||
export declare const GeneralMessageWithToken: { | ||
encode(message: GeneralMessageWithToken, writer?: _m0.Writer): _m0.Writer; | ||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GeneralMessageWithToken; | ||
fromJSON(object: any): GeneralMessageWithToken; | ||
toJSON(message: GeneralMessageWithToken): unknown; | ||
fromPartial<I extends { | ||
id?: string | undefined; | ||
chain?: string | undefined; | ||
sender?: string | undefined; | ||
destinationChain?: string | undefined; | ||
receiver?: string | undefined; | ||
payloadHash?: Uint8Array | undefined; | ||
asset?: { | ||
denom?: string | undefined; | ||
amount?: string | undefined; | ||
} | undefined; | ||
status?: GeneralMessageWithToken_Status | undefined; | ||
} & { | ||
id?: string | undefined; | ||
chain?: string | undefined; | ||
sender?: string | undefined; | ||
destinationChain?: string | undefined; | ||
receiver?: string | undefined; | ||
payloadHash?: Uint8Array | undefined; | ||
asset?: ({ | ||
denom?: string | undefined; | ||
amount?: string | undefined; | ||
} & { | ||
denom?: string | undefined; | ||
amount?: string | undefined; | ||
} & Record<Exclude<keyof I["asset"], keyof Coin>, never>) | undefined; | ||
status?: GeneralMessageWithToken_Status | undefined; | ||
} & Record<Exclude<keyof I, keyof GeneralMessageWithToken>, never>>(object: I): GeneralMessageWithToken; | ||
}; | ||
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; | ||
@@ -233,0 +285,0 @@ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? { |
@@ -25,3 +25,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Asset = exports.CosmosChain = exports.IBCTransfer = exports.iBCTransfer_StatusToJSON = exports.iBCTransfer_StatusFromJSON = exports.IBCTransfer_Status = exports.protobufPackage = void 0; | ||
exports.GeneralMessageWithToken = exports.Asset = exports.CosmosChain = exports.IBCTransfer = exports.generalMessageWithToken_StatusToJSON = exports.generalMessageWithToken_StatusFromJSON = exports.GeneralMessageWithToken_Status = exports.iBCTransfer_StatusToJSON = exports.iBCTransfer_StatusFromJSON = exports.IBCTransfer_Status = exports.protobufPackage = void 0; | ||
/* eslint-disable */ | ||
@@ -77,2 +77,41 @@ const long_1 = __importDefault(require("long")); | ||
exports.iBCTransfer_StatusToJSON = iBCTransfer_StatusToJSON; | ||
var GeneralMessageWithToken_Status; | ||
(function (GeneralMessageWithToken_Status) { | ||
GeneralMessageWithToken_Status[GeneralMessageWithToken_Status["STATUS_UNSPECIFIED"] = 0] = "STATUS_UNSPECIFIED"; | ||
GeneralMessageWithToken_Status[GeneralMessageWithToken_Status["STATUS_APPROVED"] = 1] = "STATUS_APPROVED"; | ||
GeneralMessageWithToken_Status[GeneralMessageWithToken_Status["STATUS_EXECUTED"] = 2] = "STATUS_EXECUTED"; | ||
GeneralMessageWithToken_Status[GeneralMessageWithToken_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; | ||
})(GeneralMessageWithToken_Status = exports.GeneralMessageWithToken_Status || (exports.GeneralMessageWithToken_Status = {})); | ||
function generalMessageWithToken_StatusFromJSON(object) { | ||
switch (object) { | ||
case 0: | ||
case "STATUS_UNSPECIFIED": | ||
return GeneralMessageWithToken_Status.STATUS_UNSPECIFIED; | ||
case 1: | ||
case "STATUS_APPROVED": | ||
return GeneralMessageWithToken_Status.STATUS_APPROVED; | ||
case 2: | ||
case "STATUS_EXECUTED": | ||
return GeneralMessageWithToken_Status.STATUS_EXECUTED; | ||
case -1: | ||
case "UNRECOGNIZED": | ||
default: | ||
return GeneralMessageWithToken_Status.UNRECOGNIZED; | ||
} | ||
} | ||
exports.generalMessageWithToken_StatusFromJSON = generalMessageWithToken_StatusFromJSON; | ||
function generalMessageWithToken_StatusToJSON(object) { | ||
switch (object) { | ||
case GeneralMessageWithToken_Status.STATUS_UNSPECIFIED: | ||
return "STATUS_UNSPECIFIED"; | ||
case GeneralMessageWithToken_Status.STATUS_APPROVED: | ||
return "STATUS_APPROVED"; | ||
case GeneralMessageWithToken_Status.STATUS_EXECUTED: | ||
return "STATUS_EXECUTED"; | ||
case GeneralMessageWithToken_Status.UNRECOGNIZED: | ||
default: | ||
return "UNRECOGNIZED"; | ||
} | ||
} | ||
exports.generalMessageWithToken_StatusToJSON = generalMessageWithToken_StatusToJSON; | ||
function createBaseIBCTransfer() { | ||
@@ -329,2 +368,120 @@ return { | ||
}; | ||
function createBaseGeneralMessageWithToken() { | ||
return { | ||
id: "", | ||
chain: "", | ||
sender: "", | ||
destinationChain: "", | ||
receiver: "", | ||
payloadHash: new Uint8Array(), | ||
asset: undefined, | ||
status: 0, | ||
}; | ||
} | ||
exports.GeneralMessageWithToken = { | ||
encode(message, writer = _m0.Writer.create()) { | ||
if (message.id !== "") { | ||
writer.uint32(10).string(message.id); | ||
} | ||
if (message.chain !== "") { | ||
writer.uint32(18).string(message.chain); | ||
} | ||
if (message.sender !== "") { | ||
writer.uint32(26).string(message.sender); | ||
} | ||
if (message.destinationChain !== "") { | ||
writer.uint32(34).string(message.destinationChain); | ||
} | ||
if (message.receiver !== "") { | ||
writer.uint32(42).string(message.receiver); | ||
} | ||
if (message.payloadHash.length !== 0) { | ||
writer.uint32(50).bytes(message.payloadHash); | ||
} | ||
if (message.asset !== undefined) { | ||
coin_1.Coin.encode(message.asset, writer.uint32(58).fork()).ldelim(); | ||
} | ||
if (message.status !== 0) { | ||
writer.uint32(64).int32(message.status); | ||
} | ||
return writer; | ||
}, | ||
decode(input, length) { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseGeneralMessageWithToken(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.id = reader.string(); | ||
break; | ||
case 2: | ||
message.chain = reader.string(); | ||
break; | ||
case 3: | ||
message.sender = reader.string(); | ||
break; | ||
case 4: | ||
message.destinationChain = reader.string(); | ||
break; | ||
case 5: | ||
message.receiver = reader.string(); | ||
break; | ||
case 6: | ||
message.payloadHash = reader.bytes(); | ||
break; | ||
case 7: | ||
message.asset = coin_1.Coin.decode(reader, reader.uint32()); | ||
break; | ||
case 8: | ||
message.status = reader.int32(); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromJSON(object) { | ||
return { | ||
id: isSet(object.id) ? String(object.id) : "", | ||
chain: isSet(object.chain) ? String(object.chain) : "", | ||
sender: isSet(object.sender) ? String(object.sender) : "", | ||
destinationChain: isSet(object.destinationChain) ? String(object.destinationChain) : "", | ||
receiver: isSet(object.receiver) ? String(object.receiver) : "", | ||
payloadHash: isSet(object.payloadHash) ? bytesFromBase64(object.payloadHash) : new Uint8Array(), | ||
asset: isSet(object.asset) ? coin_1.Coin.fromJSON(object.asset) : undefined, | ||
status: isSet(object.status) ? generalMessageWithToken_StatusFromJSON(object.status) : 0, | ||
}; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.id !== undefined && (obj.id = message.id); | ||
message.chain !== undefined && (obj.chain = message.chain); | ||
message.sender !== undefined && (obj.sender = message.sender); | ||
message.destinationChain !== undefined && (obj.destinationChain = message.destinationChain); | ||
message.receiver !== undefined && (obj.receiver = message.receiver); | ||
message.payloadHash !== undefined && | ||
(obj.payloadHash = base64FromBytes(message.payloadHash !== undefined ? message.payloadHash : new Uint8Array())); | ||
message.asset !== undefined && (obj.asset = message.asset ? coin_1.Coin.toJSON(message.asset) : undefined); | ||
message.status !== undefined && (obj.status = generalMessageWithToken_StatusToJSON(message.status)); | ||
return obj; | ||
}, | ||
fromPartial(object) { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
const message = createBaseGeneralMessageWithToken(); | ||
message.id = (_a = object.id) !== null && _a !== void 0 ? _a : ""; | ||
message.chain = (_b = object.chain) !== null && _b !== void 0 ? _b : ""; | ||
message.sender = (_c = object.sender) !== null && _c !== void 0 ? _c : ""; | ||
message.destinationChain = (_d = object.destinationChain) !== null && _d !== void 0 ? _d : ""; | ||
message.receiver = (_e = object.receiver) !== null && _e !== void 0 ? _e : ""; | ||
message.payloadHash = (_f = object.payloadHash) !== null && _f !== void 0 ? _f : new Uint8Array(); | ||
message.asset = | ||
object.asset !== undefined && object.asset !== null ? coin_1.Coin.fromPartial(object.asset) : undefined; | ||
message.status = (_g = object.status) !== null && _g !== void 0 ? _g : 0; | ||
return message; | ||
}, | ||
}; | ||
var globalThis = (() => { | ||
@@ -331,0 +488,0 @@ if (typeof globalThis !== "undefined") |
{ | ||
"name": "@axelar-network/axelarjs-types", | ||
"version": "0.28.0-alpha.4", | ||
"version": "0.28.0-alpha.5", | ||
"description": "JS and TS types relating to Protocol Buffers used by AxelarJS-SDK and other related projects", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8887397
156
57017