@agoric/fast-usdc 0.1.1-dev-d756c83.0.d756c83 → 0.1.1-dev-e9efaa1.0.e9efaa1

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.
Files changed (45) hide show
  1. package/package.json +11 -9
  2. package/src/cli/bin.d.ts +3 -0
  3. package/src/cli/bin.d.ts.map +1 -0
  4. package/src/cli/bridge-action.d.ts +10 -0
  5. package/src/cli/bridge-action.d.ts.map +1 -0
  6. package/src/cli/cli.d.ts +13 -0
  7. package/src/cli/cli.d.ts.map +1 -0
  8. package/src/cli/config-commands.d.ts +5 -0
  9. package/src/cli/config-commands.d.ts.map +1 -0
  10. package/src/cli/config.d.ts +22 -0
  11. package/src/cli/config.d.ts.map +1 -0
  12. package/src/cli/lp-commands.d.ts +12 -0
  13. package/src/cli/lp-commands.d.ts.map +1 -0
  14. package/src/cli/operator-commands.d.ts +10 -0
  15. package/src/cli/operator-commands.d.ts.map +1 -0
  16. package/src/cli/transfer.d.ts +9 -0
  17. package/src/cli/transfer.d.ts.map +1 -0
  18. package/src/cli/util/agoric.d.ts +3 -0
  19. package/src/cli/util/agoric.d.ts.map +1 -0
  20. package/src/cli/util/bank.d.ts +2 -0
  21. package/src/cli/util/bank.d.ts.map +1 -0
  22. package/src/cli/util/cctp.d.ts +5 -0
  23. package/src/cli/util/cctp.d.ts.map +1 -0
  24. package/src/cli/util/file.d.ts +12 -0
  25. package/src/cli/util/file.d.ts.map +1 -0
  26. package/src/cli/util/noble.d.ts +11 -0
  27. package/src/cli/util/noble.d.ts.map +1 -0
  28. package/src/clientSupport.d.ts +51 -0
  29. package/src/clientSupport.d.ts.map +1 -0
  30. package/src/constants.d.ts +35 -0
  31. package/src/constants.d.ts.map +1 -0
  32. package/src/main.d.ts +2 -0
  33. package/src/main.d.ts.map +1 -0
  34. package/src/operator-kit-interface.d.ts +19 -0
  35. package/src/operator-kit-interface.d.ts.map +1 -0
  36. package/src/pool-share-math.d.ts +73 -0
  37. package/src/pool-share-math.d.ts.map +1 -0
  38. package/src/type-guards.d.ts +113 -0
  39. package/src/type-guards.d.ts.map +1 -0
  40. package/src/types.d.ts +164 -0
  41. package/src/types.d.ts.map +1 -0
  42. package/src/types.js +197 -0
  43. package/src/utils/fees.d.ts +64 -0
  44. package/src/utils/fees.d.ts.map +1 -0
  45. package/src/types.ts +0 -197
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/fast-usdc",
3
- "version": "0.1.1-dev-d756c83.0.d756c83",
3
+ "version": "0.1.1-dev-e9efaa1.0.e9efaa1",
4
4
  "description": "CLI and library for Fast USDC product",
5
5
  "type": "module",
