Is it possible to obtain the complex parameters needed to construct a transaction without relying on an SDK?

......

const instrumentAdminPartyId =
    (await onlineSDK.tokenStandard?.getInstrumentAdmin()) || ''


const userToken = await localNetAuthDefault().getUserToken()

console.log('User Token:', userToken)


const adminToken = await localNetAuthDefault().getAdminToken()

console.log('Admin Token:', adminToken)


const [transferCommand, disclosedContracts] = await onlineSDK.tokenStandard.createTransfer(
  senderParty.partyId,
  receiverParty.partyId,
  '1688',
  {
      instrumentId: 'Amulet',
      instrumentAdmin: instrumentAdminPartyId,
  },
  [],
  'memo-curl-test'
)



const transaction = await onlineSDK.userLedger?.prepareSubmission(
    transferCommand, //the prepared ping command
    v4(), //a unique deduplication id for this transaction
    disclosedContracts //contracts that needs to be disclosed in our to execute the command
)

......

I’d like to know if the parameters in the code snippet above can all be obtained via HTTP requests, for example, using curl? Or do I need to rely on an SDK to obtain these parameters? For example, can token, transferCommand, disclosedContracts, and transaction be obtained directly using a command-line HTTP request with curl?

the code is open source so you can extract it from there:

so for reach of them:
token: This one you can obtain yourself, this is just a self-signed token by default.
transfer command & disclosed contract: This one required a call to the registry url, but that can be done with curl as well.
This one you can build by hand, you can check the repo for how that is done.
transaction: prepare-submission endpoint is called with the previous values, this should be easy to replicate with curl.

The SDK is just a simplified wrapper around the ledger APi, registry url, scan proxy service to provide a seamless experience, but it can be plugged and picked as you see fit.

1 Like