@agoric/vats 0.15.1 → 0.15.2-calypso-dev-84eb287.0

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 (208) hide show
  1. package/README.md +3 -0
  2. package/index.d.ts +6 -0
  3. package/index.d.ts.map +1 -0
  4. package/index.js +9 -0
  5. package/package.json +43 -48
  6. package/scripts/build-bundles.js +19 -0
  7. package/src/bridge-target.d.ts +193 -0
  8. package/src/bridge-target.d.ts.map +1 -0
  9. package/src/bridge-target.js +316 -0
  10. package/src/bridge.d.ts +14 -4
  11. package/src/bridge.d.ts.map +1 -1
  12. package/src/bridge.js +45 -16
  13. package/src/centralSupply.d.ts +3 -3
  14. package/src/centralSupply.d.ts.map +1 -1
  15. package/src/centralSupply.js +3 -5
  16. package/src/core/README.md +1 -1
  17. package/src/core/basic-behaviors.d.ts +24 -39
  18. package/src/core/basic-behaviors.d.ts.map +1 -1
  19. package/src/core/basic-behaviors.js +63 -63
  20. package/src/core/boot-chain.d.ts +178 -44
  21. package/src/core/boot-chain.d.ts.map +1 -1
  22. package/src/core/boot-chain.js +5 -5
  23. package/src/core/boot-sim.d.ts +5 -43
  24. package/src/core/boot-sim.d.ts.map +1 -1
  25. package/src/core/boot-sim.js +3 -4
  26. package/src/core/boot-solo.d.ts +5 -43
  27. package/src/core/boot-solo.d.ts.map +1 -1
  28. package/src/core/boot-solo.js +4 -5
  29. package/src/core/chain-behaviors.d.ts +10 -26
  30. package/src/core/chain-behaviors.d.ts.map +1 -1
  31. package/src/core/chain-behaviors.js +38 -42
  32. package/src/core/client-behaviors.d.ts +2 -1
  33. package/src/core/client-behaviors.d.ts.map +1 -1
  34. package/src/core/client-behaviors.js +6 -5
  35. package/src/core/core-eval-env.d.ts +40 -0
  36. package/src/core/demoIssuers.d.ts +24 -26
  37. package/src/core/demoIssuers.d.ts.map +1 -1
  38. package/src/core/demoIssuers.js +37 -37
  39. package/src/core/lib-boot.d.ts +17 -53
  40. package/src/core/lib-boot.d.ts.map +1 -1
  41. package/src/core/lib-boot.js +52 -60
  42. package/src/core/promise-space.d.ts +4 -7
  43. package/src/core/promise-space.d.ts.map +1 -1
  44. package/src/core/promise-space.js +15 -16
  45. package/src/core/sim-behaviors.d.ts +3 -3
  46. package/src/core/sim-behaviors.d.ts.map +1 -1
  47. package/src/core/sim-behaviors.js +1 -1
  48. package/src/core/startWalletFactory.d.ts +23 -27
  49. package/src/core/startWalletFactory.d.ts.map +1 -1
  50. package/src/core/startWalletFactory.js +32 -18
  51. package/src/core/types-ambient.d.ts +538 -0
  52. package/src/core/types-ambient.js +1 -0
  53. package/src/core/utils.d.ts +47 -92
  54. package/src/core/utils.d.ts.map +1 -1
  55. package/src/core/utils.js +58 -50
  56. package/src/crc.d.ts +2 -6
  57. package/src/crc.d.ts.map +1 -1
  58. package/src/crc.js +5 -16
  59. package/src/ibc.d.ts +30 -35
  60. package/src/ibc.d.ts.map +1 -1
  61. package/src/ibc.js +740 -491
  62. package/src/lib-board.d.ts +49 -121
  63. package/src/lib-board.d.ts.map +1 -1
  64. package/src/lib-board.js +49 -50
  65. package/src/localchain.d.ts +195 -0
  66. package/src/localchain.d.ts.map +1 -0
  67. package/src/localchain.js +324 -0
  68. package/src/mintHolder.d.ts +6 -4
  69. package/src/mintHolder.d.ts.map +1 -1
  70. package/src/mintHolder.js +19 -21
  71. package/src/nameHub.d.ts +27 -5
  72. package/src/nameHub.d.ts.map +1 -1
  73. package/src/nameHub.js +33 -26
  74. package/src/priceAuthorityRegistry.d.ts +21 -0
  75. package/src/priceAuthorityRegistry.d.ts.map +1 -0
  76. package/src/priceAuthorityRegistry.js +220 -0
  77. package/src/proposals/kread-proposal.d.ts +15 -0
  78. package/src/proposals/kread-proposal.d.ts.map +1 -0
  79. package/src/proposals/kread-proposal.js +24 -0
  80. package/src/proposals/localchain-proposal.d.ts +62 -0
  81. package/src/proposals/localchain-proposal.d.ts.map +1 -0
  82. package/src/proposals/localchain-proposal.js +128 -0
  83. package/src/proposals/localchain-test.d.ts +25 -0
  84. package/src/proposals/localchain-test.d.ts.map +1 -0
  85. package/src/proposals/localchain-test.js +89 -0
  86. package/src/proposals/namesByAddress-fix-proposal.d.ts +22 -0
  87. package/src/proposals/namesByAddress-fix-proposal.d.ts.map +1 -0
  88. package/src/proposals/namesByAddress-fix-proposal.js +55 -0
  89. package/src/proposals/network-proposal.d.ts +23 -8
  90. package/src/proposals/network-proposal.d.ts.map +1 -1
  91. package/src/proposals/network-proposal.js +90 -65
  92. package/src/proposals/probeZcfBundle.d.ts +26 -0
  93. package/src/proposals/probeZcfBundle.d.ts.map +1 -0
  94. package/src/proposals/probeZcfBundle.js +72 -0
  95. package/src/proposals/restart-vats-proposal.d.ts +4 -2
  96. package/src/proposals/restart-vats-proposal.d.ts.map +1 -1
  97. package/src/proposals/restart-vats-proposal.js +20 -8
  98. package/src/proposals/transfer-proposal.d.ts +37 -0
  99. package/src/proposals/transfer-proposal.d.ts.map +1 -0
  100. package/src/proposals/transfer-proposal.js +115 -0
  101. package/src/proposals/upgrade-bank-proposal.d.ts +27 -0
  102. package/src/proposals/upgrade-bank-proposal.d.ts.map +1 -0
  103. package/src/proposals/upgrade-bank-proposal.js +42 -0
  104. package/src/proposals/upgrade-provisionPool-proposal.d.ts +27 -0
  105. package/src/proposals/upgrade-provisionPool-proposal.d.ts.map +1 -0
  106. package/src/proposals/upgrade-provisionPool-proposal.js +67 -0
  107. package/src/proposals/upgrade-zoe-proposal.d.ts +27 -0
  108. package/src/proposals/upgrade-zoe-proposal.d.ts.map +1 -0
  109. package/src/proposals/upgrade-zoe-proposal.js +42 -0
  110. package/src/proposals/vtransfer-echoer.d.ts +24 -0
  111. package/src/proposals/vtransfer-echoer.d.ts.map +1 -0
  112. package/src/proposals/vtransfer-echoer.js +42 -0
  113. package/src/proposals/zcf-only-proposal.d.ts +33 -0
  114. package/src/proposals/zcf-only-proposal.d.ts.map +1 -0
  115. package/src/proposals/zcf-only-proposal.js +36 -0
  116. package/src/proposals/zcf-proposal.d.ts +30 -0
  117. package/src/proposals/zcf-proposal.d.ts.map +1 -0
  118. package/src/proposals/zcf-proposal.js +50 -0
  119. package/src/repl.d.ts +3 -3
  120. package/src/repl.d.ts.map +1 -1
  121. package/src/repl.js +11 -5
  122. package/src/transfer.d.ts +111 -0
  123. package/src/transfer.d.ts.map +1 -0
  124. package/src/transfer.js +260 -0
  125. package/src/types.d.ts +237 -105
  126. package/src/types.js +1 -97
  127. package/src/vat-agoricNames.d.ts +4 -4
  128. package/src/vat-agoricNames.d.ts.map +1 -1
  129. package/src/vat-agoricNames.js +2 -4
  130. package/src/vat-bank.d.ts +217 -149
  131. package/src/vat-bank.d.ts.map +1 -1
  132. package/src/vat-bank.js +96 -68
  133. package/src/vat-board.d.ts +24 -24
  134. package/src/vat-board.d.ts.map +1 -1
  135. package/src/vat-board.js +0 -1
  136. package/src/vat-bridge.d.ts +9 -23
  137. package/src/vat-bridge.d.ts.map +1 -1
  138. package/src/vat-bridge.js +1 -2
  139. package/src/vat-ibc.d.ts +16 -4
  140. package/src/vat-ibc.d.ts.map +1 -1
  141. package/src/vat-ibc.js +20 -9
  142. package/src/vat-localchain.d.ts +37 -0
  143. package/src/vat-localchain.d.ts.map +1 -0
  144. package/src/vat-localchain.js +29 -0
  145. package/src/vat-mints.d.ts +31 -31
  146. package/src/vat-mints.d.ts.map +1 -1
  147. package/src/vat-mints.js +6 -7
  148. package/src/vat-network.d.ts +69 -1
  149. package/src/vat-network.d.ts.map +1 -1
  150. package/src/vat-network.js +45 -3
  151. package/src/vat-priceAuthority.d.ts +4 -4
  152. package/src/vat-priceAuthority.d.ts.map +1 -1
  153. package/src/vat-priceAuthority.js +1 -1
  154. package/src/vat-provisioning.d.ts +6 -6
  155. package/src/vat-provisioning.d.ts.map +1 -1
  156. package/src/vat-provisioning.js +15 -12
  157. package/src/vat-transfer.d.ts +81 -0
  158. package/src/vat-transfer.d.ts.map +1 -0
  159. package/src/vat-transfer.js +63 -0
  160. package/src/vat-zoe.d.ts +4 -1
  161. package/src/vat-zoe.d.ts.map +1 -1
  162. package/src/vat-zoe.js +10 -2
  163. package/src/virtual-purse.d.ts +46 -21
  164. package/src/virtual-purse.d.ts.map +1 -1
  165. package/src/virtual-purse.js +57 -46
  166. package/src/walletFlags.d.ts +2 -2
  167. package/src/walletFlags.js +1 -2
  168. package/tools/bank-utils.d.ts +20 -0
  169. package/tools/bank-utils.d.ts.map +1 -0
  170. package/tools/bank-utils.js +92 -0
  171. package/tools/board-utils.d.ts +39 -0
  172. package/tools/board-utils.d.ts.map +1 -0
  173. package/tools/board-utils.js +92 -0
  174. package/tools/boot-test-utils.d.ts +88 -0
  175. package/tools/boot-test-utils.d.ts.map +1 -0
  176. package/tools/boot-test-utils.js +157 -0
  177. package/tools/fake-bridge.d.ts +18 -0
  178. package/tools/fake-bridge.d.ts.map +1 -0
  179. package/tools/fake-bridge.js +289 -0
  180. package/tools/ibc-utils.d.ts +29 -0
  181. package/tools/ibc-utils.d.ts.map +1 -0
  182. package/tools/ibc-utils.js +115 -0
  183. package/decentral-core-config.json +0 -66
  184. package/decentral-demo-config.json +0 -155
  185. package/decentral-devnet-config.json +0 -216
  186. package/decentral-itest-vaults-config.json +0 -210
  187. package/decentral-main-vaults-config.json +0 -229
  188. package/decentral-test-vaults-config.json +0 -195
  189. package/demo-proposals.json +0 -5
  190. package/exported.js +0 -1
  191. package/jsconfig.build.json +0 -12
  192. package/jsconfig.json +0 -13
  193. package/src/core/types.d.ts +0 -764
  194. package/src/core/types.d.ts.map +0 -1
  195. package/src/core/types.js +0 -347
  196. package/src/provisionPool.d.ts +0 -164
  197. package/src/provisionPool.d.ts.map +0 -1
  198. package/src/provisionPool.js +0 -113
  199. package/src/provisionPoolKit.d.ts +0 -392
  200. package/src/provisionPoolKit.d.ts.map +0 -1
  201. package/src/provisionPoolKit.js +0 -464
  202. package/src/tokens.d.ts +0 -36
  203. package/src/tokens.d.ts.map +0 -1
  204. package/src/tokens.js +0 -37
  205. package/src/types.d.ts.map +0 -1
  206. package/src/vat-sharing.d.ts +0 -54
  207. package/src/vat-sharing.d.ts.map +0 -1
  208. package/src/vat-sharing.js +0 -14
