-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f64dbd
commit 456adca
Showing
17 changed files
with
191 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"type":"object","properties":{"id":{"description":"On-chain account address.","type":"string","maxLength":64,"title":"Address"},"total_donations_in_usd":{"description":"Total donations received in USD.","type":"string","format":"decimal","pattern":"^-?\\d{0,18}(?:\\.\\d{0,2})?$","title":"Total donations received in USD"},"total_donations_out_usd":{"description":"Total donated in USD.","type":"string","format":"decimal","pattern":"^-?\\d{0,18}(?:\\.\\d{0,2})?$","title":"Total donations sent in USD"},"total_matching_pool_allocations_usd":{"description":"Total matching pool allocations in USD.","type":"string","format":"decimal","pattern":"^-?\\d{0,18}(?:\\.\\d{0,2})?$","title":"Total matching pool allocations in USD"},"donors_count":{"description":"Number of donors.","type":"integer","maximum":2147483647,"minimum":0},"near_social_profile_data":{"description":"NEAR social data contained under 'profile' key.","nullable":true}},"required":["id"],"x-readme-ref-name":"Account"} | ||
{"type":"object","properties":{"id":{"description":"On-chain account address.","type":"string","maxLength":64,"title":"Address"},"total_donations_in_usd":{"type":"number","format":"double","exclusiveMaximum":true,"exclusiveMinimum":true,"maximum":1000000000000000000,"minimum":-1000000000000000000},"total_donations_out_usd":{"type":"number","format":"double","exclusiveMaximum":true,"exclusiveMinimum":true,"maximum":1000000000000000000,"minimum":-1000000000000000000},"total_matching_pool_allocations_usd":{"type":"number","format":"double","exclusiveMaximum":true,"exclusiveMinimum":true,"maximum":1000000000000000000,"minimum":-1000000000000000000},"donors_count":{"type":"integer"},"near_social_profile_data":{"type":"object","properties":{"name":{"type":"string"},"image":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"ipfs_cid":{"type":"string"},"nft":{"type":"object","properties":{"media":{"type":"string","format":"uri"},"baseUri":{"type":"string","format":"uri"},"tokenId":{"type":"string"},"contractId":{"type":"string"}},"x-readme-ref-name":"NFT"}},"x-readme-ref-name":"Image"},"backgroundImage":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"ipfs_cid":{"type":"string"},"nft":{"type":"object","properties":{"media":{"type":"string","format":"uri"},"baseUri":{"type":"string","format":"uri"},"tokenId":{"type":"string"},"contractId":{"type":"string"}},"x-readme-ref-name":"NFT"}},"x-readme-ref-name":"Image"},"description":{"type":"string"},"linktree":{"type":"object","properties":{"github":{"type":"string"},"twitter":{"type":"string"},"website":{"type":"string"},"telegram":{"type":"string"}},"x-readme-ref-name":"Linktree"},"plPublicGoodReason":{"type":"string"},"plCategories":{"description":"JSON-stringified array of category strings","type":"string"},"plGithubRepos":{"description":"JSON-stringified array of URLs","type":"string"},"plSmartContracts":{"description":"JSON-stringified object with chain names as keys that map to nested objects of contract addresses","type":"string"},"plFundingSources":{"description":"JSON-stringified array of funding source objects","type":"string"},"plTeam":{"description":"JSON-stringified array of team member account ID strings","type":"string"}},"x-readme-ref-name":"NearSocialProfileData"}},"required":["donors_count","id","total_donations_in_usd","total_donations_out_usd","total_matching_pool_allocations_usd"],"x-readme-ref-name":"Account"} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"url":{"type":"string","format":"uri"},"ipfs_cid":{"type":"string"},"nft":{"type":"object","properties":{"media":{"type":"string","format":"uri"},"baseUri":{"type":"string","format":"uri"},"tokenId":{"type":"string"},"contractId":{"type":"string"}},"x-readme-ref-name":"NFT"}},"x-readme-ref-name":"Image"} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"github":{"type":"string"},"twitter":{"type":"string"},"website":{"type":"string"},"telegram":{"type":"string"}},"x-readme-ref-name":"Linktree"} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"media":{"type":"string","format":"uri"},"baseUri":{"type":"string","format":"uri"},"tokenId":{"type":"string"},"contractId":{"type":"string"}},"x-readme-ref-name":"NFT"} |
1 change: 1 addition & 0 deletions
1
src/common/api/potlock/generated/schemas/NearSocialProfileData.json
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"name":{"type":"string"},"image":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"ipfs_cid":{"type":"string"},"nft":{"type":"object","properties":{"media":{"type":"string","format":"uri"},"baseUri":{"type":"string","format":"uri"},"tokenId":{"type":"string"},"contractId":{"type":"string"}},"x-readme-ref-name":"NFT"}},"x-readme-ref-name":"Image"},"backgroundImage":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"ipfs_cid":{"type":"string"},"nft":{"type":"object","properties":{"media":{"type":"string","format":"uri"},"baseUri":{"type":"string","format":"uri"},"tokenId":{"type":"string"},"contractId":{"type":"string"}},"x-readme-ref-name":"NFT"}},"x-readme-ref-name":"Image"},"description":{"type":"string"},"linktree":{"type":"object","properties":{"github":{"type":"string"},"twitter":{"type":"string"},"website":{"type":"string"},"telegram":{"type":"string"}},"x-readme-ref-name":"Linktree"},"plPublicGoodReason":{"type":"string"},"plCategories":{"description":"JSON-stringified array of category strings","type":"string"},"plGithubRepos":{"description":"JSON-stringified array of URLs","type":"string"},"plSmartContracts":{"description":"JSON-stringified object with chain names as keys that map to nested objects of contract addresses","type":"string"},"plFundingSources":{"description":"JSON-stringified array of funding source objects","type":"string"},"plTeam":{"description":"JSON-stringified array of team member account ID strings","type":"string"}},"x-readme-ref-name":"NearSocialProfileData"} |
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,28 +1,26 @@ | ||
import { NearSocialProfileData } from "./NearSocialProfileData"; | ||
|
||
export type Account = { | ||
/** | ||
* @description On-chain account address. | ||
* @type string | ||
*/ | ||
id: string; | ||
/** | ||
* @description Total donations received in USD. | ||
* @type string | undefined, decimal | ||
* @type number, double | ||
*/ | ||
total_donations_in_usd?: string; | ||
total_donations_in_usd: number; | ||
/** | ||
* @description Total donated in USD. | ||
* @type string | undefined, decimal | ||
* @type number, double | ||
*/ | ||
total_donations_out_usd?: string; | ||
total_donations_out_usd: number; | ||
/** | ||
* @description Total matching pool allocations in USD. | ||
* @type string | undefined, decimal | ||
* @type number, double | ||
*/ | ||
total_matching_pool_allocations_usd?: string; | ||
total_matching_pool_allocations_usd: number; | ||
/** | ||
* @description Number of donors. | ||
* @type integer | undefined | ||
* @type integer | ||
*/ | ||
donors_count?: number; | ||
near_social_profile_data?: any; | ||
donors_count: number; | ||
near_social_profile_data?: NearSocialProfileData; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Nft } from "./Nft"; | ||
|
||
export type Image = { | ||
/** | ||
* @type string | undefined, uri | ||
*/ | ||
url?: string; | ||
/** | ||
* @type string | undefined | ||
*/ | ||
ipfs_cid?: string; | ||
nft?: Nft; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export type Linktree = { | ||
/** | ||
* @type string | undefined | ||
*/ | ||
github?: string; | ||
/** | ||
* @type string | undefined | ||
*/ | ||
twitter?: string; | ||
/** | ||
* @type string | undefined | ||
*/ | ||
website?: string; | ||
/** | ||
* @type string | undefined | ||
*/ | ||
telegram?: string; | ||
}; |
45 changes: 45 additions & 0 deletions
45
src/common/api/potlock/generated/types/NearSocialProfileData.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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Image } from "./Image"; | ||
import { Linktree } from "./Linktree"; | ||
|
||
export type NearSocialProfileData = { | ||
/** | ||
* @type string | undefined | ||
*/ | ||
name?: string; | ||
image?: Image; | ||
backgroundImage?: Image; | ||
/** | ||
* @type string | undefined | ||
*/ | ||
description?: string; | ||
linktree?: Linktree; | ||
/** | ||
* @type string | undefined | ||
*/ | ||
plPublicGoodReason?: string; | ||
/** | ||
* @description JSON-stringified array of category strings | ||
* @type string | undefined | ||
*/ | ||
plCategories?: string; | ||
/** | ||
* @description JSON-stringified array of URLs | ||
* @type string | undefined | ||
*/ | ||
plGithubRepos?: string; | ||
/** | ||
* @description JSON-stringified object with chain names as keys that map to nested objects of contract addresses | ||
* @type string | undefined | ||
*/ | ||
plSmartContracts?: string; | ||
/** | ||
* @description JSON-stringified array of funding source objects | ||
* @type string | undefined | ||
*/ | ||
plFundingSources?: string; | ||
/** | ||
* @description JSON-stringified array of team member account ID strings | ||
* @type string | undefined | ||
*/ | ||
plTeam?: string; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export type Nft = { | ||
/** | ||
* @type string | undefined, uri | ||
*/ | ||
media?: string; | ||
/** | ||
* @type string | undefined, uri | ||
*/ | ||
baseUri?: string; | ||
/** | ||
* @type string | undefined | ||
*/ | ||
tokenId?: string; | ||
/** | ||
* @type string | undefined | ||
*/ | ||
contractId?: string; | ||
}; |
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,27 +1,23 @@ | ||
import { z } from "zod"; | ||
|
||
import { nearSocialProfileDataSchema } from "./nearSocialProfileDataSchema"; | ||
|
||
export const accountSchema = z.object({ | ||
id: z.string().max(64).describe("On-chain account address."), | ||
total_donations_in_usd: z | ||
.string() | ||
.regex(new RegExp("^-?\\d{0,18}(?:\\.\\d{0,2})?$")) | ||
.describe("Total donations received in USD.") | ||
.optional(), | ||
.number() | ||
.min(-1000000000000000000) | ||
.max(1000000000000000000), | ||
total_donations_out_usd: z | ||
.string() | ||
.regex(new RegExp("^-?\\d{0,18}(?:\\.\\d{0,2})?$")) | ||
.describe("Total donated in USD.") | ||
.optional(), | ||
.number() | ||
.min(-1000000000000000000) | ||
.max(1000000000000000000), | ||
total_matching_pool_allocations_usd: z | ||
.string() | ||
.regex(new RegExp("^-?\\d{0,18}(?:\\.\\d{0,2})?$")) | ||
.describe("Total matching pool allocations in USD.") | ||
.optional(), | ||
donors_count: z | ||
.number() | ||
.min(0) | ||
.max(2147483647) | ||
.describe("Number of donors.") | ||
.min(-1000000000000000000) | ||
.max(1000000000000000000), | ||
donors_count: z.number(), | ||
near_social_profile_data: z | ||
.lazy(() => nearSocialProfileDataSchema) | ||
.optional(), | ||
near_social_profile_data: z.any().nullish(), | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { z } from "zod"; | ||
|
||
import { nftSchema } from "./nftSchema"; | ||
|
||
export const imageSchema = z.object({ | ||
url: z.string().url().optional(), | ||
ipfs_cid: z.string().optional(), | ||
nft: z.lazy(() => nftSchema).optional(), | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { z } from "zod"; | ||
|
||
export const linktreeSchema = z.object({ | ||
github: z.string().optional(), | ||
twitter: z.string().optional(), | ||
website: z.string().optional(), | ||
telegram: z.string().optional(), | ||
}); |
35 changes: 35 additions & 0 deletions
35
src/common/api/potlock/generated/zod/nearSocialProfileDataSchema.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { z } from "zod"; | ||
|
||
import { imageSchema } from "./imageSchema"; | ||
import { linktreeSchema } from "./linktreeSchema"; | ||
|
||
export const nearSocialProfileDataSchema = z.object({ | ||
name: z.string().optional(), | ||
image: z.lazy(() => imageSchema).optional(), | ||
backgroundImage: z.lazy(() => imageSchema).optional(), | ||
description: z.string().optional(), | ||
linktree: z.lazy(() => linktreeSchema).optional(), | ||
plPublicGoodReason: z.string().optional(), | ||
plCategories: z | ||
.string() | ||
.describe("JSON-stringified array of category strings") | ||
.optional(), | ||
plGithubRepos: z | ||
.string() | ||
.describe("JSON-stringified array of URLs") | ||
.optional(), | ||
plSmartContracts: z | ||
.string() | ||
.describe( | ||
"JSON-stringified object with chain names as keys that map to nested objects of contract addresses", | ||
) | ||
.optional(), | ||
plFundingSources: z | ||
.string() | ||
.describe("JSON-stringified array of funding source objects") | ||
.optional(), | ||
plTeam: z | ||
.string() | ||
.describe("JSON-stringified array of team member account ID strings") | ||
.optional(), | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { z } from "zod"; | ||
|
||
export const nftSchema = z.object({ | ||
media: z.string().url().optional(), | ||
baseUri: z.string().url().optional(), | ||
tokenId: z.string().optional(), | ||
contractId: z.string().optional(), | ||
}); |