Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 98 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,98 @@
MIT License

Copyright (c) 2026 BootNode

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Business Source License 1.1

License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
"Business Source License" is a trademark of MariaDB Corporation Ab.

-----------------------------------------------------------------------------

Parameters

Licensor: BootNode

Licensed Work: Canton Token Forge
The Licensed Work is (c) 2026 BootNode.

Additional Use Grant: None

Change Date: October 15, 2030

Change License: GNU General Public License v2.0 or later

-----------------------------------------------------------------------------

Terms

The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.

Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.

If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.

All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.

You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.

Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.

This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).

TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.

MariaDB hereby grants you permission to use this License's text to license
your works, and to refer to it using the trademark "Business Source License",
as long as you comply with the Covenants of Licensor below.

-----------------------------------------------------------------------------

Covenants of Licensor

In consideration of the right to use this License's text and the "Business
Source License" name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:

1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where "compatible" means that software provided under the Change License
can be included in a program with software provided under GPL Version 2.0
or a later version. Licensor may specify additional Change Licenses
without limitation.

2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text "None".

3. To specify a Change Date.

4. Not to modify this License in any other way.

-----------------------------------------------------------------------------

Notice

The Business Source License (this document, or the "License") is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,4 @@ the first page a consumer reads naming a version we just moved off.

## License

MIT - see [`LICENSE`](LICENSE).
Business Source License 1.1 (`BUSL-1.1`) - see [`LICENSE`](LICENSE).
8 changes: 4 additions & 4 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ resulting exercise itself over the JSON Ledger API, forwarding the service's

### Size and status

976 lines of production Daml, 2508 lines of Daml tests, 1846 lines of
TypeScript service, 4693 lines of TypeScript tests, each figure a
1003 lines of production Daml, 2547 lines of Daml tests, 1894 lines of
TypeScript service, 4750 lines of TypeScript tests, each figure a
`find <dir> -name '*.daml'` (or `'*.ts'`) `| xargs wc -l` count over
`daml/canton-token-forge/daml`, `daml/canton-token-forge-test/daml`,
`registry/src` and `registry/test` respectively. The two Daml paths name the
source directory rather than the package root on purpose: a package root that
has been built also holds a `.daml/` build directory, whose name the `*.daml`
glob matches and whose regenerated data-dependency sources dwarf the figure
above. MIT licensed. Pre-release: the Daml package
above. Licensed under the Business Source License 1.1. Pre-release: the Daml package
version is `0.0.1`, and the build is published as release `v0.1.0` for
downstream repositories to pin (the tag is deliberately decoupled from the
package version), with no compatibility guarantee offered across releases.
Expand Down Expand Up @@ -623,7 +623,7 @@ Stated plainly, because they are what an evaluation turns on.

