Giter Site home page Giter Site logo

Comments (3)

jorisadri avatar jorisadri commented on May 28, 2024

Please follow this guide to send a transaction from a multisig account:
https://nemtech.github.io/guides/transaction/sending-a-multisig-transaction.html#what-s-next

from symbol-docs.

dgarcia360 avatar dgarcia360 commented on May 28, 2024

Create namespace:
The transaction is announced with the cosignatory account.The multisig account is not being involved. Wrap the RegisterNamespaceTransaction into an Aggregate transaction by following the tutorial @jorisadri shared.

Create Supply Change Transaction:
The code seems ok. However, if the multisig requires more than one signature, it should be announced as aggregated bonded.

https://nemtech.github.io/guides/transaction/sending-a-multisig-transaction.html#what-s-next

from symbol-docs.

 avatar commented on May 28, 2024

thank you

i'm missing Aggregate transaction

============

const nem2Sdk = require("nem2-sdk");
const operators = require('rxjs/operators');
require('dotenv').load();
const Address = nem2Sdk.Address,
Deadline = nem2Sdk.Deadline,
Account = nem2Sdk.Account,
UInt64 = nem2Sdk.UInt64,
NetworkType = nem2Sdk.NetworkType,
PlainMessage = nem2Sdk.PlainMessage,
TransferTransaction = nem2Sdk.TransferTransaction,
Mosaic = nem2Sdk.Mosaic,
MosaicId = nem2Sdk.MosaicId,
TransactionHttp = nem2Sdk.TransactionHttp,
PublicAccount = nem2Sdk.PublicAccount,
ModifyMultisigAccountTransaction = nem2Sdk.ModifyMultisigAccountTransaction,
MultisigCosignatoryModification = nem2Sdk.MultisigCosignatoryModification,
MultisigCosignatoryModificationType = nem2Sdk.MultisigCosignatoryModificationType,
AccountHttp = nem2Sdk.AccountHttp,
MosaicDefinitionTransaction = nem2Sdk.MosaicDefinitionTransaction,
MosaicSupplyChangeTransaction = nem2Sdk.MosaicSupplyChangeTransaction,
MosaicProperties = nem2Sdk.MosaicProperties,
MosaicSupplyType = nem2Sdk.MosaicSupplyType,
XEM = nem2Sdk.XEM,
AggregateTransaction = nem2Sdk.AggregateTransaction,
LockFundsTransaction = nem2Sdk.LockFundsTransaction,
Listener = nem2Sdk.Listener,
RegisterNamespaceTransaction = nem2Sdk.RegisterNamespaceTransaction,
filter = operators.filter,
mergeMap = operators.mergeMap;

    // 01 - Set up
    const transactionHttp = new TransactionHttp( 'http://localhost:3000');

    const cosignatoryPrivateKey = process.env.COSIGNATORY_1_PRIVATE_KEY;
    const cosignatoryAccount = Account.createFromPrivateKey(cosignatoryPrivateKey, NetworkType.MIJIN_TEST);

    const multisigAccountPublicKey = '8AD114F8B5E15D6E3D6101E4690677498B83759FE9A1D001529508F5EB4D46D6';
    const multisigAccount = PublicAccount.createFromPublicKey(multisigAccountPublicKey, NetworkType.MIJIN_TEST);

const namespaceName = "zzz"; //Replace with an unique namespace name

const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace(
Deadline.create(),
namespaceName,
UInt64.fromUint(1000),
NetworkType.MIJIN_TEST);

const aggregateTransaction = AggregateTransaction.createComplete(
    Deadline.create(),
    [registerNamespaceTransaction.toAggregate(multisigAccount),],
    NetworkType.MIJIN_TEST,
    []);

const signedTransaction = cosignatoryAccount.sign(aggregateTransaction);

transactionHttp
.announce(signedTransaction)
.subscribe(x => console.log(x), err => console.error(err));

from symbol-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.