stellar-base
Advanced tools
Comparing version 8.2.2-soroban.11 to 8.2.2-soroban.12
@@ -85,3 +85,3 @@ 'use strict'; | ||
value: function toScVal() { | ||
return _xdr2.default.ScVal.scvObject(_xdr2.default.ScObject.scoAddress(this.toScAddress())); | ||
return _xdr2.default.ScVal.scvAddress(this.toScAddress()); | ||
} | ||
@@ -107,2 +107,14 @@ | ||
} | ||
/** | ||
* Return the raw public key bytes for this address. | ||
* | ||
* @returns {Buffer} | ||
*/ | ||
}, { | ||
key: 'toBuffer', | ||
value: function toBuffer() { | ||
return this._key; | ||
} | ||
}], [{ | ||
@@ -139,2 +151,35 @@ key: 'fromString', | ||
} | ||
/** | ||
* Convert this from an xdr.ScVal type | ||
* | ||
* @param {xdr.ScVal} scVal - The xdr.ScVal type to parse | ||
* @returns {Address} | ||
*/ | ||
}, { | ||
key: 'fromScVal', | ||
value: function fromScVal(scVal) { | ||
return Address.fromScAddress(scVal.address()); | ||
} | ||
/** | ||
* Convert this from an xdr.ScAddress type | ||
* | ||
* @param {xdr.ScAddress} scAddress - The xdr.ScAddress type to parse | ||
* @returns {Address} | ||
*/ | ||
}, { | ||
key: 'fromScAddress', | ||
value: function fromScAddress(scAddress) { | ||
switch (scAddress.switch()) { | ||
case _xdr2.default.ScAddressType.scAddressTypeAccount(): | ||
return Address.account(scAddress.accountId().ed25519()); | ||
case _xdr2.default.ScAddressType.scAddressTypeContract(): | ||
return Address.contract(scAddress.contractId()); | ||
default: | ||
throw new Error('Unsupported address type'); | ||
} | ||
} | ||
}]); | ||
@@ -141,0 +186,0 @@ |
@@ -71,3 +71,3 @@ 'use strict'; | ||
return _operation.Operation.invokeHostFunction({ | ||
function: _xdr2.default.HostFunction.hostFunctionTypeInvokeContract([_xdr2.default.ScVal.scvObject(_xdr2.default.ScObject.scoBytes(contractId)), _xdr2.default.ScVal.scvSymbol(method)].concat(params)), | ||
function: _xdr2.default.HostFunction.hostFunctionTypeInvokeContract([_xdr2.default.ScVal.scvBytes(contractId), _xdr2.default.ScVal.scvSymbol(method)].concat(params)), | ||
// TODO: Figure out how to calculate this or get it from the user? | ||
@@ -77,3 +77,3 @@ footprint: new _xdr2.default.LedgerFootprint({ | ||
contractId: contractId, | ||
key: _xdr2.default.ScVal.scvStatic(_xdr2.default.ScStatic.scsLedgerKeyContractCode()) | ||
key: _xdr2.default.ScVal.scvLedgerKeyContractExecutable() | ||
}))], | ||
@@ -80,0 +80,0 @@ readWrite: [] |
{ | ||
"name": "stellar-base", | ||
"version": "8.2.2-soroban.11", | ||
"version": "8.2.2-soroban.12", | ||
"description": "Low level stellar support library", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -20,5 +20,8 @@ // TypeScript Version: 2.9 | ||
static contract(buffer: Buffer): Address; | ||
static fromScVal(scVal: xdr.ScVal): Address; | ||
static fromScAddress(scAddress: xdr.ScAddress): Address; | ||
toString(): string; | ||
toScVal(): xdr.ScVal; | ||
toScAddress(): xdr.ScAddress; | ||
toBuffer(): Buffer; | ||
} | ||
@@ -25,0 +28,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
4163206
41420