Skip to content

Commit

Permalink
Merge pull request #59 from aura-nw/dev
Browse files Browse the repository at this point in the history
Merge request
  • Loading branch information
duck59uet authored Mar 21, 2022
2 parents 8cf142f + 9b7953a commit 0e86222
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/aura-nw/multisig-api/issues)

[![codecov](https://img.shields.io/codecov/c/gh/aura-nw/multisig-api/dev?style=flat-square&token=FNWOTPBIRX)](https://codecov.io/gh/aura-nw/multisig-api)
[![Known Vulnerabilities](https://snyk.io/test/github/aura-nw/multisig-api/badge.svg)](https://snyk.io/test/github/aura-nw/multisig-api/)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=aura-nw_multisig-api&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=aura-nw_multisig-api)
[![Maintainability](https://api.codeclimate.com/v1/badges/670351cb6c558dc7d9c2/maintainability)](https://codeclimate.com/github/aura-nw/multisig-api/maintainability)

# Overview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { ApiProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';

export class ConfirmMultisigWalletRequest {
@IsString()
@ApiProperty()
myAddress: string;

@IsString()
@ApiProperty()
myPubkey: string;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';

export class ConnectMultisigWalletRequest {
@IsString()
@ApiProperty()
owner_address: string;

@IsString()
@ApiProperty()
chainId: string;

@IsString()
@ApiProperty()
safe_address: string;
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsString } from 'class-validator';

export class CreateMultisigWalletRequest {
@IsString()
@ApiProperty()
creatorAddress: string;

@IsString()
@ApiProperty()
creatorPubkey: string;

@IsString()
@ApiProperty({ type: [String] })
otherOwnersAddress: string[];

@IsNumber()
@ApiProperty()
threshold: number;

@IsNumber()
@ApiProperty()
internalChainId: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ApiProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';

export class DeleteMultisigWalletRequest {
@IsString()
@ApiProperty()
myAddress: string;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty } from 'class-validator';
import { IsNotEmpty, IsNumber } from 'class-validator';

export class GetSafesByOwnerAddressQuery {
@IsNumber()
@ApiProperty()
internalChainId: number;
}
Expand Down
6 changes: 6 additions & 0 deletions src/dtos/requests/transaction/confirm-transaction.request.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsString } from 'class-validator';

export class ConfirmTransactionRequest {
@IsString()
@ApiProperty({
description: 'Owner address',
example: 'aura1l5k37zpxp3ukty282kn6r7kf8rqh7cve0ggq2w'
})
fromAddress: string;

@IsNumber()
@ApiProperty({
description: 'Offchain Transaction Id',
example: 14
})
transactionId: number;

@IsString()
@ApiProperty({
description: 'Owner sign transaction via wallet then get bodyBytes',
example: 'CosBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmsKK2F1cmExNnVyaHBuM3hqY2phMGZydjc1MHR5M3c2MnFkOHNraHQ3ZTN0bGgSK2F1cmExbDVrMzd6cHhwM3VrdHkyODJrbjZyN2tmOHJxaDdjdmUwZ2dxMncaDwoFdWF1cmESBjEwMDAwMBIWVXNlIHlvdXIgdG9rZW5zIHdpc2VseQ=='
})
bodyBytes: string;

@IsString()
@ApiProperty({
description: 'Owner sign transaction via wallet then get transaction',
example: 'd20oaWycg+cT7kWAK/rhoM8zBzHbPhAr4J3ZoTbnLyIXNB4tHuVqrBRae5Qs2mh3FAezZHx2WE1/auQYudZQyw=='
})
signature: string;

@IsNumber()
@ApiProperty({
description: 'Offline Chain Id',
example: 4
Expand Down
12 changes: 12 additions & 0 deletions src/dtos/requests/transaction/create-transaction.request.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,66 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';

export class CreateTransactionRequest {
@IsString()
@IsNotEmpty()
@ApiProperty({
description: 'Address of safe',
example: 'aura1328x7tacz28w96zl4j50qnfg4gqjdd56wqd3ke'
})
from: string;

@IsString()
@IsNotEmpty()
@ApiProperty({
description: 'Address of receiver',
example: 'aura136v0nmlv0saryev8wqz89w80edzdu3quzm0ve9'
})
to: string;

@IsNumber()
@ApiProperty({
description: 'Transaction amount',
example: 3000000
})
amount: number;

@IsNumber()
@ApiProperty({
description: 'Transaction fee',
example: 0.01
})
fee: number;

@IsNumber()
@ApiProperty({
description: 'Transaction gas limit',
example: 100000
})
gasLimit: number;

@IsNumber()
@ApiProperty({
description: 'Offline Chain Id',
example: 4
})
internalChainId: number;

@IsString()
@ApiProperty({
description: 'Owner who create transaction must sign transaction via wallet first. Then get bodyBytes of result.',
example: 'CogBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmgKK2F1cmExMzJha3g5OTg5Y2FueHV6a2ZqbnJneHd5Y2NmY210ZnpobWZscW0SK2F1cmExdHVlaDRodnJmbmZ3c3VobDMyd21sbWV2NjU2bmhxc2t2cTd0N3QaDAoFdWF1cmESAzIwMBIA'
})
bodyBytes: string;

@IsString()
@ApiProperty({
description: 'Owner who create transaction must sign transaction via wallet first. Then get signature of result.',
example: 'Dj8pEXMADBGCjaRSAQwT1/7s+6fRrf985UZL2ujo0YMe+M2VEqYLERkc5tsrg8HAWuqzKVq5CV6a7KcOSgjNtw=='
})
signature: string;

@IsString()
@ApiProperty({
description: 'Address of owner who create transaction',
example: 'aura13t8ej6yvje8n9zl7hcvj8ks24tp5qvdsgfhnjx'
Expand Down
5 changes: 5 additions & 0 deletions src/dtos/requests/transaction/get-all-transactions.request.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import { ApiProperty } from "@nestjs/swagger";
import { IsBoolean, IsNumber, IsString } from "class-validator";

export class GetAllTransactionsRequest {
@IsString()
@ApiProperty({
example: 'aura16urhpn3xjcja0frv750ty3w62qd8skht7e3tlh'
})
safeAddress: string;

@IsBoolean()
@ApiProperty({
example: true
})
isHistory: boolean;

@IsNumber()
@ApiProperty({
example: 10
})
pageSize: number;

@IsNumber()
@ApiProperty({
example: 1
})
Expand Down
4 changes: 4 additions & 0 deletions src/dtos/requests/transaction/reject-transaction.request.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsString } from 'class-validator';

export class RejectTransactionRequest {
@IsString()
@ApiProperty({
description: 'Owner Address',
example: 'aura1l5k37zpxp3ukty282kn6r7kf8rqh7cve0ggq2w'
})
fromAddress: string;

@IsNumber()
@ApiProperty({
description: 'Offchain Transaction Id',
example: 14
})
transactionId: number;

@IsNumber()
@ApiProperty({
description: 'Offchain Chain Id',
example: 4
Expand Down
4 changes: 4 additions & 0 deletions src/dtos/requests/transaction/send-transaction.request.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsString } from 'class-validator';

export class SendTransactionRequest {
@IsNumber()
@ApiProperty({
description: 'Offchain Transaction Id',
example: 14
})
transactionId: number;

@IsNumber()
@ApiProperty({
description: 'Offchain Chain Id',
example: 4
})
internalChainId: number;

@IsString()
@ApiProperty({
description: 'Owner who broadcast transaction',
example: 'aura1l5k37zpxp3ukty282kn6r7kf8rqh7cve0ggq2w'
Expand Down
5 changes: 5 additions & 0 deletions src/dtos/responses/general/get-account-onchain.response.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { Pubkey } from "@cosmjs/amino";
import { ApiProperty } from "@nestjs/swagger";
import { IsNumber, IsString } from "class-validator";

export class GetAccountOnchainResponse {
@IsString()
@ApiProperty({
example: 'aura1r2gv6rx0fxdmepu8gd2gmn5j8cjetkqrw836x5'
})
address: string;

@IsString()
@ApiProperty({
example: {
type: 'tendermint/PubKeyMultisigThreshold',
Expand All @@ -23,11 +26,13 @@ export class GetAccountOnchainResponse {
})
pubkey: Pubkey;

@IsNumber()
@ApiProperty({
example: 39
})
accountNumber: number;

@IsNumber()
@ApiProperty({
example: 13
})
Expand Down
8 changes: 8 additions & 0 deletions src/dtos/responses/general/network-list.response.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
import { ApiProperty } from "@nestjs/swagger";
import { IsNumber, IsString } from "class-validator";

export class NetworkListResponse {
@IsNumber()
@ApiProperty({
example: 13
})
id: number;

@IsString()
@ApiProperty({
example: 'Aura Testnet'
})
name: string;

@IsString()
@ApiProperty({
example: 'https://rpc-testnet.aura.network'
})
rest: string;

@IsString()
@ApiProperty({
example: 'https://tendermint-testnet.aura.network'
})
rpc: string;

@IsString()
@ApiProperty({
example: 'aura-testnet'
})
chainId: string;

@IsString()
@ApiProperty({
example: 'uaura'
})
denom: string;

@IsString()
@ApiProperty({
example: 'aura'
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
import { ApiProperty } from "@nestjs/swagger";
import { IsDate, IsNumber, IsString } from "class-validator";

export class MultisigSignatureResponse {
@IsNumber()
@ApiProperty({
example: 1
})
id: number;

@IsDate()
@ApiProperty({
example: '2022-02-24T09:44:52.935Z'
})
createdAt: Date;

@IsDate()
@ApiProperty({
example: '2022-02-24T09:44:52.935Z'
})
updatedAt: Date;

@IsString()
@ApiProperty({
example: 'aura15f6wn3nymdnhnh5ddlqletuptjag09tryrtpq5'
})
ownerAddress: string;

@IsString()
@ApiProperty({
example: 'IIo33eqegxuCl/Nx9p0Bfhlvz1y+Qr1ZVeJHQVRX2e4EW0sotraMTUyEAb3pNbQ8cgkiwIimFf73yUapGoLnmw=='
})
signature: string;

@IsString()
@ApiProperty({
example: 'CONFIRM'
})
Expand Down
Loading

0 comments on commit 0e86222

Please sign in to comment.