-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get nervous system data from the Registry (#4575)
- Loading branch information
Showing
11 changed files
with
95 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 3 additions & 6 deletions
9
frontend/openchat-agent/src/services/registry/candid/idl.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
import type { IDL } from "@dfinity/candid"; | ||
import { | ||
TokenDetails, | ||
UpdatesResponse, | ||
_SERVICE | ||
} from "./types"; | ||
import { NervousSystemSummary, TokenDetails, UpdatesResponse, _SERVICE } from "./types"; | ||
export { | ||
NervousSystemSummary as ApiNervousSystemSummary, | ||
TokenDetails as ApiTokenDetails, | ||
UpdatesResponse as ApiUpdatesResponse, | ||
_SERVICE as RegistryService | ||
_SERVICE as RegistryService, | ||
}; | ||
|
||
export const idlFactory: IDL.InterfaceFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,24 @@ | ||
import type { CryptocurrencyDetails, NervousSystemSummary } from "../crypto"; | ||
|
||
export type RegistryUpdatesResponse = | ||
| RegistryUpdatesResponseSuccess | ||
| RegistryUpdatesResponseSuccessNoUpdates; | ||
|
||
export type RegistryValue = { | ||
lastUpdated: bigint; | ||
tokenDetails: TokenDetails[]; | ||
tokenDetails: RegistryTokenDetails[]; | ||
nervousSystemDetails: NervousSystemSummary[]; | ||
}; | ||
|
||
export type RegistryUpdatesResponseSuccess = { | ||
kind: "success"; | ||
lastUpdated: bigint; | ||
tokenDetails: TokenDetails[]; | ||
tokenDetails: RegistryTokenDetails[]; | ||
nervousSystemDetails: NervousSystemSummary[]; | ||
}; | ||
|
||
export type RegistryTokenDetails = Omit<CryptocurrencyDetails, "nervousSystem">; | ||
|
||
export type RegistryUpdatesResponseSuccessNoUpdates = { | ||
kind: "success_no_updates"; | ||
}; | ||
|
||
export type TokenDetails = { | ||
ledgerCanisterId: string; | ||
name: string; | ||
symbol: string; | ||
decimals: number; | ||
fee: bigint; | ||
logo: string; | ||
nervousSystem?: { | ||
root: string; | ||
governance: string; | ||
}; | ||
infoUrl: string; | ||
howToBuyUrl: string; | ||
transactionUrlFormat: string; | ||
added: bigint; | ||
lastUpdated: bigint; | ||
}; | ||
|
||
export type NervousSystemSummary = { | ||
rootCanisterId: string; | ||
governanceCanisterId: string; | ||
ledgerCanisterId: string; | ||
isNns: boolean; | ||
proposalRejectionFee: bigint; | ||
submittingProposalsEnabled: boolean; | ||
}; |