Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Erc1155 NFT for ETH CELO and BSC #60

Merged
merged 5 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
616 changes: 616 additions & 0 deletions src/contracts/erc1155/erc1155_abi.ts

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/contracts/erc1155/erc1155_bytecode.ts

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions src/model/request/BurnMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { IsIn, IsInt, IsNotEmpty, IsOptional, Length, MaxLength, Min, } from 'class-validator';
import { Currency } from './Currency';
import { PrivateKeyOrSignatureId } from './PrivateKeyOrSignatureId';

export class BurnMultiToken extends PrivateKeyOrSignatureId {

@IsNotEmpty()
@Length(42, 42)
public account: string;

@IsNotEmpty()
@MaxLength(256)
public tokenId: string;

@IsNotEmpty()
public amount: string;

@IsNotEmpty()
@Length(42, 42)
public contractAddress: string;

@IsNotEmpty()
@IsIn([Currency.BSC, Currency.ETH, Currency.CELO])
public chain: Currency;

@Min(0)
@IsInt()
@IsOptional()
public nonce?: number;

}
30 changes: 30 additions & 0 deletions src/model/request/BurnMultiTokenBatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { IsIn, IsInt, IsNotEmpty, IsOptional, Length, MaxLength, Min, } from 'class-validator';
import { Currency } from './Currency';
import { PrivateKeyOrSignatureId } from './PrivateKeyOrSignatureId';

export class BurnMultiTokenBatch extends PrivateKeyOrSignatureId {

@IsNotEmpty()
@Length(42, 42)
public account: string;

@IsNotEmpty()
public tokenId: string[];

@IsNotEmpty()
public amounts: string[];

@IsNotEmpty()
@Length(42, 42)
public contractAddress: string;

@IsNotEmpty()
@IsIn([Currency.BSC, Currency.ETH, Currency.CELO])
public chain: Currency;

@Min(0)
@IsInt()
@IsOptional()
public nonce?: number;

}
9 changes: 9 additions & 0 deletions src/model/request/CeloBurnMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {IsIn, IsNotEmpty,} from 'class-validator';
import {Currency} from './Currency';
import { BurnMultiToken } from './BurnMultiToken';

export class CeloBurnMultiToken extends BurnMultiToken {
@IsNotEmpty()
@IsIn([Currency.CELO, Currency.CUSD, Currency.CEUR])
public feeCurrency: Currency;
}
9 changes: 9 additions & 0 deletions src/model/request/CeloBurnMultiTokenBatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { IsIn, IsNotEmpty, } from 'class-validator';
import { Currency } from './Currency';
import { BurnMultiTokenBatch } from './BurnMultiTokenBatch';

export class CeloBurnMultiTokenBatch extends BurnMultiTokenBatch {
@IsNotEmpty()
@IsIn([Currency.CELO, Currency.CUSD, Currency.CEUR])
public feeCurrency: Currency;
}
9 changes: 9 additions & 0 deletions src/model/request/CeloDeployMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {IsIn, IsNotEmpty} from 'class-validator';
import {Currency} from './Currency';
import { DeployMultiToken } from './DeployMultiToken';

export class CeloDeployMultiToken extends DeployMultiToken {
@IsNotEmpty()
@IsIn([Currency.CELO, Currency.CUSD, Currency.CEUR])
public feeCurrency: Currency;
}
13 changes: 13 additions & 0 deletions src/model/request/CeloMintMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {
IsIn,
IsNotEmpty,
} from 'class-validator';
import { Currency } from './Currency';
import { MintMultiToken } from './MintMultiToken';

export class CeloMintMultiToken extends MintMultiToken {

@IsNotEmpty()
@IsIn([Currency.CELO, Currency.CUSD, Currency.CEUR])
public feeCurrency: Currency;
}
10 changes: 10 additions & 0 deletions src/model/request/CeloMintMultiTokenBatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {IsIn, IsNotEmpty} from 'class-validator';
import {Currency} from './Currency';
import {MintMultiTokenBatch} from './MintMultiTokenBatch';