```
daml/ Container of dpm packages; not a package itself
canton-token-forge/ Production package, 976 lines
canton-token-forge/ Production package, 1003 lines
daml/Canton/TokenForge/
Registry.daml InstrumentConfig, preapproval, the three factory instances
Token.daml Token holding, input fetch/consume/spend helpers
Expand Down
3 changes: 3 additions & 0 deletions consumer-smoke/consumer/daml/Consumer.daml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

-- Every import below resolves through canton-token-forge-0.0.1.dar alone. The
-- Splice interface packages are bundled inside that DAR but hidden by default;
-- the --package lines in daml.yaml are what make them visible.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.AllocationTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.BatchTransferTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.BurnMintTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.FaucetTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.LockTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.MultiInstrumentTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.OfferTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.RegistryTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.Smoke where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.TokenTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.TransferTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.TxMetaTest where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Test.Util where

import Daml.Script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Allocation where

import DA.Assert (assertWithinDeadline)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Instruction where

import Splice.Api.Token.HoldingV1 qualified as HoldingV1
Expand Down
3 changes: 3 additions & 0 deletions daml/canton-token-forge/daml/Canton/TokenForge/Locked.daml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Locked where

import DA.Action (unless)
Expand Down
3 changes: 3 additions & 0 deletions daml/canton-token-forge/daml/Canton/TokenForge/Registry.daml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Registry where

import DA.TextMap qualified as TextMap
Expand Down
3 changes: 3 additions & 0 deletions daml/canton-token-forge/daml/Canton/TokenForge/Token.daml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Token where

import DA.List (unique)
Expand Down
3 changes: 3 additions & 0 deletions daml/canton-token-forge/daml/Canton/TokenForge/Transfer.daml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

-- | The multi-output transfer (the Splice.AmuletRules analog). No v1 interface
-- choice expresses it: HoldingV1 declares no choices and its Lock is view-only
-- metadata, and TransferInstructionV1 is single-receiver. BurnMintV1 does take
Expand Down
3 changes: 3 additions & 0 deletions daml/canton-token-forge/daml/Canton/TokenForge/TxMeta.daml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

-- | Transaction-kind annotations for this registry's own, non-standardized
-- choices (the Amulet Splice.Amulet.TokenApiUtils analog).
--
Expand Down
3 changes: 3 additions & 0 deletions daml/canton-token-forge/daml/Canton/TokenForge/Types.daml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Types where

import Splice.Api.Token.HoldingV1 qualified as HoldingV1
Expand Down
3 changes: 3 additions & 0 deletions daml/canton-token-forge/daml/Canton/TokenForge/Version.daml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright (c) 2026 BootNode. All rights reserved.
-- SPDX-License-Identifier: BUSL-1.1

module Canton.TokenForge.Version where

-- Package version marker.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@bootnodedev/canton-token-forge",
"version": "0.3.0",
"description": "A reusable, multi-instrument CIP-0056 (CN Token Standard) compliant token for demos and sandboxes, plus its read-only registry HTTP service",
"license": "MIT",
"license": "BUSL-1.1",
"type": "module",
"scripts": {
"setup": "bash scripts/fetch-dep.sh",
Expand Down
3 changes: 3 additions & 0 deletions registry/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2026 BootNode. All rights reserved.
// SPDX-License-Identifier: BUSL-1.1

export interface Config {
ledgerApiUrl: string
ledgerApiToken: string
Expand Down
3 changes: 3 additions & 0 deletions registry/src/disclose.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2026 BootNode. All rights reserved.
// SPDX-License-Identifier: BUSL-1.1

import type { ContractEntry } from './ledger.js'

// A disclosure is a ContractEntry minus its decoded payload: the ledger
Expand Down
3 changes: 3 additions & 0 deletions registry/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env node
// Copyright (c) 2026 BootNode. All rights reserved.
// SPDX-License-Identifier: BUSL-1.1

import 'dotenv/config'
import { type Config, loadConfig } from './config.js'
import { HttpLedgerClient } from './ledger.js'
Expand Down
3 changes: 3 additions & 0 deletions registry/src/ledger.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2026 BootNode. All rights reserved.
// SPDX-License-Identifier: BUSL-1.1

import { randomUUID } from 'node:crypto'
import type { Config } from './config.js'
import type { DisclosedContract } from './disclose.js'
Expand Down
3 changes: 3 additions & 0 deletions registry/src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2026 BootNode. All rights reserved.
// SPDX-License-Identifier: BUSL-1.1

import { pino } from 'pino'

// The structural interface the service depends on, so tests can pass a
Expand Down
3 changes: 3 additions & 0 deletions registry/src/mapping.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2026 BootNode. All rights reserved.
// SPDX-License-Identifier: BUSL-1.1

import type { ContractEntry } from './ledger.js'
import type { InstrumentConfigPayload, InstrumentIdValue } from './payloads.js'

Expand Down
3 changes: 3 additions & 0 deletions registry/src/openapi.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2026 BootNode. All rights reserved.
// SPDX-License-Identifier: BUSL-1.1

import path from 'node:path'
import { fileURLToPath } from 'node:url'

Expand Down
3 changes: 3 additions & 0 deletions registry/src/payloads.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2026 BootNode. All rights reserved.
// SPDX-License-Identifier: BUSL-1.1

// JSON shapes of the on-ledger contract payloads this service reads, as the
// Canton JSON Ledger API renders create arguments. Only the fields the
// service actually reads are declared; extra runtime fields are allowed by
Expand Down
3 changes: 3 additions & 0 deletions registry/src/routes/allocation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2026 BootNode. All rights reserved.
// SPDX-License-Identifier: BUSL-1.1

import { Router } from 'express'
import {
anyValueBool,
Expand Down
Loading
Loading