Questions tagged [daml]

Daml is an open source smart contract language which codifies multi-party agreements. This tag should be used for any questions relating to Daml programming and tools supplied with the Daml SDK.

DAML (the Digital Asset Modeling Language) is a contract modeling language which can run on the Digital Asset Ledger, and codifies multi-party agreements over a distributed ledger. More details on DAML and various use cases are given on the DAML Driven blog.

147 questions
1
vote
1 answer

Scenario execution fails

Guys this code is throwing up an error daml 1.2 module PaidService where template Service with provider : Party beneficiary : Party description : Text cost : Decimal currency : Text where signatory…
shj
  • 13
  • 3
1
vote
1 answer

Exercising multiple updates within DAML choice

Is it possible in DAML to use a map-like function to iterate over of list of contractids, retrieve them and execute a choice on each? This appears to be limited in DAML by the way everything needs to be wrapped in a single Update when executing a…
oslo
  • 13
  • 2
1
vote
2 answers

How to return different types from an if and its corresponding else in DAML?

Currently in DAML if and else condition would expect to return same output. How can I return different types?
1
vote
1 answer

disable linter in DAML studio

Is it possible to disable the linter that daml studio seems to be applying since ~0.13.18ish as the warnings are visually distracting in the IDE. Eg: when writing choice names with an underscore. Warning: use of camelCase I've tried adding a .dlint…
reversebind
  • 1,216
  • 1
  • 14
  • 18
1
vote
1 answer

DAML smart contract uses JVM can we replace it to webaseembly?

Since all the blockchain technologies are looking forward to webassembly, its better to write contract which is fits in webassembly environment. But DAML currently uses JVM. Can we replace it to webassembly? And whats the reason for using JVM rather…
achala
  • 197
  • 1
  • 11
1
vote
1 answer

In DAML, what to return when a choice could lead to different new contracts to be created

In DAML, if I have a choice called submit and it could lead to new contract approvedRequest or rejectedRequest. How should I manage the return value in the choice? template Request with content : Text anyone : Party where …
Frankie
  • 113
  • 5
1
vote
1 answer

In DAML, how to find and replace an element in a List

If I have a list of data [Item], what is the best way to locate and change an element in it. aList : [Item] searchName : Text newPrice : Decimal - I can find the element using let a : Optional Int = findIndex (\a -> a.name == searchName)…
Frankie
  • 113
  • 5
1
vote
1 answer

Are all parameters required when creating a contract?

When creating a contract from a template, are all the parameters required? What if some fields need to be entered later? template Exp with member1 : Party member2 : Party comment : Text where signatory : member1 choice ABC…
Frankie
  • 113
  • 5
1
vote
1 answer

Do multiple commands in one call to DAML's Command Submission Service result in one or many transactions?

The commands field on the Commands object takes a list of Command objects. The description reads Individual elements of this atomic command. Does that mean the list of commands will result in a single transaction? Are the commands guaranteed to be…
bame
  • 960
  • 5
  • 7
1
vote
1 answer

What characters are valid in DAML party names?

I noticed that Navigator doesn't handle correctly party names that contain spaces. So I was wondering what other characters are illegal and where in the stack (Navigator, DAML-LF, etc.) the limitations apply. I couldn't find anything on this in the…
GeorgS
  • 741
  • 5
  • 12
1
vote
1 answer

How can I define a local function within another function in DAML?

I'm trying to define a local function within another function but can't seem to get the syntax right. I have the following: foo : Int -> Bool foo i = let bar j = j < 5 bar i But I'm getting a syntax error on the bar. What is the correct syntax…
GeorgS
  • 741
  • 5
  • 12
1
vote
2 answers

How do I assert conditions inside a function in DAML?

I have the following code: template Iou with issuer : Party owner : Party amount : Decimal currency : Text where signatory issuer mergeIou : Iou -> Iou -> Iou mergeIou a b = -- assert $ a.issuer == b.issuer -- assert $…
GeorgS
  • 741
  • 5
  • 12
1
vote
2 answers

Creating a Transaction Filter in PHP for creating a GetTransactionsRequest object

I am writing a client that makes requests to the DA Ledger. I am following the advice I received in a previous post Doing CRUD on the DA Ledger through a gRPC client. I need to run the 'GetTransactions' rpc. Doing so requires…
Meyer Auslander
  • 349
  • 1
  • 10
1
vote
1 answer

Doing CRUD on the DA Ledger through a gRPC client

I am in the process of writing a DA Ledger client application. It's going slow because the API documentation does not explain how to combine the provided services to do simple Create, read, update, and delete on the Ledger. For example there is no…
Meyer Auslander
  • 349
  • 1
  • 10
1
vote
1 answer

running the grpc php plugin on DA Ledger API proto files

I am building the client-side of my ledger application in PHP. I have written the DAML code, gone through the grpc quickstart tutorial, and I ran the command da add ledger-api-protos and now it seems the next step is to run the grpc_php_plugin to…
Meyer Auslander
  • 349
  • 1
  • 10