export class CeloMintMultiTokenBatch extends MintMultiTokenBatch {

@IsNotEmpty()
@IsIn([Currency.CELO, Currency.CUSD, Currency.CEUR])
public feeCurrency: Currency;
}
9 changes: 9 additions & 0 deletions src/model/request/CeloTransferMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {IsIn, IsNotEmpty,} from 'class-validator';
import {Currency} from './Currency';
import { TransferMultiToken } from './TransferMultiToken';

export class CeloTransferMultiToken extends TransferMultiToken {
@IsNotEmpty()
@IsIn([Currency.CELO, Currency.CUSD, Currency.CEUR])
public feeCurrency: Currency;
}
9 changes: 9 additions & 0 deletions src/model/request/CeloTransferMultiTokenBatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { IsIn, IsNotEmpty, } from 'class-validator';
import { Currency } from './Currency';
import { TransferMultiTokenBatch } from './TransferMultiTokenBatch';

export class CeloTransferMultiTokenBatch extends TransferMultiTokenBatch {
@IsNotEmpty()
@IsIn([Currency.CELO, Currency.CUSD, Currency.CEUR])
public feeCurrency: Currency;
}
17 changes: 17 additions & 0 deletions src/model/request/DeployMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {IsIn, IsNotEmpty, IsOptional, Length, Min} from 'class-validator';
import {Currency} from './Currency';
import {PrivateKeyOrSignatureId} from './PrivateKeyOrSignatureId';

export class DeployMultiToken extends PrivateKeyOrSignatureId {

@IsNotEmpty()
public uri: string;

@IsNotEmpty()
@IsIn([Currency.BSC, Currency.ETH, Currency.CELO])
public chain: Currency;

@Min(0)
@IsOptional()
public nonce?: number;
}
14 changes: 14 additions & 0 deletions src/model/request/EthBurnMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Type } from 'class-transformer'
import {
IsOptional,
ValidateNested,
} from 'class-validator';
import { Fee } from './Fee'
import { BurnMultiToken } from './BurnMultiToken';

export class EthBurnMultiToken extends BurnMultiToken {
@IsOptional()
@Type(() => Fee)
@ValidateNested()
public fee?: Fee;
}
14 changes: 14 additions & 0 deletions src/model/request/EthBurnMultiTokenBatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Type } from 'class-transformer'
import {
IsOptional,
ValidateNested,
} from 'class-validator';
import { Fee } from './Fee'
import { BurnMultiTokenBatch } from './BurnMultiTokenBatch';

export class EthBurnMultiTokenBatch extends BurnMultiTokenBatch{
@IsOptional()
@Type(() => Fee)
@ValidateNested()
public fee?: Fee;
}
11 changes: 11 additions & 0 deletions src/model/request/EthDeployMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Type } from 'class-transformer'
import { IsOptional, ValidateNested } from 'class-validator';
import { DeployMultiToken } from './DeployMultiToken'
import { Fee } from './Fee'

export class EthDeployMultiToken extends DeployMultiToken {
@IsOptional()
@Type(() => Fee)
@ValidateNested()
public fee?: Fee;
}
44 changes: 44 additions & 0 deletions src/model/request/MintMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Type } from 'class-transformer'
import { IsIn, IsNotEmpty, IsOptional, Length, MaxLength, Min, ValidateIf, ValidateNested} from 'class-validator';
import { Currency } from './Currency';
import { PrivateKeyOrSignatureId } from './PrivateKeyOrSignatureId';
import { Fee } from './Fee'

export class MintMultiToken extends PrivateKeyOrSignatureId {

@IsNotEmpty()
@Length(42, 42)
public to: string;

@IsNotEmpty()
@MaxLength(256)
public tokenId: string;

@IsNotEmpty()
@IsIn([Currency.BSC, Currency.ETH, Currency.CELO])
public chain: Currency;

@IsNotEmpty()
@Length(42, 42)
public contractAddress: string;

@Min(0)
@IsOptional()
public nonce?: number;

@IsNotEmpty()
public data: string;

@IsNotEmpty()
public amount: string;

public authorAddresses?: string[];

public cashbackValues?: string[];

@IsOptional()
@Type(() => Fee)
@ValidateNested()
public fee?: Fee;

}
41 changes: 41 additions & 0 deletions src/model/request/MintMultiTokenBatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Type } from 'class-transformer'
import { Fee } from './Fee'
import {IsIn, IsNotEmpty, IsOptional, Length, Min, ValidateNested} from 'class-validator';
import {Currency} from './Currency';
import {PrivateKeyOrSignatureId} from './PrivateKeyOrSignatureId';