@@ -1,55 +1,13 @@
1
1
  /**
2
- * We reserve these keys in name hubs.
2
+ * Used in bootstrap to reserve names in the agoricNames namespace before any
3
+ * other proposals.
3
4
  *
4
- * @type {{ [P in keyof WellKnownName]: { [P2 in WellKnownName[P]]: string } }}
5
+ * @type {{
6
+ * [P in keyof WellKnownName]: { [P2 in WellKnownName[P]]: string };
7
+ * }}
5
8
  */
6
- export const agoricNamesReserved: {
7
- issuer: {
8
- IST: string;
9
- BLD: string;
10
- Invitation: string;
11
- AUSD: string;
12
- };
13
- installation: {
14
- reserve: string;
15
- centralSupply: string;
16
- mintHolder: string;
17
- walletFactory: string;
18
- provisionPool: string;
19
- auctioneer: string;
20
- feeDistributor: string;
21
- contractGovernor: string;
22
- committee: string;
23
- noActionElectorate: string;
24
- binaryVoteCounter: string;
25
- VaultFactory: string;
26
- liquidate: string;
27
- Pegasus: string;
28
- psm: string;
29
- econCommitteeCharter: string;
30
- priceAggregator: string;
31
- };
32
- instance: {
33
- reserve: string;
34
- walletFactory: string;
35
- provisionPool: string;
36
- auctioneer: string;
37
- feeDistributor: string;
38
- VaultFactory: string;
39
- Pegasus: string;
40
- econCommitteeCharter: string;
41
- economicCommittee: string;
42
- VaultFactoryGovernor: string;
43
- reserveGovernor: string;
44
- };
45
- oracleBrand: {
46
- USD: string;
47
- };
48
- uiConfig: {
49
- VaultFactory: string;
50
- };
51
- };
52
- /** @type { FeeIssuerConfig } */
9
+ export const agoricNamesReserved: { [P in keyof WellKnownName]: { [P2 in WellKnownName[P]]: string; }; };
10
+ /** @type {FeeIssuerConfig} */
53
11
  export const feeIssuerConfig: FeeIssuerConfig;
