@glif/filecoin-message
Advanced tools
Comparing version 2.0.0-alpha.13 to 2.0.0-alpha.15
@@ -12,2 +12,20 @@ export interface ZondaxMessage { | ||
} | ||
export declare type Address = { | ||
robust: string; | ||
id: string; | ||
}; | ||
export declare type MessagePending = { | ||
cid: string; | ||
from: Address; | ||
gasFeeCap: string; | ||
gasLimit: string; | ||
gasPremium: string; | ||
height: number; | ||
method: string; | ||
nonce: string; | ||
params: string | string[]; | ||
to: Address; | ||
value: number; | ||
version?: number; | ||
}; | ||
declare type SerializableMessage = ZondaxMessage; | ||
@@ -59,2 +77,3 @@ export interface LotusMessage { | ||
toZondaxType: () => ZondaxMessage; | ||
toPendingMessage: (cid: string) => MessagePending; | ||
} | ||
@@ -61,0 +80,0 @@ declare const _default: { |
@@ -91,2 +91,29 @@ "use strict"; | ||
_defineProperty(this, "toPendingMessage", function (cid) { | ||
var toAddr = { | ||
robust: '', | ||
id: '' | ||
}; | ||
var fromAddr = { | ||
robust: '', | ||
id: '' | ||
}; | ||
if (_this.to[1] === '0') toAddr.id = _this.to;else toAddr.robust = _this.to; | ||
if (_this.from[1] === '0') fromAddr.id = _this.from;else fromAddr.robust = _this.from; | ||
return { | ||
to: toAddr, | ||
from: fromAddr, | ||
cid: cid, | ||
method: _this.method.toString(), | ||
gasFeeCap: _this.gasFeeCap.toString(), | ||
gasLimit: _this.gasLimit.toString(), | ||
gasPremium: _this.gasPremium.toString(), | ||
params: _this.params || '', | ||
height: 0, | ||
// this could become problematic with big numbers... | ||
value: _this.value.toNumber(), | ||
nonce: _this.nonce.toString() | ||
}; | ||
}); | ||
typeCheck(msg); | ||
@@ -93,0 +120,0 @@ this.to = msg.to; |
@@ -78,2 +78,29 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
_defineProperty(this, "toPendingMessage", function (cid) { | ||
var toAddr = { | ||
robust: '', | ||
id: '' | ||
}; | ||
var fromAddr = { | ||
robust: '', | ||
id: '' | ||
}; | ||
if (_this.to[1] === '0') toAddr.id = _this.to;else toAddr.robust = _this.to; | ||
if (_this.from[1] === '0') fromAddr.id = _this.from;else fromAddr.robust = _this.from; | ||
return { | ||
to: toAddr, | ||
from: fromAddr, | ||
cid: cid, | ||
method: _this.method.toString(), | ||
gasFeeCap: _this.gasFeeCap.toString(), | ||
gasLimit: _this.gasLimit.toString(), | ||
gasPremium: _this.gasPremium.toString(), | ||
params: _this.params || '', | ||
height: 0, | ||
// this could become problematic with big numbers... | ||
value: _this.value.toNumber(), | ||
nonce: _this.nonce.toString() | ||
}; | ||
}); | ||
typeCheck(msg); | ||
@@ -80,0 +107,0 @@ this.to = msg.to; |
@@ -73,2 +73,29 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
_defineProperty(this, "toPendingMessage", cid => { | ||
const toAddr = { | ||
robust: '', | ||
id: '' | ||
}; | ||
const fromAddr = { | ||
robust: '', | ||
id: '' | ||
}; | ||
if (this.to[1] === '0') toAddr.id = this.to;else toAddr.robust = this.to; | ||
if (this.from[1] === '0') fromAddr.id = this.from;else fromAddr.robust = this.from; | ||
return { | ||
to: toAddr, | ||
from: fromAddr, | ||
cid, | ||
method: this.method.toString(), | ||
gasFeeCap: this.gasFeeCap.toString(), | ||
gasLimit: this.gasLimit.toString(), | ||
gasPremium: this.gasPremium.toString(), | ||
params: this.params || '', | ||
height: 0, | ||
// this could become problematic with big numbers... | ||
value: this.value.toNumber(), | ||
nonce: this.nonce.toString() | ||
}; | ||
}); | ||
typeCheck(msg); | ||
@@ -75,0 +102,0 @@ this.to = msg.to; |
{ | ||
"name": "@glif/filecoin-message", | ||
"version": "2.0.0-alpha.13", | ||
"version": "2.0.0-alpha.15", | ||
"description": "The Filecoin message type, used to transfer tokens and make state changes.", | ||
@@ -41,3 +41,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "26109dc7331001bdff12dcf1ef22bb029fa1a94a" | ||
"gitHead": "e6e4a6cbf9426c470660cc5cda8a7d99d4f97a3e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
58986
570