Skip to content

Instantly share code, notes, and snippets.

@kyranjamie
Created April 21, 2020 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyranjamie/1730753b175db486f51bcc3696b257fd to your computer and use it in GitHub Desktop.
Save kyranjamie/1730753b175db486f51bcc3696b257fd to your computer and use it in GitHub Desktop.
generated post conditions
export interface PostConditionFungible {
principal:
| {
typeId: 1;
}
| {
typeId: 2;
/**
* Raw data is stored in instances of the Buffer class.
* A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
* Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
*/
address: {
version: number;
bytes: number[];
};
}
| {
typeId: 3;
/**
* Raw data is stored in instances of the Buffer class.
* A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
* Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
*/
address: {
version: number;
bytes: number[];
};
contractName: string;
};
conditionCode: 1 | 2 | 3 | 4 | 5;
amount: string;
assetInfoId: 1;
}
export interface PostConditionNonFungible {
principal:
| {
typeId: 1;
}
| {
typeId: 2;
/**
* Raw data is stored in instances of the Buffer class.
* A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
* Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
*/
address: {
version: number;
bytes: number[];
};
}
| {
typeId: 3;
/**
* Raw data is stored in instances of the Buffer class.
* A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
* Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
*/
address: {
version: number;
bytes: number[];
};
contractName: string;
};
/**
* 10 = Sent, 11 = NotSent
*/
conditionCode: 10 | 11;
amount: string;
assetInfoId: 2;
assetValue: number;
asset: {
assetName: string;
contractAddress: string;
contractName: string;
};
}
export interface PostConditionStx {
principal:
| {
typeId: 1;
}
| {
typeId: 2;
/**
* Raw data is stored in instances of the Buffer class.
* A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
* Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
*/
address: {
version: number;
bytes: number[];
};
}
| {
typeId: 3;
/**
* Raw data is stored in instances of the Buffer class.
* A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
* Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
*/
address: {
version: number;
bytes: number[];
};
contractName: string;
};
conditionCode: 1 | 2 | 3 | 4 | 5;
amount: string;
assetInfoId: 0;
}
export type PostCondition = PostConditionStx | PostConditionFungible | PostConditionNonFungible;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment