@pbgtoken/rwa-contract 1.0.4 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { type PricesProvider } from "./PricesProvider";
3
3
  export { makeRWADatumProvider, type RWADatumProvider } from "./RWADatumProvider";
4
4
  export { type TokenizedAccountProvider } from "./TokenizedAccountProvider";
5
5
  export { filterTransfersAfter, type TransferID } from "./TransferID";
6
- export { one_to_one_asset, tokenized_account } from "./validators";
6
+ export { wrapped_asset, account_aggregate } from "./validators";
7
7
  export { makeCoinGeckoProvider } from "./CoinGeckoProvider";
8
8
  export { makeBitcoinWalletProvider } from "./BitcoinWalletProvider";
9
9
  export { makeEthereumERC20AccountProvider } from "./EthereumERC20AccountProvider";
package/dist/index.js CHANGED
@@ -168,18 +168,20 @@ import { expectDefined } from "@helios-lang/type-utils";
168
168
 
169
169
  // src/validators/index.ts
170
170
  import { makeCast, makeUserFunc } from "@helios-lang/contract-utils";
171
- var one_to_one_asset = {
172
- $name: "one_to_one_asset",
171
+ var account_aggregate = {
172
+ $name: "account_aggregate",
173
173
  $purpose: "mixed",
174
174
  $currentScriptIndex: 0,
175
- $sourceCode: `mixed one_to_one_asset
175
+ $sourceCode: `mixed account_aggregate
176
176
 
177
177
  import { get_current_input, tx } from ScriptContext
178
178
 
179
179
  struct State {
180
- supply: Int "supply"
180
+ current_supply: Int "current_supply" // smaller or equal to supply_after_last_mint
181
+ supply_after_last_mint: Int "supply_after_last_mint"
182
+ transfer_id_before_last_mint: ByteArray "transfer_id_before_last_mint" // this is hash, because it might contain data that shouldn't be public
181
183
 
182
- type: String "type" // eg. Bitcoin or ERC20
184
+ type: String "type" // eg. CardanoWallet or Private
183
185
  account: ByteArray "account" // if type==Private -> this is a hash of the actual account type + address
184
186
 
185
187
  name: String "name"
@@ -209,17 +211,20 @@ enum Metadata {
209
211
  }
210
212
 
211
213
  struct Redeemer {
212
- reserves: Int
214
+ total_reserves: Real // usually a USD value, 6 decimal places is enough
215
+ reserves_change: Real
216
+ latest_transfer_id: ByteArray
213
217
  }
214
218
 
215
219
  const SEED_ID = TxOutputId::new(TxId::new(#), 0)
216
220
  const ORACLE_KEYS = []PubKeyHash{}
217
- const TYPE = "BitcoinNative"
221
+ const INITIAL_PRICE: Real = 0.001 // 1000 USD per token -> 0.001 USD per microtoken
222
+ const TYPE = "Private"
218
223
  const ACCOUNT = #
219
- const TICKER = "BTC"
220
- const NAME = "wrapped " + TICKER
221
- const DESCRIPTION = "wrapped" + TICKER + " operated by PBG"
222
- const DECIMALS = 8
224
+ const TICKER = "USDT"
225
+ const NAME = TICKER + " RWA"
226
+ const DESCRIPTION = TICKER + " RWA operated by PBG"
227
+ const DECIMALS = 6
223
228
  const URL = "https://www.pbg.io"
224
229
  const LOGO = "https://assets.pbg.io/usdt_bridge.png"
225
230
 
@@ -227,7 +232,7 @@ const ticker_bytes = TICKER.encode_utf8()
227
232
  const user_token_name = Cip67::fungible_token_label + ticker_bytes
228
233
  const ref_token_name = Cip67::reference_token_label + ticker_bytes
229
234
 
230
- const own_hash = Scripts::one_to_one_asset
235
+ const own_hash = Scripts::account_aggregate
231
236
  const own_mph = MintingPolicyHash::from_script_hash(own_hash)
232
237
  const own_address = Address::new(
233
238
  SpendingCredential::new_validator(
@@ -253,7 +258,10 @@ func validate_initialization() -> () {
253
258
 
254
259
  assert(metadata == Metadata::Cip68{
255
260
  State{
256
- supply: 0,
261
+ current_supply: 0,
262
+ supply_after_last_mint: 0,
263
+ transfer_id_before_last_mint: #,
264
+
257
265
  type: TYPE,
258
266
  account: ACCOUNT,
259
267
 
@@ -277,6 +285,21 @@ func signed_by_quorum() -> Bool {
277
285
  n_signers > (ORACLE_KEYS.length/2)
278
286
  }
279
287
 
288
+ func calc_token_price(R: Real, Delta: Real, current_supply: Int, supply_after_last_mint: Int) -> Real {
289
+ if (current_supply == 0 || supply_after_last_mint == 0) {
290
+ INITIAL_PRICE
291
+ } else {
292
+ p_last = (R - Delta)/supply_after_last_mint
293
+ p_curr = R / current_supply
294
+
295
+ if (p_last < p_curr) {
296
+ p_last
297
+ } else {
298
+ p_curr
299
+ }
300
+ }
301
+ }
302
+
280
303
  func validate_state_change(redeemer: Redeemer, input: TxInput) -> () {
281
304
  state0 = input.datum.inline.as[Metadata].state()
282
305
 
@@ -294,16 +317,23 @@ func validate_state_change(redeemer: Redeemer, input: TxInput) -> () {
294
317
  assert(state1.decimals == state0.decimals, "metadata decimals not constant")
295
318
 
296
319
  n = tx.minted.get_safe(user_token_asset_class)
297
- N0 = state0.supply
298
- N1 = state1.supply
320
+ N0 = state0.current_supply
321
+ N1 = state1.current_supply
299
322
 
300
323
  assert((N1 - N0) == n, "current token supply not updated correctly")
301
324
 
302
325
  if (n > 0) {
303
- Redeemer{R} = redeemer
326
+ Redeemer{R, Delta, latest_transfer_id} = redeemer
304
327
 
305
- assert(N1 <= R, "too many tokens minted")
328
+ p = calc_token_price(R, Delta, N0, state0.supply_after_last_mint)
329
+
330
+ assert(N1*p <= R, "too many tokens minted")
331
+ assert(state1.transfer_id_before_last_mint == latest_transfer_id, "transfer_id_before_last_mint not updated correctly")
332
+ assert(state1.supply_after_last_mint == N1, "supply_after_last_mint not updated correctly")
306
333
  assert(signed_by_quorum(), "not signed by simple quorum of oracles")
334
+ } else {
335
+ assert(state1.supply_after_last_mint == state0.supply_after_last_mint, "supply_after_last_mint can't change during burn")
336
+ assert(state1.transfer_id_before_last_mint == state0.transfer_id_before_last_mint, "transfer_id_before_last_mint can't change during burn")
307
337
  }
308
338
  }
309
339
 
@@ -358,15 +388,16 @@ func main(args: MixedArgs) -> () {
358
388
  $Redeemer: (config) => makeCast({ "kind": "enum", "id": "__helios__mixedargs", "name": "MixedArgs", "variantTypes": [{ "kind": "variant", "name": "Other", "id": "__helios__mixedargs__other", "tag": 0, "fieldTypes": [{ "name": "redeemer", "type": { "kind": "internal", "name": "Data" } }] }, { "kind": "variant", "name": "Spending", "id": "__helios__mixedargs__spending", "tag": 1, "fieldTypes": [{ "name": "redeemer", "type": { "kind": "internal", "name": "Data" } }] }] }, config),
359
389
  $Datum: (config) => makeCast({ "kind": "internal", "name": "Data" }, config),
360
390
  $types: {
361
- State: (config) => makeCast({ "kind": "struct", "format": "map", "id": "__module__one_to_one_asset__State[]", "name": "State", "fieldTypes": [{ "name": "supply", "type": { "kind": "internal", "name": "Int" }, "key": "supply" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] }, config),
362
- Cip68Extra: (config) => makeCast({ "kind": "enum", "name": "Cip68Extra", "id": "__module__one_to_one_asset__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__one_to_one_asset__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] }, config),
363
- Metadata: (config) => makeCast({ "kind": "enum", "name": "Metadata", "id": "__module__one_to_one_asset__Metadata[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__one_to_one_asset__Metadata[]__Cip68", "name": "Cip68", "fieldTypes": [{ "name": "state", "type": { "kind": "struct", "format": "map", "id": "__module__one_to_one_asset__State[]", "name": "State", "fieldTypes": [{ "name": "supply", "type": { "kind": "internal", "name": "Int" }, "key": "supply" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] } }, { "name": "version", "type": { "kind": "internal", "name": "Int" } }, { "name": "extra", "type": { "kind": "enum", "name": "Cip68Extra", "id": "__module__one_to_one_asset__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__one_to_one_asset__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] } }] }] }, config),
364
- Redeemer: (config) => makeCast({ "kind": "struct", "format": "singleton", "id": "__module__one_to_one_asset__Redeemer[]", "name": "Redeemer", "fieldTypes": [{ "name": "reserves", "type": { "kind": "internal", "name": "Int" } }] }, config)
391
+ State: (config) => makeCast({ "kind": "struct", "format": "map", "id": "__module__account_aggregate__State[]", "name": "State", "fieldTypes": [{ "name": "current_supply", "type": { "kind": "internal", "name": "Int" }, "key": "current_supply" }, { "name": "supply_after_last_mint", "type": { "kind": "internal", "name": "Int" }, "key": "supply_after_last_mint" }, { "name": "transfer_id_before_last_mint", "type": { "kind": "internal", "name": "ByteArray" }, "key": "transfer_id_before_last_mint" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] }, config),
392
+ Cip68Extra: (config) => makeCast({ "kind": "enum", "name": "Cip68Extra", "id": "__module__account_aggregate__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__account_aggregate__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] }, config),
393
+ Metadata: (config) => makeCast({ "kind": "enum", "name": "Metadata", "id": "__module__account_aggregate__Metadata[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__account_aggregate__Metadata[]__Cip68", "name": "Cip68", "fieldTypes": [{ "name": "state", "type": { "kind": "struct", "format": "map", "id": "__module__account_aggregate__State[]", "name": "State", "fieldTypes": [{ "name": "current_supply", "type": { "kind": "internal", "name": "Int" }, "key": "current_supply" }, { "name": "supply_after_last_mint", "type": { "kind": "internal", "name": "Int" }, "key": "supply_after_last_mint" }, { "name": "transfer_id_before_last_mint", "type": { "kind": "internal", "name": "ByteArray" }, "key": "transfer_id_before_last_mint" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] } }, { "name": "version", "type": { "kind": "internal", "name": "Int" } }, { "name": "extra", "type": { "kind": "enum", "name": "Cip68Extra", "id": "__module__account_aggregate__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__account_aggregate__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] } }] }] }, config),
394
+ Redeemer: (config) => makeCast({ "kind": "struct", "format": "list", "id": "__module__account_aggregate__Redeemer[]", "name": "Redeemer", "fieldTypes": [{ "name": "total_reserves", "type": { "kind": "internal", "name": "Real" } }, { "name": "reserves_change", "type": { "kind": "internal", "name": "Real" } }, { "name": "latest_transfer_id", "type": { "kind": "internal", "name": "ByteArray" } }] }, config)
365
395
  },
366
396
  $functions: {
367
- "Metadata::state": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "Metadata::state", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [{ "name": "self", "isOptional": false, "type": { "kind": "enum", "name": "Metadata", "id": "__module__one_to_one_asset__Metadata[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__one_to_one_asset__Metadata[]__Cip68", "name": "Cip68", "fieldTypes": [{ "name": "state", "type": { "kind": "struct", "format": "map", "id": "__module__one_to_one_asset__State[]", "name": "State", "fieldTypes": [{ "name": "supply", "type": { "kind": "internal", "name": "Int" }, "key": "supply" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] } }, { "name": "version", "type": { "kind": "internal", "name": "Int" } }, { "name": "extra", "type": { "kind": "enum", "name": "Cip68Extra", "id": "__module__one_to_one_asset__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__one_to_one_asset__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] } }] }] } }], "returns": { "kind": "struct", "format": "map", "id": "__module__one_to_one_asset__State[]", "name": "State", "fieldTypes": [{ "name": "supply", "type": { "kind": "internal", "name": "Int" }, "key": "supply" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] } }, castConfig: config, validatorIndices: __validatorIndices }),
397
+ "Metadata::state": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "Metadata::state", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [{ "name": "self", "isOptional": false, "type": { "kind": "enum", "name": "Metadata", "id": "__module__account_aggregate__Metadata[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__account_aggregate__Metadata[]__Cip68", "name": "Cip68", "fieldTypes": [{ "name": "state", "type": { "kind": "struct", "format": "map", "id": "__module__account_aggregate__State[]", "name": "State", "fieldTypes": [{ "name": "current_supply", "type": { "kind": "internal", "name": "Int" }, "key": "current_supply" }, { "name": "supply_after_last_mint", "type": { "kind": "internal", "name": "Int" }, "key": "supply_after_last_mint" }, { "name": "transfer_id_before_last_mint", "type": { "kind": "internal", "name": "ByteArray" }, "key": "transfer_id_before_last_mint" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] } }, { "name": "version", "type": { "kind": "internal", "name": "Int" } }, { "name": "extra", "type": { "kind": "enum", "name": "Cip68Extra", "id": "__module__account_aggregate__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__account_aggregate__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] } }] }] } }], "returns": { "kind": "struct", "format": "map", "id": "__module__account_aggregate__State[]", "name": "State", "fieldTypes": [{ "name": "current_supply", "type": { "kind": "internal", "name": "Int" }, "key": "current_supply" }, { "name": "supply_after_last_mint", "type": { "kind": "internal", "name": "Int" }, "key": "supply_after_last_mint" }, { "name": "transfer_id_before_last_mint", "type": { "kind": "internal", "name": "ByteArray" }, "key": "transfer_id_before_last_mint" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] } }, castConfig: config, validatorIndices: __validatorIndices }),
368
398
  "SEED_ID": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "SEED_ID", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "TxOutputId" } }, castConfig: config, validatorIndices: __validatorIndices }),
369
399
  "ORACLE_KEYS": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "ORACLE_KEYS", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "list", "itemType": { "kind": "internal", "name": "PubKeyHash" } } }, castConfig: config, validatorIndices: __validatorIndices }),
400
+ "INITIAL_PRICE": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "INITIAL_PRICE", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "Real" } }, castConfig: config, validatorIndices: __validatorIndices }),
370
401
  "TYPE": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "TYPE", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "String" } }, castConfig: config, validatorIndices: __validatorIndices }),
371
402
  "ACCOUNT": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "ACCOUNT", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "ByteArray" } }, castConfig: config, validatorIndices: __validatorIndices }),
372
403
  "TICKER": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "TICKER", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "String" } }, castConfig: config, validatorIndices: __validatorIndices }),
@@ -385,32 +416,37 @@ func main(args: MixedArgs) -> () {
385
416
  "user_token_asset_class": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "user_token_asset_class", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "AssetClass" } }, castConfig: config, validatorIndices: __validatorIndices }),
386
417
  "validate_initialization": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "validate_initialization", "requiresCurrentScript": false, "requiresScriptContext": true, "arguments": [] }, castConfig: config, validatorIndices: __validatorIndices }),
387
418
  "signed_by_quorum": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "signed_by_quorum", "requiresCurrentScript": false, "requiresScriptContext": true, "arguments": [], "returns": { "kind": "internal", "name": "Bool" } }, castConfig: config, validatorIndices: __validatorIndices }),
388
- "validate_state_change": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "validate_state_change", "requiresCurrentScript": false, "requiresScriptContext": true, "arguments": [{ "name": "redeemer", "isOptional": false, "type": { "kind": "struct", "format": "singleton", "id": "__module__one_to_one_asset__Redeemer[]", "name": "Redeemer", "fieldTypes": [{ "name": "reserves", "type": { "kind": "internal", "name": "Int" } }] } }, { "name": "input", "isOptional": false, "type": { "kind": "internal", "name": "TxInput" } }] }, castConfig: config, validatorIndices: __validatorIndices }),
419
+ "calc_token_price": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "calc_token_price", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [{ "name": "R", "isOptional": false, "type": { "kind": "internal", "name": "Real" } }, { "name": "Delta", "isOptional": false, "type": { "kind": "internal", "name": "Real" } }, { "name": "current_supply", "isOptional": false, "type": { "kind": "internal", "name": "Int" } }, { "name": "supply_after_last_mint", "isOptional": false, "type": { "kind": "internal", "name": "Int" } }], "returns": { "kind": "internal", "name": "Real" } }, castConfig: config, validatorIndices: __validatorIndices }),
420
+ "validate_state_change": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "validate_state_change", "requiresCurrentScript": false, "requiresScriptContext": true, "arguments": [{ "name": "redeemer", "isOptional": false, "type": { "kind": "struct", "format": "list", "id": "__module__account_aggregate__Redeemer[]", "name": "Redeemer", "fieldTypes": [{ "name": "total_reserves", "type": { "kind": "internal", "name": "Real" } }, { "name": "reserves_change", "type": { "kind": "internal", "name": "Real" } }, { "name": "latest_transfer_id", "type": { "kind": "internal", "name": "ByteArray" } }] } }, { "name": "input", "isOptional": false, "type": { "kind": "internal", "name": "TxInput" } }] }, castConfig: config, validatorIndices: __validatorIndices }),
389
421
  "main": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "main", "arguments": [{ "name": "$datum", "isOptional": true, "type": { "kind": "internal", "name": "Data" } }, { "name": "args", "isOptional": false, "type": { "kind": "enum", "id": "__helios__mixedargs", "name": "MixedArgs", "variantTypes": [{ "kind": "variant", "name": "Other", "id": "__helios__mixedargs__other", "tag": 0, "fieldTypes": [{ "name": "redeemer", "type": { "kind": "internal", "name": "Data" } }] }, { "kind": "variant", "name": "Spending", "id": "__helios__mixedargs__spending", "tag": 1, "fieldTypes": [{ "name": "redeemer", "type": { "kind": "internal", "name": "Data" } }] }] } }], "requiresCurrentScript": false, "requiresScriptContext": true }, castConfig: config, validatorIndices: __validatorIndices })
390
422
  }
391
423
  };
392
- var tokenized_account = {
393
- $name: "tokenized_account",
424
+ var wrapped_asset = {
425
+ $name: "wrapped_asset",
394
426
  $purpose: "mixed",
395
427
  $currentScriptIndex: 1,
396
- $sourceCode: `mixed tokenized_account
428
+ $sourceCode: `mixed wrapped_asset
397
429
 
398
430
  import { get_current_input, tx } from ScriptContext
399
431
 
400
432
  struct State {
401
- current_supply: Int "current_supply" // smaller or equal to supply_after_last_mint
402
- supply_after_last_mint: Int "supply_after_last_mint"
403
- transfer_id_before_last_mint: ByteArray "transfer_id_before_last_mint" // this is hash, because it might contain data that shouldn't be public
433
+ supply: Int "supply"
404
434
 
405
- type: String "type" // eg. CardanoWallet or Private
406
- account: ByteArray "account" // if type==Private -> this is a hash of the actual account type + address
435
+ type: String "type" // "WrappedAsset", can't change
436
+ venue: String "venue" // eg. "Bitcoin" or "Ethereum" or <bank-name>, can't change
437
+ policy: String "policy" // eg. "Native" or "USD" or "MXN", can't change
438
+ account: String "account" // eg. "bc1q23ztqjmh9a32z8j4rstg035y3c3vpfe0la3nck", hash of actual account (+ including secret nonce) if this must remain private, can't change
407
439
 
440
+ ticker: String "ticker" // can't change
408
441
  name: String "name"
409
442
  description: String "description"
410
443
  decimals: Int "decimals" // can't change
411
- ticker: String "ticker" // can't change
412
444
  url: String "url"
413
445
  logo: String "logo"
446
+
447
+ quorum: Int "quorum" // can't change
448
+ oracles: []PubKeyHash "oracles" // can't change
449
+ seed: TxOutputId "seed" // can't change
414
450
  }
415
451
 
416
452
  enum Cip68Extra {
@@ -432,28 +468,31 @@ enum Metadata {
432
468
  }
433
469
 
434
470
  struct Redeemer {
435
- total_reserves: Real // usually a USD value, 6 decimal places is enough
436
- reserves_change: Real
437
- latest_transfer_id: ByteArray
471
+ reserves: Int
438
472
  }
439
473
 
440
- const SEED_ID = TxOutputId::new(TxId::new(#), 0)
441
- const ORACLE_KEYS = []PubKeyHash{}
442
- const INITIAL_PRICE: Real = 0.001 // 1000 USD per token -> 0.001 USD per microtoken
443
- const TYPE = "Private"
444
- const ACCOUNT = #
445
- const TICKER = "USDT"
446
- const NAME = TICKER + " RWA"
447
- const DESCRIPTION = TICKER + " RWA operated by PBG"
448
- const DECIMALS = 6
449
- const URL = "https://www.pbg.io"
450
- const LOGO = "https://assets.pbg.io/usdt_bridge.png"
474
+ // TODO: ability to leave const params unset during hl2ts transpilation
475
+ const SEED = TxOutputId::new(TxId::new(#), 0)
476
+ const ORACLES = []PubKeyHash{}
477
+ const QUORUM = ORACLES.length/2
478
+
479
+ const TYPE = "WrappedAsset"
480
+ const VENUE = "VENUE"
481
+ const POLICY = "POLICY"
482
+ const ACCOUNT = "ACCOUNT"
483
+
484
+ const TICKER = "TICKER"
485
+ const NAME = "NAME"
486
+ const DESCRIPTION = "DESCRIPTION"
487
+ const DECIMALS = 0
488
+ const URL = "URL"
489
+ const LOGO = "LOGO"
451
490
 
452
491
  const ticker_bytes = TICKER.encode_utf8()
453
492
  const user_token_name = Cip67::fungible_token_label + ticker_bytes
454
493
  const ref_token_name = Cip67::reference_token_label + ticker_bytes
455
494
 
456
- const own_hash = Scripts::tokenized_account
495
+ const own_hash = Scripts::wrapped_asset
457
496
  const own_mph = MintingPolicyHash::from_script_hash(own_hash)
458
497
  const own_address = Address::new(
459
498
  SpendingCredential::new_validator(
@@ -467,8 +506,8 @@ const user_token_asset_class = AssetClass::new(own_mph, user_token_name)
467
506
 
468
507
  func validate_initialization() -> () {
469
508
  assert(tx.inputs.any((input: TxInput) -> {
470
- input.output_id == SEED_ID
471
- }), "seed UTXO not spent")
509
+ input.output_id == SEED
510
+ }), "seed not spent")
472
511
 
473
512
  ref_utxo = tx.outputs.find((output: TxOutput) -> {
474
513
  output.address == own_address
@@ -479,19 +518,23 @@ func validate_initialization() -> () {
479
518
 
480
519
  assert(metadata == Metadata::Cip68{
481
520
  State{
482
- current_supply: 0,
483
- supply_after_last_mint: 0,
484
- transfer_id_before_last_mint: #,
521
+ supply: 0,
485
522
 
486
523
  type: TYPE,
524
+ venue: VENUE,
525
+ policy: POLICY,
487
526
  account: ACCOUNT,
488
527
 
528
+ ticker: TICKER,
489
529
  name: NAME,
490
530
  description: DESCRIPTION,
491
531
  decimals: DECIMALS,
492
- ticker: TICKER,
493
532
  url: URL,
494
- logo: LOGO
533
+ logo: LOGO,
534
+
535
+ quorum: QUORUM,
536
+ oracles: ORACLES,
537
+ seed: SEED
495
538
  },
496
539
  1,
497
540
  Cip68Extra::Unused
@@ -499,26 +542,11 @@ func validate_initialization() -> () {
499
542
  }
500
543
 
501
544
  func signed_by_quorum() -> Bool {
502
- n_signers = ORACLE_KEYS.fold((n_signers: Int, key: PubKeyHash) -> {
545
+ n_signers = ORACLES.fold((n_signers: Int, key: PubKeyHash) -> {
503
546
  n_signers + tx.is_signed_by(key).to_int()
504
547
  }, 0)
505
548
 
506
- n_signers > (ORACLE_KEYS.length/2)
507
- }
508
-
509
- func calc_token_price(R: Real, Delta: Real, current_supply: Int, supply_after_last_mint: Int) -> Real {
510
- if (current_supply == 0 || supply_after_last_mint == 0) {
511
- INITIAL_PRICE
512
- } else {
513
- p_last = (R - Delta)/supply_after_last_mint
514
- p_curr = R / current_supply
515
-
516
- if (p_last < p_curr) {
517
- p_last
518
- } else {
519
- p_curr
520
- }
521
- }
549
+ n_signers > QUORUM
522
550
  }
523
551
 
524
552
  func validate_state_change(redeemer: Redeemer, input: TxInput) -> () {
@@ -532,29 +560,29 @@ func validate_state_change(redeemer: Redeemer, input: TxInput) -> () {
532
560
  state1 = output.datum.inline.as_strictly[Metadata].state()
533
561
 
534
562
  // ensure constant metadata fields don't change
535
- assert(state1.type == state0.type, "type not constant")
536
- assert(state1.account == state0.account, "account not constant")
537
- assert(state1.ticker == state0.ticker, "metadata ticker not constant")
538
- assert(state1.decimals == state0.decimals, "metadata decimals not constant")
563
+ assert(state1.type == TYPE, "type changed")
564
+ assert(state1.venue == state0.venue, "venue changed")
565
+ assert(state1.policy == state0.policy, "policy changed")
566
+ assert(state1.account == state0.account, "account changed")
567
+
568
+ assert(state1.ticker == state0.ticker, "ticker changed")
569
+ assert(state1.decimals == state0.decimals, "decimals changed")
570
+
571
+ assert(state1.quorum == QUORUM, "quorum changed")
572
+ assert(state1.oracles == ORACLES, "oracles changed")
573
+ assert(state1.seed == SEED, "seed changed")
539
574
 
540
575
  n = tx.minted.get_safe(user_token_asset_class)
541
- N0 = state0.current_supply
542
- N1 = state1.current_supply
576
+ N0 = state0.supply
577
+ N1 = state1.supply
543
578
 
544
579
  assert((N1 - N0) == n, "current token supply not updated correctly")
545
580
 
546
581
  if (n > 0) {
547
- Redeemer{R, Delta, latest_transfer_id} = redeemer
548
-
549
- p = calc_token_price(R, Delta, N0, state0.supply_after_last_mint)
582
+ Redeemer{R} = redeemer
550
583
 
551
- assert(N1*p <= R, "too many tokens minted")
552
- assert(state1.transfer_id_before_last_mint == latest_transfer_id, "transfer_id_before_last_mint not updated correctly")
553
- assert(state1.supply_after_last_mint == N1, "supply_after_last_mint not updated correctly")
584
+ assert(N1 <= R, "too many tokens minted")
554
585
  assert(signed_by_quorum(), "not signed by simple quorum of oracles")
555
- } else {
556
- assert(state1.supply_after_last_mint == state0.supply_after_last_mint, "supply_after_last_mint can't change during burn")
557
- assert(state1.transfer_id_before_last_mint == state0.transfer_id_before_last_mint, "transfer_id_before_last_mint can't change during burn")
558
586
  }
559
587
  }
560
588
 
@@ -609,18 +637,20 @@ func main(args: MixedArgs) -> () {
609
637
  $Redeemer: (config) => makeCast({ "kind": "enum", "id": "__helios__mixedargs", "name": "MixedArgs", "variantTypes": [{ "kind": "variant", "name": "Other", "id": "__helios__mixedargs__other", "tag": 0, "fieldTypes": [{ "name": "redeemer", "type": { "kind": "internal", "name": "Data" } }] }, { "kind": "variant", "name": "Spending", "id": "__helios__mixedargs__spending", "tag": 1, "fieldTypes": [{ "name": "redeemer", "type": { "kind": "internal", "name": "Data" } }] }] }, config),
610
638
  $Datum: (config) => makeCast({ "kind": "internal", "name": "Data" }, config),
611
639
  $types: {
612
- State: (config) => makeCast({ "kind": "struct", "format": "map", "id": "__module__tokenized_account__State[]", "name": "State", "fieldTypes": [{ "name": "current_supply", "type": { "kind": "internal", "name": "Int" }, "key": "current_supply" }, { "name": "supply_after_last_mint", "type": { "kind": "internal", "name": "Int" }, "key": "supply_after_last_mint" }, { "name": "transfer_id_before_last_mint", "type": { "kind": "internal", "name": "ByteArray" }, "key": "transfer_id_before_last_mint" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] }, config),
613
- Cip68Extra: (config) => makeCast({ "kind": "enum", "name": "Cip68Extra", "id": "__module__tokenized_account__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__tokenized_account__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] }, config),
614
- Metadata: (config) => makeCast({ "kind": "enum", "name": "Metadata", "id": "__module__tokenized_account__Metadata[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__tokenized_account__Metadata[]__Cip68", "name": "Cip68", "fieldTypes": [{ "name": "state", "type": { "kind": "struct", "format": "map", "id": "__module__tokenized_account__State[]", "name": "State", "fieldTypes": [{ "name": "current_supply", "type": { "kind": "internal", "name": "Int" }, "key": "current_supply" }, { "name": "supply_after_last_mint", "type": { "kind": "internal", "name": "Int" }, "key": "supply_after_last_mint" }, { "name": "transfer_id_before_last_mint", "type": { "kind": "internal", "name": "ByteArray" }, "key": "transfer_id_before_last_mint" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] } }, { "name": "version", "type": { "kind": "internal", "name": "Int" } }, { "name": "extra", "type": { "kind": "enum", "name": "Cip68Extra", "id": "__module__tokenized_account__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__tokenized_account__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] } }] }] }, config),
615
- Redeemer: (config) => makeCast({ "kind": "struct", "format": "list", "id": "__module__tokenized_account__Redeemer[]", "name": "Redeemer", "fieldTypes": [{ "name": "total_reserves", "type": { "kind": "internal", "name": "Real" } }, { "name": "reserves_change", "type": { "kind": "internal", "name": "Real" } }, { "name": "latest_transfer_id", "type": { "kind": "internal", "name": "ByteArray" } }] }, config)
640
+ State: (config) => makeCast({ "kind": "struct", "format": "map", "id": "__module__wrapped_asset__State[]", "name": "State", "fieldTypes": [{ "name": "supply", "type": { "kind": "internal", "name": "Int" }, "key": "supply" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "venue", "type": { "kind": "internal", "name": "String" }, "key": "venue" }, { "name": "policy", "type": { "kind": "internal", "name": "String" }, "key": "policy" }, { "name": "account", "type": { "kind": "internal", "name": "String" }, "key": "account" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }, { "name": "quorum", "type": { "kind": "internal", "name": "Int" }, "key": "quorum" }, { "name": "oracles", "type": { "kind": "list", "itemType": { "kind": "internal", "name": "PubKeyHash" } }, "key": "oracles" }, { "name": "seed", "type": { "kind": "internal", "name": "TxOutputId" }, "key": "seed" }] }, config),
641
+ Cip68Extra: (config) => makeCast({ "kind": "enum", "name": "Cip68Extra", "id": "__module__wrapped_asset__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__wrapped_asset__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] }, config),
642
+ Metadata: (config) => makeCast({ "kind": "enum", "name": "Metadata", "id": "__module__wrapped_asset__Metadata[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__wrapped_asset__Metadata[]__Cip68", "name": "Cip68", "fieldTypes": [{ "name": "state", "type": { "kind": "struct", "format": "map", "id": "__module__wrapped_asset__State[]", "name": "State", "fieldTypes": [{ "name": "supply", "type": { "kind": "internal", "name": "Int" }, "key": "supply" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "venue", "type": { "kind": "internal", "name": "String" }, "key": "venue" }, { "name": "policy", "type": { "kind": "internal", "name": "String" }, "key": "policy" }, { "name": "account", "type": { "kind": "internal", "name": "String" }, "key": "account" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }, { "name": "quorum", "type": { "kind": "internal", "name": "Int" }, "key": "quorum" }, { "name": "oracles", "type": { "kind": "list", "itemType": { "kind": "internal", "name": "PubKeyHash" } }, "key": "oracles" }, { "name": "seed", "type": { "kind": "internal", "name": "TxOutputId" }, "key": "seed" }] } }, { "name": "version", "type": { "kind": "internal", "name": "Int" } }, { "name": "extra", "type": { "kind": "enum", "name": "Cip68Extra", "id": "__module__wrapped_asset__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__wrapped_asset__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] } }] }] }, config),
643
+ Redeemer: (config) => makeCast({ "kind": "struct", "format": "singleton", "id": "__module__wrapped_asset__Redeemer[]", "name": "Redeemer", "fieldTypes": [{ "name": "reserves", "type": { "kind": "internal", "name": "Int" } }] }, config)
616
644
  },
617
645
  $functions: {
618
- "Metadata::state": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "Metadata::state", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [{ "name": "self", "isOptional": false, "type": { "kind": "enum", "name": "Metadata", "id": "__module__tokenized_account__Metadata[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__tokenized_account__Metadata[]__Cip68", "name": "Cip68", "fieldTypes": [{ "name": "state", "type": { "kind": "struct", "format": "map", "id": "__module__tokenized_account__State[]", "name": "State", "fieldTypes": [{ "name": "current_supply", "type": { "kind": "internal", "name": "Int" }, "key": "current_supply" }, { "name": "supply_after_last_mint", "type": { "kind": "internal", "name": "Int" }, "key": "supply_after_last_mint" }, { "name": "transfer_id_before_last_mint", "type": { "kind": "internal", "name": "ByteArray" }, "key": "transfer_id_before_last_mint" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] } }, { "name": "version", "type": { "kind": "internal", "name": "Int" } }, { "name": "extra", "type": { "kind": "enum", "name": "Cip68Extra", "id": "__module__tokenized_account__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__tokenized_account__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] } }] }] } }], "returns": { "kind": "struct", "format": "map", "id": "__module__tokenized_account__State[]", "name": "State", "fieldTypes": [{ "name": "current_supply", "type": { "kind": "internal", "name": "Int" }, "key": "current_supply" }, { "name": "supply_after_last_mint", "type": { "kind": "internal", "name": "Int" }, "key": "supply_after_last_mint" }, { "name": "transfer_id_before_last_mint", "type": { "kind": "internal", "name": "ByteArray" }, "key": "transfer_id_before_last_mint" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "account", "type": { "kind": "internal", "name": "ByteArray" }, "key": "account" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }] } }, castConfig: config, validatorIndices: __validatorIndices }),
619
- "SEED_ID": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "SEED_ID", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "TxOutputId" } }, castConfig: config, validatorIndices: __validatorIndices }),
620
- "ORACLE_KEYS": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "ORACLE_KEYS", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "list", "itemType": { "kind": "internal", "name": "PubKeyHash" } } }, castConfig: config, validatorIndices: __validatorIndices }),
621
- "INITIAL_PRICE": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "INITIAL_PRICE", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "Real" } }, castConfig: config, validatorIndices: __validatorIndices }),
646
+ "Metadata::state": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "Metadata::state", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [{ "name": "self", "isOptional": false, "type": { "kind": "enum", "name": "Metadata", "id": "__module__wrapped_asset__Metadata[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__wrapped_asset__Metadata[]__Cip68", "name": "Cip68", "fieldTypes": [{ "name": "state", "type": { "kind": "struct", "format": "map", "id": "__module__wrapped_asset__State[]", "name": "State", "fieldTypes": [{ "name": "supply", "type": { "kind": "internal", "name": "Int" }, "key": "supply" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "venue", "type": { "kind": "internal", "name": "String" }, "key": "venue" }, { "name": "policy", "type": { "kind": "internal", "name": "String" }, "key": "policy" }, { "name": "account", "type": { "kind": "internal", "name": "String" }, "key": "account" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }, { "name": "quorum", "type": { "kind": "internal", "name": "Int" }, "key": "quorum" }, { "name": "oracles", "type": { "kind": "list", "itemType": { "kind": "internal", "name": "PubKeyHash" } }, "key": "oracles" }, { "name": "seed", "type": { "kind": "internal", "name": "TxOutputId" }, "key": "seed" }] } }, { "name": "version", "type": { "kind": "internal", "name": "Int" } }, { "name": "extra", "type": { "kind": "enum", "name": "Cip68Extra", "id": "__module__wrapped_asset__Cip68Extra[]", "variantTypes": [{ "kind": "variant", "tag": 0, "id": "__module__wrapped_asset__Cip68Extra[]__Unused", "name": "Unused", "fieldTypes": [] }] } }] }] } }], "returns": { "kind": "struct", "format": "map", "id": "__module__wrapped_asset__State[]", "name": "State", "fieldTypes": [{ "name": "supply", "type": { "kind": "internal", "name": "Int" }, "key": "supply" }, { "name": "type", "type": { "kind": "internal", "name": "String" }, "key": "type" }, { "name": "venue", "type": { "kind": "internal", "name": "String" }, "key": "venue" }, { "name": "policy", "type": { "kind": "internal", "name": "String" }, "key": "policy" }, { "name": "account", "type": { "kind": "internal", "name": "String" }, "key": "account" }, { "name": "ticker", "type": { "kind": "internal", "name": "String" }, "key": "ticker" }, { "name": "name", "type": { "kind": "internal", "name": "String" }, "key": "name" }, { "name": "description", "type": { "kind": "internal", "name": "String" }, "key": "description" }, { "name": "decimals", "type": { "kind": "internal", "name": "Int" }, "key": "decimals" }, { "name": "url", "type": { "kind": "internal", "name": "String" }, "key": "url" }, { "name": "logo", "type": { "kind": "internal", "name": "String" }, "key": "logo" }, { "name": "quorum", "type": { "kind": "internal", "name": "Int" }, "key": "quorum" }, { "name": "oracles", "type": { "kind": "list", "itemType": { "kind": "internal", "name": "PubKeyHash" } }, "key": "oracles" }, { "name": "seed", "type": { "kind": "internal", "name": "TxOutputId" }, "key": "seed" }] } }, castConfig: config, validatorIndices: __validatorIndices }),
647
+ "SEED": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "SEED", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "TxOutputId" } }, castConfig: config, validatorIndices: __validatorIndices }),
648
+ "ORACLES": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "ORACLES", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "list", "itemType": { "kind": "internal", "name": "PubKeyHash" } } }, castConfig: config, validatorIndices: __validatorIndices }),
649
+ "QUORUM": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "QUORUM", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "Int" } }, castConfig: config, validatorIndices: __validatorIndices }),
622
650
  "TYPE": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "TYPE", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "String" } }, castConfig: config, validatorIndices: __validatorIndices }),
623
- "ACCOUNT": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "ACCOUNT", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "ByteArray" } }, castConfig: config, validatorIndices: __validatorIndices }),
651
+ "VENUE": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "VENUE", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "String" } }, castConfig: config, validatorIndices: __validatorIndices }),
652
+ "POLICY": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "POLICY", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "String" } }, castConfig: config, validatorIndices: __validatorIndices }),
653
+ "ACCOUNT": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "ACCOUNT", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "String" } }, castConfig: config, validatorIndices: __validatorIndices }),
624
654
  "TICKER": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "TICKER", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "String" } }, castConfig: config, validatorIndices: __validatorIndices }),
625
655
  "NAME": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "NAME", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "String" } }, castConfig: config, validatorIndices: __validatorIndices }),
626
656
  "DESCRIPTION": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "DESCRIPTION", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "String" } }, castConfig: config, validatorIndices: __validatorIndices }),
@@ -637,16 +667,15 @@ func main(args: MixedArgs) -> () {
637
667
  "user_token_asset_class": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "user_token_asset_class", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [], "returns": { "kind": "internal", "name": "AssetClass" } }, castConfig: config, validatorIndices: __validatorIndices }),
638
668
  "validate_initialization": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "validate_initialization", "requiresCurrentScript": false, "requiresScriptContext": true, "arguments": [] }, castConfig: config, validatorIndices: __validatorIndices }),
639
669
  "signed_by_quorum": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "signed_by_quorum", "requiresCurrentScript": false, "requiresScriptContext": true, "arguments": [], "returns": { "kind": "internal", "name": "Bool" } }, castConfig: config, validatorIndices: __validatorIndices }),
640
- "calc_token_price": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "calc_token_price", "requiresCurrentScript": false, "requiresScriptContext": false, "arguments": [{ "name": "R", "isOptional": false, "type": { "kind": "internal", "name": "Real" } }, { "name": "Delta", "isOptional": false, "type": { "kind": "internal", "name": "Real" } }, { "name": "current_supply", "isOptional": false, "type": { "kind": "internal", "name": "Int" } }, { "name": "supply_after_last_mint", "isOptional": false, "type": { "kind": "internal", "name": "Int" } }], "returns": { "kind": "internal", "name": "Real" } }, castConfig: config, validatorIndices: __validatorIndices }),
641
- "validate_state_change": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "validate_state_change", "requiresCurrentScript": false, "requiresScriptContext": true, "arguments": [{ "name": "redeemer", "isOptional": false, "type": { "kind": "struct", "format": "list", "id": "__module__tokenized_account__Redeemer[]", "name": "Redeemer", "fieldTypes": [{ "name": "total_reserves", "type": { "kind": "internal", "name": "Real" } }, { "name": "reserves_change", "type": { "kind": "internal", "name": "Real" } }, { "name": "latest_transfer_id", "type": { "kind": "internal", "name": "ByteArray" } }] } }, { "name": "input", "isOptional": false, "type": { "kind": "internal", "name": "TxInput" } }] }, castConfig: config, validatorIndices: __validatorIndices }),
670
+ "validate_state_change": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "validate_state_change", "requiresCurrentScript": false, "requiresScriptContext": true, "arguments": [{ "name": "redeemer", "isOptional": false, "type": { "kind": "struct", "format": "singleton", "id": "__module__wrapped_asset__Redeemer[]", "name": "Redeemer", "fieldTypes": [{ "name": "reserves", "type": { "kind": "internal", "name": "Int" } }] } }, { "name": "input", "isOptional": false, "type": { "kind": "internal", "name": "TxInput" } }] }, castConfig: config, validatorIndices: __validatorIndices }),
642
671
  "main": (uplc, config) => makeUserFunc(uplc, { ...{ "name": "main", "arguments": [{ "name": "$datum", "isOptional": true, "type": { "kind": "internal", "name": "Data" } }, { "name": "args", "isOptional": false, "type": { "kind": "enum", "id": "__helios__mixedargs", "name": "MixedArgs", "variantTypes": [{ "kind": "variant", "name": "Other", "id": "__helios__mixedargs__other", "tag": 0, "fieldTypes": [{ "name": "redeemer", "type": { "kind": "internal", "name": "Data" } }] }, { "kind": "variant", "name": "Spending", "id": "__helios__mixedargs__spending", "tag": 1, "fieldTypes": [{ "name": "redeemer", "type": { "kind": "internal", "name": "Data" } }] }] } }], "requiresCurrentScript": false, "requiresScriptContext": true }, castConfig: config, validatorIndices: __validatorIndices })
643
672
  }
644
673
  };
645
- var __validatorIndices = { "one_to_one_asset": 0, "tokenized_account": 1 };
674
+ var __validatorIndices = { "account_aggregate": 0, "wrapped_asset": 1 };
646
675
 
647
676
  // src/RWADatumProvider.ts
648
- var castMetadata = tokenized_account.$types.Metadata;
649
- var castDatum = tokenized_account.$types.State;
677
+ var castMetadata = account_aggregate.$types.Metadata;
678
+ var castDatum = account_aggregate.$types.State;
650
679
  function makeRWADatumProvider(provider) {
651
680
  return new RWADatumProviderImpl(provider);
652
681
  }
@@ -1321,6 +1350,7 @@ function makeBSCAccountProvider(walletAddress, priceProvider, alchemyApiKey, tok
1321
1350
  return new BSCAccountProvider(walletAddress, priceProvider, alchemyApiKey, tokenContractAddress, rpcUrl);
1322
1351
  }
1323
1352
  export {
1353
+ account_aggregate,
1324
1354
  filterTransfersAfter,
1325
1355
  makeBSCAccountProvider,
1326
1356
  makeBinanceAccountProvider,
@@ -1329,6 +1359,5 @@ export {
1329
1359
  makeCoinGeckoProvider,
1330
1360
  makeEthereumERC20AccountProvider,
1331
1361
  makeRWADatumProvider,
1332
- one_to_one_asset,
1333
- tokenized_account
1362
+ wrapped_asset
1334
1363
  };
@@ -2,8 +2,8 @@ import type { IntLike } from "@helios-lang/codec-utils";
2
2
  import type { Cast, CastConfig, UserFunc } from "@helios-lang/contract-utils";
3
3
  import type { Address, AssetClass, MintingPolicyHash, PubKeyHash, ScriptHash, TxInput, TxOutputId } from "@helios-lang/ledger";
4
4
  import type { UplcData, UplcProgram } from "@helios-lang/uplc";
5
- export declare const one_to_one_asset: {
6
- $name: "one_to_one_asset";
5
+ export declare const account_aggregate: {
6
+ $name: "account_aggregate";
7
7
  $purpose: "mixed";
8
8
  $currentScriptIndex: 0;
9
9
  $sourceCode: string;
@@ -30,7 +30,9 @@ export declare const one_to_one_asset: {
30
30
  $Datum: (config: CastConfig) => Cast<UplcData, UplcData>;
31
31
  $types: {
32
32
  State: (config: CastConfig) => Cast<{
33
- supply: bigint;
33
+ current_supply: bigint;
34
+ supply_after_last_mint: bigint;
35
+ transfer_id_before_last_mint: number[];
34
36
  type: string;
35
37
  account: number[];
36
38
  name: string;
@@ -40,7 +42,9 @@ export declare const one_to_one_asset: {
40
42
  url: string;
41
43
  logo: string;
42
44
  }, {
43
- supply: IntLike;
45
+ current_supply: IntLike;
46
+ supply_after_last_mint: IntLike;
47
+ transfer_id_before_last_mint: number[];
44
48
  type: string;
45
49
  account: number[];
46
50
  name: string;
@@ -58,7 +62,9 @@ export declare const one_to_one_asset: {
58
62
  Metadata: (config: CastConfig) => Cast<{
59
63
  Cip68: {
60
64
  state: {
61
- supply: bigint;
65
+ current_supply: bigint;
66
+ supply_after_last_mint: bigint;
67
+ transfer_id_before_last_mint: number[];
62
68
  type: string;
63
69
  account: number[];
64
70
  name: string;
@@ -76,7 +82,9 @@ export declare const one_to_one_asset: {
76
82
  }, {
77
83
  Cip68: {
78
84
  state: {
79
- supply: IntLike;
85
+ current_supply: IntLike;
86
+ supply_after_last_mint: IntLike;
87
+ transfer_id_before_last_mint: number[];
80
88
  type: string;
81
89
  account: number[];
82
90
  name: string;
@@ -93,9 +101,13 @@ export declare const one_to_one_asset: {
93
101
  };
94
102
  }>;
95
103
  Redeemer: (config: CastConfig) => Cast<{
96
- reserves: bigint;
104
+ total_reserves: number;
105
+ reserves_change: number;
106
+ latest_transfer_id: number[];
97
107
  }, {
98
- reserves: IntLike;
108
+ total_reserves: number;
109
+ reserves_change: number;
110
+ latest_transfer_id: number[];
99
111
  }>;
100
112
  };
101
113
  $functions: {
@@ -103,7 +115,9 @@ export declare const one_to_one_asset: {
103
115
  self: {
104
116
  Cip68: {
105
117
  state: {
106
- supply: IntLike;
118
+ current_supply: IntLike;
119
+ supply_after_last_mint: IntLike;
120
+ transfer_id_before_last_mint: number[];
107
121
  type: string;
108
122
  account: number[];
109
123
  name: string;
@@ -120,7 +134,9 @@ export declare const one_to_one_asset: {
120
134
  };
121
135
  };
122
136
  }, {
123
- supply: bigint;
137
+ current_supply: bigint;
138
+ supply_after_last_mint: bigint;
139
+ transfer_id_before_last_mint: number[];
124
140
  type: string;
125
141
  account: number[];
126
142
  name: string;
@@ -132,6 +148,7 @@ export declare const one_to_one_asset: {
132
148
  }>;
133
149
  SEED_ID: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, TxOutputId>;
134
150
  ORACLE_KEYS: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, PubKeyHash[]>;
151
+ INITIAL_PRICE: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, number>;
135
152
  TYPE: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, string>;
136
153
  ACCOUNT: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, number[]>;
137
154
  TICKER: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, string>;
@@ -154,10 +171,18 @@ export declare const one_to_one_asset: {
154
171
  signed_by_quorum: (uplc: UplcProgram, config: CastConfig) => UserFunc<{
155
172
  $scriptContext: UplcData;
156
173
  }, boolean>;
174
+ calc_token_price: (uplc: UplcProgram, config: CastConfig) => UserFunc<{
175
+ R: number;
176
+ Delta: number;
177
+ current_supply: IntLike;
178
+ supply_after_last_mint: IntLike;
179
+ }, number>;
157
180
  validate_state_change: (uplc: UplcProgram, config: CastConfig) => UserFunc<{
158
181
  $scriptContext: UplcData;
159
182
  redeemer: {
160
- reserves: IntLike;
183
+ total_reserves: number;
184
+ reserves_change: number;
185
+ latest_transfer_id: number[];
161
186
  };
162
187
  input: TxInput;
163
188
  }, void>;
@@ -176,8 +201,8 @@ export declare const one_to_one_asset: {
176
201
  }, void>;
177
202
  };
178
203
  };
179
- export declare const tokenized_account: {
180
- $name: "tokenized_account";
204
+ export declare const wrapped_asset: {
205
+ $name: "wrapped_asset";
181
206
  $purpose: "mixed";
182
207
  $currentScriptIndex: 1;
183
208
  $sourceCode: string;
@@ -204,29 +229,35 @@ export declare const tokenized_account: {
204
229
  $Datum: (config: CastConfig) => Cast<UplcData, UplcData>;
205
230
  $types: {
206
231
  State: (config: CastConfig) => Cast<{
207
- current_supply: bigint;
208
- supply_after_last_mint: bigint;
209
- transfer_id_before_last_mint: number[];
232
+ supply: bigint;
210
233
  type: string;
211
- account: number[];
234
+ venue: string;
235
+ policy: string;
236
+ account: string;
237
+ ticker: string;
212
238
  name: string;
213
239
  description: string;
214
240
  decimals: bigint;
215
- ticker: string;
216
241
  url: string;
217
242
  logo: string;
243
+ quorum: bigint;
244
+ oracles: (PubKeyHash)[];
245
+ seed: TxOutputId;
218
246
  }, {
219
- current_supply: IntLike;
220
- supply_after_last_mint: IntLike;
221
- transfer_id_before_last_mint: number[];
247
+ supply: IntLike;
222
248
  type: string;
223
- account: number[];
249
+ venue: string;
250
+ policy: string;
251
+ account: string;
252
+ ticker: string;
224
253
  name: string;
225
254
  description: string;
226
255
  decimals: IntLike;
227
- ticker: string;
228
256
  url: string;
229
257
  logo: string;
258
+ quorum: IntLike;
259
+ oracles: (PubKeyHash | string | number[])[];
260
+ seed: TxOutputId | string;
230
261
  }>;
231
262
  Cip68Extra: (config: CastConfig) => Cast<{
232
263
  Unused: {};
@@ -236,17 +267,20 @@ export declare const tokenized_account: {
236
267
  Metadata: (config: CastConfig) => Cast<{
237
268
  Cip68: {
238
269
  state: {
239
- current_supply: bigint;
240
- supply_after_last_mint: bigint;
241
- transfer_id_before_last_mint: number[];
270
+ supply: bigint;
242
271
  type: string;
243
- account: number[];
272
+ venue: string;
273
+ policy: string;
274
+ account: string;
275
+ ticker: string;
244
276
  name: string;
245
277
  description: string;
246
278
  decimals: bigint;
247
- ticker: string;
248
279
  url: string;
249
280
  logo: string;
281
+ quorum: bigint;
282
+ oracles: (PubKeyHash)[];
283
+ seed: TxOutputId;
250
284
  };
251
285
  version: bigint;
252
286
  extra: {
@@ -256,17 +290,20 @@ export declare const tokenized_account: {
256
290
  }, {
257
291
  Cip68: {
258
292
  state: {
259
- current_supply: IntLike;
260
- supply_after_last_mint: IntLike;
261
- transfer_id_before_last_mint: number[];
293
+ supply: IntLike;
262
294
  type: string;
263
- account: number[];
295
+ venue: string;
296
+ policy: string;
297
+ account: string;
298
+ ticker: string;
264
299
  name: string;
265
300
  description: string;
266
301
  decimals: IntLike;
267
- ticker: string;
268
302
  url: string;
269
303
  logo: string;
304
+ quorum: IntLike;
305
+ oracles: (PubKeyHash | string | number[])[];
306
+ seed: TxOutputId | string;
270
307
  };
271
308
  version: IntLike;
272
309
  extra: {
@@ -275,13 +312,9 @@ export declare const tokenized_account: {
275
312
  };
276
313
  }>;
277
314
  Redeemer: (config: CastConfig) => Cast<{
278
- total_reserves: number;
279
- reserves_change: number;
280
- latest_transfer_id: number[];
315
+ reserves: bigint;
281
316
  }, {
282
- total_reserves: number;
283
- reserves_change: number;
284
- latest_transfer_id: number[];
317
+ reserves: IntLike;
285
318
  }>;
286
319
  };
287
320
  $functions: {
@@ -289,17 +322,20 @@ export declare const tokenized_account: {
289
322
  self: {
290
323
  Cip68: {
291
324
  state: {
292
- current_supply: IntLike;
293
- supply_after_last_mint: IntLike;
294
- transfer_id_before_last_mint: number[];
325
+ supply: IntLike;
295
326
  type: string;
296
- account: number[];
327
+ venue: string;
328
+ policy: string;
329
+ account: string;
330
+ ticker: string;
297
331
  name: string;
298
332
  description: string;
299
333
  decimals: IntLike;
300
- ticker: string;
301
334
  url: string;
302
335
  logo: string;
336
+ quorum: IntLike;
337
+ oracles: (PubKeyHash | string | number[])[];
338
+ seed: TxOutputId | string;
303
339
  };
304
340
  version: IntLike;
305
341
  extra: {
@@ -308,23 +344,28 @@ export declare const tokenized_account: {
308
344
  };
309
345
  };
310
346
  }, {
311
- current_supply: bigint;
312
- supply_after_last_mint: bigint;
313
- transfer_id_before_last_mint: number[];
347
+ supply: bigint;
314
348
  type: string;
315
- account: number[];
349
+ venue: string;
350
+ policy: string;
351
+ account: string;
352
+ ticker: string;
316
353
  name: string;
317
354
  description: string;
318
355
  decimals: bigint;
319
- ticker: string;
320
356
  url: string;
321
357
  logo: string;
358
+ quorum: bigint;
359
+ oracles: (PubKeyHash)[];
360
+ seed: TxOutputId;
322
361
  }>;
323
- SEED_ID: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, TxOutputId>;
324
- ORACLE_KEYS: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, PubKeyHash[]>;
325
- INITIAL_PRICE: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, number>;
362
+ SEED: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, TxOutputId>;
363
+ ORACLES: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, PubKeyHash[]>;
364
+ QUORUM: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, bigint>;
326
365
  TYPE: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, string>;
327
- ACCOUNT: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, number[]>;
366
+ VENUE: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, string>;
367
+ POLICY: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, string>;
368
+ ACCOUNT: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, string>;
328
369
  TICKER: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, string>;
329
370
  NAME: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, string>;
330
371
  DESCRIPTION: (uplc: UplcProgram, config: CastConfig) => UserFunc<{}, string>;
@@ -345,18 +386,10 @@ export declare const tokenized_account: {
345
386
  signed_by_quorum: (uplc: UplcProgram, config: CastConfig) => UserFunc<{
346
387
  $scriptContext: UplcData;
347
388
  }, boolean>;
348
- calc_token_price: (uplc: UplcProgram, config: CastConfig) => UserFunc<{
349
- R: number;
350
- Delta: number;
351
- current_supply: IntLike;
352
- supply_after_last_mint: IntLike;
353
- }, number>;
354
389
  validate_state_change: (uplc: UplcProgram, config: CastConfig) => UserFunc<{
355
390
  $scriptContext: UplcData;
356
391
  redeemer: {
357
- total_reserves: number;
358
- reserves_change: number;
359
- latest_transfer_id: number[];
392
+ reserves: IntLike;
360
393
  };
361
394
  input: TxInput;
362
395
  }, void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pbgtoken/rwa-contract",
3
- "version": "1.0.4",
3
+ "version": "1.1.4",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",