6
6
  "files": [
@@ -11,6 +11,8 @@
11
11
  "bin": "./src/cli/bin.js",
12
12
  "scripts": {
13
13
  "build": "exit 0",
14
+ "prepack": "yarn run -T prepack-package",
15
+ "postpack": "yarn run -T postpack-package",
14
16
  "test": "ava",
15
17
  "test:c8": "c8 --all ${C8_OPTIONS:-} ava",
16
18
  "test:xs": "exit 0",
@@ -27,13 +29,13 @@
27
29
  "ts-blank-space": "^0.6.2"
28
30
  },
29
31
  "dependencies": {
30
- "@agoric/client-utils": "0.1.1-dev-d756c83.0.d756c83",
31
- "@agoric/cosmic-proto": "0.4.1-dev-d756c83.0.d756c83",
32
- "@agoric/ertp": "0.16.3-dev-d756c83.0.d756c83",
33
- "@agoric/internal": "0.3.3-dev-d756c83.0.d756c83",
34
- "@agoric/notifier": "0.6.3-dev-d756c83.0.d756c83",
35
- "@agoric/orchestration": "0.1.1-dev-d756c83.0.d756c83",
36
- "@agoric/zoe": "0.26.3-dev-d756c83.0.d756c83",
32
+ "@agoric/client-utils": "0.1.1-dev-e9efaa1.0.e9efaa1",
33
+ "@agoric/cosmic-proto": "0.4.1-dev-e9efaa1.0.e9efaa1",
34
+ "@agoric/ertp": "0.16.3-dev-e9efaa1.0.e9efaa1",
35
+ "@agoric/internal": "0.3.3-dev-e9efaa1.0.e9efaa1",
36
+ "@agoric/notifier": "0.6.3-dev-e9efaa1.0.e9efaa1",
37
+ "@agoric/orchestration": "0.1.1-dev-e9efaa1.0.e9efaa1",
38
+ "@agoric/zoe": "0.26.3-dev-e9efaa1.0.e9efaa1",
37
39
  "@cosmjs/proto-signing": "^0.36.0",
38
40
  "@cosmjs/stargate": "^0.36.0",
39
41
  "@endo/base64": "^1.0.12",
@@ -79,5 +81,5 @@
79
81
  "engines": {
80
82
  "node": "^20.9 || ^22.11"
81
83
  },
82
- "gitHead": "d756c838c7eb3e3cec4a8bdf5c24b97f942b754e"
84
+ "gitHead": "e9efaa12254f2c9a6faffc40ade2f1d9a70b87ae"
83
85
  }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["bin.js"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export const sendHint: "Now use `agoric wallet send ...` to sign and broadcast the offer.\n";
2
+ export function outputActionAndHint(bridgeAction: BridgeAction, { stdout, stderr }: {
3
+ stdout: Pick<Writable, "write">;
4
+ stderr: Pick<Writable, "write">;
5
+ }, marshaller?: BoardSlottingMarshaller | undefined): void;
6
+ export type BoardSlottingMarshaller = ReturnType<typeof boardSlottingMarshaller>;
7
+ import type { BridgeAction } from '@agoric/smart-wallet/src/smartWallet.js';
8
+ import type { Writable } from 'stream';
9
+ import { boardSlottingMarshaller } from '@agoric/client-utils';
10
+ //# sourceMappingURL=bridge-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-action.d.ts","sourceRoot":"","sources":["bridge-action.js"],"names":[],"mappings":"AAsBA,uBACE,qEAAqE,CAAC;AAUjE,kDAPI,YAAY,sBACZ;IACN,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAC,OAAO,CAAC,CAAC;CAChC,eACO,uBAAuB,GAAG,SAAS,QAS7C;sCA/Ba,UAAU,CAAC,OAAO,uBAAuB,CAAC;kCANzB,yCAAyC;8BAC7C,QAAQ;wCAJK,sBAAsB"}
@@ -0,0 +1,13 @@
1
+ export function initProgram(configHelpers?: typeof configLib, transferHelpers?: typeof transferLib, readFile?: typeof readAsync, writeFile?: typeof writeAsync, mkdir?: typeof mkdirSync, exists?: typeof existsSync, fetch?: typeof globalThis.fetch, stdout?: NodeJS.WriteStream & {
2
+ fd: 1;
3
+ }, stderr?: NodeJS.WriteStream & {
4
+ fd: 2;
5
+ }, env?: NodeJS.ProcessEnv, now?: () => number): Command;
6
+ import * as configLib from './config.js';
7
+ import * as transferLib from './transfer.js';
8
+ import { readFile as readAsync } from 'node:fs/promises';
9
+ import { writeFile as writeAsync } from 'node:fs/promises';
10
+ import { mkdirSync } from 'fs';
11
+ import { existsSync } from 'fs';
12
+ import { Command } from 'commander';
13
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["cli.js"],"names":[],"mappings":"AA2BO;;;;yDA4EN;2BA1F0B,aAAa;6BACX,eAAe;sCAJrC,kBAAkB;wCAAlB,kBAAkB;0BAP2B,IAAI;2BAAJ,IAAI;wBADhC,WAAW"}
@@ -0,0 +1,5 @@
1
+ export function addConfigCommands(program: Command, configHelpers: typeof ConfigHelpers, makeConfigFile: () => File): Command;
2
+ import type { Command } from 'commander';
3
+ import type * as ConfigHelpers from './config.js';
4
+ import type { File } from './util/file.js';
5
+ //# sourceMappingURL=config-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-commands.d.ts","sourceRoot":"","sources":["config-commands.js"],"names":[],"mappings":"AAWO,2CAJI,OAAO,uDAEP,MAAM,IAAI,WAkGpB;6BA1GyB,WAAW;oCAEF,aAAa;0BADzB,gBAAgB"}
@@ -0,0 +1,22 @@
1
+ export function init(configFile: File, options: ConfigOpts, out?: Console, rl?: readline.Interface): Promise<void>;
2
+ export function update(configFile: File, options: Partial<ConfigOpts>, out?: Console): Promise<void>;
3
+ export function show(configFile: File, out?: Console): Promise<void>;
4
+ export type DestinationChain = {
5
+ bech32Prefix: string;
6
+ api: string;
7
+ USDCDenom: string;
8
+ };
9
+ export type ConfigOpts = {
10
+ nobleSeed: string;
11
+ ethSeed: string;
12
+ nobleToAgoricChannel: string;
13
+ nobleApi: string;
14
+ nobleRpc: string;
15
+ ethRpc: string;
16
+ tokenMessengerAddress: string;
17
+ tokenAddress: string;
18
+ destinationChains?: DestinationChain[];
19
+ };
20
+ import type { File } from './util/file.js';
21
+ import * as readline from 'node:readline/promises';
22
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["config.js"],"names":[],"mappings":"AA2BO,iCACM,IAAI,WACJ,UAAU,yDA+BtB;AAEM,mCACM,IAAI,WACJ,OAAO,CAAC,UAAU,CAAC,gCA2B/B;AAEM,iCAA+B,IAAI,gCAazC;+BAtGY;IACT,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB;yBAIU;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAA;CACvC;0BAGuB,gBAAgB;0BAzBhB,wBAAwB"}
@@ -0,0 +1,12 @@
1
+ export function delay(ms: any): Promise<any>;
2
+ export function addLPCommands(program: Command, { fetch, smartWalletKit, stderr, stdout, env, now }: {
3
+ fetch?: Window["fetch"];
4
+ smartWalletKit?: SmartWalletKit;
5
+ stdout: typeof process.stdout;
6
+ stderr: typeof process.stderr;
7
+ env: typeof process.env;
8
+ now: typeof Date.now;
9
+ }): Command;
10
+ import type { Command } from 'commander';
11
+ import type { SmartWalletKit } from '@agoric/client-utils';
12
+ //# sourceMappingURL=lp-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lp-commands.d.ts","sourceRoot":"","sources":["lp-commands.js"],"names":[],"mappings":"AA0BO,6CAAmE;AAkCnE,uCAVI,OAAO,uDACP;IACN,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,cAAc,CAAC,EAAE,cAAc,CAAC;IACjC,MAAM,EAAE,OAAO,OAAO,CAAC,MAAM,CAAC;IAC9B,MAAM,EAAE,OAAO,OAAO,CAAC,MAAM,CAAC;IAC9B,GAAG,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC;IACxB,GAAG,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC;CACtB,WAsGH;6BA9JyB,WAAW;oCAKJ,sBAAsB"}
@@ -0,0 +1,10 @@
1
+ export function delay(ms: any): Promise<any>;
2
+ export function addOperatorCommands(program: Command, { fetch, stderr, stdout, env, now }: {
3
+ fetch: Window["fetch"];
4
+ stdout: typeof process.stdout;
5
+ stderr: typeof process.stderr;
6
+ env: typeof process.env;
7
+ now: typeof Date.now;
8
+ }): Command;
9
+ import type { Command } from 'commander';
10
+ //# sourceMappingURL=operator-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator-commands.d.ts","sourceRoot":"","sources":["operator-commands.js"],"names":[],"mappings":"AAkBO,6CAAmE;AAwBnE,6CATI,OAAO,uCACP;IACN,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,MAAM,EAAE,OAAO,OAAO,CAAC,MAAM,CAAC;IAC9B,MAAM,EAAE,OAAO,OAAO,CAAC,MAAM,CAAC;IAC9B,GAAG,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC;IACxB,GAAG,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC;CACtB,WAsGH;6BA5IyB,WAAW"}
@@ -0,0 +1,9 @@
1
+ export function transfer(configFile: File, amount: string, EUD: string, out?: typeof globalThis.console, fetch?: typeof globalThis.fetch, vstorage?: VStorage, nobleSigner?: {
2
+ signer: SigningStargateClient;
3
+ address: string;
4
+ }, ethProvider?: ethProvider, env?: typeof process.env, setTimeout?: typeof globalThis.setTimeout): Promise<void>;
5
+ import type { File } from './util/file.js';
6
+ import type { VStorage } from '@agoric/client-utils';
7
+ import type { SigningStargateClient } from '@cosmjs/stargate';
8
+ import type { JsonRpcProvider as ethProvider } from 'ethers';
9
+ //# sourceMappingURL=transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["transfer.js"],"names":[],"mappings":"AAsCO,qCAXI,IAAI,UACJ,MAAM,OACN,MAAM,QACN,OAAO,UAAU,CAAC,OAAO,UACzB,OAAO,UAAU,CAAC,KAAK,aACvB,QAAQ,gBACR;IAAC,MAAM,EAAE,qBAAqB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,gBAChD,WAAW,QACX,OAAO,OAAO,CAAC,GAAG,eAClB,OAAO,UAAU,CAAC,UAAU,iBAmHtC;0BApIwB,gBAAgB;8BAGX,sBAAsB;2CACT,kBAAkB;oDACT,QAAQ"}
@@ -0,0 +1,3 @@
1
+ export function queryFastUSDCLocalChainAccount(vstorage: VStorage, out?: Console): Promise<any>;
2
+ import type { VStorage } from '@agoric/client-utils';
3
+ //# sourceMappingURL=agoric.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agoric.d.ts","sourceRoot":"","sources":["agoric.js"],"names":[],"mappings":"AAEO,yDACM,QAAQ,+BAOpB;8BAV6B,sBAAsB"}
@@ -0,0 +1,2 @@
1
+ export function queryUSDCBalance(address: string, api: string, denom: string, fetch: typeof globalThis.fetch): Promise<bigint>;
2
+ //# sourceMappingURL=bank.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bank.d.ts","sourceRoot":"","sources":["bank.js"],"names":[],"mappings":"AAAO,0CACM,MAAM,OACN,MAAM,SACN,MAAM,SACN,OAAO,UAAU,CAAC,KAAK,mBAOnC"}
@@ -0,0 +1,5 @@
1
+ export function encodeBech32Address(address: string): string;
2
+ export function makeProvider(rpc: string): ethers.JsonRpcProvider;
3
+ export function depositForBurn(provider: ethers.JsonRpcProvider, ethSeed: string, tokenMessengerAddress: string, tokenAddress: string, destination: string, amount: string, out?: Console): Promise<void>;
4
+ import { ethers } from 'ethers';
5
+ //# sourceMappingURL=cctp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cctp.d.ts","sourceRoot":"","sources":["cctp.js"],"names":[],"mappings":"AAUO,6CAHI,MAAM,GACJ,MAAM,CAUlB;AAQM,kCAAiC,MAAM,0BACb;AAM1B,yCACM,MAAM,CAAC,eAAe,WACtB,MAAM,yBACN,MAAM,gBACN,MAAM,eACN,MAAM,UACN,MAAM,gCA+BlB;uBApEsB,QAAQ"}
@@ -0,0 +1,12 @@
1
+ export function makeFile(path: string, readFile: typeof readAsync, writeFile: typeof writeAsync, mkdir: typeof mkdirSync, pathExists: typeof existsSync): {
2
+ read: () => Promise<string>;
3
+ write: (data: string) => Promise<void>;
4
+ exists: () => boolean;
5
+ path: string;
6
+ };
7
+ export type File = ReturnType<typeof makeFile>;
8
+ import type { readFile as readAsync } from 'node:fs/promises';
9
+ import type { writeFile as writeAsync } from 'node:fs/promises';
10
+ import type { mkdirSync } from 'node:fs';
11
+ import type { existsSync } from 'node:fs';
12
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["file.js"],"names":[],"mappings":"AAOO,+BACM,MAAM;;kBAQe,MAAM;;;EAWvC;mBAEa,UAAU,CAAC,OAAO,QAAQ,CAAC;2CA3BE,kBAAkB;6CAChB,kBAAkB;+BAChC,SAAS;gCACR,SAAS"}
@@ -0,0 +1,11 @@
1
+ export function makeSigner(nobleSeed: string, nobleRpc: string, out?: Console): Promise<{
2
+ address: string;
3
+ signer: SigningStargateClient;
4
+ }>;
5
+ export function registerFwdAccount(nobleSigner: SigningStargateClient, nobleAddress: string, nobleToAgoricChannel: string, recipient: string, out?: Console): Promise<string>;
6
+ export function queryForwardingAccount(nobleApi: string, nobleToAgoricChannel: string, agoricAddr: string, out?: Console, fetch?: typeof globalThis.fetch): Promise<{
7
+ address: string;
8
+ exists: boolean;
9
+ }>;
10
+ import { SigningStargateClient } from '@cosmjs/stargate';
11
+ //# sourceMappingURL=noble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noble.d.ts","sourceRoot":"","sources":["noble.js"],"names":[],"mappings":"AAMO,sCACM,MAAM,YACN,MAAM;;;GAoBlB;AAiBM,gDACM,qBAAqB,gBACrB,MAAM,wBACN,MAAM,aACN,MAAM,kCA+BlB;AAEM,iDACM,MAAM,wBACN,MAAM,cACN,MAAM;;;GAwBlB;sCA1GiD,kBAAkB"}
@@ -0,0 +1,51 @@
1
+ export namespace Offers {
2
+ namespace fastUsdc {
3
+ export { makeDepositOffer as Deposit };
4
+ export { makeWithdrawOffer as Withdraw };
5
+ }
6
+ }
7
+ /**
8
+ * @import {USDCProposalShapes} from './pool-share-math.js';
9
+ * @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js';
10
+ * @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js';
11
+ * @import {OfferMaker} from '@agoric/smart-wallet/src/types.js';
12
+ */
13
+ /**
14
+ * @param {Pick<
15
+ * AgoricNamesRemotes,
16
+ * 'brand'
17
+ * >} agoricNames
18
+ * @param {object} opts
19
+ * @param {string} opts.offerId
20
+ * @param {bigint} opts.fastLPAmount
21
+ * @param {bigint} opts.usdcAmount
22
+ * @returns {OfferSpec & {proposal: USDCProposalShapes['deposit']}}
23
+ */
24
+ declare function makeDepositOffer({ brand }: Pick<AgoricNamesRemotes, "brand">, { offerId, fastLPAmount, usdcAmount }: {
25
+ offerId: string;
26
+ fastLPAmount: bigint;
27
+ usdcAmount: bigint;
28
+ }): OfferSpec & {
29
+ proposal: USDCProposalShapes["deposit"];
30
+ };
31
+ /**
32
+ * @param {Pick<
33
+ * AgoricNamesRemotes,
34
+ * 'brand'
35
+ * >} agoricNames
36
+ * @param {object} opts
37
+ * @param {string} opts.offerId
38
+ * @param {bigint} opts.fastLPAmount
39
+ * @param {bigint} opts.usdcAmount
40
+ * @returns {OfferSpec}
41
+ */
42
+ declare function makeWithdrawOffer({ brand }: Pick<AgoricNamesRemotes, "brand">, { offerId, fastLPAmount, usdcAmount }: {
43
+ offerId: string;
44
+ fastLPAmount: bigint;
45
+ usdcAmount: bigint;
46
+ }): OfferSpec;
47
+ import type { AgoricNamesRemotes } from '@agoric/vats/tools/board-utils.js';
48
+ import type { OfferSpec } from '@agoric/smart-wallet/src/offers.js';
49
+ import type { USDCProposalShapes } from './pool-share-math.js';
50
+ export {};
51
+ //# sourceMappingURL=clientSupport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientSupport.d.ts","sourceRoot":"","sources":["clientSupport.js"],"names":[],"mappings":";;;;;;AAGA;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,6CAVW,IAAI,CACd,kBAAsB,EACtB,OAAW,CACR,yCAED;IAAqB,OAAO,EAApB,MAAM;IACO,YAAY,EAAzB,MAAM;IACO,UAAU,EAAvB,MAAM;CACd,GAAU,SAAS,GAAG;IAAC,QAAQ,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAA;CAAC,CA6BjE;AAED;;;;;;;;;;GAUG;AACH,8CAVW,IAAI,CACd,kBAAsB,EACtB,OAAW,CACR,yCAED;IAAqB,OAAO,EAApB,MAAM;IACO,YAAY,EAAzB,MAAM;IACO,UAAU,EAAvB,MAAM;CACd,GAAU,SAAS,CA4BpB;wCAlFmC,mCAAmC;+BAC5C,oCAAoC;wCAF3B,sBAAsB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Status values for FastUSDC. Includes states for advancing and settling.
3
+ */
4
+ export type TxStatus = (typeof TxStatus)[keyof typeof TxStatus];
5
+ export namespace TxStatus {
6
+ let Observed: "OBSERVED";
7
+ let Advancing: "ADVANCING";
8
+ let Advanced: "ADVANCED";
9
+ let AdvanceFailed: "ADVANCE_FAILED";
10
+ let AdvanceSkipped: "ADVANCE_SKIPPED";
11
+ let Disbursed: "DISBURSED";
12
+ let ForwardedSkipped: "FORWARD_SKIPPED";
13
+ let Forwarded: "FORWARDED";
14
+ let ForwardFailed: "FORWARD_FAILED";
15
+ }
16
+ export namespace TerminalTxStatus {
17
+ let FORWARDED: boolean;
18
+ let FORWARD_FAILED: boolean;
19
+ let DISBURSED: boolean;
20
+ }
21
+ /**
22
+ * Status values for the StatusManager while an advance is being processed.
23
+ */
24
+ export type PendingTxStatus = (typeof PendingTxStatus)[keyof typeof PendingTxStatus];
25
+ export namespace PendingTxStatus {
26
+ let Advancing_1: "ADVANCING";
27
+ export { Advancing_1 as Advancing };
28
+ let AdvanceFailed_1: "ADVANCE_FAILED";
29
+ export { AdvanceFailed_1 as AdvanceFailed };
30
+ let Advanced_1: "ADVANCED";
31
+ export { Advanced_1 as Advanced };
32
+ let AdvanceSkipped_1: "ADVANCE_SKIPPED";
33
+ export { AdvanceSkipped_1 as AdvanceSkipped };
34
+ }
35
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":";;;uBAGU,CAAC,OAAO,QAAQ,EAAE,MAAM,OAAO,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;8BAkCxC,CAAC,OAAO,eAAe,EAAE,MAAM,OAAO,eAAe,CAAC"}
package/src/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./types.js";
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.js"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @import {Zone} from '@agoric/zone';
3
+ * @import {CctpTxEvidence, RiskAssessment} from '@agoric/fast-usdc/src/types.js';
4
+ */
5
+ /** Name in the invitation purse (keyed also by this contract instance) */
6
+ export const INVITATION_MAKERS_DESC: "oracle operator invitation";
7
+ export namespace OperatorKitI {
8
+ let admin: import("@endo/patterns").InterfaceGuard<{
9
+ disable: import("@endo/patterns").MethodGuard;
10
+ }>;
11
+ let invitationMakers: import("@endo/patterns").InterfaceGuard<{
12
+ SubmitEvidence: import("@endo/patterns").MethodGuard;
13
+ }>;
14
+ let operator: import("@endo/patterns").InterfaceGuard<{
15
+ submitEvidence: import("@endo/patterns").MethodGuard;
16
+ getStatus: import("@endo/patterns").MethodGuard;
17
+ }>;
18
+ }
19
+ //# sourceMappingURL=operator-kit-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator-kit-interface.d.ts","sourceRoot":"","sources":["operator-kit-interface.js"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,0EAA0E;AAC1E,qCAAsC,4BAA4B,CAAC"}
@@ -0,0 +1,73 @@
1
+ export function makeParity(numeratorBrand: Brand<"nat">, denominatorBrand: Brand<"nat">): import("@agoric/ertp/src/ratio.js").Ratio;
2
+ export function depositCalc(shareWorth: ShareWorth, { give, want }: USDCProposalShapes["deposit"]): {
3
+ payouts: {
4
+ PoolShare: Amount<"nat">;
5
+ };
6
+ shareWorth: ShareWorth;
7
+ };
8
+ export function checkPoolBalance(poolAlloc: Allocation, shareWorth: ShareWorth, encumberedBalance: Amount<"nat">): {
9
+ unencumberedBalance: import("@agoric/ertp").AnyAmount;
10
+ grossBalance: import("@agoric/ertp").AnyAmount;
11
+ };
12
+ export function withdrawCalc(shareWorth: ShareWorth, { give, want }: USDCProposalShapes["withdraw"], poolAlloc: Allocation, encumberedBalance?: Amount<"nat">): {
13
+ shareWorth: ShareWorth;
14
+ payouts: {
15
+ USDC: Amount<"nat">;
16
+ };
17
+ };
18
+ export function withFees(shareWorth: ShareWorth, fees: Amount<"nat">): import("@agoric/ertp/src/ratio.js").Ratio;
19
+ export function borrowCalc(requested: Amount<"nat">, poolSeatAllocation: Amount<"nat">, encumberedBalance: Amount<"nat">, poolStats: PoolStats): {
20
+ encumberedBalance: import("@agoric/ertp").NatAmount;
21
+ poolStats: {
22
+ totalBorrows: import("@agoric/ertp").NatAmount;
23
+ totalContractFees: Amount<"nat">;
24
+ totalPoolFees: Amount<"nat">;
25
+ totalRepays: Amount<"nat">;
26
+ };
27
+ };
28
+ export function repayCalc(shareWorth: ShareWorth, split: RepayAmountKWR, encumberedBalance: Amount<"nat">, poolStats: PoolStats): {
29
+ shareWorth: import("@agoric/ertp/src/ratio.js").Ratio;
30
+ encumberedBalance: import("@agoric/ertp").NatAmount;
31
+ poolStats: {
32
+ totalRepays: import("@agoric/ertp").NatAmount;
33
+ totalPoolFees: import("@agoric/ertp").NatAmount;
34
+ totalContractFees: import("@agoric/ertp").NatAmount;
35
+ totalBorrows: Amount<"nat">;
36
+ };
37
+ };
38
+ /**
39
+ * Invariant: shareWorth is the pool balance divided by shares outstanding.
40
+ *
41
+ * Use `makeParity(USDC, PoolShares)` for an initial value.
42
+ */
43
+ export type ShareWorth = Ratio;
44
+ export type USDCProposalShapes = {
45
+ deposit: {
46
+ give: {
47
+ USDC: Amount<"nat">;
48
+ };
49
+ want: {
50
+ PoolShare: Amount<"nat">;
51
+ };
52
+ };
53
+ withdraw: {
54
+ give: {
55
+ PoolShare: Amount<"nat">;
56
+ };
57
+ want: {
58
+ USDC: Amount<"nat">;
59
+ };
60
+ };
61
+ withdrawFees: {
62
+ want: {
63
+ USDC: Amount<"nat">;
64
+ };
65
+ };
66
+ };
67
+ import type { Brand } from '@agoric/ertp';
68
+ import type { Amount } from '@agoric/ertp';
69
+ import type { Allocation } from '@agoric/zoe';
70
+ import type { PoolStats } from './types.js';
71
+ import type { RepayAmountKWR } from './utils/fees.js';
72
+ import type { Ratio } from '@agoric/ertp';
73
+ //# sourceMappingURL=pool-share-math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool-share-math.d.ts","sourceRoot":"","sources":["pool-share-math.js"],"names":[],"mappings":"AAiCO,2CAHI,MAAM,KAAK,CAAC,oBACZ,MAAM,KAAK,CAAC,6CAKtB;AA2CM,wCAJI,UAAU,kBACV,kBAAkB,CAAC,SAAS,CAAC,GAC3B;IAAE,OAAO,EAAE;QAAE,SAAS,EAAE,OAAO,KAAK,CAAC,CAAA;KAAE,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,CAmB7E;AAeM,4CAJI,UAAU,cACV,UAAU,qBACV,OAAO,KAAK,CAAC;;;EAcvB;AAWM,yCANI,UAAU,kBACV,kBAAkB,CAAC,UAAU,CAAC,aAC9B,UAAU,sBACV,OAAO,KAAK,CAAC,GACX;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE;QAAE,IAAI,EAAE,OAAO,KAAK,CAAC,CAAA;KAAE,CAAA;CAAC,CAgCvE;AAMM,qCAHI,UAAU,QACV,OAAO,KAAK,CAAC,6CAKvB;AAUM,sCANI,OAAO,KAAK,CAAC,sBACb,OAAO,KAAK,CAAC,qBACb,OAAO,KAAK,CAAC,aACb,SAAS;;;;;;;;EAoBnB;AASM,sCANI,UAAU,SACV,cAAc,qBACd,OAAO,KAAK,CAAC,aACb,SAAS;;;;;;;;;EAoBnB;;;;;;yBA1MY,KAAK;iCAeL;IACR,OAAO,EAAE;QACP,IAAI,EAAE;YAAE,IAAI,EAAE,OAAO,KAAK,CAAC,CAAA;SAAE,CAAC;QAC9B,IAAI,EAAE;YAAE,SAAS,EAAE,OAAO,KAAK,CAAC,CAAA;SAAE,CAAA;KACnC,CAAC;IACF,QAAQ,EAAE;QACR,IAAI,EAAE;YAAE,SAAS,EAAE,OAAO,KAAK,CAAC,CAAA;SAAE,CAAA;QAClC,IAAI,EAAE;YAAE,IAAI,EAAE,OAAO,KAAK,CAAC,CAAA;SAAE,CAAC;KAC/B,CAAC;IACF,YAAY,EAAE;QACZ,IAAI,EAAE;YAAE,IAAI,EAAE,OAAO,KAAK,CAAC,CAAA;SAAE,CAAA;KAC9B,CAAA;CACF;2BAtCoE,cAAc;4BAAd,cAAc;gCACzD,aAAa;+BACd,YAAY;oCACP,iBAAiB;2BAHsB,cAAc"}
@@ -0,0 +1,113 @@
1
+ export function makeNatAmountShape(brand: Brand<"nat">, min?: NatValue): {
2
+ brand: Brand<"nat">;
3
+ value: import("@endo/patterns").Matcher;
4
+ };
5
+ export function makeProposalShapes({ PoolShares, USDC }: Record<"PoolShares" | "USDC", Brand<"nat">>): {
6
+ deposit: (import("@endo/pass-style").CopyRecordInterface<import("@endo/pass-style").PassableCap, Error> & {
7
+ "Symbol(validatedType)"?: {
8
+ give: {
9
+ USDC: Amount<"nat">;
10
+ };
11
+ want: {
12
+ PoolShare: Amount<"nat">;
13
+ };
14
+ } | undefined;
15
+ }) | (import("@endo/pass-style").CopyTaggedInterface<import("@endo/pass-style").PassableCap, Error> & {
16
+ "Symbol(validatedType)"?: {
17
+ give: {
18
+ USDC: Amount<"nat">;
19
+ };
20
+ want: {
21
+ PoolShare: Amount<"nat">;
22
+ };
23
+ } | undefined;
24
+ });
25
+ withdraw: (import("@endo/pass-style").CopyRecordInterface<import("@endo/pass-style").PassableCap, Error> & {
26
+ "Symbol(validatedType)"?: {
27
+ give: {
28
+ PoolShare: Amount<"nat">;
29
+ };
30
+ want: {
31
+ USDC: Amount<"nat">;
32
+ };
33
+ } | undefined;
34
+ }) | (import("@endo/pass-style").CopyTaggedInterface<import("@endo/pass-style").PassableCap, Error> & {
35
+ "Symbol(validatedType)"?: {
36
+ give: {
37
+ PoolShare: Amount<"nat">;
38
+ };
39
+ want: {
40
+ USDC: Amount<"nat">;
41
+ };
42
+ } | undefined;
43
+ });
44
+ withdrawFees: (import("@endo/pass-style").CopyRecordInterface<import("@endo/pass-style").PassableCap, Error> & {
45
+ "Symbol(validatedType)"?: {
46
+ want: {
47
+ USDC: Amount<"nat">;
48
+ };
49
+ } | undefined;
50
+ }) | (import("@endo/pass-style").CopyTaggedInterface<import("@endo/pass-style").PassableCap, Error> & {
51
+ "Symbol(validatedType)"?: {
52
+ want: {
53
+ USDC: Amount<"nat">;
54
+ };
55
+ } | undefined;
56
+ });
57
+ };
58
+ /** @type {TypedPattern<FastUsdcTerms>} */
59
+ export const FastUSDCTermsShape: TypedPattern<FastUsdcTerms>;
60
+ /** @type {TypedPattern<EvmAddress>} */
61
+ export const EvmAddressShape: TypedPattern<EvmAddress>;
62
+ /** @type {TypedPattern<EvmHash>} */
63
+ export const EvmHashShape: TypedPattern<EvmHash>;
64
+ /** @type {TypedPattern<RiskAssessment>} */
65
+ export const RiskAssessmentShape: TypedPattern<RiskAssessment>;
66
+ /** @type {TypedPattern<CctpTxEvidence>} */
67
+ export const CctpTxEvidenceShape: TypedPattern<CctpTxEvidence>;
68
+ /** @type {TypedPattern<EvidenceWithRisk>} */
69
+ export const EvidenceWithRiskShape: TypedPattern<EvidenceWithRisk>;
70
+ /** @type {TypedPattern<PendingTx>} */
71
+ export const PendingTxShape: TypedPattern<PendingTx>;
72
+ /** @type {TypedPattern<AddressHook>} */
73
+ export const AddressHookShape: TypedPattern<AddressHook>;
74
+ /** @type {TypedPattern<FeeConfig['destinationOverrides']>} */
75
+ export const DestinationOverridesShape: TypedPattern<FeeConfig["destinationOverrides"]>;
76
+ /** @type {TypedPattern<FeeConfig>} */
77
+ export const FeeConfigShape: TypedPattern<FeeConfig>;
78
+ /** @type {TypedPattern<PoolMetrics>} */
79
+ export const PoolMetricsShape: TypedPattern<PoolMetrics>;
80
+ /** @type {TypedPattern<ChainPolicy>} */
81
+ export const ChainPolicyShape: TypedPattern<ChainPolicy>;
82
+ /**
83
+ * @type {TypedPattern<FeedPolicy>}
84
+ *
85
+ * must be CopyData; no Brands or other Remotables
86
+ */
87
+ export const FeedPolicyShape: TypedPattern<FeedPolicy>;
88
+ /**
89
+ * The version of CosmosChainInfoShape that matches the `valueShape` used in FUSDC's ChainHub's `chainInfos` mapStore.
90
+ * @type {TypedPattern<CosmosChainInfo>}
91
+ */
92
+ export const CosmosChainInfoShapeV1: TypedPattern<CosmosChainInfo>;
93
+ /** @type {TypedPattern<FastUSDCConfig>} */
94
+ export const FastUSDCConfigShape: TypedPattern<FastUSDCConfig>;
95
+ import type { Brand } from '@agoric/ertp';
96
+ import type { NatValue } from '@agoric/ertp';
97
+ import type { Amount } from '@agoric/ertp';
98
+ import type { FastUsdcTerms } from './types.js';
99
+ import type { TypedPattern } from '@agoric/internal';
100
+ import type { EvmAddress } from './types.js';
101
+ import type { EvmHash } from './types.js';
102
+ import type { RiskAssessment } from './types.js';
103
+ import type { CctpTxEvidence } from './types.js';
104
+ import type { EvidenceWithRisk } from './types.js';
105
+ import type { PendingTx } from './types.js';
106
+ import type { AddressHook } from './types.js';
107
+ import type { FeeConfig } from './types.js';
108
+ import type { PoolMetrics } from './types.js';
109
+ import type { ChainPolicy } from './types.js';
110
+ import type { FeedPolicy } from './types.js';
111
+ import type { CosmosChainInfo } from '@agoric/orchestration';
112
+ import type { FastUSDCConfig } from './types.js';
113
+ //# sourceMappingURL=type-guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["type-guards.js"],"names":[],"mappings":"AAoBO,0CAHI,MAAM,KAAK,CAAC,QACZ,QAAQ;;;EAGmC;AAG/C,yDADK,MAAM,CAAC,YAAY,GAAG,MAAM,EAAE,MAAM,KAAK,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBtD;AAED,0CAA0C;AAC1C,iCADW,aAAa,aAAa,CAAC,CAGnC;AAEH,uCAAuC;AACvC,8BADW,aAAa,UAAU,CAAC,CAIhC;AAGH,oCAAoC;AACpC,2BADW,aAAa,OAAO,CAAC,CAG7B;AAGH,2CAA2C;AAC3C,kCADW,aAAa,cAAc,CAAC,CAMrC;AAGF,2CAA2C;AAC3C,kCADW,aAAa,cAAc,CAAC,CAgBrC;AAGF,6CAA6C;AAC7C,oCADW,aAAa,gBAAgB,CAAC,CAIvC;AAGF,sCAAsC;AAEtC,6BAFW,aAAa,SAAS,CAAC,CAKhC;AAGF,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CAIlC;AAKF,8DAA8D;AAC9D,wCADW,aAAa,SAAS,CAAC,sBAAsB,CAAC,CAAC,CAYxD;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CAYhC;AAEF,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CAQlC;AAGF,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CAelC;AAGF;;;;GAIG;AACH,8BAJU,aAAa,UAAU,CAAC,CAWhC;AAGF;;;GAGG;AACH,qCAFU,aAAa,eAAe,CAAC,CAcrC;AAEF,2CAA2C;AAC3C,kCADW,aAAa,cAAc,CAAC,CAQpC;2BAzMgD,cAAc;8BAAd,cAAc;4BAAd,cAAc;mCAI+H,YAAY;kCAH7K,kBAAkB;gCAG+I,YAAY;6BAAZ,YAAY;oCAAZ,YAAY;oCAAZ,YAAY;sCAAZ,YAAY;+BAAZ,YAAY;iCAAZ,YAAY;+BAAZ,YAAY;iCAAZ,YAAY;iCAAZ,YAAY;gCAAZ,YAAY;qCAFhG,uBAAuB;oCAE6D,YAAY"}
package/src/types.d.ts ADDED
@@ -0,0 +1,164 @@
1
+ import type { Amount } from '@agoric/ertp';
2
+ import type { AccountId, BaseChainInfo, Bech32Address, CaipChainId, CosmosChainAddress, CosmosChainInfo, Denom, DenomDetail, KnownNamespace } from '@agoric/orchestration';
3
+ import type { IBCChannelID } from '@agoric/vats';
4
+ import type { CopyRecord } from '@endo/pass-style';
5
+ import type { PendingTxStatus, TxStatus } from './constants.js';
6
+ import type { RepayAmountKWR } from './utils/fees.js';
7
+ type Ratio = {
8
+ numerator: Amount<'nat'>;
9
+ denominator: Amount<'nat'>;
10
+ };
11
+ /**
12
+ * Block hash is calculated using the keccak256 algorithm that always results
13
+ * in 32 bytes (64 hex characters prepended by 0x) no matter the input length.
14
+ */
15
+ export type EvmHash = `0x${string}`;
16
+ /**
17
+ * An address is always the last 20 bytes (40 hex charaters prepended by 0x) of
18
+ * the public key hash.
19
+ */
20
+ export type EvmAddress = `0x${string & {
21
+ length: 40;
22
+ }}`;
23
+ export type NobleAddress = `noble1${string}`;
24
+ export type EvmChainID = number;
25
+ export type EvmChainName = string;
26
+ export interface RiskAssessment {
27
+ risksIdentified?: string[];
28
+ }
29
+ export interface CctpTxEvidence {
30
+ /** from Noble RPC */
31
+ aux: {
32
+ forwardingChannel: IBCChannelID;
33
+ recipientAddress: CosmosChainAddress['value'] | AccountId;
34
+ };
35
+ /** on the source chain (e.g. L1 Ethereum and L2s Arbitrum, Base) */
36
+ blockHash: EvmHash;
37
+ /** height of blockHash on the source chain */
38
+ blockNumber: bigint;
39
+ /**
40
+ * Seconds since Unix epoch. Not all CCTP source chains update time the same
41
+ * way but they all use Unix epoch and thus are approximately equal. (Within
42
+ * minutes apart.)
43
+ */
44
+ blockTimestamp: bigint;
45
+ /**
46
+ * [Domain of values](https://chainid.network/) per [EIP-155](https://eips.ethereum.org/EIPS/eip-155)
47
+ * (We don't have [CCTP `domain`](https://developers.circle.com/stablecoins/supported-domains) )
48
+ */
49
+ chainId: number;
50
+ /** data covered by signature (aka txHash) */
51
+ tx: {
52
+ amount: bigint;
53
+ forwardingAddress: NobleAddress;
54
+ sender: EvmAddress;
55
+ };
56
+ txHash: EvmHash;
57
+ }
58
+ export interface EvidenceWithRisk extends CopyRecord {
59
+ evidence: CctpTxEvidence;
60
+ risk: RiskAssessment;
61
+ }
62
+ /**
63
+ * 'evidence' only available when it's first observed and not in subsequent
64
+ * updates.
65
+ */
66
+ export interface TransactionRecord extends CopyRecord {
67
+ evidence?: CctpTxEvidence;
68
+ split?: RepayAmountKWR;
69
+ risksIdentified?: string[];
70
+ status: TxStatus;
71
+ }
72
+ /** the record in vstorage at the path of the contract's node */
73
+ export interface ContractRecord extends CopyRecord {
74
+ nobleICA?: CosmosChainAddress['value'];
75
+ poolAccount: CosmosChainAddress['value'];
76
+ settlementAccount: CosmosChainAddress['value'];
77
+ }
78
+ export type LogFn = (...args: unknown[]) => void;
79
+ export interface PendingTx extends CctpTxEvidence {
80
+ status: PendingTxStatus;
81
+ }
82
+ export type FeeConfig = {
83
+ /** flat fee charged for every advance, eligible for LP disbursement */
84
+ flat: Amount<'nat'>;
85
+ /** proportion of advance kept as a fee, eligible for LP disbursement */
86
+ variableRate: Ratio;
87
+ /** proportion of `flat` and `variableRate` fees that goes to the contract (remaining goes to LPs) */
88
+ contractRate: Ratio;
89
+ /**
90
+ * if present, a fee required to relay (e.g. CCTP to EVM/Solana). Not
91
+ * considered for LP disbursement - goes to `contractSeat`.
92
+ */
93
+ relay?: Amount<'nat'>;
94
+ /** Optional destination-specific overrides. If present, must supersede base values. */
95
+ destinationOverrides?: Record<CaipChainId, Partial<Omit<FeeConfig, 'destinationOverrides'>>>;
96
+ };
97
+ export interface PoolStats {
98
+ totalBorrows: Amount<'nat'>;
99
+ totalContractFees: Amount<'nat'>;
100
+ totalPoolFees: Amount<'nat'>;
101
+ totalRepays: Amount<'nat'>;
102
+ }
103
+ export interface PoolMetrics extends PoolStats {
104
+ encumberedBalance: Amount<'nat'>;
105
+ shareWorth: Ratio;
106
+ }
107
+ export interface ChainPolicy {
108
+ /** `msg.sender` of DepositAndBurn to TokenMessenger must be an attenuated wrapper contract that does not contain `replaceDepositForBurn` */
109
+ attenuatedCttpBridgeAddresses: EvmHash[];
110
+ /** @see {@link https://developers.circle.com/stablecoins/evm-smart-contracts} */
111
+ cctpTokenMessengerAddress: EvmHash;
112
+ /** e.g., `1` for ETH mainnet 42161 for Arbitrum One. @see {@link https://chainlist.org/} */
113
+ chainId: EvmChainID;
114
+ /** the number of block confirmations to observe before reporting */
115
+ confirmations: number;
116
+ rateLimits: {
117
+ /** do not advance more than this amount for an individual transaction */
118
+ tx: bigint;
119
+ /** do not advance more than this amount per block window */
120
+ blockWindow: bigint;
121
+ /** the number of blocks to consider for `blockWindow` */
122
+ blockWindowSize: number;
123
+ };
124
+ }
125
+ export type FeedPolicy = {
126
+ nobleDomainId: number;
127
+ nobleAgoricChannelId: string;
128
+ chainPolicies: Record<EvmChainName, ChainPolicy>;
129
+ eventFilter?: string;
130
+ } & CopyRecord;
131
+ export type FastUsdcTerms = {
132
+ usdcDenom: Denom;
133
+ };
134
+ export type FastUSDCConfig = {
135
+ terms: FastUsdcTerms;
136
+ oracles: Record<string, string>;
137
+ feeConfig: FeeConfig;
138
+ feedPolicy: FeedPolicy;
139
+ noNoble: boolean;
140
+ chainInfo: Record<string, ChainHubChainInfo>;
141
+ assetInfo: [Denom, DenomDetail & {
142
+ brandKey?: string;
143
+ }][];
144
+ } & CopyRecord;
145
+ /** decoded address hook parameters */
146
+ export type AddressHook = {
147
+ baseAddress: string;
148
+ query: {
149
+ /** end user destination address */
150
+ EUD: Bech32Address;
151
+ };
152
+ };
153
+ /**
154
+ * The shape of ChainInfo ChainHub is expecting for FUSDC.
155
+ *
156
+ * Note: this diverges from `CosmosChainInfo` and `BaseChainInfo` in that:
157
+ * - BaseChainInfo includes chainId for backwards compatibility with `CosmosChainInfoShapeV1`
158
+ */
159
+ export type ChainHubChainInfo<N extends KnownNamespace = KnownNamespace> = N extends 'cosmos' ? CosmosChainInfo : BaseChainInfoWithChainId<N>;
160
+ interface BaseChainInfoWithChainId<N extends KnownNamespace = KnownNamespace> extends BaseChainInfo<N> {
161
+ chainId: string;
162
+ }
163
+ export type * from './constants.js';
164
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"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"}
package/src/types.js ADDED
@@ -0,0 +1,197 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+ // XXX duped with Zoe contractSupport ambient types
19
+
20
+
21
+
22
+
23
+
24
+ /**
25
+ * Block hash is calculated using the keccak256 algorithm that always results
26
+ * in 32 bytes (64 hex characters prepended by 0x) no matter the input length.
27
+ */
28
+
29
+ /**
30
+ * An address is always the last 20 bytes (40 hex charaters prepended by 0x) of
31
+ * the public key hash.
32
+ */
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ /**
79
+ * 'evidence' only available when it's first observed and not in subsequent
80
+ * updates.
81
+ */
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ /** the record in vstorage at the path of the contract's node */
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ /** decoded address hook parameters */
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+ /**
183
+ * The shape of ChainInfo ChainHub is expecting for FUSDC.
184
+ *
185
+ * Note: this diverges from `CosmosChainInfo` and `BaseChainInfo` in that:
186
+ * - BaseChainInfo includes chainId for backwards compatibility with `CosmosChainInfoShapeV1`
187
+ */
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
@@ -0,0 +1,64 @@
1
+ export function makeFeeTools(feeConfig: FeeConfig): {
2
+ /**
3
+ * Calculate the base fee to charge for the advance (variable + flat).
4
+ * Will be shared between the pool and the contract based on
5
+ * {@link FeeConfig.contractRate}.
6
+ *
7
+ * @param {Amount<'nat'>} requested
8
+ * @param {AccountId} destination
9
+ * @returns {Amount<'nat'>}
10
+ */
11
+ calculateBaseFee(requested: Amount<"nat">, destination: AccountId): Amount<"nat">;
12
+ /**
13
+ * Calculate the optional relay fee charged for certain destinations.
14
+ * Only disbursed to contract seat.
15
+ *
16
+ * @param {AccountId} destination
17
+ * @returns {Amount<'nat'>}
18
+ */
19
+ calculateRelayFee(destination: AccountId): Amount<"nat">;
20
+ /**
21
+ * Calculate the total fee to charge for the advance.
22
+ *
23
+ * @param {Amount<'nat'>} requested
24
+ * @param {AccountId} destination
25
+ * @throws {Error} if requested does not exceed fees
26
+ */
27
+ calculateAdvanceFee(requested: Amount<"nat">, destination: AccountId): import("@agoric/ertp").NatAmount;
28
+ /**
29
+ * Calculate the net amount to advance after withholding fees.
30
+ *
31
+ * @param {Amount<'nat'>} requested
32
+ * @param {AccountId} destination
33
+ * @throws {Error} if requested does not exceed fees
34
+ */
35
+ calculateAdvance(requested: Amount<"nat">, destination: AccountId): import("@agoric/ertp").NatAmount;
36
+ /**
37
+ * Calculate the split of fees between pool and contract.
38
+ *
39
+ * The `ContractFee` includes base fees plus the relay fee.
40
+ *
41
+ * @param {Amount<'nat'>} requested
42
+ * @param {AccountId} destination
43
+ * @returns {RepayAmountKWR} an {@link AmountKeywordRecord}
44
+ * @throws {Error} if requested does not exceed fees
45
+ */
46
+ calculateSplit(requested: Amount<"nat">, destination: AccountId): RepayAmountKWR;
47
+ };
48
+ export type RepayAmountKWR = {
49
+ Principal: Amount<"nat">;
50
+ PoolFee: Amount<"nat">;
51
+ ContractFee: Amount<"nat">;
52
+ RelayFee: Amount<"nat">;
53
+ };
54
+ export type RepayPaymentKWR = {
55
+ Principal: Payment<"nat">;
56
+ PoolFee: Payment<"nat">;
57
+ ContractFee: Payment<"nat">;
58
+ RelayFee: Payment<"nat">;
59
+ };
60
+ import type { FeeConfig } from '../types.js';
61
+ import type { Amount } from '@agoric/ertp';
62
+ import type { AccountId } from '@agoric/orchestration';
63
+ import type { Payment } from '@agoric/ertp';
64
+ //# sourceMappingURL=fees.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["fees.js"],"names":[],"mappings":"AAsDO,wCAFI,SAAS;IAOhB;;;;;;;;OAQG;gCAHQ,OAAO,KAAK,CAAC,eACb,SAAS,GACP,OAAO,KAAK,CAAC;IAW1B;;;;;;OAMG;mCAFQ,SAAS,GACP,OAAO,KAAK,CAAC;IAM1B;;;;;;OAMG;mCAHQ,OAAO,KAAK,CAAC,eACb,SAAS;IAUpB;;;;;;OAMG;gCAHQ,OAAO,KAAK,CAAC,eACb,SAAS;IAOpB;;;;;;;;;OASG;8BAJQ,OAAO,KAAK,CAAC,eACb,SAAS,GACP,cAAc;EAsB9B;6BA9HY;IACT,SAAS,EAAE,OAAO,KAAK,CAAC,CAAC;IACzB,OAAO,EAAE,OAAO,KAAK,CAAC,CAAC;IACvB,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC;IAC3B,QAAQ,EAAE,OAAO,KAAK,CAAC,CAAC;CACxB;8BAIS;IACT,SAAS,EAAE,QAAQ,KAAK,CAAC,CAAC;IAC1B,OAAO,EAAE,QAAQ,KAAK,CAAC,CAAC;IACxB,WAAW,EAAE,QAAQ,KAAK,CAAC,CAAC;IAC5B,QAAQ,EAAE,QAAQ,KAAK,CAAC,CAAC;CACzB;+BAlBwB,aAAa;4BAFP,cAAc;+BACpB,uBAAuB;6BADjB,cAAc"}
package/src/types.ts DELETED
@@ -1,197 +0,0 @@
1
- import type { Amount } from '@agoric/ertp';
2
- import type {
3
- AccountId,
4
- BaseChainInfo,
5
- Bech32Address,
6
- CaipChainId,
7
- CosmosChainAddress,
8
- CosmosChainInfo,
9
- Denom,
10
- DenomDetail,
11
- KnownNamespace,
12
- } from '@agoric/orchestration';
13
- import type { IBCChannelID } from '@agoric/vats';
14
- import type { CopyRecord } from '@endo/pass-style';
15
- import type { PendingTxStatus, TxStatus } from './constants.js';
16
- import type { RepayAmountKWR } from './utils/fees.js';
17
-
18
- // XXX duped with Zoe contractSupport ambient types
19
- type Ratio = {
20
- numerator: Amount<'nat'>;
21
- denominator: Amount<'nat'>;
22
- };
23
-
24
- /**
25
- * Block hash is calculated using the keccak256 algorithm that always results
26
- * in 32 bytes (64 hex characters prepended by 0x) no matter the input length.
27
- */
28
- export type EvmHash = `0x${string}`;
29
- /**
30
- * An address is always the last 20 bytes (40 hex charaters prepended by 0x) of
31
- * the public key hash.
32
- */
33
- export type EvmAddress = `0x${string & { length: 40 }}`;
34
- export type NobleAddress = `noble1${string}`;
35
- export type EvmChainID = number;
36
- export type EvmChainName = string;
37
-
38
- export interface RiskAssessment {
39
- risksIdentified?: string[];
40
- }
41
-
42
- export interface CctpTxEvidence {
43
- /** from Noble RPC */
44
- aux: {
45
- forwardingChannel: IBCChannelID;
46
- recipientAddress: CosmosChainAddress['value'] | AccountId;
47
- };
48
- /** on the source chain (e.g. L1 Ethereum and L2s Arbitrum, Base) */
49
- blockHash: EvmHash;
50
- /** height of blockHash on the source chain */
51
- blockNumber: bigint;
52
- /**
53
- * Seconds since Unix epoch. Not all CCTP source chains update time the same
54
- * way but they all use Unix epoch and thus are approximately equal. (Within
55
- * minutes apart.)
56
- */
57
- blockTimestamp: bigint;
58
- //
59
- /**
60
- * [Domain of values](https://chainid.network/) per [EIP-155](https://eips.ethereum.org/EIPS/eip-155)
61
- * (We don't have [CCTP `domain`](https://developers.circle.com/stablecoins/supported-domains) )
62
- */
63
- chainId: number;
64
- /** data covered by signature (aka txHash) */
65
- tx: {
66
- amount: bigint;
67
- forwardingAddress: NobleAddress;
68
- sender: EvmAddress;
69
- };
70
- txHash: EvmHash;
71
- }
72
-
73
- export interface EvidenceWithRisk extends CopyRecord {
74
- evidence: CctpTxEvidence;
75
- risk: RiskAssessment;
76
- }
77
-
78
- /**
79
- * 'evidence' only available when it's first observed and not in subsequent
80
- * updates.
81
- */
82
- export interface TransactionRecord extends CopyRecord {
83
- evidence?: CctpTxEvidence;
84
- split?: RepayAmountKWR;
85
- risksIdentified?: string[];
86
- status: TxStatus;
87
- }
88
-
89
- /** the record in vstorage at the path of the contract's node */
90
- export interface ContractRecord extends CopyRecord {
91
- nobleICA?: CosmosChainAddress['value'];
92
- poolAccount: CosmosChainAddress['value'];
93
- settlementAccount: CosmosChainAddress['value'];
94
- }
95
-
96
- export type LogFn = (...args: unknown[]) => void;
97
-
98
- export interface PendingTx extends CctpTxEvidence {
99
- status: PendingTxStatus;
100
- }
101
-
102
- export type FeeConfig = {
103
- /** flat fee charged for every advance, eligible for LP disbursement */
104
- flat: Amount<'nat'>;
105
- /** proportion of advance kept as a fee, eligible for LP disbursement */
106
- variableRate: Ratio;
107
- /** proportion of `flat` and `variableRate` fees that goes to the contract (remaining goes to LPs) */
108
- contractRate: Ratio;
109
- /**
110
- * if present, a fee required to relay (e.g. CCTP to EVM/Solana). Not
111
- * considered for LP disbursement - goes to `contractSeat`.
112
- */
113
- relay?: Amount<'nat'>;
114
- /** Optional destination-specific overrides. If present, must supersede base values. */
115
- destinationOverrides?: Record<
116
- CaipChainId,
117
- Partial<Omit<FeeConfig, 'destinationOverrides'>>
118
- >;
119
- };
120
-
121
- export interface PoolStats {
122
- totalBorrows: Amount<'nat'>;
123
- totalContractFees: Amount<'nat'>;
124
- totalPoolFees: Amount<'nat'>;
125
- totalRepays: Amount<'nat'>;
126
- }
127
-
128
- export interface PoolMetrics extends PoolStats {
129
- encumberedBalance: Amount<'nat'>;
130
- shareWorth: Ratio;
131
- }
132
-
133
- export interface ChainPolicy {
134
- /** `msg.sender` of DepositAndBurn to TokenMessenger must be an attenuated wrapper contract that does not contain `replaceDepositForBurn` */
135
- attenuatedCttpBridgeAddresses: EvmHash[];
136
- /** @see {@link https://developers.circle.com/stablecoins/evm-smart-contracts} */
137
- cctpTokenMessengerAddress: EvmHash;
138
- /** e.g., `1` for ETH mainnet 42161 for Arbitrum One. @see {@link https://chainlist.org/} */
139
- chainId: EvmChainID;
140
- /** the number of block confirmations to observe before reporting */
141
- confirmations: number;
142
- rateLimits: {
143
- /** do not advance more than this amount for an individual transaction */
144
- tx: bigint;
145
- /** do not advance more than this amount per block window */
146
- blockWindow: bigint;
147
- /** the number of blocks to consider for `blockWindow` */
148
- blockWindowSize: number;
149
- };
150
- }
151
-
152
- export type FeedPolicy = {
153
- nobleDomainId: number;
154
- nobleAgoricChannelId: string;
155
- chainPolicies: Record<EvmChainName, ChainPolicy>;
156
- eventFilter?: string;
157
- } & CopyRecord;
158
-
159
- export type FastUsdcTerms = {
160
- usdcDenom: Denom;
161
- };
162
-
163
- export type FastUSDCConfig = {
164
- terms: FastUsdcTerms;
165
- oracles: Record<string, string>;
166
- feeConfig: FeeConfig;
167
- feedPolicy: FeedPolicy;
168
- noNoble: boolean; // support a3p-integration, which has no noble chain
169
- chainInfo: Record<string, ChainHubChainInfo>;
170
- assetInfo: [Denom, DenomDetail & { brandKey?: string }][];
171
- } & CopyRecord;
172
-
173
- /** decoded address hook parameters */
174
- export type AddressHook = {
175
- baseAddress: string;
176
- query: {
177
- /** end user destination address */
178
- EUD: Bech32Address;
179
- };
180
- };
181
-
182
- /**
183
- * The shape of ChainInfo ChainHub is expecting for FUSDC.
184
- *
185
- * Note: this diverges from `CosmosChainInfo` and `BaseChainInfo` in that:
186
- * - BaseChainInfo includes chainId for backwards compatibility with `CosmosChainInfoShapeV1`
187
- */
188
- export type ChainHubChainInfo<N extends KnownNamespace = KnownNamespace> =
189
- N extends 'cosmos' ? CosmosChainInfo : BaseChainInfoWithChainId<N>;
190
-
191
- interface BaseChainInfoWithChainId<
192
- N extends KnownNamespace = KnownNamespace,
193
- > extends BaseChainInfo<N> {
194
- chainId: string;
195
- }
196
-
197
- export type * from './constants.js';