Skip to content

Commit

Permalink
hackathon merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubcolony committed Jun 26, 2024
2 parents a43d4b0 + 8bf349b commit ad4dcc4
Show file tree
Hide file tree
Showing 182 changed files with 14,490 additions and 528 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ PINATA_API_SECRET=

# Needed for currency conversion. For testing, see: https://support.coingecko.com/hc/en-us/articles/21880397454233
COINGECKO_API_KEY=
COINGECKO_API_URL=
POSTHOG_KEY=
POSTHOG_HOST=

# Needed for crypto-to-fiat
USDC_LOCAL_ADDRESS=
4 changes: 4 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ GOOGLE_TAG_MANAGER_ID=
PINATA_API_KEY=
PINATA_API_SECRET=
COINGECKO_API_KEY=
COINGECKO_API_URL="http://localhost:3007/coingecko/"
POSTHOG_KEY=
POSTHOG_HOST=
USDC_LOCAL_ADDRESS='0xC83649CC2f5488E95989Ec6d4CEc98A74793E2a7'
156 changes: 156 additions & 0 deletions amplify/backend/api/colonycdapp/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,105 @@ input GetSafeTransactionStatusInput {
chainId: String!
}

input BridgeXYZQueryInput {
path: String!
}

input BridgeXYZMutationAddressInput {
street_line_1: String!
street_line_2: String
city: String!
state: String
postcode: String
country: String!
}

input BridgeXYZMutationIbanInput {
account_number: String!
bic: String!
country: String!
}

input BridgeXYZMutationAccountInput {
account_number: String!
routing_number: String!
}

input BridgeXYZMutationBodyInput {
#
# KYC Links
#
full_name: String
email: String

#
# Put Customer
#
first_name: String
last_name: String
# email: String
address: BridgeXYZMutationAddressInput
birth_date: String
tax_identification_number: String
signed_agreement_id: String
currency: String
bank_name: String
iban: BridgeXYZMutationIbanInput
account: BridgeXYZMutationAccountInput
}

input BridgeXYZMutationInput {
path: String!
body: BridgeXYZMutationBodyInput!
}

type BridgeXYZIbanBankAccount {
last4: String!
bic: String!
country: String!
}

type BridgeXYZUSBankAccount {
last4: String!
routingNumber: String!
}

type BridgeXYZBankAccount {
id: String!
currency: String!
bankName: String!
iban: BridgeXYZIbanBankAccount
usAccount: BridgeXYZUSBankAccount
}

type BridgeXYZMutationReturn {
#
# KYC Links
#
tos_link: String
kyc_link: String

#
# KYC Status
#
kyc_status: String
country: String
# Should support multiple accounts at some point
bankAccount: BridgeXYZBankAccount

success: Boolean
}

type BridgeXYZDrain {
id: String
}

type BridgeXYZQueryReturn {
drains: BridgeXYZDrain
success: Boolean
transactionFee: String
}

"""
Return type for tokens gotten from DB or from chain
"""
Expand Down Expand Up @@ -792,27 +891,32 @@ type Query {
getTokenFromEverywhere(
input: TokenFromEverywhereArguments
): TokenFromEverywhereReturn @function(name: "fetchTokenFromChain-${env}")

"""
Retrieve a user's reputation within a specific domain in a Colony
"""
getUserReputation(input: GetUserReputationInput): String
@function(name: "getUserReputation-${env}")

"""
Retrieve a user's token balance for a specific token
"""
getUserTokenBalance(
input: GetUserTokenBalanceInput
): GetUserTokenBalanceReturn @function(name: "getUserTokenBalance-${env}")

"""
Get the state of a motion (i.e. the current period)
"""
getMotionState(input: GetMotionStateInput): Int!
@function(name: "fetchMotionState-${env}")

"""
Get the voting reward for a user and a motion
"""
getVoterRewards(input: GetVoterRewardsInput): VoterRewardsReturn
@function(name: "fetchVoterRewards-${env}")

"""
Get the timeout for the current period of a motion
"""
Expand All @@ -823,6 +927,12 @@ type Query {

getSafeTransactionStatus(input: GetSafeTransactionStatusInput): [String!]
@function(name: "getSafeTransactionStatus-${env}")

"""
Fetch from the Bridge XYZ API
"""
bridgeXYZQuery(input: BridgeXYZQueryInput!): BridgeXYZQueryReturn
@function(name: "bridgeXYZQuery-${env}")
}

"""
Expand Down Expand Up @@ -853,6 +963,11 @@ type Mutation {
"""
validateUserInvite(input: ValidateUserInviteInput!): Boolean
@function(name: "validateUserInvite-${env}")
"""
Post to the Bridge XYZ API
"""
bridgeXYZMutation(input: BridgeXYZMutationInput!): BridgeXYZMutationReturn
@function(name: "bridgeXYZMutation-${env}")
}

"""
Expand Down Expand Up @@ -926,6 +1041,10 @@ type Profile @model {
A user's prefered currency, for conversion purposes
"""
preferredCurrency: SupportedCurrencies
"""
Is automatic offramp enabled
"""
isAutoOfframpEnabled: Boolean
}

"""
Expand Down Expand Up @@ -1722,6 +1841,43 @@ type User @model {
A user who has been invited by colony will be able to pass on the private beta invite
"""
privateBetaInviteCode: PrivateBetaInviteCode @hasOne
"""
Bridge customer id
"""
bridgeCustomerId: String
liquidationAddresses: [LiquidationAddress!]
@hasMany(indexName: "byUserAddress", fields: ["id"])
}

type LiquidationAddress @model {
"""
Unique identifier for the liquidation address entry
"""
id: ID!
"""
The chain id the colony is on
"""
chainId: Int!
"""
The user address associated
"""
userAddress: ID!
@index(
name: "byUserAddress"
queryField: "getLiquidationAddressesByUserAddress"
)
"""
The user associated
"""
user: User @hasOne(fields: ["userAddress"])
"""
The liquidation address
"""
liquidationAddress: ID!
@index(
name: "byLiquidationAddress"
queryField: "getUserByLiquidationAddress"
)
}

"""
Expand Down
10 changes: 10 additions & 0 deletions amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
}
},
"function": {
"bridgeXYZMutation": {
"build": true,
"providerPlugin": "awscloudformation",
"service": "Lambda"
},
"bridgeXYZQuery": {
"build": true,
"providerPlugin": "awscloudformation",
"service": "Lambda"
},
"colonycdappSSMAccess": {
"build": true,
"providerPlugin": "awscloudformation",
Expand Down
6 changes: 6 additions & 0 deletions amplify/backend/function/bridgeXYZMutation/amplify.state
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pluginId": "amplify-nodejs-function-runtime-provider",
"functionRuntime": "nodejs",
"useLegacyBuild": true,
"defaultEditorFile": "src/index.js"
}
Loading

0 comments on commit ad4dcc4

Please sign in to comment.