export class MintMultiTokenBatch extends PrivateKeyOrSignatureId {

@IsNotEmpty()
public to: string[];

@IsNotEmpty()
public tokenId: string[][];

@IsNotEmpty()
@IsIn([Currency.BSC, Currency.ETH, Currency.CELO])
public chain: Currency;

@IsNotEmpty()
@Length(42, 42)
public contractAddress: string;

@Min(0)
@IsOptional()
public nonce?: number;

@IsNotEmpty()
public amounts: string[][];

@IsNotEmpty()
public data: string;

public authorAddresses?: string[][][];

public cashbackValues?: string[][][];

@IsOptional()
@Type(() => Fee)
@ValidateNested()
public fee?: Fee;
}
43 changes: 43 additions & 0 deletions src/model/request/TransferMultiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import {IsIn, IsNotEmpty, IsNumberString, IsOptional, Length, MaxLength, Min, ValidateNested} from 'class-validator';
import {Currency} from './Currency';
import {PrivateKeyOrSignatureId} from './PrivateKeyOrSignatureId';
import { Fee } from './Fee'
import { Type } from 'class-transformer'

export class TransferMultiToken extends PrivateKeyOrSignatureId {

@IsNotEmpty()
@Length(42, 42)
public to: string;

@IsNotEmpty()
@MaxLength(256)
public tokenId: string;

@IsNotEmpty()
@Length(42, 42)
public contractAddress: string;

@IsNotEmpty()
@IsIn([Currency.BSC, Currency.ETH, Currency.CELO])
public chain: Currency;

@IsNotEmpty()
public amount: string;

@IsNotEmpty()
public data: string;

@Min(0)
@IsOptional()
public nonce?: number;

@IsOptional()
@IsNumberString()
public value?: string;

@IsOptional()
@Type(() => Fee)
@ValidateNested()
public fee?: Fee;
}
42 changes: 42 additions & 0 deletions src/model/request/TransferMultiTokenBatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { IsIn, IsNotEmpty, IsNumberString, IsOptional, Length, MaxLength, Min, ValidateNested } from 'class-validator';
import { Currency } from './Currency';
import { PrivateKeyOrSignatureId } from './PrivateKeyOrSignatureId';
import { Fee } from './Fee'
import { Type } from 'class-transformer'

export class TransferMultiTokenBatch extends PrivateKeyOrSignatureId {

@IsNotEmpty()
@Length(42, 42)
public to: string;

@IsNotEmpty()
public tokenId: string[];

@IsNotEmpty()
@Length(42, 42)
public contractAddress: string;

@IsNotEmpty()
@IsIn([Currency.BSC, Currency.ETH, Currency.CELO])
public chain: Currency;

@IsNotEmpty()
public amounts: string[];

@IsNotEmpty()
public data: string;

@Min(0)
@IsOptional()
public nonce?: number;

@IsOptional()
@IsNumberString()
public value?: string;

@IsOptional()
@Type(() => Fee)
@ValidateNested()
public fee?: Fee;
}
13 changes: 13 additions & 0 deletions src/model/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,16 @@ export * from './PrepareEthErc20SignedOffchainTransaction'
export * from './PrepareEthSignedOffchainTransaction'
export * from './TransferAda';
export * from './AdaUTxo';
export * from './TransferMultiTokenBatch';
export * from './MintMultiToken';
export * from './MintMultiTokenBatch';
export * from './TransferMultiToken';
export * from './CeloMintMultiToken';
export * from './CeloMintMultiTokenBatch';
export * from './CeloTransferMultiToken';
export * from './CeloTransferMultiTokenBatch';
export * from './EthBurnMultiToken';
export * from './EthBurnMultiTokenBatch';
export * from './CeloBurnMultiToken';
export * from './CeloBurnMultiTokenBatch';
export * from './CeloDeployMultiToken';
Loading