54
12
  export function addRemote(addr: string, { vats: { comms, vattp } }: {
55
13
  vats: {
@@ -57,7 +15,7 @@ export function addRemote(addr: string, { vats: { comms, vattp } }: {
57
15
  comms: CommsVatRoot;
58
16
  };
59
17
  }): Promise<void>;
60
- export function callProperties(builders: ((...args: any[]) => Record<string, unknown>)[], ...args: unknown[]): Record<string, unknown>;
18
+ export function callProperties(builders: ((...args: any) => Record<string, unknown>)[], ...args: unknown[]): Record<string, unknown>;
61
19
  export function extract(template: true | string | Record<string, any>, specimen: unknown, path?: string[] | undefined): any;
62
20
  export function extractPowers(permit: true | string | Record<string, any>, allPowers: unknown): any;
63
21
  export function runModuleBehaviors({ allPowers, behaviors, manifest, makeConfig, }: {
@@ -66,11 +24,11 @@ export function runModuleBehaviors({ allPowers, behaviors, manifest, makeConfig,
66
24
  manifest: Record<string, Record<string, unknown>>;
67
25
  makeConfig: (name: string, permit: Record<string, unknown>) => unknown;
68
26
  }): Promise<any[]>;
69
- export function makePromiseSpaceForNameHub(nameAdmin: ERef<import('../types').NameAdmin>, log?: {
27
+ export function makePromiseSpaceForNameHub(nameAdmin: ERef<import("../types.js").NameAdmin>, log?: {
70
28
  (...data: any[]): void;
71
29
  (message?: any, ...optionalParams: any[]): void;
72
30
  } | undefined): PromiseSpaceOf<any, {}, {}>;
73
- export function makeWellKnownSpaces(parentAdmin: ERef<import('../types').NameAdmin>, log?: {
31
+ export function makeWellKnownSpaces(parentAdmin: ERef<import("../types.js").NameAdmin>, log?: {
74
32
  (...data: any[]): void;
75
33
  (message?: any, ...optionalParams: any[]): void;
76
34
  } | undefined, kinds?: string[] | undefined): Promise<WellKnownSpaces>;
@@ -78,80 +36,77 @@ export function makeAgoricNamesAccess(log?: {
78
36
  (...data: any[]): void;
79
37
  (message?: any, ...optionalParams: any[]): void;
80
38
  } | undefined, reserved?: Record<string, Record<string, unknown>>): Promise<{
81
- agoricNames: import('../types.js').NameHub;
82
- agoricNamesAdmin: import('../types.js').NameAdmin;
39
+ agoricNames: import("../types.js").NameHub;
40
+ agoricNamesAdmin: import("../types.js").NameAdmin;
83
41
  spaces: WellKnownSpaces;
84
42
  }>;
85
43
  export function makeMyAddressNameAdminKit(address: string): {
86
- nameHub: import("../types").NameHub;
87
- myAddressNameAdmin: import("../types").MyAddressNameAdmin;
44
+ nameHub: import("../types.js").NameHub<any>;
45
+ myAddressNameAdmin: import("../types.js").MyAddressNameAdmin;
88
46
  };
89
- export function makeVatSpace(svc: ERef<ReturnType<Awaited<VatAdminVat>['createVatAdminService']>>, criticalVatKey: unknown, log?: ((...args: any) => void) | undefined, label?: string | undefined): {
47
+ export function makeVatSpace(svc: ERef<ReturnType<Awaited<VatAdminVat>["createVatAdminService"]>>, criticalVatKey: unknown, log?: ((...args: any) => void) | undefined, label?: string | undefined): {
90
48
  space: {
91
49
  consume: {
92
50
  agoricNames: Promise<{
93
- getNameHub: () => import("../types").NameHub;
94
- getNameHubKit: () => import("../types").NameHubKit;
51
+ getNameHub: () => import("../types.js").NameHub<any>;
52
+ getNameHubKit: () => import("../types.js").NameHubKit;
95
53
  publishNameHubs: (nameStorage: ERef<StorageNode>, vatBoard: ERef<BoardVat>, kinds: string[]) => Promise<void>;
96
- provideInertBrand: (keyword: string, displayInfo: DisplayInfo<AssetKind>) => any;
97
- } & import("@endo/eventual-send").RemotableBrand<{}, {
98
- getNameHub: () => import("../types").NameHub;
99
- getNameHubKit: () => import("../types").NameHubKit;
54
+ provideInertBrand: (keyword: string, displayInfo: DisplayInfo) => any;
55
+ } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
56
+ getNameHub: () => import("../types.js").NameHub<any>;
57
+ getNameHubKit: () => import("../types.js").NameHubKit;
100
58
  publishNameHubs: (nameStorage: ERef<StorageNode>, vatBoard: ERef<BoardVat>, kinds: string[]) => Promise<void>;
101
- provideInertBrand: (keyword: string, displayInfo: DisplayInfo<AssetKind>) => any;
59
+ provideInertBrand: (keyword: string, displayInfo: DisplayInfo) => any;
102
60
  }>>;
103
61
  board: Promise<{
104
- getBoard: () => {
105
- getId(value: any): string;
106
- getValue(id: string): any;
62
+ getBoard: () => import("@endo/exo").Guarded<{
63
+ getId(value: import("@endo/pass-style").RemotableObject): string;
64
+ getValue(id: BoardId): import("@endo/pass-style").RemotableObject;
107
65
  lookup(...path: string[]): Promise<any>;
108
- has(val: any): boolean;
66
+ has(val: import("@endo/pass-style").RemotableObject): boolean;
109
67
  ids(): string[];
110
- getPublishingMarshaller(): {
68
+ getPublishingMarshaller(): import("@endo/exo").Guarded<{
111
69
  toCapData(val: any): import("@endo/marshal").CapData<string>;
112
70
  fromCapData(data: any): any;
113
71
  serialize(data: any): import("@endo/marshal").CapData<string>;
114
72
  unserialize(data: any): any;
115
- };
116
- getReadonlyMarshaller(): {
73
+ }>;
74
+ getReadonlyMarshaller(): import("@endo/exo").Guarded<{
117
75
  toCapData(val: any): import("@endo/marshal").CapData<string | null>;
118
76
  fromCapData(data: any): any;
119
77
  serialize(data: any): import("@endo/marshal").CapData<string | null>;
120
78
  unserialize(data: any): any;
121
- };
122
- };
123
- makePublishingRecorderKit: <T>(storageNode: StorageNode, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T> | undefined) => import("@agoric/zoe/src/contractSupport/recorder.js").RecorderKit<T>;
124
- makeReadOnlyRecorderKit: <T>(storageNode: StorageNode, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T> | undefined) => import("@agoric/zoe/src/contractSupport/recorder.js").RecorderKit<T>;
125
- } & import("@endo/eventual-send").RemotableBrand<{}, {
126
- getBoard: () => {
127
- getId(value: any): string;
128
- getValue(id: string): any;
79
+ }>;
80
+ }>;
81
+ makePublishingRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T> | undefined) => RecorderKit<T>;
82
+ makeReadOnlyRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T> | undefined) => RecorderKit<T>;
83
+ } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
84
+ getBoard: () => import("@endo/exo").Guarded<{
85
+ getId(value: import("@endo/pass-style").RemotableObject): string;
86
+ getValue(id: BoardId): import("@endo/pass-style").RemotableObject;
129
87
  lookup(...path: string[]): Promise<any>;
130
- has(val: any): boolean;
88
+ has(val: import("@endo/pass-style").RemotableObject): boolean;
131
89
  ids(): string[];
132
- getPublishingMarshaller(): {
90
+ getPublishingMarshaller(): import("@endo/exo").Guarded<{
133
91
  toCapData(val: any): import("@endo/marshal").CapData<string>;
134
92
  fromCapData(data: any): any;
135
93
  serialize(data: any): import("@endo/marshal").CapData<string>;
136
94
  unserialize(data: any): any;
137
- };
138
- getReadonlyMarshaller(): {
95
+ }>;
96
+ getReadonlyMarshaller(): import("@endo/exo").Guarded<{
139
97
  toCapData(val: any): import("@endo/marshal").CapData<string | null>;
140
98
  fromCapData(data: any): any;
141
99
  serialize(data: any): import("@endo/marshal").CapData<string | null>;
142
100
  unserialize(data: any): any;
143
- };
144
- };
145
- makePublishingRecorderKit: <T>(storageNode: StorageNode, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T> | undefined) => import("@agoric/zoe/src/contractSupport/recorder.js").RecorderKit<T>;
146
- makeReadOnlyRecorderKit: <T>(storageNode: StorageNode, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T> | undefined) => import("@agoric/zoe/src/contractSupport/recorder.js").RecorderKit<T>;
101
+ }>;
102
+ }>;
103
+ makePublishingRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T> | undefined) => RecorderKit<T>;
104
+ makeReadOnlyRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T> | undefined) => RecorderKit<T>;
147
105
  }>>;
148
106
  };
149
107
  };
150
- durableStore: MapStore<K, V>;
108
+ durableStore: globalThis.MapStore<any, any>;
151
109
  };
152
- /**
153
- * as from createVatByName
154
- */
155
- export type CreateVatResults = import('@agoric/swingset-vat').CreateVatResults;
156
110
  export type VatStore = MapStore<string, CreateVatResults>;
111
+ import type { CreateVatResults } from '@agoric/swingset-vat';
157
112
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDG;AAEH,gCAAgC;AAChC,8BADY,eAAe,CAKzB;AAQK,gCAHI,MAAM,8BACN;IAAE,IAAI,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,YAAY,CAAA;KAAE,CAAA;CAAC,iBAK3D;AAQM,8DAJuB,OAAO,MAAM,EAAE,OAAO,CAAC,cACtC,OAAO,KACT,OAAO,MAAM,EAAE,OAAO,CAAC,CAG0B;AASvD,kCAJI,IAAI,GAAG,MAAM,GAAG,OAAO,MAAM,MAAI,YACjC,OAAO,oCAkCjB;AAOM,sCAHI,IAAI,GAAG,MAAM,GAAG,OAAO,MAAM,MAAI,aACjC,OAAO,OAYjB;AAUM;eALI,OAAO;eACP,OAAO,MAAM,EAAE,OAAO,CAAC;cACvB,OAAO,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;uBAC/B,MAAM,UAAU,OAAO,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO;mBAwBrE;AAUM,sDAHI,KAAK,OAAO,UAAU,EAAE,SAAS,CAAC;;;4CAyB5C;AAOM,iDAJI,KAAK,OAAO,UAAU,EAAE,SAAS,CAAC;;;uEAsB5C;AAuBM;;;0BAfI,OAAO,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;iBAUhC,OAAO,aAAa,EAAE,OAAO;sBACxB,OAAO,aAAa,EAAE,SAAS;YACzC,eAAe;GAuB3B;AAOM,mDAJI,MAAM;;;EAkBhB;AAWM,kCARI,KAAK,WAAW,QAAQ,WAAW,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,kBAC/D,OAAO,mBACG,GAAG,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDhC;;;;+BAlDY,OAAO,sBAAsB,EAAE,gBAAgB;uBAC/C,SAAS,MAAM,EAAE,gBAAgB,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAcA;;;;;;;GAOG;AACH,kCAJU,GACJ,CAAwB,IAAnB,MAAM,aAAa,GAAG,GAAG,EAAsB,IAAhB,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,GAAE,GACjE,CA+DD;AAEH,8BAA8B;AAC9B,8BADW,eAAe,CAKxB;AAQK,gCAHI,MAAM,8BACN;IAAE,IAAI,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,YAAY,CAAA;KAAE,CAAA;CAAE,iBAK5D;AAQM,yCAJI,CAAC,CAAC,GAAG,IAAI,KAAA,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,WACrC,OAAO,EAAA,GACR,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAG0B;AAWvD,kCALI,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAEnC,OAAO,oCAkCjB;AAQM,sCAJI,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,aAEnC,OAAO,OAYjB;AAUM,oFALJ;IAAsB,SAAS,EAAvB,OAAO;IACuB,SAAS,EAAvC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACuB,QAAQ,EAAtD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC0B,UAAU,EAA3E,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO;CACpE,kBAuBA;AASM,sDAHI,IAAI,CAAC,OAAO,aAAa,EAAE,SAAS,CAAC;;;4CAyB/C;AAOM,iDAJI,IAAI,CAAC,OAAO,aAAa,EAAE,SAAS,CAAC;;;uEAsB/C;AAoBM;;;0BAXI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAKrC,OAAO,CAAC;IACpB,WAAe,EAAE,OAAO,aAAa,EAAE,OAAO,CAAC;IAC/C,gBAAoB,EAAE,OAAO,aAAa,EAAE,SAAS,CAAC;IACtD,MAAU,EAAE,eAAe,CAAC;CACzB,CAAC,CAsBJ;AAMM,mDAFI,MAAM;;;EAgBhB;AAYM,kCAPI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,kBAC/D,OAAO,mBACG,GAAG,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yFA5KtB,WAGX;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6NC;uBAzDa,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;sCAOb,sBAAsB"}
package/src/core/utils.js CHANGED
@@ -1,20 +1,24 @@
1
- // @ts-check
2
- import { E, Far } from '@endo/far';
1
+ import { Stable, Stake } from '@agoric/internal/src/tokens.js';
3
2
  import { WalletName } from '@agoric/internal';
3
+ import { E, Far } from '@endo/far';
4
4
  import { makeAtomicProvider } from '@agoric/store/src/stores/store-utils.js';
5
5
  import { makeScalarBigMapStore, makeScalarMapStore } from '@agoric/vat-data';
6
6
  import { keyEQ } from '@agoric/store';
7
7
  import { makeNameHubKit } from '../nameHub.js';
8
- import { Stable, Stake } from '../tokens.js';
9
8
  import { makeLogHooks, makePromiseSpace } from './promise-space.js';
10
9
 
10
+ import './types-ambient.js';
11
+
11
12
  const { entries, fromEntries, keys } = Object;
12
13
  const { Fail, quote: q } = assert;
13
14
 
14
15
  /**
15
- * We reserve these keys in name hubs.
16
+ * Used in bootstrap to reserve names in the agoricNames namespace before any
17
+ * other proposals.
16
18
  *
17
- * @type {{ [P in keyof WellKnownName]: { [P2 in WellKnownName[P]]: string } }}
19
+ * @type {{
20
+ * [P in keyof WellKnownName]: { [P2 in WellKnownName[P]]: string };
21
+ * }}
18
22
  */
19
23
  export const agoricNamesReserved = harden({
20
24
  issuer: {
@@ -52,6 +56,9 @@ export const agoricNamesReserved = harden({
52
56
  psm: 'Parity Stability Module',
53
57
  econCommitteeCharter: 'Charter for Econ Governance questions',
54
58
  priceAggregator: 'simple price aggregator',
59
+ scaledPriceAuthority: 'scaled price authority',
60
+ stakeAtom: 'example ATOM staking contract',
61
+ stakeBld: 'example BLD staking contract',
55
62
  },
56
63
  instance: {
57
64
  economicCommittee: 'Economic Committee',
@@ -65,6 +72,8 @@ export const agoricNamesReserved = harden({
65
72
  econCommitteeCharter: 'Charter for Econ Governance questions',
66
73
  provisionPool: 'Account Provision Pool',
67
74
  walletFactory: 'Smart Wallet Factory',
75
+ stakeAtom: 'example ATOM staking contract',
76
+ stakeBld: 'example BLD staking contract',
68
77
  },
69
78
  oracleBrand: {
70
79
  USD: 'US Dollar',
@@ -74,7 +83,7 @@ export const agoricNamesReserved = harden({
74
83
  },
75
84
  });
76
85
 
77
- /** @type { FeeIssuerConfig } */
86
+ /** @type {FeeIssuerConfig} */
78
87
  export const feeIssuerConfig = {
79
88
  name: Stable.symbol,
80
89
  assetKind: Stable.assetKind,
@@ -85,7 +94,7 @@ export const feeIssuerConfig = {
85
94
  * Wire up a remote between the comms vat and vattp.
86
95
  *
87
96
  * @param {string} addr
88
- * @param {{ vats: { vattp: VattpVat, comms: CommsVatRoot }}} powers
97
+ * @param {{ vats: { vattp: VattpVat; comms: CommsVatRoot } }} powers
89
98
  */
90
99
  export const addRemote = async (addr, { vats: { comms, vattp } }) => {
91
100
  const { transmitter, setReceiver } = await E(vattp).addRemote(addr);
@@ -94,17 +103,19 @@ export const addRemote = async (addr, { vats: { comms, vattp } }) => {
94
103
  harden(addRemote);
95
104
 
96
105
  /**
97
- * @param {Array<(...args) => Record<string, unknown>>} builders
98
- * @param {...unknown} args
106
+ * @param {((...args) => Record<string, unknown>)[]} builders
107
+ * @param {...unknown} args
99
108
  * @returns {Record<string, unknown>}
100
109
  */
101
110
  export const callProperties = (builders, ...args) =>
102
111
  fromEntries(builders.map(fn => entries(fn(...args))).flat());
103
112
 
104
113
  /**
105
- * Attenuate `specimen` to only allow acccess to properties specified in `template`
114
+ * Attenuate `specimen` to only allow acccess to properties specified in
115
+ * `template`
106
116
  *
107
- * @param {true | string | Record<string, *>} template true or vat name string or recursive object
117
+ * @param {true | string | Record<string, any>} template true or vat name string
118
+ * or recursive object
108
119
  * @param {unknown} specimen
109
120
  * @param {string[]} [path]
110
121
  */
@@ -143,7 +154,8 @@ export const extract = (template, specimen, path = []) => {
143
154
  harden(extract);
144
155
 
145
156
  /**
146
- * @param {true | string | Record<string, *>} permit the permit supplied by the manifest
157
+ * @param {true | string | Record<string, any>} permit the permit supplied by
158
+ * the manifest
147
159
  * @param {unknown} allPowers the powers to attenuate
148
160
  */
149
161
  export const extractPowers = (permit, allPowers) => {
@@ -164,7 +176,7 @@ harden(extractPowers);
164
176
  * @param {unknown} opts.allPowers
165
177
  * @param {Record<string, unknown>} opts.behaviors
166
178
  * @param {Record<string, Record<string, unknown>>} opts.manifest
167
- * @param { (name: string, permit: Record<string, unknown>) => unknown} opts.makeConfig
179
+ * @param {(name: string, permit: Record<string, unknown>) => unknown} opts.makeConfig
168
180
  */
169
181
  export const runModuleBehaviors = ({
170
182
  allPowers,
@@ -173,20 +185,20 @@ export const runModuleBehaviors = ({
173
185
  makeConfig,
174
186
  }) => {
175
187
  return Promise.all(
176
- entries(manifest).map(([name, permit]) =>
177
- Promise.resolve().then(() => {
178
- const behavior = behaviors[name];
179
- assert(behavior, `${name} not in ${Object.keys(behaviors).join(',')}`);
180
- assert.typeof(
181
- behavior,
182
- 'function',
183
- `behaviors[${name}] is not a function; got ${behavior}`,
188
+ entries(manifest).map(async ([name, permit]) => {
189
+ await null;
190
+ const behavior = behaviors[name];
191
+ if (typeof behavior !== 'function') {
192
+ const behaviorKeys = Reflect.ownKeys(behaviors).map(key =>
193
+ typeof key === 'string' ? JSON.stringify(key) : String(key),
184
194
  );
185
- const powers = extractPowers(permit, allPowers);
186
- const config = harden(makeConfig(name, permit));
187
- return behavior.call(behaviors, powers, config);
188
- }),
189
- ),
195
+ const keysStr = `[${behaviorKeys.join(', ')}]`;
196
+ throw Fail`${q(name)} is not a function in ${keysStr}: ${behavior}`;
197
+ }
198
+ const powers = extractPowers(permit, allPowers);
199
+ const config = harden(makeConfig(name, permit));
200
+ return Reflect.apply(behavior, behaviors, [powers, config]);
201
+ }),
190
202
  );
191
203
  };
192
204
  harden(runModuleBehaviors);
@@ -194,8 +206,7 @@ harden(runModuleBehaviors);
194
206
  const noop = harden(() => {});
195
207
 
196
208
  /**
197
- *
198
- * @param {ERef<import('../types').NameAdmin>} nameAdmin
209
+ * @param {ERef<import('../types.js').NameAdmin>} nameAdmin
199
210
  * @param {typeof console.log} [log]
200
211
  */
201
212
  export const makePromiseSpaceForNameHub = (nameAdmin, log = noop) => {
@@ -223,7 +234,7 @@ export const makePromiseSpaceForNameHub = (nameAdmin, log = noop) => {
223
234
  };
224
235
 
225
236
  /**
226
- * @param {ERef<import('../types').NameAdmin>} parentAdmin
237
+ * @param {ERef<import('../types.js').NameAdmin>} parentAdmin
227
238
  * @param {typeof console.log} [log]
228
239
  * @param {string[]} [kinds]
229
240
  */
@@ -241,7 +252,7 @@ export const makeWellKnownSpaces = async (
241
252
  }),
242
253
  );
243
254
  const spaces = Object.fromEntries(spaceEntries);
244
- const typedSpaces = /** @type { WellKnownSpaces } */ (
255
+ const typedSpaces = /** @type {WellKnownSpaces} */ (
245
256
  /** @type {any} */ (spaces)
246
257
  );
247
258
  return typedSpaces;
@@ -249,23 +260,20 @@ export const makeWellKnownSpaces = async (
249
260
 
250
261
  /**
251
262
  * Make the well-known agoricNames namespace so that we can
252
- * E(home.agoricNames).lookup('issuer', 'IST') and likewise
253
- * for brand, installation, instance, etc.
254
- *
255
- * @param {typeof console.log} [log]
256
- * @param {Record<string, Record<string, unknown>>} reserved a property
257
- * for each of issuer, brand, etc. with a value whose keys are names
258
- * to reserve.
259
- *
260
- * For static typing and integrating with the bootstrap permit system,
261
- * return { produce, consume } spaces rather than NameAdmins.
263
+ * E(home.agoricNames).lookup('issuer', 'IST') and likewise for brand,
264
+ * installation, instance, etc.
262
265
  *
263
266
  * @deprecated use vat-agoricNames, makeWellKnownSpaces
267
+ * @param {typeof console.log} [log]
268
+ * @param {Record<string, Record<string, unknown>>} reserved a property for each
269
+ * of issuer, brand, etc. with a value whose keys are names to reserve.
264
270
  *
271
+ * For static typing and integrating with the bootstrap permit system, return {
272
+ * produce, consume } spaces rather than NameAdmins.
265
273
  * @returns {Promise<{
266
- * agoricNames: import('../types.js').NameHub,
267
- * agoricNamesAdmin: import('../types.js').NameAdmin,
268
- * spaces: WellKnownSpaces,
274
+ * agoricNames: import('../types.js').NameHub;
275
+ * agoricNamesAdmin: import('../types.js').NameAdmin;
276
+ * spaces: WellKnownSpaces;
269
277
  * }>}
270
278
  */
271
279
  export const makeAgoricNamesAccess = async (
@@ -280,7 +288,7 @@ export const makeAgoricNamesAccess = async (
280
288
  Object.keys(reserved),
281
289
  );
282
290
 
283
- const typedSpaces = /** @type { WellKnownSpaces } */ (
291
+ const typedSpaces = /** @type {WellKnownSpaces} */ (
284
292
  /** @type {any} */ (spaces)
285
293
  );
286
294
  return {
@@ -291,15 +299,14 @@ export const makeAgoricNamesAccess = async (
291
299
  };
292
300
 
293
301
  /**
294
- * @param {string} address
295
- *
296
302
  * @deprecated use nameAdmin.provideChild() instead
303
+ * @param {string} address
297
304
  */
298
305
  export const makeMyAddressNameAdminKit = address => {
299
306
  // Create a name hub for this address.
300
307
  const { nameHub, nameAdmin: rawMyAddressNameAdmin } = makeNameHubKit();
301
308
 
302
- /** @type {import('../types').MyAddressNameAdmin} */
309
+ /** @type {import('../types.js').MyAddressNameAdmin} */
303
310
  const myAddressNameAdmin = Far('myAddressNameAdmin', {
304
311
  ...rawMyAddressNameAdmin,
305
312
  getMyAddress: () => address,
@@ -311,14 +318,15 @@ export const makeMyAddressNameAdminKit = address => {
311
318
  return { nameHub, myAddressNameAdmin };
312
319
  };
313
320
 
321
+ /** @typedef {MapStore<string, CreateVatResults>} VatStore */
322
+
314
323
  /**
315
324
  * @param {ERef<ReturnType<Awaited<VatAdminVat>['createVatAdminService']>>} svc
316
325
  * @param {unknown} criticalVatKey
317
326
  * @param {(...args: any) => void} [log]
318
327
  * @param {string} [label]
319
- *
320
- * @typedef {import('@agoric/swingset-vat').CreateVatResults} CreateVatResults as from createVatByName
321
- * @typedef {MapStore<string, CreateVatResults>} VatStore
328
+ * @import {CreateVatResults} from '@agoric/swingset-vat'
329
+ * as from createVatByName
322
330
  */
323
331
  export const makeVatSpace = (
324
332
  svc,
package/src/crc.d.ts CHANGED
@@ -18,13 +18,9 @@ export class CRC {
18
18
  crcShift: number;
19
19
  shiftedXorIn: number;
20
20
  table: Int32Array;
21
- /**
22
- * @param {Data} data
23
- */
21
+ /** @param {Data} data */
24
22
  calculate(data: Data): number;
25
- /**
26
- * @param {Data} data
27
- */
23
+ /** @param {Data} data */
28
24
  calculateNoTable(data: Data): number;
29
25
  genTable(): Int32Array;
30
26
  }
package/src/crc.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"crc.d.ts","sourceRoot":"","sources":["crc.js"],"names":[],"mappings":"AAuDA;IACE;;;;;;OAMG;IACH,mBANW,MAAM,QACN,MAAM,SACN,MAAM,UACN,MAAM,WACN,OAAO,EA8BjB;IA3BC,cAAkB;IAClB,aAAgB;IAChB,cAAkB;IAClB,uBAA0C;IAC1C,eAAoB;IACpB,iBAAsB;IACtB,gBAAoC;IACpC,aAAyC;IACzC,iBAAmD;IACnD,qBAA+C;IAG/C,kBAAkB;IAiBpB;;OAEG;IACH,gBAFW,IAAI,UAwBd;IAED;;OAEG;IACH,uBAFW,IAAI,UAmBd;IAED,uBAqBC;CACF;AAED,uBAAwD;AACxD,uBAAwD;AACxD,uBAAwD;AACxD,wBAA+D;AAC/D,wBAA+D;AAC/D,wBAAsE;AACtE,wBAA2E;AAC3E,yBAA4E;;;;;;;;;;;mBAjK/D,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW"}
1
+ {"version":3,"file":"crc.d.ts","sourceRoot":"","sources":["crc.js"],"names":[],"mappings":"AAkDA;IACE;;;;;;OAMG;IACH,mBANW,MAAM,QACN,MAAM,SACN,MAAM,UACN,MAAM,WACN,OAAO,EA4BjB;IAzBC,cAAkB;IAClB,aAAgB;IAChB,cAAkB;IAClB,uBAA0C;IAC1C,eAAoB;IACpB,iBAAsB;IACtB,gBAAoC;IACpC,aAAyC;IACzC,iBAAmD;IACnD,qBAA+C;IAG/C,kBAAkB;IAepB,yBAAyB;IACzB,gBADY,IAAI,UAuBf;IAED,yBAAyB;IACzB,uBADY,IAAI,UAkBf;IAED,uBAqBC;CACF;AAED,uBAAwD;AACxD,uBAAwD;AACxD,uBAAwD;AACxD,wBAA+D;AAC/D,wBAA+D;AAC/D,wBAAsE;AACtE,wBAA2E;AAC3E,yBAA4E;;;;;;;;;;;mBAxJ9D,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW"}
package/src/crc.js CHANGED
@@ -6,18 +6,13 @@
6
6
  * Forked from npm polycrc@1.1.0 for module system compatibility, then trimmed
7
7
  * down to a version that assumes TypedArrays are universal.
8
8
  */
9
- // @ts-check
10
9
  /* eslint-disable no-bitwise */
11
10
 
12
- /**
13
- * @typedef {string | number | Uint8Array | ArrayBuffer} Data
14
- */
11
+ /** @typedef {string | number | Uint8Array | ArrayBuffer} Data */
15
12
 
16
13
  const encoder = new TextEncoder();
17
14
 
18
- /**
19
- * @param {Data} data
20
- */
15
+ /** @param {Data} data */
21
16
  function convert(data) {
22
17
  if (typeof data === 'number') {
23
18
  const bytes = [];
@@ -77,9 +72,7 @@ export class CRC {
77
72
  this.table = table;
78
73
 
79
74
  if (this.width === 8 && !this.xorIn && !this.xorOut && !this.reflect) {
80
- /**
81
- * @param {Data} data
82
- */
75
+ /** @param {Data} data */
83
76
  this.calculate = function calculate(data) {
84
77
  const buffer = convert(data);
85
78
  let crc = 0;
@@ -91,9 +84,7 @@ export class CRC {
91
84
  }
92
85
  }
93
86
 
94
- /**
95
- * @param {Data} data
96
- */
87
+ /** @param {Data} data */
97
88
  calculate(data) {
98
89
  const buffer = convert(data);
99
90
  let crc;
@@ -118,9 +109,7 @@ export class CRC {
118
109
  return crc >>> 0;
119
110
  }
120
111
 
121
- /**
122
- * @param {Data} data
123
- */
112
+ /** @param {Data} data */
124
113
  calculateNoTable(data) {
125
114
  const buffer = convert(data);
126
115
  let crc = this.xorIn;
package/src/ibc.d.ts CHANGED
@@ -1,37 +1,32 @@
1
- /**
2
- * @typedef {import('./types.js').BridgeHandler} BridgeHandler
3
- */
4
- /**
5
- * @typedef {string} IBCPortID
6
- * @typedef {string} IBCChannelID
7
- * @typedef {string} IBCConnectionID
8
- */
9
- /**
10
- * @typedef {object} IBCPacket
11
- * @property {Bytes} [data]
12
- * @property {IBCChannelID} source_channel
13
- * @property {IBCPortID} source_port
14
- * @property {IBCChannelID} destination_channel
15
- * @property {IBCPortID} destination_port
16
- */
17
- /**
18
- * Create a handler for the IBC protocol, both from the network
19
- * and from the bridge.
20
- *
21
- * @param {typeof import('@endo/far').E} E
22
- * @param {(method: string, params: any) => Promise<any>} rawCallIBCDevice
23
- * @returns {ProtocolHandler & BridgeHandler} Protocol/Bridge handler
24
- */
25
- export function makeIBCProtocolHandler(E: typeof import('@endo/far').E, rawCallIBCDevice: (method: string, params: any) => Promise<any>): ProtocolHandler & BridgeHandler;
26
- export type BridgeHandler = import('./types.js').BridgeHandler;
27
- export type IBCPortID = string;
28
- export type IBCChannelID = string;
29
- export type IBCConnectionID = string;
30
- export type IBCPacket = {
31
- data?: string | undefined;
32
- source_channel: IBCChannelID;
33
- source_port: IBCPortID;
34
- destination_channel: IBCChannelID;
35
- destination_port: IBCPortID;
1
+ export function prepareIBCConnectionHandler(zone: Zone): any;
2
+ export function prepareIBCProtocol(zone: Zone, powers: VowTools): (ibcdev: {
3
+ downcall: (method: string, args: object) => Promise<any>;
4
+ }) => {
5
+ protocolHandler: ProtocolHandler;
6
+ bridgeHandler: BridgeHandler;
36
7
  };
8
+ export function prepareCallbacks(zone: Zone): (dibcBridgeManager: ScopedBridgeManager<"dibc">) => import("@endo/exo").Guarded<{
9
+ /**
10
+ * @param {string} method
11
+ * @param {any} obj
12
+ */
13
+ downcall(method: string, obj: any): Promise<any>;
14
+ }>;
15
+ export type OnConnectP = VowKit<AttemptDescription>;
16
+ export type Outbound = Omit<ConnectingInfo, "counterparty" | "channelID" | "counterpartyVersion"> & {
17
+ localAddr: Endpoint;
18
+ onConnectP: OnConnectP;
19
+ counterparty: {
20
+ port_id: string;
21
+ };
22
+ };
23
+ import type { Zone } from '@agoric/base-zone';
24
+ import type { VowTools } from '@agoric/vow';
25
+ import type { ProtocolHandler } from '@agoric/network';
26
+ import type { BridgeHandler } from './types.js';
27
+ import type { ScopedBridgeManager } from './types.js';
28
+ import type { AttemptDescription } from '@agoric/network';
29
+ import type { VowKit } from '@agoric/vow';
30
+ import type { ConnectingInfo } from './types.js';
31
+ import type { Endpoint } from '@agoric/network';
37
32
  //# sourceMappingURL=ibc.d.ts.map
package/src/ibc.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ibc.d.ts","sourceRoot":"","sources":["ibc.js"],"names":[],"mappings":"AAuBA;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,0CAJW,cAAc,WAAW,EAAE,CAAC,6BACnB,MAAM,UAAU,GAAG,KAAK,QAAQ,GAAG,CAAC,GAC3C,eAAe,GAAG,aAAa,CAwhB3C;4BAhjBY,OAAO,YAAY,EAAE,aAAa;wBAIlC,MAAM;2BACN,MAAM;8BACN,MAAM;;;oBAML,YAAY;iBACZ,SAAS;yBACT,YAAY;sBACZ,SAAS"}
1
+ {"version":3,"file":"ibc.d.ts","sourceRoot":"","sources":["ibc.js"],"names":[],"mappings":"AAmDO,kDAHI,IAAI,GACF,GAAG,CAmHf;AAMM,yCAHI,IAAI,UACJ,QAAQ;cASH,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC;;qBAOpC,eAAe;mBACjB,aAAa;EA+mBpC;AAIM,uCADK,IAAI;IAQV;;;OAGG;qBAFQ,MAAM,OACN,GAAG;GAYnB;yBAhyBa,OAAO,kBAAkB,CAAC;uBAG3B,IAAI,CAChB,cAAkB,EAClB,cAAkB,GAAG,WAAW,GAAG,qBAAqB,CACrD,GAAG;IACN,SAAa,EAAE,QAAQ,CAAC;IACxB,UAAc,EAAE,UAAU,CAAC;IAC3B,YAAgB,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC;0BAdmB,mBAAmB;8BAC0B,aAAa;qCAH+B,iBAAiB;mCACyE,YAAY;yCAAZ,YAAY;wCAZjL,iBAAiB;4BAcc,aAAa;oCAFyH,YAAY;8BADtG,iBAAiB"}