Skip to main content

ModifyAccount

Source: auctioneerrpc/auctioneer.proto

gRPC

rpc ModifyAccount (ServerModifyAccountRequest) returns (ServerModifyAccountResponse);

Code Samples

const fs = require('fs');
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');

const GRPC_HOST = 'localhost:12010'
const MACAROON_PATH = 'POOL_DIR/regtest/pool.macaroon'
const TLS_PATH = 'POOL_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync('auctioneerrpc/auctioneer.proto', loaderOptions);
const poolrpc = grpc.loadPackageDefinition(packageDefinition).poolrpc;
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA';
const tlsCert = fs.readFileSync(TLS_PATH);
const sslCreds = grpc.credentials.createSsl(tlsCert);
const macaroon = fs.readFileSync(MACAROON_PATH).toString('hex');
const macaroonCreds = grpc.credentials.createFromMetadataGenerator(function(args, callback) {
let metadata = new grpc.Metadata();
metadata.add('macaroon', macaroon);
callback(null, metadata);
});
let creds = grpc.credentials.combineChannelCredentials(sslCreds, macaroonCreds);
let client = new poolrpc.ChannelAuctioneer(GRPC_HOST, creds);
let request = {
trader_key: <bytes>,
new_inputs: <ServerInput>,
new_outputs: <ServerOutput>,
new_params: <NewAccountParameters>,
trader_nonces: <bytes>,
prev_outputs: <TxOut>,
};
client.modifyAccount(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "account_sig": <bytes>,
// "server_nonces": <bytes>,
// }

Messages

poolrpc.ServerModifyAccountRequest

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST TypeREST Placement
trader_key
bytesunknownunknown
new_inputs
ServerInput[]unknownunknown
new_outputs
ServerOutput[]unknownunknown
new_params
NewAccountParametersunknownunknown
trader_nonces
bytesunknownunknown
prev_outputs
TxOut[]unknownunknown

poolrpc.ServerModifyAccountResponse

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST Type
account_sig
bytesunknown
server_nonces
bytesunknown

Nested Messages

poolrpc.OutPoint

FieldgRPC TypeREST Type
txid
bytesstring
output_index
uint32integer

poolrpc.ServerInput

FieldgRPC TypeREST Type
outpoint
OutPointunknown
sig_script
bytesunknown

poolrpc.ServerModifyAccountRequest.NewAccountParameters

FieldgRPC TypeREST Type
value
uint64unknown
expiry
uint32unknown
version
uint32unknown

poolrpc.ServerOutput

FieldgRPC TypeREST Type
value
uint64unknown
script
bytesunknown

poolrpc.TxOut

FieldgRPC TypeREST Type
value
uint64unknown
pk_script
bytesunknown